RTEMS-6
Annotated Report
libdosfs
Sun Feb 28 12:28:39 2021
4000cf64 <_fat_block_read>:
uint32_t start,
uint32_t offset,
uint32_t count,
void *buff
)
{
4000cf64: fd010113 addi sp,sp,-48
4000cf68: 02112623 sw ra,44(sp)
4000cf6c: 02812423 sw s0,40(sp)
4000cf70: 02912223 sw s1,36(sp)
4000cf74: 03212023 sw s2,32(sp)
4000cf78: 01312e23 sw s3,28(sp)
4000cf7c: 01412c23 sw s4,24(sp)
4000cf80: 01512a23 sw s5,20(sp)
4000cf84: 01612823 sw s6,16(sp)
4000cf88: 01712623 sw s7,12(sp)
4000cf8c: 01812423 sw s8,8(sp)
4000cf90: 01912223 sw s9,4(sp)
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
4000cf94: 0e068463 beqz a3,4000d07c <_fat_block_read+0x118> <== NEVER TAKEN
4000cf98: 00068b93 mv s7,a3
4000cf9c: 00050413 mv s0,a0
4000cfa0: 00058913 mv s2,a1
4000cfa4: 00060c13 mv s8,a2
4000cfa8: 00070a13 mv s4,a4
ssize_t cmpltd = 0;
4000cfac: 00000993 li s3,0
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
4000cfb0: 0a050a93 addi s5,a0,160
fs_info->c.modified = 0;
4000cfb4: 10000b13 li s6,256
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000cfb8: 00244483 lbu s1,2(s0)
4000cfbc: 01444783 lbu a5,20(s0)
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
4000cfc0: 09d44703 lbu a4,157(s0)
4000cfc4: 00040513 mv a0,s0
4000cfc8: 409787b3 sub a5,a5,s1
4000cfcc: 00f95cb3 srl s9,s2,a5
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000cfd0: 00fc97b3 sll a5,s9,a5
((sector -
4000cfd4: 40f907b3 sub a5,s2,a5
<< fs_info->vol.sec_log2);
4000cfd8: 009794b3 sll s1,a5,s1
4000cfdc: 00070863 beqz a4,4000cfec <_fat_block_read+0x88>
4000cfe0: 09842783 lw a5,152(s0)
4000cfe4: 03278263 beq a5,s2,4000d008 <_fat_block_read+0xa4>
4000cfe8: cf1ff0ef jal ra,4000ccd8 <fat_buf_release.part.0>
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
4000cfec: 06c42503 lw a0,108(s0)
4000cff0: 000a8613 mv a2,s5
4000cff4: 000c8593 mv a1,s9
4000cff8: 315080ef jal ra,40015b0c <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL)
4000cffc: 08051463 bnez a0,4000d084 <_fat_block_read+0x120> <== NEVER TAKEN
fs_info->c.blk_num = sec_num;
4000d000: 09242c23 sw s2,152(s0)
fs_info->c.modified = 0;
4000d004: 09641e23 sh s6,156(s0)
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return -1;
c = MIN(count, (fs_info->vol.bps - ofs));
4000d008: 00045603 lhu a2,0(s0)
memcpy((buff + cmpltd), (sec_buf + ofs), c);
4000d00c: 018484b3 add s1,s1,s8
4000d010: 013a0533 add a0,s4,s3
c = MIN(count, (fs_info->vol.bps - ofs));
4000d014: 41860633 sub a2,a2,s8
4000d018: 00cbf463 bgeu s7,a2,4000d020 <_fat_block_read+0xbc>
4000d01c: 000b8613 mv a2,s7
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
4000d020: 0a042703 lw a4,160(s0)
count -= c;
4000d024: 40cb8bb3 sub s7,s7,a2
cmpltd += c;
4000d028: 00c989b3 add s3,s3,a2
memcpy((buff + cmpltd), (sec_buf + ofs), c);
4000d02c: 01c72583 lw a1,28(a4)
sec_num++;
4000d030: 00190913 addi s2,s2,1
ofs = 0;
4000d034: 00000c13 li s8,0
memcpy((buff + cmpltd), (sec_buf + ofs), c);
4000d038: 009585b3 add a1,a1,s1
4000d03c: 00d0e0ef jal ra,4001b848 <memcpy>
while (count > 0)
4000d040: f60b9ce3 bnez s7,4000cfb8 <_fat_block_read+0x54>
}
return cmpltd;
}
4000d044: 02c12083 lw ra,44(sp)
4000d048: 02812403 lw s0,40(sp)
4000d04c: 02412483 lw s1,36(sp)
4000d050: 02012903 lw s2,32(sp)
4000d054: 01812a03 lw s4,24(sp)
4000d058: 01412a83 lw s5,20(sp)
4000d05c: 01012b03 lw s6,16(sp)
4000d060: 00c12b83 lw s7,12(sp)
4000d064: 00812c03 lw s8,8(sp)
4000d068: 00412c83 lw s9,4(sp)
4000d06c: 00098513 mv a0,s3
4000d070: 01c12983 lw s3,28(sp)
4000d074: 03010113 addi sp,sp,48
4000d078: 00008067 ret
ssize_t cmpltd = 0;
4000d07c: 00000993 li s3,0 <== NOT EXECUTED
4000d080: fc5ff06f j 4000d044 <_fat_block_read+0xe0> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
4000d084: 6d50d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000d088: 00500793 li a5,5 <== NOT EXECUTED
4000d08c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return -1;
4000d090: fff00993 li s3,-1 <== NOT EXECUTED
4000d094: fb1ff06f j 4000d044 <_fat_block_read+0xe0> <== NOT EXECUTED
4000ce74 <fat_buf_access>:
{
4000ce74: fe010113 addi sp,sp,-32
4000ce78: 00812c23 sw s0,24(sp)
4000ce7c: 01212823 sw s2,16(sp)
4000ce80: 01312623 sw s3,12(sp)
4000ce84: 01412423 sw s4,8(sp)
4000ce88: 01512223 sw s5,4(sp)
4000ce8c: 00112e23 sw ra,28(sp)
4000ce90: 00912a23 sw s1,20(sp)
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000ce94: 00254483 lbu s1,2(a0)
4000ce98: 01454783 lbu a5,20(a0)
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
4000ce9c: 09d54703 lbu a4,157(a0)
{
4000cea0: 00050413 mv s0,a0
4000cea4: 409787b3 sub a5,a5,s1
4000cea8: 00f5dab3 srl s5,a1,a5
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000ceac: 00fa97b3 sll a5,s5,a5
((sector -
4000ceb0: 40f587b3 sub a5,a1,a5
4000ceb4: 00058913 mv s2,a1
4000ceb8: 00060a13 mv s4,a2
4000cebc: 00068993 mv s3,a3
<< fs_info->vol.sec_log2);
4000cec0: 009794b3 sll s1,a5,s1
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
4000cec4: 00070863 beqz a4,4000ced4 <fat_buf_access+0x60>
4000cec8: 09852783 lw a5,152(a0)
4000cecc: 02b78863 beq a5,a1,4000cefc <fat_buf_access+0x88>
if (fs_info->c.state == FAT_CACHE_EMPTY)
4000ced0: e09ff0ef jal ra,4000ccd8 <fat_buf_release.part.0>
if (op_type == FAT_OP_TYPE_READ)
4000ced4: 00100793 li a5,1
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
4000ced8: 06c42503 lw a0,108(s0)
4000cedc: 0a040613 addi a2,s0,160
4000cee0: 000a8593 mv a1,s5
if (op_type == FAT_OP_TYPE_READ)
4000cee4: 04fa0863 beq s4,a5,4000cf34 <fat_buf_access+0xc0>
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
4000cee8: 321080ef jal ra,40015a08 <rtems_bdbuf_get>
if (sc != RTEMS_SUCCESSFUL)
4000ceec: 04051863 bnez a0,4000cf3c <fat_buf_access+0xc8> <== NEVER TAKEN
fs_info->c.modified = 0;
4000cef0: 10000793 li a5,256
fs_info->c.blk_num = sec_num;
4000cef4: 09242c23 sw s2,152(s0)
fs_info->c.modified = 0;
4000cef8: 08f41e23 sh a5,156(s0)
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
4000cefc: 0a042783 lw a5,160(s0)
return RC_OK;
4000cf00: 00000513 li a0,0
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
4000cf04: 01c7a783 lw a5,28(a5)
4000cf08: 009787b3 add a5,a5,s1
4000cf0c: 00f9a023 sw a5,0(s3)
}
4000cf10: 01c12083 lw ra,28(sp)
4000cf14: 01812403 lw s0,24(sp)
4000cf18: 01412483 lw s1,20(sp)
4000cf1c: 01012903 lw s2,16(sp)
4000cf20: 00c12983 lw s3,12(sp)
4000cf24: 00812a03 lw s4,8(sp)
4000cf28: 00412a83 lw s5,4(sp)
4000cf2c: 02010113 addi sp,sp,32
4000cf30: 00008067 ret
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
4000cf34: 3d9080ef jal ra,40015b0c <rtems_bdbuf_read>
4000cf38: fb5ff06f j 4000ceec <fat_buf_access+0x78>
rtems_set_errno_and_return_minus_one(EIO);
4000cf3c: 01c0e0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000cf40: 00500793 li a5,5 <== NOT EXECUTED
4000cf44: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000cf48: fff00513 li a0,-1 <== NOT EXECUTED
4000cf4c: fc5ff06f j 4000cf10 <fat_buf_access+0x9c> <== NOT EXECUTED
4000ccd8 <fat_buf_release.part.0>:
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (fs_info->c.state == FAT_CACHE_EMPTY)
return RC_OK;
if (fs_info->c.modified)
4000ccd8: 09c54783 lbu a5,156(a0) <== NOT EXECUTED
fat_buf_release(fat_fs_info_t *fs_info)
4000ccdc: fe010113 addi sp,sp,-32 <== NOT EXECUTED
4000cce0: 00812c23 sw s0,24(sp) <== NOT EXECUTED
4000cce4: 00112e23 sw ra,28(sp) <== NOT EXECUTED
4000cce8: 00912a23 sw s1,20(sp) <== NOT EXECUTED
4000ccec: 01212823 sw s2,16(sp) <== NOT EXECUTED
4000ccf0: 00050413 mv s0,a0 <== NOT EXECUTED
sec_num,
0);
if (sec_of_fat && !fs_info->vol.mirror)
memcpy(fs_info->sec_buf,
fs_info->c.buf->buffer + blk_ofs,
4000ccf4: 0a052503 lw a0,160(a0) <== NOT EXECUTED
if (fs_info->c.modified)
4000ccf8: 0e078c63 beqz a5,4000cdf0 <fat_buf_release.part.0+0x118> <== NOT EXECUTED
uint32_t sec_num = fs_info->c.blk_num;
4000ccfc: 09842783 lw a5,152(s0) <== NOT EXECUTED
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
4000cd00: 02045703 lhu a4,32(s0) <== NOT EXECUTED
4000cd04: 02e7f863 bgeu a5,a4,4000cd34 <fat_buf_release.part.0+0x5c> <== NOT EXECUTED
fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
4000cd08: 100090ef jal ra,40015e08 <rtems_bdbuf_release_modified> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
4000cd0c: 0e051663 bnez a0,4000cdf8 <fat_buf_release.part.0+0x120> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.modified = 0;
4000cd10: 08040e23 sb zero,156(s0) <== NOT EXECUTED
{
sc = rtems_bdbuf_release(fs_info->c.buf);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
}
fs_info->c.state = FAT_CACHE_EMPTY;
4000cd14: 08040ea3 sb zero,157(s0) <== NOT EXECUTED
return RC_OK;
}
4000cd18: 01c12083 lw ra,28(sp) <== NOT EXECUTED
4000cd1c: 01812403 lw s0,24(sp) <== NOT EXECUTED
4000cd20: 01412483 lw s1,20(sp) <== NOT EXECUTED
4000cd24: 01012903 lw s2,16(sp) <== NOT EXECUTED
return RC_OK;
4000cd28: 00000513 li a0,0 <== NOT EXECUTED
}
4000cd2c: 02010113 addi sp,sp,32 <== NOT EXECUTED
4000cd30: 00008067 ret <== NOT EXECUTED
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
4000cd34: 02842703 lw a4,40(s0) <== NOT EXECUTED
4000cd38: fce7f8e3 bgeu a5,a4,4000cd08 <fat_buf_release.part.0+0x30> <== NOT EXECUTED
if (sec_of_fat && !fs_info->vol.mirror)
4000cd3c: 05c44703 lbu a4,92(s0) <== NOT EXECUTED
4000cd40: 0e070463 beqz a4,4000ce28 <fat_buf_release.part.0+0x150> <== NOT EXECUTED
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
4000cd44: 0c4090ef jal ra,40015e08 <rtems_bdbuf_release_modified> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
4000cd48: 0a051863 bnez a0,4000cdf8 <fat_buf_release.part.0+0x120> <== NOT EXECUTED
if (sec_of_fat && !fs_info->vol.mirror)
4000cd4c: 05c44783 lbu a5,92(s0) <== NOT EXECUTED
fs_info->c.modified = 0;
4000cd50: 08040e23 sb zero,156(s0) <== NOT EXECUTED
if (sec_of_fat && !fs_info->vol.mirror)
4000cd54: fc0790e3 bnez a5,4000cd14 <fat_buf_release.part.0+0x3c> <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
4000cd58: 01544783 lbu a5,21(s0) <== NOT EXECUTED
4000cd5c: 00100913 li s2,1 <== NOT EXECUTED
4000cd60: faf97ae3 bgeu s2,a5,4000cd14 <fat_buf_release.part.0+0x3c> <== NOT EXECUTED
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
4000cd64: 02442783 lw a5,36(s0) <== NOT EXECUTED
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000cd68: 00244683 lbu a3,2(s0) <== NOT EXECUTED
4000cd6c: 09842703 lw a4,152(s0) <== NOT EXECUTED
4000cd70: 02f907b3 mul a5,s2,a5 <== NOT EXECUTED
4000cd74: 01444483 lbu s1,20(s0) <== NOT EXECUTED
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
4000cd78: 06c42803 lw a6,108(s0) <== NOT EXECUTED
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
4000cd7c: 00c10613 addi a2,sp,12 <== NOT EXECUTED
4000cd80: 40d484b3 sub s1,s1,a3 <== NOT EXECUTED
4000cd84: 00080513 mv a0,a6 <== NOT EXECUTED
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
4000cd88: 00e787b3 add a5,a5,a4 <== NOT EXECUTED
4000cd8c: 0097d733 srl a4,a5,s1 <== NOT EXECUTED
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000cd90: 009714b3 sll s1,a4,s1 <== NOT EXECUTED
fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info,
const uint32_t sector,
const uint32_t sector_offset)
{
return sector_offset +
((sector -
4000cd94: 409787b3 sub a5,a5,s1 <== NOT EXECUTED
fat_block_num_to_sector_num (fs_info,
fat_sector_num_to_block_num (fs_info, sector)))
<< fs_info->vol.sec_log2);
4000cd98: 00d794b3 sll s1,a5,a3 <== NOT EXECUTED
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
4000cd9c: 00070593 mv a1,a4 <== NOT EXECUTED
if (blk_ofs == 0
4000cda0: 00049863 bnez s1,4000cdb0 <fat_buf_release.part.0+0xd8> <== NOT EXECUTED
&& fs_info->vol.bps == fs_info->vol.bytes_per_block)
4000cda4: 00045683 lhu a3,0(s0) <== NOT EXECUTED
4000cda8: 01042783 lw a5,16(s0) <== NOT EXECUTED
4000cdac: 06f68a63 beq a3,a5,4000ce20 <fat_buf_release.part.0+0x148> <== NOT EXECUTED
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
4000cdb0: 55d080ef jal ra,40015b0c <rtems_bdbuf_read> <== NOT EXECUTED
if ( sc != RTEMS_SUCCESSFUL)
4000cdb4: 0a051663 bnez a0,4000ce60 <fat_buf_release.part.0+0x188> <== NOT EXECUTED
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
4000cdb8: 00c12783 lw a5,12(sp) <== NOT EXECUTED
4000cdbc: 00045603 lhu a2,0(s0) <== NOT EXECUTED
4000cdc0: 0a442583 lw a1,164(s0) <== NOT EXECUTED
4000cdc4: 01c7a503 lw a0,28(a5) <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
4000cdc8: 00190913 addi s2,s2,1 <== NOT EXECUTED
4000cdcc: 0ff97913 andi s2,s2,255 <== NOT EXECUTED
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
4000cdd0: 00950533 add a0,a0,s1 <== NOT EXECUTED
4000cdd4: 2750e0ef jal ra,4001b848 <memcpy> <== NOT EXECUTED
sc = rtems_bdbuf_release_modified(bd);
4000cdd8: 00c12503 lw a0,12(sp) <== NOT EXECUTED
4000cddc: 02c090ef jal ra,40015e08 <rtems_bdbuf_release_modified> <== NOT EXECUTED
if ( sc != RTEMS_SUCCESSFUL)
4000cde0: 08051063 bnez a0,4000ce60 <fat_buf_release.part.0+0x188> <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
4000cde4: 01544783 lbu a5,21(s0) <== NOT EXECUTED
4000cde8: f6f96ee3 bltu s2,a5,4000cd64 <fat_buf_release.part.0+0x8c> <== NOT EXECUTED
4000cdec: f29ff06f j 4000cd14 <fat_buf_release.part.0+0x3c> <== NOT EXECUTED
sc = rtems_bdbuf_release(fs_info->c.buf);
4000cdf0: 71d080ef jal ra,40015d0c <rtems_bdbuf_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
4000cdf4: f20500e3 beqz a0,4000cd14 <fat_buf_release.part.0+0x3c> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
4000cdf8: 1600e0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000cdfc: 00500793 li a5,5 <== NOT EXECUTED
4000ce00: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000ce04: fff00513 li a0,-1 <== NOT EXECUTED
}
4000ce08: 01c12083 lw ra,28(sp) <== NOT EXECUTED
4000ce0c: 01812403 lw s0,24(sp) <== NOT EXECUTED
4000ce10: 01412483 lw s1,20(sp) <== NOT EXECUTED
4000ce14: 01012903 lw s2,16(sp) <== NOT EXECUTED
4000ce18: 02010113 addi sp,sp,32 <== NOT EXECUTED
4000ce1c: 00008067 ret <== NOT EXECUTED
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
4000ce20: 3e9080ef jal ra,40015a08 <rtems_bdbuf_get> <== NOT EXECUTED
4000ce24: f91ff06f j 4000cdb4 <fat_buf_release.part.0+0xdc> <== NOT EXECUTED
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000ce28: 00244803 lbu a6,2(s0) <== NOT EXECUTED
4000ce2c: 01444703 lbu a4,20(s0) <== NOT EXECUTED
fs_info->c.buf->buffer + blk_ofs,
4000ce30: 01c52583 lw a1,28(a0) <== NOT EXECUTED
memcpy(fs_info->sec_buf,
4000ce34: 00045603 lhu a2,0(s0) <== NOT EXECUTED
4000ce38: 41070733 sub a4,a4,a6 <== NOT EXECUTED
4000ce3c: 00e7d6b3 srl a3,a5,a4 <== NOT EXECUTED
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000ce40: 00e69733 sll a4,a3,a4 <== NOT EXECUTED
((sector -
4000ce44: 40e787b3 sub a5,a5,a4 <== NOT EXECUTED
4000ce48: 0a442503 lw a0,164(s0) <== NOT EXECUTED
<< fs_info->vol.sec_log2);
4000ce4c: 010797b3 sll a5,a5,a6 <== NOT EXECUTED
4000ce50: 00f585b3 add a1,a1,a5 <== NOT EXECUTED
4000ce54: 1f50e0ef jal ra,4001b848 <memcpy> <== NOT EXECUTED
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
4000ce58: 0a042503 lw a0,160(s0) <== NOT EXECUTED
4000ce5c: ee9ff06f j 4000cd44 <fat_buf_release.part.0+0x6c> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
4000ce60: 0f80e0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000ce64: 00c00793 li a5,12 <== NOT EXECUTED
4000ce68: 00f52023 sw a5,0(a0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
4000ce6c: fff00513 li a0,-1 <== NOT EXECUTED
4000ce70: f99ff06f j 4000ce08 <fat_buf_release.part.0+0x130> <== NOT EXECUTED
4000d198 <fat_cluster_set>:
fat_fs_info_t *fs_info,
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
4000d198: fc010113 addi sp,sp,-64
4000d19c: 02912a23 sw s1,52(sp)
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
4000d1a0: 00852483 lw s1,8(a0)
{
4000d1a4: 03512223 sw s5,36(sp)
4000d1a8: 01812c23 sw s8,24(sp)
4000d1ac: 02112e23 sw ra,60(sp)
4000d1b0: 02812c23 sw s0,56(sp)
4000d1b4: 03212823 sw s2,48(sp)
4000d1b8: 03312623 sw s3,44(sp)
4000d1bc: 03412423 sw s4,40(sp)
4000d1c0: 03612023 sw s6,32(sp)
4000d1c4: 01712e23 sw s7,28(sp)
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
4000d1c8: 40c484b3 sub s1,s1,a2
{
4000d1cc: 00050c13 mv s8,a0
4000d1d0: 00070a93 mv s5,a4
4000d1d4: 00058513 mv a0,a1
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
4000d1d8: 0096f463 bgeu a3,s1,4000d1e0 <fat_cluster_set+0x48>
4000d1dc: 00068493 mv s1,a3 <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000d1e0: 014c4783 lbu a5,20(s8)
4000d1e4: 002c4583 lbu a1,2(s8)
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000d1e8: 40b786b3 sub a3,a5,a1
4000d1ec: 00051863 bnez a0,4000d1fc <fat_cluster_set+0x64> <== ALWAYS TAKEN
4000d1f0: 016c4703 lbu a4,22(s8) <== NOT EXECUTED
4000d1f4: 00377713 andi a4,a4,3 <== NOT EXECUTED
4000d1f8: 10071663 bnez a4,4000d304 <fat_cluster_set+0x16c> <== NOT EXECUTED
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
4000d1fc: 00cc4703 lbu a4,12(s8)
4000d200: 03cc2983 lw s3,60(s8)
cln -= FAT_RSRVD_CLN;
4000d204: ffe50513 addi a0,a0,-2
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
4000d208: 40f70733 sub a4,a4,a5
4000d20c: 00e51533 sll a0,a0,a4
4000d210: 00d9d9b3 srl s3,s3,a3
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
4000d214: 00a98533 add a0,s3,a0
uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln);
uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2;
4000d218: 00f659b3 srl s3,a2,a5
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
4000d21c: 00f99bb3 sll s7,s3,a5
4000d220: 41760bb3 sub s7,a2,s7
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
4000d224: 00a989b3 add s3,s3,a0
ssize_t bytes_written = 0;
4000d228: 00000a13 li s4,0
while ( (RC_OK == rc)
&& (0 < bytes_to_write))
4000d22c: 04048a63 beqz s1,4000d280 <fat_cluster_set+0xe8> <== NEVER TAKEN
fs_info->c.modified = true;
4000d230: 00100b13 li s6,1
{
uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
4000d234: 010c2703 lw a4,16(s8)
4000d238: 41770433 sub s0,a4,s7
4000d23c: 00040913 mv s2,s0
4000d240: 0084f463 bgeu s1,s0,4000d248 <fat_cluster_set+0xb0>
4000d244: 00048913 mv s2,s1 <== NOT EXECUTED
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
4000d248: 00897463 bgeu s2,s0,4000d250 <fat_cluster_set+0xb8>
4000d24c: 00090413 mv s0,s2 <== NOT EXECUTED
if (0 < bytes_to_write)
4000d250: 08040e63 beqz s0,4000d2ec <fat_cluster_set+0x154> <== NEVER TAKEN
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000d254: 40b785b3 sub a1,a5,a1
4000d258: 00b995b3 sll a1,s3,a1
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
4000d25c: 00c10693 addi a3,sp,12
if (bytes_to_write == fs_info->vol.bytes_per_block)
4000d260: 08870a63 beq a4,s0,4000d2f4 <fat_cluster_set+0x15c>
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
4000d264: 00100613 li a2,1
4000d268: 000c0513 mv a0,s8
4000d26c: c09ff0ef jal ra,4000ce74 <fat_buf_access>
if (RC_OK == rc)
4000d270: 06050263 beqz a0,4000d2d4 <fat_cluster_set+0x13c> <== ALWAYS TAKEN
fs_info,
cur_blk,
ofs_blk,
c,
pattern);
if (c != ret)
4000d274: 00050413 mv s0,a0 <== NOT EXECUTED
4000d278: 03240e63 beq s0,s2,4000d2b4 <fat_cluster_set+0x11c>
4000d27c: fff00a13 li s4,-1 <== NOT EXECUTED
}
if (RC_OK != rc)
return rc;
else
return bytes_written;
}
4000d280: 03c12083 lw ra,60(sp)
4000d284: 03812403 lw s0,56(sp)
4000d288: 03412483 lw s1,52(sp)
4000d28c: 03012903 lw s2,48(sp)
4000d290: 02c12983 lw s3,44(sp)
4000d294: 02412a83 lw s5,36(sp)
4000d298: 02012b03 lw s6,32(sp)
4000d29c: 01c12b83 lw s7,28(sp)
4000d2a0: 01812c03 lw s8,24(sp)
4000d2a4: 000a0513 mv a0,s4
4000d2a8: 02812a03 lw s4,40(sp)
4000d2ac: 04010113 addi sp,sp,64
4000d2b0: 00008067 ret
bytes_to_write -= ret;
4000d2b4: 408484b3 sub s1,s1,s0
bytes_written += ret;
4000d2b8: 00aa0a33 add s4,s4,a0
++cur_blk;
4000d2bc: 00198993 addi s3,s3,1
&& (0 < bytes_to_write))
4000d2c0: fc0480e3 beqz s1,4000d280 <fat_cluster_set+0xe8>
4000d2c4: 014c4783 lbu a5,20(s8)
4000d2c8: 002c4583 lbu a1,2(s8)
4000d2cc: 00000b93 li s7,0
4000d2d0: f65ff06f j 4000d234 <fat_cluster_set+0x9c>
memset(blk_buf + offset, pattern, bytes_to_write);
4000d2d4: 00c12503 lw a0,12(sp)
4000d2d8: 00040613 mv a2,s0
4000d2dc: 000a8593 mv a1,s5
4000d2e0: 01750533 add a0,a0,s7
4000d2e4: 68c0e0ef jal ra,4001b970 <memset>
fs_info->c.modified = true;
4000d2e8: 096c0e23 sb s6,156(s8)
return bytes_to_write;
4000d2ec: 00040513 mv a0,s0
4000d2f0: f89ff06f j 4000d278 <fat_cluster_set+0xe0>
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
4000d2f4: 00200613 li a2,2
4000d2f8: 000c0513 mv a0,s8
4000d2fc: b79ff0ef jal ra,4000ce74 <fat_buf_access>
4000d300: f71ff06f j 4000d270 <fat_cluster_set+0xd8>
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000d304: 028c2503 lw a0,40(s8) <== NOT EXECUTED
4000d308: 00d55533 srl a0,a0,a3 <== NOT EXECUTED
return blk;
4000d30c: f0dff06f j 4000d218 <fat_cluster_set+0x80> <== NOT EXECUTED
4000d310 <fat_cluster_write>:
fat_fs_info_t *fs_info,
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff)
{
4000d310: fc010113 addi sp,sp,-64
4000d314: 02912a23 sw s1,52(sp)
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
4000d318: 00852483 lw s1,8(a0)
{
4000d31c: 03512223 sw s5,36(sp)
4000d320: 01812c23 sw s8,24(sp)
4000d324: 02112e23 sw ra,60(sp)
4000d328: 02812c23 sw s0,56(sp)
4000d32c: 03212823 sw s2,48(sp)
4000d330: 03312623 sw s3,44(sp)
4000d334: 03412423 sw s4,40(sp)
4000d338: 03612023 sw s6,32(sp)
4000d33c: 01712e23 sw s7,28(sp)
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
4000d340: 40c484b3 sub s1,s1,a2
{
4000d344: 00050c13 mv s8,a0
4000d348: 00070a93 mv s5,a4
4000d34c: 00058513 mv a0,a1
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
4000d350: 0096f463 bgeu a3,s1,4000d358 <fat_cluster_write+0x48>
4000d354: 00068493 mv s1,a3
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000d358: 014c4783 lbu a5,20(s8)
4000d35c: 002c4583 lbu a1,2(s8)
4000d360: 40b786b3 sub a3,a5,a1
4000d364: 00051863 bnez a0,4000d374 <fat_cluster_write+0x64>
4000d368: 016c4703 lbu a4,22(s8)
4000d36c: 00377713 andi a4,a4,3
4000d370: 10071663 bnez a4,4000d47c <fat_cluster_write+0x16c> <== ALWAYS TAKEN
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
4000d374: 00cc4703 lbu a4,12(s8)
4000d378: 03cc2983 lw s3,60(s8)
cln -= FAT_RSRVD_CLN;
4000d37c: ffe50513 addi a0,a0,-2
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
4000d380: 40f70733 sub a4,a4,a5
4000d384: 00e51533 sll a0,a0,a4
4000d388: 00d9d9b3 srl s3,s3,a3
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
4000d38c: 00a98533 add a0,s3,a0
uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln);
uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2);
4000d390: 00f659b3 srl s3,a2,a5
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
4000d394: 00f99bb3 sll s7,s3,a5
4000d398: 41760bb3 sub s7,a2,s7
ssize_t bytes_written = 0;
uint8_t *buffer = (uint8_t*)buff;
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
4000d39c: 00a989b3 add s3,s3,a0
ssize_t bytes_written = 0;
4000d3a0: 00000a13 li s4,0
while ( (RC_OK == rc)
&& (0 < bytes_to_write))
4000d3a4: 04048a63 beqz s1,4000d3f8 <fat_cluster_write+0xe8> <== NEVER TAKEN
fs_info->c.modified = true;
4000d3a8: 00100b13 li s6,1
{
c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
4000d3ac: 010c2703 lw a4,16(s8)
4000d3b0: 41770433 sub s0,a4,s7
4000d3b4: 00040913 mv s2,s0
4000d3b8: 0084f463 bgeu s1,s0,4000d3c0 <fat_cluster_write+0xb0>
4000d3bc: 00048913 mv s2,s1
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
4000d3c0: 00897463 bgeu s2,s0,4000d3c8 <fat_cluster_write+0xb8>
4000d3c4: 00090413 mv s0,s2
if (0 < bytes_to_write)
4000d3c8: 08040e63 beqz s0,4000d464 <fat_cluster_write+0x154> <== NEVER TAKEN
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000d3cc: 40b785b3 sub a1,a5,a1
4000d3d0: 00b995b3 sll a1,s3,a1
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
4000d3d4: 00c10693 addi a3,sp,12
if (bytes_to_write == fs_info->vol.bytes_per_block)
4000d3d8: 08870a63 beq a4,s0,4000d46c <fat_cluster_write+0x15c>
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
4000d3dc: 00100613 li a2,1
4000d3e0: 000c0513 mv a0,s8
4000d3e4: a91ff0ef jal ra,4000ce74 <fat_buf_access>
if (RC_OK == rc)
4000d3e8: 06050263 beqz a0,4000d44c <fat_cluster_write+0x13c> <== ALWAYS TAKEN
fs_info,
cur_blk,
ofs_blk,
c,
&buffer[bytes_written]);
if (c != ret)
4000d3ec: 00050413 mv s0,a0 <== NOT EXECUTED
4000d3f0: 03240e63 beq s0,s2,4000d42c <fat_cluster_write+0x11c>
4000d3f4: fff00a13 li s4,-1 <== NOT EXECUTED
}
if (RC_OK != rc)
return rc;
else
return bytes_written;
}
4000d3f8: 03c12083 lw ra,60(sp)
4000d3fc: 03812403 lw s0,56(sp)
4000d400: 03412483 lw s1,52(sp)
4000d404: 03012903 lw s2,48(sp)
4000d408: 02c12983 lw s3,44(sp)
4000d40c: 02412a83 lw s5,36(sp)
4000d410: 02012b03 lw s6,32(sp)
4000d414: 01c12b83 lw s7,28(sp)
4000d418: 01812c03 lw s8,24(sp)
4000d41c: 000a0513 mv a0,s4
4000d420: 02812a03 lw s4,40(sp)
4000d424: 04010113 addi sp,sp,64
4000d428: 00008067 ret
bytes_to_write -= ret;
4000d42c: 408484b3 sub s1,s1,s0
bytes_written += ret;
4000d430: 00aa0a33 add s4,s4,a0
++cur_blk;
4000d434: 00198993 addi s3,s3,1
&& (0 < bytes_to_write))
4000d438: fc0480e3 beqz s1,4000d3f8 <fat_cluster_write+0xe8> <== ALWAYS TAKEN
4000d43c: 014c4783 lbu a5,20(s8) <== NOT EXECUTED
4000d440: 002c4583 lbu a1,2(s8) <== NOT EXECUTED
4000d444: 00000b93 li s7,0 <== NOT EXECUTED
4000d448: f65ff06f j 4000d3ac <fat_cluster_write+0x9c> <== NOT EXECUTED
memcpy(blk_buf + offset, buf, bytes_to_write);
4000d44c: 00c12503 lw a0,12(sp)
4000d450: 00040613 mv a2,s0
4000d454: 014a85b3 add a1,s5,s4
4000d458: 01750533 add a0,a0,s7
4000d45c: 3ec0e0ef jal ra,4001b848 <memcpy>
fs_info->c.modified = true;
4000d460: 096c0e23 sb s6,156(s8)
return bytes_to_write;
4000d464: 00040513 mv a0,s0
4000d468: f89ff06f j 4000d3f0 <fat_cluster_write+0xe0>
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
4000d46c: 00200613 li a2,2
4000d470: 000c0513 mv a0,s8
4000d474: a01ff0ef jal ra,4000ce74 <fat_buf_access>
4000d478: f71ff06f j 4000d3e8 <fat_cluster_write+0xd8>
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
4000d47c: 028c2503 lw a0,40(s8)
4000d480: 00d55533 srl a0,a0,a3
return blk;
4000d484: f0dff06f j 4000d390 <fat_cluster_write+0x80>
4000ee5c <fat_file_close>:
if (fat_fd->links_num > 1)
4000ee5c: 0085a783 lw a5,8(a1)
{
4000ee60: ff010113 addi sp,sp,-16
4000ee64: 00812423 sw s0,8(sp)
4000ee68: 00912223 sw s1,4(sp)
4000ee6c: 00112623 sw ra,12(sp)
if (fat_fd->links_num > 1)
4000ee70: 00100713 li a4,1
{
4000ee74: 00058413 mv s0,a1
4000ee78: 00050493 mv s1,a0
if (fat_fd->links_num > 1)
4000ee7c: 02f77263 bgeu a4,a5,4000eea0 <fat_file_close+0x44>
fat_fd->links_num--;
4000ee80: fff78793 addi a5,a5,-1
4000ee84: 00f5a423 sw a5,8(a1)
}
4000ee88: 00812403 lw s0,8(sp)
4000ee8c: 00c12083 lw ra,12(sp)
rc = fat_buf_release(fs_info);
4000ee90: 00048513 mv a0,s1
}
4000ee94: 00412483 lw s1,4(sp)
4000ee98: 01010113 addi sp,sp,16
rc = fat_buf_release(fs_info);
4000ee9c: 8b4fe06f j 4000cf50 <fat_buf_release>
fat_file_update(fs_info, fat_fd);
4000eea0: c1dff0ef jal ra,4000eabc <fat_file_update>
if (fat_fd->flags & FAT_FILE_REMOVED)
4000eea4: 03044783 lbu a5,48(s0)
4000eea8: 0017f793 andi a5,a5,1
4000eeac: 00079e63 bnez a5,4000eec8 <fat_file_close+0x6c>
if (fat_ino_is_unique(fs_info, fat_fd->ino))
4000eeb0: 00c42583 lw a1,12(s0)
4000eeb4: 00048513 mv a0,s1
4000eeb8: 8d0ff0ef jal ra,4000df88 <fat_ino_is_unique>
4000eebc: 04050663 beqz a0,4000ef08 <fat_file_close+0xac>
fat_fd->links_num = 0;
4000eec0: 00042423 sw zero,8(s0)
4000eec4: fc5ff06f j 4000ee88 <fat_file_close+0x2c>
rc = fat_file_truncate(fs_info, fat_fd, 0);
4000eec8: 00000613 li a2,0
4000eecc: 00040593 mv a1,s0
4000eed0: 00048513 mv a0,s1
4000eed4: e91ff0ef jal ra,4000ed64 <fat_file_truncate>
if (rc == RC_OK)
4000eed8: fa0518e3 bnez a0,4000ee88 <fat_file_close+0x2c> <== NEVER TAKEN
next = the_node->next;
4000eedc: 00042703 lw a4,0(s0)
previous = the_node->previous;
4000eee0: 00442783 lw a5,4(s0)
_hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd);
4000eee4: 00c42583 lw a1,12(s0)
if (fat_ino_is_unique(fs_info, fat_fd->ino))
4000eee8: 00048513 mv a0,s1
next->previous = previous;
4000eeec: 00f72223 sw a5,4(a4)
previous->next = next;
4000eef0: 00e7a023 sw a4,0(a5)
4000eef4: 894ff0ef jal ra,4000df88 <fat_ino_is_unique>
4000eef8: 02051663 bnez a0,4000ef24 <fat_file_close+0xc8> <== NEVER TAKEN
free(fat_fd);
4000eefc: 00040513 mv a0,s0
4000ef00: dc0f20ef jal ra,400014c0 <free>
4000ef04: f85ff06f j 4000ee88 <fat_file_close+0x2c>
next = the_node->next;
4000ef08: 00042703 lw a4,0(s0)
previous = the_node->previous;
4000ef0c: 00442783 lw a5,4(s0)
free(fat_fd);
4000ef10: 00040513 mv a0,s0
next->previous = previous;
4000ef14: 00f72223 sw a5,4(a4)
previous->next = next;
4000ef18: 00e7a023 sw a4,0(a5)
4000ef1c: da4f20ef jal ra,400014c0 <free>
4000ef20: f69ff06f j 4000ee88 <fat_file_close+0x2c>
fat_free_unique_ino(fs_info, fat_fd->ino);
4000ef24: 00c42583 lw a1,12(s0) <== NOT EXECUTED
4000ef28: 00048513 mv a0,s1 <== NOT EXECUTED
4000ef2c: 828ff0ef jal ra,4000df54 <fat_free_unique_ino> <== NOT EXECUTED
4000ef30: fcdff06f j 4000eefc <fat_file_close+0xa0> <== NOT EXECUTED
4000f008 <fat_file_extend>:
{
4000f008: fc010113 addi sp,sp,-64
4000f00c: 03612023 sw s6,32(sp)
4000f010: 02112e23 sw ra,60(sp)
4000f014: 02812c23 sw s0,56(sp)
4000f018: 02912a23 sw s1,52(sp)
4000f01c: 03212823 sw s2,48(sp)
4000f020: 03312623 sw s3,44(sp)
4000f024: 03412423 sw s4,40(sp)
4000f028: 03512223 sw s5,36(sp)
4000f02c: 01712e23 sw s7,28(sp)
4000f030: 01812c23 sw s8,24(sp)
*a_length = new_length;
4000f034: 00d72023 sw a3,0(a4)
if (new_length <= fat_fd->fat_file_size)
4000f038: 0185a803 lw a6,24(a1)
uint32_t chain = 0;
4000f03c: 00012023 sw zero,0(sp)
uint32_t last_cl = 0;
4000f040: 00012423 sw zero,8(sp)
{
4000f044: 00070b13 mv s6,a4
if (new_length <= fat_fd->fat_file_size)
4000f048: 10d87c63 bgeu a6,a3,4000f160 <fat_file_extend+0x158>
4000f04c: 00068413 mv s0,a3
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000f050: 0205a683 lw a3,32(a1)
4000f054: 00100713 li a4,1
4000f058: 00058493 mv s1,a1
4000f05c: 00050993 mv s3,a0
4000f060: 00060c13 mv s8,a2
4000f064: 12e68a63 beq a3,a4,4000f198 <fat_file_extend+0x190>
bytes_remain = (fs_info->vol.bpc -
4000f068: 0089a903 lw s2,8(s3)
bytes2add = new_length - fat_fd->fat_file_size;
4000f06c: 410406b3 sub a3,s0,a6
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
4000f070: fff90713 addi a4,s2,-1
4000f074: 00e87ab3 and s5,a6,a4
bytes_remain = (fs_info->vol.bpc -
4000f078: 41590933 sub s2,s2,s5
4000f07c: 00e97933 and s2,s2,a4
if (bytes2add > bytes_remain)
4000f080: 0cd97e63 bgeu s2,a3,4000f15c <fat_file_extend+0x154>
bytes2add -= bytes_remain;
4000f084: 41268bb3 sub s7,a3,s2
if (zero_fill && bytes_remain > 0) {
4000f088: 120c1c63 bnez s8,4000f1c0 <fat_file_extend+0x1b8>
if (bytes2add == 0)
4000f08c: 0c0b8a63 beqz s7,4000f160 <fat_file_extend+0x158>
cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1;
4000f090: 00c9c603 lbu a2,12(s3)
4000f094: fffb8a93 addi s5,s7,-1
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
4000f098: 000c0793 mv a5,s8
cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1;
4000f09c: 00cadab3 srl s5,s5,a2
4000f0a0: 001a8a93 addi s5,s5,1
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
4000f0a4: 00810713 addi a4,sp,8
4000f0a8: 00c10693 addi a3,sp,12
4000f0ac: 000a8613 mv a2,s5
4000f0b0: 00010593 mv a1,sp
4000f0b4: 00098513 mv a0,s3
4000f0b8: c34ff0ef jal ra,4000e4ec <fat_scan_fat_for_free_clusters>
4000f0bc: 00050a13 mv s4,a0
if (rc != RC_OK)
4000f0c0: 0a051263 bnez a0,4000f164 <fat_file_extend+0x15c> <== NEVER TAKEN
if ((cls_added == 0) && (bytes_remain == 0))
4000f0c4: 00c12783 lw a5,12(sp)
4000f0c8: 0127e933 or s2,a5,s2
4000f0cc: 0e090063 beqz s2,4000f1ac <fat_file_extend+0x1a4>
if (cls2add != cls_added)
4000f0d0: 01578e63 beq a5,s5,4000f0ec <fat_file_extend+0xe4>
uint32_t missing = (cls2add - cls_added) << fs_info->vol.bpc_log2;
4000f0d4: 00c9c603 lbu a2,12(s3)
4000f0d8: 40fa8ab3 sub s5,s5,a5
4000f0dc: 00ca9ab3 sll s5,s5,a2
new_length -= bytes2add < missing ? bytes2add : missing;
4000f0e0: 015bf463 bgeu s7,s5,4000f0e8 <fat_file_extend+0xe0>
4000f0e4: 000b8a93 mv s5,s7
4000f0e8: 41540433 sub s0,s0,s5
if (cls_added > 0)
4000f0ec: 12078263 beqz a5,4000f210 <fat_file_extend+0x208>
if ( fat_fd->fat_file_size == 0 )
4000f0f0: 0184a683 lw a3,24(s1)
4000f0f4: 12068a63 beqz a3,4000f228 <fat_file_extend+0x220>
if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE)
4000f0f8: 03c4a583 lw a1,60(s1)
4000f0fc: fff00793 li a5,-1
4000f100: 14f58463 beq a1,a5,4000f248 <fat_file_extend+0x240>
old_last_cl = fat_fd->map.last_cln;
4000f104: 00b12223 sw a1,4(sp)
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
4000f108: 00012603 lw a2,0(sp)
4000f10c: 00098513 mv a0,s3
4000f110: 844ff0ef jal ra,4000e154 <fat_set_fat_cluster>
4000f114: 00050793 mv a5,a0
if ( rc != RC_OK )
4000f118: 02051863 bnez a0,4000f148 <fat_file_extend+0x140> <== NEVER TAKEN
fat_buf_release(fs_info);
4000f11c: 00098513 mv a0,s3
4000f120: e31fd0ef jal ra,4000cf50 <fat_buf_release>
fat_fd->map.last_cln = last_cl;
4000f124: 00812703 lw a4,8(sp)
if (fat_fd->fat_file_type == FAT_DIRECTORY)
4000f128: 0104a783 lw a5,16(s1)
fat_fd->map.last_cln = last_cl;
4000f12c: 02e4ae23 sw a4,60(s1)
if (fat_fd->fat_file_type == FAT_DIRECTORY)
4000f130: 0e079063 bnez a5,4000f210 <fat_file_extend+0x208>
rc = fat_init_clusters_chain(fs_info, chain);
4000f134: 00012583 lw a1,0(sp)
4000f138: 00098513 mv a0,s3
4000f13c: cb9fe0ef jal ra,4000ddf4 <fat_init_clusters_chain>
4000f140: 00050793 mv a5,a0
if ( rc != RC_OK )
4000f144: 0c050663 beqz a0,4000f210 <fat_file_extend+0x208> <== ALWAYS TAKEN
fat_free_fat_clusters_chain(fs_info, chain);
4000f148: 00012583 lw a1,0(sp) <== NOT EXECUTED
4000f14c: 00098513 mv a0,s3 <== NOT EXECUTED
return rc;
4000f150: 00078a13 mv s4,a5 <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, chain);
4000f154: a90ff0ef jal ra,4000e3e4 <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
4000f158: 00c0006f j 4000f164 <fat_file_extend+0x15c> <== NOT EXECUTED
if (zero_fill && bytes_remain > 0) {
4000f15c: 060c1663 bnez s8,4000f1c8 <fat_file_extend+0x1c0>
return RC_OK;
4000f160: 00000a13 li s4,0
}
4000f164: 03c12083 lw ra,60(sp)
4000f168: 03812403 lw s0,56(sp)
4000f16c: 03412483 lw s1,52(sp)
4000f170: 03012903 lw s2,48(sp)
4000f174: 02c12983 lw s3,44(sp)
4000f178: 02412a83 lw s5,36(sp)
4000f17c: 02012b03 lw s6,32(sp)
4000f180: 01c12b83 lw s7,28(sp)
4000f184: 01812c03 lw s8,24(sp)
4000f188: 000a0513 mv a0,s4
4000f18c: 02812a03 lw s4,40(sp)
4000f190: 04010113 addi sp,sp,64
4000f194: 00008067 ret
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000f198: 0245a703 lw a4,36(a1)
4000f19c: ec0716e3 bnez a4,4000f068 <fat_file_extend+0x60> <== NEVER TAKEN
4000f1a0: 01654703 lbu a4,22(a0)
4000f1a4: 00377713 andi a4,a4,3
4000f1a8: ec0700e3 beqz a4,4000f068 <fat_file_extend+0x60> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one(ENOSPC);
4000f1ac: 5ad0b0ef jal ra,4001af58 <__errno>
4000f1b0: 01c00793 li a5,28
4000f1b4: 00f52023 sw a5,0(a0)
4000f1b8: fff00a13 li s4,-1
4000f1bc: fa9ff06f j 4000f164 <fat_file_extend+0x15c>
if (zero_fill && bytes_remain > 0) {
4000f1c0: ec0906e3 beqz s2,4000f08c <fat_file_extend+0x84> <== ALWAYS TAKEN
4000f1c4: 0080006f j 4000f1cc <fat_file_extend+0x1c4> <== NOT EXECUTED
bytes2add = 0;
4000f1c8: 00000b93 li s7,0
uint32_t cl_start = start >> fs_info->vol.bpc_log2;
4000f1cc: 00c9c603 lbu a2,12(s3)
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
4000f1d0: 00c10693 addi a3,sp,12
4000f1d4: 00048593 mv a1,s1
4000f1d8: 00c85633 srl a2,a6,a2
4000f1dc: 00098513 mv a0,s3
4000f1e0: d04ff0ef jal ra,4000e6e4 <fat_file_lseek>
4000f1e4: 00050a13 mv s4,a0
if (rc != RC_OK)
4000f1e8: f6051ee3 bnez a0,4000f164 <fat_file_extend+0x15c> <== NEVER TAKEN
bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0);
4000f1ec: 00c12583 lw a1,12(sp)
4000f1f0: 00000713 li a4,0
4000f1f4: 00090693 mv a3,s2
4000f1f8: 000a8613 mv a2,s5
4000f1fc: 00098513 mv a0,s3
4000f200: f99fd0ef jal ra,4000d198 <fat_cluster_set>
return -1;
4000f204: fff00a13 li s4,-1
if (bytes_remain != bytes_written)
4000f208: f5251ee3 bne a0,s2,4000f164 <fat_file_extend+0x15c>
4000f20c: e81ff06f j 4000f08c <fat_file_extend+0x84>
*a_length = new_length;
4000f210: 008b2023 sw s0,0(s6)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f214: 0304c783 lbu a5,48(s1)
fat_fd->fat_file_size = s;
4000f218: 0084ac23 sw s0,24(s1)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f21c: 0027e793 ori a5,a5,2
4000f220: 02f48823 sb a5,48(s1)
return RC_OK;
4000f224: f41ff06f j 4000f164 <fat_file_extend+0x15c>
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f228: 0304c783 lbu a5,48(s1)
fat_fd->map.disk_cln = chain;
4000f22c: 00012703 lw a4,0(sp)
fat_fd->map.file_cln = 0;
4000f230: 0204aa23 sw zero,52(s1)
4000f234: 0027e793 ori a5,a5,2
fat_fd->map.disk_cln = chain;
4000f238: 02e4ac23 sw a4,56(s1)
fat_fd->cln = cln;
4000f23c: 00e4ae23 sw a4,28(s1)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f240: 02f48823 sb a5,48(s1)
}
4000f244: ee1ff06f j 4000f124 <fat_file_extend+0x11c>
rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM,
4000f248: 00410713 addi a4,sp,4 <== NOT EXECUTED
4000f24c: fff68693 addi a3,a3,-1 <== NOT EXECUTED
4000f250: 00100613 li a2,1 <== NOT EXECUTED
4000f254: 00048593 mv a1,s1 <== NOT EXECUTED
4000f258: 00098513 mv a0,s3 <== NOT EXECUTED
4000f25c: cd9ff0ef jal ra,4000ef34 <fat_file_ioctl> <== NOT EXECUTED
4000f260: 00050793 mv a5,a0 <== NOT EXECUTED
if ( rc != RC_OK )
4000f264: ee0512e3 bnez a0,4000f148 <fat_file_extend+0x140> <== NOT EXECUTED
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
4000f268: 00412583 lw a1,4(sp) <== NOT EXECUTED
4000f26c: e9dff06f j 4000f108 <fat_file_extend+0x100> <== NOT EXECUTED
4000ef34 <fat_file_ioctl>:
{
4000ef34: fc010113 addi sp,sp,-64
va_start(ap, cmd);
4000ef38: 02c10313 addi t1,sp,44
{
4000ef3c: 02f12a23 sw a5,52(sp)
4000ef40: 00112e23 sw ra,28(sp)
4000ef44: 00812c23 sw s0,24(sp)
4000ef48: 02d12623 sw a3,44(sp)
4000ef4c: 02e12823 sw a4,48(sp)
4000ef50: 03012c23 sw a6,56(sp)
4000ef54: 03112e23 sw a7,60(sp)
uint32_t cur_cln = 0;
4000ef58: 00012423 sw zero,8(sp)
va_start(ap, cmd);
4000ef5c: 00612623 sw t1,12(sp)
switch (cmd)
4000ef60: 00100793 li a5,1
4000ef64: 04f61c63 bne a2,a5,4000efbc <fat_file_ioctl+0x88>
if ( pos >= fat_fd->fat_file_size ) {
4000ef68: 0185a703 lw a4,24(a1)
pos = va_arg(ap, uint32_t);
4000ef6c: 00068793 mv a5,a3
ret = va_arg(ap, uint32_t *);
4000ef70: 03410693 addi a3,sp,52
4000ef74: 00d12623 sw a3,12(sp)
4000ef78: 03012403 lw s0,48(sp)
if ( pos >= fat_fd->fat_file_size ) {
4000ef7c: 06e7fc63 bgeu a5,a4,4000eff4 <fat_file_ioctl+0xc0>
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000ef80: 0205a703 lw a4,32(a1)
4000ef84: 00c71663 bne a4,a2,4000ef90 <fat_file_ioctl+0x5c>
4000ef88: 0245a703 lw a4,36(a1)
4000ef8c: 04070863 beqz a4,4000efdc <fat_file_ioctl+0xa8> <== ALWAYS TAKEN
cl_start = pos >> fs_info->vol.bpc_log2;
4000ef90: 00c54603 lbu a2,12(a0)
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
4000ef94: 00810693 addi a3,sp,8
4000ef98: 00c7d633 srl a2,a5,a2
4000ef9c: f48ff0ef jal ra,4000e6e4 <fat_file_lseek>
if ( rc != RC_OK )
4000efa0: 00051663 bnez a0,4000efac <fat_file_ioctl+0x78> <== NEVER TAKEN
*ret = cur_cln;
4000efa4: 00812783 lw a5,8(sp)
4000efa8: 00f42023 sw a5,0(s0)
}
4000efac: 01c12083 lw ra,28(sp)
4000efb0: 01812403 lw s0,24(sp)
4000efb4: 04010113 addi sp,sp,64
4000efb8: 00008067 ret
errno = EINVAL;
4000efbc: 79d0b0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
}
4000efc0: 01c12083 lw ra,28(sp) <== NOT EXECUTED
4000efc4: 01812403 lw s0,24(sp) <== NOT EXECUTED
errno = EINVAL;
4000efc8: 01600793 li a5,22 <== NOT EXECUTED
4000efcc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
rc = -1;
4000efd0: fff00513 li a0,-1 <== NOT EXECUTED
}
4000efd4: 04010113 addi sp,sp,64 <== NOT EXECUTED
4000efd8: 00008067 ret <== NOT EXECUTED
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000efdc: 01654703 lbu a4,22(a0)
4000efe0: 00377713 andi a4,a4,3
4000efe4: fa0706e3 beqz a4,4000ef90 <fat_file_ioctl+0x5c>
*ret = 0;
4000efe8: 00042023 sw zero,0(s0)
rc = RC_OK;
4000efec: 00000513 li a0,0
break;
4000eff0: fbdff06f j 4000efac <fat_file_ioctl+0x78>
rtems_set_errno_and_return_minus_one( EIO );
4000eff4: 7650b0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000eff8: 00500793 li a5,5 <== NOT EXECUTED
4000effc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000f000: fff00513 li a0,-1 <== NOT EXECUTED
4000f004: fa9ff06f j 4000efac <fat_file_ioctl+0x78> <== NOT EXECUTED
4000e7b8 <fat_file_open>:
key = fat_construct_key(fs_info, &dir_pos->sname);
4000e7b8: 0005a783 lw a5,0(a1)
{
4000e7bc: fd010113 addi sp,sp,-48
4000e7c0: 02812423 sw s0,40(sp)
4000e7c4: 03212023 sw s2,32(sp)
4000e7c8: 01612823 sw s6,16(sp)
4000e7cc: 02112623 sw ra,44(sp)
4000e7d0: 02912223 sw s1,36(sp)
4000e7d4: 01312e23 sw s3,28(sp)
4000e7d8: 01412c23 sw s4,24(sp)
4000e7dc: 01512a23 sw s5,20(sp)
4000e7e0: 01712623 sw s7,12(sp)
if (cln == 1)
4000e7e4: 00100693 li a3,1
4000e7e8: 0045a703 lw a4,4(a1)
4000e7ec: 00058913 mv s2,a1
4000e7f0: 00050413 mv s0,a0
4000e7f4: 00060b13 mv s6,a2
4000e7f8: 02d78263 beq a5,a3,4000e81c <fat_file_open+0x64>
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000e7fc: 1e078a63 beqz a5,4000e9f0 <fat_file_open+0x238>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e800: 00544603 lbu a2,5(s0)
4000e804: 03c42683 lw a3,60(s0)
4000e808: ffe78793 addi a5,a5,-2
4000e80c: 00c797b3 sll a5,a5,a2
4000e810: 00d787b3 add a5,a5,a3
fs_info->vol.sec_mul);
4000e814: 00344483 lbu s1,3(s0)
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
4000e818: 009797b3 sll a5,a5,s1
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
4000e81c: 00575493 srli s1,a4,0x5
4000e820: 00f4f693 andi a3,s1,15
uint32_t mod = (key1) % FAT_HASH_MODULE;
4000e824: 0016f613 andi a2,a3,1
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
4000e828: 00161993 slli s3,a2,0x1
4000e82c: 08042a03 lw s4,128(s0)
4000e830: 00c989b3 add s3,s3,a2
4000e834: 00299993 slli s3,s3,0x2
4000e838: 013a0a33 add s4,s4,s3
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
4000e83c: 00975493 srli s1,a4,0x9
return _Chain_Immutable_head( the_chain )->next;
4000e840: 000a2603 lw a2,0(s4)
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
4000e844: 00f484b3 add s1,s1,a5
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
4000e848: 00449493 slli s1,s1,0x4
return &the_chain->Tail.Node;
4000e84c: 004a0a93 addi s5,s4,4
4000e850: 00d484b3 add s1,s1,a3
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
4000e854: 07560263 beq a2,s5,4000e8b8 <fat_file_open+0x100>
if (cln == 1)
4000e858: 00100593 li a1,1
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e85c: 02062783 lw a5,32(a2)
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000e860: 02462683 lw a3,36(a2)
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e864: ffe78713 addi a4,a5,-2
if (cln == 1)
4000e868: 02b78663 beq a5,a1,4000e894 <fat_file_open+0xdc>
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000e86c: 00079863 bnez a5,4000e87c <fat_file_open+0xc4>
4000e870: 01644783 lbu a5,22(s0)
4000e874: 0037f793 andi a5,a5,3
4000e878: 18079a63 bnez a5,4000ea0c <fat_file_open+0x254> <== ALWAYS TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e87c: 00544503 lbu a0,5(s0)
4000e880: 03c42783 lw a5,60(s0)
4000e884: 00a71733 sll a4,a4,a0
4000e888: 00f707b3 add a5,a4,a5
fs_info->vol.sec_mul);
4000e88c: 00344703 lbu a4,3(s0)
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
4000e890: 00e797b3 sll a5,a5,a4
4000e894: 0096d713 srli a4,a3,0x9
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
4000e898: 00f707b3 add a5,a4,a5
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
4000e89c: 0056d693 srli a3,a3,0x5
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
4000e8a0: 00479793 slli a5,a5,0x4
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
4000e8a4: 00f6f693 andi a3,a3,15
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
4000e8a8: 00d787b3 add a5,a5,a3
if ( (key1) == ck)
4000e8ac: 10f48263 beq s1,a5,4000e9b0 <fat_file_open+0x1f8>
the_node = the_node->next;
4000e8b0: 00062603 lw a2,0(a2)
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
4000e8b4: fb5614e3 bne a2,s5,4000e85c <fat_file_open+0xa4>
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
4000e8b8: 08442603 lw a2,132(s0)
if (cln == 1)
4000e8bc: 00100513 li a0,1
4000e8c0: 01360633 add a2,a2,s3
return _Chain_Immutable_head( the_chain )->next;
4000e8c4: 00062803 lw a6,0(a2)
return &the_chain->Tail.Node;
4000e8c8: 00460613 addi a2,a2,4
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
4000e8cc: 00c81863 bne a6,a2,4000e8dc <fat_file_open+0x124>
4000e8d0: 1440006f j 4000ea14 <fat_file_open+0x25c>
the_node = the_node->next;
4000e8d4: 00082803 lw a6,0(a6) <== NOT EXECUTED
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
4000e8d8: 12c80e63 beq a6,a2,4000ea14 <fat_file_open+0x25c> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e8dc: 02082783 lw a5,32(a6) <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000e8e0: 02482683 lw a3,36(a6) <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e8e4: ffe78713 addi a4,a5,-2 <== NOT EXECUTED
if (cln == 1)
4000e8e8: 02a78663 beq a5,a0,4000e914 <fat_file_open+0x15c> <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000e8ec: 00079863 bnez a5,4000e8fc <fat_file_open+0x144> <== NOT EXECUTED
4000e8f0: 01644783 lbu a5,22(s0) <== NOT EXECUTED
4000e8f4: 0037f793 andi a5,a5,3 <== NOT EXECUTED
4000e8f8: 10079663 bnez a5,4000ea04 <fat_file_open+0x24c> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000e8fc: 00544583 lbu a1,5(s0) <== NOT EXECUTED
4000e900: 03c42783 lw a5,60(s0) <== NOT EXECUTED
4000e904: 00b71733 sll a4,a4,a1 <== NOT EXECUTED
4000e908: 00f707b3 add a5,a4,a5 <== NOT EXECUTED
fs_info->vol.sec_mul);
4000e90c: 00344703 lbu a4,3(s0) <== NOT EXECUTED
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
4000e910: 00e797b3 sll a5,a5,a4 <== NOT EXECUTED
4000e914: 0096d713 srli a4,a3,0x9 <== NOT EXECUTED
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
4000e918: 00f707b3 add a5,a4,a5 <== NOT EXECUTED
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
4000e91c: 0056d693 srli a3,a3,0x5 <== NOT EXECUTED
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
4000e920: 00479793 slli a5,a5,0x4 <== NOT EXECUTED
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
4000e924: 00f6f693 andi a3,a3,15 <== NOT EXECUTED
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
4000e928: 00d787b3 add a5,a5,a3 <== NOT EXECUTED
if ( (key1) == ck)
4000e92c: faf494e3 bne s1,a5,4000e8d4 <fat_file_open+0x11c> <== NOT EXECUTED
if ( ((key2) == 0) || ((key2) == ffd->ino) )
4000e930: 00048663 beqz s1,4000e93c <fat_file_open+0x184> <== NOT EXECUTED
4000e934: 00c82783 lw a5,12(a6) <== NOT EXECUTED
4000e938: f8f49ee3 bne s1,a5,4000e8d4 <fat_file_open+0x11c> <== NOT EXECUTED
lfat_fd = (*fat_fd) = (fat_file_fd_t*)calloc(1, sizeof(fat_file_fd_t));
4000e93c: 05000593 li a1,80 <== NOT EXECUTED
4000e940: 00100513 li a0,1 <== NOT EXECUTED
4000e944: d60fd0ef jal ra,4000bea4 <calloc> <== NOT EXECUTED
4000e948: 00ab2023 sw a0,0(s6) <== NOT EXECUTED
4000e94c: 00050b93 mv s7,a0 <== NOT EXECUTED
if ( lfat_fd == NULL )
4000e950: 14050063 beqz a0,4000ea90 <fat_file_open+0x2d8> <== NOT EXECUTED
lfat_fd->flags &= ~FAT_FILE_REMOVED;
4000e954: 030bc783 lbu a5,48(s7) <== NOT EXECUTED
lfat_fd->dir_pos = *dir_pos;
4000e958: 00092583 lw a1,0(s2) <== NOT EXECUTED
4000e95c: 00492603 lw a2,4(s2) <== NOT EXECUTED
4000e960: 00892683 lw a3,8(s2) <== NOT EXECUTED
4000e964: 00c92703 lw a4,12(s2) <== NOT EXECUTED
lfat_fd->flags &= ~FAT_FILE_REMOVED;
4000e968: ffe7f793 andi a5,a5,-2 <== NOT EXECUTED
lfat_fd->links_num = 1;
4000e96c: 00100513 li a0,1 <== NOT EXECUTED
lfat_fd->flags &= ~FAT_FILE_REMOVED;
4000e970: 02fb8823 sb a5,48(s7) <== NOT EXECUTED
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
4000e974: fff00793 li a5,-1 <== NOT EXECUTED
lfat_fd->links_num = 1;
4000e978: 00aba423 sw a0,8(s7) <== NOT EXECUTED
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
4000e97c: 02fbae23 sw a5,60(s7) <== NOT EXECUTED
lfat_fd->dir_pos = *dir_pos;
4000e980: 02bba023 sw a1,32(s7) <== NOT EXECUTED
4000e984: 02cba223 sw a2,36(s7) <== NOT EXECUTED
4000e988: 02dba423 sw a3,40(s7) <== NOT EXECUTED
4000e98c: 02eba623 sw a4,44(s7) <== NOT EXECUTED
lfat_fd->ino = fat_get_unique_ino(fs_info);
4000e990: 00040513 mv a0,s0 <== NOT EXECUTED
4000e994: ce8ff0ef jal ra,4000de7c <fat_get_unique_ino> <== NOT EXECUTED
4000e998: 00aba623 sw a0,12(s7) <== NOT EXECUTED
if ( lfat_fd->ino == 0 )
4000e99c: 0e050663 beqz a0,4000ea88 <fat_file_open+0x2d0> <== NOT EXECUTED
rtems_chain_append_unprotected((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link);
4000e9a0: 08042a03 lw s4,128(s0) <== NOT EXECUTED
4000e9a4: 013a0a33 add s4,s4,s3 <== NOT EXECUTED
return &the_chain->Tail.Node;
4000e9a8: 004a0a93 addi s5,s4,4 <== NOT EXECUTED
4000e9ac: 0c00006f j 4000ea6c <fat_file_open+0x2b4> <== NOT EXECUTED
lfat_fd->links_num++;
4000e9b0: 00862783 lw a5,8(a2)
(*fat_fd) = lfat_fd;
4000e9b4: 00cb2023 sw a2,0(s6)
return rc;
4000e9b8: 00000513 li a0,0
lfat_fd->links_num++;
4000e9bc: 00178793 addi a5,a5,1
4000e9c0: 00f62423 sw a5,8(a2)
}
4000e9c4: 02c12083 lw ra,44(sp)
4000e9c8: 02812403 lw s0,40(sp)
4000e9cc: 02412483 lw s1,36(sp)
4000e9d0: 02012903 lw s2,32(sp)
4000e9d4: 01c12983 lw s3,28(sp)
4000e9d8: 01812a03 lw s4,24(sp)
4000e9dc: 01412a83 lw s5,20(sp)
4000e9e0: 01012b03 lw s6,16(sp)
4000e9e4: 00c12b83 lw s7,12(sp)
4000e9e8: 03010113 addi sp,sp,48
4000e9ec: 00008067 ret
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000e9f0: 01654683 lbu a3,22(a0)
4000e9f4: 0036f693 andi a3,a3,3
4000e9f8: e00684e3 beqz a3,4000e800 <fat_file_open+0x48> <== NEVER TAKEN
return fs_info->vol.rdir_loc;
4000e9fc: 02852783 lw a5,40(a0)
4000ea00: e15ff06f j 4000e814 <fat_file_open+0x5c>
4000ea04: 02842783 lw a5,40(s0) <== NOT EXECUTED
4000ea08: f05ff06f j 4000e90c <fat_file_open+0x154> <== NOT EXECUTED
4000ea0c: 02842783 lw a5,40(s0)
4000ea10: e7dff06f j 4000e88c <fat_file_open+0xd4>
lfat_fd = (*fat_fd) = (fat_file_fd_t*)calloc(1, sizeof(fat_file_fd_t));
4000ea14: 05000593 li a1,80
4000ea18: 00100513 li a0,1
4000ea1c: c88fd0ef jal ra,4000bea4 <calloc>
4000ea20: 00ab2023 sw a0,0(s6)
4000ea24: 00050b93 mv s7,a0
if ( lfat_fd == NULL )
4000ea28: 06050463 beqz a0,4000ea90 <fat_file_open+0x2d8> <== NEVER TAKEN
lfat_fd->flags &= ~FAT_FILE_REMOVED;
4000ea2c: 030bc783 lbu a5,48(s7)
lfat_fd->dir_pos = *dir_pos;
4000ea30: 00092583 lw a1,0(s2)
4000ea34: 00492603 lw a2,4(s2)
4000ea38: 00892683 lw a3,8(s2)
4000ea3c: 00c92703 lw a4,12(s2)
lfat_fd->flags &= ~FAT_FILE_REMOVED;
4000ea40: ffe7f793 andi a5,a5,-2
lfat_fd->links_num = 1;
4000ea44: 00100513 li a0,1
lfat_fd->flags &= ~FAT_FILE_REMOVED;
4000ea48: 02fb8823 sb a5,48(s7)
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
4000ea4c: fff00793 li a5,-1
lfat_fd->links_num = 1;
4000ea50: 00aba423 sw a0,8(s7)
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
4000ea54: 02fbae23 sw a5,60(s7)
lfat_fd->dir_pos = *dir_pos;
4000ea58: 02bba023 sw a1,32(s7)
4000ea5c: 02cba223 sw a2,36(s7)
4000ea60: 02dba423 sw a3,40(s7)
4000ea64: 02eba623 sw a4,44(s7)
lfat_fd->ino = key;
4000ea68: 009ba623 sw s1,12(s7)
old_last = tail->previous;
4000ea6c: 008a2783 lw a5,8(s4)
the_node->next = tail;
4000ea70: 015ba023 sw s5,0(s7)
tail->previous = the_node;
4000ea74: 017a2423 sw s7,8(s4)
old_last->next = the_node;
4000ea78: 0177a023 sw s7,0(a5)
the_node->previous = old_last;
4000ea7c: 00fba223 sw a5,4(s7)
return RC_OK;
4000ea80: 00000513 li a0,0
4000ea84: f41ff06f j 4000e9c4 <fat_file_open+0x20c>
free((*fat_fd));
4000ea88: 000b2503 lw a0,0(s6) <== NOT EXECUTED
4000ea8c: a35f20ef jal ra,400014c0 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000ea90: 4c80c0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000ea94: 00c00793 li a5,12 <== NOT EXECUTED
4000ea98: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000ea9c: fff00513 li a0,-1 <== NOT EXECUTED
4000eaa0: f25ff06f j 4000e9c4 <fat_file_open+0x20c> <== NOT EXECUTED
4000eb5c <fat_file_read>:
{
4000eb5c: fc010113 addi sp,sp,-64
4000eb60: 02112e23 sw ra,60(sp)
4000eb64: 02812c23 sw s0,56(sp)
4000eb68: 02912a23 sw s1,52(sp)
4000eb6c: 03212823 sw s2,48(sp)
4000eb70: 03312623 sw s3,44(sp)
4000eb74: 03412423 sw s4,40(sp)
4000eb78: 03512223 sw s5,36(sp)
4000eb7c: 03612023 sw s6,32(sp)
4000eb80: 01712e23 sw s7,28(sp)
4000eb84: 01812c23 sw s8,24(sp)
uint32_t cur_cln = 0;
4000eb88: 00012623 sw zero,12(sp)
if (count == 0)
4000eb8c: 10068a63 beqz a3,4000eca0 <fat_file_read+0x144> <== NEVER TAKEN
if ( start >= fat_fd->fat_file_size )
4000eb90: 0185a783 lw a5,24(a1)
4000eb94: 00050413 mv s0,a0
4000eb98: 00058a93 mv s5,a1
4000eb9c: 00060b93 mv s7,a2
return cmpltd;
4000eba0: 00000513 li a0,0
if ( start >= fat_fd->fat_file_size )
4000eba4: 10f67063 bgeu a2,a5,4000eca4 <fat_file_read+0x148>
4000eba8: 00068913 mv s2,a3
4000ebac: 00070a13 mv s4,a4
if ((count > fat_fd->fat_file_size) ||
4000ebb0: 12d7e263 bltu a5,a3,4000ecd4 <fat_file_read+0x178>
(start > fat_fd->fat_file_size - count))
4000ebb4: 40d78733 sub a4,a5,a3
if ((count > fat_fd->fat_file_size) ||
4000ebb8: 10c76e63 bltu a4,a2,4000ecd4 <fat_file_read+0x178>
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000ebbc: 020aa703 lw a4,32(s5)
4000ebc0: 00100793 li a5,1
4000ebc4: 00f71663 bne a4,a5,4000ebd0 <fat_file_read+0x74>
4000ebc8: 024aa783 lw a5,36(s5)
4000ebcc: 10078863 beqz a5,4000ecdc <fat_file_read+0x180> <== ALWAYS TAKEN
cl_start = start >> fs_info->vol.bpc_log2;
4000ebd0: 00c44b03 lbu s6,12(s0)
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
4000ebd4: 00c10693 addi a3,sp,12
4000ebd8: 000a8593 mv a1,s5
cl_start = start >> fs_info->vol.bpc_log2;
4000ebdc: 016bdb33 srl s6,s7,s6
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
4000ebe0: 000b0613 mv a2,s6
4000ebe4: 00040513 mv a0,s0
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
4000ebe8: 00842483 lw s1,8(s0)
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
4000ebec: af9ff0ef jal ra,4000e6e4 <fat_file_lseek>
if (rc != RC_OK)
4000ebf0: 0a051a63 bnez a0,4000eca4 <fat_file_read+0x148> <== NEVER TAKEN
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
4000ebf4: fff48493 addi s1,s1,-1
4000ebf8: 0174fbb3 and s7,s1,s7
4000ebfc: 000b8693 mv a3,s7
uint32_t cmpltd = 0;
4000ec00: 00000993 li s3,0
4000ec04: 06c0006f j 4000ec70 <fat_file_read+0x114>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000ec08: 00544703 lbu a4,5(s0)
4000ec0c: 03c42783 lw a5,60(s0)
4000ec10: 00e595b3 sll a1,a1,a4
4000ec14: 00f587b3 add a5,a1,a5
byte = ofs & (fs_info->vol.bps - 1);
4000ec18: 00045603 lhu a2,0(s0)
sec += (ofs >> fs_info->vol.sec_log2);
4000ec1c: 00244583 lbu a1,2(s0)
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
4000ec20: 013a0733 add a4,s4,s3
byte = ofs & (fs_info->vol.bps - 1);
4000ec24: fff60613 addi a2,a2,-1
sec += (ofs >> fs_info->vol.sec_log2);
4000ec28: 00b6d5b3 srl a1,a3,a1
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
4000ec2c: 00d67633 and a2,a2,a3
4000ec30: 00f585b3 add a1,a1,a5
4000ec34: 00048693 mv a3,s1
4000ec38: 00040513 mv a0,s0
4000ec3c: b28fe0ef jal ra,4000cf64 <_fat_block_read>
4000ec40: 00050793 mv a5,a0
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
4000ec44: 00c10613 addi a2,sp,12
4000ec48: 00040513 mv a0,s0
if ( ret < 0 )
4000ec4c: 0e07c263 bltz a5,4000ed30 <fat_file_read+0x1d4> <== NEVER TAKEN
save_cln = cur_cln;
4000ec50: 00c12c03 lw s8,12(sp)
count -= c;
4000ec54: 40990933 sub s2,s2,s1
cmpltd += c;
4000ec58: 009989b3 add s3,s3,s1
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
4000ec5c: 000c0593 mv a1,s8
4000ec60: b38ff0ef jal ra,4000df98 <fat_get_fat_cluster>
if ( rc != RC_OK )
4000ec64: 04051063 bnez a0,4000eca4 <fat_file_read+0x148> <== NEVER TAKEN
ofs = 0;
4000ec68: 00000693 li a3,0
while (count > 0)
4000ec6c: 0c090663 beqz s2,4000ed38 <fat_file_read+0x1dc>
c = MIN(count, (fs_info->vol.bpc - ofs));
4000ec70: 00842483 lw s1,8(s0)
4000ec74: 40d484b3 sub s1,s1,a3
4000ec78: 00997463 bgeu s2,s1,4000ec80 <fat_file_read+0x124>
4000ec7c: 00090493 mv s1,s2
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
4000ec80: 00c12783 lw a5,12(sp)
4000ec84: ffe78593 addi a1,a5,-2
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000ec88: f80790e3 bnez a5,4000ec08 <fat_file_read+0xac> <== ALWAYS TAKEN
4000ec8c: 01644783 lbu a5,22(s0) <== NOT EXECUTED
4000ec90: 0037f793 andi a5,a5,3 <== NOT EXECUTED
4000ec94: f6078ae3 beqz a5,4000ec08 <fat_file_read+0xac> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
4000ec98: 02842783 lw a5,40(s0) <== NOT EXECUTED
4000ec9c: f7dff06f j 4000ec18 <fat_file_read+0xbc> <== NOT EXECUTED
return cmpltd;
4000eca0: 00000513 li a0,0 <== NOT EXECUTED
}
4000eca4: 03c12083 lw ra,60(sp)
4000eca8: 03812403 lw s0,56(sp)
4000ecac: 03412483 lw s1,52(sp)
4000ecb0: 03012903 lw s2,48(sp)
4000ecb4: 02c12983 lw s3,44(sp)
4000ecb8: 02812a03 lw s4,40(sp)
4000ecbc: 02412a83 lw s5,36(sp)
4000ecc0: 02012b03 lw s6,32(sp)
4000ecc4: 01c12b83 lw s7,28(sp)
4000ecc8: 01812c03 lw s8,24(sp)
4000eccc: 04010113 addi sp,sp,64
4000ecd0: 00008067 ret
count = fat_fd->fat_file_size - start;
4000ecd4: 41778933 sub s2,a5,s7
4000ecd8: ee5ff06f j 4000ebbc <fat_file_read+0x60>
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000ecdc: 01644783 lbu a5,22(s0)
4000ece0: 0037f793 andi a5,a5,3
4000ece4: ee0786e3 beqz a5,4000ebd0 <fat_file_read+0x74>
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln);
4000ece8: 01caa783 lw a5,28(s5)
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000ecec: 06078863 beqz a5,4000ed5c <fat_file_read+0x200> <== ALWAYS TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000ecf0: 00544683 lbu a3,5(s0) <== NOT EXECUTED
4000ecf4: 03c42703 lw a4,60(s0) <== NOT EXECUTED
4000ecf8: ffe78793 addi a5,a5,-2 <== NOT EXECUTED
4000ecfc: 00d797b3 sll a5,a5,a3 <== NOT EXECUTED
4000ed00: 00e787b3 add a5,a5,a4 <== NOT EXECUTED
byte = start & (fs_info->vol.bps - 1);
4000ed04: 00045603 lhu a2,0(s0)
sec += (start >> fs_info->vol.sec_log2);
4000ed08: 00244583 lbu a1,2(s0)
ret = _fat_block_read(fs_info, sec, byte, count, buf);
4000ed0c: 000a0713 mv a4,s4
byte = start & (fs_info->vol.bps - 1);
4000ed10: fff60613 addi a2,a2,-1
sec += (start >> fs_info->vol.sec_log2);
4000ed14: 00bbd5b3 srl a1,s7,a1
ret = _fat_block_read(fs_info, sec, byte, count, buf);
4000ed18: 00090693 mv a3,s2
4000ed1c: 01767633 and a2,a2,s7
4000ed20: 00f585b3 add a1,a1,a5
4000ed24: 00040513 mv a0,s0
4000ed28: a3cfe0ef jal ra,4000cf64 <_fat_block_read>
if ( ret < 0 )
4000ed2c: f6055ce3 bgez a0,4000eca4 <fat_file_read+0x148> <== ALWAYS TAKEN
return -1;
4000ed30: fff00513 li a0,-1 <== NOT EXECUTED
4000ed34: f71ff06f j 4000eca4 <fat_file_read+0x148> <== NOT EXECUTED
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
4000ed38: 00c44703 lbu a4,12(s0)
4000ed3c: fffb8793 addi a5,s7,-1
4000ed40: 013787b3 add a5,a5,s3
4000ed44: 00e7d7b3 srl a5,a5,a4
fat_fd->map.file_cln = cl_start +
4000ed48: 01678b33 add s6,a5,s6
4000ed4c: 036aaa23 sw s6,52(s5)
fat_fd->map.disk_cln = save_cln;
4000ed50: 038aac23 sw s8,56(s5)
return cmpltd;
4000ed54: 00098513 mv a0,s3
4000ed58: f4dff06f j 4000eca4 <fat_file_read+0x148>
return fs_info->vol.rdir_loc;
4000ed5c: 02842783 lw a5,40(s0)
4000ed60: fa5ff06f j 4000ed04 <fat_file_read+0x1a8>
4000f4c4 <fat_file_size>:
{
4000f4c4: fe010113 addi sp,sp,-32
4000f4c8: 01212823 sw s2,16(sp)
uint32_t cur_cln = fat_fd->cln;
4000f4cc: 01c5a903 lw s2,28(a1)
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000f4d0: 0205a703 lw a4,32(a1)
{
4000f4d4: 00812c23 sw s0,24(sp)
4000f4d8: 00912a23 sw s1,20(sp)
4000f4dc: 00112e23 sw ra,28(sp)
uint32_t cur_cln = fat_fd->cln;
4000f4e0: 01212623 sw s2,12(sp)
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000f4e4: 00100793 li a5,1
{
4000f4e8: 00058493 mv s1,a1
4000f4ec: 00050413 mv s0,a0
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000f4f0: 08f70a63 beq a4,a5,4000f584 <fat_file_size+0xc0>
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000f4f4: 01842783 lw a5,24(s0)
4000f4f8: 01c42703 lw a4,28(s0)
fat_fd->fat_file_size = 0;
4000f4fc: 0004ac23 sw zero,24(s1)
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000f500: 00f977b3 and a5,s2,a5
4000f504: 02e7e863 bltu a5,a4,4000f534 <fat_file_size+0x70>
4000f508: 0580006f j 4000f560 <fat_file_size+0x9c> <== NOT EXECUTED
fat_fd->fat_file_size += fs_info->vol.bpc;
4000f50c: 0184a703 lw a4,24(s1)
4000f510: 00842583 lw a1,8(s0)
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000f514: 01842783 lw a5,24(s0)
4000f518: 00c12683 lw a3,12(sp)
4000f51c: 01c42603 lw a2,28(s0)
fat_fd->fat_file_size += fs_info->vol.bpc;
4000f520: 00b70733 add a4,a4,a1
4000f524: 00e4ac23 sw a4,24(s1)
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000f528: 00f6f7b3 and a5,a3,a5
4000f52c: 02c7fc63 bgeu a5,a2,4000f564 <fat_file_size+0xa0>
4000f530: 00068913 mv s2,a3
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
4000f534: 00090593 mv a1,s2
4000f538: 00c10613 addi a2,sp,12
4000f53c: 00040513 mv a0,s0
4000f540: a59fe0ef jal ra,4000df98 <fat_get_fat_cluster>
if ( rc != RC_OK )
4000f544: fc0504e3 beqz a0,4000f50c <fat_file_size+0x48> <== ALWAYS TAKEN
}
4000f548: 01c12083 lw ra,28(sp)
4000f54c: 01812403 lw s0,24(sp)
4000f550: 01412483 lw s1,20(sp)
4000f554: 01012903 lw s2,16(sp)
4000f558: 02010113 addi sp,sp,32
4000f55c: 00008067 ret
uint32_t save_cln = 0;
4000f560: 00000913 li s2,0 <== NOT EXECUTED
}
4000f564: 01c12083 lw ra,28(sp)
4000f568: 01812403 lw s0,24(sp)
fat_fd->map.last_cln = save_cln;
4000f56c: 0324ae23 sw s2,60(s1)
return rc;
4000f570: 00000513 li a0,0
}
4000f574: 01412483 lw s1,20(sp)
4000f578: 01012903 lw s2,16(sp)
4000f57c: 02010113 addi sp,sp,32
4000f580: 00008067 ret
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
4000f584: 0245a783 lw a5,36(a1)
4000f588: f60796e3 bnez a5,4000f4f4 <fat_file_size+0x30> <== NEVER TAKEN
4000f58c: 01654783 lbu a5,22(a0)
4000f590: 0037f793 andi a5,a5,3
4000f594: f60780e3 beqz a5,4000f4f4 <fat_file_size+0x30>
fat_fd->fat_file_size = fs_info->vol.rdir_size;
4000f598: 03452783 lw a5,52(a0)
return rc;
4000f59c: 00000513 li a0,0
fat_fd->fat_file_size = fs_info->vol.rdir_size;
4000f5a0: 00f5ac23 sw a5,24(a1)
return rc;
4000f5a4: fa5ff06f j 4000f548 <fat_file_size+0x84>
4000ed64 <fat_file_truncate>:
if ( new_length >= fat_fd->fat_file_size )
4000ed64: 0185a783 lw a5,24(a1)
{
4000ed68: fe010113 addi sp,sp,-32
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
4000ed6c: fff00713 li a4,-1
{
4000ed70: 00112e23 sw ra,28(sp)
4000ed74: 00812c23 sw s0,24(sp)
4000ed78: 00912a23 sw s1,20(sp)
4000ed7c: 01212823 sw s2,16(sp)
uint32_t cur_cln = 0;
4000ed80: 00012423 sw zero,8(sp)
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
4000ed84: 00e12623 sw a4,12(sp)
if ( new_length >= fat_fd->fat_file_size )
4000ed88: 06f67663 bgeu a2,a5,4000edf4 <fat_file_truncate+0x90>
assert(fat_fd->fat_file_size);
4000ed8c: 0a078863 beqz a5,4000ee3c <fat_file_truncate+0xd8> <== NEVER TAKEN
cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2;
4000ed90: 00852403 lw s0,8(a0)
4000ed94: 00c54703 lbu a4,12(a0)
4000ed98: 00050493 mv s1,a0
4000ed9c: 00860433 add s0,a2,s0
4000eda0: fff40413 addi s0,s0,-1
4000eda4: 00e45433 srl s0,s0,a4
if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size)
4000eda8: 00e41733 sll a4,s0,a4
4000edac: 04f77463 bgeu a4,a5,4000edf4 <fat_file_truncate+0x90>
4000edb0: 00058913 mv s2,a1
if (cl_start != 0)
4000edb4: 00040a63 beqz s0,4000edc8 <fat_file_truncate+0x64>
rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln);
4000edb8: 00c10693 addi a3,sp,12
4000edbc: fff40613 addi a2,s0,-1
4000edc0: 925ff0ef jal ra,4000e6e4 <fat_file_lseek>
if (rc != RC_OK)
4000edc4: 02051a63 bnez a0,4000edf8 <fat_file_truncate+0x94> <== NEVER TAKEN
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
4000edc8: 00810693 addi a3,sp,8
4000edcc: 00040613 mv a2,s0
4000edd0: 00090593 mv a1,s2
4000edd4: 00048513 mv a0,s1
4000edd8: 90dff0ef jal ra,4000e6e4 <fat_file_lseek>
if (rc != RC_OK)
4000eddc: 00051e63 bnez a0,4000edf8 <fat_file_truncate+0x94> <== NEVER TAKEN
rc = fat_free_fat_clusters_chain(fs_info, cur_cln);
4000ede0: 00812583 lw a1,8(sp)
4000ede4: 00048513 mv a0,s1
4000ede8: dfcff0ef jal ra,4000e3e4 <fat_free_fat_clusters_chain>
if (rc != RC_OK)
4000edec: 00051663 bnez a0,4000edf8 <fat_file_truncate+0x94> <== NEVER TAKEN
if (cl_start != 0)
4000edf0: 02041063 bnez s0,4000ee10 <fat_file_truncate+0xac>
return rc;
4000edf4: 00000513 li a0,0
}
4000edf8: 01c12083 lw ra,28(sp)
4000edfc: 01812403 lw s0,24(sp)
4000ee00: 01412483 lw s1,20(sp)
4000ee04: 01012903 lw s2,16(sp)
4000ee08: 02010113 addi sp,sp,32
4000ee0c: 00008067 ret
rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC);
4000ee10: 00c12583 lw a1,12(sp)
4000ee14: fff00613 li a2,-1
4000ee18: 00048513 mv a0,s1
4000ee1c: b38ff0ef jal ra,4000e154 <fat_set_fat_cluster>
if ( rc != RC_OK )
4000ee20: fc051ce3 bnez a0,4000edf8 <fat_file_truncate+0x94> <== NEVER TAKEN
fat_fd->map.disk_cln = new_last_cln;
4000ee24: 00c12783 lw a5,12(sp)
fat_fd->map.file_cln = cl_start - 1;
4000ee28: fff40413 addi s0,s0,-1
4000ee2c: 02892a23 sw s0,52(s2)
fat_fd->map.disk_cln = new_last_cln;
4000ee30: 02f92c23 sw a5,56(s2)
fat_fd->map.last_cln = new_last_cln;
4000ee34: 02f92e23 sw a5,60(s2)
4000ee38: fc1ff06f j 4000edf8 <fat_file_truncate+0x94>
assert(fat_fd->fat_file_size);
4000ee3c: 400266b7 lui a3,0x40026 <== NOT EXECUTED
4000ee40: 40026637 lui a2,0x40026 <== NOT EXECUTED
4000ee44: 40026537 lui a0,0x40026 <== NOT EXECUTED
4000ee48: d5068693 addi a3,a3,-688 # 40025d50 <rtems_blkdev_imfs_node+0x78><== NOT EXECUTED
4000ee4c: d9460613 addi a2,a2,-620 # 40025d94 <__func__.0> <== NOT EXECUTED
4000ee50: 2e400593 li a1,740 <== NOT EXECUTED
4000ee54: d6850513 addi a0,a0,-664 # 40025d68 <rtems_blkdev_imfs_node+0x90><== NOT EXECUTED
4000ee58: 334070ef jal ra,4001618c <__assert_func> <== NOT EXECUTED
4000eabc <fat_file_update>:
{
4000eabc: ff010113 addi sp,sp,-16 <== NOT EXECUTED
4000eac0: 01212023 sw s2,0(sp) <== NOT EXECUTED
4000eac4: 00112623 sw ra,12(sp) <== NOT EXECUTED
4000eac8: 00812423 sw s0,8(sp) <== NOT EXECUTED
4000eacc: 00912223 sw s1,4(sp) <== NOT EXECUTED
return (fat_fd->flags & FAT_FILE_REMOVED) != 0;
4000ead0: 0305c783 lbu a5,48(a1) <== NOT EXECUTED
int ret_rc = RC_OK;
4000ead4: 00000913 li s2,0 <== NOT EXECUTED
if (!FAT_FILE_IS_REMOVED(fat_fd) &&
4000ead8: 0017f713 andi a4,a5,1 <== NOT EXECUTED
4000eadc: 06071263 bnez a4,4000eb40 <fat_file_update+0x84> <== NOT EXECUTED
4000eae0: 0027f793 andi a5,a5,2 <== NOT EXECUTED
int ret_rc = RC_OK;
4000eae4: 00000913 li s2,0 <== NOT EXECUTED
if (!FAT_FILE_IS_REMOVED(fat_fd) &&
4000eae8: 04078c63 beqz a5,4000eb40 <fat_file_update+0x84> <== NOT EXECUTED
FAT_FILE_HAS_META_DATA_CHANGED(fat_fd) &&
4000eaec: 0205a703 lw a4,32(a1) <== NOT EXECUTED
4000eaf0: 00100793 li a5,1 <== NOT EXECUTED
4000eaf4: 00058413 mv s0,a1 <== NOT EXECUTED
4000eaf8: 00050493 mv s1,a0 <== NOT EXECUTED
4000eafc: 00f71663 bne a4,a5,4000eb08 <fat_file_update+0x4c> <== NOT EXECUTED
!FAT_FD_OF_ROOT_DIR(fat_fd))
4000eb00: 0245a783 lw a5,36(a1) <== NOT EXECUTED
4000eb04: 02078e63 beqz a5,4000eb40 <fat_file_update+0x84> <== NOT EXECUTED
rc = fat_file_write_first_cluster_num(fs_info, fat_fd);
4000eb08: 00040593 mv a1,s0 <== NOT EXECUTED
4000eb0c: 00048513 mv a0,s1 <== NOT EXECUTED
4000eb10: 175010ef jal ra,40010484 <fat_file_write_first_cluster_num> <== NOT EXECUTED
4000eb14: 00050913 mv s2,a0 <== NOT EXECUTED
rc = fat_file_write_file_size(fs_info, fat_fd);
4000eb18: 00040593 mv a1,s0 <== NOT EXECUTED
4000eb1c: 00048513 mv a0,s1 <== NOT EXECUTED
4000eb20: 245010ef jal ra,40010564 <fat_file_write_file_size> <== NOT EXECUTED
if (rc != RC_OK)
4000eb24: 00050463 beqz a0,4000eb2c <fat_file_update+0x70> <== NOT EXECUTED
4000eb28: 00050913 mv s2,a0 <== NOT EXECUTED
rc = fat_file_write_time_and_date(fs_info, fat_fd);
4000eb2c: 00040593 mv a1,s0 <== NOT EXECUTED
4000eb30: 00048513 mv a0,s1 <== NOT EXECUTED
4000eb34: 7f0010ef jal ra,40010324 <fat_file_write_time_and_date> <== NOT EXECUTED
if (rc != RC_OK)
4000eb38: 00050463 beqz a0,4000eb40 <fat_file_update+0x84> <== NOT EXECUTED
4000eb3c: 00050913 mv s2,a0 <== NOT EXECUTED
}
4000eb40: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4000eb44: 00812403 lw s0,8(sp) <== NOT EXECUTED
4000eb48: 00412483 lw s1,4(sp) <== NOT EXECUTED
4000eb4c: 00090513 mv a0,s2 <== NOT EXECUTED
4000eb50: 00012903 lw s2,0(sp) <== NOT EXECUTED
4000eb54: 01010113 addi sp,sp,16 <== NOT EXECUTED
4000eb58: 00008067 ret <== NOT EXECUTED
4000f270 <fat_file_write>:
{
4000f270: fc010113 addi sp,sp,-64
4000f274: 02112e23 sw ra,60(sp)
4000f278: 02812c23 sw s0,56(sp)
4000f27c: 02912a23 sw s1,52(sp)
4000f280: 03212823 sw s2,48(sp)
4000f284: 03312623 sw s3,44(sp)
4000f288: 03412423 sw s4,40(sp)
4000f28c: 03512223 sw s5,36(sp)
4000f290: 03612023 sw s6,32(sp)
4000f294: 01712e23 sw s7,28(sp)
uint32_t c = 0;
4000f298: 00012423 sw zero,8(sp)
if ( count == 0 )
4000f29c: 10068e63 beqz a3,4000f3b8 <fat_file_write+0x148> <== NEVER TAKEN
if (start >= fat_fd->size_limit)
4000f2a0: 0145a403 lw s0,20(a1)
4000f2a4: 00058b93 mv s7,a1
4000f2a8: 00060913 mv s2,a2
4000f2ac: 1a867663 bgeu a2,s0,4000f458 <fat_file_write+0x1e8>
if (count > fat_fd->size_limit - start)
4000f2b0: 40c40433 sub s0,s0,a2
4000f2b4: 00050493 mv s1,a0
4000f2b8: 00070993 mv s3,a4
4000f2bc: 0e86ea63 bltu a3,s0,4000f3b0 <fat_file_write+0x140>
bool zero_fill = start > fat_fd->fat_file_size;
4000f2c0: 018ba603 lw a2,24(s7)
rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c);
4000f2c4: 00890a33 add s4,s2,s0
4000f2c8: 00810713 addi a4,sp,8
4000f2cc: 000a0693 mv a3,s4
4000f2d0: 01263633 sltu a2,a2,s2
4000f2d4: 000b8593 mv a1,s7
4000f2d8: 00048513 mv a0,s1
4000f2dc: d2dff0ef jal ra,4000f008 <fat_file_extend>
if (RC_OK == rc)
4000f2e0: 0a051263 bnez a0,4000f384 <fat_file_write+0x114>
if (c != (start + count))
4000f2e4: 00812783 lw a5,8(sp)
4000f2e8: 00fa0463 beq s4,a5,4000f2f0 <fat_file_write+0x80>
count = c - start;
4000f2ec: 41278433 sub s0,a5,s2
cln += (start >> fs_info->vol.bpc_log2);
4000f2f0: 00c4ca83 lbu s5,12(s1)
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
4000f2f4: 020ba703 lw a4,32(s7)
4000f2f8: 00100793 li a5,1
cln += (start >> fs_info->vol.bpc_log2);
4000f2fc: 01595a33 srl s4,s2,s5
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
4000f300: 0cf70063 beq a4,a5,4000f3c0 <fat_file_write+0x150>
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
4000f304: 00c10693 addi a3,sp,12
4000f308: 000a0613 mv a2,s4
4000f30c: 000b8593 mv a1,s7
4000f310: 00048513 mv a0,s1
uint32_t cur_cln = 0;
4000f314: 00012623 sw zero,12(sp)
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
4000f318: bccff0ef jal ra,4000e6e4 <fat_file_lseek>
if (RC_OK == rc)
4000f31c: 06051263 bnez a0,4000f380 <fat_file_write+0x110> <== NEVER TAKEN
uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2);
4000f320: 015a1ab3 sll s5,s4,s5
4000f324: 41590933 sub s2,s2,s5
4000f328: 00090793 mv a5,s2
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
4000f32c: 00000b13 li s6,0
uint32_t cmpltd = 0;
4000f330: 00000a93 li s5,0
ret = fat_cluster_write(fs_info,
4000f334: 00078613 mv a2,a5
4000f338: 00048513 mv a0,s1
&& (bytes_to_write > 0))
4000f33c: 0c040463 beqz s0,4000f404 <fat_file_write+0x194> <== NEVER TAKEN
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
4000f340: 0084a683 lw a3,8(s1)
&buf[cmpltd]);
4000f344: 01598733 add a4,s3,s5
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
4000f348: 40f686b3 sub a3,a3,a5
4000f34c: 00d47463 bgeu s0,a3,4000f354 <fat_file_write+0xe4>
4000f350: 00040693 mv a3,s0
ret = fat_cluster_write(fs_info,
4000f354: 00c12583 lw a1,12(sp)
4000f358: fb9fd0ef jal ra,4000d310 <fat_cluster_write>
if (0 > ret)
4000f35c: 0c055863 bgez a0,4000f42c <fat_file_write+0x1bc> <== ALWAYS TAKEN
rc = -1;
4000f360: fff00513 li a0,-1 <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
4000f364: 00c4c703 lbu a4,12(s1) <== NOT EXECUTED
4000f368: fff90793 addi a5,s2,-1 <== NOT EXECUTED
4000f36c: 015787b3 add a5,a5,s5 <== NOT EXECUTED
4000f370: 00e7d7b3 srl a5,a5,a4 <== NOT EXECUTED
fat_fd->map.file_cln = start_cln +
4000f374: 01478a33 add s4,a5,s4 <== NOT EXECUTED
4000f378: 034baa23 sw s4,52(s7) <== NOT EXECUTED
fat_fd->map.disk_cln = save_cln;
4000f37c: 036bac23 sw s6,56(s7) <== NOT EXECUTED
if (0 > ret)
4000f380: 06054e63 bltz a0,4000f3fc <fat_file_write+0x18c> <== NOT EXECUTED
}
4000f384: 03c12083 lw ra,60(sp)
4000f388: 03812403 lw s0,56(sp)
4000f38c: 03412483 lw s1,52(sp)
4000f390: 03012903 lw s2,48(sp)
4000f394: 02c12983 lw s3,44(sp)
4000f398: 02812a03 lw s4,40(sp)
4000f39c: 02412a83 lw s5,36(sp)
4000f3a0: 02012b03 lw s6,32(sp)
4000f3a4: 01c12b83 lw s7,28(sp)
4000f3a8: 04010113 addi sp,sp,64
4000f3ac: 00008067 ret
4000f3b0: 00068413 mv s0,a3
4000f3b4: f0dff06f j 4000f2c0 <fat_file_write+0x50>
return cmpltd;
4000f3b8: 00000513 li a0,0 <== NOT EXECUTED
4000f3bc: fc9ff06f j 4000f384 <fat_file_write+0x114> <== NOT EXECUTED
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
4000f3c0: 024ba783 lw a5,36(s7)
4000f3c4: f40790e3 bnez a5,4000f304 <fat_file_write+0x94> <== NEVER TAKEN
4000f3c8: 0164c783 lbu a5,22(s1)
4000f3cc: 0037f793 andi a5,a5,3
4000f3d0: f2078ae3 beqz a5,4000f304 <fat_file_write+0x94>
byte = start & (fs_info->vol.bpc -1);
4000f3d4: 0084a603 lw a2,8(s1)
cln = fat_fd->cln;
4000f3d8: 01cba583 lw a1,28(s7)
ret = fat_cluster_write(fs_info,
4000f3dc: 00098713 mv a4,s3
byte = start & (fs_info->vol.bpc -1);
4000f3e0: fff60613 addi a2,a2,-1
ret = fat_cluster_write(fs_info,
4000f3e4: 00040693 mv a3,s0
4000f3e8: 01267633 and a2,a2,s2
4000f3ec: 014585b3 add a1,a1,s4
4000f3f0: 00048513 mv a0,s1
4000f3f4: f1dfd0ef jal ra,4000d310 <fat_cluster_write>
if (0 > ret)
4000f3f8: f80556e3 bgez a0,4000f384 <fat_file_write+0x114> <== ALWAYS TAKEN
rc = -1;
4000f3fc: fff00513 li a0,-1 <== NOT EXECUTED
4000f400: f85ff06f j 4000f384 <fat_file_write+0x114> <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
4000f404: 00c4c783 lbu a5,12(s1)
4000f408: fff90913 addi s2,s2,-1
4000f40c: 01590933 add s2,s2,s5
4000f410: 00f95933 srl s2,s2,a5
fat_fd->map.file_cln = start_cln +
4000f414: 01490a33 add s4,s2,s4
4000f418: 034baa23 sw s4,52(s7)
fat_fd->map.disk_cln = save_cln;
4000f41c: 036bac23 sw s6,56(s7)
return cmpltd;
4000f420: 000a8513 mv a0,s5
if (0 > ret)
4000f424: f60550e3 bgez a0,4000f384 <fat_file_write+0x114> <== ALWAYS TAKEN
4000f428: fd5ff06f j 4000f3fc <fat_file_write+0x18c> <== NOT EXECUTED
bytes_to_write -= ret;
4000f42c: 40a40433 sub s0,s0,a0
save_cln = cur_cln;
4000f430: 00c12b03 lw s6,12(sp)
cmpltd += ret;
4000f434: 00aa8ab3 add s5,s5,a0
if (0 < bytes_to_write)
4000f438: fc0406e3 beqz s0,4000f404 <fat_file_write+0x194>
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
4000f43c: 00c10613 addi a2,sp,12
4000f440: 000b0593 mv a1,s6
4000f444: 00048513 mv a0,s1
4000f448: b51fe0ef jal ra,4000df98 <fat_get_fat_cluster>
while ( (RC_OK == rc)
4000f44c: 00000793 li a5,0
4000f450: ee0502e3 beqz a0,4000f334 <fat_file_write+0xc4> <== ALWAYS TAKEN
4000f454: f11ff06f j 4000f364 <fat_file_write+0xf4> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EFBIG);
4000f458: 3010b0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000f45c: 01b00793 li a5,27 <== NOT EXECUTED
4000f460: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000f464: fff00513 li a0,-1 <== NOT EXECUTED
4000f468: f1dff06f j 4000f384 <fat_file_write+0x114> <== NOT EXECUTED
40010564 <fat_file_write_file_size>:
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->dir_pos.sname.cln);
40010564: 0205a783 lw a5,32(a1)
{
40010568: fe010113 addi sp,sp,-32
4001056c: 00112e23 sw ra,28(sp)
uint32_t le_new_length = 0;
40010570: 00012623 sw zero,12(sp)
{
40010574: 00058713 mv a4,a1
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
40010578: 00079863 bnez a5,40010588 <fat_file_write_file_size+0x24>
4001057c: 01654683 lbu a3,22(a0)
40010580: 0036f693 andi a3,a3,3
40010584: 06069263 bnez a3,400105e8 <fat_file_write_file_size+0x84> <== ALWAYS TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
40010588: 00554683 lbu a3,5(a0)
4001058c: 03c52583 lw a1,60(a0)
40010590: ffe78793 addi a5,a5,-2
40010594: 00d797b3 sll a5,a5,a3
40010598: 00b787b3 add a5,a5,a1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
4001059c: 02472683 lw a3,36(a4)
400105a0: 00254583 lbu a1,2(a0)
byte = (fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1));
400105a4: 00055603 lhu a2,0(a0)
if (fat_fd->fat_file_type == FAT_DIRECTORY) {
400105a8: 01072803 lw a6,16(a4)
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
400105ac: 00b6d5b3 srl a1,a3,a1
byte = (fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1));
400105b0: fff60613 addi a2,a2,-1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
400105b4: 00f585b3 add a1,a1,a5
byte = (fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1));
400105b8: 00d67633 and a2,a2,a3
if (fat_fd->fat_file_type == FAT_DIRECTORY) {
400105bc: 00080663 beqz a6,400105c8 <fat_file_write_file_size+0x64>
le_new_length = CT_LE_L(fat_fd->fat_file_size);
400105c0: 01872783 lw a5,24(a4)
400105c4: 00f12623 sw a5,12(sp)
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_SIZE_OFFSET, 4,
400105c8: 00c10713 addi a4,sp,12
400105cc: 00400693 li a3,4
400105d0: 01c60613 addi a2,a2,28
400105d4: ac5fc0ef jal ra,4000d098 <fat_sector_write>
}
400105d8: 01c12083 lw ra,28(sp)
400105dc: 41f55513 srai a0,a0,0x1f
400105e0: 02010113 addi sp,sp,32
400105e4: 00008067 ret
return fs_info->vol.rdir_loc;
400105e8: 02852783 lw a5,40(a0)
400105ec: fb1ff06f j 4001059c <fat_file_write_file_size+0x38>
40010484 <fat_file_write_first_cluster_num>:
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->dir_pos.sname.cln);
40010484: 0205a783 lw a5,32(a1)
{
40010488: fd010113 addi sp,sp,-48
4001048c: 02812423 sw s0,40(sp)
40010490: 01312e23 sw s3,28(sp)
40010494: 02112623 sw ra,44(sp)
40010498: 02912223 sw s1,36(sp)
4001049c: 03212023 sw s2,32(sp)
uint16_t le_cl_hi = 0;
400104a0: 00011723 sh zero,14(sp)
uint32_t new_cln = fat_fd->cln;
400104a4: 01c5a983 lw s3,28(a1)
{
400104a8: 00050413 mv s0,a0
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
400104ac: 00079863 bnez a5,400104bc <fat_file_write_first_cluster_num+0x38>
400104b0: 01654703 lbu a4,22(a0)
400104b4: 00377713 andi a4,a4,3
400104b8: 08071e63 bnez a4,40010554 <fat_file_write_first_cluster_num+0xd0><== ALWAYS TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
400104bc: 00544683 lbu a3,5(s0)
400104c0: 03c42703 lw a4,60(s0)
400104c4: ffe78793 addi a5,a5,-2
400104c8: 00d797b3 sll a5,a5,a3
400104cc: 00e787b3 add a5,a5,a4
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
400104d0: 0245a683 lw a3,36(a1)
400104d4: 00244483 lbu s1,2(s0)
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
400104d8: 00045903 lhu s2,0(s0)
ret1 = fat_sector_write(fs_info, sec,
400104dc: 00c10713 addi a4,sp,12
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
400104e0: 0096d4b3 srl s1,a3,s1
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
400104e4: fff90913 addi s2,s2,-1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
400104e8: 00f484b3 add s1,s1,a5
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
400104ec: 00d97933 and s2,s2,a3
ret1 = fat_sector_write(fs_info, sec,
400104f0: 01a90613 addi a2,s2,26
400104f4: 00200693 li a3,2
400104f8: 00048593 mv a1,s1
400104fc: 00040513 mv a0,s0
le_cl_low = CT_LE_W((uint16_t )(new_cln & 0x0000FFFF));
40010500: 01311623 sh s3,12(sp)
ret1 = fat_sector_write(fs_info, sec,
40010504: b95fc0ef jal ra,4000d098 <fat_sector_write>
40010508: 00050793 mv a5,a0
le_cl_hi = CT_LE_W((uint16_t )((new_cln & 0xFFFF0000) >> 16));
4001050c: 0109d993 srli s3,s3,0x10
ret2 = fat_sector_write(fs_info, sec,
40010510: 00040513 mv a0,s0
40010514: 00e10713 addi a4,sp,14
ret1 = fat_sector_write(fs_info, sec,
40010518: 00078413 mv s0,a5
ret2 = fat_sector_write(fs_info, sec,
4001051c: 00200693 li a3,2
40010520: 01490613 addi a2,s2,20
40010524: 00048593 mv a1,s1
le_cl_hi = CT_LE_W((uint16_t )((new_cln & 0xFFFF0000) >> 16));
40010528: 01311723 sh s3,14(sp)
ret2 = fat_sector_write(fs_info, sec,
4001052c: b6dfc0ef jal ra,4000d098 <fat_sector_write>
if ( (ret1 < 0) || (ret2 < 0) )
40010530: 02044663 bltz s0,4001055c <fat_file_write_first_cluster_num+0xd8><== NEVER TAKEN
40010534: 41f55513 srai a0,a0,0x1f
}
40010538: 02c12083 lw ra,44(sp)
4001053c: 02812403 lw s0,40(sp)
40010540: 02412483 lw s1,36(sp)
40010544: 02012903 lw s2,32(sp)
40010548: 01c12983 lw s3,28(sp)
4001054c: 03010113 addi sp,sp,48
40010550: 00008067 ret
return fs_info->vol.rdir_loc;
40010554: 02852783 lw a5,40(a0)
40010558: f79ff06f j 400104d0 <fat_file_write_first_cluster_num+0x4c>
return -1;
4001055c: fff00513 li a0,-1 <== NOT EXECUTED
40010560: fd9ff06f j 40010538 <fat_file_write_first_cluster_num+0xb4> <== NOT EXECUTED
40010324 <fat_file_write_time_and_date>:
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->dir_pos.sname.cln);
40010324: 0205a783 lw a5,32(a1)
{
40010328: fd010113 addi sp,sp,-48
4001032c: 02812423 sw s0,40(sp)
40010330: 01512a23 sw s5,20(sp)
40010334: 02112623 sw ra,44(sp)
40010338: 02912223 sw s1,36(sp)
4001033c: 03212023 sw s2,32(sp)
40010340: 01312e23 sw s3,28(sp)
40010344: 01412c23 sw s4,24(sp)
40010348: 00058a93 mv s5,a1
4001034c: 00050413 mv s0,a0
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
40010350: 00079863 bnez a5,40010360 <fat_file_write_time_and_date+0x3c>
40010354: 01654703 lbu a4,22(a0)
40010358: 00377713 andi a4,a4,3
4001035c: 10071c63 bnez a4,40010474 <fat_file_write_time_and_date+0x150> <== ALWAYS TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
40010360: 00544703 lbu a4,5(s0)
40010364: 03c42483 lw s1,60(s0)
40010368: ffe78793 addi a5,a5,-2
4001036c: 00e797b3 sll a5,a5,a4
40010370: 009787b3 add a5,a5,s1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
40010374: 024aa703 lw a4,36(s5)
40010378: 00244483 lbu s1,2(s0)
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
4001037c: 00045903 lhu s2,0(s0)
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
40010380: 048aa503 lw a0,72(s5)
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
40010384: 009754b3 srl s1,a4,s1
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
40010388: 00c10613 addi a2,sp,12
4001038c: 00e10593 addi a1,sp,14
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
40010390: fff90913 addi s2,s2,-1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
40010394: 00f484b3 add s1,s1,a5
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
40010398: 00e97933 and s2,s2,a4
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
4001039c: 204060ef jal ra,400165a0 <msdos_date_unix2dos>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_WTIME_OFFSET,
400103a0: 00c10713 addi a4,sp,12
400103a4: 00200693 li a3,2
400103a8: 01690613 addi a2,s2,22
400103ac: 00048593 mv a1,s1
400103b0: 00040513 mv a0,s0
400103b4: ce5fc0ef jal ra,4000d098 <fat_sector_write>
400103b8: 00050993 mv s3,a0
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_WDATE_OFFSET,
400103bc: 00e10713 addi a4,sp,14
400103c0: 00200693 li a3,2
400103c4: 01890613 addi a2,s2,24
400103c8: 00048593 mv a1,s1
400103cc: 00040513 mv a0,s0
400103d0: cc9fc0ef jal ra,4000d098 <fat_sector_write>
rc = -1;
400103d4: fff00a13 li s4,-1
if ( ret < 0 )
400103d8: 00054463 bltz a0,400103e0 <fat_file_write_time_and_date+0xbc> <== NEVER TAKEN
if ( ret < 0 )
400103dc: 41f9da13 srai s4,s3,0x1f
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_ADATE_OFFSET,
400103e0: 00e10713 addi a4,sp,14
400103e4: 00200693 li a3,2
400103e8: 01290613 addi a2,s2,18
400103ec: 00048593 mv a1,s1
400103f0: 00040513 mv a0,s0
400103f4: ca5fc0ef jal ra,4000d098 <fat_sector_write>
if ( ret < 0 )
400103f8: 00055463 bgez a0,40010400 <fat_file_write_time_and_date+0xdc> <== ALWAYS TAKEN
rc = -1;
400103fc: fff00a13 li s4,-1 <== NOT EXECUTED
msdos_date_unix2dos(fat_fd->ctime, &date, &time_val);
40010400: 040aa503 lw a0,64(s5)
40010404: 00c10613 addi a2,sp,12
40010408: 00e10593 addi a1,sp,14
4001040c: 194060ef jal ra,400165a0 <msdos_date_unix2dos>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_CTIME_OFFSET,
40010410: 00c10713 addi a4,sp,12
40010414: 00200693 li a3,2
40010418: 00e90613 addi a2,s2,14
4001041c: 00048593 mv a1,s1
40010420: 00040513 mv a0,s0
40010424: c75fc0ef jal ra,4000d098 <fat_sector_write>
if ( ret < 0 )
40010428: 00055463 bgez a0,40010430 <fat_file_write_time_and_date+0x10c> <== ALWAYS TAKEN
rc = -1;
4001042c: fff00a13 li s4,-1 <== NOT EXECUTED
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_CDATE_OFFSET,
40010430: 00e10713 addi a4,sp,14
40010434: 00200693 li a3,2
40010438: 01090613 addi a2,s2,16
4001043c: 00048593 mv a1,s1
40010440: 00040513 mv a0,s0
40010444: c55fc0ef jal ra,4000d098 <fat_sector_write>
if ( ret < 0 )
40010448: 02054a63 bltz a0,4001047c <fat_file_write_time_and_date+0x158> <== NEVER TAKEN
}
4001044c: 02c12083 lw ra,44(sp)
40010450: 02812403 lw s0,40(sp)
40010454: 02412483 lw s1,36(sp)
40010458: 02012903 lw s2,32(sp)
4001045c: 01c12983 lw s3,28(sp)
40010460: 01412a83 lw s5,20(sp)
40010464: 000a0513 mv a0,s4
40010468: 01812a03 lw s4,24(sp)
4001046c: 03010113 addi sp,sp,48
40010470: 00008067 ret
return fs_info->vol.rdir_loc;
40010474: 02852783 lw a5,40(a0)
40010478: efdff06f j 40010374 <fat_file_write_time_and_date+0x50>
rc = -1;
4001047c: fff00a13 li s4,-1 <== NOT EXECUTED
return rc;
40010480: fcdff06f j 4001044c <fat_file_write_time_and_date+0x128> <== NOT EXECUTED
4000e3e4 <fat_free_fat_clusters_chain>:
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000e3e4: 01852783 lw a5,24(a0)
4000e3e8: 01c52703 lw a4,28(a0)
{
4000e3ec: fd010113 addi sp,sp,-48
4000e3f0: 02812423 sw s0,40(sp)
4000e3f4: 01512a23 sw s5,20(sp)
4000e3f8: 02112623 sw ra,44(sp)
4000e3fc: 02912223 sw s1,36(sp)
4000e400: 03212023 sw s2,32(sp)
4000e404: 01312e23 sw s3,28(sp)
4000e408: 01412c23 sw s4,24(sp)
uint32_t next_cln = 0;
4000e40c: 00012623 sw zero,12(sp)
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000e410: 00f5f7b3 and a5,a1,a5
{
4000e414: 00050413 mv s0,a0
4000e418: 00058a93 mv s5,a1
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000e41c: 08e7f063 bgeu a5,a4,4000e49c <fat_free_fat_clusters_chain+0xb8>
uint32_t cur_cln = chain;
4000e420: 00058913 mv s2,a1
uint32_t freed_cls_cnt = 0;
4000e424: 00000993 li s3,0
int rc = RC_OK, rc1 = RC_OK;
4000e428: 00000a13 li s4,0
4000e42c: 0280006f j 4000e454 <fat_free_fat_clusters_chain+0x70>
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
4000e430: d25ff0ef jal ra,4000e154 <fat_set_fat_cluster>
if ( rc != RC_OK )
4000e434: 00050463 beqz a0,4000e43c <fat_free_fat_clusters_chain+0x58> <== ALWAYS TAKEN
4000e438: 00050a13 mv s4,a0 <== NOT EXECUTED
cur_cln = next_cln;
4000e43c: 00c12903 lw s2,12(sp)
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000e440: 01842783 lw a5,24(s0)
4000e444: 01c42703 lw a4,28(s0)
freed_cls_cnt++;
4000e448: 00198993 addi s3,s3,1
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000e44c: 00f977b3 and a5,s2,a5
4000e450: 04e7fa63 bgeu a5,a4,4000e4a4 <fat_free_fat_clusters_chain+0xc0>
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
4000e454: 00090593 mv a1,s2
4000e458: 00c10613 addi a2,sp,12
4000e45c: 00040513 mv a0,s0
4000e460: b39ff0ef jal ra,4000df98 <fat_get_fat_cluster>
4000e464: 00050493 mv s1,a0
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
4000e468: 00090593 mv a1,s2
4000e46c: 00000613 li a2,0
4000e470: 00040513 mv a0,s0
if ( rc != RC_OK )
4000e474: fa048ee3 beqz s1,4000e430 <fat_free_fat_clusters_chain+0x4c> <== ALWAYS TAKEN
if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
4000e478: 04c42783 lw a5,76(s0) <== NOT EXECUTED
4000e47c: fff00713 li a4,-1 <== NOT EXECUTED
4000e480: 00e78663 beq a5,a4,4000e48c <fat_free_fat_clusters_chain+0xa8> <== NOT EXECUTED
fs_info->vol.free_cls += freed_cls_cnt;
4000e484: 013787b3 add a5,a5,s3 <== NOT EXECUTED
4000e488: 04f42623 sw a5,76(s0) <== NOT EXECUTED
fat_buf_release(fs_info);
4000e48c: 00040513 mv a0,s0 <== NOT EXECUTED
4000e490: ac1fe0ef jal ra,4000cf50 <fat_buf_release> <== NOT EXECUTED
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
4000e494: 00048a13 mv s4,s1 <== NOT EXECUTED
return rc;
4000e498: 02c0006f j 4000e4c4 <fat_free_fat_clusters_chain+0xe0> <== NOT EXECUTED
uint32_t freed_cls_cnt = 0;
4000e49c: 00000993 li s3,0 <== NOT EXECUTED
int rc = RC_OK, rc1 = RC_OK;
4000e4a0: 00000a13 li s4,0 <== NOT EXECUTED
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
4000e4a4: 04c42783 lw a5,76(s0)
fs_info->vol.next_cl = chain;
4000e4a8: 05542a23 sw s5,84(s0)
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
4000e4ac: fff00713 li a4,-1
4000e4b0: 00e78663 beq a5,a4,4000e4bc <fat_free_fat_clusters_chain+0xd8>
fs_info->vol.free_cls += freed_cls_cnt;
4000e4b4: 013787b3 add a5,a5,s3 <== NOT EXECUTED
4000e4b8: 04f42623 sw a5,76(s0) <== NOT EXECUTED
fat_buf_release(fs_info);
4000e4bc: 00040513 mv a0,s0
4000e4c0: a91fe0ef jal ra,4000cf50 <fat_buf_release>
}
4000e4c4: 02c12083 lw ra,44(sp)
4000e4c8: 02812403 lw s0,40(sp)
4000e4cc: 02412483 lw s1,36(sp)
4000e4d0: 02012903 lw s2,32(sp)
4000e4d4: 01c12983 lw s3,28(sp)
4000e4d8: 01412a83 lw s5,20(sp)
4000e4dc: 000a0513 mv a0,s4
4000e4e0: 01812a03 lw s4,24(sp)
4000e4e4: 03010113 addi sp,sp,48
4000e4e8: 00008067 ret
4000df54 <fat_free_unique_ino>:
fat_free_unique_ino(
fat_fs_info_t *fs_info,
uint32_t ino
)
{
FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino);
4000df54: 09452783 lw a5,148(a0) <== NOT EXECUTED
4000df58: 08852703 lw a4,136(a0) <== NOT EXECUTED
4000df5c: 40f585b3 sub a1,a1,a5 <== NOT EXECUTED
4000df60: 0035d793 srli a5,a1,0x3 <== NOT EXECUTED
4000df64: 00f70733 add a4,a4,a5 <== NOT EXECUTED
4000df68: 00074683 lbu a3,0(a4) <== NOT EXECUTED
4000df6c: 0075f593 andi a1,a1,7 <== NOT EXECUTED
4000df70: 00100793 li a5,1 <== NOT EXECUTED
4000df74: 00b797b3 sll a5,a5,a1 <== NOT EXECUTED
4000df78: fff7c793 not a5,a5 <== NOT EXECUTED
4000df7c: 00d7f7b3 and a5,a5,a3 <== NOT EXECUTED
4000df80: 00f70023 sb a5,0(a4) <== NOT EXECUTED
}
4000df84: 00008067 ret <== NOT EXECUTED
4000df98 <fat_get_fat_cluster>:
fat_get_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t *ret_val
)
{
4000df98: fd010113 addi sp,sp,-48
4000df9c: 02112623 sw ra,44(sp)
4000dfa0: 02812423 sw s0,40(sp)
4000dfa4: 02912223 sw s1,36(sp)
4000dfa8: 03212023 sw s2,32(sp)
4000dfac: 01312e23 sw s3,28(sp)
4000dfb0: 01412c23 sw s4,24(sp)
4000dfb4: 01512a23 sw s5,20(sp)
4000dfb8: 01612823 sw s6,16(sp)
uint8_t *sec_buf;
uint32_t sec = 0;
uint32_t ofs = 0;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
4000dfbc: 00100793 li a5,1
4000dfc0: 08b7f463 bgeu a5,a1,4000e048 <fat_get_fat_cluster+0xb0>
4000dfc4: 04052783 lw a5,64(a0)
4000dfc8: 00058b13 mv s6,a1
4000dfcc: 00050413 mv s0,a0
4000dfd0: 00178793 addi a5,a5,1
4000dfd4: 06b7ea63 bltu a5,a1,4000e048 <fat_get_fat_cluster+0xb0>
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000dfd8: 01654703 lbu a4,22(a0)
fs_info->vol.afat_loc;
4000dfdc: 06052983 lw s3,96(a0)
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000dfe0: 00254783 lbu a5,2(a0)
4000dfe4: 00177693 andi a3,a4,1
4000dfe8: 00060a13 mv s4,a2
4000dfec: 08069c63 bnez a3,4000e084 <fat_get_fat_cluster+0xec>
4000dff0: 00277713 andi a4,a4,2
4000dff4: 0a070263 beqz a4,4000e098 <fat_get_fat_cluster+0x100>
4000dff8: 00159a93 slli s5,a1,0x1
4000dffc: 00fad7b3 srl a5,s5,a5
4000e000: 013789b3 add s3,a5,s3
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
4000e004: 00c10693 addi a3,sp,12
4000e008: 00100613 li a2,1
4000e00c: 00098593 mv a1,s3
4000e010: 00040513 mv a0,s0
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e014: 00045903 lhu s2,0(s0)
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
4000e018: e5dfe0ef jal ra,4000ce74 <fat_buf_access>
4000e01c: 00050493 mv s1,a0
if (rc != RC_OK)
4000e020: 02051c63 bnez a0,4000e058 <fat_get_fat_cluster+0xc0> <== NEVER TAKEN
return rc;
switch ( fs_info->vol.type )
4000e024: 01644783 lbu a5,22(s0)
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e028: fff90913 addi s2,s2,-1
switch ( fs_info->vol.type )
4000e02c: 00200713 li a4,2
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e030: 01597933 and s2,s2,s5
switch ( fs_info->vol.type )
4000e034: 06e78a63 beq a5,a4,4000e0a8 <fat_get_fat_cluster+0x110>
4000e038: 00400713 li a4,4
4000e03c: 0ae78e63 beq a5,a4,4000e0f8 <fat_get_fat_cluster+0x160>
4000e040: 00100713 li a4,1
4000e044: 06e78c63 beq a5,a4,4000e0bc <fat_get_fat_cluster+0x124>
*ret_val = *((uint32_t *)(sec_buf + ofs));
*ret_val = CF_LE_L(*ret_val);
break;
default:
rtems_set_errno_and_return_minus_one(EIO);
4000e048: 7110c0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000e04c: 00500793 li a5,5 <== NOT EXECUTED
4000e050: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000e054: fff00493 li s1,-1 <== NOT EXECUTED
break;
}
return RC_OK;
}
4000e058: 02c12083 lw ra,44(sp)
4000e05c: 02812403 lw s0,40(sp)
4000e060: 02012903 lw s2,32(sp)
4000e064: 01c12983 lw s3,28(sp)
4000e068: 01812a03 lw s4,24(sp)
4000e06c: 01412a83 lw s5,20(sp)
4000e070: 01012b03 lw s6,16(sp)
4000e074: 00048513 mv a0,s1
4000e078: 02412483 lw s1,36(sp)
4000e07c: 03010113 addi sp,sp,48
4000e080: 00008067 ret
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000e084: 0015d913 srli s2,a1,0x1
4000e088: 00b90ab3 add s5,s2,a1
4000e08c: 00fad7b3 srl a5,s5,a5
4000e090: 013789b3 add s3,a5,s3
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e094: f71ff06f j 4000e004 <fat_get_fat_cluster+0x6c>
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000e098: 00259a93 slli s5,a1,0x2
4000e09c: 00fad7b3 srl a5,s5,a5
4000e0a0: 013789b3 add s3,a5,s3
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e0a4: f61ff06f j 4000e004 <fat_get_fat_cluster+0x6c>
*ret_val = *((uint16_t *)(sec_buf + ofs));
4000e0a8: 00c12783 lw a5,12(sp)
4000e0ac: 01278933 add s2,a5,s2
4000e0b0: 00095783 lhu a5,0(s2)
4000e0b4: 00fa2023 sw a5,0(s4)
break;
4000e0b8: fa1ff06f j 4000e058 <fat_get_fat_cluster+0xc0>
*ret_val = (*(sec_buf + ofs));
4000e0bc: 00c12703 lw a4,12(sp)
if ( ofs == (fs_info->vol.bps - 1) )
4000e0c0: 00045683 lhu a3,0(s0)
*ret_val = (*(sec_buf + ofs));
4000e0c4: 01270733 add a4,a4,s2
4000e0c8: 00074603 lbu a2,0(a4)
if ( ofs == (fs_info->vol.bps - 1) )
4000e0cc: fff68693 addi a3,a3,-1
*ret_val = (*(sec_buf + ofs));
4000e0d0: 00ca2023 sw a2,0(s4)
if ( ofs == (fs_info->vol.bps - 1) )
4000e0d4: 05268463 beq a3,s2,4000e11c <fat_get_fat_cluster+0x184>
*ret_val |= *(sec_buf + ofs + 1) << 8;
4000e0d8: 00174783 lbu a5,1(a4)
4000e0dc: 00879793 slli a5,a5,0x8
4000e0e0: 00c7e7b3 or a5,a5,a2
if ( FAT_CLUSTER_IS_ODD(cln) )
4000e0e4: 001b7593 andi a1,s6,1
4000e0e8: 02058263 beqz a1,4000e10c <fat_get_fat_cluster+0x174>
*ret_val = (*ret_val) >> FAT12_SHIFT;
4000e0ec: 0047d793 srli a5,a5,0x4
4000e0f0: 00fa2023 sw a5,0(s4)
4000e0f4: f65ff06f j 4000e058 <fat_get_fat_cluster+0xc0>
*ret_val = *((uint32_t *)(sec_buf + ofs));
4000e0f8: 00c12783 lw a5,12(sp)
4000e0fc: 01278933 add s2,a5,s2
4000e100: 00092783 lw a5,0(s2)
4000e104: 00fa2023 sw a5,0(s4)
break;
4000e108: f51ff06f j 4000e058 <fat_get_fat_cluster+0xc0>
*ret_val = (*ret_val) & FAT_FAT12_MASK;
4000e10c: 01479793 slli a5,a5,0x14
4000e110: 0147d793 srli a5,a5,0x14
4000e114: 00fa2023 sw a5,0(s4)
4000e118: f41ff06f j 4000e058 <fat_get_fat_cluster+0xc0>
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
4000e11c: 00c10693 addi a3,sp,12
4000e120: 00100613 li a2,1
4000e124: 00198593 addi a1,s3,1
4000e128: 00040513 mv a0,s0
4000e12c: d49fe0ef jal ra,4000ce74 <fat_buf_access>
if (rc != RC_OK)
4000e130: 00051e63 bnez a0,4000e14c <fat_get_fat_cluster+0x1b4> <== NEVER TAKEN
*ret_val |= *sec_buf << 8;
4000e134: 00c12783 lw a5,12(sp)
4000e138: 000a2703 lw a4,0(s4)
4000e13c: 0007c783 lbu a5,0(a5)
4000e140: 00879793 slli a5,a5,0x8
4000e144: 00e7e7b3 or a5,a5,a4
4000e148: f9dff06f j 4000e0e4 <fat_get_fat_cluster+0x14c>
4000e14c: 00050493 mv s1,a0 <== NOT EXECUTED
4000e150: f09ff06f j 4000e058 <fat_get_fat_cluster+0xc0> <== NOT EXECUTED
4000de7c <fat_get_unique_ino>:
* 0 means FAILED !!!
*
*/
uint32_t
fat_get_unique_ino(fat_fs_info_t *fs_info)
{
4000de7c: ff010113 addi sp,sp,-16 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
4000de80: 09052583 lw a1,144(a0) <== NOT EXECUTED
{
4000de84: 00912223 sw s1,4(sp) <== NOT EXECUTED
fs_info->index++;
if (fs_info->index >= fs_info->uino_pool_size)
fs_info->index = 0;
}
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
4000de88: 100004b7 lui s1,0x10000 <== NOT EXECUTED
{
4000de8c: 00812423 sw s0,8(sp) <== NOT EXECUTED
4000de90: 00112623 sw ra,12(sp) <== NOT EXECUTED
4000de94: 00050413 mv s0,a0 <== NOT EXECUTED
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
4000de98: fff48493 addi s1,s1,-1 # fffffff <RamSize+0xeffffff> <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
4000de9c: 04058a63 beqz a1,4000def0 <fat_get_unique_ino+0x74> <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
4000dea0: 08842883 lw a7,136(s0) <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
4000dea4: 00000613 li a2,0 <== NOT EXECUTED
4000dea8: 0100006f j 4000deb8 <fat_get_unique_ino+0x3c> <== NOT EXECUTED
fs_info->index++;
4000deac: 08f42623 sw a5,140(s0) <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
4000deb0: 00160613 addi a2,a2,1 <== NOT EXECUTED
4000deb4: 02b60c63 beq a2,a1,4000deec <fat_get_unique_ino+0x70> <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
4000deb8: 08c42783 lw a5,140(s0) <== NOT EXECUTED
4000debc: 0037d713 srli a4,a5,0x3 <== NOT EXECUTED
4000dec0: 00e88733 add a4,a7,a4 <== NOT EXECUTED
4000dec4: 00074503 lbu a0,0(a4) <== NOT EXECUTED
4000dec8: 0077f813 andi a6,a5,7 <== NOT EXECUTED
fs_info->index++;
4000decc: 00178793 addi a5,a5,1 <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
4000ded0: 410556b3 sra a3,a0,a6 <== NOT EXECUTED
4000ded4: 0016f693 andi a3,a3,1 <== NOT EXECUTED
4000ded8: 04068263 beqz a3,4000df1c <fat_get_unique_ino+0xa0> <== NOT EXECUTED
if (fs_info->index >= fs_info->uino_pool_size)
4000dedc: fcb7e8e3 bltu a5,a1,4000deac <fat_get_unique_ino+0x30> <== NOT EXECUTED
fs_info->index = 0;
4000dee0: 08042623 sw zero,140(s0) <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
4000dee4: 00160613 addi a2,a2,1 <== NOT EXECUTED
4000dee8: fcb618e3 bne a2,a1,4000deb8 <fat_get_unique_ino+0x3c> <== NOT EXECUTED
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
4000deec: 00159593 slli a1,a1,0x1 <== NOT EXECUTED
4000def0: 09442783 lw a5,148(s0) <== NOT EXECUTED
4000def4: 40f487b3 sub a5,s1,a5 <== NOT EXECUTED
4000def8: 04f5fa63 bgeu a1,a5,4000df4c <fat_get_unique_ino+0xd0> <== NOT EXECUTED
{
fs_info->uino_pool_size <<= 1;
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
4000defc: 08842503 lw a0,136(s0) <== NOT EXECUTED
fs_info->uino_pool_size <<= 1;
4000df00: 08b42823 sw a1,144(s0) <== NOT EXECUTED
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
4000df04: 36c080ef jal ra,40016270 <realloc> <== NOT EXECUTED
4000df08: 08a42423 sw a0,136(s0) <== NOT EXECUTED
if (fs_info->uino != NULL)
4000df0c: 04050063 beqz a0,4000df4c <fat_get_unique_ino+0xd0> <== NOT EXECUTED
fs_info->index = fs_info->uino_pool_size;
4000df10: 09042583 lw a1,144(s0) <== NOT EXECUTED
4000df14: 08b42623 sw a1,140(s0) <== NOT EXECUTED
4000df18: f85ff06f j 4000de9c <fat_get_unique_ino+0x20> <== NOT EXECUTED
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
4000df1c: 00100793 li a5,1 <== NOT EXECUTED
4000df20: 01079833 sll a6,a5,a6 <== NOT EXECUTED
4000df24: 00a86533 or a0,a6,a0 <== NOT EXECUTED
4000df28: 00a70023 sb a0,0(a4) <== NOT EXECUTED
return (fs_info->uino_base + fs_info->index);
4000df2c: 09442503 lw a0,148(s0) <== NOT EXECUTED
4000df30: 08c42783 lw a5,140(s0) <== NOT EXECUTED
4000df34: 00f50533 add a0,a0,a5 <== NOT EXECUTED
}
else
resrc_unsuff = true;
}
return 0;
}
4000df38: 00c12083 lw ra,12(sp) <== NOT EXECUTED
4000df3c: 00812403 lw s0,8(sp) <== NOT EXECUTED
4000df40: 00412483 lw s1,4(sp) <== NOT EXECUTED
4000df44: 01010113 addi sp,sp,16 <== NOT EXECUTED
4000df48: 00008067 ret <== NOT EXECUTED
return 0;
4000df4c: 00000513 li a0,0 <== NOT EXECUTED
4000df50: fe9ff06f j 4000df38 <fat_get_unique_ino+0xbc> <== NOT EXECUTED
4000ddf4 <fat_init_clusters_chain>:
int
fat_init_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t start_cln
)
{
4000ddf4: fe010113 addi sp,sp,-32
4000ddf8: 00812c23 sw s0,24(sp)
4000ddfc: 00112e23 sw ra,28(sp)
4000de00: 00050413 mv s0,a0
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
4000de04: 00b12623 sw a1,12(sp)
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000de08: 0300006f j 4000de38 <fat_init_clusters_chain+0x44>
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
4000de0c: 00842683 lw a3,8(s0)
4000de10: b88ff0ef jal ra,4000d198 <fat_cluster_set>
if ( ret != fs_info->vol.bpc )
4000de14: 00842703 lw a4,8(s0)
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
4000de18: 00050793 mv a5,a0
{
return -1;
}
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
4000de1c: 00c10613 addi a2,sp,12
4000de20: 00040513 mv a0,s0
if ( ret != fs_info->vol.bpc )
4000de24: 04f71263 bne a4,a5,4000de68 <fat_init_clusters_chain+0x74>
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
4000de28: 00c12583 lw a1,12(sp)
4000de2c: 16c000ef jal ra,4000df98 <fat_get_fat_cluster>
if ( rc != RC_OK )
4000de30: 02051463 bnez a0,4000de58 <fat_init_clusters_chain+0x64> <== NEVER TAKEN
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000de34: 00c12583 lw a1,12(sp)
4000de38: 01842783 lw a5,24(s0)
4000de3c: 01c42683 lw a3,28(s0)
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
4000de40: 00000713 li a4,0
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000de44: 00f5f7b3 and a5,a1,a5
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
4000de48: 00000613 li a2,0
4000de4c: 00040513 mv a0,s0
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
4000de50: fad7eee3 bltu a5,a3,4000de0c <fat_init_clusters_chain+0x18>
return rc;
}
}
return rc;
4000de54: 00000513 li a0,0
}
4000de58: 01c12083 lw ra,28(sp)
4000de5c: 01812403 lw s0,24(sp)
4000de60: 02010113 addi sp,sp,32
4000de64: 00008067 ret
4000de68: 01c12083 lw ra,28(sp) <== NOT EXECUTED
4000de6c: 01812403 lw s0,24(sp) <== NOT EXECUTED
return -1;
4000de70: fff00513 li a0,-1 <== NOT EXECUTED
}
4000de74: 02010113 addi sp,sp,32 <== NOT EXECUTED
4000de78: 00008067 ret <== NOT EXECUTED
4000d488 <fat_init_volume_info>:
* RC_OK on success, or -1 if error occured
* and errno set appropriately
*/
int
fat_init_volume_info(fat_fs_info_t *fs_info, const char *device)
{
4000d488: f3010113 addi sp,sp,-208
4000d48c: 00058793 mv a5,a1
4000d490: 0c812423 sw s0,200(sp)
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
vol->fd = open(device, O_RDWR);
4000d494: 00200593 li a1,2
{
4000d498: 00050413 mv s0,a0
vol->fd = open(device, O_RDWR);
4000d49c: 00078513 mv a0,a5
{
4000d4a0: 0c112623 sw ra,204(sp)
4000d4a4: 0c912223 sw s1,196(sp)
4000d4a8: 0d212023 sw s2,192(sp)
4000d4ac: 0b312e23 sw s3,188(sp)
4000d4b0: 0b412c23 sw s4,184(sp)
4000d4b4: 0b512a23 sw s5,180(sp)
4000d4b8: 0b612823 sw s6,176(sp)
4000d4bc: 0b712623 sw s7,172(sp)
4000d4c0: 0b812423 sw s8,168(sp)
4000d4c4: 0b912223 sw s9,164(sp)
4000d4c8: 0ba12023 sw s10,160(sp)
4000d4cc: 09b12e23 sw s11,156(sp)
rtems_bdbuf_buffer *block = NULL;
4000d4d0: 00012c23 sw zero,24(sp)
vol->fd = open(device, O_RDWR);
4000d4d4: bddf40ef jal ra,400020b0 <open>
4000d4d8: 06a42423 sw a0,104(s0)
if (vol->fd < 0)
4000d4dc: 5c054663 bltz a0,4000daa8 <fat_init_volume_info+0x620> <== NEVER TAKEN
{
rtems_set_errno_and_return_minus_one(ENXIO);
}
rc = fstat(vol->fd, &stat_buf);
4000d4e0: 02810593 addi a1,sp,40
4000d4e4: 8ccf40ef jal ra,400015b0 <fstat>
if (rc != 0)
4000d4e8: 5c051a63 bnez a0,4000dabc <fat_init_volume_info+0x634> <== NEVER TAKEN
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* Must be a block device. */
if (!S_ISBLK(stat_buf.st_mode))
4000d4ec: 03812683 lw a3,56(sp)
4000d4f0: 0000f7b7 lui a5,0xf
4000d4f4: 00006737 lui a4,0x6
4000d4f8: 00d7f7b3 and a5,a5,a3
close(vol->fd);
4000d4fc: 06842503 lw a0,104(s0)
if (!S_ISBLK(stat_buf.st_mode))
4000d500: 5ae79263 bne a5,a4,4000daa4 <fat_init_volume_info+0x61c>
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
4000d504: 400445b7 lui a1,0x40044
4000d508: 06c40613 addi a2,s0,108
4000d50c: 20958593 addi a1,a1,521 # 40044209 <WorkAreaBase+0x17c89>
4000d510: bc5fe0ef jal ra,4000c0d4 <ioctl>
4000d514: 00050c93 mv s9,a0
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* check that device is registred as block device and lock it */
rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd);
if (rc != 0) {
4000d518: 5a051263 bnez a0,4000dabc <fat_init_volume_info+0x634> <== NEVER TAKEN
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
vol->dev = stat_buf.st_rdev;
4000d51c: 04812703 lw a4,72(sp)
4000d520: 04c12783 lw a5,76(sp)
/* Read boot record */
/* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */
sc = rtems_bdbuf_read( vol->dd, 0, &block);
4000d524: 06c42503 lw a0,108(s0)
4000d528: 01810613 addi a2,sp,24
vol->dev = stat_buf.st_rdev;
4000d52c: 06e42823 sw a4,112(s0)
4000d530: 06f42a23 sw a5,116(s0)
sc = rtems_bdbuf_read( vol->dd, 0, &block);
4000d534: 00000593 li a1,0
4000d538: 5d4080ef jal ra,40015b0c <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL)
4000d53c: 58051e63 bnez a0,4000dad8 <fat_init_volume_info+0x650> <== NEVER TAKEN
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO);
}
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
4000d540: 01812503 lw a0,24(sp)
4000d544: 01c52783 lw a5,28(a0)
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
else
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d548: 0257c883 lbu a7,37(a5) # f025 <bsp_section_rodata_size+0xc899>
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d54c: 02d7c683 lbu a3,45(a5)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d550: 0247cd83 lbu s11,36(a5)
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d554: 02c7c483 lbu s1,44(a5)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d558: 0217c303 lbu t1,33(a5)
4000d55c: 0207c083 lbu ra,32(a5)
4000d560: 0227c803 lbu a6,34(a5)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d564: 0267c603 lbu a2,38(a5)
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d568: 02e7c703 lbu a4,46(a5)
4000d56c: 00c7c583 lbu a1,12(a5)
4000d570: 00f7ca03 lbu s4,15(a5)
4000d574: 0127ca83 lbu s5,18(a5)
4000d578: 0147cb03 lbu s6,20(a5)
4000d57c: 0177cb83 lbu s7,23(a5)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d580: 0237c983 lbu s3,35(a5)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d584: 0277c903 lbu s2,39(a5)
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d588: 02f7cd03 lbu s10,47(a5)
4000d58c: 0317cc03 lbu s8,49(a5)
4000d590: 00b7c383 lbu t2,11(a5)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d594: 00889893 slli a7,a7,0x8
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d598: 00869693 slli a3,a3,0x8
4000d59c: 00e7c283 lbu t0,14(a5)
4000d5a0: 0117cf83 lbu t6,17(a5)
4000d5a4: 0137cf03 lbu t5,19(a5)
4000d5a8: 0167ce83 lbu t4,22(a5)
4000d5ac: 0307ce03 lbu t3,48(a5)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d5b0: 01b8e8b3 or a7,a7,s11
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d5b4: 0096e6b3 or a3,a3,s1
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
4000d5b8: 00d7cd83 lbu s11,13(a5)
4000d5bc: 0107c483 lbu s1,16(a5)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d5c0: 00831313 slli t1,t1,0x8
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
4000d5c4: 0287c783 lbu a5,40(a5)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d5c8: 00136333 or t1,t1,ra
4000d5cc: 01081813 slli a6,a6,0x10
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d5d0: 01061613 slli a2,a2,0x10
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d5d4: 01071713 slli a4,a4,0x10
4000d5d8: 00859593 slli a1,a1,0x8
4000d5dc: 0075e5b3 or a1,a1,t2
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d5e0: 00686833 or a6,a6,t1
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d5e4: 01166633 or a2,a2,a7
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d5e8: 00d76733 or a4,a4,a3
4000d5ec: 008a1a13 slli s4,s4,0x8
4000d5f0: 008a9a93 slli s5,s5,0x8
4000d5f4: 008b1b13 slli s6,s6,0x8
4000d5f8: 008b9b93 slli s7,s7,0x8
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d5fc: 01899993 slli s3,s3,0x18
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d600: 01891913 slli s2,s2,0x18
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d604: 018d1d13 slli s10,s10,0x18
4000d608: 008c1c13 slli s8,s8,0x8
4000d60c: 00b12423 sw a1,8(sp)
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
4000d610: 00f12623 sw a5,12(sp)
4000d614: 005a6a33 or s4,s4,t0
4000d618: 01faeab3 or s5,s5,t6
4000d61c: 01eb6b33 or s6,s6,t5
4000d620: 01dbebb3 or s7,s7,t4
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
4000d624: 0109e9b3 or s3,s3,a6
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
4000d628: 00c96933 or s2,s2,a2
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d62c: 00ed6d33 or s10,s10,a4
4000d630: 01cc6c33 or s8,s8,t3
sc = rtems_bdbuf_release( block);
4000d634: 6d8080ef jal ra,40015d0c <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
4000d638: 00812583 lw a1,8(sp)
4000d63c: 48051e63 bnez a0,4000dad8 <fat_init_volume_info+0x650> <== NEVER TAKEN
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
4000d640: 00b41023 sh a1,0(s0)
if ( (vol->bps != 512) &&
4000d644: 20000793 li a5,512
4000d648: 40f58c63 beq a1,a5,4000da60 <fat_init_volume_info+0x5d8>
4000d64c: c0058793 addi a5,a1,-1024 <== NOT EXECUTED
4000d650: bff7f793 andi a5,a5,-1025 <== NOT EXECUTED
4000d654: 01079793 slli a5,a5,0x10 <== NOT EXECUTED
4000d658: 0107d793 srli a5,a5,0x10 <== NOT EXECUTED
4000d65c: 00078663 beqz a5,4000d668 <fat_init_volume_info+0x1e0> <== NOT EXECUTED
(vol->bps != 2048) &&
4000d660: 000017b7 lui a5,0x1 <== NOT EXECUTED
4000d664: 42f59263 bne a1,a5,4000da88 <fat_init_volume_info+0x600> <== NOT EXECUTED
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
4000d668: 0095d713 srli a4,a1,0x9 <== NOT EXECUTED
4000d66c: 00100793 li a5,1 <== NOT EXECUTED
i >>= 1, vol->sec_mul++);
4000d670: 40175713 srai a4,a4,0x1 <== NOT EXECUTED
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
4000d674: 00178513 addi a0,a5,1 # 1001 <_ISR_Stack_size+0x1> <== NOT EXECUTED
4000d678: 00177613 andi a2,a4,1 <== NOT EXECUTED
4000d67c: 00078813 mv a6,a5 <== NOT EXECUTED
4000d680: 0ff57793 andi a5,a0,255 <== NOT EXECUTED
4000d684: fe0606e3 beqz a2,4000d670 <fat_init_volume_info+0x1e8> <== NOT EXECUTED
4000d688: 010401a3 sb a6,3(s0) <== NOT EXECUTED
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
4000d68c: 00040123 sb zero,2(s0) <== NOT EXECUTED
4000d690: 0015f713 andi a4,a1,1 <== NOT EXECUTED
4000d694: 00058793 mv a5,a1 <== NOT EXECUTED
4000d698: 02071263 bnez a4,4000d6bc <fat_init_volume_info+0x234> <== NOT EXECUTED
4000d69c: 00100713 li a4,1
i >>= 1, vol->sec_log2++);
4000d6a0: 4017d793 srai a5,a5,0x1
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
4000d6a4: 00170513 addi a0,a4,1 # 6001 <bsp_section_rodata_size+0x3875>
4000d6a8: 0017f613 andi a2,a5,1
4000d6ac: 00070813 mv a6,a4
4000d6b0: 0ff57713 andi a4,a0,255
4000d6b4: fe0606e3 beqz a2,4000d6a0 <fat_init_volume_info+0x218>
4000d6b8: 01040123 sb a6,2(s0)
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bps, true);
4000d6bc: 06c42503 lw a0,108(s0)
4000d6c0: 00100613 li a2,1
4000d6c4: 0cd080ef jal ra,40015f90 <rtems_bdbuf_set_block_size>
if (sc != RTEMS_SUCCESSFUL)
4000d6c8: 3c051063 bnez a0,4000da88 <fat_init_volume_info+0x600> <== NEVER TAKEN
vol->bytes_per_block = vol->bps;
4000d6cc: 00045883 lhu a7,0(s0)
vol->bytes_per_block_log2 = vol->sec_log2;
4000d6d0: 00244803 lbu a6,2(s0)
vol->sectors_per_block = 1;
4000d6d4: 00100793 li a5,1
vol->bytes_per_block = vol->bps;
4000d6d8: 01142823 sw a7,16(s0)
vol->bytes_per_block_log2 = vol->sec_log2;
4000d6dc: 01040a23 sb a6,20(s0)
vol->sectors_per_block = 1;
4000d6e0: 00f406a3 sb a5,13(s0)
vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec);
4000d6e4: 01b40223 sb s11,4(s0)
if (vol->spc == 0)
4000d6e8: 3a0d8063 beqz s11,4000da88 <fat_init_volume_info+0x600> <== NEVER TAKEN
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
4000d6ec: 000402a3 sb zero,5(s0)
4000d6f0: 001df713 andi a4,s11,1
4000d6f4: 000d8793 mv a5,s11
4000d6f8: 36071a63 bnez a4,4000da6c <fat_init_volume_info+0x5e4>
4000d6fc: 00100713 li a4,1
i >>= 1, vol->spc_log2++);
4000d700: 4017d793 srai a5,a5,0x1
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
4000d704: 00170593 addi a1,a4,1
4000d708: 0017f613 andi a2,a5,1
4000d70c: 00070513 mv a0,a4
4000d710: 0ff5f713 andi a4,a1,255
4000d714: fe0606e3 beqz a2,4000d700 <fat_init_volume_info+0x278>
if (vol->spc != UINT32_C(1) << vol->spc_log2)
4000d718: 00100793 li a5,1
4000d71c: 00050713 mv a4,a0
4000d720: 00a402a3 sb a0,5(s0)
4000d724: 00a797b3 sll a5,a5,a0
4000d728: 36fd9063 bne s11,a5,4000da88 <fat_init_volume_info+0x600>
vol->bpc = ((uint32_t) vol->bps) << vol->spc_log2;
4000d72c: 00e89733 sll a4,a7,a4
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
4000d730: 00070793 mv a5,a4
vol->bpc = ((uint32_t) vol->bps) << vol->spc_log2;
4000d734: 00e42423 sw a4,8(s0)
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
4000d738: 00040623 sb zero,12(s0)
4000d73c: 00177713 andi a4,a4,1
4000d740: 02071263 bnez a4,4000d764 <fat_init_volume_info+0x2dc> <== NEVER TAKEN
4000d744: 00100713 li a4,1
i >>= 1, vol->bpc_log2++);
4000d748: 4017d793 srai a5,a5,0x1
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
4000d74c: 00170593 addi a1,a4,1
4000d750: 0017f613 andi a2,a5,1
4000d754: 00070513 mv a0,a4
4000d758: 0ff5f713 andi a4,a1,255
4000d75c: fe0606e3 beqz a2,4000d748 <fat_init_volume_info+0x2c0>
4000d760: 00a40623 sb a0,12(s0)
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
4000d764: 005a9793 slli a5,s5,0x5
4000d768: fff88713 addi a4,a7,-1
4000d76c: 00e787b3 add a5,a5,a4
4000d770: 0317c7b3 div a5,a5,a7
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
4000d774: 00940aa3 sb s1,21(s0)
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
4000d778: 03441023 sh s4,32(s0)
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
4000d77c: 03541623 sh s5,44(s0)
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
4000d780: 01079833 sll a6,a5,a6
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
4000d784: 02f42823 sw a5,48(s0)
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
4000d788: 03042a23 sw a6,52(s0)
if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0)
4000d78c: 000b8463 beqz s7,4000d794 <fat_init_volume_info+0x30c>
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
4000d790: 000b8913 mv s2,s7
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
4000d794: 032484b3 mul s1,s1,s2
4000d798: 03242223 sw s2,36(s0)
4000d79c: 01448a33 add s4,s1,s4
4000d7a0: 014787b3 add a5,a5,s4
4000d7a4: 02f42e23 sw a5,60(s0)
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
4000d7a8: 03442423 sw s4,40(s0)
if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0)
4000d7ac: 000b0463 beqz s6,4000d7b4 <fat_init_volume_info+0x32c>
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
4000d7b0: 000b0993 mv s3,s6
data_secs = vol->tot_secs - vol->data_fsec;
4000d7b4: 40f987b3 sub a5,s3,a5
vol->data_cls = data_secs / vol->spc;
4000d7b8: 03b7d7b3 divu a5,a5,s11
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
4000d7bc: 00001737 lui a4,0x1
4000d7c0: 03342c23 sw s3,56(s0)
4000d7c4: ff470693 addi a3,a4,-12 # ff4 <bsp_section_data_size+0x8fc>
vol->data_cls = data_secs / vol->spc;
4000d7c8: 04f42023 sw a5,64(s0)
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
4000d7cc: 1cf6f063 bgeu a3,a5,4000d98c <fat_init_volume_info+0x504>
if ( vol->data_cls < FAT_FAT16_MAX_CLN)
4000d7d0: 00010737 lui a4,0x10
4000d7d4: ff470693 addi a3,a4,-12 # fff4 <bsp_section_rodata_size+0xd868>
4000d7d8: 1cf6e863 bltu a3,a5,4000d9a8 <fat_init_volume_info+0x520>
vol->mask = FAT_FAT16_MASK;
4000d7dc: fff70793 addi a5,a4,-1
vol->type = FAT_FAT16;
4000d7e0: 00200693 li a3,2
vol->eoc_val = FAT_FAT16_EOC;
4000d7e4: ff870713 addi a4,a4,-8
vol->type = FAT_FAT16;
4000d7e8: 00d40b23 sb a3,22(s0)
vol->mask = FAT_FAT16_MASK;
4000d7ec: 00f42c23 sw a5,24(s0)
vol->eoc_val = FAT_FAT16_EOC;
4000d7f0: 00e42e23 sw a4,28(s0)
else
{
vol->rdir_cl = 0;
vol->mirror = 0;
vol->afat = 0;
vol->free_cls = FAT_UNDEFINED_VALUE;
4000d7f4: fff00793 li a5,-1
vol->rdir_cl = 0;
4000d7f8: 04042223 sw zero,68(s0)
vol->mirror = 0;
4000d7fc: 04040e23 sb zero,92(s0)
vol->afat = 0;
4000d800: 06040223 sb zero,100(s0)
vol->free_cls = FAT_UNDEFINED_VALUE;
4000d804: 04f42623 sw a5,76(s0)
vol->next_cl = FAT_UNDEFINED_VALUE;
4000d808: 04f42a23 sw a5,84(s0)
if (fs_info->c.state == FAT_CACHE_EMPTY)
4000d80c: 09d44783 lbu a5,157(s0)
4000d810: 00078663 beqz a5,4000d81c <fat_init_volume_info+0x394>
4000d814: 00040513 mv a0,s0
4000d818: cc0ff0ef jal ra,4000ccd8 <fat_buf_release.part.0>
}
_fat_block_release(fs_info);
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
4000d81c: 06444783 lbu a5,100(s0)
4000d820: 02442683 lw a3,36(s0)
4000d824: 02045703 lhu a4,32(s0)
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
4000d828: 00c00593 li a1,12
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
4000d82c: 02d787b3 mul a5,a5,a3
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
4000d830: 00200513 li a0,2
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
4000d834: 00e787b3 add a5,a5,a4
4000d838: 06f42023 sw a5,96(s0)
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
4000d83c: e68fe0ef jal ra,4000bea4 <calloc>
4000d840: 08a42023 sw a0,128(s0)
4000d844: 00050793 mv a5,a0
if ( fs_info->vhash == NULL )
4000d848: 34050863 beqz a0,4000db98 <fat_init_volume_info+0x710> <== NEVER TAKEN
return &the_chain->Tail.Node;
4000d84c: 00450613 addi a2,a0,4
4000d850: 00c50713 addi a4,a0,12
4000d854: 01050693 addi a3,a0,16
head->next = tail;
4000d858: 00c7a023 sw a2,0(a5)
head->previous = NULL;
4000d85c: 0007a223 sw zero,4(a5)
tail->previous = head;
4000d860: 00f7a423 sw a5,8(a5)
head->next = tail;
4000d864: 00d7a623 sw a3,12(a5)
head->previous = NULL;
4000d868: 0007a823 sw zero,16(a5)
tail->previous = head;
4000d86c: 00e7aa23 sw a4,20(a5)
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->vhash + i);
fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
4000d870: 00c00593 li a1,12
4000d874: 00200513 li a0,2
4000d878: e2cfe0ef jal ra,4000bea4 <calloc>
4000d87c: 08a42223 sw a0,132(s0)
4000d880: 00050793 mv a5,a0
if ( fs_info->rhash == NULL )
4000d884: 2a050e63 beqz a0,4000db40 <fat_init_volume_info+0x6b8> <== NEVER TAKEN
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->rhash + i);
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
4000d888: 00344683 lbu a3,3(s0)
4000d88c: 03842703 lw a4,56(s0)
return &the_chain->Tail.Node;
4000d890: 00450813 addi a6,a0,4
4000d894: 01050613 addi a2,a0,16
4000d898: 00d71733 sll a4,a4,a3
4000d89c: 00471713 slli a4,a4,0x4
4000d8a0: 00c50693 addi a3,a0,12
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
4000d8a4: 10000593 li a1,256
4000d8a8: 08b42823 sw a1,144(s0)
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
4000d8ac: 08e42a23 sw a4,148(s0)
fs_info->index = 0;
4000d8b0: 08042623 sw zero,140(s0)
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
4000d8b4: 00100593 li a1,1
4000d8b8: 10000513 li a0,256
head->next = tail;
4000d8bc: 0107a023 sw a6,0(a5)
head->previous = NULL;
4000d8c0: 0007a223 sw zero,4(a5)
tail->previous = head;
4000d8c4: 00f7a423 sw a5,8(a5)
head->next = tail;
4000d8c8: 00c7a623 sw a2,12(a5)
head->previous = NULL;
4000d8cc: 0007a823 sw zero,16(a5)
tail->previous = head;
4000d8d0: 00d7aa23 sw a3,20(a5)
4000d8d4: dd0fe0ef jal ra,4000bea4 <calloc>
4000d8d8: 08a42423 sw a0,136(s0)
if ( fs_info->uino == NULL )
4000d8dc: 22050c63 beqz a0,4000db14 <fat_init_volume_info+0x68c> <== NEVER TAKEN
close(vol->fd);
free(fs_info->vhash);
free(fs_info->rhash);
rtems_set_errno_and_return_minus_one( ENOMEM );
}
fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t));
4000d8e0: 00045503 lhu a0,0(s0)
4000d8e4: 00100593 li a1,1
4000d8e8: dbcfe0ef jal ra,4000bea4 <calloc>
4000d8ec: 0aa42223 sw a0,164(s0)
if (fs_info->sec_buf == NULL)
4000d8f0: 26050a63 beqz a0,4000db64 <fat_init_volume_info+0x6dc> <== NEVER TAKEN
return (sec_num & (vol->spc - 1)) == 0;
4000d8f4: 00444783 lbu a5,4(s0)
4000d8f8: 03c42703 lw a4,60(s0)
4000d8fc: fff78793 addi a5,a5,-1
4000d900: 00e7f733 and a4,a5,a4
/*
* If possible we will use the cluster size as bdbuf block size for faster
* file access. This requires that certain sectors are aligned to cluster
* borders.
*/
if (is_cluster_aligned(vol, vol->data_fsec)
4000d904: 04071463 bnez a4,4000d94c <fat_init_volume_info+0x4c4> <== NEVER TAKEN
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
4000d908: 01644683 lbu a3,22(s0)
4000d90c: 00400713 li a4,4
4000d910: 00e68863 beq a3,a4,4000d920 <fat_init_volume_info+0x498>
return (sec_num & (vol->spc - 1)) == 0;
4000d914: 02842703 lw a4,40(s0)
4000d918: 00e7f7b3 and a5,a5,a4
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
4000d91c: 02079863 bnez a5,4000d94c <fat_init_volume_info+0x4c4> <== NEVER TAKEN
{
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true);
4000d920: 00842583 lw a1,8(s0)
4000d924: 06c42503 lw a0,108(s0)
4000d928: 00100613 li a2,1
4000d92c: 664080ef jal ra,40015f90 <rtems_bdbuf_set_block_size>
if (sc == RTEMS_SUCCESSFUL)
4000d930: 00051e63 bnez a0,4000d94c <fat_init_volume_info+0x4c4>
{
vol->bytes_per_block = vol->bpc;
4000d934: 00842683 lw a3,8(s0)
vol->bytes_per_block_log2 = vol->bpc_log2;
4000d938: 00c44703 lbu a4,12(s0)
vol->sectors_per_block = vol->spc;
4000d93c: 00444783 lbu a5,4(s0)
vol->bytes_per_block = vol->bpc;
4000d940: 00d42823 sw a3,16(s0)
vol->bytes_per_block_log2 = vol->bpc_log2;
4000d944: 00e40a23 sb a4,20(s0)
vol->sectors_per_block = vol->spc;
4000d948: 00f406a3 sb a5,13(s0)
}
}
return RC_OK;
}
4000d94c: 0cc12083 lw ra,204(sp)
4000d950: 0c812403 lw s0,200(sp)
4000d954: 0c412483 lw s1,196(sp)
4000d958: 0c012903 lw s2,192(sp)
4000d95c: 0bc12983 lw s3,188(sp)
4000d960: 0b812a03 lw s4,184(sp)
4000d964: 0b412a83 lw s5,180(sp)
4000d968: 0b012b03 lw s6,176(sp)
4000d96c: 0ac12b83 lw s7,172(sp)
4000d970: 0a812c03 lw s8,168(sp)
4000d974: 0a012d03 lw s10,160(sp)
4000d978: 09c12d83 lw s11,156(sp)
4000d97c: 000c8513 mv a0,s9
4000d980: 0a412c83 lw s9,164(sp)
4000d984: 0d010113 addi sp,sp,208
4000d988: 00008067 ret
vol->mask = FAT_FAT12_MASK;
4000d98c: fff70793 addi a5,a4,-1
vol->type = FAT_FAT12;
4000d990: 00100693 li a3,1
vol->eoc_val = FAT_FAT12_EOC;
4000d994: ff870713 addi a4,a4,-8
vol->type = FAT_FAT12;
4000d998: 00d40b23 sb a3,22(s0)
vol->mask = FAT_FAT12_MASK;
4000d99c: 00f42c23 sw a5,24(s0)
vol->eoc_val = FAT_FAT12_EOC;
4000d9a0: 00e42e23 sw a4,28(s0)
4000d9a4: e51ff06f j 4000d7f4 <fat_init_volume_info+0x36c>
else if ( vol->data_cls < FAT_FAT32_MASK - 1 )
4000d9a8: 10000737 lui a4,0x10000
4000d9ac: ffd70693 addi a3,a4,-3 # ffffffd <RamSize+0xefffffd>
4000d9b0: 0cf6ec63 bltu a3,a5,4000da88 <fat_init_volume_info+0x600>
if (vol->mirror)
4000d9b4: 00c12603 lw a2,12(sp)
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
4000d9b8: 05a42223 sw s10,68(s0)
vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec);
4000d9bc: 05841423 sh s8,72(s0)
if (vol->mirror)
4000d9c0: 01861793 slli a5,a2,0x18
4000d9c4: 4187d793 srai a5,a5,0x18
vol->afat = 0;
4000d9c8: 41f7d693 srai a3,a5,0x1f
4000d9cc: 00f67793 andi a5,a2,15
4000d9d0: 00d7f7b3 and a5,a5,a3
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
4000d9d4: f8067d93 andi s11,a2,-128
vol->mask = FAT_FAT32_MASK;
4000d9d8: fff70693 addi a3,a4,-1
vol->type = FAT_FAT32;
4000d9dc: 00400613 li a2,4
vol->eoc_val = FAT_FAT32_EOC;
4000d9e0: ff870713 addi a4,a4,-8
vol->type = FAT_FAT32;
4000d9e4: 00c40b23 sb a2,22(s0)
vol->mask = FAT_FAT32_MASK;
4000d9e8: 00d42c23 sw a3,24(s0)
vol->eoc_val = FAT_FAT32_EOC;
4000d9ec: 00e42e23 sw a4,28(s0)
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
4000d9f0: 05b40e23 sb s11,92(s0)
if (vol->mirror)
4000d9f4: 06f40223 sb a5,100(s0)
if( vol->info_sec == 0 )
4000d9f8: 080c0863 beqz s8,4000da88 <fat_init_volume_info+0x600> <== NEVER TAKEN
ret = _fat_block_read(fs_info, vol->info_sec , 0,
4000d9fc: 01c10713 addi a4,sp,28
4000da00: 00400693 li a3,4
4000da04: 00000613 li a2,0
4000da08: 000c0593 mv a1,s8
4000da0c: 00040513 mv a0,s0
4000da10: d54ff0ef jal ra,4000cf64 <_fat_block_read>
if ( ret < 0 )
4000da14: 0e054863 bltz a0,4000db04 <fat_init_volume_info+0x67c> <== NEVER TAKEN
if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) !=
4000da18: 01c12703 lw a4,28(sp)
4000da1c: 416157b7 lui a5,0x41615
4000da20: 25278793 addi a5,a5,594 # 41615252 <RamEnd+0x615252>
4000da24: 04f71a63 bne a4,a5,4000da78 <fat_init_volume_info+0x5f0>
ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO,
4000da28: 04845583 lhu a1,72(s0)
4000da2c: 01c10713 addi a4,sp,28
4000da30: 00c00693 li a3,12
4000da34: 1e400613 li a2,484
4000da38: 00040513 mv a0,s0
4000da3c: d28ff0ef jal ra,4000cf64 <_fat_block_read>
if ( ret < 0 )
4000da40: 0a054a63 bltz a0,4000daf4 <fat_init_volume_info+0x66c> <== NEVER TAKEN
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
4000da44: 02012703 lw a4,32(sp)
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
4000da48: 02412783 lw a5,36(sp)
vol->free_cls_in_fs_info =
4000da4c: 04e42823 sw a4,80(s0)
vol->free_cls = vol->free_cls_in_fs_info;
4000da50: 04e42623 sw a4,76(s0)
vol->next_cl_in_fs_info =
4000da54: 04f42c23 sw a5,88(s0)
vol->next_cl = vol->next_cl_in_fs_info;
4000da58: 04f42a23 sw a5,84(s0)
4000da5c: db1ff06f j 4000d80c <fat_init_volume_info+0x384>
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
4000da60: 000401a3 sb zero,3(s0)
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
4000da64: 20000793 li a5,512
4000da68: c35ff06f j 4000d69c <fat_init_volume_info+0x214>
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
4000da6c: 00000713 li a4,0
4000da70: 00100793 li a5,1
4000da74: cb5ff06f j 4000d728 <fat_init_volume_info+0x2a0>
if (fs_info->c.state == FAT_CACHE_EMPTY)
4000da78: 09d44783 lbu a5,157(s0) <== NOT EXECUTED
4000da7c: 00078663 beqz a5,4000da88 <fat_init_volume_info+0x600> <== NOT EXECUTED
4000da80: 00040513 mv a0,s0 <== NOT EXECUTED
4000da84: a54ff0ef jal ra,4000ccd8 <fat_buf_release.part.0> <== NOT EXECUTED
close(vol->fd);
4000da88: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
4000da8c: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000da90: 84df30ef jal ra,400012dc <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
4000da94: 4c40d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000da98: 01600793 li a5,22 <== NOT EXECUTED
4000da9c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000daa0: eadff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000daa4: 839f30ef jal ra,400012dc <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
4000daa8: 4b00d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000daac: 00600793 li a5,6 <== NOT EXECUTED
4000dab0: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000dab4: fff00c93 li s9,-1 <== NOT EXECUTED
4000dab8: e95ff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000dabc: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
4000dac0: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000dac4: 819f30ef jal ra,400012dc <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
4000dac8: 4900d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000dacc: 00600793 li a5,6 <== NOT EXECUTED
4000dad0: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000dad4: e79ff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000dad8: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
4000dadc: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000dae0: ffcf30ef jal ra,400012dc <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
4000dae4: 4740d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000dae8: 00500793 li a5,5 <== NOT EXECUTED
4000daec: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000daf0: e5dff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
if (fs_info->c.state == FAT_CACHE_EMPTY)
4000daf4: 09d44783 lbu a5,157(s0) <== NOT EXECUTED
4000daf8: 00078663 beqz a5,4000db04 <fat_init_volume_info+0x67c> <== NOT EXECUTED
4000dafc: 00040513 mv a0,s0 <== NOT EXECUTED
4000db00: 9d8ff0ef jal ra,4000ccd8 <fat_buf_release.part.0> <== NOT EXECUTED
close(vol->fd);
4000db04: 06842503 lw a0,104(s0) <== NOT EXECUTED
return -1;
4000db08: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000db0c: fd0f30ef jal ra,400012dc <close> <== NOT EXECUTED
return -1;
4000db10: e3dff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000db14: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db18: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000db1c: fc0f30ef jal ra,400012dc <close> <== NOT EXECUTED
free(fs_info->vhash);
4000db20: 08042503 lw a0,128(s0) <== NOT EXECUTED
4000db24: 99df30ef jal ra,400014c0 <free> <== NOT EXECUTED
free(fs_info->rhash);
4000db28: 08442503 lw a0,132(s0) <== NOT EXECUTED
4000db2c: 995f30ef jal ra,400014c0 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db30: 4280d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000db34: 00c00793 li a5,12 <== NOT EXECUTED
4000db38: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000db3c: e11ff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000db40: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db44: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000db48: f94f30ef jal ra,400012dc <close> <== NOT EXECUTED
free(fs_info->vhash);
4000db4c: 08042503 lw a0,128(s0) <== NOT EXECUTED
4000db50: 971f30ef jal ra,400014c0 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db54: 4040d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000db58: 00c00793 li a5,12 <== NOT EXECUTED
4000db5c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000db60: dedff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000db64: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db68: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000db6c: f70f30ef jal ra,400012dc <close> <== NOT EXECUTED
free(fs_info->vhash);
4000db70: 08042503 lw a0,128(s0) <== NOT EXECUTED
4000db74: 94df30ef jal ra,400014c0 <free> <== NOT EXECUTED
free(fs_info->rhash);
4000db78: 08442503 lw a0,132(s0) <== NOT EXECUTED
4000db7c: 945f30ef jal ra,400014c0 <free> <== NOT EXECUTED
free(fs_info->uino);
4000db80: 08842503 lw a0,136(s0) <== NOT EXECUTED
4000db84: 93df30ef jal ra,400014c0 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db88: 3d00d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000db8c: 00c00793 li a5,12 <== NOT EXECUTED
4000db90: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000db94: db9ff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
close(vol->fd);
4000db98: 06842503 lw a0,104(s0) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000db9c: fff00c93 li s9,-1 <== NOT EXECUTED
close(vol->fd);
4000dba0: f3cf30ef jal ra,400012dc <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4000dba4: 3b40d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000dba8: 00c00793 li a5,12 <== NOT EXECUTED
4000dbac: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000dbb0: d9dff06f j 4000d94c <fat_init_volume_info+0x4c4> <== NOT EXECUTED
4000e4ec <fat_scan_fat_for_free_clusters>:
{
4000e4ec: fc010113 addi sp,sp,-64
4000e4f0: 01812c23 sw s8,24(sp)
if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls)
4000e4f4: 05452c03 lw s8,84(a0)
{
4000e4f8: 01a12823 sw s10,16(sp)
4000e4fc: 00050d13 mv s10,a0
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
4000e500: 04052503 lw a0,64(a0)
{
4000e504: 03212823 sw s2,48(sp)
4000e508: 03312623 sw s3,44(sp)
4000e50c: 03412423 sw s4,40(sp)
4000e510: 03512223 sw s5,36(sp)
4000e514: 03612023 sw s6,32(sp)
4000e518: 01712e23 sw s7,28(sp)
4000e51c: 02112e23 sw ra,60(sp)
4000e520: 02812c23 sw s0,56(sp)
4000e524: 02912a23 sw s1,52(sp)
4000e528: 01912a23 sw s9,20(sp)
if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls)
4000e52c: ffec0813 addi a6,s8,-2
{
4000e530: 00058b13 mv s6,a1
4000e534: 00060a13 mv s4,a2
4000e538: 00068913 mv s2,a3
4000e53c: 00070b93 mv s7,a4
4000e540: 00078a93 mv s5,a5
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
4000e544: 00250993 addi s3,a0,2
if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls)
4000e548: 00a86463 bltu a6,a0,4000e550 <fat_scan_fat_for_free_clusters+0x64>
uint32_t cl4find = 2;
4000e54c: 00200c13 li s8,2
*cls_added = 0;
4000e550: 00092023 sw zero,0(s2)
while (*cls_added != count && i < data_cls_val)
4000e554: 180a0463 beqz s4,4000e6dc <fat_scan_fat_for_free_clusters+0x1f0><== NEVER TAKEN
4000e558: 00200793 li a5,2
uint32_t i = 2;
4000e55c: 00200493 li s1,2
uint32_t save_cln = FAT_UNDEFINED_VALUE;
4000e560: fff00c93 li s9,-1
while (*cls_added != count && i < data_cls_val)
4000e564: 1737fc63 bgeu a5,s3,4000e6dc <fat_scan_fat_for_free_clusters+0x1f0>
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
4000e568: 00c10613 addi a2,sp,12
4000e56c: 000c0593 mv a1,s8
4000e570: 000d0513 mv a0,s10
uint32_t next_cln = 0;
4000e574: 00012623 sw zero,12(sp)
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
4000e578: a21ff0ef jal ra,4000df98 <fat_get_fat_cluster>
4000e57c: 00050413 mv s0,a0
if ( rc != RC_OK )
4000e580: 14051263 bnez a0,4000e6c4 <fat_scan_fat_for_free_clusters+0x1d8><== NEVER TAKEN
if (next_cln == FAT_GENFAT_FREE)
4000e584: 00c12703 lw a4,12(sp)
if (*cls_added != 0)
4000e588: 00092783 lw a5,0(s2)
if (next_cln == FAT_GENFAT_FREE)
4000e58c: 02071c63 bnez a4,4000e5c4 <fat_scan_fat_for_free_clusters+0xd8>
if (*cls_added == 0)
4000e590: 0a079a63 bnez a5,4000e644 <fat_scan_fat_for_free_clusters+0x158>
*chain = cl4find;
4000e594: 018b2023 sw s8,0(s6)
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
4000e598: fff00613 li a2,-1
4000e59c: 000c0593 mv a1,s8
4000e5a0: 000d0513 mv a0,s10
4000e5a4: bb1ff0ef jal ra,4000e154 <fat_set_fat_cluster>
4000e5a8: 00050413 mv s0,a0
if ( rc != RC_OK )
4000e5ac: 04051e63 bnez a0,4000e608 <fat_scan_fat_for_free_clusters+0x11c><== NEVER TAKEN
if (zero_fill)
4000e5b0: 0e0a9663 bnez s5,4000e69c <fat_scan_fat_for_free_clusters+0x1b0>
(*cls_added)++;
4000e5b4: 00092783 lw a5,0(s2)
4000e5b8: 000c0c93 mv s9,s8
4000e5bc: 00178793 addi a5,a5,1
4000e5c0: 00f92023 sw a5,0(s2)
cl4find++;
4000e5c4: 001c0c13 addi s8,s8,1
i++;
4000e5c8: 00148493 addi s1,s1,1
if (cl4find >= data_cls_val)
4000e5cc: 013c6463 bltu s8,s3,4000e5d4 <fat_scan_fat_for_free_clusters+0xe8>
cl4find = 2;
4000e5d0: 00200c13 li s8,2
while (*cls_added != count && i < data_cls_val)
4000e5d4: 01478463 beq a5,s4,4000e5dc <fat_scan_fat_for_free_clusters+0xf0>
4000e5d8: f89998e3 bne s3,s1,4000e568 <fat_scan_fat_for_free_clusters+0x7c>
*last_cl = save_cln;
4000e5dc: 019ba023 sw s9,0(s7)
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
4000e5e0: 04cd2783 lw a5,76(s10)
fs_info->vol.next_cl = save_cln;
4000e5e4: 059d2a23 sw s9,84(s10)
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
4000e5e8: fff00713 li a4,-1
4000e5ec: 00e78863 beq a5,a4,4000e5fc <fat_scan_fat_for_free_clusters+0x110>
fs_info->vol.free_cls -= (*cls_added);
4000e5f0: 00092703 lw a4,0(s2) <== NOT EXECUTED
4000e5f4: 40e787b3 sub a5,a5,a4 <== NOT EXECUTED
4000e5f8: 04fd2623 sw a5,76(s10) <== NOT EXECUTED
fat_buf_release(fs_info);
4000e5fc: 000d0513 mv a0,s10
4000e600: 951fe0ef jal ra,4000cf50 <fat_buf_release>
return RC_OK;
4000e604: 00000413 li s0,0
}
4000e608: 03c12083 lw ra,60(sp)
4000e60c: 00040513 mv a0,s0
4000e610: 03812403 lw s0,56(sp)
4000e614: 03412483 lw s1,52(sp)
4000e618: 03012903 lw s2,48(sp)
4000e61c: 02c12983 lw s3,44(sp)
4000e620: 02812a03 lw s4,40(sp)
4000e624: 02412a83 lw s5,36(sp)
4000e628: 02012b03 lw s6,32(sp)
4000e62c: 01c12b83 lw s7,28(sp)
4000e630: 01812c03 lw s8,24(sp)
4000e634: 01412c83 lw s9,20(sp)
4000e638: 01012d03 lw s10,16(sp)
4000e63c: 04010113 addi sp,sp,64
4000e640: 00008067 ret
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
4000e644: fff00613 li a2,-1
4000e648: 000c0593 mv a1,s8
4000e64c: 000d0513 mv a0,s10
4000e650: b05ff0ef jal ra,4000e154 <fat_set_fat_cluster>
4000e654: 00050413 mv s0,a0
if ( rc != RC_OK )
4000e658: 06051a63 bnez a0,4000e6cc <fat_scan_fat_for_free_clusters+0x1e0><== NEVER TAKEN
rc = fat_set_fat_cluster(fs_info, save_cln, cl4find);
4000e65c: 000c0613 mv a2,s8
4000e660: 000c8593 mv a1,s9
4000e664: 000d0513 mv a0,s10
4000e668: aedff0ef jal ra,4000e154 <fat_set_fat_cluster>
4000e66c: 00050413 mv s0,a0
if ( rc != RC_OK )
4000e670: f40500e3 beqz a0,4000e5b0 <fat_scan_fat_for_free_clusters+0xc4> <== ALWAYS TAKEN
fat_free_fat_clusters_chain(fs_info, (*chain));
4000e674: 000b2583 lw a1,0(s6) <== NOT EXECUTED
4000e678: 000d0513 mv a0,s10 <== NOT EXECUTED
4000e67c: d69ff0ef jal ra,4000e3e4 <fat_free_fat_clusters_chain> <== NOT EXECUTED
(void) fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE);
4000e680: 00000613 li a2,0 <== NOT EXECUTED
4000e684: 000c0593 mv a1,s8 <== NOT EXECUTED
4000e688: 000d0513 mv a0,s10 <== NOT EXECUTED
4000e68c: ac9ff0ef jal ra,4000e154 <fat_set_fat_cluster> <== NOT EXECUTED
fat_buf_release(fs_info);
4000e690: 000d0513 mv a0,s10 <== NOT EXECUTED
4000e694: 8bdfe0ef jal ra,4000cf50 <fat_buf_release> <== NOT EXECUTED
return rc;
4000e698: f71ff06f j 4000e608 <fat_scan_fat_for_free_clusters+0x11c> <== NOT EXECUTED
fat_cluster_set(fs_info, cl4find, 0, fs_info->vol.bpc, 0);
4000e69c: 008d2683 lw a3,8(s10)
4000e6a0: 00000713 li a4,0
4000e6a4: 00000613 li a2,0
4000e6a8: 000c0593 mv a1,s8
4000e6ac: 000d0513 mv a0,s10
4000e6b0: ae9fe0ef jal ra,4000d198 <fat_cluster_set>
if (fs_info->vol.bpc != bytes_written)
4000e6b4: 008d2783 lw a5,8(s10)
4000e6b8: eea78ee3 beq a5,a0,4000e5b4 <fat_scan_fat_for_free_clusters+0xc8>
rc = -1;
4000e6bc: fff00413 li s0,-1 <== NOT EXECUTED
4000e6c0: fb5ff06f j 4000e674 <fat_scan_fat_for_free_clusters+0x188> <== NOT EXECUTED
if (*cls_added != 0)
4000e6c4: 00092783 lw a5,0(s2) <== NOT EXECUTED
4000e6c8: f40780e3 beqz a5,4000e608 <fat_scan_fat_for_free_clusters+0x11c><== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
4000e6cc: 000b2583 lw a1,0(s6) <== NOT EXECUTED
4000e6d0: 000d0513 mv a0,s10 <== NOT EXECUTED
4000e6d4: d11ff0ef jal ra,4000e3e4 <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
4000e6d8: f31ff06f j 4000e608 <fat_scan_fat_for_free_clusters+0x11c> <== NOT EXECUTED
uint32_t save_cln = FAT_UNDEFINED_VALUE;
4000e6dc: fff00c93 li s9,-1 <== NOT EXECUTED
4000e6e0: efdff06f j 4000e5dc <fat_scan_fat_for_free_clusters+0xf0> <== NOT EXECUTED
4000d098 <fat_sector_write>:
fat_fs_info_t *fs_info,
uint32_t start,
uint32_t offset,
uint32_t count,
const void *buff)
{
4000d098: fd010113 addi sp,sp,-48
4000d09c: 02112623 sw ra,44(sp)
4000d0a0: 02812423 sw s0,40(sp)
4000d0a4: 02912223 sw s1,36(sp)
4000d0a8: 03212023 sw s2,32(sp)
4000d0ac: 01312e23 sw s3,28(sp)
4000d0b0: 01412c23 sw s4,24(sp)
4000d0b4: 01512a23 sw s5,20(sp)
4000d0b8: 01612823 sw s6,16(sp)
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
4000d0bc: 0c068a63 beqz a3,4000d190 <fat_sector_write+0xf8> <== NEVER TAKEN
4000d0c0: 00068493 mv s1,a3
4000d0c4: 00050913 mv s2,a0
4000d0c8: 00058993 mv s3,a1
4000d0cc: 00060a13 mv s4,a2
4000d0d0: 00070b13 mv s6,a4
ssize_t cmpltd = 0;
4000d0d4: 00000a93 li s5,0
4000d0d8: 03c0006f j 4000d114 <fat_sector_write+0x7c>
c = MIN(count, (fs_info->vol.bps - ofs));
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
4000d0dc: d99ff0ef jal ra,4000ce74 <fat_buf_access>
if (rc != RC_OK)
return -1;
memcpy((sec_buf + ofs), (buff + cmpltd), c);
4000d0e0: 015b05b3 add a1,s6,s5
4000d0e4: 00040613 mv a2,s0
fat_buf_mark_modified(fs_info);
count -= c;
4000d0e8: 408484b3 sub s1,s1,s0
if (rc != RC_OK)
4000d0ec: 06051a63 bnez a0,4000d160 <fat_sector_write+0xc8> <== NEVER TAKEN
memcpy((sec_buf + ofs), (buff + cmpltd), c);
4000d0f0: 00c12503 lw a0,12(sp)
cmpltd +=c;
4000d0f4: 008a8ab3 add s5,s5,s0
sec_num++;
4000d0f8: 00198993 addi s3,s3,1
memcpy((sec_buf + ofs), (buff + cmpltd), c);
4000d0fc: 01450533 add a0,a0,s4
4000d100: 7480e0ef jal ra,4001b848 <memcpy>
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
4000d104: 00100793 li a5,1
4000d108: 08f90e23 sb a5,156(s2)
ofs = 0;
4000d10c: 00000a13 li s4,0
while(count > 0)
4000d110: 04048a63 beqz s1,4000d164 <fat_sector_write+0xcc> <== ALWAYS TAKEN
c = MIN(count, (fs_info->vol.bps - ofs));
4000d114: 00095403 lhu s0,0(s2)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
4000d118: 00098593 mv a1,s3
4000d11c: 00c10693 addi a3,sp,12
c = MIN(count, (fs_info->vol.bps - ofs));
4000d120: 41440433 sub s0,s0,s4
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
4000d124: 00100613 li a2,1
4000d128: 00090513 mv a0,s2
c = MIN(count, (fs_info->vol.bps - ofs));
4000d12c: 0084f463 bgeu s1,s0,4000d134 <fat_sector_write+0x9c>
4000d130: 00048413 mv s0,s1
if (c == fs_info->vol.bytes_per_block)
4000d134: 01092783 lw a5,16(s2)
4000d138: fa8792e3 bne a5,s0,4000d0dc <fat_sector_write+0x44>
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
4000d13c: 00200613 li a2,2 <== NOT EXECUTED
4000d140: 00098593 mv a1,s3 <== NOT EXECUTED
4000d144: 00c10693 addi a3,sp,12 <== NOT EXECUTED
4000d148: 00090513 mv a0,s2 <== NOT EXECUTED
4000d14c: d29ff0ef jal ra,4000ce74 <fat_buf_access> <== NOT EXECUTED
memcpy((sec_buf + ofs), (buff + cmpltd), c);
4000d150: 015b05b3 add a1,s6,s5 <== NOT EXECUTED
4000d154: 00040613 mv a2,s0 <== NOT EXECUTED
count -= c;
4000d158: 408484b3 sub s1,s1,s0 <== NOT EXECUTED
if (rc != RC_OK)
4000d15c: f8050ae3 beqz a0,4000d0f0 <fat_sector_write+0x58> <== NOT EXECUTED
return -1;
4000d160: fff00a93 li s5,-1 <== NOT EXECUTED
}
return cmpltd;
}
4000d164: 02c12083 lw ra,44(sp)
4000d168: 02812403 lw s0,40(sp)
4000d16c: 02412483 lw s1,36(sp)
4000d170: 02012903 lw s2,32(sp)
4000d174: 01c12983 lw s3,28(sp)
4000d178: 01812a03 lw s4,24(sp)
4000d17c: 01012b03 lw s6,16(sp)
4000d180: 000a8513 mv a0,s5
4000d184: 01412a83 lw s5,20(sp)
4000d188: 03010113 addi sp,sp,48
4000d18c: 00008067 ret
ssize_t cmpltd = 0;
4000d190: 00000a93 li s5,0 <== NOT EXECUTED
4000d194: fd1ff06f j 4000d164 <fat_sector_write+0xcc> <== NOT EXECUTED
4000e154 <fat_set_fat_cluster>:
fat_set_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t in_val
)
{
4000e154: fd010113 addi sp,sp,-48
4000e158: 02112623 sw ra,44(sp)
4000e15c: 02812423 sw s0,40(sp)
4000e160: 02912223 sw s1,36(sp)
4000e164: 03212023 sw s2,32(sp)
4000e168: 01312e23 sw s3,28(sp)
4000e16c: 01412c23 sw s4,24(sp)
4000e170: 01512a23 sw s5,20(sp)
4000e174: 01612823 sw s6,16(sp)
int rc = RC_OK;
uint32_t sec = 0;
uint32_t ofs = 0;
uint16_t fat16_clv = 0;
uint32_t fat32_clv = 0;
uint8_t *sec_buf = NULL;
4000e178: 00012623 sw zero,12(sp)
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
4000e17c: 00100793 li a5,1
4000e180: 08b7f263 bgeu a5,a1,4000e204 <fat_set_fat_cluster+0xb0>
4000e184: 04052783 lw a5,64(a0)
4000e188: 00058493 mv s1,a1
4000e18c: 00050413 mv s0,a0
4000e190: 00178793 addi a5,a5,1
4000e194: 06b7e863 bltu a5,a1,4000e204 <fat_set_fat_cluster+0xb0>
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000e198: 01654703 lbu a4,22(a0)
fs_info->vol.afat_loc;
4000e19c: 06052a83 lw s5,96(a0)
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000e1a0: 00254783 lbu a5,2(a0)
4000e1a4: 00177693 andi a3,a4,1
4000e1a8: 00060913 mv s2,a2
4000e1ac: 08069863 bnez a3,4000e23c <fat_set_fat_cluster+0xe8>
4000e1b0: 00277713 andi a4,a4,2
4000e1b4: 08070e63 beqz a4,4000e250 <fat_set_fat_cluster+0xfc>
4000e1b8: 00159993 slli s3,a1,0x1
4000e1bc: 00f9d7b3 srl a5,s3,a5
4000e1c0: 01578ab3 add s5,a5,s5
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
4000e1c4: 00c10693 addi a3,sp,12
4000e1c8: 00100613 li a2,1
4000e1cc: 000a8593 mv a1,s5
4000e1d0: 00040513 mv a0,s0
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e1d4: 00045a03 lhu s4,0(s0)
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
4000e1d8: c9dfe0ef jal ra,4000ce74 <fat_buf_access>
if (rc != RC_OK)
4000e1dc: 02051c63 bnez a0,4000e214 <fat_set_fat_cluster+0xc0> <== NEVER TAKEN
return rc;
switch ( fs_info->vol.type )
4000e1e0: 01644b03 lbu s6,22(s0)
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e1e4: fffa0a13 addi s4,s4,-1
switch ( fs_info->vol.type )
4000e1e8: 00200793 li a5,2
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e1ec: 013a79b3 and s3,s4,s3
switch ( fs_info->vol.type )
4000e1f0: 06fb0863 beq s6,a5,4000e260 <fat_set_fat_cluster+0x10c>
4000e1f4: 00400793 li a5,4
4000e1f8: 10fb0063 beq s6,a5,4000e2f8 <fat_set_fat_cluster+0x1a4>
4000e1fc: 00100793 li a5,1
4000e200: 06fb0c63 beq s6,a5,4000e278 <fat_set_fat_cluster+0x124>
fat_buf_mark_modified(fs_info);
break;
default:
rtems_set_errno_and_return_minus_one(EIO);
4000e204: 5550c0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000e208: 00500793 li a5,5 <== NOT EXECUTED
4000e20c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000e210: fff00513 li a0,-1 <== NOT EXECUTED
break;
}
return RC_OK;
}
4000e214: 02c12083 lw ra,44(sp)
4000e218: 02812403 lw s0,40(sp)
4000e21c: 02412483 lw s1,36(sp)
4000e220: 02012903 lw s2,32(sp)
4000e224: 01c12983 lw s3,28(sp)
4000e228: 01812a03 lw s4,24(sp)
4000e22c: 01412a83 lw s5,20(sp)
4000e230: 01012b03 lw s6,16(sp)
4000e234: 03010113 addi sp,sp,48
4000e238: 00008067 ret
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000e23c: 0015d993 srli s3,a1,0x1
4000e240: 00b989b3 add s3,s3,a1
4000e244: 00f9d7b3 srl a5,s3,a5
4000e248: 01578ab3 add s5,a5,s5
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e24c: f79ff06f j 4000e1c4 <fat_set_fat_cluster+0x70>
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
4000e250: 00259993 slli s3,a1,0x2
4000e254: 00f9d7b3 srl a5,s3,a5
4000e258: 01578ab3 add s5,a5,s5
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
4000e25c: f69ff06f j 4000e1c4 <fat_set_fat_cluster+0x70>
*((uint16_t *)(sec_buf + ofs)) =
4000e260: 00c12a03 lw s4,12(sp)
fs_info->c.modified = true;
4000e264: 00100793 li a5,1
4000e268: 013a09b3 add s3,s4,s3
(uint16_t )(CT_LE_W(in_val));
4000e26c: 01299023 sh s2,0(s3)
4000e270: 08f40e23 sb a5,156(s0)
}
4000e274: fa1ff06f j 4000e214 <fat_set_fat_cluster+0xc0>
*(sec_buf + ofs) &= 0x0F;
4000e278: 00c12783 lw a5,12(sp)
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
4000e27c: 01091913 slli s2,s2,0x10
if ( FAT_CLUSTER_IS_ODD(cln) )
4000e280: 0014f493 andi s1,s1,1
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
4000e284: 01095913 srli s2,s2,0x10
*(sec_buf + ofs) &= 0x0F;
4000e288: 013787b3 add a5,a5,s3
if ( FAT_CLUSTER_IS_ODD(cln) )
4000e28c: 08048e63 beqz s1,4000e328 <fat_set_fat_cluster+0x1d4>
*(sec_buf + ofs) &= 0x0F;
4000e290: 0007c703 lbu a4,0(a5)
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
4000e294: 00491913 slli s2,s2,0x4
4000e298: 01091913 slli s2,s2,0x10
*(sec_buf + ofs) &= 0x0F;
4000e29c: 00f77713 andi a4,a4,15
4000e2a0: 00e78023 sb a4,0(a5)
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0);
4000e2a4: 00c12783 lw a5,12(sp)
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
4000e2a8: 01095913 srli s2,s2,0x10
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0);
4000e2ac: 013787b3 add a5,a5,s3
4000e2b0: 0007c703 lbu a4,0(a5)
4000e2b4: 00e96733 or a4,s2,a4
4000e2b8: 00e78023 sb a4,0(a5)
if ( ofs == (fs_info->vol.bps - 1) )
4000e2bc: 00045783 lhu a5,0(s0)
fs_info->c.modified = true;
4000e2c0: 09640e23 sb s6,156(s0)
4000e2c4: fff78793 addi a5,a5,-1
4000e2c8: 0b378863 beq a5,s3,4000e378 <fat_set_fat_cluster+0x224>
*(sec_buf + ofs + 1) &= 0x00;
4000e2cc: 00c12783 lw a5,12(sp)
4000e2d0: 00198993 addi s3,s3,1
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
4000e2d4: 00895913 srli s2,s2,0x8
*(sec_buf + ofs + 1) &= 0x00;
4000e2d8: 013787b3 add a5,a5,s3
4000e2dc: 00078023 sb zero,0(a5)
*(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8);
4000e2e0: 00c12783 lw a5,12(sp)
4000e2e4: 013789b3 add s3,a5,s3
4000e2e8: 0009c783 lbu a5,0(s3)
4000e2ec: 00f96933 or s2,s2,a5
4000e2f0: 01298023 sb s2,0(s3)
4000e2f4: f21ff06f j 4000e214 <fat_set_fat_cluster+0xc0>
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
4000e2f8: 00c12a03 lw s4,12(sp)
fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK));
4000e2fc: 00491913 slli s2,s2,0x4
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
4000e300: f00007b7 lui a5,0xf0000
4000e304: 013a09b3 add s3,s4,s3
4000e308: 0009a703 lw a4,0(s3)
fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK));
4000e30c: 00495913 srli s2,s2,0x4
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
4000e310: 00e7f7b3 and a5,a5,a4
*((uint32_t *)(sec_buf + ofs)) |= fat32_clv;
4000e314: 0127e933 or s2,a5,s2
4000e318: 0129a023 sw s2,0(s3)
4000e31c: 00100793 li a5,1
4000e320: 08f40e23 sb a5,156(s0)
}
4000e324: ef1ff06f j 4000e214 <fat_set_fat_cluster+0xc0>
*(sec_buf + ofs) &= 0x00;
4000e328: 00078023 sb zero,0(a5) # f0000000 <RamEnd+0xaf000000>
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
4000e32c: 00c12783 lw a5,12(sp)
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
4000e330: 01491913 slli s2,s2,0x14
4000e334: 01495913 srli s2,s2,0x14
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
4000e338: 013787b3 add a5,a5,s3
4000e33c: 0007c703 lbu a4,0(a5)
4000e340: 00e96733 or a4,s2,a4
4000e344: 00e78023 sb a4,0(a5)
if ( ofs == (fs_info->vol.bps - 1) )
4000e348: 00045783 lhu a5,0(s0)
fs_info->c.modified = true;
4000e34c: 09640e23 sb s6,156(s0)
4000e350: fff78793 addi a5,a5,-1
4000e354: 07378063 beq a5,s3,4000e3b4 <fat_set_fat_cluster+0x260>
*(sec_buf + ofs + 1) &= 0xF0;
4000e358: 00c12783 lw a5,12(sp)
4000e35c: 00198993 addi s3,s3,1
*(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8);
4000e360: 00895913 srli s2,s2,0x8
*(sec_buf + ofs + 1) &= 0xF0;
4000e364: 013787b3 add a5,a5,s3
4000e368: 0007c703 lbu a4,0(a5)
4000e36c: ff077713 andi a4,a4,-16
4000e370: 00e78023 sb a4,0(a5)
4000e374: f6dff06f j 4000e2e0 <fat_set_fat_cluster+0x18c>
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
4000e378: 00c10693 addi a3,sp,12
4000e37c: 00100613 li a2,1
4000e380: 001a8593 addi a1,s5,1
4000e384: 00040513 mv a0,s0
4000e388: aedfe0ef jal ra,4000ce74 <fat_buf_access>
if (rc != RC_OK)
4000e38c: e80514e3 bnez a0,4000e214 <fat_set_fat_cluster+0xc0> <== NEVER TAKEN
*sec_buf &= 0x00;
4000e390: 00c12703 lw a4,12(sp)
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
4000e394: 00895793 srli a5,s2,0x8
*sec_buf &= 0x00;
4000e398: 00070023 sb zero,0(a4)
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
4000e39c: 00c12703 lw a4,12(sp)
4000e3a0: 00074683 lbu a3,0(a4)
4000e3a4: 00d7e7b3 or a5,a5,a3
4000e3a8: 00f70023 sb a5,0(a4)
4000e3ac: 09640e23 sb s6,156(s0)
}
4000e3b0: e65ff06f j 4000e214 <fat_set_fat_cluster+0xc0>
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
4000e3b4: 00c10693 addi a3,sp,12 <== NOT EXECUTED
4000e3b8: 00100613 li a2,1 <== NOT EXECUTED
4000e3bc: 001a8593 addi a1,s5,1 <== NOT EXECUTED
4000e3c0: 00040513 mv a0,s0 <== NOT EXECUTED
4000e3c4: ab1fe0ef jal ra,4000ce74 <fat_buf_access> <== NOT EXECUTED
if (rc != RC_OK)
4000e3c8: e40516e3 bnez a0,4000e214 <fat_set_fat_cluster+0xc0> <== NOT EXECUTED
*sec_buf &= 0xF0;
4000e3cc: 00c12683 lw a3,12(sp) <== NOT EXECUTED
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
4000e3d0: 00895793 srli a5,s2,0x8 <== NOT EXECUTED
*sec_buf &= 0xF0;
4000e3d4: 0006c703 lbu a4,0(a3) <== NOT EXECUTED
4000e3d8: ff077713 andi a4,a4,-16 <== NOT EXECUTED
4000e3dc: 00e68023 sb a4,0(a3) <== NOT EXECUTED
4000e3e0: fbdff06f j 4000e39c <fat_set_fat_cluster+0x248> <== NOT EXECUTED
4000dcb4 <fat_shutdown_drive>:
* RC_OK on success, or -1 if error occured
* and errno set appropriately
*/
int
fat_shutdown_drive(fat_fs_info_t *fs_info)
{
4000dcb4: fe010113 addi sp,sp,-32
4000dcb8: 00912a23 sw s1,20(sp)
4000dcbc: 00050493 mv s1,a0
4000dcc0: 00812c23 sw s0,24(sp)
4000dcc4: 01212823 sw s2,16(sp)
4000dcc8: 01312623 sw s3,12(sp)
4000dccc: 01412423 sw s4,8(sp)
4000dcd0: 00112e23 sw ra,28(sp)
4000dcd4: 01512223 sw s5,4(sp)
int rc = RC_OK;
int i = 0;
rc = fat_sync(fs_info);
4000dcd8: eddff0ef jal ra,4000dbb4 <fat_sync>
rc = -1;
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->vhash + i;
4000dcdc: 0804a403 lw s0,128(s1)
if ( rc != RC_OK )
4000dce0: 00a039b3 snez s3,a0
rc = fat_sync(fs_info);
4000dce4: 00050913 mv s2,a0
return _Chain_Immutable_head( the_chain )->next;
4000dce8: 00042503 lw a0,0(s0)
return &the_chain->Tail.Node;
4000dcec: 00440a13 addi s4,s0,4
if ( rc != RC_OK )
4000dcf0: 413009b3 neg s3,s3
if ( !_Chain_Is_empty(the_chain))
4000dcf4: 02aa0063 beq s4,a0,4000dd14 <fat_shutdown_drive+0x60>
new_first = old_first->next;
4000dcf8: 00052783 lw a5,0(a0)
head->next = new_first;
4000dcfc: 00f42023 sw a5,0(s0)
new_first->previous = head;
4000dd00: 0087a223 sw s0,4(a5)
while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL )
free(node);
4000dd04: fbcf30ef jal ra,400014c0 <free>
return _Chain_Immutable_head( the_chain )->next;
4000dd08: 00042503 lw a0,0(s0)
if ( !_Chain_Is_empty(the_chain))
4000dd0c: feaa16e3 bne s4,a0,4000dcf8 <fat_shutdown_drive+0x44>
rtems_chain_control *the_chain = fs_info->vhash + i;
4000dd10: 0804a403 lw s0,128(s1)
return _Chain_Immutable_head( the_chain )->next;
4000dd14: 00c42503 lw a0,12(s0)
return &the_chain->Tail.Node;
4000dd18: 01040a13 addi s4,s0,16
4000dd1c: 00c40a93 addi s5,s0,12
if ( !_Chain_Is_empty(the_chain))
4000dd20: 01450e63 beq a0,s4,4000dd3c <fat_shutdown_drive+0x88>
new_first = old_first->next;
4000dd24: 00052783 lw a5,0(a0) <== NOT EXECUTED
head->next = new_first;
4000dd28: 00f42623 sw a5,12(s0) <== NOT EXECUTED
new_first->previous = head;
4000dd2c: 0157a223 sw s5,4(a5) <== NOT EXECUTED
free(node);
4000dd30: f90f30ef jal ra,400014c0 <free> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
4000dd34: 00c42503 lw a0,12(s0) <== NOT EXECUTED
if ( !_Chain_Is_empty(the_chain))
4000dd38: feaa16e3 bne s4,a0,4000dd24 <fat_shutdown_drive+0x70> <== NOT EXECUTED
}
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->rhash + i;
4000dd3c: 0844a403 lw s0,132(s1)
return _Chain_Immutable_head( the_chain )->next;
4000dd40: 00042503 lw a0,0(s0)
return &the_chain->Tail.Node;
4000dd44: 00440a13 addi s4,s0,4
if ( !_Chain_Is_empty(the_chain))
4000dd48: 02aa0063 beq s4,a0,4000dd68 <fat_shutdown_drive+0xb4>
new_first = old_first->next;
4000dd4c: 00052783 lw a5,0(a0) <== NOT EXECUTED
head->next = new_first;
4000dd50: 00f42023 sw a5,0(s0) <== NOT EXECUTED
new_first->previous = head;
4000dd54: 0087a223 sw s0,4(a5) <== NOT EXECUTED
while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL )
free(node);
4000dd58: f68f30ef jal ra,400014c0 <free> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
4000dd5c: 00042503 lw a0,0(s0) <== NOT EXECUTED
if ( !_Chain_Is_empty(the_chain))
4000dd60: ff4516e3 bne a0,s4,4000dd4c <fat_shutdown_drive+0x98> <== NOT EXECUTED
rtems_chain_control *the_chain = fs_info->rhash + i;
4000dd64: 0844a403 lw s0,132(s1) <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
4000dd68: 00c42503 lw a0,12(s0)
return &the_chain->Tail.Node;
4000dd6c: 01040a13 addi s4,s0,16
4000dd70: 00c40a93 addi s5,s0,12
if ( !_Chain_Is_empty(the_chain))
4000dd74: 00aa0e63 beq s4,a0,4000dd90 <fat_shutdown_drive+0xdc>
new_first = old_first->next;
4000dd78: 00052783 lw a5,0(a0) <== NOT EXECUTED
head->next = new_first;
4000dd7c: 00f42623 sw a5,12(s0) <== NOT EXECUTED
new_first->previous = head;
4000dd80: 0157a223 sw s5,4(a5) <== NOT EXECUTED
free(node);
4000dd84: f3cf30ef jal ra,400014c0 <free> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
4000dd88: 00c42503 lw a0,12(s0) <== NOT EXECUTED
if ( !_Chain_Is_empty(the_chain))
4000dd8c: feaa16e3 bne s4,a0,4000dd78 <fat_shutdown_drive+0xc4> <== NOT EXECUTED
}
free(fs_info->vhash);
4000dd90: 0804a503 lw a0,128(s1)
4000dd94: f2cf30ef jal ra,400014c0 <free>
free(fs_info->rhash);
4000dd98: 0844a503 lw a0,132(s1)
4000dd9c: f24f30ef jal ra,400014c0 <free>
free(fs_info->uino);
4000dda0: 0884a503 lw a0,136(s1)
4000dda4: f1cf30ef jal ra,400014c0 <free>
free(fs_info->sec_buf);
4000dda8: 0a44a503 lw a0,164(s1)
4000ddac: f14f30ef jal ra,400014c0 <free>
close(fs_info->vol.fd);
4000ddb0: 0684a503 lw a0,104(s1)
4000ddb4: d28f30ef jal ra,400012dc <close>
if (rc)
4000ddb8: 02091663 bnez s2,4000dde4 <fat_shutdown_drive+0x130> <== NEVER TAKEN
errno = EIO;
return rc;
}
4000ddbc: 01c12083 lw ra,28(sp)
4000ddc0: 01812403 lw s0,24(sp)
4000ddc4: 01412483 lw s1,20(sp)
4000ddc8: 01012903 lw s2,16(sp)
4000ddcc: 00812a03 lw s4,8(sp)
4000ddd0: 00412a83 lw s5,4(sp)
4000ddd4: 00098513 mv a0,s3
4000ddd8: 00c12983 lw s3,12(sp)
4000dddc: 02010113 addi sp,sp,32
4000dde0: 00008067 ret
errno = EIO;
4000dde4: 1740d0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000dde8: 00500793 li a5,5 <== NOT EXECUTED
4000ddec: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return rc;
4000ddf0: fcdff06f j 4000ddbc <fat_shutdown_drive+0x108> <== NOT EXECUTED
4000dbb4 <fat_sync>:
return RC_OK;
}
int
fat_sync(fat_fs_info_t *fs_info)
{
4000dbb4: fe010113 addi sp,sp,-32
4000dbb8: 00812c23 sw s0,24(sp)
4000dbbc: 00912a23 sw s1,20(sp)
4000dbc0: 00112e23 sw ra,28(sp)
4000dbc4: 01212823 sw s2,16(sp)
if (fs_info->vol.type == FAT_FAT32)
4000dbc8: 01654703 lbu a4,22(a0)
4000dbcc: 00400793 li a5,4
{
4000dbd0: 00050413 mv s0,a0
return RC_OK;
4000dbd4: 00000493 li s1,0
if (fs_info->vol.type == FAT_FAT32)
4000dbd8: 02f70e63 beq a4,a5,4000dc14 <fat_sync+0x60>
if (fs_info->c.state == FAT_CACHE_EMPTY)
4000dbdc: 09d44783 lbu a5,157(s0)
4000dbe0: 00078663 beqz a5,4000dbec <fat_sync+0x38>
4000dbe4: 00040513 mv a0,s0
4000dbe8: 8f0ff0ef jal ra,4000ccd8 <fat_buf_release.part.0>
if ( rc != RC_OK )
rc = -1;
fat_buf_release(fs_info);
if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL)
4000dbec: 06c42503 lw a0,108(s0)
4000dbf0: 2a0080ef jal ra,40015e90 <rtems_bdbuf_syncdev>
4000dbf4: 0a051c63 bnez a0,4000dcac <fat_sync+0xf8> <== NEVER TAKEN
rc = -1;
return rc;
}
4000dbf8: 01c12083 lw ra,28(sp)
4000dbfc: 01812403 lw s0,24(sp)
4000dc00: 01012903 lw s2,16(sp)
4000dc04: 00048513 mv a0,s1
4000dc08: 01412483 lw s1,20(sp)
4000dc0c: 02010113 addi sp,sp,32
4000dc10: 00008067 ret
uint32_t free_count = fs_info->vol.free_cls;
4000dc14: 04c52783 lw a5,76(a0)
if (free_count != fs_info->vol.free_cls_in_fs_info)
4000dc18: 05052703 lw a4,80(a0)
uint32_t next_free = fs_info->vol.next_cl;
4000dc1c: 05452903 lw s2,84(a0)
if (free_count != fs_info->vol.free_cls_in_fs_info)
4000dc20: 02e79863 bne a5,a4,4000dc50 <fat_sync+0x9c>
if (next_free != fs_info->vol.next_cl_in_fs_info)
4000dc24: 05852783 lw a5,88(a0)
4000dc28: faf90ae3 beq s2,a5,4000dbdc <fat_sync+0x28>
ret2 = fat_sector_write(fs_info,
4000dc2c: 04845583 lhu a1,72(s0)
fs_info->vol.next_cl_in_fs_info = next_free;
4000dc30: 05242c23 sw s2,88(s0)
ret2 = fat_sector_write(fs_info,
4000dc34: 00c10713 addi a4,sp,12
4000dc38: 00400693 li a3,4
4000dc3c: 1ec00613 li a2,492
uint32_t le_next_free = CT_LE_L(next_free);
4000dc40: 01212623 sw s2,12(sp)
ret2 = fat_sector_write(fs_info,
4000dc44: c54ff0ef jal ra,4000d098 <fat_sector_write>
if ( (ret1 < 0) || (ret2 < 0) )
4000dc48: 41f55493 srai s1,a0,0x1f
4000dc4c: f91ff06f j 4000dbdc <fat_sync+0x28>
ret1 = fat_sector_write(fs_info,
4000dc50: 04855583 lhu a1,72(a0) <== NOT EXECUTED
fs_info->vol.free_cls_in_fs_info = free_count;
4000dc54: 04f52823 sw a5,80(a0) <== NOT EXECUTED
ret1 = fat_sector_write(fs_info,
4000dc58: 00c10713 addi a4,sp,12 <== NOT EXECUTED
4000dc5c: 00400693 li a3,4 <== NOT EXECUTED
4000dc60: 1e800613 li a2,488 <== NOT EXECUTED
uint32_t le_free_count = CT_LE_L(free_count);
4000dc64: 00f12623 sw a5,12(sp) <== NOT EXECUTED
ret1 = fat_sector_write(fs_info,
4000dc68: c30ff0ef jal ra,4000d098 <fat_sector_write> <== NOT EXECUTED
if (next_free != fs_info->vol.next_cl_in_fs_info)
4000dc6c: 05842783 lw a5,88(s0) <== NOT EXECUTED
ret1 = fat_sector_write(fs_info,
4000dc70: 00050493 mv s1,a0 <== NOT EXECUTED
if (next_free != fs_info->vol.next_cl_in_fs_info)
4000dc74: 00f91663 bne s2,a5,4000dc80 <fat_sync+0xcc> <== NOT EXECUTED
if ( (ret1 < 0) || (ret2 < 0) )
4000dc78: 41f55493 srai s1,a0,0x1f <== NOT EXECUTED
4000dc7c: f61ff06f j 4000dbdc <fat_sync+0x28> <== NOT EXECUTED
ret2 = fat_sector_write(fs_info,
4000dc80: 04845583 lhu a1,72(s0) <== NOT EXECUTED
fs_info->vol.next_cl_in_fs_info = next_free;
4000dc84: 05242c23 sw s2,88(s0) <== NOT EXECUTED
ret2 = fat_sector_write(fs_info,
4000dc88: 00c10713 addi a4,sp,12 <== NOT EXECUTED
4000dc8c: 00400693 li a3,4 <== NOT EXECUTED
4000dc90: 1ec00613 li a2,492 <== NOT EXECUTED
4000dc94: 00040513 mv a0,s0 <== NOT EXECUTED
uint32_t le_next_free = CT_LE_L(next_free);
4000dc98: 01212623 sw s2,12(sp) <== NOT EXECUTED
ret2 = fat_sector_write(fs_info,
4000dc9c: bfcff0ef jal ra,4000d098 <fat_sector_write> <== NOT EXECUTED
if ( (ret1 < 0) || (ret2 < 0) )
4000dca0: fa04d4e3 bgez s1,4000dc48 <fat_sync+0x94> <== NOT EXECUTED
rc = -1;
4000dca4: fff00493 li s1,-1 <== NOT EXECUTED
4000dca8: f35ff06f j 4000dbdc <fat_sync+0x28> <== NOT EXECUTED
rc = -1;
4000dcac: fff00493 li s1,-1 <== NOT EXECUTED
return rc;
4000dcb0: f49ff06f j 4000dbf8 <fat_sync+0x44> <== NOT EXECUTED
4000f748 <msdos_creat_node>:
mode_t mode,
const fat_file_fd_t *link_fd)
{
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
4000f748: 01452803 lw a6,20(a0)
{
4000f74c: f3010113 addi sp,sp,-208
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
4000f750: fff00713 li a4,-1
4000f754: 0c912223 sw s1,196(sp)
4000f758: 0b512a23 sw s5,180(sp)
4000f75c: 0b812423 sw s8,168(sp)
4000f760: 00050493 mv s1,a0
4000f764: 00058c13 mv s8,a1
4000f768: 00060a93 mv s5,a2
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
4000f76c: 00000593 li a1,0
4000f770: 04000613 li a2,64
4000f774: 06010513 addi a0,sp,96
{
4000f778: 0c812423 sw s0,200(sp)
4000f77c: 0d212023 sw s2,192(sp)
4000f780: 0b612823 sw s6,176(sp)
4000f784: 0b912223 sw s9,164(sp)
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
4000f788: 00882b03 lw s6,8(a6)
{
4000f78c: 00078c93 mv s9,a5
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
4000f790: 0084a403 lw s0,8(s1)
{
4000f794: 0c112623 sw ra,204(sp)
4000f798: 0b312e23 sw s3,188(sp)
4000f79c: 0b412c23 sw s4,184(sp)
4000f7a0: 0b712623 sw s7,172(sp)
4000f7a4: 00068913 mv s2,a3
fat_file_fd_t *fat_fd = NULL;
4000f7a8: 00012623 sw zero,12(sp)
uint16_t time_val = 0;
4000f7ac: 00011423 sh zero,8(sp)
uint16_t date = 0;
4000f7b0: 00011523 sh zero,10(sp)
dir_pos->sname.cln = 0;
4000f7b4: 00012823 sw zero,16(sp)
dir_pos->sname.ofs = 0;
4000f7b8: 00012a23 sw zero,20(sp)
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
4000f7bc: 00e12c23 sw a4,24(sp)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
4000f7c0: 00e12e23 sw a4,28(sp)
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
4000f7c4: 02012023 sw zero,32(sp)
4000f7c8: 02012223 sw zero,36(sp)
4000f7cc: 02012423 sw zero,40(sp)
4000f7d0: 02012623 sw zero,44(sp)
4000f7d4: 02012823 sw zero,48(sp)
4000f7d8: 02012a23 sw zero,52(sp)
4000f7dc: 02012c23 sw zero,56(sp)
4000f7e0: 02012e23 sw zero,60(sp)
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
4000f7e4: 18c0c0ef jal ra,4001b970 <memset>
if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) {
4000f7e8: 10400793 li a5,260
4000f7ec: 3f27ca63 blt a5,s2,4000fbe0 <msdos_creat_node+0x498>
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
}
name_type = msdos_long_to_short (fs_info->converter,
4000f7f0: 0ccb2503 lw a0,204(s6)
4000f7f4: 00b00713 li a4,11
4000f7f8: 02010693 addi a3,sp,32
4000f7fc: 00090613 mv a2,s2
4000f800: 000a8593 mv a1,s5
4000f804: 091000ef jal ra,40010094 <msdos_long_to_short>
4000f808: 00050b93 mv s7,a0
name, name_len,
MSDOS_DIR_NAME(short_node),
MSDOS_NAME_MAX);
if (name_type == MSDOS_NAME_INVALID) {
4000f80c: 3e050463 beqz a0,4000fbf4 <msdos_creat_node+0x4ac> <== NEVER TAKEN
/* fill reserved field */
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
/* set up last write date and time */
now = time(NULL);
4000f810: 00000513 li a0,0
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
4000f814: 02010623 sb zero,44(sp)
now = time(NULL);
4000f818: 7680f0ef jal ra,4001ef80 <time>
static inline void fat_file_set_ctime_mtime(fat_file_fd_t *fat_fd, time_t t)
{
fat_fd->ctime = t;
fat_fd->mtime = t;
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f81c: 03044703 lbu a4,48(s0)
fat_fd->ctime = t;
4000f820: 04b42223 sw a1,68(s0)
fat_fd->mtime = t;
4000f824: 04b42623 sw a1,76(s0)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f828: 00276713 ori a4,a4,2
4000f82c: 02e40823 sb a4,48(s0)
4000f830: 00058993 mv s3,a1
fat_fd->ctime = t;
4000f834: 04a42023 sw a0,64(s0)
fat_fd->mtime = t;
4000f838: 04a42423 sw a0,72(s0)
fat_file_set_ctime_mtime(parent_fat_fd, now);
msdos_date_unix2dos(now, &date, &time_val);
4000f83c: 00810613 addi a2,sp,8
4000f840: 00a10593 addi a1,sp,10
now = time(NULL);
4000f844: 00050a13 mv s4,a0
msdos_date_unix2dos(now, &date, &time_val);
4000f848: 559060ef jal ra,400165a0 <msdos_date_unix2dos>
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
4000f84c: 00a15703 lhu a4,10(sp)
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
4000f850: 00815783 lhu a5,8(sp)
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
4000f854: 02012e23 sw zero,60(sp)
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
4000f858: 02e11823 sh a4,48(sp)
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
4000f85c: 02f11723 sh a5,46(sp)
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
4000f860: 02f11b23 sh a5,54(sp)
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
4000f864: 02e11c23 sh a4,56(sp)
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
4000f868: 02e11923 sh a4,50(sp)
if (type == FAT_DIRECTORY) {
4000f86c: 060c0a63 beqz s8,4000f8e0 <msdos_creat_node+0x198>
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
}
else if (type == FAT_HARD_LINK) {
4000f870: 00200793 li a5,2
4000f874: 28fc0c63 beq s8,a5,4000fb0c <msdos_creat_node+0x3c4>
* set "archive bit" due to changes
*/
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
}
else { /* regular file... */
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
4000f878: 02b14783 lbu a5,43(sp)
4000f87c: 0207e793 ori a5,a5,32
4000f880: 02f105a3 sb a5,43(sp)
/*
* find free space in the parent directory and write new initialized
* FAT 32 Bytes Directory Entry Structure to the disk
*/
rc = msdos_get_name_node(parent_loc, true, name, name_len,
4000f884: 00090693 mv a3,s2
4000f888: 02010813 addi a6,sp,32
4000f88c: 01010793 addi a5,sp,16
4000f890: 000b8713 mv a4,s7
4000f894: 000a8613 mv a2,s5
4000f898: 00100593 li a1,1
4000f89c: 00048513 mv a0,s1
4000f8a0: 665010ef jal ra,40011704 <msdos_get_name_node>
4000f8a4: 00050913 mv s2,a0
err:
/* mark the used 32bytes structure on the disk as free */
msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5);
return rc;
}
4000f8a8: 0cc12083 lw ra,204(sp)
4000f8ac: 0c812403 lw s0,200(sp)
4000f8b0: 0c412483 lw s1,196(sp)
4000f8b4: 0bc12983 lw s3,188(sp)
4000f8b8: 0b812a03 lw s4,184(sp)
4000f8bc: 0b412a83 lw s5,180(sp)
4000f8c0: 0b012b03 lw s6,176(sp)
4000f8c4: 0ac12b83 lw s7,172(sp)
4000f8c8: 0a812c03 lw s8,168(sp)
4000f8cc: 0a412c83 lw s9,164(sp)
4000f8d0: 00090513 mv a0,s2
4000f8d4: 0c012903 lw s2,192(sp)
4000f8d8: 0d010113 addi sp,sp,208
4000f8dc: 00008067 ret
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
4000f8e0: 02b14883 lbu a7,43(sp)
rc = msdos_get_name_node(parent_loc, true, name, name_len,
4000f8e4: 00090693 mv a3,s2
4000f8e8: 02010813 addi a6,sp,32
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
4000f8ec: 0108e893 ori a7,a7,16
rc = msdos_get_name_node(parent_loc, true, name, name_len,
4000f8f0: 01010793 addi a5,sp,16
4000f8f4: 000b8713 mv a4,s7
4000f8f8: 000a8613 mv a2,s5
4000f8fc: 00100593 li a1,1
4000f900: 00048513 mv a0,s1
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
4000f904: 031105a3 sb a7,43(sp)
rc = msdos_get_name_node(parent_loc, true, name, name_len,
4000f908: 5fd010ef jal ra,40011704 <msdos_get_name_node>
4000f90c: 00050913 mv s2,a0
if ( rc != RC_OK )
4000f910: f8051ce3 bnez a0,4000f8a8 <msdos_creat_node+0x160> <== NEVER TAKEN
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
4000f914: 00c10613 addi a2,sp,12
4000f918: 01010593 addi a1,sp,16
4000f91c: 000b0513 mv a0,s6
4000f920: e99fe0ef jal ra,4000e7b8 <fat_file_open>
4000f924: 00050913 mv s2,a0
if (rc != RC_OK)
4000f928: 00050c63 beqz a0,4000f940 <msdos_creat_node+0x1f8> <== ALWAYS TAKEN
msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5);
4000f92c: 0144a503 lw a0,20(s1) <== NOT EXECUTED
4000f930: 0e500613 li a2,229 <== NOT EXECUTED
4000f934: 01010593 addi a1,sp,16 <== NOT EXECUTED
4000f938: 4b9000ef jal ra,400105f0 <msdos_set_first_char4file_name> <== NOT EXECUTED
return rc;
4000f93c: f6dff06f j 4000f8a8 <msdos_creat_node+0x160> <== NOT EXECUTED
fat_fd->fat_file_type = FAT_DIRECTORY;
4000f940: 00c12583 lw a1,12(sp)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
4000f944: 002006b7 lui a3,0x200
rc = fat_file_extend(&fs_info->fat,
4000f948: 04010713 addi a4,sp,64
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4000f94c: 0305c783 lbu a5,48(a1)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
4000f950: 00d5aa23 sw a3,20(a1)
fat_fd->fat_file_type = FAT_DIRECTORY;
4000f954: 0005a823 sw zero,16(a1)
4000f958: 0027e793 ori a5,a5,2
4000f95c: 02f58823 sb a5,48(a1)
rc = fat_file_extend(&fs_info->fat,
4000f960: 008b2683 lw a3,8(s6)
4000f964: 00100613 li a2,1
fat_fd->ctime = t;
4000f968: 0545a023 sw s4,64(a1)
4000f96c: 0535a223 sw s3,68(a1)
fat_fd->mtime = t;
4000f970: 0545a423 sw s4,72(a1)
4000f974: 0535a623 sw s3,76(a1)
4000f978: 000b0513 mv a0,s6
4000f97c: e8cff0ef jal ra,4000f008 <fat_file_extend>
4000f980: 00050913 mv s2,a0
if (rc != RC_OK)
4000f984: fa0514e3 bnez a0,4000f92c <msdos_creat_node+0x1e4> <== NEVER TAKEN
memcpy(DOT_NODE_P(dot_dotdot), short_node,
4000f988: 02012303 lw t1,32(sp)
4000f98c: 02412883 lw a7,36(sp)
4000f990: 02812803 lw a6,40(sp)
4000f994: 02c12503 lw a0,44(sp)
4000f998: 03412603 lw a2,52(sp)
4000f99c: 03812683 lw a3,56(sp)
4000f9a0: 03c12703 lw a4,60(sp)
4000f9a4: 03012583 lw a1,48(sp)
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
4000f9a8: 8b81a783 lw a5,-1864(gp) # 40027e90 <MSDOS_DOT_NAME>
memcpy(DOT_NODE_P(dot_dotdot), short_node,
4000f9ac: 06c12a23 sw a2,116(sp)
4000f9b0: 06d12c23 sw a3,120(sp)
4000f9b4: 06e12e23 sw a4,124(sp)
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
4000f9b8: 08c12a23 sw a2,148(sp)
4000f9bc: 08d12c23 sw a3,152(sp)
4000f9c0: 08e12e23 sw a4,156(sp)
memcpy(DOT_NODE_P(dot_dotdot), short_node,
4000f9c4: 06612023 sw t1,96(sp)
4000f9c8: 07112223 sw a7,100(sp)
4000f9cc: 07012423 sw a6,104(sp)
4000f9d0: 06a12623 sw a0,108(sp)
4000f9d4: 06b12823 sw a1,112(sp)
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
4000f9d8: 08612023 sw t1,128(sp)
4000f9dc: 09112223 sw a7,132(sp)
4000f9e0: 09012423 sw a6,136(sp)
4000f9e4: 08a12623 sw a0,140(sp)
4000f9e8: 08b12823 sw a1,144(sp)
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
4000f9ec: 0017ce83 lbu t4,1(a5)
4000f9f0: 0027ce03 lbu t3,2(a5)
4000f9f4: 0037c303 lbu t1,3(a5)
4000f9f8: 0047c883 lbu a7,4(a5)
4000f9fc: 0057c803 lbu a6,5(a5)
4000fa00: 0067c503 lbu a0,6(a5)
4000fa04: 0007cf03 lbu t5,0(a5)
4000fa08: 0077c583 lbu a1,7(a5)
4000fa0c: 0087c603 lbu a2,8(a5)
4000fa10: 0097c683 lbu a3,9(a5)
4000fa14: 00a7c703 lbu a4,10(a5)
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
4000fa18: 8b41a783 lw a5,-1868(gp) # 40027e8c <MSDOS_DOTDOT_NAME>
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
4000fa1c: 07e10023 sb t5,96(sp)
4000fa20: 07d100a3 sb t4,97(sp)
4000fa24: 07c10123 sb t3,98(sp)
4000fa28: 066101a3 sb t1,99(sp)
4000fa2c: 07110223 sb a7,100(sp)
4000fa30: 070102a3 sb a6,101(sp)
4000fa34: 06a10323 sb a0,102(sp)
4000fa38: 06b103a3 sb a1,103(sp)
4000fa3c: 06c10423 sb a2,104(sp)
4000fa40: 06d104a3 sb a3,105(sp)
4000fa44: 06e10523 sb a4,106(sp)
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
4000fa48: 0007ce83 lbu t4,0(a5)
4000fa4c: 0017ce03 lbu t3,1(a5)
4000fa50: 0027c303 lbu t1,2(a5)
4000fa54: 0037c883 lbu a7,3(a5)
4000fa58: 0047c803 lbu a6,4(a5)
4000fa5c: 00a7c703 lbu a4,10(a5)
4000fa60: 0067c503 lbu a0,6(a5)
4000fa64: 0077c583 lbu a1,7(a5)
4000fa68: 0087c603 lbu a2,8(a5)
4000fa6c: 0097c683 lbu a3,9(a5)
4000fa70: 0057c783 lbu a5,5(a5)
4000fa74: 09d10023 sb t4,128(sp)
4000fa78: 09c100a3 sb t3,129(sp)
4000fa7c: 08610123 sb t1,130(sp)
4000fa80: 091101a3 sb a7,131(sp)
4000fa84: 09010223 sb a6,132(sp)
4000fa88: 08f102a3 sb a5,133(sp)
4000fa8c: 08a10323 sb a0,134(sp)
4000fa90: 08b103a3 sb a1,135(sp)
4000fa94: 08c10423 sb a2,136(sp)
4000fa98: 08d104a3 sb a3,137(sp)
4000fa9c: 08e10523 sb a4,138(sp)
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
4000faa0: 02042703 lw a4,32(s0)
4000faa4: 00100793 li a5,1
4000faa8: 0ef70e63 beq a4,a5,4000fba4 <msdos_creat_node+0x45c>
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
4000faac: 01c42783 lw a5,28(s0)
CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
4000fab0: 0107d713 srli a4,a5,0x10
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
4000fab4: 08f11d23 sh a5,154(sp)
CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
4000fab8: 08e11a23 sh a4,148(sp)
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
4000fabc: 00c12583 lw a1,12(sp)
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
4000fac0: 06010713 addi a4,sp,96
4000fac4: 04000693 li a3,64
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
4000fac8: 01c5a783 lw a5,28(a1)
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
4000facc: 00000613 li a2,0
4000fad0: 000b0513 mv a0,s6
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
4000fad4: 0107d813 srli a6,a5,0x10
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
4000fad8: 06f11d23 sh a5,122(sp)
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
4000fadc: 07011a23 sh a6,116(sp)
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
4000fae0: f90ff0ef jal ra,4000f270 <fat_file_write>
if (ret < 0)
4000fae4: 0e054063 bltz a0,4000fbc4 <msdos_creat_node+0x47c> <== NEVER TAKEN
rc = fat_file_write_first_cluster_num(&fs_info->fat, fat_fd);
4000fae8: 00c12583 lw a1,12(sp)
4000faec: 000b0513 mv a0,s6
4000faf0: 195000ef jal ra,40010484 <fat_file_write_first_cluster_num>
4000faf4: 00050913 mv s2,a0
if (rc != RC_OK)
4000faf8: 0c051863 bnez a0,4000fbc8 <msdos_creat_node+0x480> <== NEVER TAKEN
fat_file_close(&fs_info->fat, fat_fd);
4000fafc: 00c12583 lw a1,12(sp)
4000fb00: 000b0513 mv a0,s6
4000fb04: b58ff0ef jal ra,4000ee5c <fat_file_close>
4000fb08: da1ff06f j 4000f8a8 <msdos_creat_node+0x160>
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
4000fb0c: 020ca783 lw a5,32(s9) <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4000fb10: 00079863 bnez a5,4000fb20 <msdos_creat_node+0x3d8> <== NOT EXECUTED
4000fb14: 016b4703 lbu a4,22(s6) <== NOT EXECUTED
4000fb18: 00377713 andi a4,a4,3 <== NOT EXECUTED
4000fb1c: 0a071e63 bnez a4,4000fbd8 <msdos_creat_node+0x490> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4000fb20: 005b4703 lbu a4,5(s6) <== NOT EXECUTED
4000fb24: 03cb2583 lw a1,60(s6) <== NOT EXECUTED
4000fb28: ffe78793 addi a5,a5,-2 <== NOT EXECUTED
4000fb2c: 00e797b3 sll a5,a5,a4 <== NOT EXECUTED
4000fb30: 00b787b3 add a5,a5,a1 <== NOT EXECUTED
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
4000fb34: 024ca503 lw a0,36(s9) <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
4000fb38: 000b5603 lhu a2,0(s6) <== NOT EXECUTED
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
4000fb3c: 002b4583 lbu a1,2(s6) <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
4000fb40: 04010713 addi a4,sp,64 <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
4000fb44: fff60613 addi a2,a2,-1 <== NOT EXECUTED
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
4000fb48: 00b555b3 srl a1,a0,a1 <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
4000fb4c: 00a67633 and a2,a2,a0 <== NOT EXECUTED
4000fb50: 02000693 li a3,32 <== NOT EXECUTED
4000fb54: 00f585b3 add a1,a1,a5 <== NOT EXECUTED
4000fb58: 000b0513 mv a0,s6 <== NOT EXECUTED
4000fb5c: c08fd0ef jal ra,4000cf64 <_fat_block_read> <== NOT EXECUTED
if (ret < 0) {
4000fb60: 0a054463 bltz a0,4000fc08 <msdos_creat_node+0x4c0> <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME_TENTH(short_node)=*MSDOS_DIR_CRT_TIME_TENTH(link_node);
4000fb64: 04d14703 lbu a4,77(sp) <== NOT EXECUTED
*MSDOS_DIR_ATTR(short_node) =*MSDOS_DIR_ATTR(link_node);
4000fb68: 04b14783 lbu a5,75(sp) <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME_TENTH(short_node)=*MSDOS_DIR_CRT_TIME_TENTH(link_node);
4000fb6c: 02e106a3 sb a4,45(sp) <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
4000fb70: 04e15703 lhu a4,78(sp) <== NOT EXECUTED
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
4000fb74: 0207e793 ori a5,a5,32 <== NOT EXECUTED
4000fb78: 02f105a3 sb a5,43(sp) <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
4000fb7c: 02e11723 sh a4,46(sp) <== NOT EXECUTED
*MSDOS_DIR_CRT_DATE(short_node) =*MSDOS_DIR_CRT_DATE(link_node);
4000fb80: 05015703 lhu a4,80(sp) <== NOT EXECUTED
4000fb84: 02e11823 sh a4,48(sp) <== NOT EXECUTED
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
4000fb88: 05c12703 lw a4,92(sp) <== NOT EXECUTED
4000fb8c: 02e12e23 sw a4,60(sp) <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
4000fb90: 05a15703 lhu a4,90(sp) <== NOT EXECUTED
4000fb94: 02e11d23 sh a4,58(sp) <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
4000fb98: 05415703 lhu a4,84(sp) <== NOT EXECUTED
4000fb9c: 02e11a23 sh a4,52(sp) <== NOT EXECUTED
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
4000fba0: ce5ff06f j 4000f884 <msdos_creat_node+0x13c> <== NOT EXECUTED
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
4000fba4: 02442783 lw a5,36(s0)
4000fba8: f00792e3 bnez a5,4000faac <msdos_creat_node+0x364> <== NEVER TAKEN
4000fbac: 016b4783 lbu a5,22(s6)
4000fbb0: 0047f793 andi a5,a5,4
4000fbb4: ee078ce3 beqz a5,4000faac <msdos_creat_node+0x364> <== ALWAYS TAKEN
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
4000fbb8: 08011d23 sh zero,154(sp) <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
4000fbbc: 08011a23 sh zero,148(sp) <== NOT EXECUTED
4000fbc0: efdff06f j 4000fabc <msdos_creat_node+0x374> <== NOT EXECUTED
rc = -1;
4000fbc4: fff00913 li s2,-1 <== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
4000fbc8: 00c12583 lw a1,12(sp) <== NOT EXECUTED
4000fbcc: 000b0513 mv a0,s6 <== NOT EXECUTED
4000fbd0: a8cff0ef jal ra,4000ee5c <fat_file_close> <== NOT EXECUTED
4000fbd4: d59ff06f j 4000f92c <msdos_creat_node+0x1e4> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
4000fbd8: 028b2783 lw a5,40(s6) <== NOT EXECUTED
4000fbdc: f59ff06f j 4000fb34 <msdos_creat_node+0x3ec> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
4000fbe0: 3780b0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000fbe4: 05b00793 li a5,91 <== NOT EXECUTED
4000fbe8: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000fbec: fff00913 li s2,-1 <== NOT EXECUTED
4000fbf0: cb9ff06f j 4000f8a8 <msdos_creat_node+0x160> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EINVAL);
4000fbf4: 3640b0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
4000fbf8: 01600793 li a5,22 <== NOT EXECUTED
4000fbfc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
4000fc00: fff00913 li s2,-1 <== NOT EXECUTED
4000fc04: ca5ff06f j 4000f8a8 <msdos_creat_node+0x160> <== NOT EXECUTED
return -1;
4000fc08: fff00913 li s2,-1 <== NOT EXECUTED
4000fc0c: c9dff06f j 4000f8a8 <msdos_creat_node+0x160> <== NOT EXECUTED
400166dc <msdos_date_dos2unix>:
uint32_t days;
uint16_t *months;
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
400166dc: 00b5d793 srli a5,a1,0xb
400166e0: 70800713 li a4,1800
400166e4: 01f7f793 andi a5,a5,31
400166e8: 02e787b3 mul a5,a5,a4
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
400166ec: 0055d713 srli a4,a1,0x5
400166f0: 03f77693 andi a3,a4,63
400166f4: 00469713 slli a4,a3,0x4
400166f8: 40d70733 sub a4,a4,a3
/*
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
400166fc: 95a18693 addi a3,gp,-1702 # 40027f32 <lastdosdate>
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
40016700: 00171713 slli a4,a4,0x1
if (lastdosdate != dd) {
40016704: 0006d603 lhu a2,0(a3)
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
40016708: 01f5f593 andi a1,a1,31
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
4001670c: 00e787b3 add a5,a5,a4
40016710: 00b787b3 add a5,a5,a1
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
40016714: 00179593 slli a1,a5,0x1
if (lastdosdate != dd) {
40016718: 0aa60e63 beq a2,a0,400167d4 <msdos_date_dos2unix+0xf8>
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
4001671c: 00955893 srli a7,a0,0x9
lastdosdate = dd;
40016720: 00a69023 sh a0,0(a3)
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
40016724: 07f8f813 andi a6,a7,127
days = 0;
40016728: 00000713 li a4,0
for (y = 0; y < year; y++)
4001672c: 00000793 li a5,0
days += y & 0x03 ? 365 : 366;
40016730: 16e00693 li a3,366
for (y = 0; y < year; y++)
40016734: 00081663 bnez a6,40016740 <msdos_date_dos2unix+0x64> <== ALWAYS TAKEN
40016738: 01c0006f j 40016754 <msdos_date_dos2unix+0x78> <== NOT EXECUTED
days += y & 0x03 ? 365 : 366;
4001673c: 16d68693 addi a3,a3,365
for (y = 0; y < year; y++)
40016740: 00178793 addi a5,a5,1
days += y & 0x03 ? 365 : 366;
40016744: 0037f613 andi a2,a5,3
40016748: 00d70733 add a4,a4,a3
4001674c: 00163693 seqz a3,a2
for (y = 0; y < year; y++)
40016750: fef816e3 bne a6,a5,4001673c <msdos_date_dos2unix+0x60>
months = year & 0x03 ? regyear : leapyear;
40016754: 0038f893 andi a7,a7,3
40016758: 06089863 bnez a7,400167c8 <msdos_date_dos2unix+0xec>
4001675c: 400287b7 lui a5,0x40028
40016760: a7078793 addi a5,a5,-1424 # 40027a70 <leapyear>
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
40016764: 00555693 srli a3,a0,0x5
40016768: 00f6f613 andi a2,a3,15
if (month == 0) {
4001676c: 00061463 bnez a2,40016774 <msdos_date_dos2unix+0x98> <== ALWAYS TAKEN
40016770: 00100613 li a2,1 <== NOT EXECUTED
month = 1;
}
for (m = 0; m < month - 1; m++)
40016774: 00e6f693 andi a3,a3,14
40016778: 02068063 beqz a3,40016798 <msdos_date_dos2unix+0xbc>
4001677c: 00161613 slli a2,a2,0x1
40016780: ffe60613 addi a2,a2,-2
40016784: 00c78633 add a2,a5,a2
days += months[m];
40016788: 0007d683 lhu a3,0(a5)
for (m = 0; m < month - 1; m++)
4001678c: 00278793 addi a5,a5,2
days += months[m];
40016790: 00d70733 add a4,a4,a3
for (m = 0; m < month - 1; m++)
40016794: fef61ae3 bne a2,a5,40016788 <msdos_date_dos2unix+0xac>
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
40016798: 01f57793 andi a5,a0,31
4001679c: fff78793 addi a5,a5,-1
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
400167a0: 00015537 lui a0,0x15
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
400167a4: 00e78733 add a4,a5,a4
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
400167a8: 18050513 addi a0,a0,384 # 15180 <bsp_section_rodata_size+0x129f4>
400167ac: 02a70733 mul a4,a4,a0
400167b0: 12cea537 lui a0,0x12cea
400167b4: 60050513 addi a0,a0,1536 # 12cea600 <RamSize+0x11cea600>
400167b8: 00a70533 add a0,a4,a0
400167bc: 96a1a023 sw a0,-1696(gp) # 40027f38 <lastseconds>
}
return seconds + lastseconds;
}
400167c0: 00a58533 add a0,a1,a0
400167c4: 00008067 ret
months = year & 0x03 ? regyear : leapyear;
400167c8: 400287b7 lui a5,0x40028
400167cc: a8878793 addi a5,a5,-1400 # 40027a88 <regyear>
400167d0: f95ff06f j 40016764 <msdos_date_dos2unix+0x88>
return seconds + lastseconds;
400167d4: 9601a503 lw a0,-1696(gp) # 40027f38 <lastseconds>
}
400167d8: 00a58533 add a0,a1,a0
400167dc: 00008067 ret
400165a0 <msdos_date_unix2dos>:
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
400165a0: 96418793 addi a5,gp,-1692 # 40027f3c <lasttime>
400165a4: 0007a703 lw a4,0(a5)
400165a8: 10a70263 beq a4,a0,400166ac <msdos_date_unix2dos+0x10c>
lasttime = t;
400165ac: 00a7a023 sw a0,0(a5)
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165b0: 000017b7 lui a5,0x1
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
400165b4: 03c00713 li a4,60
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165b8: e1078793 addi a5,a5,-496 # e10 <bsp_section_data_size+0x718>
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
400165bc: 02e558b3 divu a7,a0,a4
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165c0: 01800313 li t1,24
* If the number of days since 1970 is the same as the last
* time we did the computation then skip all this leap year
* and month stuff.
*/
days = t / (SECONDSPERDAY);
if (days != lastday) {
400165c4: 95418693 addi a3,gp,-1708 # 40027f2c <lastday>
400165c8: 0006a803 lw a6,0(a3)
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165cc: 02f557b3 divu a5,a0,a5
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
400165d0: 02e8f8b3 remu a7,a7,a4
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165d4: 0267f7b3 remu a5,a5,t1
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
400165d8: 00589893 slli a7,a7,0x5
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
400165dc: 02e57733 remu a4,a0,a4
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165e0: 00b79793 slli a5,a5,0xb
400165e4: 00f888b3 add a7,a7,a5
days = t / (SECONDSPERDAY);
400165e8: 000157b7 lui a5,0x15
400165ec: 18078793 addi a5,a5,384 # 15180 <bsp_section_rodata_size+0x129f4>
400165f0: 02f55533 divu a0,a0,a5
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
400165f4: 00175713 srli a4,a4,0x1
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
400165f8: 00e888b3 add a7,a7,a4
400165fc: 01089893 slli a7,a7,0x10
40016600: 0108d893 srli a7,a7,0x10
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
40016604: 95119e23 sh a7,-1700(gp) # 40027f34 <lastdtime>
if (days != lastday) {
40016608: 08a80a63 beq a6,a0,4001669c <msdos_date_unix2dos+0xfc>
lastday = days;
4001660c: 00a6a023 sw a0,0(a3)
for (year = 1970;; year++) {
40016610: 7b200713 li a4,1970
40016614: 00c0006f j 40016620 <msdos_date_unix2dos+0x80>
inc = year & 0x03 ? 365 : 366;
if (days < inc)
break;
days -= inc;
40016618: 40f50533 sub a0,a0,a5
for (year = 1970;; year++) {
4001661c: 00170713 addi a4,a4,1
inc = year & 0x03 ? 365 : 366;
40016620: 00377693 andi a3,a4,3
40016624: 0016b793 seqz a5,a3
40016628: 16d78793 addi a5,a5,365
if (days < inc)
4001662c: fef576e3 bgeu a0,a5,40016618 <msdos_date_unix2dos+0x78>
}
months = year & 0x03 ? regyear : leapyear;
40016630: 08069863 bnez a3,400166c0 <msdos_date_unix2dos+0x120> <== NEVER TAKEN
40016634: 400286b7 lui a3,0x40028
40016638: a7068693 addi a3,a3,-1424 # 40027a70 <leapyear>
for (month = 0; month < 12; month++) {
4001663c: 00000793 li a5,0
40016640: 00c00313 li t1,12
if (days < months[month])
40016644: 0006d803 lhu a6,0(a3)
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
40016648: 00178793 addi a5,a5,1
for (month = 0; month < 12; month++) {
4001664c: 00268693 addi a3,a3,2
if (days < months[month])
40016650: 07056e63 bltu a0,a6,400166cc <msdos_date_unix2dos+0x12c>
days -= months[month];
40016654: 41050533 sub a0,a0,a6 <== NOT EXECUTED
for (month = 0; month < 12; month++) {
40016658: fe6796e3 bne a5,t1,40016644 <msdos_date_unix2dos+0xa4> <== NOT EXECUTED
4001665c: 1a000793 li a5,416 <== NOT EXECUTED
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
40016660: 00178793 addi a5,a5,1
40016664: 00a78533 add a0,a5,a0
40016668: 01051513 slli a0,a0,0x10
* Remember dos's idea of time is relative to 1980.
* unix's is relative to 1970. If somehow we get a
* time before 1980 then don't give totally crazy
* results.
*/
if (year > 1980)
4001666c: 7bc00793 li a5,1980
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
40016670: 01055513 srli a0,a0,0x10
if (year > 1980)
40016674: 00e7fc63 bgeu a5,a4,4001668c <msdos_date_unix2dos+0xec>
lastddate += (year - 1980) <<
40016678: 84470713 addi a4,a4,-1980
4001667c: 00971713 slli a4,a4,0x9
40016680: 00e50533 add a0,a0,a4
40016684: 01051513 slli a0,a0,0x10
40016688: 01055513 srli a0,a0,0x10
MSDOS_DD_YEAR_SHIFT;
}
}
*dtp = lastdtime;
4001668c: 01161023 sh a7,0(a2)
lastddate += (year - 1980) <<
40016690: 94a19c23 sh a0,-1704(gp) # 40027f30 <lastddate>
*ddp = lastddate;
40016694: 00a59023 sh a0,0(a1)
}
40016698: 00008067 ret
*ddp = lastddate;
4001669c: 9581d503 lhu a0,-1704(gp) # 40027f30 <lastddate>
*dtp = lastdtime;
400166a0: 01161023 sh a7,0(a2)
*ddp = lastddate;
400166a4: 00a59023 sh a0,0(a1)
}
400166a8: 00008067 ret
*dtp = lastdtime;
400166ac: 95c1d883 lhu a7,-1700(gp) # 40027f34 <lastdtime>
*ddp = lastddate;
400166b0: 9581d503 lhu a0,-1704(gp) # 40027f30 <lastddate>
*dtp = lastdtime;
400166b4: 01161023 sh a7,0(a2)
*ddp = lastddate;
400166b8: 00a59023 sh a0,0(a1)
}
400166bc: 00008067 ret
months = year & 0x03 ? regyear : leapyear;
400166c0: 400286b7 lui a3,0x40028 <== NOT EXECUTED
400166c4: a8868693 addi a3,a3,-1400 # 40027a88 <regyear> <== NOT EXECUTED
400166c8: f75ff06f j 4001663c <msdos_date_unix2dos+0x9c> <== NOT EXECUTED
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
400166cc: 00579793 slli a5,a5,0x5
400166d0: 01079793 slli a5,a5,0x10
400166d4: 0107d793 srli a5,a5,0x10
400166d8: f89ff06f j 40016660 <msdos_date_unix2dos+0xc0>
4001075c <msdos_dir_is_empty>:
{
4001075c: fb010113 addi sp,sp,-80
40010760: 04912223 sw s1,68(sp)
msdos_fs_info_t *fs_info = mt_entry->fs_info;
40010764: 00852483 lw s1,8(a0)
{
40010768: 05212023 sw s2,64(sp)
4001076c: 03412c23 sw s4,56(sp)
40010770: 03512a23 sw s5,52(sp)
40010774: 03612823 sw s6,48(sp)
40010778: 03712623 sw s7,44(sp)
4001077c: 03812423 sw s8,40(sp)
40010780: 03912223 sw s9,36(sp)
40010784: 01b12e23 sw s11,28(sp)
40010788: 04112623 sw ra,76(sp)
4001078c: 04812423 sw s0,72(sp)
40010790: 03312e23 sw s3,60(sp)
40010794: 03a12023 sw s10,32(sp)
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
40010798: 0004dd83 lhu s11,0(s1)
4001079c: 0c84a903 lw s2,200(s1)
{
400107a0: 00c12623 sw a2,12(sp)
400107a4: 00058a93 mv s5,a1
*ret_val = false;
400107a8: 00060023 sb zero,0(a2)
uint32_t j = 0, i = 0;
400107ac: 00000c13 li s8,0
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
400107b0: 0e500a13 li s4,229
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
400107b4: 00f00b13 li s6,15
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
400107b8: 40026bb7 lui s7,0x40026
(strncmp(MSDOS_DIR_NAME((entry)),
400107bc: 40026cb7 lui s9,0x40026
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
400107c0: 038d8633 mul a2,s11,s8
400107c4: 00090713 mv a4,s2
400107c8: 000d8693 mv a3,s11
400107cc: 000a8593 mv a1,s5
400107d0: 00048513 mv a0,s1
400107d4: b88fe0ef jal ra,4000eb5c <fat_file_read>
400107d8: 0a050c63 beqz a0,40010890 <msdos_dir_is_empty+0x134> <== NEVER TAKEN
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
400107dc: 01f00793 li a5,31
400107e0: 0ca7d263 bge a5,a0,400108a4 <msdos_dir_is_empty+0x148>
assert(ret == fs_info->fat.vol.bps);
400107e4: 0004dd83 lhu s11,0(s1)
400107e8: 0cad9263 bne s11,a0,400108ac <msdos_dir_is_empty+0x150>
char* entry = (char*) fs_info->cl_buf + i;
400107ec: 0c84a903 lw s2,200(s1)
for (i = 0;
400107f0: 00000993 li s3,0
400107f4: 00090413 mv s0,s2
400107f8: 080d8863 beqz s11,40010888 <msdos_dir_is_empty+0x12c> <== NEVER TAKEN
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
400107fc: 00044d03 lbu s10,0(s0)
40010800: 074d0e63 beq s10,s4,4001087c <msdos_dir_is_empty+0x120>
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
40010804: 00b44783 lbu a5,11(s0)
40010808: 03f7f793 andi a5,a5,63
4001080c: 07678863 beq a5,s6,4001087c <msdos_dir_is_empty+0x120>
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
40010810: 00b00613 li a2,11
40010814: ea8b8593 addi a1,s7,-344 # 40025ea8 <msdos_file_handlers+0xa8>
40010818: 00040513 mv a0,s0
4001081c: 3800c0ef jal ra,4001cb9c <strncmp>
MSDOS_ATTR_LFN) ||
40010820: 04050e63 beqz a0,4001087c <msdos_dir_is_empty+0x120>
(strncmp(MSDOS_DIR_NAME((entry)),
40010824: 00b00613 li a2,11
40010828: eb4c8593 addi a1,s9,-332 # 40025eb4 <msdos_file_handlers+0xb4>
4001082c: 00040513 mv a0,s0
40010830: 36c0c0ef jal ra,4001cb9c <strncmp>
MSDOS_SHORT_NAME_LEN) == 0) ||
40010834: 04050463 beqz a0,4001087c <msdos_dir_is_empty+0x120>
return RC_OK;
40010838: 00000513 li a0,0
if ((*MSDOS_DIR_NAME(entry)) ==
4001083c: 040d0a63 beqz s10,40010890 <msdos_dir_is_empty+0x134>
}
40010840: 04c12083 lw ra,76(sp)
40010844: 04812403 lw s0,72(sp)
40010848: 04412483 lw s1,68(sp)
4001084c: 04012903 lw s2,64(sp)
40010850: 03c12983 lw s3,60(sp)
40010854: 03812a03 lw s4,56(sp)
40010858: 03412a83 lw s5,52(sp)
4001085c: 03012b03 lw s6,48(sp)
40010860: 02c12b83 lw s7,44(sp)
40010864: 02812c03 lw s8,40(sp)
40010868: 02412c83 lw s9,36(sp)
4001086c: 02012d03 lw s10,32(sp)
40010870: 01c12d83 lw s11,28(sp)
40010874: 05010113 addi sp,sp,80
40010878: 00008067 ret
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
4001087c: 02098993 addi s3,s3,32
for (i = 0;
40010880: 02040413 addi s0,s0,32
40010884: f7b9ece3 bltu s3,s11,400107fc <msdos_dir_is_empty+0xa0>
j++;
40010888: 001c0c13 addi s8,s8,1
4001088c: f35ff06f j 400107c0 <msdos_dir_is_empty+0x64>
*ret_val = true;
40010890: 00c12703 lw a4,12(sp)
40010894: 00100793 li a5,1
return RC_OK;
40010898: 00000513 li a0,0
*ret_val = true;
4001089c: 00f70023 sb a5,0(a4)
return RC_OK;
400108a0: fa1ff06f j 40010840 <msdos_dir_is_empty+0xe4>
return -1;
400108a4: fff00513 li a0,-1 <== NOT EXECUTED
400108a8: f99ff06f j 40010840 <msdos_dir_is_empty+0xe4> <== NOT EXECUTED
assert(ret == fs_info->fat.vol.bps);
400108ac: 400266b7 lui a3,0x40026 <== NOT EXECUTED
400108b0: 40026637 lui a2,0x40026 <== NOT EXECUTED
400108b4: 40026537 lui a0,0x40026 <== NOT EXECUTED
400108b8: e5c68693 addi a3,a3,-420 # 40025e5c <msdos_file_handlers+0x5c> <== NOT EXECUTED
400108bc: f7860613 addi a2,a2,-136 # 40025f78 <__func__.4> <== NOT EXECUTED
400108c0: 3c600593 li a1,966 <== NOT EXECUTED
400108c4: e7850513 addi a0,a0,-392 # 40025e78 <msdos_file_handlers+0x78> <== NOT EXECUTED
400108c8: 0c5050ef jal ra,4001618c <__assert_func> <== NOT EXECUTED
40016e6c <msdos_dir_read>:
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
int rc = RC_OK;
int eno = 0;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
40016e6c: 02452783 lw a5,36(a0)
{
40016e70: e5010113 addi sp,sp,-432
40016e74: 17b12e23 sw s11,380(sp)
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
40016e78: 0087ad83 lw s11,8(a5)
{
40016e7c: 19312e23 sw s3,412(sp)
40016e80: 19712623 sw s7,396(sp)
rtems_dosfs_convert_control *converter = fs_info->converter;
40016e84: 0ccda783 lw a5,204(s11)
40016e88: 0b0d8713 addi a4,s11,176
{
40016e8c: 00050993 mv s3,a0
const rtems_dosfs_convert_handler *convert_handler = converter->handler;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
fat_file_fd_t *tmp_fat_fd = NULL;
struct dirent tmp_dirent;
size_t lfn_len = 0;
uint16_t *lfn_buf = converter->buffer.data;
40016e90: 0047ab83 lw s7,4(a5)
{
40016e94: 19812423 sw s8,392(sp)
rtems_dosfs_convert_control *converter = fs_info->converter;
40016e98: 00f12623 sw a5,12(sp)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
40016e9c: 01852c03 lw s8,24(a0)
40016ea0: 02e12423 sw a4,40(sp)
_Mutex_recursive_Acquire( mutex );
40016ea4: 00070513 mv a0,a4
const rtems_dosfs_convert_handler *convert_handler = converter->handler;
40016ea8: 0007a703 lw a4,0(a5)
char *sfn_buf = converter->buffer.data;
const size_t buf_size = converter->buffer.size;
40016eac: 0087a783 lw a5,8(a5)
{
40016eb0: 1a812423 sw s0,424(sp)
40016eb4: 19412c23 sw s4,408(sp)
40016eb8: 00060413 mv s0,a2
* cast start and count - protect against using sizes that are not exact
* multiples of the -dirent- size. These could result in unexpected
* results
*/
start = iop->offset / sizeof(struct dirent);
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
40016ebc: 11800a13 li s4,280
const rtems_dosfs_convert_handler *convert_handler = converter->handler;
40016ec0: 00e12823 sw a4,16(sp)
const size_t buf_size = converter->buffer.size;
40016ec4: 02f12623 sw a5,44(sp)
{
40016ec8: 1a112623 sw ra,428(sp)
40016ecc: 19512a23 sw s5,404(sp)
40016ed0: 00b12a23 sw a1,20(sp)
40016ed4: 1a912223 sw s1,420(sp)
40016ed8: 1b212023 sw s2,416(sp)
40016edc: 19612823 sw s6,400(sp)
40016ee0: 19912223 sw s9,388(sp)
40016ee4: 19a12023 sw s10,384(sp)
fat_file_fd_t *tmp_fat_fd = NULL;
40016ee8: 02012e23 sw zero,60(sp)
uint32_t cur_cln = 0;
40016eec: 04012023 sw zero,64(sp)
40016ef0: 895f10ef jal ra,40008784 <_Mutex_recursive_Acquire>
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
40016ef4: 03445433 divu s0,s0,s4
start = iop->offset / sizeof(struct dirent);
40016ef8: 0089a503 lw a0,8(s3)
40016efc: 00c9a583 lw a1,12(s3)
40016f00: 11800613 li a2,280
40016f04: 00000693 li a3,0
40016f08: 13d020ef jal ra,40019844 <__divdi3>
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
40016f0c: 020c2703 lw a4,32(s8)
40016f10: 00100793 li a5,1
start = iop->offset / sizeof(struct dirent);
40016f14: 00050a93 mv s5,a0
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
40016f18: 03440a33 mul s4,s0,s4
fat_fd->fat_file_size :
40016f1c: 0ef71063 bne a4,a5,40016ffc <msdos_dir_read+0x190>
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
40016f20: 024c2783 lw a5,36(s8)
40016f24: 0c079c63 bnez a5,40016ffc <msdos_dir_read+0x190> <== NEVER TAKEN
40016f28: 016dc783 lbu a5,22(s11)
40016f2c: 0037f793 andi a5,a5,3
40016f30: 0c078663 beqz a5,40016ffc <msdos_dir_read+0x190> <== NEVER TAKEN
fat_fd->fat_file_size :
40016f34: 018c2783 lw a5,24(s8)
40016f38: 02f12223 sw a5,36(sp)
fs_info->fat.vol.bpc;
while (count > 0 && cmpltd >= 0)
40016f3c: 3a0a0663 beqz s4,400172e8 <msdos_dir_read+0x47c> <== NEVER TAKEN
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
sfn_buf, entry); /* src text */
eno = (*convert_handler->codepage_to_utf8) (
40016f40: 000107b7 lui a5,0x10
40016f44: fff78793 addi a5,a5,-1 # ffff <bsp_section_rodata_size+0xd873>
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
40016f48: 00000c93 li s9,0
int lfn_entries = 0;
40016f4c: 00012423 sw zero,8(sp)
uint8_t lfn_checksum = 0;
40016f50: 00012e23 sw zero,28(sp)
uint32_t lfn_start = FAT_FILE_SHORT_NAME;
40016f54: fff00913 li s2,-1
ssize_t cmpltd = 0;
40016f58: 00000413 li s0,0
size_t lfn_len = 0;
40016f5c: 02012023 sw zero,32(sp)
eno = (*convert_handler->codepage_to_utf8) (
40016f60: 00f12c23 sw a5,24(sp)
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
40016f64: 0c8da703 lw a4,200(s11)
40016f68: 02412683 lw a3,36(sp)
40016f6c: 000c8613 mv a2,s9
40016f70: 000c0593 mv a1,s8
40016f74: 000d8513 mv a0,s11
40016f78: be5f70ef jal ra,4000eb5c <fat_file_read>
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40016f7c: 01f00793 li a5,31
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
40016f80: 00050493 mv s1,a0
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40016f84: 34a7d463 bge a5,a0,400172cc <msdos_dir_read+0x460>
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40016f88: 00000d13 li s10,0
char* entry = (char*) fs_info->cl_buf + i;
40016f8c: 0c8da783 lw a5,200(s11)
40016f90: 01a78b33 add s6,a5,s10
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
40016f94: 000b4803 lbu a6,0(s6)
40016f98: 26080463 beqz a6,40017200 <msdos_dir_read+0x394>
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) == MSDOS_THIS_DIR_ENTRY_EMPTY)
40016f9c: 0e500713 li a4,229
40016fa0: 04e80263 beq a6,a4,40016fe4 <msdos_dir_read+0x178>
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
40016fa4: 00bb4703 lbu a4,11(s6)
40016fa8: 00877613 andi a2,a4,8
40016fac: 03f77693 andi a3,a4,63
40016fb0: 08060e63 beqz a2,4001704c <msdos_dir_read+0x1e0>
40016fb4: 00f00713 li a4,15
40016fb8: 02e69663 bne a3,a4,40016fe4 <msdos_dir_read+0x178>
if (lfn_start == FAT_FILE_SHORT_NAME)
40016fbc: fff00713 li a4,-1
is_first_entry = false;
40016fc0: 00000693 li a3,0
if (lfn_start == FAT_FILE_SHORT_NAME)
40016fc4: 1ee90863 beq s2,a4,400171b4 <msdos_dir_read+0x348>
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
40016fc8: 00812783 lw a5,8(sp)
40016fcc: 03f87813 andi a6,a6,63
40016fd0: 00f81863 bne a6,a5,40016fe0 <msdos_dir_read+0x174>
MSDOS_LAST_LONG_ENTRY_MASK)) ||
40016fd4: 00db4703 lbu a4,13(s6)
40016fd8: 01c12783 lw a5,28(sp)
40016fdc: 02f70663 beq a4,a5,40017008 <msdos_dir_read+0x19c>
lfn_start = FAT_FILE_SHORT_NAME;
40016fe0: fff00913 li s2,-1
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40016fe4: 020d0d13 addi s10,s10,32
40016fe8: fa9d62e3 bltu s10,s1,40016f8c <msdos_dir_read+0x120>
while (count > 0 && cmpltd >= 0)
40016fec: 02412783 lw a5,36(sp)
40016ff0: 00fc8cb3 add s9,s9,a5
40016ff4: f60458e3 bgez s0,40016f64 <msdos_dir_read+0xf8> <== ALWAYS TAKEN
40016ff8: 2080006f j 40017200 <msdos_dir_read+0x394> <== NOT EXECUTED
fat_fd->fat_file_size :
40016ffc: 008da783 lw a5,8(s11)
40017000: 02f12223 sw a5,36(sp)
40017004: f39ff06f j 40016f3c <msdos_dir_read+0xd0>
lfn_entries--;
40017008: 00812783 lw a5,8(sp)
lfn_len += msdos_get_utf16_string_from_long_entry (
4001700c: 000b0513 mv a0,s6
lfn_entries--;
40017010: fff78793 addi a5,a5,-1
offset_lfn = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
40017014: 00179613 slli a2,a5,0x1
40017018: 00f60633 add a2,a2,a5
4001701c: 00261613 slli a2,a2,0x2
40017020: 00f60633 add a2,a2,a5
lfn_entries--;
40017024: 00f12423 sw a5,8(sp)
lfn_len += msdos_get_utf16_string_from_long_entry (
40017028: 02c12783 lw a5,44(sp)
&lfn_buf[offset_lfn],
4001702c: 00161593 slli a1,a2,0x1
lfn_len += msdos_get_utf16_string_from_long_entry (
40017030: 00bb85b3 add a1,s7,a1
40017034: 40c78633 sub a2,a5,a2
40017038: 895f90ef jal ra,400108cc <msdos_get_utf16_string_from_long_entry>
4001703c: 02012783 lw a5,32(sp)
40017040: 00a787b3 add a5,a5,a0
40017044: 02f12023 sw a5,32(sp)
return rc;
}
}
}
if (count <= 0)
40017048: f9dff06f j 40016fe4 <msdos_dir_read+0x178>
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
4001704c: 00f00613 li a2,15
40017050: f6c686e3 beq a3,a2,40016fbc <msdos_dir_read+0x150>
if (start)
40017054: 140a9a63 bnez s5,400171a8 <msdos_dir_read+0x33c>
tmp_dirent.d_type = DT_REG;
40017058: 01b71813 slli a6,a4,0x1b
4001705c: 41f85813 srai a6,a6,0x1f
40017060: ffc87813 andi a6,a6,-4
40017064: 00880813 addi a6,a6,8
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
40017068: 04010713 addi a4,sp,64
4001706c: 000c8693 mv a3,s9
40017070: 00100613 li a2,1
40017074: 000c0593 mv a1,s8
40017078: 000d8513 mv a0,s11
4001707c: 07010523 sb a6,106(sp)
40017080: eb5f70ef jal ra,4000ef34 <fat_file_ioctl>
40017084: 00050713 mv a4,a0
if (rc != RC_OK)
40017088: 20051a63 bnez a0,4001729c <msdos_dir_read+0x430> <== NEVER TAKEN
dir_pos.sname.cln = cur_cln;
4001708c: 04012703 lw a4,64(sp)
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40017090: fff00693 li a3,-1
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
40017094: 03c10613 addi a2,sp,60
40017098: 04810593 addi a1,sp,72
4001709c: 000d8513 mv a0,s11
400170a0: 04d12823 sw a3,80(sp)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
400170a4: 04d12a23 sw a3,84(sp)
dir_pos.sname.cln = cur_cln;
400170a8: 04e12423 sw a4,72(sp)
dir_pos.sname.ofs = i;
400170ac: 05a12623 sw s10,76(sp)
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
400170b0: f08f70ef jal ra,4000e7b8 <fat_file_open>
400170b4: 00050713 mv a4,a0
if (rc != RC_OK)
400170b8: fff00693 li a3,-1
400170bc: 1e051063 bnez a0,4001729c <msdos_dir_read+0x430> <== NEVER TAKEN
tmp_dirent.d_ino = tmp_fat_fd->ino;
400170c0: 03c12603 lw a2,60(sp)
tmp_dirent.d_off = start + cmpltd;
400170c4: 41f45713 srai a4,s0,0x1f
tmp_dirent.d_ino = tmp_fat_fd->ino;
400170c8: 04012e23 sw zero,92(sp)
400170cc: 00c62603 lw a2,12(a2)
tmp_dirent.d_off = start + cmpltd;
400170d0: 06e12223 sw a4,100(sp)
tmp_dirent.d_reclen = sizeof(struct dirent);
400170d4: 11800713 li a4,280
tmp_dirent.d_off = start + cmpltd;
400170d8: 06812023 sw s0,96(sp)
tmp_dirent.d_reclen = sizeof(struct dirent);
400170dc: 06e11423 sh a4,104(sp)
tmp_dirent.d_ino = tmp_fat_fd->ino;
400170e0: 04c12c23 sw a2,88(sp)
if (lfn_start != FAT_FILE_SHORT_NAME)
400170e4: 00d90663 beq s2,a3,400170f0 <msdos_dir_read+0x284>
if (lfn_entries == 0 &&
400170e8: 00812783 lw a5,8(sp)
400170ec: 14078e63 beqz a5,40017248 <msdos_dir_read+0x3dc> <== ALWAYS TAKEN
size_t len = sizeof(tmp_dirent.d_name) - 1;
400170f0: 0ff00793 li a5,255
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
400170f4: 000b0593 mv a1,s6
400170f8: 000b8513 mv a0,s7
size_t len = sizeof(tmp_dirent.d_name) - 1;
400170fc: 04f12223 sw a5,68(sp)
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
40017100: fe4f90ef jal ra,400108e4 <msdos_format_dirent_with_dot>
eno = (*convert_handler->codepage_to_utf8) (
40017104: 01012783 lw a5,16(sp)
40017108: 01812603 lw a2,24(sp)
4001710c: 04410713 addi a4,sp,68
40017110: 0047a783 lw a5,4(a5)
40017114: 00c57633 and a2,a0,a2
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
40017118: 06a11623 sh a0,108(sp)
eno = (*convert_handler->codepage_to_utf8) (
4001711c: 00c12503 lw a0,12(sp)
40017120: 06e10693 addi a3,sp,110
40017124: 000b8593 mv a1,s7
40017128: 000780e7 jalr a5
4001712c: 00050913 mv s2,a0
if ( 0 == eno ) {
40017130: 0c051263 bnez a0,400171f4 <msdos_dir_read+0x388> <== NEVER TAKEN
tmp_dirent.d_namlen = len;
40017134: 04412783 lw a5,68(sp)
tmp_dirent.d_name[len] = '\0';
40017138: 17010713 addi a4,sp,368
4001713c: fff00913 li s2,-1
40017140: 00f70733 add a4,a4,a5
tmp_dirent.d_namlen = len;
40017144: 06f11623 sh a5,108(sp)
tmp_dirent.d_name[len] = '\0';
40017148: ee070f23 sb zero,-258(a4)
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
4001714c: 01412783 lw a5,20(sp)
40017150: 11800613 li a2,280
40017154: 05810593 addi a1,sp,88
40017158: 00878533 add a0,a5,s0
4001715c: 6ec040ef jal ra,4001b848 <memcpy>
iop->offset = iop->offset + sizeof(struct dirent);
40017160: 0089a783 lw a5,8(s3)
40017164: 00c9a683 lw a3,12(s3)
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
40017168: 03c12583 lw a1,60(sp)
iop->offset = iop->offset + sizeof(struct dirent);
4001716c: 11878713 addi a4,a5,280
40017170: 00f737b3 sltu a5,a4,a5
40017174: 00d787b3 add a5,a5,a3
40017178: 00e9a423 sw a4,8(s3)
4001717c: 00f9a623 sw a5,12(s3)
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
40017180: 000d8513 mv a0,s11
40017184: cd9f70ef jal ra,4000ee5c <fat_file_close>
cmpltd += (sizeof(struct dirent));
40017188: 11840413 addi s0,s0,280
count -= (sizeof(struct dirent));
4001718c: ee8a0a13 addi s4,s4,-280
if (rc != RC_OK)
40017190: 12051263 bnez a0,400172b4 <msdos_dir_read+0x448> <== NEVER TAKEN
if (count <= 0)
40017194: 060a0663 beqz s4,40017200 <msdos_dir_read+0x394> <== ALWAYS TAKEN
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40017198: 020d0d13 addi s10,s10,32 <== NOT EXECUTED
4001719c: e49d78e3 bgeu s10,s1,40016fec <msdos_dir_read+0x180> <== NOT EXECUTED
400171a0: de0456e3 bgez s0,40016f8c <msdos_dir_read+0x120> <== NOT EXECUTED
400171a4: 05c0006f j 40017200 <msdos_dir_read+0x394> <== NOT EXECUTED
start--;
400171a8: fffa8a93 addi s5,s5,-1
lfn_start = FAT_FILE_SHORT_NAME;
400171ac: fff00913 li s2,-1
400171b0: e35ff06f j 40016fe4 <msdos_dir_read+0x178>
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
400171b4: 04087713 andi a4,a6,64
400171b8: e20706e3 beqz a4,40016fe4 <msdos_dir_read+0x178>
lfn_entries = (*MSDOS_DIR_ENTRY_TYPE(entry) &
400171bc: 03f87793 andi a5,a6,63
400171c0: 00f12423 sw a5,8(sp)
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
400171c4: 00db4783 lbu a5,13(s6)
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
400171c8: 10000613 li a2,256
400171cc: 00000593 li a1,0
400171d0: 06e10513 addi a0,sp,110
lfn_start =
400171d4: 01ac8933 add s2,s9,s10
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
400171d8: 00f12e23 sw a5,28(sp)
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
400171dc: 794040ef jal ra,4001b970 <memset>
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
400171e0: 000b4803 lbu a6,0(s6)
lfn_start =
400171e4: 00595913 srli s2,s2,0x5
is_first_entry = true;
400171e8: 00100693 li a3,1
lfn_len = 0;
400171ec: 02012023 sw zero,32(sp)
400171f0: dd9ff06f j 40016fc8 <msdos_dir_read+0x15c>
errno = eno;
400171f4: 565030ef jal ra,4001af58 <__errno> <== NOT EXECUTED
400171f8: 01252023 sw s2,0(a0) <== NOT EXECUTED
cmpltd = -1;
400171fc: fff00413 li s0,-1 <== NOT EXECUTED
_Mutex_recursive_Release( mutex );
40017200: 02812503 lw a0,40(sp)
40017204: e08f10ef jal ra,4000880c <_Mutex_recursive_Release>
j++;
}
msdos_fs_unlock(fs_info);
return cmpltd;
}
40017208: 1ac12083 lw ra,428(sp)
4001720c: 00040513 mv a0,s0
40017210: 1a812403 lw s0,424(sp)
40017214: 1a412483 lw s1,420(sp)
40017218: 1a012903 lw s2,416(sp)
4001721c: 19c12983 lw s3,412(sp)
40017220: 19812a03 lw s4,408(sp)
40017224: 19412a83 lw s5,404(sp)
40017228: 19012b03 lw s6,400(sp)
4001722c: 18c12b83 lw s7,396(sp)
40017230: 18812c03 lw s8,392(sp)
40017234: 18412c83 lw s9,388(sp)
40017238: 18012d03 lw s10,384(sp)
4001723c: 17c12d83 lw s11,380(sp)
40017240: 1b010113 addi sp,sp,432
40017244: 00008067 ret
lfn_checksum == msdos_lfn_checksum(entry)) {
40017248: 000b0513 mv a0,s6
4001724c: e19f80ef jal ra,40010064 <msdos_lfn_checksum>
if (lfn_entries == 0 &&
40017250: 01c12783 lw a5,28(sp)
40017254: e8f51ee3 bne a0,a5,400170f0 <msdos_dir_read+0x284>
eno = (*convert_handler->utf16_to_utf8) (
40017258: 01012783 lw a5,16(sp)
4001725c: 02012603 lw a2,32(sp)
40017260: 00c12503 lw a0,12(sp)
40017264: 00c7a803 lw a6,12(a5)
size_t len = sizeof(tmp_dirent.d_name) - 1;
40017268: 0ff00713 li a4,255
4001726c: 04e12223 sw a4,68(sp)
eno = (*convert_handler->utf16_to_utf8) (
40017270: 06e10693 addi a3,sp,110
40017274: 04410713 addi a4,sp,68
40017278: 000b8593 mv a1,s7
4001727c: 000800e7 jalr a6
if (eno == 0) {
40017280: e60518e3 bnez a0,400170f0 <msdos_dir_read+0x284>
tmp_dirent.d_namlen = len;
40017284: 04412783 lw a5,68(sp)
tmp_dirent.d_name[len] = '\0';
40017288: 17010713 addi a4,sp,368
4001728c: 00f70733 add a4,a4,a5
tmp_dirent.d_namlen = len;
40017290: 06f11623 sh a5,108(sp)
tmp_dirent.d_name[len] = '\0';
40017294: ee070f23 sb zero,-258(a4)
if (lfn_start == FAT_FILE_SHORT_NAME) {
40017298: eb5ff06f j 4001714c <msdos_dir_read+0x2e0>
4001729c: 02812503 lw a0,40(sp) <== NOT EXECUTED
400172a0: 00e12423 sw a4,8(sp) <== NOT EXECUTED
400172a4: d68f10ef jal ra,4000880c <_Mutex_recursive_Release> <== NOT EXECUTED
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
400172a8: 00812703 lw a4,8(sp) <== NOT EXECUTED
400172ac: 00070413 mv s0,a4 <== NOT EXECUTED
return rc;
400172b0: f59ff06f j 40017208 <msdos_dir_read+0x39c> <== NOT EXECUTED
400172b4: 00a12423 sw a0,8(sp) <== NOT EXECUTED
400172b8: 02812503 lw a0,40(sp) <== NOT EXECUTED
400172bc: d50f10ef jal ra,4000880c <_Mutex_recursive_Release> <== NOT EXECUTED
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
400172c0: 00812783 lw a5,8(sp) <== NOT EXECUTED
400172c4: 00078413 mv s0,a5 <== NOT EXECUTED
return rc;
400172c8: f41ff06f j 40017208 <msdos_dir_read+0x39c> <== NOT EXECUTED
400172cc: 02812503 lw a0,40(sp) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
400172d0: fff00413 li s0,-1 <== NOT EXECUTED
400172d4: d38f10ef jal ra,4000880c <_Mutex_recursive_Release> <== NOT EXECUTED
400172d8: 481030ef jal ra,4001af58 <__errno> <== NOT EXECUTED
400172dc: 00500793 li a5,5 <== NOT EXECUTED
400172e0: 00f52023 sw a5,0(a0) <== NOT EXECUTED
400172e4: f25ff06f j 40017208 <msdos_dir_read+0x39c> <== NOT EXECUTED
ssize_t cmpltd = 0;
400172e8: 00000413 li s0,0 <== NOT EXECUTED
400172ec: f15ff06f j 40017200 <msdos_dir_read+0x394> <== NOT EXECUTED
400176a8 <msdos_file_ftruncate>:
*/
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
int rc = RC_OK;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
400176a8: 02452783 lw a5,36(a0)
{
400176ac: fd010113 addi sp,sp,-48
400176b0: 01412c23 sw s4,24(sp)
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
400176b4: 0087aa03 lw s4,8(a5)
{
400176b8: 02812423 sw s0,40(sp)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
400176bc: 01852403 lw s0,24(a0)
{
400176c0: 01512a23 sw s5,20(sp)
400176c4: 0b0a0a93 addi s5,s4,176
400176c8: 01312e23 sw s3,28(sp)
_Mutex_recursive_Acquire( mutex );
400176cc: 000a8513 mv a0,s5
400176d0: 00060993 mv s3,a2
400176d4: 03212023 sw s2,32(sp)
400176d8: 01612823 sw s6,16(sp)
400176dc: 02112623 sw ra,44(sp)
400176e0: 02912223 sw s1,36(sp)
400176e4: 00058913 mv s2,a1
400176e8: 89cf10ef jal ra,40008784 <_Mutex_recursive_Acquire>
uint32_t old_length;
msdos_fs_lock(fs_info);
old_length = fat_fd->fat_file_size;
400176ec: 01842b03 lw s6,24(s0)
if (length < old_length) {
400176f0: 0a09c063 bltz s3,40017790 <msdos_file_ftruncate+0xe8> <== NEVER TAKEN
400176f4: 08098c63 beqz s3,4001778c <msdos_file_ftruncate+0xe4> <== ALWAYS TAKEN
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
} else {
uint32_t new_length;
rc = fat_file_extend(&fs_info->fat,
400176f8: 00c10713 addi a4,sp,12
400176fc: 00090693 mv a3,s2
40017700: 00100613 li a2,1
40017704: 00040593 mv a1,s0
40017708: 000a0513 mv a0,s4
4001770c: 8fdf70ef jal ra,4000f008 <fat_file_extend>
40017710: 00050493 mv s1,a0
fat_fd,
true,
length,
&new_length);
if (rc == RC_OK && length != new_length) {
40017714: 04051263 bnez a0,40017758 <msdos_file_ftruncate+0xb0> <== NEVER TAKEN
40017718: 00c12783 lw a5,12(sp)
4001771c: 09279863 bne a5,s2,400177ac <msdos_file_ftruncate+0x104>
40017720: 08099663 bnez s3,400177ac <msdos_file_ftruncate+0x104> <== NEVER TAKEN
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017724: 03044783 lbu a5,48(s0)
fat_fd->fat_file_size = s;
40017728: 01242c23 sw s2,24(s0)
}
if (rc == RC_OK)
{
fat_file_set_file_size(fat_fd, length);
fat_file_set_ctime_mtime(fat_fd, time(NULL));
4001772c: 00000513 li a0,0
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017730: 0027e793 ori a5,a5,2
40017734: 02f40823 sb a5,48(s0)
40017738: 049070ef jal ra,4001ef80 <time>
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4001773c: 03044783 lbu a5,48(s0)
fat_fd->ctime = t;
40017740: 04a42023 sw a0,64(s0)
40017744: 04b42223 sw a1,68(s0)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017748: 0027e793 ori a5,a5,2
fat_fd->mtime = t;
4001774c: 04a42423 sw a0,72(s0)
40017750: 04b42623 sw a1,76(s0)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017754: 02f40823 sb a5,48(s0)
_Mutex_recursive_Release( mutex );
40017758: 000a8513 mv a0,s5
4001775c: 8b0f10ef jal ra,4000880c <_Mutex_recursive_Release>
}
msdos_fs_unlock(fs_info);
return rc;
}
40017760: 02c12083 lw ra,44(sp)
40017764: 02812403 lw s0,40(sp)
40017768: 02012903 lw s2,32(sp)
4001776c: 01c12983 lw s3,28(sp)
40017770: 01812a03 lw s4,24(sp)
40017774: 01412a83 lw s5,20(sp)
40017778: 01012b03 lw s6,16(sp)
4001777c: 00048513 mv a0,s1
40017780: 02412483 lw s1,36(sp)
40017784: 03010113 addi sp,sp,48
40017788: 00008067 ret
if (length < old_length) {
4001778c: f76976e3 bgeu s2,s6,400176f8 <msdos_file_ftruncate+0x50>
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
40017790: 00090613 mv a2,s2
40017794: 00040593 mv a1,s0
40017798: 000a0513 mv a0,s4
4001779c: dc8f70ef jal ra,4000ed64 <fat_file_truncate>
400177a0: 00050493 mv s1,a0
if (rc == RC_OK)
400177a4: fa051ae3 bnez a0,40017758 <msdos_file_ftruncate+0xb0> <== NEVER TAKEN
400177a8: f7dff06f j 40017724 <msdos_file_ftruncate+0x7c>
fat_file_truncate(&fs_info->fat, fat_fd, old_length);
400177ac: 000b0613 mv a2,s6 <== NOT EXECUTED
400177b0: 00040593 mv a1,s0 <== NOT EXECUTED
400177b4: 000a0513 mv a0,s4 <== NOT EXECUTED
400177b8: dacf70ef jal ra,4000ed64 <fat_file_truncate> <== NOT EXECUTED
errno = ENOSPC;
400177bc: 79c030ef jal ra,4001af58 <__errno> <== NOT EXECUTED
400177c0: 01c00793 li a5,28 <== NOT EXECUTED
400177c4: 00f52023 sw a5,0(a0) <== NOT EXECUTED
rc = -1;
400177c8: fff00493 li s1,-1 <== NOT EXECUTED
400177cc: f8dff06f j 40017758 <msdos_file_ftruncate+0xb0> <== NOT EXECUTED
400177d0 <msdos_file_sync>:
*/
int
msdos_file_sync(rtems_libio_t *iop)
{
int rc = RC_OK;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
400177d0: 02452783 lw a5,36(a0)
{
400177d4: ff010113 addi sp,sp,-16
400177d8: 00912223 sw s1,4(sp)
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
400177dc: 0087a483 lw s1,8(a5)
{
400177e0: 00812423 sw s0,8(sp)
400177e4: 01212023 sw s2,0(sp)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
400177e8: 01852403 lw s0,24(a0)
400177ec: 0b048913 addi s2,s1,176
_Mutex_recursive_Acquire( mutex );
400177f0: 00090513 mv a0,s2
{
400177f4: 00112623 sw ra,12(sp)
400177f8: f8df00ef jal ra,40008784 <_Mutex_recursive_Acquire>
msdos_fs_lock(fs_info);
rc = fat_file_update(&fs_info->fat, fat_fd);
400177fc: 00040593 mv a1,s0
40017800: 00048513 mv a0,s1
40017804: ab8f70ef jal ra,4000eabc <fat_file_update>
40017808: 00050413 mv s0,a0
if (rc != RC_OK)
4001780c: 00051663 bnez a0,40017818 <msdos_file_sync+0x48> <== NEVER TAKEN
{
msdos_fs_unlock(fs_info);
return rc;
}
rc = fat_sync(&fs_info->fat);
40017810: 00048513 mv a0,s1
40017814: ba0f60ef jal ra,4000dbb4 <fat_sync>
_Mutex_recursive_Release( mutex );
40017818: 00090513 mv a0,s2
4001781c: ff1f00ef jal ra,4000880c <_Mutex_recursive_Release>
msdos_fs_unlock(fs_info);
return RC_OK;
}
40017820: 00c12083 lw ra,12(sp)
40017824: 00040513 mv a0,s0
40017828: 00812403 lw s0,8(sp)
4001782c: 00412483 lw s1,4(sp)
40017830: 00012903 lw s2,0(sp)
40017834: 01010113 addi sp,sp,16
40017838: 00008067 ret
40017480 <msdos_file_write>:
*/
ssize_t
msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
40017480: 02452783 lw a5,36(a0)
{
40017484: fe010113 addi sp,sp,-32
40017488: 01512223 sw s5,4(sp)
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
4001748c: 0087aa83 lw s5,8(a5)
{
40017490: 01312623 sw s3,12(sp)
40017494: 00812c23 sw s0,24(sp)
40017498: 0b0a8993 addi s3,s5,176
4001749c: 01212823 sw s2,16(sp)
400174a0: 00050413 mv s0,a0
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
400174a4: 01852903 lw s2,24(a0)
_Mutex_recursive_Acquire( mutex );
400174a8: 00098513 mv a0,s3
{
400174ac: 00912a23 sw s1,20(sp)
400174b0: 01412423 sw s4,8(sp)
400174b4: 00112e23 sw ra,28(sp)
400174b8: 00058a13 mv s4,a1
400174bc: 00060493 mv s1,a2
400174c0: ac4f10ef jal ra,40008784 <_Mutex_recursive_Acquire>
400174c4: 00042783 lw a5,0(s0)
return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_APPEND ) != 0;
400174c8: 2007f793 andi a5,a5,512
msdos_fs_lock(fs_info);
if (rtems_libio_iop_is_append(iop))
400174cc: 08079663 bnez a5,40017558 <msdos_file_write+0xd8>
iop->offset = fat_fd->fat_file_size;
ret = fat_file_write(&fs_info->fat, fat_fd, iop->offset, count,
400174d0: 00842603 lw a2,8(s0)
400174d4: 00048693 mv a3,s1
400174d8: 000a0713 mv a4,s4
400174dc: 00090593 mv a1,s2
400174e0: 000a8513 mv a0,s5
400174e4: d8df70ef jal ra,4000f270 <fat_file_write>
400174e8: 00050493 mv s1,a0
buffer);
if (ret < 0)
400174ec: 0a054c63 bltz a0,400175a4 <msdos_file_write+0x124>
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
400174f0: 00842703 lw a4,8(s0)
400174f4: 00c42603 lw a2,12(s0)
400174f8: 41f55793 srai a5,a0,0x1f
400174fc: 00e50733 add a4,a0,a4
40017500: 00a736b3 sltu a3,a4,a0
40017504: 00c787b3 add a5,a5,a2
40017508: 00f687b3 add a5,a3,a5
4001750c: 00e42423 sw a4,8(s0)
40017510: 00f42623 sw a5,12(s0)
if (iop->offset > fat_fd->fat_file_size)
40017514: 01892683 lw a3,24(s2)
40017518: 04f04863 bgtz a5,40017568 <msdos_file_write+0xe8> <== NEVER TAKEN
4001751c: 00079463 bnez a5,40017524 <msdos_file_write+0xa4> <== NEVER TAKEN
40017520: 04e6e463 bltu a3,a4,40017568 <msdos_file_write+0xe8>
fat_file_set_file_size(fat_fd, (uint32_t) iop->offset);
if (ret > 0)
40017524: 04049c63 bnez s1,4001757c <msdos_file_write+0xfc> <== ALWAYS TAKEN
_Mutex_recursive_Release( mutex );
40017528: 00098513 mv a0,s3
4001752c: ae0f10ef jal ra,4000880c <_Mutex_recursive_Release>
fat_file_set_ctime_mtime(fat_fd, time(NULL));
msdos_fs_unlock(fs_info);
return ret;
}
40017530: 01c12083 lw ra,28(sp)
40017534: 01812403 lw s0,24(sp)
40017538: 01012903 lw s2,16(sp)
4001753c: 00c12983 lw s3,12(sp)
40017540: 00812a03 lw s4,8(sp)
40017544: 00412a83 lw s5,4(sp)
40017548: 00048513 mv a0,s1
4001754c: 01412483 lw s1,20(sp)
40017550: 02010113 addi sp,sp,32
40017554: 00008067 ret
iop->offset = fat_fd->fat_file_size;
40017558: 01892603 lw a2,24(s2)
4001755c: 00042623 sw zero,12(s0)
40017560: 00c42423 sw a2,8(s0)
40017564: f71ff06f j 400174d4 <msdos_file_write+0x54>
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017568: 03094783 lbu a5,48(s2)
fat_file_set_file_size(fat_fd, (uint32_t) iop->offset);
4001756c: 00e92c23 sw a4,24(s2)
40017570: 0027e793 ori a5,a5,2
40017574: 02f90823 sb a5,48(s2)
if (ret > 0)
40017578: fa0488e3 beqz s1,40017528 <msdos_file_write+0xa8> <== NEVER TAKEN
fat_file_set_ctime_mtime(fat_fd, time(NULL));
4001757c: 00000513 li a0,0
40017580: 201070ef jal ra,4001ef80 <time>
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017584: 03094783 lbu a5,48(s2)
fat_fd->ctime = t;
40017588: 04a92023 sw a0,64(s2)
4001758c: 04b92223 sw a1,68(s2)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
40017590: 0027e793 ori a5,a5,2
fat_fd->mtime = t;
40017594: 04a92423 sw a0,72(s2)
40017598: 04b92623 sw a1,76(s2)
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
4001759c: 02f90823 sb a5,48(s2)
}
400175a0: f89ff06f j 40017528 <msdos_file_write+0xa8>
400175a4: 00098513 mv a0,s3
400175a8: a64f10ef jal ra,4000880c <_Mutex_recursive_Release>
return -1;
400175ac: fff00493 li s1,-1
400175b0: f81ff06f j 40017530 <msdos_file_write+0xb0>
400167e0 <msdos_filename_utf8_to_long_name_for_compare>:
int eno = 0;
/*
* The filenames "." and ".." are handled specially, since they
* don't follow dos filename rules.
*/
if ( src_name[0] == UTF8_FULL_STOP
400167e0: 0005c783 lbu a5,0(a1)
rtems_dosfs_convert_control *converter,
const uint8_t *utf8_name,
const size_t utf8_name_size,
uint8_t *long_name,
const size_t long_name_size)
{
400167e4: fe010113 addi sp,sp,-32
400167e8: 00112e23 sw ra,28(sp)
400167ec: 00812c23 sw s0,24(sp)
ssize_t returned_size = 0;
int eno = 0;
size_t name_size;
size_t dest_size = long_name_size;
400167f0: 00e12623 sw a4,12(sp)
if ( src_name[0] == UTF8_FULL_STOP
400167f4: 02e00813 li a6,46
400167f8: 07078263 beq a5,a6,4001685c <msdos_filename_utf8_to_long_name_for_compare+0x7c>
ssize_t size_returned = filename_size;
400167fc: 00060793 mv a5,a2
&& filename_utf8[i] == UTF8_FULL_STOP;) {
40016800: 02e00813 li a6,46
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
40016804: 04c04063 bgtz a2,40016844 <msdos_filename_utf8_to_long_name_for_compare+0x64><== ALWAYS TAKEN
if (returned_size == 0) {
name_size = msdos_filename_delete_trailing_dots (
&utf8_name[0],
utf8_name_size);
if (name_size > 0) {
40016808: 08060a63 beqz a2,4001689c <msdos_filename_utf8_to_long_name_for_compare+0xbc><== NOT EXECUTED
eno = (*converter->handler->utf8_normalize_and_fold) (
4001680c: 00052783 lw a5,0(a0)
40016810: 00c10713 addi a4,sp,12
40016814: 0107a783 lw a5,16(a5)
40016818: 000780e7 jalr a5
4001681c: 00050413 mv s0,a0
converter,
utf8_name,
name_size,
long_name,
&dest_size);
if (eno == 0) {
40016820: 06050463 beqz a0,40016888 <msdos_filename_utf8_to_long_name_for_compare+0xa8><== ALWAYS TAKEN
eno = EINVAL;
}
}
if ( eno != 0 ) {
errno = eno;
40016824: 734040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40016828: 00852023 sw s0,0(a0) <== NOT EXECUTED
returned_size = -1;
4001682c: fff00513 li a0,-1 <== NOT EXECUTED
}
return returned_size;
}
40016830: 01c12083 lw ra,28(sp) <== NOT EXECUTED
40016834: 01812403 lw s0,24(sp) <== NOT EXECUTED
40016838: 02010113 addi sp,sp,32 <== NOT EXECUTED
4001683c: 00008067 ret <== NOT EXECUTED
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
40016840: 04078e63 beqz a5,4001689c <msdos_filename_utf8_to_long_name_for_compare+0xbc><== NEVER TAKEN
&& filename_utf8[i] == UTF8_FULL_STOP;) {
40016844: 00f58733 add a4,a1,a5
40016848: fff74703 lbu a4,-1(a4)
4001684c: 00078613 mv a2,a5
size_returned -= UTF8_FULL_STOP_SIZE;
40016850: fff78793 addi a5,a5,-1
&& filename_utf8[i] == UTF8_FULL_STOP;) {
40016854: ff0706e3 beq a4,a6,40016840 <msdos_filename_utf8_to_long_name_for_compare+0x60>
40016858: fb5ff06f j 4001680c <msdos_filename_utf8_to_long_name_for_compare+0x2c>
&& src_size == UTF8_FULL_STOP_SIZE) {
4001685c: 00100813 li a6,1 <== NOT EXECUTED
40016860: 05060263 beq a2,a6,400168a4 <msdos_filename_utf8_to_long_name_for_compare+0xc4><== NOT EXECUTED
&& src_name[1] == UTF8_FULL_STOP
40016864: 0015c883 lbu a7,1(a1) <== NOT EXECUTED
40016868: f8f89ae3 bne a7,a5,400167fc <msdos_filename_utf8_to_long_name_for_compare+0x1c><== NOT EXECUTED
&& src_size == ( 2 * UTF8_FULL_STOP_SIZE ) ) {
4001686c: 00200793 li a5,2 <== NOT EXECUTED
40016870: f8f616e3 bne a2,a5,400167fc <msdos_filename_utf8_to_long_name_for_compare+0x1c><== NOT EXECUTED
if (dest_size >= 2 * UTF8_FULL_STOP_SIZE) {
40016874: 04e87663 bgeu a6,a4,400168c0 <msdos_filename_utf8_to_long_name_for_compare+0xe0><== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
40016878: 01168023 sb a7,0(a3) <== NOT EXECUTED
dest_name[1] = UTF8_FULL_STOP;
4001687c: 011680a3 sb a7,1(a3) <== NOT EXECUTED
returned_size = 2 * UTF8_FULL_STOP_SIZE;
40016880: 00200513 li a0,2 <== NOT EXECUTED
40016884: fadff06f j 40016830 <msdos_filename_utf8_to_long_name_for_compare+0x50><== NOT EXECUTED
}
40016888: 01c12083 lw ra,28(sp)
4001688c: 01812403 lw s0,24(sp)
returned_size = (ssize_t)dest_size;
40016890: 00c12503 lw a0,12(sp)
}
40016894: 02010113 addi sp,sp,32
40016898: 00008067 ret
eno = EINVAL;
4001689c: 01600413 li s0,22 <== NOT EXECUTED
400168a0: f85ff06f j 40016824 <msdos_filename_utf8_to_long_name_for_compare+0x44><== NOT EXECUTED
if (dest_size >= UTF8_FULL_STOP_SIZE) {
400168a4: 00070e63 beqz a4,400168c0 <msdos_filename_utf8_to_long_name_for_compare+0xe0><== NOT EXECUTED
}
400168a8: 01c12083 lw ra,28(sp) <== NOT EXECUTED
400168ac: 01812403 lw s0,24(sp) <== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
400168b0: 00f68023 sb a5,0(a3) <== NOT EXECUTED
returned_size = UTF8_FULL_STOP_SIZE;
400168b4: 00100513 li a0,1 <== NOT EXECUTED
}
400168b8: 02010113 addi sp,sp,32 <== NOT EXECUTED
400168bc: 00008067 ret <== NOT EXECUTED
errno = eno;
400168c0: 698040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
400168c4: 05b00793 li a5,91 <== NOT EXECUTED
400168c8: 00f52023 sw a5,0(a0) <== NOT EXECUTED
400168cc: fff00513 li a0,-1 <== NOT EXECUTED
400168d0: f61ff06f j 40016830 <msdos_filename_utf8_to_long_name_for_compare+0x50><== NOT EXECUTED
400168d4 <msdos_filename_utf8_to_long_name_for_save>:
rtems_dosfs_convert_control *converter,
const uint8_t *utf8_name,
const size_t utf8_name_size,
uint16_t *long_name,
const size_t long_name_size)
{
400168d4: fe010113 addi sp,sp,-32
400168d8: 00912a23 sw s1,20(sp)
400168dc: 01212823 sw s2,16(sp)
400168e0: 00112e23 sw ra,28(sp)
400168e4: 00812c23 sw s0,24(sp)
size_t name_size_tmp;
int i;
uint16_t c;
unsigned int chars_written;
name_size_tmp = long_name_size;
400168e8: 00e12623 sw a4,12(sp)
{
400168ec: 00070493 mv s1,a4
400168f0: 00068913 mv s2,a3
size_returned >= UTF8_FULL_STOP_SIZE
400168f4: 00060793 mv a5,a2
400168f8: 02e00893 li a7,46
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
400168fc: 00c04863 bgtz a2,4001690c <msdos_filename_utf8_to_long_name_for_save+0x38><== ALWAYS TAKEN
40016900: 0a00006f j 400169a0 <msdos_filename_utf8_to_long_name_for_save+0xcc><== NOT EXECUTED
size_returned -= UTF8_FULL_STOP_SIZE;
40016904: fff78793 addi a5,a5,-1
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
40016908: 08078e63 beqz a5,400169a4 <msdos_filename_utf8_to_long_name_for_save+0xd0><== NEVER TAKEN
&& filename_utf8[i] == UTF8_FULL_STOP;) {
4001690c: 00f58633 add a2,a1,a5
40016910: fff64803 lbu a6,-1(a2)
40016914: 00078613 mv a2,a5
40016918: ff1806e3 beq a6,a7,40016904 <msdos_filename_utf8_to_long_name_for_save+0x30>
utf8_name_size);
if (name_size > 0) {
/*
* Finally convert from UTF-8 to UTF-16
*/
eno = (*converter->handler->utf8_to_utf16) (
4001691c: 00052783 lw a5,0(a0)
40016920: 00c10713 addi a4,sp,12
40016924: 00090693 mv a3,s2
40016928: 0087a783 lw a5,8(a5)
4001692c: 000780e7 jalr a5
40016930: 00050413 mv s0,a0
converter,
utf8_name,
name_size,
&long_name[0],
&name_size_tmp);
if (eno == 0) {
40016934: 0e051063 bnez a0,40016a14 <msdos_filename_utf8_to_long_name_for_save+0x140><== NEVER TAKEN
if (name_size_tmp <= (MSDOS_NAME_MAX_LNF_LEN * MSDOS_NAME_LFN_BYTES_PER_CHAR))
40016938: 00c12583 lw a1,12(sp)
4001693c: 1fe00793 li a5,510
40016940: 0cb7e863 bltu a5,a1,40016a10 <msdos_filename_utf8_to_long_name_for_save+0x13c>
{
/*
* Validate the characters and assign them to the UTF-16 file name
*/
for ( i = 0;
name_size
40016944: 00090613 mv a2,s2
for ( i = 0;
40016948: 14058263 beqz a1,40016a8c <msdos_filename_utf8_to_long_name_for_save+0x1b8><== NEVER TAKEN
retval = codepage_valid_char_map[char_num];
4001694c: 40026eb7 lui t4,0x40026
40016950: 40026e37 lui t3,0x40026
if ( char_num <= 0x00ff ) {
40016954: 0ff00713 li a4,255
switch ( char_num )
40016958: 05d00313 li t1,93
retval = codepage_valid_char_map[char_num];
4001695c: 1a8e8e93 addi t4,t4,424 # 400261a8 <codepage_valid_char_map>
switch ( char_num )
40016960: 01900893 li a7,25
40016964: 02a00813 li a6,42
40016968: 03200693 li a3,50
4001696c: 0dce0e13 addi t3,t3,220 # 400260dc <_Objects_Information_table+0x120>
&& (c = msdos_get_valid_utf16_filename_character ( long_name[i]) );
40016970: 00065783 lhu a5,0(a2)
if ( char_num <= 0x00ff ) {
40016974: 04f76a63 bltu a4,a5,400169c8 <msdos_filename_utf8_to_long_name_for_save+0xf4>
switch ( char_num )
40016978: 02f36a63 bltu t1,a5,400169ac <msdos_filename_utf8_to_long_name_for_save+0xd8>
4001697c: 04f87063 bgeu a6,a5,400169bc <msdos_filename_utf8_to_long_name_for_save+0xe8>
40016980: fd578513 addi a0,a5,-43
40016984: 01051513 slli a0,a0,0x10
40016988: 01055513 srli a0,a0,0x10
4001698c: 02a6e863 bltu a3,a0,400169bc <msdos_filename_utf8_to_long_name_for_save+0xe8>
40016990: 00251513 slli a0,a0,0x2
40016994: 01c50533 add a0,a0,t3
40016998: 00052503 lw a0,0(a0)
4001699c: 00050067 jr a0
if (name_size > 0) {
400169a0: f6061ee3 bnez a2,4001691c <msdos_filename_utf8_to_long_name_for_save+0x48><== NOT EXECUTED
if ( name_size == UTF16_NULL_SIZE && c == UTF16_NULL ) {
long_name[i] = c;
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
}
else if ( name_size != 0 )
eno = EINVAL;
400169a4: 01600413 li s0,22 <== NOT EXECUTED
400169a8: 06c0006f j 40016a14 <msdos_filename_utf8_to_long_name_for_save+0x140><== NOT EXECUTED
switch ( char_num )
400169ac: f9f78513 addi a0,a5,-97
400169b0: 01051513 slli a0,a0,0x10
400169b4: 01055513 srli a0,a0,0x10
400169b8: 00a8f863 bgeu a7,a0,400169c8 <msdos_filename_utf8_to_long_name_for_save+0xf4>
retval = codepage_valid_char_map[char_num];
400169bc: 00fe87b3 add a5,t4,a5
400169c0: 0007c783 lbu a5,0(a5)
&& (c = msdos_get_valid_utf16_filename_character ( long_name[i]) );
400169c4: 06078063 beqz a5,40016a24 <msdos_filename_utf8_to_long_name_for_save+0x150>
long_name[i] = c;
400169c8: 00f61023 sh a5,0(a2)
name_size -= MSDOS_NAME_LFN_BYTES_PER_CHAR;
400169cc: ffe58593 addi a1,a1,-2
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
400169d0: 00240413 addi s0,s0,2
for ( i = 0;
400169d4: 00260613 addi a2,a2,2
400169d8: f8059ce3 bnez a1,40016970 <msdos_filename_utf8_to_long_name_for_save+0x9c>
chars_written = returned_size / MSDOS_NAME_LFN_BYTES_PER_CHAR;
if ( long_name [chars_written - 1] != UTF16_NULL
400169dc: ffe47793 andi a5,s0,-2
chars_written = returned_size / MSDOS_NAME_LFN_BYTES_PER_CHAR;
400169e0: 40145593 srai a1,s0,0x1
if ( long_name [chars_written - 1] != UTF16_NULL
400169e4: ffe78793 addi a5,a5,-2
400169e8: 00f907b3 add a5,s2,a5
400169ec: 0007d783 lhu a5,0(a5)
400169f0: 08079263 bnez a5,40016a74 <msdos_filename_utf8_to_long_name_for_save+0x1a0><== ALWAYS TAKEN
errno = eno;
returned_size = -1;
}
return returned_size;
}
400169f4: 01c12083 lw ra,28(sp)
400169f8: 00040513 mv a0,s0
400169fc: 01812403 lw s0,24(sp)
40016a00: 01412483 lw s1,20(sp)
40016a04: 01012903 lw s2,16(sp)
40016a08: 02010113 addi sp,sp,32
40016a0c: 00008067 ret
eno = ENAMETOOLONG;
40016a10: 05b00413 li s0,91
errno = eno;
40016a14: 544040ef jal ra,4001af58 <__errno>
40016a18: 00852023 sw s0,0(a0)
returned_size = -1;
40016a1c: fff00413 li s0,-1
return returned_size;
40016a20: fd5ff06f j 400169f4 <msdos_filename_utf8_to_long_name_for_save+0x120>
if ( name_size == UTF16_NULL_SIZE && c == UTF16_NULL ) {
40016a24: 00200793 li a5,2
40016a28: 02f58a63 beq a1,a5,40016a5c <msdos_filename_utf8_to_long_name_for_save+0x188>
if ( long_name [chars_written - 1] != UTF16_NULL
40016a2c: ffe47793 andi a5,s0,-2
40016a30: 00f907b3 add a5,s2,a5
40016a34: ffe7d703 lhu a4,-2(a5)
chars_written = returned_size / MSDOS_NAME_LFN_BYTES_PER_CHAR;
40016a38: 40145793 srai a5,s0,0x1
if ( long_name [chars_written - 1] != UTF16_NULL
40016a3c: f60704e3 beqz a4,400169a4 <msdos_filename_utf8_to_long_name_for_save+0xd0><== NEVER TAKEN
&& (returned_size + UTF16_NULL_SIZE ) <= long_name_size ) {
40016a40: 00240413 addi s0,s0,2
40016a44: f684e0e3 bltu s1,s0,400169a4 <msdos_filename_utf8_to_long_name_for_save+0xd0>
long_name[chars_written] = UTF16_NULL;
40016a48: 00179793 slli a5,a5,0x1
40016a4c: 00f907b3 add a5,s2,a5
40016a50: 00079023 sh zero,0(a5)
eno = EINVAL;
40016a54: 01600413 li s0,22
40016a58: fbdff06f j 40016a14 <msdos_filename_utf8_to_long_name_for_save+0x140>
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
40016a5c: 00240413 addi s0,s0,2 <== NOT EXECUTED
if ( long_name [chars_written - 1] != UTF16_NULL
40016a60: ffe47793 andi a5,s0,-2 <== NOT EXECUTED
long_name[i] = c;
40016a64: 00061023 sh zero,0(a2) <== NOT EXECUTED
chars_written = returned_size / MSDOS_NAME_LFN_BYTES_PER_CHAR;
40016a68: 40145593 srai a1,s0,0x1 <== NOT EXECUTED
if ( long_name [chars_written - 1] != UTF16_NULL
40016a6c: ffe78793 addi a5,a5,-2 <== NOT EXECUTED
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
40016a70: f79ff06f j 400169e8 <msdos_filename_utf8_to_long_name_for_save+0x114><== NOT EXECUTED
&& (returned_size + UTF16_NULL_SIZE ) <= long_name_size ) {
40016a74: 00240793 addi a5,s0,2
40016a78: f6f4eee3 bltu s1,a5,400169f4 <msdos_filename_utf8_to_long_name_for_save+0x120>
long_name[chars_written] = UTF16_NULL;
40016a7c: 00159593 slli a1,a1,0x1
40016a80: 00b905b3 add a1,s2,a1
40016a84: 00059023 sh zero,0(a1)
if ( eno != 0 ) {
40016a88: f6dff06f j 400169f4 <msdos_filename_utf8_to_long_name_for_save+0x120>
for ( i = 0;
40016a8c: ffe00793 li a5,-2 <== NOT EXECUTED
40016a90: f59ff06f j 400169e8 <msdos_filename_utf8_to_long_name_for_save+0x114><== NOT EXECUTED
40016a94 <msdos_filename_utf8_to_short_name_for_compare>:
rtems_dosfs_convert_control *converter,
const uint8_t *utf8_name,
const size_t utf8_name_size,
void *short_name,
const size_t short_name_size)
{
40016a94: fb010113 addi sp,sp,-80
40016a98: 04812423 sw s0,72(sp)
40016a9c: 04112623 sw ra,76(sp)
40016aa0: 04912223 sw s1,68(sp)
40016aa4: 05212023 sw s2,64(sp)
if ( src_name[0] == UTF8_FULL_STOP
40016aa8: 0005c783 lbu a5,0(a1)
int eno = 0;
const uint8_t *name_ptr = utf8_name;
char *dest_ptr = (char*)short_name;
size_t name_size = utf8_name_size;
uint8_t name_normalized_buf[(MSDOS_SHORT_NAME_LEN +1) * MSDOS_NAME_MAX_UTF8_BYTES_PER_CHAR];
size_t name_size_tmp = sizeof(name_normalized_buf);
40016aac: 03000813 li a6,48
40016ab0: 01012623 sw a6,12(sp)
if ( src_name[0] == UTF8_FULL_STOP
40016ab4: 02e00813 li a6,46
{
40016ab8: 00068413 mv s0,a3
if ( src_name[0] == UTF8_FULL_STOP
40016abc: 09078263 beq a5,a6,40016b40 <msdos_filename_utf8_to_short_name_for_compare+0xac>
while ( *name_size >= UTF8_FULL_STOP_SIZE
40016ac0: 02061663 bnez a2,40016aec <msdos_filename_utf8_to_short_name_for_compare+0x58><== ALWAYS TAKEN
if ( eno == 0 ) {
memcpy (&dest_ptr[0], &name_ptr[0], name_size);
returned_size = name_size;
}
} else
eno = EINVAL;
40016ac4: 01600493 li s1,22 <== NOT EXECUTED
}
if ( eno != 0 ) {
errno = eno;
40016ac8: 490040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40016acc: 00952023 sw s1,0(a0) <== NOT EXECUTED
returned_size = -1;
40016ad0: fff00513 li a0,-1 <== NOT EXECUTED
}
return returned_size;
}
40016ad4: 04c12083 lw ra,76(sp)
40016ad8: 04812403 lw s0,72(sp)
40016adc: 04412483 lw s1,68(sp)
40016ae0: 04012903 lw s2,64(sp)
40016ae4: 05010113 addi sp,sp,80
40016ae8: 00008067 ret
eno = (*converter->handler->utf8_normalize_and_fold) (
40016aec: 00052783 lw a5,0(a0)
40016af0: 00c10713 addi a4,sp,12
40016af4: 01010693 addi a3,sp,16
40016af8: 0107a783 lw a5,16(a5)
40016afc: 000780e7 jalr a5
if ( eno == ENOMEM ) {
40016b00: 00c00793 li a5,12
name_size = name_size_tmp;
40016b04: 00c12903 lw s2,12(sp)
eno = (*converter->handler->utf8_normalize_and_fold) (
40016b08: 00050493 mv s1,a0
if ( eno == ENOMEM ) {
40016b0c: 00f50463 beq a0,a5,40016b14 <msdos_filename_utf8_to_short_name_for_compare+0x80>
if ( eno == 0 ) {
40016b10: fa049ce3 bnez s1,40016ac8 <msdos_filename_utf8_to_short_name_for_compare+0x34><== NEVER TAKEN
memcpy (&dest_ptr[0], &name_ptr[0], name_size);
40016b14: 00090613 mv a2,s2
40016b18: 01010593 addi a1,sp,16
40016b1c: 00040513 mv a0,s0
40016b20: 529040ef jal ra,4001b848 <memcpy>
}
40016b24: 04c12083 lw ra,76(sp)
40016b28: 04812403 lw s0,72(sp)
40016b2c: 04412483 lw s1,68(sp)
returned_size = name_size;
40016b30: 00090513 mv a0,s2
}
40016b34: 04012903 lw s2,64(sp)
40016b38: 05010113 addi sp,sp,80
40016b3c: 00008067 ret
&& src_size == UTF8_FULL_STOP_SIZE) {
40016b40: 00100693 li a3,1
40016b44: 04d60663 beq a2,a3,40016b90 <msdos_filename_utf8_to_short_name_for_compare+0xfc>
&& src_name[1] == UTF8_FULL_STOP
40016b48: 0015c803 lbu a6,1(a1)
40016b4c: 02f80463 beq a6,a5,40016b74 <msdos_filename_utf8_to_short_name_for_compare+0xe0>
&& **name_utf8 == UTF8_FULL_STOP) {
40016b50: 02e00713 li a4,46 <== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
40016b54: 00061863 bnez a2,40016b64 <msdos_filename_utf8_to_short_name_for_compare+0xd0><== NOT EXECUTED
40016b58: f6dff06f j 40016ac4 <msdos_filename_utf8_to_short_name_for_compare+0x30><== NOT EXECUTED
&& **name_utf8 == UTF8_FULL_STOP) {
40016b5c: 0005c783 lbu a5,0(a1) <== NOT EXECUTED
40016b60: f8e796e3 bne a5,a4,40016aec <msdos_filename_utf8_to_short_name_for_compare+0x58><== NOT EXECUTED
*name_size -= UTF8_FULL_STOP_SIZE;
40016b64: fff60613 addi a2,a2,-1 <== NOT EXECUTED
*name_utf8 += UTF8_FULL_STOP_SIZE;
40016b68: 00158593 addi a1,a1,1 <== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
40016b6c: fe0618e3 bnez a2,40016b5c <msdos_filename_utf8_to_short_name_for_compare+0xc8><== NOT EXECUTED
40016b70: f55ff06f j 40016ac4 <msdos_filename_utf8_to_short_name_for_compare+0x30><== NOT EXECUTED
&& src_size == ( 2 * UTF8_FULL_STOP_SIZE ) ) {
40016b74: 00200793 li a5,2
40016b78: fcf61ce3 bne a2,a5,40016b50 <msdos_filename_utf8_to_short_name_for_compare+0xbc>
if (dest_size >= 2 * UTF8_FULL_STOP_SIZE) {
40016b7c: 02e6fc63 bgeu a3,a4,40016bb4 <msdos_filename_utf8_to_short_name_for_compare+0x120>
dest_name[0] = UTF8_FULL_STOP;
40016b80: 01040023 sb a6,0(s0)
dest_name[1] = UTF8_FULL_STOP;
40016b84: 010400a3 sb a6,1(s0)
returned_size = 2 * UTF8_FULL_STOP_SIZE;
40016b88: 00200513 li a0,2
40016b8c: f49ff06f j 40016ad4 <msdos_filename_utf8_to_short_name_for_compare+0x40>
if (dest_size >= UTF8_FULL_STOP_SIZE) {
40016b90: 02070263 beqz a4,40016bb4 <msdos_filename_utf8_to_short_name_for_compare+0x120><== NEVER TAKEN
dest_name[0] = UTF8_FULL_STOP;
40016b94: 00f40023 sb a5,0(s0)
}
40016b98: 04c12083 lw ra,76(sp)
40016b9c: 04812403 lw s0,72(sp)
40016ba0: 04412483 lw s1,68(sp)
40016ba4: 04012903 lw s2,64(sp)
returned_size = UTF8_FULL_STOP_SIZE;
40016ba8: 00100513 li a0,1
}
40016bac: 05010113 addi sp,sp,80
40016bb0: 00008067 ret
errno = eno;
40016bb4: 3a4040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40016bb8: 05b00793 li a5,91 <== NOT EXECUTED
40016bbc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40016bc0: fff00513 li a0,-1 <== NOT EXECUTED
40016bc4: f11ff06f j 40016ad4 <msdos_filename_utf8_to_short_name_for_compare+0x40><== NOT EXECUTED
40016bc8 <msdos_filename_utf8_to_short_name_for_save>:
rtems_dosfs_convert_control *converter,
const uint8_t *utf8_name,
const size_t utf8_name_size,
void *short_name,
const size_t short_name_size)
{
40016bc8: fd010113 addi sp,sp,-48
40016bcc: 03212023 sw s2,32(sp)
40016bd0: 01312e23 sw s3,28(sp)
40016bd4: 02112623 sw ra,44(sp)
40016bd8: 02812423 sw s0,40(sp)
40016bdc: 02912223 sw s1,36(sp)
40016be0: 01412c23 sw s4,24(sp)
if ( src_name[0] == UTF8_FULL_STOP
40016be4: 0005c783 lbu a5,0(a1)
40016be8: 02e00813 li a6,46
{
40016bec: 00068993 mv s3,a3
40016bf0: 00070913 mv s2,a4
if ( src_name[0] == UTF8_FULL_STOP
40016bf4: 1b078463 beq a5,a6,40016d9c <msdos_filename_utf8_to_short_name_for_save+0x1d4>
while ( *name_size >= UTF8_FULL_STOP_SIZE
40016bf8: 02061c63 bnez a2,40016c30 <msdos_filename_utf8_to_short_name_for_save+0x68><== ALWAYS TAKEN
else
eno = EINVAL;
}
if ( eno != 0 ) {
errno = eno;
40016bfc: 35c040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40016c00: 01600793 li a5,22 <== NOT EXECUTED
40016c04: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return -1;
40016c08: fff00493 li s1,-1 <== NOT EXECUTED
}
return returned_size;
}
40016c0c: 02c12083 lw ra,44(sp)
40016c10: 02812403 lw s0,40(sp)
40016c14: 02012903 lw s2,32(sp)
40016c18: 01c12983 lw s3,28(sp)
40016c1c: 01812a03 lw s4,24(sp)
40016c20: 00048513 mv a0,s1
40016c24: 02412483 lw s1,36(sp)
40016c28: 03010113 addi sp,sp,48
40016c2c: 00008067 ret
eno = (*converter->handler->utf8_to_codepage) (
40016c30: 00052783 lw a5,0(a0)
name_size_tmp = sizeof ( name_to_format_buf );
40016c34: 00c00713 li a4,12
eno = (*converter->handler->utf8_to_codepage) (
40016c38: 00410693 addi a3,sp,4
40016c3c: 0007a783 lw a5,0(a5)
name_size_tmp = sizeof ( name_to_format_buf );
40016c40: 00e12023 sw a4,0(sp)
eno = (*converter->handler->utf8_to_codepage) (
40016c44: 00010713 mv a4,sp
40016c48: 000780e7 jalr a5
name_size = name_size_tmp;
40016c4c: 00012403 lw s0,0(sp)
returned_size = msdos_filename_process_dot_names (
40016c50: 00000493 li s1,0
for (i = 0; i < name_size; ++i)
40016c54: fa040ce3 beqz s0,40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44><== NEVER TAKEN
40016c58: 00410793 addi a5,sp,4
40016c5c: 400276b7 lui a3,0x40027
40016c60: 00878833 add a6,a5,s0
40016c64: 10968693 addi a3,a3,265 # 40027109 <_ctype_+0x1>
name_to_format_buf[i] = toupper ( (unsigned char)(name_to_format_buf[i]) );
40016c68: 00200513 li a0,2
40016c6c: 0007c603 lbu a2,0(a5)
40016c70: 00c68733 add a4,a3,a2
40016c74: 00074583 lbu a1,0(a4)
40016c78: 0035f593 andi a1,a1,3
40016c7c: 00a59663 bne a1,a0,40016c88 <msdos_filename_utf8_to_short_name_for_save+0xc0>
40016c80: fe060613 addi a2,a2,-32
40016c84: 0ff67613 andi a2,a2,255
40016c88: 00c78023 sb a2,0(a5)
for (i = 0; i < name_size; ++i)
40016c8c: 00178793 addi a5,a5,1
40016c90: fd079ee3 bne a5,a6,40016c6c <msdos_filename_utf8_to_short_name_for_save+0xa4>
if ( 0x20 == *name_ptr )
40016c94: 00414783 lbu a5,4(sp)
40016c98: 02000713 li a4,32
40016c9c: 16e78063 beq a5,a4,40016dfc <msdos_filename_utf8_to_short_name_for_save+0x234>
else if ( 0xE5 == *name_ptr )
40016ca0: 0e500713 li a4,229
40016ca4: 18e78e63 beq a5,a4,40016e40 <msdos_filename_utf8_to_short_name_for_save+0x278>
char c = codepage_valid_char_map[character];
40016ca8: 40026737 lui a4,0x40026
40016cac: 1a870713 addi a4,a4,424 # 400261a8 <codepage_valid_char_map>
40016cb0: 00f707b3 add a5,a4,a5
40016cb4: 0007c783 lbu a5,0(a5)
if (c == 0) {
40016cb8: 14078263 beqz a5,40016dfc <msdos_filename_utf8_to_short_name_for_save+0x234>
dest_ptr[0] = msdos_get_valid_codepage_filename_character(*name_ptr);
40016cbc: 00f98023 sb a5,0(s3)
++returned_size;
40016cc0: 00100493 li s1,1
char c = codepage_valid_char_map[character];
40016cc4: 40026537 lui a0,0x40026
--name_size;
40016cc8: fff40413 addi s0,s0,-1
++name_ptr;
40016ccc: 00510a13 addi s4,sp,5
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
40016cd0: 02e00813 li a6,46
char c = codepage_valid_char_map[character];
40016cd4: 1a850513 addi a0,a0,424 # 400261a8 <codepage_valid_char_map>
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
40016cd8: 00800893 li a7,8
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
40016cdc: 00998733 add a4,s3,s1
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
40016ce0: 04040063 beqz s0,40016d20 <msdos_filename_utf8_to_short_name_for_save+0x158>
40016ce4: 000a4783 lbu a5,0(s4)
++name_ptr;
40016ce8: 001a0593 addi a1,s4,1
--name_size;
40016cec: fff40693 addi a3,s0,-1
char c = codepage_valid_char_map[character];
40016cf0: 00f50633 add a2,a0,a5
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
40016cf4: 17078663 beq a5,a6,40016e60 <msdos_filename_utf8_to_short_name_for_save+0x298>
char c = codepage_valid_char_map[character];
40016cf8: 00064783 lbu a5,0(a2)
++returned_size;
40016cfc: 00148493 addi s1,s1,1
if (c == 0) {
40016d00: 00079463 bnez a5,40016d08 <msdos_filename_utf8_to_short_name_for_save+0x140>
c = '_';
40016d04: 05f00793 li a5,95
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
40016d08: 00f70023 sb a5,0(a4)
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
40016d0c: 0f148c63 beq s1,a7,40016e04 <msdos_filename_utf8_to_short_name_for_save+0x23c>
--name_size;
40016d10: 00068413 mv s0,a3
++name_ptr;
40016d14: 00058a13 mv s4,a1
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
40016d18: 00998733 add a4,s3,s1
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
40016d1c: fc0414e3 bnez s0,40016ce4 <msdos_filename_utf8_to_short_name_for_save+0x11c>
dest_ptr[i] = ' ';
40016d20: 00800613 li a2,8
40016d24: 40960633 sub a2,a2,s1
40016d28: 02000593 li a1,32
40016d2c: 00998533 add a0,s3,s1
40016d30: 441040ef jal ra,4001b970 <memset>
char c = codepage_valid_char_map[character];
40016d34: 40026637 lui a2,0x40026
40016d38: 00840713 addi a4,s0,8
if ( name_size > 0 && *name_ptr == '.' ) {
40016d3c: 00800493 li s1,8
40016d40: 00800413 li s0,8
char c = codepage_valid_char_map[character];
40016d44: 1a860613 addi a2,a2,424 # 400261a8 <codepage_valid_char_map>
for (; i <= 10 && name_size ; i++) {
40016d48: 00b00593 li a1,11
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
40016d4c: 008a07b3 add a5,s4,s0
40016d50: 008986b3 add a3,s3,s0
for (; i <= 10 && name_size ; i++) {
40016d54: 02870463 beq a4,s0,40016d7c <msdos_filename_utf8_to_short_name_for_save+0x1b4>
char c = codepage_valid_char_map[character];
40016d58: ff87c783 lbu a5,-8(a5)
for (; i <= 10 && name_size ; i++) {
40016d5c: 00140413 addi s0,s0,1
++returned_size;
40016d60: 00148493 addi s1,s1,1
char c = codepage_valid_char_map[character];
40016d64: 00f607b3 add a5,a2,a5
40016d68: 0007c783 lbu a5,0(a5)
if (c == 0) {
40016d6c: 00079463 bnez a5,40016d74 <msdos_filename_utf8_to_short_name_for_save+0x1ac>
c = '_';
40016d70: 05f00793 li a5,95
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
40016d74: 00f68023 sb a5,0(a3)
for (; i <= 10 && name_size ; i++) {
40016d78: fcb41ae3 bne s0,a1,40016d4c <msdos_filename_utf8_to_short_name_for_save+0x184>
for ( ; i < short_name_size; ++i ) {
40016d7c: e92478e3 bgeu s0,s2,40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44>
dest_ptr[i] = ' ';
40016d80: 40890633 sub a2,s2,s0
40016d84: 00898533 add a0,s3,s0
40016d88: 02000593 li a1,32
++returned_size;
40016d8c: 40848433 sub s0,s1,s0
dest_ptr[i] = ' ';
40016d90: 3e1040ef jal ra,4001b970 <memset>
++returned_size;
40016d94: 012404b3 add s1,s0,s2
40016d98: e75ff06f j 40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44>
&& src_size == UTF8_FULL_STOP_SIZE) {
40016d9c: 00100713 li a4,1 <== NOT EXECUTED
40016da0: 06e60863 beq a2,a4,40016e10 <msdos_filename_utf8_to_short_name_for_save+0x248><== NOT EXECUTED
&& src_name[1] == UTF8_FULL_STOP
40016da4: 0015c683 lbu a3,1(a1) <== NOT EXECUTED
40016da8: 02f68c63 beq a3,a5,40016de0 <msdos_filename_utf8_to_short_name_for_save+0x218><== NOT EXECUTED
&& **name_utf8 == UTF8_FULL_STOP) {
40016dac: 02e00713 li a4,46 <== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
40016db0: 00061863 bnez a2,40016dc0 <msdos_filename_utf8_to_short_name_for_save+0x1f8><== NOT EXECUTED
40016db4: e49ff06f j 40016bfc <msdos_filename_utf8_to_short_name_for_save+0x34><== NOT EXECUTED
&& **name_utf8 == UTF8_FULL_STOP) {
40016db8: 0005c783 lbu a5,0(a1) <== NOT EXECUTED
40016dbc: e6e79ae3 bne a5,a4,40016c30 <msdos_filename_utf8_to_short_name_for_save+0x68><== NOT EXECUTED
*name_size -= UTF8_FULL_STOP_SIZE;
40016dc0: fff60613 addi a2,a2,-1 <== NOT EXECUTED
*name_utf8 += UTF8_FULL_STOP_SIZE;
40016dc4: 00158593 addi a1,a1,1 <== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
40016dc8: fe0618e3 bnez a2,40016db8 <msdos_filename_utf8_to_short_name_for_save+0x1f0><== NOT EXECUTED
errno = eno;
40016dcc: 18c040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40016dd0: 01600793 li a5,22 <== NOT EXECUTED
40016dd4: 00f52023 sw a5,0(a0) <== NOT EXECUTED
return -1;
40016dd8: fff00493 li s1,-1 <== NOT EXECUTED
40016ddc: e31ff06f j 40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44><== NOT EXECUTED
&& src_size == ( 2 * UTF8_FULL_STOP_SIZE ) ) {
40016de0: 00200793 li a5,2 <== NOT EXECUTED
40016de4: fcf614e3 bne a2,a5,40016dac <msdos_filename_utf8_to_short_name_for_save+0x1e4><== NOT EXECUTED
if (dest_size >= 2 * UTF8_FULL_STOP_SIZE) {
40016de8: 07277263 bgeu a4,s2,40016e4c <msdos_filename_utf8_to_short_name_for_save+0x284><== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
40016dec: 00d98023 sb a3,0(s3) <== NOT EXECUTED
dest_name[1] = UTF8_FULL_STOP;
40016df0: 00d980a3 sb a3,1(s3) <== NOT EXECUTED
returned_size = 2 * UTF8_FULL_STOP_SIZE;
40016df4: 00200493 li s1,2 <== NOT EXECUTED
40016df8: e15ff06f j 40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44><== NOT EXECUTED
c = '_';
40016dfc: 05f00793 li a5,95
40016e00: ebdff06f j 40016cbc <msdos_filename_utf8_to_short_name_for_save+0xf4>
if ( name_size > 0 && *name_ptr == '.' ) {
40016e04: 00069e63 bnez a3,40016e20 <msdos_filename_utf8_to_short_name_for_save+0x258>
40016e08: 00800413 li s0,8
40016e0c: f71ff06f j 40016d7c <msdos_filename_utf8_to_short_name_for_save+0x1b4>
if (dest_size >= UTF8_FULL_STOP_SIZE) {
40016e10: 02090e63 beqz s2,40016e4c <msdos_filename_utf8_to_short_name_for_save+0x284><== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
40016e14: 00f68023 sb a5,0(a3) <== NOT EXECUTED
returned_size = UTF8_FULL_STOP_SIZE;
40016e18: 00100493 li s1,1 <== NOT EXECUTED
40016e1c: df1ff06f j 40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44><== NOT EXECUTED
if ( name_size > 0 && *name_ptr == '.' ) {
40016e20: 0005c703 lbu a4,0(a1)
40016e24: 02e00793 li a5,46
++name_ptr;
40016e28: 002a0a13 addi s4,s4,2
--name_size;
40016e2c: ffe40413 addi s0,s0,-2
if ( name_size > 0 && *name_ptr == '.' ) {
40016e30: f0f702e3 beq a4,a5,40016d34 <msdos_filename_utf8_to_short_name_for_save+0x16c>
40016e34: 00068413 mv s0,a3
40016e38: 00058a13 mv s4,a1
40016e3c: ef9ff06f j 40016d34 <msdos_filename_utf8_to_short_name_for_save+0x16c>
dest_ptr[0] = 0x05;
40016e40: 00500793 li a5,5 <== NOT EXECUTED
40016e44: 00f98023 sb a5,0(s3) <== NOT EXECUTED
40016e48: e79ff06f j 40016cc0 <msdos_filename_utf8_to_short_name_for_save+0xf8><== NOT EXECUTED
errno = eno;
40016e4c: 10c040ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40016e50: 05b00793 li a5,91 <== NOT EXECUTED
40016e54: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40016e58: fff00493 li s1,-1 <== NOT EXECUTED
40016e5c: db1ff06f j 40016c0c <msdos_filename_utf8_to_short_name_for_save+0x44><== NOT EXECUTED
++name_ptr;
40016e60: 001a0a13 addi s4,s4,1
--name_size;
40016e64: fff40413 addi s0,s0,-1
40016e68: eb9ff06f j 40016d20 <msdos_filename_utf8_to_short_name_for_save+0x158>
400117f4 <msdos_find_name>:
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
400117f4: 01452783 lw a5,20(a0)
{
400117f8: fa010113 addi sp,sp,-96
400117fc: 05312623 sw s3,76(sp)
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
40011800: 0087a983 lw s3,8(a5)
{
40011804: 04912a23 sw s1,84(sp)
40011808: 00050493 mv s1,a0
name_type = msdos_long_to_short (
4001180c: 0cc9a503 lw a0,204(s3)
40011810: 00b00713 li a4,11
40011814: 02010693 addi a3,sp,32
{
40011818: 04112e23 sw ra,92(sp)
4001181c: 04812c23 sw s0,88(sp)
40011820: 05212823 sw s2,80(sp)
40011824: 00058413 mv s0,a1
40011828: 00060913 mv s2,a2
fat_file_fd_t *fat_fd = NULL;
4001182c: 00012623 sw zero,12(sp)
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
40011830: 02012023 sw zero,32(sp)
40011834: 02012223 sw zero,36(sp)
40011838: 02012423 sw zero,40(sp)
4001183c: 02012623 sw zero,44(sp)
40011840: 02012823 sw zero,48(sp)
40011844: 02012a23 sw zero,52(sp)
40011848: 02012c23 sw zero,56(sp)
4001184c: 02012e23 sw zero,60(sp)
name_type = msdos_long_to_short (
40011850: 845fe0ef jal ra,40010094 <msdos_long_to_short>
40011854: 00050713 mv a4,a0
rc = msdos_get_name_node(parent_loc, false, name, name_len, name_type,
40011858: 00040613 mv a2,s0
4001185c: 02010813 addi a6,sp,32
40011860: 01010793 addi a5,sp,16
40011864: 00090693 mv a3,s2
40011868: 00000593 li a1,0
4001186c: 00048513 mv a0,s1
40011870: e95ff0ef jal ra,40011704 <msdos_get_name_node>
40011874: 00050413 mv s0,a0
if (rc != RC_OK)
40011878: 08051063 bnez a0,400118f8 <msdos_find_name+0x104>
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
4001187c: 02b14783 lbu a5,43(sp)
40011880: 0087f713 andi a4,a5,8
40011884: 08071a63 bnez a4,40011918 <msdos_find_name+0x124> <== NEVER TAKEN
40011888: 03f7f793 andi a5,a5,63
4001188c: 00f00713 li a4,15
40011890: 08e78463 beq a5,a4,40011918 <msdos_find_name+0x124>
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
40011894: 00c10613 addi a2,sp,12
40011898: 01010593 addi a1,sp,16
4001189c: 00098513 mv a0,s3
400118a0: f19fc0ef jal ra,4000e7b8 <fat_file_open>
400118a4: 00050413 mv s0,a0
if (rc != RC_OK)
400118a8: 04051863 bnez a0,400118f8 <msdos_find_name+0x104> <== NEVER TAKEN
fat_fd->dir_pos = dir_pos;
400118ac: 00c12783 lw a5,12(sp)
400118b0: 01012703 lw a4,16(sp)
if (fat_fd->links_num == 1)
400118b4: 0087a683 lw a3,8(a5)
fat_fd->dir_pos = dir_pos;
400118b8: 02e7a023 sw a4,32(a5)
400118bc: 01412703 lw a4,20(sp)
400118c0: 02e7a223 sw a4,36(a5)
400118c4: 01812703 lw a4,24(sp)
400118c8: 02e7a423 sw a4,40(a5)
400118cc: 01c12703 lw a4,28(sp)
400118d0: 02e7a623 sw a4,44(a5)
if (fat_fd->links_num == 1)
400118d4: 00100713 li a4,1
400118d8: 06e68463 beq a3,a4,40011940 <msdos_find_name+0x14c>
rc = fat_file_close(&fs_info->fat, parent_loc->node_access);
400118dc: 0084a583 lw a1,8(s1)
400118e0: 00098513 mv a0,s3
400118e4: d78fd0ef jal ra,4000ee5c <fat_file_close>
400118e8: 00050413 mv s0,a0
if (rc != RC_OK)
400118ec: 0e051663 bnez a0,400119d8 <msdos_find_name+0x1e4> <== NEVER TAKEN
parent_loc->node_access = fat_fd;
400118f0: 00c12783 lw a5,12(sp)
400118f4: 00f4a423 sw a5,8(s1)
}
400118f8: 05c12083 lw ra,92(sp)
400118fc: 00040513 mv a0,s0
40011900: 05812403 lw s0,88(sp)
40011904: 05412483 lw s1,84(sp)
40011908: 05012903 lw s2,80(sp)
4001190c: 04c12983 lw s3,76(sp)
40011910: 06010113 addi sp,sp,96
40011914: 00008067 ret
return MSDOS_NAME_NOT_FOUND_ERR;
40011918: 00008537 lui a0,0x8 <== NOT EXECUTED
4001191c: d0150413 addi s0,a0,-767 # 7d01 <bsp_section_rodata_size+0x5575><== NOT EXECUTED
}
40011920: 05c12083 lw ra,92(sp) <== NOT EXECUTED
40011924: 00040513 mv a0,s0 <== NOT EXECUTED
40011928: 05812403 lw s0,88(sp) <== NOT EXECUTED
4001192c: 05412483 lw s1,84(sp) <== NOT EXECUTED
40011930: 05012903 lw s2,80(sp) <== NOT EXECUTED
40011934: 04c12983 lw s3,76(sp) <== NOT EXECUTED
40011938: 06010113 addi sp,sp,96 <== NOT EXECUTED
4001193c: 00008067 ret <== NOT EXECUTED
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
40011940: 03415703 lhu a4,52(sp)
40011944: 03a15683 lhu a3,58(sp)
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
40011948: 03615583 lhu a1,54(sp)
4001194c: 03815503 lhu a0,56(sp)
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
40011950: 01071713 slli a4,a4,0x10
40011954: 00d76733 or a4,a4,a3
40011958: 00e7ae23 sw a4,28(a5)
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
4001195c: 581040ef jal ra,400166dc <msdos_date_dos2unix>
40011960: 00c12783 lw a5,12(sp)
40011964: 00050713 mv a4,a0
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
40011968: 02e15583 lhu a1,46(sp)
4001196c: 03015503 lhu a0,48(sp)
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
40011970: 04e7a423 sw a4,72(a5)
40011974: 0407a623 sw zero,76(a5)
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
40011978: 565040ef jal ra,400166dc <msdos_date_dos2unix>
4001197c: 00c12583 lw a1,12(sp)
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
40011980: 02b14783 lbu a5,43(sp)
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
40011984: 04a5a023 sw a0,64(a1)
40011988: 0405a223 sw zero,68(a1)
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
4001198c: 0107f793 andi a5,a5,16
40011990: 04079c63 bnez a5,400119e8 <msdos_find_name+0x1f4>
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
40011994: 03c12783 lw a5,60(sp)
fat_fd->fat_file_type = FAT_FILE;
40011998: 00400713 li a4,4
4001199c: 00e5a823 sw a4,16(a1)
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
400119a0: fff00713 li a4,-1
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
400119a4: 00f5ac23 sw a5,24(a1)
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
400119a8: 00e5aa23 sw a4,20(a1)
fat_fd->map.disk_cln = fat_fd->cln;
400119ac: 01c5a703 lw a4,28(a1)
fat_fd->map.file_cln = 0;
400119b0: 0205aa23 sw zero,52(a1)
fat_fd->map.disk_cln = fat_fd->cln;
400119b4: 02e5ac23 sw a4,56(a1)
if ((fat_fd->fat_file_size != 0) &&
400119b8: 00078a63 beqz a5,400119cc <msdos_find_name+0x1d8>
400119bc: 0089a683 lw a3,8(s3)
400119c0: 00f6e663 bltu a3,a5,400119cc <msdos_find_name+0x1d8>
fat_fd->map.last_cln = fat_fd->cln;
400119c4: 02e5ae23 sw a4,60(a1)
400119c8: f15ff06f j 400118dc <msdos_find_name+0xe8>
fat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
400119cc: fff00793 li a5,-1
400119d0: 02f5ae23 sw a5,60(a1)
400119d4: f09ff06f j 400118dc <msdos_find_name+0xe8>
fat_file_close(&fs_info->fat, fat_fd);
400119d8: 00c12583 lw a1,12(sp) <== NOT EXECUTED
400119dc: 00098513 mv a0,s3 <== NOT EXECUTED
400119e0: c7cfd0ef jal ra,4000ee5c <fat_file_close> <== NOT EXECUTED
return rc;
400119e4: f15ff06f j 400118f8 <msdos_find_name+0x104> <== NOT EXECUTED
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
400119e8: 002007b7 lui a5,0x200
fat_fd->fat_file_type = FAT_DIRECTORY;
400119ec: 0005a823 sw zero,16(a1)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
400119f0: 00f5aa23 sw a5,20(a1)
rc = fat_file_size(&fs_info->fat, fat_fd);
400119f4: 00098513 mv a0,s3
400119f8: acdfd0ef jal ra,4000f4c4 <fat_file_size>
fat_file_close(&fs_info->fat, fat_fd);
400119fc: 00c12583 lw a1,12(sp)
rc = fat_file_size(&fs_info->fat, fat_fd);
40011a00: 00050413 mv s0,a0
if (rc != RC_OK)
40011a04: fc051ce3 bnez a0,400119dc <msdos_find_name+0x1e8> <== NEVER TAKEN
if ((fat_fd->fat_file_size != 0) &&
40011a08: 0185a783 lw a5,24(a1)
40011a0c: fa1ff06f j 400119ac <msdos_find_name+0x1b8>
40010a38 <msdos_find_name_in_fat_file>:
const uint8_t *name_utf8,
int name_utf8_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry)
{
40010a38: ed010113 addi sp,sp,-304
40010a3c: 11312e23 sw s3,284(sp)
int retval = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
40010a40: 00852983 lw s3,8(a0)
{
40010a44: 12112623 sw ra,300(sp)
40010a48: 12812423 sw s0,296(sp)
ssize_t name_len_for_compare;
uint32_t bts2rd = 0;
uint32_t empty_file_offset = 0;
uint32_t empty_entry_count = 0;
unsigned int lfn_entries;
rtems_dosfs_convert_control *converter = fs_info->converter;
40010a4c: 0cc9a503 lw a0,204(s3)
{
40010a50: 12912223 sw s1,292(sp)
40010a54: 13212023 sw s2,288(sp)
void *buffer = converter->buffer.data;
40010a58: 00452303 lw t1,4(a0)
rtems_dosfs_convert_control *converter = fs_info->converter;
40010a5c: 02a12e23 sw a0,60(sp)
size_t buffer_size = converter->buffer.size;
40010a60: 00852503 lw a0,8(a0)
{
40010a64: 11412c23 sw s4,280(sp)
40010a68: 11512a23 sw s5,276(sp)
40010a6c: 11612823 sw s6,272(sp)
40010a70: 11712623 sw s7,268(sp)
40010a74: 11812423 sw s8,264(sp)
40010a78: 11912223 sw s9,260(sp)
40010a7c: 11a12023 sw s10,256(sp)
40010a80: 0fb12e23 sw s11,252(sp)
40010a84: 04e12223 sw a4,68(sp)
void *buffer = converter->buffer.data;
40010a88: 02612823 sw t1,48(sp)
size_t buffer_size = converter->buffer.size;
40010a8c: 04a12623 sw a0,76(sp)
{
40010a90: 02b12023 sw a1,32(sp)
40010a94: 04d12023 sw a3,64(sp)
40010a98: 02f12c23 sw a5,56(sp)
40010a9c: 03012a23 sw a6,52(sp)
40010aa0: 05112423 sw a7,72(sp)
assert(name_utf8_len > 0);
40010aa4: 7ee05a63 blez a4,40011298 <msdos_find_name_in_fat_file+0x860> <== NEVER TAKEN
dir_pos->sname.cln = 0;
40010aa8: 03412683 lw a3,52(sp)
fat_dir_pos_init(dir_pos);
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
40010aac: 02012783 lw a5,32(sp)
40010ab0: 00060d13 mv s10,a2
40010ab4: 0006a023 sw zero,0(a3)
40010ab8: 0207a703 lw a4,32(a5)
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40010abc: fff00793 li a5,-1
40010ac0: 00f6a423 sw a5,8(a3)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
40010ac4: 00f6a623 sw a5,12(a3)
dir_pos->sname.ofs = 0;
40010ac8: 0006a223 sw zero,4(a3)
40010acc: 00100793 li a5,1
40010ad0: 1af70863 beq a4,a5,40010c80 <msdos_find_name_in_fat_file+0x248>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
40010ad4: 0089ad83 lw s11,8(s3)
switch ( name_type ) {
40010ad8: 03812703 lw a4,56(sp)
40010adc: 00100793 li a5,1
40010ae0: 1cf70063 beq a4,a5,40010ca0 <msdos_find_name_in_fat_file+0x268>
40010ae4: 00200793 li a5,2
40010ae8: 04f70863 beq a4,a5,40010b38 <msdos_find_name_in_fat_file+0x100>
}
else
retval = -1;
break;
default:
errno = EINVAL;
40010aec: 46c0a0ef jal ra,4001af58 <__errno>
40010af0: 01600793 li a5,22
40010af4: 00f52023 sw a5,0(a0)
retval = -1;
40010af8: fff00513 li a0,-1
empty_entry_count
);
}
return retval;
}
40010afc: 12c12083 lw ra,300(sp)
40010b00: 12812403 lw s0,296(sp)
40010b04: 12412483 lw s1,292(sp)
40010b08: 12012903 lw s2,288(sp)
40010b0c: 11c12983 lw s3,284(sp)
40010b10: 11812a03 lw s4,280(sp)
40010b14: 11412a83 lw s5,276(sp)
40010b18: 11012b03 lw s6,272(sp)
40010b1c: 10c12b83 lw s7,268(sp)
40010b20: 10812c03 lw s8,264(sp)
40010b24: 10412c83 lw s9,260(sp)
40010b28: 10012d03 lw s10,256(sp)
40010b2c: 0fc12d83 lw s11,252(sp)
40010b30: 13010113 addi sp,sp,304
40010b34: 00008067 ret
name_len_for_save = msdos_filename_utf8_to_long_name_for_save (
40010b38: 04c12b03 lw s6,76(sp)
40010b3c: 03012a83 lw s5,48(sp)
40010b40: 04412a03 lw s4,68(sp)
40010b44: 04012903 lw s2,64(sp)
40010b48: 03c12483 lw s1,60(sp)
40010b4c: 000b0713 mv a4,s6
40010b50: 000a8693 mv a3,s5
40010b54: 000a0613 mv a2,s4
40010b58: 00090593 mv a1,s2
40010b5c: 00048513 mv a0,s1
40010b60: 575050ef jal ra,400168d4 <msdos_filename_utf8_to_long_name_for_save>
40010b64: 00050413 mv s0,a0
if (name_len_for_save > 0) {
40010b68: f8a058e3 blez a0,40010af8 <msdos_find_name_in_fat_file+0xc0>
name_len_for_compare = msdos_filename_utf8_to_long_name_for_compare (
40010b6c: 000b0713 mv a4,s6
40010b70: 000a8693 mv a3,s5
40010b74: 000a0613 mv a2,s4
40010b78: 00090593 mv a1,s2
40010b7c: 00048513 mv a0,s1
40010b80: 461050ef jal ra,400167e0 <msdos_filename_utf8_to_long_name_for_compare>
40010b84: 00050c93 mv s9,a0
if (0 >= name_len_for_compare) {
40010b88: f6a058e3 blez a0,40010af8 <msdos_find_name_in_fat_file+0xc0> <== NEVER TAKEN
lfn_entries = (name_len_for_save + MSDOS_LFN_ENTRY_SIZE - 1)
40010b8c: 01940413 addi s0,s0,25
/ MSDOS_LFN_ENTRY_SIZE;
40010b90: 01a00c13 li s8,26
40010b94: 038447b3 div a5,s0,s8
40010b98: 02f12223 sw a5,36(sp)
rtems_dosfs_convert_control *converter = fs_info->converter;
40010b9c: 0cc9a783 lw a5,204(s3)
40010ba0: 0c89a703 lw a4,200(s3)
*entry_matched = false;
40010ba4: 04010ba3 sb zero,87(sp)
rtems_dosfs_convert_control *converter = fs_info->converter;
40010ba8: 02f12623 sw a5,44(sp)
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010bac: fff00793 li a5,-1
40010bb0: 04f12e23 sw a5,92(sp)
}
40010bb4: 000c8b13 mv s6,s9
40010bb8: 00000a93 li s5,0
uint32_t empty_entry_count = 0;
40010bbc: 00000c13 li s8,0
uint32_t empty_file_offset = 0;
40010bc0: 00000493 li s1,0
uint32_t dir_offset = 0;
40010bc4: 00012e23 sw zero,28(sp)
int lfn_entry = 0;
40010bc8: 00000913 li s2,0
bool empty_space_found = false;
40010bcc: 00012c23 sw zero,24(sp)
uint8_t lfn_checksum = 0;
40010bd0: 02012423 sw zero,40(sp)
while ( (bytes_read = fat_file_read (&fs_info->fat, fat_fd, (dir_offset * bts2rd),
40010bd4: 02012583 lw a1,32(sp)
40010bd8: 000d8693 mv a3,s11
40010bdc: 000a8613 mv a2,s5
40010be0: 00098513 mv a0,s3
40010be4: f79fd0ef jal ra,4000eb5c <fat_file_read>
40010be8: 62050063 beqz a0,40011208 <msdos_find_name_in_fat_file+0x7d0>
if (bytes_read < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40010bec: 01f00713 li a4,31
40010bf0: 60a75263 bge a4,a0,400111f4 <msdos_find_name_in_fat_file+0x7bc>
assert(bytes_read == bts2rd);
40010bf4: 69b51263 bne a0,s11,40011278 <msdos_find_name_in_fat_file+0x840>
dir_entry < bts2rd && rc == RC_OK && (! filename_matched);
40010bf8: 0c89a703 lw a4,200(s3)
for (dir_entry = 0;
40010bfc: 060d8863 beqz s11,40010c6c <msdos_find_name_in_fat_file+0x234> <== NEVER TAKEN
40010c00: 00000413 li s0,0
else if (entry_empty)
40010c04: 0e500893 li a7,229
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
40010c08: 00f00393 li t2,15
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010c0c: fff00a13 li s4,-1
char* entry = (char*) fs_info->cl_buf + dir_entry;
40010c10: 00870bb3 add s7,a4,s0
bool entry_empty = (*MSDOS_DIR_ENTRY_TYPE(entry) ==
40010c14: 000bc683 lbu a3,0(s7)
if (*empty_entry_count == 0)
40010c18: 000c1463 bnez s8,40010c20 <msdos_find_name_in_fat_file+0x1e8>
*empty_file_offset = dir_offset * bts2rd + dir_entry;
40010c1c: 008a84b3 add s1,s5,s0
if (remainder_empty)
40010c20: 26068263 beqz a3,40010e84 <msdos_find_name_in_fat_file+0x44c>
else if (entry_empty)
40010c24: 0b168263 beq a3,a7,40010cc8 <msdos_find_name_in_fat_file+0x290>
if (create_node && !empty_space_found)
40010c28: 000d0a63 beqz s10,40010c3c <msdos_find_name_in_fat_file+0x204>
40010c2c: 01812783 lw a5,24(sp)
40010c30: 00079663 bnez a5,40010c3c <msdos_find_name_in_fat_file+0x204> <== NEVER TAKEN
*empty_entry_count = 0;
40010c34: 00000c13 li s8,0
*empty_file_offset = 0;
40010c38: 00000493 li s1,0
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
40010c3c: 00bbc603 lbu a2,11(s7)
40010c40: 03f67593 andi a1,a2,63
40010c44: 08758e63 beq a1,t2,40010ce0 <msdos_find_name_in_fat_file+0x2a8>
if (entry_matched)
40010c48: 05714583 lbu a1,87(sp)
40010c4c: 0a058a63 beqz a1,40010d00 <msdos_find_name_in_fat_file+0x2c8>
if (lfn_entry ||
40010c50: 00091463 bnez s2,40010c58 <msdos_find_name_in_fat_file+0x220> <== NEVER TAKEN
40010c54: 240b0863 beqz s6,40010ea4 <msdos_find_name_in_fat_file+0x46c>
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010c58: 05412e23 sw s4,92(sp)
*entry_matched = false;
40010c5c: 04010ba3 sb zero,87(sp)
}
40010c60: 000c8b13 mv s6,s9
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40010c64: 02040413 addi s0,s0,32
for (dir_entry = 0;
40010c68: fbb464e3 bltu s0,s11,40010c10 <msdos_find_name_in_fat_file+0x1d8>
dir_offset++;
40010c6c: 01c12783 lw a5,28(sp)
40010c70: 01ba8ab3 add s5,s5,s11
40010c74: 00178793 addi a5,a5,1
40010c78: 00f12e23 sw a5,28(sp)
40010c7c: f59ff06f j 40010bd4 <msdos_find_name_in_fat_file+0x19c>
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
40010c80: 02012703 lw a4,32(sp)
40010c84: 02472783 lw a5,36(a4)
40010c88: e40796e3 bnez a5,40010ad4 <msdos_find_name_in_fat_file+0x9c> <== NEVER TAKEN
40010c8c: 0169c783 lbu a5,22(s3)
40010c90: 0037f793 andi a5,a5,3
40010c94: e40780e3 beqz a5,40010ad4 <msdos_find_name_in_fat_file+0x9c>
bts2rd = fat_fd->fat_file_size;
40010c98: 01872d83 lw s11,24(a4)
40010c9c: e3dff06f j 40010ad8 <msdos_find_name_in_fat_file+0xa0>
name_len_for_compare = msdos_filename_utf8_to_short_name_for_compare (
40010ca0: 03012683 lw a3,48(sp)
40010ca4: 04412603 lw a2,68(sp)
40010ca8: 04012583 lw a1,64(sp)
40010cac: 03c12503 lw a0,60(sp)
40010cb0: 00b00713 li a4,11
40010cb4: 5e1050ef jal ra,40016a94 <msdos_filename_utf8_to_short_name_for_compare>
lfn_entries = 0;
40010cb8: 02012223 sw zero,36(sp)
name_len_for_compare = msdos_filename_utf8_to_short_name_for_compare (
40010cbc: 00050c93 mv s9,a0
if (name_len_for_compare > 0) {
40010cc0: eca04ee3 bgtz a0,40010b9c <msdos_find_name_in_fat_file+0x164> <== ALWAYS TAKEN
40010cc4: e35ff06f j 40010af8 <msdos_find_name_in_fat_file+0xc0> <== NOT EXECUTED
if (create_node)
40010cc8: f80d08e3 beqz s10,40010c58 <msdos_find_name_in_fat_file+0x220>
if (*empty_entry_count == (lfn_entries + 1))
40010ccc: 02412683 lw a3,36(sp)
(*empty_entry_count)++;
40010cd0: 001c0793 addi a5,s8,1
if (*empty_entry_count == (lfn_entries + 1))
40010cd4: 1b868263 beq a3,s8,40010e78 <msdos_find_name_in_fat_file+0x440>
(*empty_entry_count)++;
40010cd8: 00078c13 mv s8,a5
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010cdc: f7dff06f j 40010c58 <msdos_find_name_in_fat_file+0x220>
(lfn_start.cln == FAT_FILE_SHORT_NAME);
40010ce0: 05c12603 lw a2,92(sp)
if (is_first_lfn_entry)
40010ce4: 0d460063 beq a2,s4,40010da4 <msdos_find_name_in_fat_file+0x36c>
if ((lfn_entry != (*MSDOS_DIR_ENTRY_TYPE(entry) &
40010ce8: 03f6f693 andi a3,a3,63
40010cec: f72696e3 bne a3,s2,40010c58 <msdos_find_name_in_fat_file+0x220>
MSDOS_LAST_LONG_ENTRY_MASK)) ||
40010cf0: 00dbc683 lbu a3,13(s7)
40010cf4: 02812783 lw a5,40(sp)
40010cf8: f6f690e3 bne a3,a5,40010c58 <msdos_find_name_in_fat_file+0x220>
40010cfc: 0d40006f j 40010dd0 <msdos_find_name_in_fat_file+0x398>
} else if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_VOLUME_ID)
40010d00: 00867613 andi a2,a2,8
40010d04: f60610e3 bnez a2,40010c64 <msdos_find_name_in_fat_file+0x22c>
size_t bytes_converted = buf_size;
40010d08: 00c00793 li a5,12
ssize_t bytes_written = msdos_format_dirent_with_dot(char_buf, entry);
40010d0c: 000b8593 mv a1,s7
40010d10: 06410513 addi a0,sp,100
size_t bytes_converted = buf_size;
40010d14: 04f12c23 sw a5,88(sp)
ssize_t bytes_written = msdos_format_dirent_with_dot(char_buf, entry);
40010d18: bcdff0ef jal ra,400108e4 <msdos_format_dirent_with_dot>
40010d1c: 00050613 mv a2,a0
if (bytes_written > 0) {
40010d20: 54a05863 blez a0,40011270 <msdos_find_name_in_fat_file+0x838> <== NEVER TAKEN
if (char_buf[0] == 0x05)
40010d24: 06414703 lbu a4,100(sp)
40010d28: 00500793 li a5,5
40010d2c: 00f71663 bne a4,a5,40010d38 <msdos_find_name_in_fat_file+0x300>
char_buf[0] = 0xE5;
40010d30: fe500793 li a5,-27 <== NOT EXECUTED
40010d34: 06f10223 sb a5,100(sp) <== NOT EXECUTED
eno = (*converter->handler->codepage_to_utf8) (
40010d38: 02c12503 lw a0,44(sp)
40010d3c: 05810713 addi a4,sp,88
40010d40: 08010693 addi a3,sp,128
40010d44: 00052783 lw a5,0(a0)
40010d48: 06410593 addi a1,sp,100
40010d4c: 0047a783 lw a5,4(a5)
40010d50: 000780e7 jalr a5
40010d54: 00050b13 mv s6,a0
if (eno == 0)
40010d58: 0e500893 li a7,229
40010d5c: 00f00393 li t2,15
40010d60: 10050463 beqz a0,40010e68 <msdos_find_name_in_fat_file+0x430> <== ALWAYS TAKEN
errno = eno;
40010d64: 1f40a0ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40010d68: 01652023 sw s6,0(a0) <== NOT EXECUTED
bytes_in_entry = msdos_short_entry_to_utf8_name (
40010d6c: fff00613 li a2,-1 <== NOT EXECUTED
name_len_remaining = msdos_compare_entry_against_filename (
40010d70: 03012683 lw a3,48(sp)
40010d74: 02c12503 lw a0,44(sp)
40010d78: 05710793 addi a5,sp,87
40010d7c: 000c8713 mv a4,s9
40010d80: 08010593 addi a1,sp,128
40010d84: fe9fe0ef jal ra,4000fd6c <msdos_compare_entry_against_filename>
if (entry_matched && name_len_remaining == 0) {
40010d88: 05714783 lbu a5,87(sp)
40010d8c: 0e500893 li a7,229
40010d90: 00f00393 li t2,15
40010d94: 00078463 beqz a5,40010d9c <msdos_find_name_in_fat_file+0x364>
40010d98: 14050263 beqz a0,40010edc <msdos_find_name_in_fat_file+0x4a4>
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010d9c: 0c89a703 lw a4,200(s3)
40010da0: eb9ff06f j 40010c58 <msdos_find_name_in_fat_file+0x220>
entry_matched = false;
40010da4: 04010ba3 sb zero,87(sp)
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
40010da8: 000bc683 lbu a3,0(s7)
40010dac: 0406f693 andi a3,a3,64
40010db0: ea068ae3 beqz a3,40010c64 <msdos_find_name_in_fat_file+0x22c>
lfn_start.cln = dir_offset;
40010db4: 01c12783 lw a5,28(sp)
lfn_start.ofs = dir_entry;
40010db8: 06812023 sw s0,96(sp)
lfn_start.cln = dir_offset;
40010dbc: 04f12e23 sw a5,92(sp)
lfn_entry = (*MSDOS_DIR_ENTRY_TYPE(entry)
40010dc0: 000bc903 lbu s2,0(s7)
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
40010dc4: 00dbc783 lbu a5,13(s7)
lfn_entry = (*MSDOS_DIR_ENTRY_TYPE(entry)
40010dc8: 03f97913 andi s2,s2,63
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
40010dcc: 02f12423 sw a5,40(sp)
bool is_first_lfn_entry =
40010dd0: 00160613 addi a2,a2,1
40010dd4: 00163613 seqz a2,a2
size_t bytes_in_utf8 = buf_size;
40010dd8: 07000713 li a4,112
40010ddc: 06410593 addi a1,sp,100
40010de0: 000b8513 mv a0,s7
40010de4: 04e12c23 sw a4,88(sp)
40010de8: 954ff0ef jal ra,4000ff3c <msdos_get_utf16_string_from_long_entry.part.0>
40010dec: 00050613 mv a2,a0
lfn_entry--;
40010df0: fff90913 addi s2,s2,-1
if (retval >= 0) {
40010df4: 02054e63 bltz a0,40010e30 <msdos_find_name_in_fat_file+0x3f8> <== NEVER TAKEN
eno = (*converter->handler->utf16_to_utf8) (
40010df8: 02c12503 lw a0,44(sp)
40010dfc: 05810713 addi a4,sp,88
40010e00: 08010693 addi a3,sp,128
40010e04: 00052583 lw a1,0(a0)
40010e08: 00c5a303 lw t1,12(a1)
40010e0c: 06410593 addi a1,sp,100
40010e10: 000300e7 jalr t1
40010e14: 00050b93 mv s7,a0
if ( eno == 0 ) {
40010e18: 0e500893 li a7,229
40010e1c: 00f00393 li t2,15
40010e20: 06050a63 beqz a0,40010e94 <msdos_find_name_in_fat_file+0x45c>
errno = eno;
40010e24: 1340a0ef jal ra,4001af58 <__errno>
40010e28: 01752023 sw s7,0(a0)
bytes_in_entry = msdos_long_entry_to_utf8_name (
40010e2c: fff00613 li a2,-1
name_len_remaining = msdos_compare_entry_against_filename (
40010e30: 03012683 lw a3,48(sp)
40010e34: 02c12503 lw a0,44(sp)
40010e38: 000b0713 mv a4,s6
40010e3c: 05710793 addi a5,sp,87
40010e40: 08010593 addi a1,sp,128
40010e44: f29fe0ef jal ra,4000fd6c <msdos_compare_entry_against_filename>
40010e48: 00050b13 mv s6,a0
if (name_len_remaining < 0 || !entry_matched) {
40010e4c: 0e500893 li a7,229
40010e50: 00f00393 li t2,15
40010e54: f40544e3 bltz a0,40010d9c <msdos_find_name_in_fat_file+0x364> <== NEVER TAKEN
40010e58: 05714703 lbu a4,87(sp)
40010e5c: f40700e3 beqz a4,40010d9c <msdos_find_name_in_fat_file+0x364>
40010e60: 0c89a703 lw a4,200(s3)
40010e64: e01ff06f j 40010c64 <msdos_find_name_in_fat_file+0x22c>
bytes_written = bytes_converted;
40010e68: 05812603 lw a2,88(sp)
if (bytes_in_entry > 0) {
40010e6c: f00612e3 bnez a2,40010d70 <msdos_find_name_in_fat_file+0x338> <== ALWAYS TAKEN
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010e70: 0c89a703 lw a4,200(s3) <== NOT EXECUTED
40010e74: de5ff06f j 40010c58 <msdos_find_name_in_fat_file+0x220> <== NOT EXECUTED
(*empty_entry_count)++;
40010e78: 00078c13 mv s8,a5
empty_space_found = true;
40010e7c: 01a12c23 sw s10,24(sp)
40010e80: dd9ff06f j 40010c58 <msdos_find_name_in_fat_file+0x220>
if (!create_node)
40010e84: 080d1a63 bnez s10,40010f18 <msdos_find_name_in_fat_file+0x4e0>
rc = MSDOS_NAME_NOT_FOUND_ERR;
40010e88: 00008537 lui a0,0x8
40010e8c: d0150513 addi a0,a0,-767 # 7d01 <bsp_section_rodata_size+0x5575>
40010e90: c6dff06f j 40010afc <msdos_find_name_in_fat_file+0xc4>
retval = bytes_in_utf8;
40010e94: 05812603 lw a2,88(sp)
if (bytes_in_entry > 0) {
40010e98: f8061ce3 bnez a2,40010e30 <msdos_find_name_in_fat_file+0x3f8> <== ALWAYS TAKEN
lfn_start->cln = FAT_FILE_SHORT_NAME;
40010e9c: 0c89a703 lw a4,200(s3) <== NOT EXECUTED
40010ea0: db9ff06f j 40010c58 <msdos_find_name_in_fat_file+0x220> <== NOT EXECUTED
40010ea4: 001b8613 addi a2,s7,1
40010ea8: 00bb8593 addi a1,s7,11
cs = 0;
40010eac: 00000513 li a0,0
40010eb0: 00c0006f j 40010ebc <msdos_find_name_in_fat_file+0x484>
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
40010eb4: 00064683 lbu a3,0(a2)
40010eb8: 00160613 addi a2,a2,1
40010ebc: 00751793 slli a5,a0,0x7
40010ec0: 00155513 srli a0,a0,0x1
40010ec4: 00a787b3 add a5,a5,a0
40010ec8: 00d786b3 add a3,a5,a3
40010ecc: 0ff6f513 andi a0,a3,255
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
40010ed0: fec592e3 bne a1,a2,40010eb4 <msdos_find_name_in_fat_file+0x47c>
name_len_remaining > 0 ||
40010ed4: 02812783 lw a5,40(sp)
40010ed8: d8f510e3 bne a0,a5,40010c58 <msdos_find_name_in_fat_file+0x220>
rc = msdos_on_entry_found (
40010edc: 05c10793 addi a5,sp,92
40010ee0: 00f12023 sw a5,0(sp)
40010ee4: 01c12803 lw a6,28(sp)
40010ee8: 03412783 lw a5,52(sp)
40010eec: 04812683 lw a3,72(sp)
40010ef0: 02012583 lw a1,32(sp)
40010ef4: 00040893 mv a7,s0
40010ef8: 000b8713 mv a4,s7
40010efc: 000d8613 mv a2,s11
40010f00: 00098513 mv a0,s3
40010f04: f49fe0ef jal ra,4000fe4c <msdos_on_entry_found>
dir_entry < bts2rd && rc == RC_OK && (! filename_matched);
40010f08: be051ae3 bnez a0,40010afc <msdos_find_name_in_fat_file+0xc4> <== NEVER TAKEN
&& create_node) {
40010f0c: 020d1263 bnez s10,40010f30 <msdos_find_name_in_fat_file+0x4f8> <== NEVER TAKEN
rc = MSDOS_NAME_NOT_FOUND_ERR;
40010f10: 00000513 li a0,0
40010f14: be9ff06f j 40010afc <msdos_find_name_in_fat_file+0xc4>
if ( !empty_space_found
40010f18: 01812783 lw a5,24(sp)
40010f1c: 00079a63 bnez a5,40010f30 <msdos_find_name_in_fat_file+0x4f8>
uint32_t entries_per_block = bts2rd / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
40010f20: 005dd793 srli a5,s11,0x5
*empty_entry_count +=
40010f24: 01878e33 add t3,a5,s8
entries_per_block - (dir_entry / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
40010f28: 00545413 srli s0,s0,0x5
*empty_entry_count +=
40010f2c: 408e0c33 sub s8,t3,s0
switch (name_type) {
40010f30: 03812703 lw a4,56(sp)
40010f34: 00100793 li a5,1
40010f38: 22f70463 beq a4,a5,40011160 <msdos_find_name_in_fat_file+0x728>
40010f3c: 00200793 li a5,2
40010f40: baf716e3 bne a4,a5,40010aec <msdos_find_name_in_fat_file+0xb4>
name_len_for_save = msdos_filename_utf8_to_long_name_for_save (
40010f44: 04c12703 lw a4,76(sp)
40010f48: 03012683 lw a3,48(sp)
40010f4c: 04412603 lw a2,68(sp)
40010f50: 04012583 lw a1,64(sp)
40010f54: 03c12503 lw a0,60(sp)
40010f58: 17d050ef jal ra,400168d4 <msdos_filename_utf8_to_long_name_for_save>
if (name_len_for_save > 0) {
40010f5c: b8a05ee3 blez a0,40010af8 <msdos_find_name_in_fat_file+0xc0> <== NEVER TAKEN
lfn_entries = (name_len_for_save + MSDOS_LFN_ENTRY_SIZE - 1)
40010f60: 01950913 addi s2,a0,25
/ MSDOS_LFN_ENTRY_SIZE;
40010f64: 01a00793 li a5,26
40010f68: 02f94933 div s2,s2,a5
if (empty_entry_count < lfn_entries + 1)
40010f6c: 00190a93 addi s5,s2,1
40010f70: 035c7863 bgeu s8,s5,40010fa0 <msdos_find_name_in_fat_file+0x568>
empty_file_offset = fat_fd->fat_file_size -
40010f74: 02012583 lw a1,32(sp)
ret = fat_file_extend(&fs_info->fat,
40010f78: 0089a683 lw a3,8(s3)
40010f7c: 08010713 addi a4,sp,128
empty_file_offset = fat_fd->fat_file_size -
40010f80: 0185a483 lw s1,24(a1)
ret = fat_file_extend(&fs_info->fat,
40010f84: 00100613 li a2,1
40010f88: 00098513 mv a0,s3
40010f8c: 00d486b3 add a3,s1,a3
40010f90: 878fe0ef jal ra,4000f008 <fat_file_extend>
if (ret != RC_OK)
40010f94: b60514e3 bnez a0,40010afc <msdos_find_name_in_fat_file+0xc4> <== NEVER TAKEN
empty_entry_count * MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
40010f98: 005c1e13 slli t3,s8,0x5
empty_file_offset = fat_fd->fat_file_size -
40010f9c: 41c484b3 sub s1,s1,t3
if ((*c == ' ') || (*c == '.'))
40010fa0: 04812783 lw a5,72(sp)
slot = (empty_file_offset /
40010fa4: 0054d613 srli a2,s1,0x5
if ((*c == ' ') || (*c == '.'))
40010fa8: 02000713 li a4,32
40010fac: 0007c783 lbu a5,0(a5)
slot = (empty_file_offset /
40010fb0: 01560633 add a2,a2,s5
if ((*c == ' ') || (*c == '.'))
40010fb4: 2ae78663 beq a5,a4,40011260 <msdos_find_name_in_fat_file+0x828>
40010fb8: 02e00713 li a4,46
40010fbc: 2ae78263 beq a5,a4,40011260 <msdos_find_name_in_fat_file+0x828>
40010fc0: 04812783 lw a5,72(sp)
40010fc4: 02000713 li a4,32
40010fc8: 0017c783 lbu a5,1(a5)
40010fcc: 28e78263 beq a5,a4,40011250 <msdos_find_name_in_fat_file+0x818>
40010fd0: 02e00713 li a4,46
40010fd4: 26e78e63 beq a5,a4,40011250 <msdos_find_name_in_fat_file+0x818>
for (i = 0; i < 2; i++, c++)
40010fd8: 04812783 lw a5,72(sp)
40010fdc: 400265b7 lui a1,0x40026
40010fe0: 00c00713 li a4,12
40010fe4: 00278693 addi a3,a5,2
for (i = 0; i < 4; i++, c++)
40010fe8: eec58593 addi a1,a1,-276 # 40025eec <msdos_file_handlers+0xec>
40010fec: ffc00513 li a0,-4
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
40010ff0: 00e657b3 srl a5,a2,a4
40010ff4: 00f7f793 andi a5,a5,15
40010ff8: 00f587b3 add a5,a1,a5
40010ffc: 0007c783 lbu a5,0(a5)
for (i = 0; i < 4; i++, c++)
40011000: ffc70713 addi a4,a4,-4
40011004: 00168693 addi a3,a3,1
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
40011008: fef68fa3 sb a5,-1(a3)
for (i = 0; i < 4; i++, c++)
4001100c: fea712e3 bne a4,a0,40010ff0 <msdos_find_name_in_fat_file+0x5b8>
*c++ = '~';
40011010: 04812703 lw a4,72(sp)
40011014: 07e00793 li a5,126
cs = 0;
40011018: 00000413 li s0,0
*c++ = '~';
4001101c: 00f70323 sb a5,6(a4)
*c = '1';
40011020: 03100793 li a5,49
40011024: 00f703a3 sb a5,7(a4)
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
40011028: 00b70593 addi a1,a4,11
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
4001102c: 00074603 lbu a2,0(a4)
40011030: 00145793 srli a5,s0,0x1
40011034: 00741693 slli a3,s0,0x7
40011038: 00c78433 add s0,a5,a2
4001103c: 00d40433 add s0,s0,a3
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
40011040: 00170713 addi a4,a4,1
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
40011044: 0ff47413 andi s0,s0,255
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
40011048: fee592e3 bne a1,a4,4001102c <msdos_find_name_in_fat_file+0x5f4>
pos->ofs = file_offset & (bts2rd - 1);
4001104c: 03412b03 lw s6,52(sp)
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
40011050: 02012b83 lw s7,32(sp)
pos->ofs = file_offset & (bts2rd - 1);
40011054: fffd8d93 addi s11,s11,-1
40011058: 009df7b3 and a5,s11,s1
4001105c: 00fb2623 sw a5,12(s6)
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
40011060: 008b0713 addi a4,s6,8
40011064: 00048693 mv a3,s1
40011068: 00100613 li a2,1
4001106c: 000b8593 mv a1,s7
40011070: 00098513 mv a0,s3
40011074: ec1fd0ef jal ra,4000ef34 <fat_file_ioctl>
if (ret != RC_OK)
40011078: a80512e3 bnez a0,40010afc <msdos_find_name_in_fat_file+0xc4> <== NEVER TAKEN
* MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
4001107c: 00591a13 slli s4,s2,0x5
short_file_offset = empty_file_offset + lfn_entries
40011080: 009a06b3 add a3,s4,s1
pos->ofs = file_offset & (bts2rd - 1);
40011084: 01b6f7b3 and a5,a3,s11
40011088: 00fb2223 sw a5,4(s6)
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
4001108c: 000b0713 mv a4,s6
40011090: 000b8593 mv a1,s7
40011094: 00100613 li a2,1
40011098: 00098513 mv a0,s3
4001109c: e99fd0ef jal ra,4000ef34 <fat_file_ioctl>
400110a0: 01a00793 li a5,26
400110a4: 02f907b3 mul a5,s2,a5
entry = fs_info->cl_buf;
400110a8: 0c89a803 lw a6,200(s3)
400110ac: 03012703 lw a4,48(sp)
length = (lfn_entries + 1) * MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
400110b0: 005a9a93 slli s5,s5,0x5
if (bytes_written == (ssize_t) length)
400110b4: 000a8b13 mv s6,s5
*MSDOS_DIR_ENTRY_TYPE(entry) = lfn_entries - lfn_entry;
400110b8: 0ff97913 andi s2,s2,255
400110bc: 01480a33 add s4,a6,s4
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
400110c0: 00000b93 li s7,0
switch (i)
400110c4: 00400c93 li s9,4
400110c8: 00a00c13 li s8,10
400110cc: fe678793 addi a5,a5,-26
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
400110d0: 00d00d13 li s10,13
400110d4: 00f70db3 add s11,a4,a5
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
400110d8: 02000613 li a2,32
400110dc: 00080513 mv a0,a6
400110e0: 00000593 li a1,0
400110e4: 08d0a0ef jal ra,4001b970 <memset>
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
400110e8: 008506a3 sb s0,13(a0)
n = (const uint8_t *) name_converted +
400110ec: 000d8693 mv a3,s11
if (*n != 0 || *(n + 1) != 0)
400110f0: 0006c603 lbu a2,0(a3)
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
400110f4: 00050813 mv a6,a0
p = entry + 1;
400110f8: 00150793 addi a5,a0,1
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
400110fc: 00000713 li a4,0
uint8_t fill = 0;
40011100: 00000513 li a0,0
if (*n != 0 || *(n + 1) != 0)
40011104: 02061c63 bnez a2,4001113c <msdos_find_name_in_fat_file+0x704> <== ALWAYS TAKEN
40011108: 0016c583 lbu a1,1(a3)
4001110c: 02059863 bnez a1,4001113c <msdos_find_name_in_fat_file+0x704>
p [0] = fill;
40011110: 00a78023 sb a0,0(a5)
p [1] = fill;
40011114: 00a780a3 sb a0,1(a5)
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
40011118: 00170613 addi a2,a4,1
fill = 0xff;
4001111c: 0ff00513 li a0,255
switch (i)
40011120: 03970a63 beq a4,s9,40011154 <msdos_find_name_in_fat_file+0x71c>
40011124: 13870063 beq a4,s8,40011244 <msdos_find_name_in_fat_file+0x80c>
p += 2;
40011128: 00278793 addi a5,a5,2
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
4001112c: 0fa60263 beq a2,s10,40011210 <msdos_find_name_in_fat_file+0x7d8>
40011130: 00060713 mv a4,a2
if (*n != 0 || *(n + 1) != 0)
40011134: 0006c603 lbu a2,0(a3)
40011138: fc0608e3 beqz a2,40011108 <msdos_find_name_in_fat_file+0x6d0>
*p = *n;
4001113c: 00c78023 sb a2,0(a5)
*(p + 1) = *(n + 1);
40011140: 0016c603 lbu a2,1(a3)
n += MSDOS_NAME_LFN_BYTES_PER_CHAR;
40011144: 00268693 addi a3,a3,2
*(p + 1) = *(n + 1);
40011148: 00c780a3 sb a2,1(a5)
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
4001114c: 00170613 addi a2,a4,1
switch (i)
40011150: fd971ae3 bne a4,s9,40011124 <msdos_find_name_in_fat_file+0x6ec>
p += 5;
40011154: 00578793 addi a5,a5,5
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
40011158: 00060713 mv a4,a2
4001115c: fd9ff06f j 40011134 <msdos_find_name_in_fat_file+0x6fc>
name_len_for_save = msdos_filename_utf8_to_short_name_for_save (
40011160: 03012683 lw a3,48(sp)
40011164: 04412603 lw a2,68(sp)
40011168: 04012583 lw a1,64(sp)
4001116c: 03c12503 lw a0,60(sp)
40011170: 00b00713 li a4,11
40011174: 255050ef jal ra,40016bc8 <msdos_filename_utf8_to_short_name_for_save>
if (name_len_for_save > 0 ) {
40011178: 98a050e3 blez a0,40010af8 <msdos_find_name_in_fat_file+0xc0> <== NEVER TAKEN
if (empty_entry_count < lfn_entries + 1)
4001117c: 120c0e63 beqz s8,400112b8 <msdos_find_name_in_fat_file+0x880>
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40011180: 03412683 lw a3,52(sp)
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
40011184: 02012583 lw a1,32(sp)
pos->ofs = file_offset & (bts2rd - 1);
40011188: fffd8793 addi a5,s11,-1
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
4001118c: fff00713 li a4,-1
pos->ofs = file_offset & (bts2rd - 1);
40011190: 0097f7b3 and a5,a5,s1
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40011194: 00e6a423 sw a4,8(a3)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
40011198: 00e6a623 sw a4,12(a3)
pos->ofs = file_offset & (bts2rd - 1);
4001119c: 00f6a223 sw a5,4(a3)
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
400111a0: 00068713 mv a4,a3
400111a4: 00100613 li a2,1
400111a8: 00048693 mv a3,s1
400111ac: 00098513 mv a0,s3
400111b0: d85fd0ef jal ra,4000ef34 <fat_file_ioctl>
entry = fs_info->cl_buf;
400111b4: 0c89aa03 lw s4,200(s3)
400111b8: 02000a93 li s5,32
400111bc: 02000b13 li s6,32
memcpy(entry, name_dir_entry, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
400111c0: 04812583 lw a1,72(sp)
400111c4: 02000613 li a2,32
400111c8: 000a0513 mv a0,s4
400111cc: 67c0a0ef jal ra,4001b848 <memcpy>
bytes_written = fat_file_write(&fs_info->fat, fat_fd,
400111d0: 0c89a703 lw a4,200(s3)
400111d4: 02012583 lw a1,32(sp)
400111d8: 000a8693 mv a3,s5
400111dc: 00048613 mv a2,s1
400111e0: 00098513 mv a0,s3
400111e4: 88cfe0ef jal ra,4000f270 <fat_file_write>
if (bytes_written == (ssize_t) length)
400111e8: d36504e3 beq a0,s6,40010f10 <msdos_find_name_in_fat_file+0x4d8>
else if (bytes_written == -1)
400111ec: fff00793 li a5,-1 <== NOT EXECUTED
400111f0: 90f504e3 beq a0,a5,40010af8 <msdos_find_name_in_fat_file+0xc0> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
400111f4: 565090ef jal ra,4001af58 <__errno> <== NOT EXECUTED
400111f8: 00500793 li a5,5 <== NOT EXECUTED
400111fc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40011200: fff00513 li a0,-1 <== NOT EXECUTED
return retval;
40011204: 8f9ff06f j 40010afc <msdos_find_name_in_fat_file+0xc4> <== NOT EXECUTED
if (!create_node)
40011208: d20d14e3 bnez s10,40010f30 <msdos_find_name_in_fat_file+0x4f8>
4001120c: c7dff06f j 40010e88 <msdos_find_name_in_fat_file+0x450>
*MSDOS_DIR_ENTRY_TYPE(entry) = lfn_entries - lfn_entry;
40011210: 417907b3 sub a5,s2,s7
40011214: 0ff7f793 andi a5,a5,255
if (lfn_entry == 0)
40011218: 000b9463 bnez s7,40011220 <msdos_find_name_in_fat_file+0x7e8>
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
4001121c: 0407e793 ori a5,a5,64
40011220: 00f80023 sb a5,0(a6)
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
40011224: 00b84783 lbu a5,11(a6)
entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
40011228: 02080813 addi a6,a6,32
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
4001122c: 001b8b93 addi s7,s7,1
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
40011230: 00f7e793 ori a5,a5,15
40011234: fef805a3 sb a5,-21(a6)
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
40011238: fe6d8d93 addi s11,s11,-26
4001123c: e90a1ee3 bne s4,a6,400110d8 <msdos_find_name_in_fat_file+0x6a0>
40011240: f81ff06f j 400111c0 <msdos_find_name_in_fat_file+0x788>
p += 4;
40011244: 00478793 addi a5,a5,4
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
40011248: 00060713 mv a4,a2
4001124c: ee9ff06f j 40011134 <msdos_find_name_in_fat_file+0x6fc>
*c = '_';
40011250: 04812703 lw a4,72(sp)
40011254: 05f00793 li a5,95
40011258: 00f700a3 sb a5,1(a4)
4001125c: d7dff06f j 40010fd8 <msdos_find_name_in_fat_file+0x5a0>
40011260: 04812703 lw a4,72(sp) <== NOT EXECUTED
40011264: 05f00793 li a5,95 <== NOT EXECUTED
40011268: 00f70023 sb a5,0(a4) <== NOT EXECUTED
4001126c: d55ff06f j 40010fc0 <msdos_find_name_in_fat_file+0x588> <== NOT EXECUTED
eno = EINVAL;
40011270: 01600b13 li s6,22 <== NOT EXECUTED
40011274: af1ff06f j 40010d64 <msdos_find_name_in_fat_file+0x32c> <== NOT EXECUTED
assert(bytes_read == bts2rd);
40011278: 400266b7 lui a3,0x40026 <== NOT EXECUTED
4001127c: 40026637 lui a2,0x40026 <== NOT EXECUTED
40011280: 40026537 lui a0,0x40026 <== NOT EXECUTED
40011284: ed468693 addi a3,a3,-300 # 40025ed4 <msdos_file_handlers+0xd4> <== NOT EXECUTED
40011288: f3c60613 addi a2,a2,-196 # 40025f3c <__func__.2> <== NOT EXECUTED
4001128c: 54d00593 li a1,1357 <== NOT EXECUTED
40011290: e7850513 addi a0,a0,-392 # 40025e78 <msdos_file_handlers+0x78> <== NOT EXECUTED
40011294: 6f9040ef jal ra,4001618c <__assert_func> <== NOT EXECUTED
assert(name_utf8_len > 0);
40011298: 400266b7 lui a3,0x40026 <== NOT EXECUTED
4001129c: 40026637 lui a2,0x40026 <== NOT EXECUTED
400112a0: 40026537 lui a0,0x40026 <== NOT EXECUTED
400112a4: ec068693 addi a3,a3,-320 # 40025ec0 <msdos_file_handlers+0xc0> <== NOT EXECUTED
400112a8: f5c60613 addi a2,a2,-164 # 40025f5c <__func__.3> <== NOT EXECUTED
400112ac: 74600593 li a1,1862 <== NOT EXECUTED
400112b0: e7850513 addi a0,a0,-392 # 40025e78 <msdos_file_handlers+0x78> <== NOT EXECUTED
400112b4: 6d9040ef jal ra,4001618c <__assert_func> <== NOT EXECUTED
empty_file_offset = fat_fd->fat_file_size -
400112b8: 02012583 lw a1,32(sp)
ret = fat_file_extend(&fs_info->fat,
400112bc: 0089a683 lw a3,8(s3)
400112c0: 08010713 addi a4,sp,128
empty_file_offset = fat_fd->fat_file_size -
400112c4: 0185a483 lw s1,24(a1)
ret = fat_file_extend(&fs_info->fat,
400112c8: 00100613 li a2,1
400112cc: 00098513 mv a0,s3
400112d0: 00d486b3 add a3,s1,a3
400112d4: d35fd0ef jal ra,4000f008 <fat_file_extend>
if (ret != RC_OK)
400112d8: ea0504e3 beqz a0,40011180 <msdos_find_name_in_fat_file+0x748> <== NEVER TAKEN
400112dc: 821ff06f j 40010afc <msdos_find_name_in_fat_file+0xc4>
400112e0 <msdos_find_node_by_cluster_num_in_fat_file>:
fat_file_fd_t *fat_fd,
uint32_t cl4find,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
400112e0: fd010113 addi sp,sp,-48
400112e4: 01912223 sw s9,4(sp)
400112e8: 00058c93 mv s9,a1
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
400112ec: 0205a583 lw a1,32(a1)
{
400112f0: 01412c23 sw s4,24(sp)
400112f4: 01512a23 sw s5,20(sp)
400112f8: 01712623 sw s7,12(sp)
400112fc: 01812423 sw s8,8(sp)
40011300: 02112623 sw ra,44(sp)
40011304: 02812423 sw s0,40(sp)
40011308: 02912223 sw s1,36(sp)
4001130c: 03212023 sw s2,32(sp)
40011310: 01312e23 sw s3,28(sp)
40011314: 01612823 sw s6,16(sp)
40011318: 01a12023 sw s10,0(sp)
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
4001131c: 00100793 li a5,1
msdos_fs_info_t *fs_info = mt_entry->fs_info;
40011320: 00852c03 lw s8,8(a0)
{
40011324: 00060b93 mv s7,a2
40011328: 00068a13 mv s4,a3
4001132c: 00070a93 mv s5,a4
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
40011330: 0af58e63 beq a1,a5,400113ec <msdos_find_node_by_cluster_num_in_fat_file+0x10c>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
40011334: 008c2903 lw s2,8(s8)
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * bts2rd, bts2rd,
40011338: 0c8c2703 lw a4,200(s8)
4001133c: 00000d13 li s10,0
fs_info->cl_buf)) != FAT_EOF)
{
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
40011340: 01f00b13 li s6,31
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
return MSDOS_NAME_NOT_FOUND_ERR;
/* if this entry is empty - skip it */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
40011344: 0e500993 li s3,229
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * bts2rd, bts2rd,
40011348: 00090693 mv a3,s2
4001134c: 000d0613 mv a2,s10
40011350: 000c8593 mv a1,s9
40011354: 000c0513 mv a0,s8
40011358: 805fd0ef jal ra,4000eb5c <fat_file_read>
4001135c: 04050663 beqz a0,400113a8 <msdos_find_node_by_cluster_num_in_fat_file+0xc8><== NEVER TAKEN
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
40011360: 0eab5663 bge s6,a0,4001144c <msdos_find_node_by_cluster_num_in_fat_file+0x16c>
assert(ret == bts2rd);
40011364: 0f251e63 bne a0,s2,40011460 <msdos_find_node_by_cluster_num_in_fat_file+0x180>
char* entry = (char*) fs_info->cl_buf + i;
40011368: 0c8c2703 lw a4,200(s8)
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
4001136c: 00000493 li s1,0
40011370: 00070413 mv s0,a4
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
40011374: 00044783 lbu a5,0(s0)
40011378: 02078863 beqz a5,400113a8 <msdos_find_node_by_cluster_num_in_fat_file+0xc8><== NEVER TAKEN
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
4001137c: 01378c63 beq a5,s3,40011394 <msdos_find_node_by_cluster_num_in_fat_file+0xb4>
MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* if get a non-empty entry - compare clusters num */
if (MSDOS_EXTRACT_CLUSTER_NUM(entry) == cl4find)
40011380: 01445783 lhu a5,20(s0)
40011384: 01a45803 lhu a6,26(s0)
40011388: 01079793 slli a5,a5,0x10
4001138c: 0107e7b3 or a5,a5,a6
40011390: 07778c63 beq a5,s7,40011408 <msdos_find_node_by_cluster_num_in_fat_file+0x128>
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
40011394: 02048493 addi s1,s1,32
40011398: 02040413 addi s0,s0,32
4001139c: fd24ece3 bltu s1,s2,40011374 <msdos_find_node_by_cluster_num_in_fat_file+0x94>
memcpy(dir_entry, entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
}
}
j++;
400113a0: 012d0d33 add s10,s10,s2 <== NOT EXECUTED
400113a4: fa5ff06f j 40011348 <msdos_find_node_by_cluster_num_in_fat_file+0x68><== NOT EXECUTED
return MSDOS_NAME_NOT_FOUND_ERR;
400113a8: 00008937 lui s2,0x8 <== NOT EXECUTED
400113ac: d0190913 addi s2,s2,-767 # 7d01 <bsp_section_rodata_size+0x5575><== NOT EXECUTED
}
return MSDOS_NAME_NOT_FOUND_ERR;
}
400113b0: 02c12083 lw ra,44(sp)
400113b4: 02812403 lw s0,40(sp)
400113b8: 02412483 lw s1,36(sp)
400113bc: 01c12983 lw s3,28(sp)
400113c0: 01812a03 lw s4,24(sp)
400113c4: 01412a83 lw s5,20(sp)
400113c8: 01012b03 lw s6,16(sp)
400113cc: 00c12b83 lw s7,12(sp)
400113d0: 00812c03 lw s8,8(sp)
400113d4: 00412c83 lw s9,4(sp)
400113d8: 00012d03 lw s10,0(sp)
400113dc: 00090513 mv a0,s2
400113e0: 02012903 lw s2,32(sp)
400113e4: 03010113 addi sp,sp,48
400113e8: 00008067 ret
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
400113ec: 024ca783 lw a5,36(s9)
400113f0: f40792e3 bnez a5,40011334 <msdos_find_node_by_cluster_num_in_fat_file+0x54><== NEVER TAKEN
400113f4: 016c4783 lbu a5,22(s8)
400113f8: 0037f793 andi a5,a5,3
400113fc: f2078ce3 beqz a5,40011334 <msdos_find_node_by_cluster_num_in_fat_file+0x54><== NEVER TAKEN
bts2rd = fat_fd->fat_file_size;
40011400: 018ca903 lw s2,24(s9)
40011404: f35ff06f j 40011338 <msdos_find_node_by_cluster_num_in_fat_file+0x58>
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM, j * bts2rd,
40011408: 000a0713 mv a4,s4
4001140c: 000d0693 mv a3,s10
40011410: 00100613 li a2,1
40011414: 000c8593 mv a1,s9
40011418: 000c0513 mv a0,s8
4001141c: b19fd0ef jal ra,4000ef34 <fat_file_ioctl>
40011420: 00050913 mv s2,a0
if (rc != RC_OK)
40011424: f80516e3 bnez a0,400113b0 <msdos_find_node_by_cluster_num_in_fat_file+0xd0><== NEVER TAKEN
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40011428: fff00793 li a5,-1
dir_pos->sname.ofs = i;
4001142c: 009a2223 sw s1,4(s4)
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40011430: 00fa2423 sw a5,8(s4)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
40011434: 00fa2623 sw a5,12(s4)
memcpy(dir_entry, entry,
40011438: 02000613 li a2,32
4001143c: 00040593 mv a1,s0
40011440: 000a8513 mv a0,s5
40011444: 4040a0ef jal ra,4001b848 <memcpy>
return RC_OK;
40011448: f69ff06f j 400113b0 <msdos_find_node_by_cluster_num_in_fat_file+0xd0>
rtems_set_errno_and_return_minus_one( EIO );
4001144c: 30d090ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40011450: 00500793 li a5,5 <== NOT EXECUTED
40011454: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40011458: fff00913 li s2,-1 <== NOT EXECUTED
4001145c: f55ff06f j 400113b0 <msdos_find_node_by_cluster_num_in_fat_file+0xd0><== NOT EXECUTED
assert(ret == bts2rd);
40011460: 400266b7 lui a3,0x40026 <== NOT EXECUTED
40011464: 40026637 lui a2,0x40026 <== NOT EXECUTED
40011468: 40026537 lui a0,0x40026 <== NOT EXECUTED
4001146c: f0068693 addi a3,a3,-256 # 40025f00 <msdos_file_handlers+0x100> <== NOT EXECUTED
40011470: f1060613 addi a2,a2,-240 # 40025f10 <__func__.0> <== NOT EXECUTED
40011474: 7f100593 li a1,2033 <== NOT EXECUTED
40011478: e7850513 addi a0,a0,-392 # 40025e78 <msdos_file_handlers+0x78> <== NOT EXECUTED
4001147c: 511040ef jal ra,4001618c <__assert_func> <== NOT EXECUTED
40003a94 <msdos_format>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
40003a94: ef010113 addi sp,sp,-272
40003a98: 10812423 sw s0,264(sp)
40003a9c: 0f312e23 sw s3,252(sp)
40003aa0: 00058413 mv s0,a1
40003aa4: 00050993 mv s3,a0
int ret_val = 0;
int fd = -1;
int i;
msdos_format_param_t fmt_params;
memset(&fmt_params, 0, sizeof(fmt_params));
40003aa8: 05800613 li a2,88
40003aac: 00000593 li a1,0
40003ab0: 01010513 addi a0,sp,16
{
40003ab4: 10112623 sw ra,268(sp)
40003ab8: 10912223 sw s1,260(sp)
40003abc: 11212023 sw s2,256(sp)
40003ac0: 0f412c23 sw s4,248(sp)
40003ac4: 0f512a23 sw s5,244(sp)
40003ac8: 0f612823 sw s6,240(sp)
40003acc: 0f712623 sw s7,236(sp)
40003ad0: 0f812423 sw s8,232(sp)
40003ad4: 0f912223 sw s9,228(sp)
40003ad8: 0fa12023 sw s10,224(sp)
40003adc: 0db12e23 sw s11,220(sp)
memset(&fmt_params, 0, sizeof(fmt_params));
40003ae0: 691170ef jal ra,4001b970 <memset>
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
40003ae4: 40025637 lui a2,0x40025
40003ae8: 7a060613 addi a2,a2,1952 # 400257a0 <rtems_filesystem_null_handlers+0x8c>
40003aec: 00200593 li a1,2
40003af0: 00040513 mv a0,s0
40003af4: d41ff0ef jal ra,40003834 <msdos_format_printf>
fd = open(devname, O_RDWR);
40003af8: 00200593 li a1,2
40003afc: 00098513 mv a0,s3
40003b00: db0fe0ef jal ra,400020b0 <open>
if (fd == -1) {
40003b04: fff00793 li a5,-1
40003b08: 6af50263 beq a0,a5,400041ac <msdos_format+0x718>
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003b0c: 40025637 lui a2,0x40025
40003b10: 00098693 mv a3,s3
40003b14: 7b060613 addi a2,a2,1968 # 400257b0 <rtems_filesystem_null_handlers+0x9c>
40003b18: 00050493 mv s1,a0
40003b1c: 00200593 li a1,2
40003b20: 00040513 mv a0,s0
40003b24: d11ff0ef jal ra,40003834 <msdos_format_printf>
"stat check: %s\n", devname);
if (ret_val == 0) {
ret_val = fstat(fd, &stat_buf);
40003b28: 06810593 addi a1,sp,104
40003b2c: 00048513 mv a0,s1
40003b30: a81fd0ef jal ra,400015b0 <fstat>
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
40003b34: 40025637 lui a2,0x40025
ret_val = fstat(fd, &stat_buf);
40003b38: 00050913 mv s2,a0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
40003b3c: 00098693 mv a3,s3
40003b40: 7c060613 addi a2,a2,1984 # 400257c0 <rtems_filesystem_null_handlers+0xac>
40003b44: 00100593 li a1,1
40003b48: 00040513 mv a0,s0
40003b4c: ce9ff0ef jal ra,40003834 <msdos_format_printf>
"formating: %s\n", devname);
/* rtems feature: no block devices, all are character devices */
if ((ret_val == 0) && (!S_ISBLK(stat_buf.st_mode))) {
40003b50: 60091663 bnez s2,4000415c <msdos_format+0x6c8> <== NEVER TAKEN
40003b54: 07812683 lw a3,120(sp)
40003b58: 0000f7b7 lui a5,0xf
40003b5c: 00006737 lui a4,0x6
40003b60: 00d7f7b3 and a5,a5,a3
40003b64: 5ee79463 bne a5,a4,4000414c <msdos_format+0x6b8>
memset(fmt_params,0,sizeof(*fmt_params));
40003b68: 00000593 li a1,0
40003b6c: 05800613 li a2,88
40003b70: 01010513 addi a0,sp,16
40003b74: 5fd170ef jal ra,4001b970 <memset>
static inline int rtems_disk_fd_get_media_block_size(
int fd,
uint32_t *media_block_size
)
{
return ioctl(fd, RTEMS_BLKIO_GETMEDIABLKSIZE, media_block_size);
40003b78: 400449b7 lui s3,0x40044
40003b7c: 01010613 addi a2,sp,16
40003b80: 20298593 addi a1,s3,514 # 40044202 <WorkAreaBase+0x17c82>
40003b84: 00048513 mv a0,s1
40003b88: 54c080ef jal ra,4000c0d4 <ioctl>
40003b8c: 00050913 mv s2,a0
if (ret_val == 0) {
40003b90: 64050e63 beqz a0,400041ec <msdos_format+0x758> <== ALWAYS TAKEN
if ( fmt_params->totl_sector_cnt == 0 )
40003b94: 01412783 lw a5,20(sp)
40003b98: 64079663 bnez a5,400041e4 <msdos_format+0x750> <== ALWAYS TAKEN
errno = EINVAL;
40003b9c: 3bc170ef jal ra,4001af58 <__errno>
40003ba0: 01600793 li a5,22
40003ba4: 00f52023 sw a5,0(a0)
fmt_params->rsvd_sector_cnt
40003ba8: 01812983 lw s3,24(sp)
ret_val = -1;
40003bac: fff00913 li s2,-1
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
40003bb0: 04014783 lbu a5,64(sp)
40003bb4: 02012683 lw a3,32(sp)
if (fmt_params->root_dir_sectors > 0) {
40003bb8: 02c12703 lw a4,44(sp)
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
40003bbc: 02d787b3 mul a5,a5,a3
40003bc0: 013787b3 add a5,a5,s3
fmt_params->root_dir_start_sec =
40003bc4: 02f12823 sw a5,48(sp)
if (fmt_params->root_dir_sectors > 0) {
40003bc8: 0a070ae3 beqz a4,4000447c <msdos_format+0x9e8>
fmt_params->root_dir_fmt_sec_cnt = fmt_params->root_dir_sectors;
40003bcc: 02e12a23 sw a4,52(sp)
if (ret_val == 0) {
40003bd0: 58091663 bnez s2,4000415c <msdos_format+0x6c8>
if ((rqdata != NULL) && (rqdata->OEMName != NULL)) {
40003bd4: 10040ce3 beqz s0,400044ec <msdos_format+0xa58>
40003bd8: 00042603 lw a2,0(s0)
40003bdc: 100608e3 beqz a2,400044ec <msdos_format+0xa58>
if (isprint((unsigned char)*from)) {
40003be0: 00064683 lbu a3,0(a2)
40003be4: 400275b7 lui a1,0x40027
from = "RTEMS"; /* default: make "from" point to OS Name */
40003be8: 04310793 addi a5,sp,67
40003bec: 10958593 addi a1,a1,265 # 40027109 <_ctype_+0x1>
40003bf0: 04b10513 addi a0,sp,75
40003bf4: 0180006f j 40003c0c <msdos_format+0x178>
40003bf8: fed78fa3 sb a3,-1(a5) # efff <bsp_section_rodata_size+0xc873>
*to = '\0';
40003bfc: 00078023 sb zero,0(a5)
*to++ = *from++;
40003c00: 00160613 addi a2,a2,1
for (cnt = 0; cnt < (sizeof(fmt_params->OEMName)-1); cnt++) {
40003c04: 02a78663 beq a5,a0,40003c30 <msdos_format+0x19c>
if (isprint((unsigned char)*from)) {
40003c08: 00064683 lbu a3,0(a2)
40003c0c: 00d58733 add a4,a1,a3
40003c10: 00074703 lbu a4,0(a4) # 6000 <bsp_section_rodata_size+0x3874>
*to++ = *from++;
40003c14: 00178793 addi a5,a5,1
if (isprint((unsigned char)*from)) {
40003c18: 09777713 andi a4,a4,151
40003c1c: fc071ee3 bnez a4,40003bf8 <msdos_format+0x164>
*to++=' ';
40003c20: 02000693 li a3,32
40003c24: fed78fa3 sb a3,-1(a5)
*to = '\0';
40003c28: 00078023 sb zero,0(a5)
for (cnt = 0; cnt < (sizeof(fmt_params->OEMName)-1); cnt++) {
40003c2c: fca79ee3 bne a5,a0,40003c08 <msdos_format+0x174>
if ((rqdata != NULL) &&
40003c30: 0a0406e3 beqz s0,400044dc <msdos_format+0xa48>
(rqdata->VolLabel != NULL)) {
40003c34: 00442603 lw a2,4(s0)
if ((rqdata != NULL) &&
40003c38: 0a0602e3 beqz a2,400044dc <msdos_format+0xa48>
fmt_params->VolLabel_present = true;
40003c3c: 00100793 li a5,1
40003c40: 04f10c23 sb a5,88(sp)
if (isprint((unsigned char)*from)) {
40003c44: 00064683 lbu a3,0(a2)
from = ""; /* default: make "from" point to empty string */
40003c48: 04c10793 addi a5,sp,76
40003c4c: 05710513 addi a0,sp,87
40003c50: 0180006f j 40003c68 <msdos_format+0x1d4>
40003c54: fed78fa3 sb a3,-1(a5)
*to = '\0';
40003c58: 00078023 sb zero,0(a5)
*to++ = *from++;
40003c5c: 00160613 addi a2,a2,1
for (cnt = 0; cnt < (sizeof(fmt_params->VolLabel)-1); cnt++) {
40003c60: 02a78663 beq a5,a0,40003c8c <msdos_format+0x1f8>
if (isprint((unsigned char)*from)) {
40003c64: 00064683 lbu a3,0(a2)
40003c68: 00d58733 add a4,a1,a3
40003c6c: 00074703 lbu a4,0(a4)
*to++ = *from++;
40003c70: 00178793 addi a5,a5,1
if (isprint((unsigned char)*from)) {
40003c74: 09777713 andi a4,a4,151
40003c78: fc071ee3 bnez a4,40003c54 <msdos_format+0x1c0>
*to++=' ';
40003c7c: 02000693 li a3,32
40003c80: fed78fa3 sb a3,-1(a5)
*to = '\0';
40003c84: 00078023 sb zero,0(a5)
for (cnt = 0; cnt < (sizeof(fmt_params->VolLabel)-1); cnt++) {
40003c88: fca79ee3 bne a5,a0,40003c64 <msdos_format+0x1d0>
rc = rtems_clock_get_tod_timeval(&time_value);
40003c8c: 00010513 mv a0,sp
40003c90: 745020ef jal ra,40006bd4 <rtems_clock_get_tod_timeval>
if (rc == RTEMS_SUCCESSFUL) {
40003c94: 660512e3 bnez a0,40004af8 <msdos_format+0x1064> <== ALWAYS TAKEN
*volid_ptr = time_value.tv_sec + time_value.tv_sec;
40003c98: 00012783 lw a5,0(sp) <== NOT EXECUTED
40003c9c: 00179793 slli a5,a5,0x1 <== NOT EXECUTED
40003ca0: 04f12e23 sw a5,92(sp) <== NOT EXECUTED
if (ret_val == 0) {
ret_val = msdos_format_determine_fmt_params(fd,rqdata,&fmt_params);
}
if (ret_val == 0) {
fmt_params.sec = malloc(fmt_params.bytes_per_sector);
40003ca4: 01012503 lw a0,16(sp)
40003ca8: bb9fd0ef jal ra,40001860 <malloc>
40003cac: 06a12223 sw a0,100(sp)
if (fmt_params.sec == NULL) {
40003cb0: 7c050e63 beqz a0,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
40003cb4: 00040663 beqz s0,40003cc0 <msdos_format+0x22c>
(rqdata != NULL) &&
40003cb8: 01544783 lbu a5,21(s0)
40003cbc: 7c078c63 beqz a5,40004494 <msdos_format+0xa00> <== NEVER TAKEN
*/
if (ret_val == 0) {
/*
* Read the current MBR to obtain the partition table.
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003cc0: 40026637 lui a2,0x40026
40003cc4: 83c60613 addi a2,a2,-1988 # 4002583c <rtems_filesystem_null_handlers+0x128>
40003cc8: 00200593 li a1,2
40003ccc: 00040513 mv a0,s0
40003cd0: b65ff0ef jal ra,40003834 <msdos_format_printf>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003cd4: 00000693 li a3,0
40003cd8: 00000593 li a1,0
40003cdc: 00000613 li a2,0
40003ce0: 00048513 mv a0,s1
"read MRB sector\n");
ret_val = msdos_format_read_sec(fd,
40003ce4: 01012983 lw s3,16(sp)
40003ce8: 06412903 lw s2,100(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003cec: 4f0080ef jal ra,4000c1dc <lseek>
40003cf0: 7805ce63 bltz a1,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
if (0 > read(fd,buffer,sector_size)) {
40003cf4: 00098613 mv a2,s3
40003cf8: 00090593 mv a1,s2
40003cfc: 00048513 mv a0,s1
40003d00: 75c080ef jal ra,4000c45c <read>
40003d04: 78054463 bltz a0,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
0,
fmt_params.bytes_per_sector,
fmt_params.sec);
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003d08: 40026637 lui a2,0x40026
40003d0c: 85060613 addi a2,a2,-1968 # 40025850 <rtems_filesystem_null_handlers+0x13c>
40003d10: 00200593 li a1,2
40003d14: 00040513 mv a0,s0
40003d18: b1dff0ef jal ra,40003834 <msdos_format_printf>
if (fmt_params->totl_sector_cnt < 0x10000) {
40003d1c: 01412783 lw a5,20(sp)
40003d20: 00010737 lui a4,0x10
40003d24: 78e7ec63 bltu a5,a4,400044bc <msdos_format+0xa28>
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
40003d28: 0087db13 srli s6,a5,0x8
40003d2c: 0107d993 srli s3,a5,0x10
40003d30: 0ff7fb93 andi s7,a5,255
40003d34: 0ffb7b13 andi s6,s6,255
40003d38: 0ff9f993 andi s3,s3,255
40003d3c: 0187da93 srli s5,a5,0x18
40003d40: 00000a13 li s4,0
40003d44: 00000913 li s2,0
"generate MRB sector\n");
ret_val = msdos_format_gen_mbr(fmt_params.sec,&fmt_params);
40003d48: 06412783 lw a5,100(sp)
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
40003d4c: 1be00613 li a2,446
40003d50: 00000593 li a1,0
40003d54: 00078513 mv a0,a5
40003d58: 419170ef jal ra,4001b970 <memset>
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
40003d5c: 1e050f23 sb zero,510(a0)
40003d60: 1e050fa3 sb zero,511(a0)
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
40003d64: 04614683 lbu a3,70(sp)
40003d68: 04414303 lbu t1,68(sp)
40003d6c: 04514883 lbu a7,69(sp)
40003d70: 04314e03 lbu t3,67(sp)
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
40003d74: 00050793 mv a5,a0
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
40003d78: 04914583 lbu a1,73(sp)
40003d7c: 04a14603 lbu a2,74(sp)
40003d80: 04714803 lbu a6,71(sp)
40003d84: 04814503 lbu a0,72(sp)
40003d88: 01c781a3 sb t3,3(a5)
40003d8c: 00678223 sb t1,4(a5)
40003d90: 011782a3 sb a7,5(a5)
40003d94: 00d78323 sb a3,6(a5)
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
40003d98: 01012683 lw a3,16(sp)
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
40003d9c: 00c78523 sb a2,10(a5)
40003da0: 010783a3 sb a6,7(a5)
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
40003da4: 00d785a3 sb a3,11(a5)
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
40003da8: 00a78423 sb a0,8(a5)
40003dac: 00b784a3 sb a1,9(a5)
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
40003db0: 0086d693 srli a3,a3,0x8
40003db4: 00d78623 sb a3,12(a5)
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
40003db8: 01812703 lw a4,24(sp)
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
40003dbc: 01c12583 lw a1,28(sp)
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
40003dc0: 00200693 li a3,2
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
40003dc4: 00875613 srli a2,a4,0x8
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
40003dc8: 00b786a3 sb a1,13(a5)
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
40003dcc: 00c787a3 sb a2,15(a5)
40003dd0: 00e78723 sb a4,14(a5)
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
40003dd4: 00d78823 sb a3,16(a5)
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
40003dd8: 02812703 lw a4,40(sp)
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
40003ddc: fff00593 li a1,-1
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
40003de0: 00100613 li a2,1
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
40003de4: 00e788a3 sb a4,17(a5)
40003de8: 02812703 lw a4,40(sp)
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
40003dec: 012789a3 sb s2,19(a5)
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
40003df0: 00875713 srli a4,a4,0x8
40003df4: 00e78923 sb a4,18(a5)
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
40003df8: 01478a23 sb s4,20(a5)
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
40003dfc: 04114703 lbu a4,65(sp)
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
40003e00: 00b78c23 sb a1,24(a5)
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
40003e04: 00600593 li a1,6
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
40003e08: 00e78aa3 sb a4,21(a5)
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
40003e0c: 00b78d23 sb a1,26(a5)
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
40003e10: 00c78e23 sb a2,28(a5)
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
40003e14: 03778023 sb s7,32(a5)
40003e18: 036780a3 sb s6,33(a5)
40003e1c: 03378123 sb s3,34(a5)
40003e20: 035781a3 sb s5,35(a5)
if (fmt_params->fattype != FAT_FAT32) {
40003e24: 04214583 lbu a1,66(sp)
40003e28: 00400713 li a4,4
40003e2c: 38e58ce3 beq a1,a4,400049c4 <msdos_format+0xf30>
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
40003e30: 02012703 lw a4,32(sp)
FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL);
40003e34: 02900693 li a3,41
40003e38: 02d78323 sb a3,38(a5)
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
40003e3c: 00875693 srli a3,a4,0x8
40003e40: 00d78ba3 sb a3,23(a5)
40003e44: 00e78b23 sb a4,22(a5)
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
40003e48: 05c12583 lw a1,92(sp)
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
40003e4c: 03678693 addi a3,a5,54
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
40003e50: 0085d893 srli a7,a1,0x8
40003e54: 0105d813 srli a6,a1,0x10
40003e58: 0185d513 srli a0,a1,0x18
40003e5c: 02b783a3 sb a1,39(a5)
40003e60: 03178423 sb a7,40(a5)
40003e64: 030784a3 sb a6,41(a5)
40003e68: 02a78523 sb a0,42(a5)
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
40003e6c: 04d14283 lbu t0,77(sp)
40003e70: 04e14f83 lbu t6,78(sp)
40003e74: 04f14f03 lbu t5,79(sp)
40003e78: 05014e83 lbu t4,80(sp)
40003e7c: 05114e03 lbu t3,81(sp)
40003e80: 05214303 lbu t1,82(sp)
40003e84: 05314883 lbu a7,83(sp)
40003e88: 05414803 lbu a6,84(sp)
40003e8c: 05514503 lbu a0,85(sp)
40003e90: 05614583 lbu a1,86(sp)
40003e94: 04c14383 lbu t2,76(sp)
40003e98: 02578623 sb t0,44(a5)
40003e9c: 03f786a3 sb t6,45(a5)
40003ea0: 027785a3 sb t2,43(a5)
40003ea4: 03e78723 sb t5,46(a5)
40003ea8: 03d787a3 sb t4,47(a5)
40003eac: 03c78823 sb t3,48(a5)
40003eb0: 026788a3 sb t1,49(a5)
40003eb4: 03178923 sb a7,50(a5)
40003eb8: 030789a3 sb a6,51(a5)
40003ebc: 02a78a23 sb a0,52(a5)
40003ec0: 02b78aa3 sb a1,53(a5)
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
40003ec4: 04214703 lbu a4,66(sp)
40003ec8: 64c70c63 beq a4,a2,40004520 <msdos_format+0xa8c>
40003ecc: 40025737 lui a4,0x40025
40003ed0: 79470713 addi a4,a4,1940 # 40025794 <rtems_filesystem_null_handlers+0x80>
40003ed4: 00074e03 lbu t3,0(a4)
40003ed8: 00174303 lbu t1,1(a4)
40003edc: 00274883 lbu a7,2(a4)
40003ee0: 00374803 lbu a6,3(a4)
40003ee4: 00474503 lbu a0,4(a4)
40003ee8: 00574583 lbu a1,5(a4)
40003eec: 00674603 lbu a2,6(a4)
40003ef0: 00774703 lbu a4,7(a4)
40003ef4: 03c78b23 sb t3,54(a5)
40003ef8: 006680a3 sb t1,1(a3) # 10001 <bsp_section_rodata_size+0xd875>
40003efc: 01168123 sb a7,2(a3)
40003f00: 010681a3 sb a6,3(a3)
40003f04: 00a68223 sb a0,4(a3)
40003f08: 00b682a3 sb a1,5(a3)
40003f0c: 00c68323 sb a2,6(a3)
40003f10: 00e683a3 sb a4,7(a3)
FAT_SET_BR_SIGNATURE(mbr, FAT_BR_SIGNATURE_VAL);
40003f14: 05500713 li a4,85
40003f18: 1ee78f23 sb a4,510(a5)
40003f1c: faa00713 li a4,-86
40003f20: 1ee78fa3 sb a4,511(a5)
FAT_SET_VAL8(mbr,0,0xeb);
40003f24: feb00713 li a4,-21
40003f28: 00e78023 sb a4,0(a5)
FAT_SET_VAL8(mbr,1,0x3c);
40003f2c: 03c00713 li a4,60
40003f30: 00e780a3 sb a4,1(a5)
/*
* write master boot record to disk
* also write copy of MBR to disk
*/
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003f34: 40026637 lui a2,0x40026
FAT_SET_VAL8(mbr,2,0x90);
40003f38: f9000713 li a4,-112
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003f3c: 87460613 addi a2,a2,-1932 # 40025874 <rtems_filesystem_null_handlers+0x160>
40003f40: 00200593 li a1,2
40003f44: 00040513 mv a0,s0
FAT_SET_VAL8(mbr,2,0x90);
40003f48: 00e78123 sb a4,2(a5)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003f4c: 8e9ff0ef jal ra,40003834 <msdos_format_printf>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003f50: 00000693 li a3,0
40003f54: 00000593 li a1,0
40003f58: 00000613 li a2,0
40003f5c: 00048513 mv a0,s1
"write MRB sector\n");
ret_val = msdos_format_write_sec(fd,
40003f60: 01012983 lw s3,16(sp)
0,
fmt_params.bytes_per_sector,
fmt_params.sec);
40003f64: 06412903 lw s2,100(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003f68: 274080ef jal ra,4000c1dc <lseek>
40003f6c: 5205c063 bltz a1,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
if (0 > write(fd,buffer,sector_size)) {
40003f70: 00098613 mv a2,s3
40003f74: 00090593 mv a1,s2
40003f78: 00048513 mv a0,s1
40003f7c: d08ff0ef jal ra,40003484 <write>
40003f80: 50054663 bltz a0,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
}
if ((ret_val == 0) &&
40003f84: 03812783 lw a5,56(sp)
40003f88: 04078863 beqz a5,40003fd8 <msdos_format+0x544>
(fmt_params.mbr_copy_sec != 0)) {
/*
* write copy of MBR
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40003f8c: 40026637 lui a2,0x40026
40003f90: 88860613 addi a2,a2,-1912 # 40025888 <rtems_filesystem_null_handlers+0x174>
40003f94: 00200593 li a1,2
40003f98: 00040513 mv a0,s0
40003f9c: 899ff0ef jal ra,40003834 <msdos_format_printf>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003fa0: 03812583 lw a1,56(sp)
"write back up MRB sector\n");
ret_val = msdos_format_write_sec(fd,
40003fa4: 01012903 lw s2,16(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003fa8: 00000693 li a3,0
40003fac: 00048513 mv a0,s1
40003fb0: 02b93633 mulhu a2,s2,a1
fmt_params.mbr_copy_sec ,
fmt_params.bytes_per_sector,
fmt_params.sec);
40003fb4: 06412983 lw s3,100(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40003fb8: 02b905b3 mul a1,s2,a1
40003fbc: 220080ef jal ra,4000c1dc <lseek>
40003fc0: 4c05c663 bltz a1,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
if (0 > write(fd,buffer,sector_size)) {
40003fc4: 00090613 mv a2,s2
40003fc8: 00098593 mv a1,s3
40003fcc: 00048513 mv a0,s1
40003fd0: cb4ff0ef jal ra,40003484 <write>
40003fd4: 4a054c63 bltz a0,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
40003fd8: 03c12783 lw a5,60(sp)
40003fdc: 66079e63 bnez a5,40004658 <msdos_format+0xbc4>
ret_val = msdos_format_fill_sectors
(&fmt_params,
rqdata,
fd,
fmt_params.rsvd_sector_cnt, /* start sector */
fmt_params.fat_num*fmt_params.sectors_per_fat,/* sector count */
40003fe0: 04014603 lbu a2,64(sp)
ret_val = msdos_format_fill_sectors
40003fe4: 02012703 lw a4,32(sp)
40003fe8: 01812683 lw a3,24(sp)
40003fec: 00000793 li a5,0
40003ff0: 02e60733 mul a4,a2,a4
40003ff4: 00040593 mv a1,s0
40003ff8: 00048613 mv a2,s1
40003ffc: 01010513 addi a0,sp,16
40004000: 91dff0ef jal ra,4000391c <msdos_format_fill_sectors>
40004004: 00050913 mv s2,a0
}
/*
* clear/init root directory
* -> write all directory sectors as 0x00
*/
if (ret_val == 0) {
40004008: 14051a63 bnez a0,4000415c <msdos_format+0x6c8> <== NEVER TAKEN
ret_val = msdos_format_fill_sectors
4000400c: 03412703 lw a4,52(sp)
40004010: 03012683 lw a3,48(sp)
40004014: 00000793 li a5,0
40004018: 00048613 mv a2,s1
4000401c: 00040593 mv a1,s0
40004020: 01010513 addi a0,sp,16
40004024: 8f9ff0ef jal ra,4000391c <msdos_format_fill_sectors>
40004028: 00050913 mv s2,a0
0x00);
}
/*
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
4000402c: 12051863 bnez a0,4000415c <msdos_format+0x6c8> <== NEVER TAKEN
40004030: 05814783 lbu a5,88(sp)
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
40004034: 06412503 lw a0,100(sp)
40004038: 01012603 lw a2,16(sp)
if ((ret_val == 0) && fmt_params.VolLabel_present) {
4000403c: 70079863 bnez a5,4000474c <msdos_format+0xcb8>
uint32_t start_sector;
/*
* empty sector: all clusters are free/do not link further on
*/
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
40004040: 00000593 li a1,0
40004044: 12d170ef jal ra,4001b970 <memset>
switch(fmt_params.fattype) {
40004048: 04214783 lbu a5,66(sp)
4000404c: 00200713 li a4,2
40004050: 02e78ee3 beq a5,a4,4000488c <msdos_format+0xdf8>
40004054: 00400713 li a4,4
40004058: 7ce78e63 beq a5,a4,40004834 <msdos_format+0xda0>
4000405c: 00100713 li a4,1
40004060: 7ae78463 beq a5,a4,40004808 <msdos_format+0xd74>
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
break;
default:
ret_val = -1;
errno = EINVAL;
40004064: 6f5160ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40004068: 01600793 li a5,22 <== NOT EXECUTED
4000406c: 00f52023 sw a5,0(a0) <== NOT EXECUTED
ret_val = -1;
40004070: fff00993 li s3,-1 <== NOT EXECUTED
}
if (fmt_params.fattype == FAT_FAT32) {
40004074: 04214703 lbu a4,66(sp)
40004078: 00400793 li a5,4
4000407c: 02f71863 bne a4,a5,400040ac <msdos_format+0x618>
/*
* only first valid cluster (cluster number 2) belongs
* to root directory, and is end of chain
* mark this in every copy of the FAT
*/
FAT_SET_VAL32(fmt_params.sec,8,FAT_FAT32_EOC);
40004080: 06412703 lw a4,100(sp)
40004084: ff800693 li a3,-8
40004088: fff00793 li a5,-1
4000408c: 00d70423 sb a3,8(a4)
40004090: 06412703 lw a4,100(sp)
40004094: 00f704a3 sb a5,9(a4)
40004098: 06412703 lw a4,100(sp)
4000409c: 00f70523 sb a5,10(a4)
400040a0: 06412783 lw a5,100(sp)
400040a4: 00f00713 li a4,15
400040a8: 00e785a3 sb a4,11(a5)
if (! skip_alignment)
400040ac: 06014703 lbu a4,96(sp)
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
400040b0: 01812b03 lw s6,24(sp)
400040b4: 01c12783 lw a5,28(sp)
if (! skip_alignment)
400040b8: 00071a63 bnez a4,400040cc <msdos_format+0x638>
return (sectors + clustersize - 1) & ~(clustersize - 1);
400040bc: 00fb0b33 add s6,s6,a5
400040c0: fffb0b13 addi s6,s6,-1
400040c4: 40f007b3 neg a5,a5
400040c8: 00fb7b33 and s6,s6,a5
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
400040cc: 04014783 lbu a5,64(sp)
400040d0: 3a078c63 beqz a5,40004488 <msdos_format+0x9f4> <== NEVER TAKEN
(i < fmt_params.fat_num) && (ret_val == 0);
400040d4: 3a099c63 bnez s3,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
i++) {
ret_val = msdos_format_write_sec
(fd,
start_sector
+ (i * fmt_params.sectors_per_fat),
400040d8: 02012583 lw a1,32(sp)
ret_val = msdos_format_write_sec
400040dc: 01012a03 lw s4,16(sp)
fmt_params.bytes_per_sector,
fmt_params.sec);
400040e0: 06412a83 lw s5,100(sp)
+ (i * fmt_params.sectors_per_fat),
400040e4: 02b985b3 mul a1,s3,a1
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
400040e8: 00000693 li a3,0
400040ec: 00048513 mv a0,s1
ret_val = msdos_format_write_sec
400040f0: 00198993 addi s3,s3,1
400040f4: 016585b3 add a1,a1,s6
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
400040f8: 0345b633 mulhu a2,a1,s4
400040fc: 034585b3 mul a1,a1,s4
40004100: 0dc080ef jal ra,4000c1dc <lseek>
40004104: 00058793 mv a5,a1
if (0 > write(fd,buffer,sector_size)) {
40004108: 000a0613 mv a2,s4
4000410c: 000a8593 mv a1,s5
40004110: 00048513 mv a0,s1
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
40004114: 3607cc63 bltz a5,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
if (0 > write(fd,buffer,sector_size)) {
40004118: b6cff0ef jal ra,40003484 <write>
4000411c: 36054863 bltz a0,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
(i < fmt_params.fat_num) && (ret_val == 0);
40004120: 04014783 lbu a5,64(sp)
for (i = 0;
40004124: faf9cae3 blt s3,a5,400040d8 <msdos_format+0x644>
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
40004128: 02040a63 beqz s0,4000415c <msdos_format+0x6c8>
4000412c: 01744783 lbu a5,23(s0)
40004130: 02078663 beqz a5,4000415c <msdos_format+0x6c8>
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
}
static inline int rtems_disk_fd_sync(int fd)
{
return ioctl(fd, RTEMS_BLKIO_SYNCDEV);
40004134: 200045b7 lui a1,0x20004
40004138: 20658593 addi a1,a1,518 # 20004206 <RamSize+0x1f004206>
4000413c: 00048513 mv a0,s1
40004140: 795070ef jal ra,4000c0d4 <ioctl>
40004144: 00050913 mv s2,a0
40004148: 0140006f j 4000415c <msdos_format+0x6c8>
errno = ENOTTY;
4000414c: 60d160ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40004150: 01900793 li a5,25 <== NOT EXECUTED
40004154: 00f52023 sw a5,0(a0) <== NOT EXECUTED
ret_val = -1;
40004158: fff00913 li s2,-1 <== NOT EXECUTED
* cleanup:
* sync and unlock disk
* free any data structures (not needed now)
*/
if (fd != -1) {
close(fd);
4000415c: 00048513 mv a0,s1
40004160: 97cfd0ef jal ra,400012dc <close>
}
free(fmt_params.sec);
40004164: 06412503 lw a0,100(sp)
40004168: b58fd0ef jal ra,400014c0 <free>
return ret_val;
}
4000416c: 10c12083 lw ra,268(sp)
40004170: 10812403 lw s0,264(sp)
40004174: 10412483 lw s1,260(sp)
40004178: 0fc12983 lw s3,252(sp)
4000417c: 0f812a03 lw s4,248(sp)
40004180: 0f412a83 lw s5,244(sp)
40004184: 0f012b03 lw s6,240(sp)
40004188: 0ec12b83 lw s7,236(sp)
4000418c: 0e812c03 lw s8,232(sp)
40004190: 0e412c83 lw s9,228(sp)
40004194: 0e012d03 lw s10,224(sp)
40004198: 0dc12d83 lw s11,220(sp)
4000419c: 00090513 mv a0,s2
400041a0: 10012903 lw s2,256(sp)
400041a4: 11010113 addi sp,sp,272
400041a8: 00008067 ret
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400041ac: 40025637 lui a2,0x40025 <== NOT EXECUTED
400041b0: 7b060613 addi a2,a2,1968 # 400257b0 <rtems_filesystem_null_handlers+0x9c><== NOT EXECUTED
400041b4: 00200593 li a1,2 <== NOT EXECUTED
400041b8: 00040513 mv a0,s0 <== NOT EXECUTED
400041bc: 00098693 mv a3,s3 <== NOT EXECUTED
400041c0: e74ff0ef jal ra,40003834 <msdos_format_printf> <== NOT EXECUTED
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
400041c4: 40025637 lui a2,0x40025 <== NOT EXECUTED
400041c8: 00098693 mv a3,s3 <== NOT EXECUTED
400041cc: 7c060613 addi a2,a2,1984 # 400257c0 <rtems_filesystem_null_handlers+0xac><== NOT EXECUTED
400041d0: 00100593 li a1,1 <== NOT EXECUTED
400041d4: 00040513 mv a0,s0 <== NOT EXECUTED
400041d8: e5cff0ef jal ra,40003834 <msdos_format_printf> <== NOT EXECUTED
ret_val= -1;
400041dc: fff00913 li s2,-1 <== NOT EXECUTED
400041e0: f85ff06f j 40004164 <msdos_format+0x6d0> <== NOT EXECUTED
fmt_params->rsvd_sector_cnt
400041e4: 01812983 lw s3,24(sp)
400041e8: 9c9ff06f j 40003bb0 <msdos_format+0x11c>
return ioctl(fd, RTEMS_BLKIO_GETSIZE, block_count);
400041ec: 01410613 addi a2,sp,20
400041f0: 20598593 addi a1,s3,517
400041f4: 00048513 mv a0,s1
400041f8: 6dd070ef jal ra,4000c0d4 <ioctl>
400041fc: 00050913 mv s2,a0
if (ret_val == 0) {
40004200: 98051ae3 bnez a0,40003b94 <msdos_format+0x100> <== NEVER TAKEN
total_size = (uint64_t)fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
40004204: 01012683 lw a3,16(sp)
40004208: 01412703 lw a4,20(sp)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
4000420c: 40025637 lui a2,0x40025
40004210: 7d060613 addi a2,a2,2000 # 400257d0 <rtems_filesystem_null_handlers+0xbc>
total_size = (uint64_t)fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
40004214: 02e68a33 mul s4,a3,a4
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004218: 00200593 li a1,2
4000421c: 00040513 mv a0,s0
total_size = (uint64_t)fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
40004220: 02e6b9b3 mulhu s3,a3,a4
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004224: 000a0813 mv a6,s4
40004228: 00098893 mv a7,s3
4000422c: e08ff0ef jal ra,40003834 <msdos_format_printf>
if ((rqdata == NULL) || (rqdata->fat_num == 0)) {
40004230: 68040863 beqz s0,400048c0 <msdos_format+0xe2c>
40004234: 00c42683 lw a3,12(s0)
40004238: 2c068263 beqz a3,400044fc <msdos_format+0xa68>
else if (rqdata->fat_num <= 6) {
4000423c: 00600793 li a5,6
40004240: 0cd7e2e3 bltu a5,a3,40004b04 <msdos_format+0x1070>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004244: 40026637 lui a2,0x40026
40004248: 80c60613 addi a2,a2,-2036 # 4002580c <rtems_filesystem_null_handlers+0xf8>
4000424c: 00200593 li a1,2
40004250: 00040513 mv a0,s0
fmt_params->fat_num = rqdata->fat_num;
40004254: 04d10023 sb a3,64(sp)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004258: ddcff0ef jal ra,40003834 <msdos_format_printf>
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
4000425c: 00842703 lw a4,8(s0)
40004260: 68070063 beqz a4,400048e0 <msdos_format+0xe4c>
if (fmt_params->totl_sector_cnt < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
40004264: 000017b7 lui a5,0x1
40004268: ff578793 addi a5,a5,-11 # ff5 <bsp_section_data_size+0x8fd>
4000426c: 02f707b3 mul a5,a4,a5
40004270: 01412683 lw a3,20(sp)
40004274: 66f6fe63 bgeu a3,a5,400048f0 <msdos_format+0xe5c>
fmt_params->fattype = FAT_FAT12;
40004278: 00100793 li a5,1
4000427c: 04f10123 sb a5,66(sp)
fmt_params->sectors_per_cluster = 2;
40004280: 00200793 li a5,2
40004284: 00f12e23 sw a5,28(sp)
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata, fmt_params );
40004288: 01010593 addi a1,sp,16
4000428c: 00040513 mv a0,s0
40004290: e1cff0ef jal ra,400038ac <msdos_set_sectors_per_cluster_from_request>
40004294: 00050913 mv s2,a0
if (ret_val == 0) {
40004298: 8e051ee3 bnez a0,40003b94 <msdos_format+0x100> <== NEVER TAKEN
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
4000429c: 400007b7 lui a5,0x40000
400042a0: 00fa07b3 add a5,s4,a5
400042a4: 0147ba33 sltu s4,a5,s4
400042a8: 013a0a33 add s4,s4,s3
400042ac: 01e7d713 srli a4,a5,0x1e
&& fmt_params->totl_sector_cnt > 0 ) {
400042b0: 01412d83 lw s11,20(sp)
400042b4: 04214783 lbu a5,66(sp)
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
400042b8: 00010c37 lui s8,0x10
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
400042bc: 002a1a13 slli s4,s4,0x2
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
400042c0: 00001bb7 lui s7,0x1
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
400042c4: 00ea6a33 or s4,s4,a4
&& fmt_params->totl_sector_cnt > 0 ) {
400042c8: 0ff00c93 li s9,255
400042cc: 00000993 li s3,0
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
400042d0: ff5c0a93 addi s5,s8,-11 # fff5 <bsp_section_rodata_size+0xd869>
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
400042d4: ff5b8b13 addi s6,s7,-11 # ff5 <bsp_section_data_size+0x8fd>
&& fmt_params->fattype != fat_type
400042d8: 65978063 beq a5,s9,40004918 <msdos_format+0xe84>
&& fmt_params->totl_sector_cnt > 0 ) {
400042dc: 8c0d80e3 beqz s11,40003b9c <msdos_format+0x108> <== NEVER TAKEN
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400042e0: 01c12683 lw a3,28(sp)
if (ret_val == 0 && rqdata != NULL)
400042e4: 32040663 beqz s0,40004610 <msdos_format+0xb7c>
fmt_params->skip_alignment = rqdata->skip_alignment;
400042e8: 01644783 lbu a5,22(s0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400042ec: 40026737 lui a4,0x40026
400042f0: 82070613 addi a2,a4,-2016 # 40025820 <rtems_filesystem_null_handlers+0x10c>
400042f4: 00200593 li a1,2
400042f8: 00040513 mv a0,s0
fmt_params->skip_alignment = rqdata->skip_alignment;
400042fc: 06f10023 sb a5,96(sp)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004300: d34ff0ef jal ra,40003834 <msdos_format_printf>
if (fmt_params->fattype == FAT_FAT32) {
40004304: 04214c83 lbu s9,66(sp)
40004308: 00400793 li a5,4
4000430c: 40fc8663 beq s9,a5,40004718 <msdos_format+0xc84>
(rqdata->files_per_root_dir > 0)) {
40004310: 01042f03 lw t5,16(s0)
fmt_params->rsvd_sector_cnt = 1;
40004314: 00100793 li a5,1
40004318: 00f12c23 sw a5,24(sp)
if ((rqdata != NULL) &&
4000431c: 300f0e63 beqz t5,40004638 <msdos_format+0xba4>
fmt_params->files_per_root_dir = rqdata->files_per_root_dir;
40004320: ffff0f13 addi t5,t5,-1
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
40004324: 000c8813 mv a6,s9
fmt_params->files_per_root_dir = rqdata->files_per_root_dir;
40004328: 00100293 li t0,1
(2*fmt_params->bytes_per_sector/
4000432c: 01012303 lw t1,16(sp)
40004330: 00131793 slli a5,t1,0x1
40004334: 0057d793 srli a5,a5,0x5
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
40004338: 00ff0f33 add t5,t5,a5
fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir %
4000433c: 02ff77b3 remu a5,t5,a5
40004340: 40ff0f33 sub t5,t5,a5
40004344: 03e12423 sw t5,40(sp)
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
40004348: 005f1f13 slli t5,t5,0x5
fmt_params->root_dir_sectors =
4000434c: fff30f93 addi t6,t1,-1
+ fmt_params->bytes_per_sector - 1)
40004350: 01ef8f33 add t5,t6,t5
/ fmt_params->bytes_per_sector);
40004354: 026f5f33 divu t5,t5,t1
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
40004358: 01412383 lw t2,20(sp)
4000435c: 01c12703 lw a4,28(sp)
40004360: 04014e83 lbu t4,64(sp)
40004364: 06014503 lbu a0,96(sp)
40004368: 00038d93 mv s11,t2
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
4000436c: 026c57b3 divu a5,s8,t1
fmt_params->root_dir_sectors =
40004370: 03e12623 sw t5,44(sp)
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
40004374: 00e7f663 bgeu a5,a4,40004380 <msdos_format+0x8ec>
sectors_per_cluster /= 2;
40004378: 00175713 srli a4,a4,0x1 <== NOT EXECUTED
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
4000437c: fee7eee3 bltu a5,a4,40004378 <msdos_format+0x8e4> <== NOT EXECUTED
fatdata_sect_cnt = total_sector_cnt
40004380: 405380b3 sub ra,t2,t0
if (fattype == FAT_FAT12) {
40004384: 00100593 li a1,1
else if (fattype == FAT_FAT16) {
40004388: 00200e13 li t3,2
return (sectors + clustersize - 1) & ~(clustersize - 1);
4000438c: fff28293 addi t0,t0,-1
40004390: ffff0d13 addi s10,t5,-1
if (! skip_alignment)
40004394: 18051c63 bnez a0,4000452c <msdos_format+0xa98>
return (sectors + clustersize - 1) & ~(clustersize - 1);
40004398: 40e00633 neg a2,a4
4000439c: 00e286b3 add a3,t0,a4
400043a0: 00c6f6b3 and a3,a3,a2
400043a4: 00ed07b3 add a5,s10,a4
fatdata_sect_cnt = total_sector_cnt
400043a8: 40d386b3 sub a3,t2,a3
return (sectors + clustersize - 1) & ~(clustersize - 1);
400043ac: 00c7f7b3 and a5,a5,a2
if (fattype == FAT_FAT12) {
400043b0: 1ab80063 beq a6,a1,40004550 <msdos_format+0xabc>
else if (fattype == FAT_FAT16) {
400043b4: 25c80863 beq a6,t3,40004604 <msdos_format+0xb70>
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
400043b8: 02e6d6b3 divu a3,a3,a4
fat_capacity = fatdata_cluster_cnt * 4;
400043bc: 00269793 slli a5,a3,0x2
+ (bytes_per_sector - 1))
400043c0: 00ff87b3 add a5,t6,a5
sectors_per_fat = ((fat_capacity
400043c4: 0267d7b3 divu a5,a5,t1
400043c8: fff70893 addi a7,a4,-1
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
400043cc: 03d787b3 mul a5,a5,t4
return (sectors + clustersize - 1) & ~(clustersize - 1);
400043d0: 01178633 add a2,a5,a7
if (! skip_alignment)
400043d4: 00051863 bnez a0,400043e4 <msdos_format+0x950>
return (sectors + clustersize - 1) & ~(clustersize - 1);
400043d8: 40e007b3 neg a5,a4
400043dc: 00c7f7b3 and a5,a5,a2
+ (sectors_per_cluster - 1))
400043e0: 01178633 add a2,a5,a7
/ sectors_per_cluster));
400043e4: 02e65633 divu a2,a2,a4
*data_cluster_cnt = (fatdata_cluster_cnt -
400043e8: 40c686b3 sub a3,a3,a2
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
400043ec: 16b80e63 beq a6,a1,40004568 <msdos_format+0xad4>
400043f0: 73c81a63 bne a6,t3,40004b24 <msdos_format+0x1090>
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
400043f4: 72daf863 bgeu s5,a3,40004b24 <msdos_format+0x1090>
sectors_per_cluster *= 2;
400043f8: 00171713 slli a4,a4,0x1
} else if ((sectors_per_cluster * bytes_per_sector)
400043fc: 02e306b3 mul a3,t1,a4
40004400: f8dc7ae3 bgeu s8,a3,40004394 <msdos_format+0x900>
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
40004404: 03d7d7b3 divu a5,a5,t4 <== NOT EXECUTED
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
40004408: 00e12e23 sw a4,28(sp) <== NOT EXECUTED
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
4000440c: 02f12023 sw a5,32(sp) <== NOT EXECUTED
fmt_params->fattype = msdos_get_fat_type(
40004410: 00400713 li a4,4
40004414: 04e10123 sb a4,66(sp)
for ( b = 31; b > 0; b-- ) {
40004418: 01f00793 li a5,31
if ( (gigs & ( 1 << b) ) != 0 )
4000441c: 00100613 li a2,1
if (fat_type != fmt_params->fattype) {
40004420: 00ec9663 bne s9,a4,4000442c <msdos_format+0x998>
40004424: 1800006f j 400045a4 <msdos_format+0xb10>
for ( b = 31; b > 0; b-- ) {
40004428: 4e078463 beqz a5,40004910 <msdos_format+0xe7c> <== NEVER TAKEN
if ( (gigs & ( 1 << b) ) != 0 )
4000442c: 00f61733 sll a4,a2,a5
40004430: 00ea76b3 and a3,s4,a4
for ( b = 31; b > 0; b-- ) {
40004434: fff78793 addi a5,a5,-1 # 3fffffff <RamSize+0x3effffff>
if ( (gigs & ( 1 << b) ) != 0 )
40004438: fe0688e3 beqz a3,40004428 <msdos_format+0x994>
fmt_params->sectors_per_cluster = 1 << b;
4000443c: 00e12e23 sw a4,28(sp)
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata,
40004440: 01010593 addi a1,sp,16
40004444: 00040513 mv a0,s0
40004448: c64ff0ef jal ra,400038ac <msdos_set_sectors_per_cluster_from_request>
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
4000444c: 04214783 lbu a5,66(sp)
40004450: 3b978863 beq a5,s9,40004800 <msdos_format+0xd6c>
40004454: 00100713 li a4,1
--fmt_params->totl_sector_cnt;
40004458: 01412d83 lw s11,20(sp)
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
4000445c: 01377663 bgeu a4,s3,40004468 <msdos_format+0x9d4>
--fmt_params->totl_sector_cnt;
40004460: fffd8d93 addi s11,s11,-1
40004464: 01b12a23 sw s11,20(sp)
++iteration_cnt;
40004468: 00198993 addi s3,s3,1
4000446c: 0ff9f993 andi s3,s3,255
while( ret_val == 0
40004470: e60504e3 beqz a0,400042d8 <msdos_format+0x844> <== ALWAYS TAKEN
40004474: 00050913 mv s2,a0 <== NOT EXECUTED
40004478: f1cff06f j 40003b94 <msdos_format+0x100> <== NOT EXECUTED
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
4000447c: 01c12783 lw a5,28(sp)
40004480: 02f12a23 sw a5,52(sp)
40004484: f4cff06f j 40003bd0 <msdos_format+0x13c>
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
40004488: ca0980e3 beqz s3,40004128 <msdos_format+0x694> <== NOT EXECUTED
4000448c: fff00913 li s2,-1 <== NOT EXECUTED
40004490: ccdff06f j 4000415c <msdos_format+0x6c8> <== NOT EXECUTED
ret_val = msdos_format_fill_sectors
40004494: 01412703 lw a4,20(sp) <== NOT EXECUTED
40004498: 0e500793 li a5,229 <== NOT EXECUTED
4000449c: 00000693 li a3,0 <== NOT EXECUTED
400044a0: 00048613 mv a2,s1 <== NOT EXECUTED
400044a4: 00040593 mv a1,s0 <== NOT EXECUTED
400044a8: 01010513 addi a0,sp,16 <== NOT EXECUTED
400044ac: c70ff0ef jal ra,4000391c <msdos_format_fill_sectors> <== NOT EXECUTED
400044b0: 00050913 mv s2,a0 <== NOT EXECUTED
if (ret_val == 0) {
400044b4: 800506e3 beqz a0,40003cc0 <msdos_format+0x22c> <== NOT EXECUTED
400044b8: ca5ff06f j 4000415c <msdos_format+0x6c8> <== NOT EXECUTED
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
400044bc: 0087da13 srli s4,a5,0x8
400044c0: 0ff7f913 andi s2,a5,255
400044c4: 0ffa7a13 andi s4,s4,255
400044c8: 00000a93 li s5,0
400044cc: 00000993 li s3,0
400044d0: 00000b13 li s6,0
400044d4: 00000b93 li s7,0
400044d8: 871ff06f j 40003d48 <msdos_format+0x2b4>
from = ""; /* default: make "from" point to empty string */
400044dc: 40026637 lui a2,0x40026
400044e0: 00000693 li a3,0
400044e4: 83860613 addi a2,a2,-1992 # 40025838 <rtems_filesystem_null_handlers+0x124>
400044e8: f60ff06f j 40003c48 <msdos_format+0x1b4>
from = "RTEMS"; /* default: make "from" point to OS Name */
400044ec: 40025637 lui a2,0x40025
400044f0: 05200693 li a3,82
400044f4: 78060613 addi a2,a2,1920 # 40025780 <rtems_filesystem_null_handlers+0x6c>
400044f8: eecff06f j 40003be4 <msdos_format+0x150>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400044fc: 40026637 lui a2,0x40026
fmt_params->fat_num = 2;
40004500: 00200793 li a5,2
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004504: 00200693 li a3,2
40004508: 80c60613 addi a2,a2,-2036 # 4002580c <rtems_filesystem_null_handlers+0xf8>
4000450c: 00200593 li a1,2
40004510: 00040513 mv a0,s0
fmt_params->fat_num = 2;
40004514: 04f10023 sb a5,64(sp)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004518: b1cff0ef jal ra,40003834 <msdos_format_printf>
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
4000451c: d41ff06f j 4000425c <msdos_format+0x7c8>
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
40004520: 40025737 lui a4,0x40025
40004524: 78870713 addi a4,a4,1928 # 40025788 <rtems_filesystem_null_handlers+0x74>
40004528: 9adff06f j 40003ed4 <msdos_format+0x440>
fatdata_sect_cnt = total_sector_cnt
4000452c: 00008693 mv a3,ra
if (fattype == FAT_FAT12) {
40004530: 00b80e63 beq a6,a1,4000454c <msdos_format+0xab8>
else if (fattype == FAT_FAT16) {
40004534: e9c812e3 bne a6,t3,400043b8 <msdos_format+0x924>
return sectors;
40004538: 000f0793 mv a5,t5
fatdata_sect_cnt = fatdata_sect_cnt
4000453c: 40f686b3 sub a3,a3,a5
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
40004540: 02e6d6b3 divu a3,a3,a4
fat_capacity = fatdata_cluster_cnt * 2;
40004544: 00169793 slli a5,a3,0x1
40004548: e79ff06f j 400043c0 <msdos_format+0x92c>
return sectors;
4000454c: 000f0793 mv a5,t5
fatdata_sect_cnt = fatdata_sect_cnt
40004550: 40f686b3 sub a3,a3,a5
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
40004554: 02e6d6b3 divu a3,a3,a4
fat_capacity = fatdata_cluster_cnt * 3 / 2;
40004558: 00169793 slli a5,a3,0x1
4000455c: 00d787b3 add a5,a5,a3
40004560: 0017d793 srli a5,a5,0x1
40004564: e5dff06f j 400043c0 <msdos_format+0x92c>
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
40004568: 04db6663 bltu s6,a3,400045b4 <msdos_format+0xb20>
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
4000456c: 03d7d7b3 divu a5,a5,t4
uint32_t ms_sectors_per_cluster_limit_FAT12 =
40004570: 001b8613 addi a2,s7,1
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
40004574: 00e12e23 sw a4,28(sp)
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
40004578: 02f12023 sw a5,32(sp)
uint32_t ms_sectors_per_cluster_limit_FAT16 =
4000457c: 000087b7 lui a5,0x8
40004580: 00178793 addi a5,a5,1 # 8001 <bsp_section_rodata_size+0x5875>
uint32_t ms_sectors_per_cluster_limit_FAT12 =
40004584: 02665633 divu a2,a2,t1
uint32_t ms_sectors_per_cluster_limit_FAT16 =
40004588: 0267d7b3 divu a5,a5,t1
if ( number_of_clusters < FAT_FAT12_MAX_CLN
4000458c: 05668c63 beq a3,s6,400045e4 <msdos_format+0xb50>
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT12 ) {
40004590: 04e66a63 bltu a2,a4,400045e4 <msdos_format+0xb50>
fattype = FAT_FAT12;
40004594: 00100793 li a5,1
fmt_params->fattype = msdos_get_fat_type(
40004598: 04f10123 sb a5,66(sp)
if ( fmt_params->totl_sector_cnt == 0 )
4000459c: 00038d93 mv s11,t2
if (fat_type != fmt_params->fattype) {
400045a0: 05979c63 bne a5,s9,400045f8 <msdos_format+0xb64>
++iteration_cnt;
400045a4: 00198993 addi s3,s3,1
400045a8: 04214783 lbu a5,66(sp)
400045ac: 0ff9f993 andi s3,s3,255
while( ret_val == 0
400045b0: d29ff06f j 400042d8 <msdos_format+0x844>
sectors_per_cluster *= 2;
400045b4: 00171713 slli a4,a4,0x1
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
400045b8: 02e30633 mul a2,t1,a4
400045bc: dccbfce3 bgeu s7,a2,40004394 <msdos_format+0x900>
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
400045c0: 03d7deb3 divu t4,a5,t4 <== NOT EXECUTED
uint32_t ms_sectors_per_cluster_limit_FAT16 =
400045c4: 000087b7 lui a5,0x8 <== NOT EXECUTED
400045c8: 00178793 addi a5,a5,1 # 8001 <bsp_section_rodata_size+0x5875> <== NOT EXECUTED
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
400045cc: 00e12e23 sw a4,28(sp) <== NOT EXECUTED
uint32_t ms_sectors_per_cluster_limit_FAT16 =
400045d0: 0267d7b3 divu a5,a5,t1 <== NOT EXECUTED
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
400045d4: 03d12023 sw t4,32(sp) <== NOT EXECUTED
else if ( number_of_clusters < FAT_FAT16_MAX_CLN
400045d8: 00010637 lui a2,0x10
400045dc: ff460613 addi a2,a2,-12 # fff4 <bsp_section_rodata_size+0xd868>
400045e0: e2d668e3 bltu a2,a3,40004410 <msdos_format+0x97c>
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT16 ) {
400045e4: e2e7e6e3 bltu a5,a4,40004410 <msdos_format+0x97c>
fattype = FAT_FAT16;
400045e8: 00200793 li a5,2
fmt_params->fattype = msdos_get_fat_type(
400045ec: 04f10123 sb a5,66(sp)
if ( fmt_params->totl_sector_cnt == 0 )
400045f0: 00038d93 mv s11,t2
if (fat_type != fmt_params->fattype) {
400045f4: fb9788e3 beq a5,s9,400045a4 <msdos_format+0xb10>
fmt_params->sectors_per_cluster = 2;
400045f8: 00200793 li a5,2
400045fc: 00f12e23 sw a5,28(sp)
40004600: e41ff06f j 40004440 <msdos_format+0x9ac>
return (sectors + clustersize - 1) & ~(clustersize - 1);
40004604: 00ed07b3 add a5,s10,a4
40004608: 00c7f7b3 and a5,a5,a2
4000460c: f31ff06f j 4000453c <msdos_format+0xaa8>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004610: 400267b7 lui a5,0x40026
40004614: 82078613 addi a2,a5,-2016 # 40025820 <rtems_filesystem_null_handlers+0x10c>
40004618: 00200593 li a1,2
4000461c: 00000513 li a0,0
40004620: a14ff0ef jal ra,40003834 <msdos_format_printf>
if (fmt_params->fattype == FAT_FAT32) {
40004624: 04214c83 lbu s9,66(sp)
40004628: 00400793 li a5,4
4000462c: 0efc8663 beq s9,a5,40004718 <msdos_format+0xc84>
fmt_params->rsvd_sector_cnt = 1;
40004630: 00100793 li a5,1
40004634: 00f12c23 sw a5,24(sp)
if (fmt_params->fattype == FAT_FAT16) {
40004638: 00200793 li a5,2
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
4000463c: 01812283 lw t0,24(sp)
40004640: 00200813 li a6,2
40004644: 1ff00f13 li t5,511
if (fmt_params->fattype == FAT_FAT16) {
40004648: cefc82e3 beq s9,a5,4000432c <msdos_format+0x898>
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
4000464c: 000c8813 mv a6,s9
40004650: 03f00f13 li t5,63
40004654: cd9ff06f j 4000432c <msdos_format+0x898>
ret_val = msdos_format_gen_fsinfo(fmt_params.sec);
40004658: 06412783 lw a5,100(sp)
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
4000465c: 20000613 li a2,512
40004660: 00000593 li a1,0
40004664: 00078513 mv a0,a5
40004668: 308170ef jal ra,4001b970 <memset>
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
4000466c: 05200713 li a4,82
40004670: 06100693 li a3,97
40004674: 04100613 li a2,65
40004678: 00e50023 sb a4,0(a0)
4000467c: 00e500a3 sb a4,1(a0)
40004680: 00d50123 sb a3,2(a0)
40004684: 00c501a3 sb a2,3(a0)
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
40004688: 00050793 mv a5,a0
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
4000468c: 1ed783a3 sb a3,487(a5)
(fmt_params.fsinfo_sec != 0)) {
40004690: 03c12583 lw a1,60(sp)
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
40004694: 05500693 li a3,85
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO, 0xffffffff);
40004698: fff00713 li a4,-1
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
4000469c: 07200513 li a0,114
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
400046a0: 1ed78f23 sb a3,510(a5)
400046a4: faa00693 li a3,-86
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
400046a8: 1ea78223 sb a0,484(a5)
400046ac: 1ea782a3 sb a0,485(a5)
400046b0: 1ec78323 sb a2,486(a5)
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
400046b4: 1ed78fa3 sb a3,511(a5)
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO, 0xffffffff);
400046b8: 1ee78423 sb a4,488(a5)
400046bc: 1ee784a3 sb a4,489(a5)
400046c0: 1ee78523 sb a4,490(a5)
400046c4: 1ee785a3 sb a4,491(a5)
FAT_SET_FSINFO_NEXT_FREE_CLUSTER (fsinfo+FAT_FSI_INFO, 0xffffffff);
400046c8: 1ee78623 sb a4,492(a5)
400046cc: 1ee786a3 sb a4,493(a5)
400046d0: 1ee78723 sb a4,494(a5)
400046d4: 1ee787a3 sb a4,495(a5)
if ((ret_val == 0) &&
400046d8: 900584e3 beqz a1,40003fe0 <msdos_format+0x54c> <== NEVER TAKEN
ret_val = msdos_format_write_sec(fd,
400046dc: 01012903 lw s2,16(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
400046e0: 00000693 li a3,0
400046e4: 00048513 mv a0,s1
400046e8: 0325b633 mulhu a2,a1,s2
fmt_params.sec);
400046ec: 06412983 lw s3,100(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
400046f0: 032585b3 mul a1,a1,s2
400046f4: 2e9070ef jal ra,4000c1dc <lseek>
400046f8: d805cae3 bltz a1,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
if (0 > write(fd,buffer,sector_size)) {
400046fc: 00090613 mv a2,s2
40004700: 00098593 mv a1,s3
40004704: 00048513 mv a0,s1
40004708: d7dfe0ef jal ra,40003484 <write>
4000470c: 8c055ae3 bgez a0,40003fe0 <msdos_format+0x54c> <== ALWAYS TAKEN
40004710: fff00913 li s2,-1 <== NOT EXECUTED
40004714: a49ff06f j 4000415c <msdos_format+0x6c8> <== NOT EXECUTED
fmt_params->rsvd_sector_cnt = 32;
40004718: 02000793 li a5,32
4000471c: 00f12c23 sw a5,24(sp)
fmt_params->mbr_copy_sec = 6;
40004720: 00600793 li a5,6
40004724: 02f12c23 sw a5,56(sp)
fmt_params->fsinfo_sec = 1;
40004728: 00100793 li a5,1
+ fmt_params->bytes_per_sector - 1)
4000472c: 01012303 lw t1,16(sp)
fmt_params->files_per_root_dir = 0;
40004730: 02012423 sw zero,40(sp)
fmt_params->fsinfo_sec = 1;
40004734: 02f12e23 sw a5,60(sp)
40004738: 02000293 li t0,32
4000473c: 00400813 li a6,4
40004740: 00000f13 li t5,0
40004744: 00400c93 li s9,4
40004748: c05ff06f j 4000434c <msdos_format+0x8b8>
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
4000474c: 00000593 li a1,0
40004750: 220170ef jal ra,4001b970 <memset>
memcpy(MSDOS_DIR_NAME(fmt_params.sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
40004754: 06412783 lw a5,100(sp)
40004758: 05214503 lbu a0,82(sp)
4000475c: 05314583 lbu a1,83(sp)
40004760: 05414603 lbu a2,84(sp)
40004764: 05514683 lbu a3,85(sp)
40004768: 05614703 lbu a4,86(sp)
4000476c: 04d14e83 lbu t4,77(sp)
40004770: 04e14e03 lbu t3,78(sp)
40004774: 04f14303 lbu t1,79(sp)
40004778: 05014883 lbu a7,80(sp)
4000477c: 05114803 lbu a6,81(sp)
40004780: 04c14f03 lbu t5,76(sp)
40004784: 01d780a3 sb t4,1(a5)
40004788: 01c78123 sb t3,2(a5)
4000478c: 01e78023 sb t5,0(a5)
40004790: 006781a3 sb t1,3(a5)
40004794: 00a78323 sb a0,6(a5)
40004798: 00c78423 sb a2,8(a5)
4000479c: 00d784a3 sb a3,9(a5)
400047a0: 00e78523 sb a4,10(a5)
400047a4: 01178223 sb a7,4(a5)
400047a8: 010782a3 sb a6,5(a5)
400047ac: 00b783a3 sb a1,7(a5)
*MSDOS_DIR_ATTR(fmt_params.sec) = MSDOS_ATTR_VOLUME_ID;
400047b0: 06412783 lw a5,100(sp)
400047b4: 00800713 li a4,8
ret_val = msdos_format_write_sec
400047b8: 01012983 lw s3,16(sp)
*MSDOS_DIR_ATTR(fmt_params.sec) = MSDOS_ATTR_VOLUME_ID;
400047bc: 00e785a3 sb a4,11(a5)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
400047c0: 03012583 lw a1,48(sp)
400047c4: 00000693 li a3,0
400047c8: 00048513 mv a0,s1
400047cc: 02b9b633 mulhu a2,s3,a1
fmt_params.sec);
400047d0: 06412a03 lw s4,100(sp)
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
400047d4: 02b985b3 mul a1,s3,a1
400047d8: 205070ef jal ra,4000c1dc <lseek>
400047dc: ca05c8e3 bltz a1,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
if (0 > write(fd,buffer,sector_size)) {
400047e0: 00098613 mv a2,s3
400047e4: 000a0593 mv a1,s4
400047e8: 00048513 mv a0,s1
400047ec: c99fe0ef jal ra,40003484 <write>
400047f0: c8054ee3 bltz a0,4000448c <msdos_format+0x9f8> <== NEVER TAKEN
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
400047f4: 06412503 lw a0,100(sp)
400047f8: 01012603 lw a2,16(sp)
400047fc: 845ff06f j 40004040 <msdos_format+0x5ac>
if ( fmt_params->totl_sector_cnt == 0 )
40004800: 01412d83 lw s11,20(sp) <== NOT EXECUTED
40004804: c65ff06f j 40004468 <msdos_format+0x9d4> <== NOT EXECUTED
FAT_SET_VAL8(fmt_params.sec,0,(fmt_params.media_code));
40004808: 04114703 lbu a4,65(sp)
4000480c: 06412783 lw a5,100(sp)
break;
40004810: 00000993 li s3,0
FAT_SET_VAL8(fmt_params.sec,0,(fmt_params.media_code));
40004814: 00e78023 sb a4,0(a5)
FAT_SET_VAL8(fmt_params.sec,1,(0x0f | (FAT_FAT12_EOC << 4)));
40004818: 06412783 lw a5,100(sp)
4000481c: f8f00713 li a4,-113
40004820: 00e780a3 sb a4,1(a5)
FAT_SET_VAL8(fmt_params.sec,2,(FAT_FAT12_EOC >> 4));
40004824: 06412783 lw a5,100(sp)
40004828: fff00713 li a4,-1
4000482c: 00e78123 sb a4,2(a5)
break;
40004830: 845ff06f j 40004074 <msdos_format+0x5e0>
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
40004834: 04114683 lbu a3,65(sp)
40004838: 06412703 lw a4,100(sp)
4000483c: fff00793 li a5,-1
break;
40004840: 00000993 li s3,0
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
40004844: 00d70023 sb a3,0(a4)
40004848: 06412703 lw a4,100(sp)
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
4000484c: ff800693 li a3,-8
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
40004850: 00f700a3 sb a5,1(a4)
40004854: 06412703 lw a4,100(sp)
40004858: 00f70123 sb a5,2(a4)
4000485c: 06412703 lw a4,100(sp)
40004860: 00f701a3 sb a5,3(a4)
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
40004864: 06412703 lw a4,100(sp)
40004868: 00d70223 sb a3,4(a4)
4000486c: 06412703 lw a4,100(sp)
40004870: 00f702a3 sb a5,5(a4)
40004874: 06412703 lw a4,100(sp)
40004878: 00f70323 sb a5,6(a4)
4000487c: 06412783 lw a5,100(sp)
40004880: fcf00713 li a4,-49
40004884: 00e783a3 sb a4,7(a5)
break;
40004888: fecff06f j 40004074 <msdos_format+0x5e0>
FAT_SET_VAL8(fmt_params.sec,0,fmt_params.media_code);
4000488c: 04114683 lbu a3,65(sp)
40004890: 06412703 lw a4,100(sp)
FAT_SET_VAL8(fmt_params.sec,1,0xff);
40004894: fff00793 li a5,-1
break;
40004898: 00000993 li s3,0
FAT_SET_VAL8(fmt_params.sec,0,fmt_params.media_code);
4000489c: 00d70023 sb a3,0(a4)
FAT_SET_VAL8(fmt_params.sec,1,0xff);
400048a0: 06412703 lw a4,100(sp)
FAT_SET_VAL16(fmt_params.sec,2,FAT_FAT16_EOC);
400048a4: ff800693 li a3,-8
FAT_SET_VAL8(fmt_params.sec,1,0xff);
400048a8: 00f700a3 sb a5,1(a4)
FAT_SET_VAL16(fmt_params.sec,2,FAT_FAT16_EOC);
400048ac: 06412703 lw a4,100(sp)
400048b0: 00d70123 sb a3,2(a4)
400048b4: 06412703 lw a4,100(sp)
400048b8: 00f701a3 sb a5,3(a4)
break;
400048bc: fb8ff06f j 40004074 <msdos_format+0x5e0>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400048c0: 40026637 lui a2,0x40026
fmt_params->fat_num = 2;
400048c4: 00200793 li a5,2
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400048c8: 00200693 li a3,2
400048cc: 80c60613 addi a2,a2,-2036 # 4002580c <rtems_filesystem_null_handlers+0xf8>
400048d0: 00200593 li a1,2
400048d4: 00000513 li a0,0
fmt_params->fat_num = 2;
400048d8: 04f10023 sb a5,64(sp)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
400048dc: f59fe0ef jal ra,40003834 <msdos_format_printf>
{
400048e0: 000087b7 lui a5,0x8
400048e4: fa878793 addi a5,a5,-88 # 7fa8 <bsp_section_rodata_size+0x581c>
uint32_t fat16_sect_per_clust = 32;
400048e8: 02000713 li a4,32
400048ec: 985ff06f j 40004270 <msdos_format+0x7dc>
else if (fmt_params->totl_sector_cnt < FAT_FAT16_MAX_CLN * fat16_sect_per_clust) {
400048f0: 000107b7 lui a5,0x10
400048f4: ff578793 addi a5,a5,-11 # fff5 <bsp_section_rodata_size+0xd869>
400048f8: 02f70733 mul a4,a4,a5
400048fc: 1ae6f863 bgeu a3,a4,40004aac <msdos_format+0x1018>
fmt_params->fattype = FAT_FAT16;
40004900: 00200793 li a5,2
40004904: 04f10123 sb a5,66(sp)
fmt_params->sectors_per_cluster = 2;
40004908: 00f12e23 sw a5,28(sp)
4000490c: 97dff06f j 40004288 <msdos_format+0x7f4>
40004910: 00100713 li a4,1 <== NOT EXECUTED
40004914: b29ff06f j 4000443c <msdos_format+0x9a8> <== NOT EXECUTED
if ( fmt_params->totl_sector_cnt == 0 )
40004918: a80d8263 beqz s11,40003b9c <msdos_format+0x108> <== NEVER TAKEN
if (FAT_FAT32 != fmt_params->fattype)
4000491c: 00400613 li a2,4
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
40004920: 06014683 lbu a3,96(sp)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
40004924: 01c12703 lw a4,28(sp)
if (FAT_FAT32 != fmt_params->fattype)
40004928: 02c78663 beq a5,a2,40004954 <msdos_format+0xec0>
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
4000492c: 02c12603 lw a2,44(sp)
if (! skip_alignment)
40004930: 00069a63 bnez a3,40004944 <msdos_format+0xeb0>
return (sectors + clustersize - 1) & ~(clustersize - 1);
40004934: 00c707b3 add a5,a4,a2
40004938: fff78793 addi a5,a5,-1
4000493c: 40e00633 neg a2,a4
40004940: 00c7f633 and a2,a5,a2
* (fmt_params->bytes_per_sector / FAT_DIRENTRY_SIZE);
40004944: 01012783 lw a5,16(sp)
40004948: 0057d793 srli a5,a5,0x5
4000494c: 02c787b3 mul a5,a5,a2
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
40004950: 02f12423 sw a5,40(sp)
fmt_params->rsvd_sector_cnt = loc_align_object (fmt_params->rsvd_sector_cnt,
40004954: 01812983 lw s3,24(sp)
if (! skip_alignment)
40004958: 00069a63 bnez a3,4000496c <msdos_format+0xed8>
return (sectors + clustersize - 1) & ~(clustersize - 1);
4000495c: 013707b3 add a5,a4,s3
40004960: fff78793 addi a5,a5,-1
40004964: 40e00733 neg a4,a4
40004968: 00e7f9b3 and s3,a5,a4
fmt_params->rsvd_sector_cnt = loc_align_object (fmt_params->rsvd_sector_cnt,
4000496c: 01312c23 sw s3,24(sp)
if ((rqdata != NULL) && (rqdata->media != 0)) {
40004970: 04040463 beqz s0,400049b8 <msdos_format+0xf24>
40004974: 01444a03 lbu s4,20(s0)
40004978: 040a0063 beqz s4,400049b8 <msdos_format+0xf24>
const char valid_media_codes[] =
4000497c: fafa07b7 lui a5,0xfafa0
40004980: 8f078793 addi a5,a5,-1808 # faf9f8f0 <RamEnd+0xb9f9f8f0>
40004984: 00f12023 sw a5,0(sp)
40004988: fefe07b7 lui a5,0xfefe0
4000498c: cfb78793 addi a5,a5,-773 # fefdfcfb <RamEnd+0xbdfdfcfb>
40004990: 00f12223 sw a5,4(sp)
if (NULL==memchr(valid_media_codes,
40004994: 00900613 li a2,9
const char valid_media_codes[] =
40004998: fff00793 li a5,-1
if (NULL==memchr(valid_media_codes,
4000499c: 000a0593 mv a1,s4
400049a0: 00010513 mv a0,sp
const char valid_media_codes[] =
400049a4: 00f10423 sb a5,8(sp)
if (NULL==memchr(valid_media_codes,
400049a8: 561160ef jal ra,4001b708 <memchr>
400049ac: 9e050863 beqz a0,40003b9c <msdos_format+0x108> <== ALWAYS TAKEN
fmt_params->media_code = rqdata->media;
400049b0: 054100a3 sb s4,65(sp) <== NOT EXECUTED
if ((rqdata != NULL) && (rqdata->media != 0)) {
400049b4: 9fcff06f j 40003bb0 <msdos_format+0x11c> <== NOT EXECUTED
fmt_params->media_code = FAT_BR_MEDIA_FIXED;
400049b8: ff800793 li a5,-8
400049bc: 04f100a3 sb a5,65(sp)
400049c0: 9f0ff06f j 40003bb0 <msdos_format+0x11c>
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
400049c4: 02012703 lw a4,32(sp)
FAT_SET_BR_FAT32_ROOT_CLUSTER(mbr , 2); /* put root dir to cluster 2 */
400049c8: 02d78623 sb a3,44(a5)
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
400049cc: 02c78823 sb a2,48(a5)
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
400049d0: 00875593 srli a1,a4,0x8
400049d4: 01075613 srli a2,a4,0x10
400049d8: 01875693 srli a3,a4,0x18
400049dc: 02b782a3 sb a1,37(a5)
400049e0: 02c78323 sb a2,38(a5)
400049e4: 02e78223 sb a4,36(a5)
400049e8: 02d783a3 sb a3,39(a5)
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
400049ec: 03812683 lw a3,56(sp)
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
400049f0: 02078a23 sb zero,52(a5)
400049f4: 02078aa3 sb zero,53(a5)
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
400049f8: 0086d613 srli a2,a3,0x8
400049fc: 02d78923 sb a3,50(a5)
FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL);
40004a00: 02900693 li a3,41
40004a04: 04d78123 sb a3,66(a5)
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
40004a08: 400266b7 lui a3,0x40026
40004a0c: 86868693 addi a3,a3,-1944 # 40025868 <rtems_filesystem_null_handlers+0x154>
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
40004a10: 02c789a3 sb a2,51(a5)
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
40004a14: 02078b23 sb zero,54(a5)
40004a18: 02078ba3 sb zero,55(a5)
40004a1c: 02078c23 sb zero,56(a5)
40004a20: 02078ca3 sb zero,57(a5)
40004a24: 02078d23 sb zero,58(a5)
40004a28: 02078da3 sb zero,59(a5)
40004a2c: 02078e23 sb zero,60(a5)
40004a30: 02078ea3 sb zero,61(a5)
40004a34: 02078f23 sb zero,62(a5)
40004a38: 02078fa3 sb zero,63(a5)
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
40004a3c: 040783a3 sb zero,71(a5)
40004a40: 04078423 sb zero,72(a5)
40004a44: 040784a3 sb zero,73(a5)
40004a48: 04078523 sb zero,74(a5)
40004a4c: 040785a3 sb zero,75(a5)
40004a50: 04078623 sb zero,76(a5)
40004a54: 040786a3 sb zero,77(a5)
40004a58: 04078723 sb zero,78(a5)
40004a5c: 040787a3 sb zero,79(a5)
40004a60: 04078823 sb zero,80(a5)
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
40004a64: 0006ce03 lbu t3,0(a3)
40004a68: 0016c303 lbu t1,1(a3)
40004a6c: 0026c883 lbu a7,2(a3)
40004a70: 0036c803 lbu a6,3(a3)
40004a74: 0046c503 lbu a0,4(a3)
40004a78: 0056c583 lbu a1,5(a3)
40004a7c: 0066c603 lbu a2,6(a3)
40004a80: 0076c683 lbu a3,7(a3)
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
40004a84: 040788a3 sb zero,81(a5)
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
40004a88: 05c78923 sb t3,82(a5)
40004a8c: 046789a3 sb t1,83(a5)
40004a90: 05178a23 sb a7,84(a5)
40004a94: 05078aa3 sb a6,85(a5)
40004a98: 04a78b23 sb a0,86(a5)
40004a9c: 04b78ba3 sb a1,87(a5)
40004aa0: 04c78c23 sb a2,88(a5)
40004aa4: 04d78ca3 sb a3,89(a5)
40004aa8: c6cff06f j 40003f14 <msdos_format+0x480>
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
40004aac: 400007b7 lui a5,0x40000
40004ab0: 00fa07b3 add a5,s4,a5
40004ab4: 0147b633 sltu a2,a5,s4
40004ab8: 01360633 add a2,a2,s3
40004abc: 01e7d793 srli a5,a5,0x1e
40004ac0: 00261613 slli a2,a2,0x2
40004ac4: 00f66633 or a2,a2,a5
fmt_params->fattype = FAT_FAT32;
40004ac8: 00400793 li a5,4
40004acc: 04f10123 sb a5,66(sp)
if ((gigs & (1 << b)) != 0)
40004ad0: 00100593 li a1,1
for (b = 31; b > 0; b--)
40004ad4: 01f00793 li a5,31
40004ad8: 0080006f j 40004ae0 <msdos_format+0x104c>
40004adc: 02078e63 beqz a5,40004b18 <msdos_format+0x1084>
if ((gigs & (1 << b)) != 0)
40004ae0: 00f59733 sll a4,a1,a5
40004ae4: 00e676b3 and a3,a2,a4
for (b = 31; b > 0; b--)
40004ae8: fff78793 addi a5,a5,-1 # 3fffffff <RamSize+0x3effffff>
if ((gigs & (1 << b)) != 0)
40004aec: fe0688e3 beqz a3,40004adc <msdos_format+0x1048>
fmt_params->sectors_per_cluster = 1 << b;
40004af0: 00e12e23 sw a4,28(sp)
40004af4: f94ff06f j 40004288 <msdos_format+0x7f4>
*volid_ptr = rand();
40004af8: 7bc170ef jal ra,4001c2b4 <rand>
40004afc: 04a12e23 sw a0,92(sp)
40004b00: 9a4ff06f j 40003ca4 <msdos_format+0x210>
errno = EINVAL;
40004b04: 454160ef jal ra,4001af58 <__errno>
40004b08: 01600793 li a5,22
40004b0c: 00f52023 sw a5,0(a0)
ret_val = -1;
40004b10: fff00913 li s2,-1
40004b14: 880ff06f j 40003b94 <msdos_format+0x100>
40004b18: 00100713 li a4,1
fmt_params->sectors_per_cluster = 1 << b;
40004b1c: 00e12e23 sw a4,28(sp)
40004b20: f68ff06f j 40004288 <msdos_format+0x7f4>
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
40004b24: 03d7d7b3 divu a5,a5,t4
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
40004b28: 00e12e23 sw a4,28(sp)
if ( number_of_clusters < FAT_FAT12_MAX_CLN
40004b2c: ff4b8613 addi a2,s7,-12
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
40004b30: 02f12023 sw a5,32(sp)
uint32_t ms_sectors_per_cluster_limit_FAT16 =
40004b34: 000087b7 lui a5,0x8
40004b38: 00178793 addi a5,a5,1 # 8001 <bsp_section_rodata_size+0x5875>
40004b3c: 0267d7b3 divu a5,a5,t1
if ( number_of_clusters < FAT_FAT12_MAX_CLN
40004b40: a8d66ce3 bltu a2,a3,400045d8 <msdos_format+0xb44>
uint32_t ms_sectors_per_cluster_limit_FAT12 =
40004b44: 001b8613 addi a2,s7,1
40004b48: 02665633 divu a2,a2,t1
40004b4c: a45ff06f j 40004590 <msdos_format+0xafc>
400108e4 <msdos_format_dirent_with_dot>:
{
400108e4: 00050313 mv t1,a0
i > 0 && *src_tmp == ' ';
400108e8: 02000693 li a3,32
for (i = MSDOS_SHORT_BASE_LEN, src_tmp = src + MSDOS_SHORT_BASE_LEN - 1;
400108ec: 00800513 li a0,8
i > 0 && *src_tmp == ' ';
400108f0: 00a58733 add a4,a1,a0
400108f4: fff74703 lbu a4,-1(a4)
400108f8: 00050e13 mv t3,a0
--i,--src_tmp)
400108fc: fff50513 addi a0,a0,-1
i > 0 && *src_tmp == ' ';
40010900: 02d71663 bne a4,a3,4001092c <msdos_format_dirent_with_dot+0x48>
for (i = MSDOS_SHORT_BASE_LEN, src_tmp = src + MSDOS_SHORT_BASE_LEN - 1;
40010904: fe0516e3 bnez a0,400108f0 <msdos_format_dirent_with_dot+0xc> <== ALWAYS TAKEN
i > 0 && *src_tmp == ' ';
40010908: 00a5c703 lbu a4,10(a1)
4001090c: 02000693 li a3,32
40010910: 06d71a63 bne a4,a3,40010984 <msdos_format_dirent_with_dot+0xa0>
40010914: 0095c683 lbu a3,9(a1)
40010918: 0ee69463 bne a3,a4,40010a00 <msdos_format_dirent_with_dot+0x11c>
4001091c: 0085c703 lbu a4,8(a1)
40010920: 0ed71e63 bne a4,a3,40010a1c <msdos_format_dirent_with_dot+0x138>
*dst = '\0'; /* terminate string */
40010924: 00030023 sb zero,0(t1)
}
40010928: 00008067 ret
4001092c: 40027eb7 lui t4,0x40027
40010930: 00058693 mv a3,a1
40010934: 00030813 mv a6,t1
40010938: 109e8e93 addi t4,t4,265 # 40027109 <_ctype_+0x1>
*dst++ = tolower((unsigned char)(*src_tmp++));
4001093c: 00100893 li a7,1
40010940: 0006c703 lbu a4,0(a3)
40010944: 00168693 addi a3,a3,1
while (i-- > 0) {
40010948: 40d887b3 sub a5,a7,a3
*dst++ = tolower((unsigned char)(*src_tmp++));
4001094c: 00ee8633 add a2,t4,a4
40010950: 00064603 lbu a2,0(a2)
while (i-- > 0) {
40010954: 00f587b3 add a5,a1,a5
*dst++ = tolower((unsigned char)(*src_tmp++));
40010958: 00180813 addi a6,a6,1
4001095c: 00367613 andi a2,a2,3
while (i-- > 0) {
40010960: 00a787b3 add a5,a5,a0
*dst++ = tolower((unsigned char)(*src_tmp++));
40010964: 01161663 bne a2,a7,40010970 <msdos_format_dirent_with_dot+0x8c>
40010968: 02070713 addi a4,a4,32
4001096c: 0ff77713 andi a4,a4,255
40010970: fee80fa3 sb a4,-1(a6)
while (i-- > 0) {
40010974: fcf046e3 bgtz a5,40010940 <msdos_format_dirent_with_dot+0x5c>
*dst++ = tolower((unsigned char)(*src_tmp++));
40010978: 01c30333 add t1,t1,t3
4001097c: 000e0513 mv a0,t3
40010980: f89ff06f j 40010908 <msdos_format_dirent_with_dot+0x24>
*dst++ = '.'; /* append dot */
40010984: 02e00793 li a5,46
40010988: 00f30023 sb a5,0(t1)
4001098c: 00130f13 addi t5,t1,1
++len; /* dot */
40010990: 00150513 addi a0,a0,1
src_tmp = src + MSDOS_SHORT_BASE_LEN;
40010994: 00858793 addi a5,a1,8
--i, --src_tmp)
40010998: 00200813 li a6,2
4001099c: 40027eb7 lui t4,0x40027
400109a0: 000f0613 mv a2,t5
400109a4: 109e8e93 addi t4,t4,265 # 40027109 <_ctype_+0x1>
*dst++ = tolower((unsigned char)(*src_tmp++));
400109a8: 00100e13 li t3,1
while (i-- > 0) {
400109ac: 00200893 li a7,2
*dst++ = tolower((unsigned char)(*src_tmp++));
400109b0: 0007c683 lbu a3,0(a5)
400109b4: 00160613 addi a2,a2,1
while (i-- > 0) {
400109b8: 40c88733 sub a4,a7,a2
*dst++ = tolower((unsigned char)(*src_tmp++));
400109bc: 00de85b3 add a1,t4,a3
400109c0: 0005c583 lbu a1,0(a1)
while (i-- > 0) {
400109c4: 00e30733 add a4,t1,a4
400109c8: 01070733 add a4,a4,a6
*dst++ = tolower((unsigned char)(*src_tmp++));
400109cc: 0035f593 andi a1,a1,3
400109d0: 00178793 addi a5,a5,1
400109d4: 01c59663 bne a1,t3,400109e0 <msdos_format_dirent_with_dot+0xfc>
400109d8: 02068693 addi a3,a3,32
400109dc: 0ff6f693 andi a3,a3,255
400109e0: fed60fa3 sb a3,-1(a2)
while (i-- > 0) {
400109e4: fce046e3 bgtz a4,400109b0 <msdos_format_dirent_with_dot+0xcc>
*dst++ = tolower((unsigned char)(*src_tmp++));
400109e8: 00180313 addi t1,a6,1
400109ec: 006f0333 add t1,t5,t1
400109f0: 00150513 addi a0,a0,1
++len;
400109f4: 01050533 add a0,a0,a6
*dst = '\0'; /* terminate string */
400109f8: 00030023 sb zero,0(t1)
}
400109fc: 00008067 ret
*dst++ = '.'; /* append dot */
40010a00: 02e00793 li a5,46
40010a04: 00f30023 sb a5,0(t1)
40010a08: 00130f13 addi t5,t1,1
++len; /* dot */
40010a0c: 00150513 addi a0,a0,1
src_tmp = src + MSDOS_SHORT_BASE_LEN;
40010a10: 00858793 addi a5,a1,8
--i, --src_tmp)
40010a14: 00100813 li a6,1
40010a18: f85ff06f j 4001099c <msdos_format_dirent_with_dot+0xb8>
*dst++ = '.'; /* append dot */
40010a1c: 02e00793 li a5,46
40010a20: 00f30023 sb a5,0(t1)
40010a24: 00130f13 addi t5,t1,1
++len; /* dot */
40010a28: 00150513 addi a0,a0,1
src_tmp = src + MSDOS_SHORT_BASE_LEN;
40010a2c: 00858793 addi a5,a1,8
--i, --src_tmp)
40010a30: 00000813 li a6,0
40010a34: f69ff06f j 4001099c <msdos_format_dirent_with_dot+0xb8>
40011480 <msdos_get_dotdot_dir_info_cluster_num_and_offset>:
{
40011480: f9010113 addi sp,sp,-112
40011484: 05312e23 sw s3,92(sp)
msdos_fs_info_t *fs_info = mt_entry->fs_info;
40011488: 00852983 lw s3,8(a0)
{
4001148c: 06912223 sw s1,100(sp)
40011490: 00060493 mv s1,a2
40011494: 07212023 sw s2,96(sp)
40011498: 05512a23 sw s5,84(sp)
4001149c: 00050913 mv s2,a0
400114a0: 00058a93 mv s5,a1
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
400114a4: 00c10613 addi a2,sp,12
400114a8: 00048593 mv a1,s1
400114ac: 00098513 mv a0,s3
{
400114b0: 06812423 sw s0,104(sp)
400114b4: 05412c23 sw s4,88(sp)
400114b8: 05612823 sw s6,80(sp)
400114bc: 06112623 sw ra,108(sp)
rtems_dosfs_convert_control *converter = fs_info->converter;
400114c0: 0cc9ab03 lw s6,204(s3)
{
400114c4: 00068a13 mv s4,a3
fat_file_fd_t *fat_fd = NULL;
400114c8: 00012623 sw zero,12(sp)
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
400114cc: aecfd0ef jal ra,4000e7b8 <fat_file_open>
400114d0: 00050413 mv s0,a0
if (rc != RC_OK)
400114d4: 02050863 beqz a0,40011504 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x84><== ALWAYS TAKEN
}
400114d8: 06c12083 lw ra,108(sp)
400114dc: 00040513 mv a0,s0
400114e0: 06812403 lw s0,104(sp)
400114e4: 06412483 lw s1,100(sp)
400114e8: 06012903 lw s2,96(sp)
400114ec: 05c12983 lw s3,92(sp)
400114f0: 05812a03 lw s4,88(sp)
400114f4: 05412a83 lw s5,84(sp)
400114f8: 05012b03 lw s6,80(sp)
400114fc: 07010113 addi sp,sp,112
40011500: 00008067 ret
fat_fd->cln = cln;
40011504: 00c12583 lw a1,12(sp)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
40011508: 002007b7 lui a5,0x200
rc = fat_file_size(&fs_info->fat, fat_fd);
4001150c: 00098513 mv a0,s3
fat_fd->cln = cln;
40011510: 0155ae23 sw s5,28(a1)
fat_fd->fat_file_type = FAT_DIRECTORY;
40011514: 0005a823 sw zero,16(a1)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
40011518: 00f5aa23 sw a5,20(a1)
fat_fd->map.file_cln = 0;
4001151c: 0205aa23 sw zero,52(a1)
fat_fd->map.disk_cln = fat_fd->cln;
40011520: 0355ac23 sw s5,56(a1)
rc = fat_file_size(&fs_info->fat, fat_fd);
40011524: fa1fd0ef jal ra,4000f4c4 <fat_file_size>
40011528: 00050413 mv s0,a0
if (rc != RC_OK)
4001152c: 18051a63 bnez a0,400116c0 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x240><== NEVER TAKEN
msdos_long_to_short(
40011530: 40025437 lui s0,0x40025
40011534: 6c440593 addi a1,s0,1732 # 400256c4 <rtems_filesystem_default_pathconf+0x40>
40011538: 00b00713 li a4,11
4001153c: 01010693 addi a3,sp,16
40011540: 00100613 li a2,1
40011544: 000b0513 mv a0,s6
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
40011548: 00012823 sw zero,16(sp)
4001154c: 00012a23 sw zero,20(sp)
40011550: 00012c23 sw zero,24(sp)
40011554: 00012e23 sw zero,28(sp)
40011558: 02012023 sw zero,32(sp)
4001155c: 02012223 sw zero,36(sp)
40011560: 02012423 sw zero,40(sp)
40011564: 02012623 sw zero,44(sp)
msdos_long_to_short(
40011568: b2dfe0ef jal ra,40010094 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, (const uint8_t*)".", 1,
4001156c: 00c12583 lw a1,12(sp)
40011570: 6c440693 addi a3,s0,1732
40011574: 01010893 addi a7,sp,16
40011578: 00048813 mv a6,s1
4001157c: 00100793 li a5,1
40011580: 00100713 li a4,1
40011584: 00000613 li a2,0
40011588: 00090513 mv a0,s2
4001158c: cacff0ef jal ra,40010a38 <msdos_find_name_in_fat_file>
40011590: 00050413 mv s0,a0
if (rc != RC_OK)
40011594: 12051663 bnez a0,400116c0 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x240><== NEVER TAKEN
msdos_long_to_short(
40011598: 40026437 lui s0,0x40026
4001159c: d4c40593 addi a1,s0,-692 # 40025d4c <rtems_blkdev_imfs_node+0x74>
400115a0: 00b00713 li a4,11
400115a4: 03010693 addi a3,sp,48
400115a8: 00200613 li a2,2
400115ac: 000b0513 mv a0,s6
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
400115b0: 02012823 sw zero,48(sp)
400115b4: 02012a23 sw zero,52(sp)
400115b8: 02012c23 sw zero,56(sp)
400115bc: 02012e23 sw zero,60(sp)
400115c0: 04012023 sw zero,64(sp)
400115c4: 04012223 sw zero,68(sp)
400115c8: 04012423 sw zero,72(sp)
400115cc: 04012623 sw zero,76(sp)
msdos_long_to_short(
400115d0: ac5fe0ef jal ra,40010094 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, (const uint8_t*)"..", 2,
400115d4: 00c12583 lw a1,12(sp)
400115d8: d4c40693 addi a3,s0,-692
400115dc: 03010893 addi a7,sp,48
400115e0: 00048813 mv a6,s1
400115e4: 00100793 li a5,1
400115e8: 00200713 li a4,2
400115ec: 00000613 li a2,0
400115f0: 00090513 mv a0,s2
400115f4: c44ff0ef jal ra,40010a38 <msdos_find_name_in_fat_file>
400115f8: 00050413 mv s0,a0
fat_file_close(&fs_info->fat, fat_fd);
400115fc: 00c12583 lw a1,12(sp)
40011600: 00098513 mv a0,s3
if (rc != RC_OK)
40011604: 0c041863 bnez s0,400116d4 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x254><== NEVER TAKEN
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
40011608: 02a15b03 lhu s6,42(sp)
4001160c: 02415a83 lhu s5,36(sp)
rc = fat_file_close(&fs_info->fat, fat_fd);
40011610: 84dfd0ef jal ra,4000ee5c <fat_file_close>
40011614: 00050413 mv s0,a0
if ( rc != RC_OK )
40011618: ec0510e3 bnez a0,400114d8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x58><== NEVER TAKEN
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
4001161c: 04415783 lhu a5,68(sp)
40011620: 04a15703 lhu a4,74(sp)
40011624: 01079793 slli a5,a5,0x10
40011628: 00e7e7b3 or a5,a5,a4
4001162c: 0a078863 beqz a5,400116dc <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x25c>
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
40011630: 00c10613 addi a2,sp,12
40011634: 00048593 mv a1,s1
40011638: 00098513 mv a0,s3
4001163c: 97cfd0ef jal ra,4000e7b8 <fat_file_open>
40011640: 00050413 mv s0,a0
if (rc != RC_OK)
40011644: e8051ae3 bnez a0,400114d8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x58><== NEVER TAKEN
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
40011648: 04415783 lhu a5,68(sp)
4001164c: 04a15703 lhu a4,74(sp)
fat_fd->cln = fs_info->fat.vol.rdir_cl;
40011650: 00c12583 lw a1,12(sp)
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
40011654: 01079793 slli a5,a5,0x10
40011658: 00e7e7b3 or a5,a5,a4
4001165c: 08078e63 beqz a5,400116f8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x278>
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node);
40011660: 00f5ae23 sw a5,28(a1)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
40011664: 00200737 lui a4,0x200
fat_fd->fat_file_type = FAT_DIRECTORY;
40011668: 0005a823 sw zero,16(a1)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
4001166c: 00e5aa23 sw a4,20(a1)
fat_fd->map.file_cln = 0;
40011670: 0205aa23 sw zero,52(a1)
fat_fd->map.disk_cln = fat_fd->cln;
40011674: 02f5ac23 sw a5,56(a1)
rc = fat_file_size(&fs_info->fat, fat_fd);
40011678: 00098513 mv a0,s3
4001167c: e49fd0ef jal ra,4000f4c4 <fat_file_size>
fat_file_close(&fs_info->fat, fat_fd);
40011680: 00c12583 lw a1,12(sp)
rc = fat_file_size(&fs_info->fat, fat_fd);
40011684: 00050413 mv s0,a0
if (rc != RC_OK)
40011688: 04051463 bnez a0,400116d0 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x250><== NEVER TAKEN
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
4001168c: 010a9613 slli a2,s5,0x10
rc = msdos_find_node_by_cluster_num_in_fat_file(mt_entry, fat_fd, cl4find,
40011690: 000a0713 mv a4,s4
40011694: 00048693 mv a3,s1
40011698: 01666633 or a2,a2,s6
4001169c: 00090513 mv a0,s2
400116a0: c41ff0ef jal ra,400112e0 <msdos_find_node_by_cluster_num_in_fat_file>
400116a4: 00050413 mv s0,a0
fat_file_close(&fs_info->fat, fat_fd);
400116a8: 00c12583 lw a1,12(sp)
400116ac: 00098513 mv a0,s3
if (rc != RC_OK)
400116b0: 02041263 bnez s0,400116d4 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x254><== NEVER TAKEN
rc = fat_file_close(&fs_info->fat, fat_fd);
400116b4: fa8fd0ef jal ra,4000ee5c <fat_file_close>
400116b8: 00050413 mv s0,a0
return rc;
400116bc: e1dff06f j 400114d8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x58>
fat_file_close(&fs_info->fat, fat_fd);
400116c0: 00c12583 lw a1,12(sp) <== NOT EXECUTED
400116c4: 00098513 mv a0,s3 <== NOT EXECUTED
400116c8: f94fd0ef jal ra,4000ee5c <fat_file_close> <== NOT EXECUTED
return rc;
400116cc: e0dff06f j 400114d8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x58><== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
400116d0: 00098513 mv a0,s3 <== NOT EXECUTED
400116d4: f88fd0ef jal ra,4000ee5c <fat_file_close> <== NOT EXECUTED
return rc;
400116d8: e01ff06f j 400114d8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x58><== NOT EXECUTED
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
400116dc: fff00793 li a5,-1
400116e0: 00f4a423 sw a5,8(s1)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
400116e4: 00f4a623 sw a5,12(s1)
dir_pos->sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
400116e8: 00100793 li a5,1
dir_pos->sname.ofs = 0;
400116ec: 0004a223 sw zero,4(s1)
400116f0: 00f4a023 sw a5,0(s1)
400116f4: f3dff06f j 40011630 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1b0>
fat_fd->cln = fs_info->fat.vol.rdir_cl;
400116f8: 0449a783 lw a5,68(s3)
400116fc: 00f5ae23 sw a5,28(a1)
40011700: f65ff06f j 40011664 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1e4>
40011704 <msdos_get_name_node>:
{
40011704: fe010113 addi sp,sp,-32
40011708: 00812c23 sw s0,24(sp)
4001170c: 00912a23 sw s1,20(sp)
40011710: 00050413 mv s0,a0
40011714: 00058493 mv s1,a1
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
40011718: 00852583 lw a1,8(a0)
4001171c: 01452503 lw a0,20(a0)
{
40011720: 01212823 sw s2,16(sp)
40011724: 00078913 mv s2,a5
40011728: 01312623 sw s3,12(sp)
4001172c: 01412423 sw s4,8(sp)
40011730: 00060993 mv s3,a2
40011734: 00070793 mv a5,a4
40011738: 00080a13 mv s4,a6
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
4001173c: 00080893 mv a7,a6
40011740: 00068713 mv a4,a3
40011744: 00090813 mv a6,s2
40011748: 00060693 mv a3,a2
4001174c: 00048613 mv a2,s1
{
40011750: 00112e23 sw ra,28(sp)
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
40011754: ae4ff0ef jal ra,40010a38 <msdos_find_name_in_fat_file>
if ((rc != RC_OK) && (rc != MSDOS_NAME_NOT_FOUND_ERR))
40011758: 00051463 bnez a0,40011760 <msdos_get_name_node+0x5c>
if (!create_node)
4001175c: 02048263 beqz s1,40011780 <msdos_get_name_node+0x7c>
}
40011760: 01c12083 lw ra,28(sp)
40011764: 01812403 lw s0,24(sp)
40011768: 01412483 lw s1,20(sp)
4001176c: 01012903 lw s2,16(sp)
40011770: 00c12983 lw s3,12(sp)
40011774: 00812a03 lw s4,8(sp)
40011778: 02010113 addi sp,sp,32
4001177c: 00008067 ret
if (strncmp(name, "..", 2) == 0)
40011780: 0009c783 lbu a5,0(s3)
40011784: fd278793 addi a5,a5,-46 # 1fffd2 <bsp_section_text_size+0x1dafba>
40011788: fc079ce3 bnez a5,40011760 <msdos_get_name_node+0x5c>
4001178c: 0019c783 lbu a5,1(s3)
40011790: fd278793 addi a5,a5,-46
40011794: fc0796e3 bnez a5,40011760 <msdos_get_name_node+0x5c> <== NEVER TAKEN
dotdot_cln = MSDOS_EXTRACT_CLUSTER_NUM((name_dir_entry));
40011798: 014a5583 lhu a1,20(s4)
4001179c: 01aa5783 lhu a5,26(s4)
400117a0: 01059593 slli a1,a1,0x10
400117a4: 00f5e5b3 or a1,a1,a5
if (dotdot_cln == 0)
400117a8: 02059063 bnez a1,400117c8 <msdos_get_name_node+0xc4>
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
400117ac: fff00793 li a5,-1
400117b0: 00f92423 sw a5,8(s2)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
400117b4: 00f92623 sw a5,12(s2)
dir_pos->sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
400117b8: 00100793 li a5,1
dir_pos->sname.ofs = 0;
400117bc: 00092223 sw zero,4(s2)
400117c0: 00f92023 sw a5,0(s2)
400117c4: f9dff06f j 40011760 <msdos_get_name_node+0x5c>
msdos_get_dotdot_dir_info_cluster_num_and_offset(parent_loc->mt_entry,
400117c8: 01442503 lw a0,20(s0)
}
400117cc: 01812403 lw s0,24(sp)
400117d0: 01c12083 lw ra,28(sp)
400117d4: 01412483 lw s1,20(sp)
400117d8: 00c12983 lw s3,12(sp)
msdos_get_dotdot_dir_info_cluster_num_and_offset(parent_loc->mt_entry,
400117dc: 000a0693 mv a3,s4
400117e0: 00090613 mv a2,s2
}
400117e4: 00812a03 lw s4,8(sp)
400117e8: 01012903 lw s2,16(sp)
400117ec: 02010113 addi sp,sp,32
msdos_get_dotdot_dir_info_cluster_num_and_offset(parent_loc->mt_entry,
400117f0: c91ff06f j 40011480 <msdos_get_dotdot_dir_info_cluster_num_and_offset>
4000ff3c <msdos_get_utf16_string_from_long_entry.part.0>:
msdos_get_utf16_string_from_long_entry (
4000ff3c: ff010113 addi sp,sp,-16 <== NOT EXECUTED
4000ff40: 00912423 sw s1,8(sp) <== NOT EXECUTED
4000ff44: 00812623 sw s0,12(sp) <== NOT EXECUTED
memcpy (&entry_string_buf[0], &entry[1], 10 );
4000ff48: 00954703 lbu a4,9(a0) <== NOT EXECUTED
4000ff4c: 00154f83 lbu t6,1(a0) <== NOT EXECUTED
4000ff50: 00254f03 lbu t5,2(a0) <== NOT EXECUTED
4000ff54: 00354e83 lbu t4,3(a0) <== NOT EXECUTED
4000ff58: 00454e03 lbu t3,4(a0) <== NOT EXECUTED
4000ff5c: 00554303 lbu t1,5(a0) <== NOT EXECUTED
4000ff60: 00654883 lbu a7,6(a0) <== NOT EXECUTED
4000ff64: 00754803 lbu a6,7(a0) <== NOT EXECUTED
4000ff68: 00854683 lbu a3,8(a0) <== NOT EXECUTED
4000ff6c: 00a54783 lbu a5,10(a0) <== NOT EXECUTED
4000ff70: 00e58423 sb a4,8(a1) <== NOT EXECUTED
4000ff74: 01f58023 sb t6,0(a1) <== NOT EXECUTED
4000ff78: 01e580a3 sb t5,1(a1) <== NOT EXECUTED
4000ff7c: 01d58123 sb t4,2(a1) <== NOT EXECUTED
4000ff80: 01c581a3 sb t3,3(a1) <== NOT EXECUTED
4000ff84: 00658223 sb t1,4(a1) <== NOT EXECUTED
4000ff88: 011582a3 sb a7,5(a1) <== NOT EXECUTED
4000ff8c: 01058323 sb a6,6(a1) <== NOT EXECUTED
4000ff90: 00d583a3 sb a3,7(a1) <== NOT EXECUTED
4000ff94: 00f584a3 sb a5,9(a1) <== NOT EXECUTED
memcpy (&entry_string_buf[5], &entry[14], 12 );
4000ff98: 01854803 lbu a6,24(a0) <== NOT EXECUTED
4000ff9c: 00f54403 lbu s0,15(a0) <== NOT EXECUTED
4000ffa0: 01054383 lbu t2,16(a0) <== NOT EXECUTED
4000ffa4: 01154283 lbu t0,17(a0) <== NOT EXECUTED
4000ffa8: 01254f83 lbu t6,18(a0) <== NOT EXECUTED
4000ffac: 01354f03 lbu t5,19(a0) <== NOT EXECUTED
4000ffb0: 01454e83 lbu t4,20(a0) <== NOT EXECUTED
4000ffb4: 01554e03 lbu t3,21(a0) <== NOT EXECUTED
4000ffb8: 01654303 lbu t1,22(a0) <== NOT EXECUTED
4000ffbc: 01754883 lbu a7,23(a0) <== NOT EXECUTED
4000ffc0: 01954683 lbu a3,25(a0) <== NOT EXECUTED
4000ffc4: 00e54483 lbu s1,14(a0) <== NOT EXECUTED
memcpy (&entry_string_buf[11], &entry[28], 4 );
4000ffc8: 01c50713 addi a4,a0,28 <== NOT EXECUTED
memcpy (&entry_string_buf[5], &entry[14], 12 );
4000ffcc: 008585a3 sb s0,11(a1) <== NOT EXECUTED
4000ffd0: 00958523 sb s1,10(a1) <== NOT EXECUTED
4000ffd4: 00758623 sb t2,12(a1) <== NOT EXECUTED
4000ffd8: 005586a3 sb t0,13(a1) <== NOT EXECUTED
4000ffdc: 01f58723 sb t6,14(a1) <== NOT EXECUTED
4000ffe0: 01e587a3 sb t5,15(a1) <== NOT EXECUTED
4000ffe4: 01d58823 sb t4,16(a1) <== NOT EXECUTED
4000ffe8: 01c588a3 sb t3,17(a1) <== NOT EXECUTED
4000ffec: 00658923 sb t1,18(a1) <== NOT EXECUTED
4000fff0: 011589a3 sb a7,19(a1) <== NOT EXECUTED
4000fff4: 01058a23 sb a6,20(a1) <== NOT EXECUTED
4000fff8: 00d58aa3 sb a3,21(a1) <== NOT EXECUTED
memcpy (&entry_string_buf[11], &entry[28], 4 );
4000fffc: 01c54803 lbu a6,28(a0) <== NOT EXECUTED
40010000: 00274683 lbu a3,2(a4) <== NOT EXECUTED
40010004: 01d54503 lbu a0,29(a0) <== NOT EXECUTED
40010008: 00374703 lbu a4,3(a4) <== NOT EXECUTED
4001000c: 01058b23 sb a6,22(a1) <== NOT EXECUTED
40010010: 00a58ba3 sb a0,23(a1) <== NOT EXECUTED
40010014: 00d58c23 sb a3,24(a1) <== NOT EXECUTED
40010018: 00e58ca3 sb a4,25(a1) <== NOT EXECUTED
if (is_first_entry) {
4001001c: 02060063 beqz a2,4001003c <msdos_get_utf16_string_from_long_entry.part.0+0x100><== NOT EXECUTED
for (chars_in_entry = 0;
40010020: 00000513 li a0,0 <== NOT EXECUTED
40010024: 00d00713 li a4,13 <== NOT EXECUTED
&& entry_string_buf[chars_in_entry] != 0x0000);
40010028: 0005d783 lhu a5,0(a1) <== NOT EXECUTED
for (chars_in_entry = 0;
4001002c: 00258593 addi a1,a1,2 <== NOT EXECUTED
&& entry_string_buf[chars_in_entry] != 0x0000);
40010030: 02078063 beqz a5,40010050 <msdos_get_utf16_string_from_long_entry.part.0+0x114><== NOT EXECUTED
++chars_in_entry) {
40010034: 00150513 addi a0,a0,1 <== NOT EXECUTED
for (chars_in_entry = 0;
40010038: fee518e3 bne a0,a4,40010028 <msdos_get_utf16_string_from_long_entry.part.0+0xec><== NOT EXECUTED
}
4001003c: 00c12403 lw s0,12(sp) <== NOT EXECUTED
40010040: 00812483 lw s1,8(sp) <== NOT EXECUTED
40010044: 01a00513 li a0,26 <== NOT EXECUTED
40010048: 01010113 addi sp,sp,16 <== NOT EXECUTED
4001004c: 00008067 ret <== NOT EXECUTED
40010050: 00c12403 lw s0,12(sp) <== NOT EXECUTED
40010054: 00812483 lw s1,8(sp) <== NOT EXECUTED
return chars_in_entry * MSDOS_NAME_LFN_BYTES_PER_CHAR;
40010058: 00151513 slli a0,a0,0x1 <== NOT EXECUTED
}
4001005c: 01010113 addi sp,sp,16 <== NOT EXECUTED
40010060: 00008067 ret <== NOT EXECUTED
40004c7c <msdos_initialize_support>:
const rtems_filesystem_operations_table *op_table,
const rtems_filesystem_file_handlers_r *file_handlers,
const rtems_filesystem_file_handlers_r *directory_handlers,
rtems_dosfs_convert_control *converter
)
{
40004c7c: fc010113 addi sp,sp,-64
40004c80: 03212823 sw s2,48(sp)
40004c84: 03512223 sw s5,36(sp)
40004c88: 00050913 mv s2,a0
40004c8c: 00058a93 mv s5,a1
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
fat_dir_pos_t root_pos;
uint32_t cl_buf_size;
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
40004c90: 00100513 li a0,1
40004c94: 0d000593 li a1,208
{
40004c98: 02912a23 sw s1,52(sp)
40004c9c: 03312623 sw s3,44(sp)
40004ca0: 03412423 sw s4,40(sp)
40004ca4: 02112e23 sw ra,60(sp)
40004ca8: 02812c23 sw s0,56(sp)
40004cac: 00060993 mv s3,a2
40004cb0: 00068a13 mv s4,a3
40004cb4: 00070493 mv s1,a4
fat_file_fd_t *fat_fd = NULL;
40004cb8: 00012623 sw zero,12(sp)
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
40004cbc: 1e8070ef jal ra,4000bea4 <calloc>
if (!fs_info)
40004cc0: 14050e63 beqz a0,40004e1c <msdos_initialize_support+0x1a0> <== NEVER TAKEN
temp_mt_entry->fs_info = fs_info;
fs_info->converter = converter;
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
40004cc4: 03892583 lw a1,56(s2)
fs_info->converter = converter;
40004cc8: 0c952623 sw s1,204(a0)
temp_mt_entry->fs_info = fs_info;
40004ccc: 00a92423 sw a0,8(s2)
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
40004cd0: 00050413 mv s0,a0
40004cd4: 7b4080ef jal ra,4000d488 <fat_init_volume_info>
40004cd8: 00050493 mv s1,a0
if (rc != RC_OK)
40004cdc: 0c051663 bnez a0,40004da8 <msdos_initialize_support+0x12c> <== NEVER TAKEN
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
40004ce0: fff00793 li a5,-1
40004ce4: 00f12c23 sw a5,24(sp)
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
40004ce8: 00f12e23 sw a5,28(sp)
* open fat-file which correspondes to root directory
* (so inode number 0x00000010 is always used for root directory)
*/
fat_dir_pos_init(&root_pos);
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
40004cec: 00c10613 addi a2,sp,12
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
40004cf0: 00100793 li a5,1
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
40004cf4: 01010593 addi a1,sp,16
40004cf8: 00040513 mv a0,s0
fs_info->file_handlers = file_handlers;
40004cfc: 0b342623 sw s3,172(s0)
fs_info->directory_handlers = directory_handlers;
40004d00: 0b442423 sw s4,168(s0)
dir_pos->sname.ofs = 0;
40004d04: 00012a23 sw zero,20(sp)
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
40004d08: 00f12823 sw a5,16(sp)
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
40004d0c: 2ad090ef jal ra,4000e7b8 <fat_file_open>
40004d10: 00050493 mv s1,a0
if (rc != RC_OK)
40004d14: 08051663 bnez a0,40004da0 <msdos_initialize_support+0x124> <== NEVER TAKEN
free(fs_info);
return rc;
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
40004d18: 00c12983 lw s3,12(sp)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
fat_fd->cln = fs_info->fat.vol.rdir_cl;
40004d1c: 04442783 lw a5,68(s0)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
40004d20: 00200737 lui a4,0x200
fat_fd->fat_file_type = FAT_DIRECTORY;
40004d24: 0009a823 sw zero,16(s3)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
40004d28: 00e9aa23 sw a4,20(s3)
fat_fd->cln = fs_info->fat.vol.rdir_cl;
40004d2c: 00f9ae23 sw a5,28(s3)
fat_fd->map.file_cln = 0;
40004d30: 0209aa23 sw zero,52(s3)
fat_fd->map.disk_cln = fat_fd->cln;
40004d34: 02f9ac23 sw a5,56(s3)
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
40004d38: 0a079463 bnez a5,40004de0 <msdos_initialize_support+0x164>
{
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
40004d3c: 03442783 lw a5,52(s0)
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
40004d40: 00842503 lw a0,8(s0)
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
40004d44: 00f9ac23 sw a5,24(s3)
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
40004d48: 08f56863 bltu a0,a5,40004dd8 <msdos_initialize_support+0x15c>
return rc;
}
cl_buf_size = fs_info->fat.vol.bpc;
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
40004d4c: 00100593 li a1,1
40004d50: 154070ef jal ra,4000bea4 <calloc>
40004d54: 0ca42423 sw a0,200(s0)
if (fs_info->cl_buf == NULL)
40004d58: 0a050463 beqz a0,40004e00 <msdos_initialize_support+0x184> <== NEVER TAKEN
}
rtems_recursive_mutex_init(&fs_info->vol_mutex,
RTEMS_FILESYSTEM_TYPE_DOSFS);
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
40004d5c: 02492703 lw a4,36(s2)
const char *_name)
{
struct _Mutex_recursive_Control _init =
_MUTEX_RECURSIVE_NAMED_INITIALIZER(_name);
*_mutex = _init;
40004d60: 400257b7 lui a5,0x40025
40004d64: 07078793 addi a5,a5,112 # 40025070 <bsp_section_rodata_begin+0x10>
40004d68: 0a042823 sw zero,176(s0)
40004d6c: 0a042a23 sw zero,180(s0)
40004d70: 0a042c23 sw zero,184(s0)
40004d74: 0a042e23 sw zero,188(s0)
40004d78: 0cf42023 sw a5,192(s0)
40004d7c: 0c042223 sw zero,196(s0)
40004d80: 01372423 sw s3,8(a4) # 200008 <bsp_section_text_size+0x1daff0>
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
40004d84: 01472823 sw s4,16(a4)
temp_mt_entry->ops = op_table;
40004d88: 01592623 sw s5,12(s2)
return rc;
40004d8c: 0240006f j 40004db0 <msdos_initialize_support+0x134>
fat_file_close(&fs_info->fat, fat_fd);
40004d90: 00c12583 lw a1,12(sp) <== NOT EXECUTED
40004d94: 00040513 mv a0,s0 <== NOT EXECUTED
return rc;
40004d98: 00078493 mv s1,a5 <== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
40004d9c: 0c00a0ef jal ra,4000ee5c <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
40004da0: 00040513 mv a0,s0 <== NOT EXECUTED
40004da4: 711080ef jal ra,4000dcb4 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
40004da8: 00040513 mv a0,s0 <== NOT EXECUTED
40004dac: f14fc0ef jal ra,400014c0 <free> <== NOT EXECUTED
}
40004db0: 03c12083 lw ra,60(sp)
40004db4: 03812403 lw s0,56(sp)
40004db8: 03012903 lw s2,48(sp)
40004dbc: 02c12983 lw s3,44(sp)
40004dc0: 02812a03 lw s4,40(sp)
40004dc4: 02412a83 lw s5,36(sp)
40004dc8: 00048513 mv a0,s1
40004dcc: 03412483 lw s1,52(sp)
40004dd0: 04010113 addi sp,sp,64
40004dd4: 00008067 ret
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
40004dd8: 00078513 mv a0,a5
40004ddc: f71ff06f j 40004d4c <msdos_initialize_support+0xd0>
rc = fat_file_size(&fs_info->fat, fat_fd);
40004de0: 00098593 mv a1,s3
40004de4: 00040513 mv a0,s0
40004de8: 6dc0a0ef jal ra,4000f4c4 <fat_file_size>
40004dec: 00050793 mv a5,a0
if ( rc != RC_OK )
40004df0: fa0510e3 bnez a0,40004d90 <msdos_initialize_support+0x114> <== NEVER TAKEN
cl_buf_size = fs_info->fat.vol.bpc;
40004df4: 00842503 lw a0,8(s0)
fat_file_close(&fs_info->fat, fat_fd);
40004df8: 00c12983 lw s3,12(sp)
40004dfc: f51ff06f j 40004d4c <msdos_initialize_support+0xd0>
40004e00: 00098593 mv a1,s3 <== NOT EXECUTED
40004e04: 00040513 mv a0,s0 <== NOT EXECUTED
40004e08: 0540a0ef jal ra,4000ee5c <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
40004e0c: 00040513 mv a0,s0 <== NOT EXECUTED
40004e10: 6a5080ef jal ra,4000dcb4 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
40004e14: 00040513 mv a0,s0 <== NOT EXECUTED
40004e18: ea8fc0ef jal ra,400014c0 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
40004e1c: 13c160ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40004e20: 00c00793 li a5,12 <== NOT EXECUTED
40004e24: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40004e28: fff00493 li s1,-1 <== NOT EXECUTED
40004e2c: f85ff06f j 40004db0 <msdos_initialize_support+0x134> <== NOT EXECUTED
40010064 <msdos_lfn_checksum>:
{
40010064: 00050713 mv a4,a0 <== NOT EXECUTED
40010068: 00b50613 addi a2,a0,11 <== NOT EXECUTED
cs = 0;
4001006c: 00000513 li a0,0 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
40010070: 00074683 lbu a3,0(a4) <== NOT EXECUTED
40010074: 00155793 srli a5,a0,0x1 <== NOT EXECUTED
40010078: 00751513 slli a0,a0,0x7 <== NOT EXECUTED
4001007c: 00d787b3 add a5,a5,a3 <== NOT EXECUTED
40010080: 00a787b3 add a5,a5,a0 <== NOT EXECUTED
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
40010084: 00170713 addi a4,a4,1 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
40010088: 0ff7f513 andi a0,a5,255 <== NOT EXECUTED
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
4001008c: fee612e3 bne a2,a4,40010070 <msdos_lfn_checksum+0xc> <== NOT EXECUTED
}
40010090: 00008067 ret <== NOT EXECUTED
40010094 <msdos_long_to_short>:
size_t codepage_name_len = converter->buffer.size;
40010094: 00852783 lw a5,8(a0)
{
40010098: f9010113 addi sp,sp,-112
4001009c: 06812423 sw s0,104(sp)
400100a0: 06912223 sw s1,100(sp)
400100a4: 05412c23 sw s4,88(sp)
400100a8: 00058493 mv s1,a1
400100ac: 00050a13 mv s4,a0
400100b0: 00060413 mv s0,a2
memset (sfn, ' ', sfn_len);
400100b4: 02000593 li a1,32
400100b8: 00070613 mv a2,a4
400100bc: 00068513 mv a0,a3
{
400100c0: 07212023 sw s2,96(sp)
400100c4: 00e12e23 sw a4,28(sp)
size_t codepage_name_len = converter->buffer.size;
400100c8: 02f12623 sw a5,44(sp)
void *buffer = converter->buffer.data;
400100cc: 004a2903 lw s2,4(s4)
{
400100d0: 06112623 sw ra,108(sp)
400100d4: 05312e23 sw s3,92(sp)
400100d8: 05512a23 sw s5,84(sp)
400100dc: 05612823 sw s6,80(sp)
400100e0: 05712623 sw s7,76(sp)
400100e4: 05812423 sw s8,72(sp)
400100e8: 05912223 sw s9,68(sp)
400100ec: 05a12023 sw s10,64(sp)
400100f0: 03b12e23 sw s11,60(sp)
400100f4: 00d12c23 sw a3,24(sp)
memset (sfn, ' ', sfn_len);
400100f8: 0790b0ef jal ra,4001b970 <memset>
if ((lfn[0] == '.') && (lfn_len == 1))
400100fc: 0004c703 lbu a4,0(s1)
40010100: 02e00793 li a5,46
40010104: 1cf70863 beq a4,a5,400102d4 <msdos_long_to_short+0x240>
for (i = 0; i < lfn_len; i++)
40010108: 00000793 li a5,0
if ((lfn[i] != ' ') && (lfn[i] != '.'))
4001010c: 02000613 li a2,32
40010110: 02e00593 li a1,46
for (i = 0; i < lfn_len; i++)
40010114: 02805063 blez s0,40010134 <msdos_long_to_short+0xa0> <== NEVER TAKEN
40010118: 00178793 addi a5,a5,1
if ((lfn[i] != ' ') && (lfn[i] != '.'))
4001011c: 00f486b3 add a3,s1,a5
40010120: 00c70463 beq a4,a2,40010128 <msdos_long_to_short+0x94>
40010124: 00b71a63 bne a4,a1,40010138 <msdos_long_to_short+0xa4>
for (i = 0; i < lfn_len; i++)
40010128: 16f40263 beq s0,a5,4001028c <msdos_long_to_short+0x1f8>
if ((lfn[i] != ' ') && (lfn[i] != '.'))
4001012c: 0006c703 lbu a4,0(a3) # 200000 <bsp_section_text_size+0x1dafe8>
40010130: fe9ff06f j 40010118 <msdos_long_to_short+0x84>
if (i == lfn_len)
40010134: 14040c63 beqz s0,4001028c <msdos_long_to_short+0x1f8> <== NOT EXECUTED
eno = (*converter->handler->utf8_to_codepage) (
40010138: 000a2783 lw a5,0(s4)
4001013c: 02c10713 addi a4,sp,44
40010140: 00090693 mv a3,s2
40010144: 0007a783 lw a5,0(a5)
40010148: 00040613 mv a2,s0
4001014c: 00048593 mv a1,s1
40010150: 000a0513 mv a0,s4
40010154: 000780e7 jalr a5
if (eno == EINVAL)
40010158: 01600793 li a5,22
4001015c: 0cf50263 beq a0,a5,40010220 <msdos_long_to_short+0x18c>
while (*name && (count < name_len))
40010160: 00094c03 lbu s8,0(s2)
type = msdos_name_type (
40010164: 02c12a83 lw s5,44(sp)
while (*name && (count < name_len))
40010168: 1a0c0463 beqz s8,40010310 <msdos_long_to_short+0x27c> <== NEVER TAKEN
4001016c: 1b505263 blez s5,40010310 <msdos_long_to_short+0x27c> <== NEVER TAKEN
if ((ch == '.') || isalnum((unsigned char)ch) ||
40010170: 40027737 lui a4,0x40027
40010174: 10970793 addi a5,a4,265 # 40027109 <_ctype_+0x1>
bool uppercase = false;
40010178: 00012823 sw zero,16(sp)
bool lowercase = false;
4001017c: 00012a23 sw zero,20(sp)
int count = 0;
40010180: 00000c93 li s9,0
int dot_at = -1;
40010184: fff00993 li s3,-1
40010188: 40026b37 lui s6,0x40026
if ((ch == '.') || isalnum((unsigned char)ch) ||
4001018c: 02e00d13 li s10,46
40010190: 00f12623 sw a5,12(sp)
else if ((*name >= 'A') && (*name <= 'Z'))
40010194: 01900b93 li s7,25
if (is_dot || ((count - dot_at) > 3))
40010198: 00300d93 li s11,3
4001019c: 0740006f j 40010210 <msdos_long_to_short+0x17c>
if ((ch == '.') || isalnum((unsigned char)ch) ||
400101a0: 13ac0263 beq s8,s10,400102c4 <msdos_long_to_short+0x230>
400101a4: 00c12783 lw a5,12(sp)
400101a8: 00fc0733 add a4,s8,a5
400101ac: 00074703 lbu a4,0(a4)
400101b0: 00777713 andi a4,a4,7
400101b4: 00071c63 bnez a4,400101cc <msdos_long_to_short+0x138>
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
400101b8: 400267b7 lui a5,0x40026
400101bc: 000c0593 mv a1,s8
400101c0: e4878513 addi a0,a5,-440 # 40025e48 <msdos_file_handlers+0x48>
400101c4: 5600c0ef jal ra,4001c724 <strchr>
if ((ch == '.') || isalnum((unsigned char)ch) ||
400101c8: 0a050c63 beqz a0,40010280 <msdos_long_to_short+0x1ec>
if (dot_at >= 0)
400101cc: fff00793 li a5,-1
400101d0: 14f98463 beq s3,a5,40010318 <msdos_long_to_short+0x284>
if (is_dot || ((count - dot_at) > 3))
400101d4: 413c8733 sub a4,s9,s3
400101d8: 04edc463 blt s11,a4,40010220 <msdos_long_to_short+0x18c>
else if ((*name >= 'A') && (*name <= 'Z'))
400101dc: fbfc0713 addi a4,s8,-65
400101e0: 0ff77713 andi a4,a4,255
400101e4: 0aebf863 bgeu s7,a4,40010294 <msdos_long_to_short+0x200>
else if ((*name >= 'a') && (*name <= 'z'))
400101e8: f9fc0593 addi a1,s8,-97
400101ec: 0ff5f593 andi a1,a1,255
400101f0: 00bbe663 bltu s7,a1,400101fc <msdos_long_to_short+0x168>
lowercase = true;
400101f4: 00100793 li a5,1
400101f8: 00f12a23 sw a5,20(sp)
count++;
400101fc: 001c8c93 addi s9,s9,1
while (*name && (count < name_len))
40010200: 01990733 add a4,s2,s9
40010204: 00074c03 lbu s8,0(a4)
40010208: 0a0c0263 beqz s8,400102ac <msdos_long_to_short+0x218>
4001020c: 0b9a8063 beq s5,s9,400102ac <msdos_long_to_short+0x218>
if (strchr(" +,;=[]", ch) != NULL)
40010210: 000c0593 mv a1,s8
40010214: e40b0513 addi a0,s6,-448 # 40025e40 <msdos_file_handlers+0x40>
40010218: 50c0c0ef jal ra,4001c724 <strchr>
4001021c: f80502e3 beqz a0,400101a0 <msdos_long_to_short+0x10c>
type = MSDOS_NAME_LONG;
40010220: 00200913 li s2,2
short_filename_length = msdos_filename_utf8_to_short_name_for_save (
40010224: 01c12703 lw a4,28(sp)
40010228: 01812683 lw a3,24(sp)
4001022c: 00040613 mv a2,s0
40010230: 00048593 mv a1,s1
40010234: 000a0513 mv a0,s4
40010238: 191060ef jal ra,40016bc8 <msdos_filename_utf8_to_short_name_for_save>
if (short_filename_length < 0 ) {
4001023c: 04054863 bltz a0,4001028c <msdos_long_to_short+0x1f8> <== NEVER TAKEN
}
40010240: 06c12083 lw ra,108(sp)
40010244: 06812403 lw s0,104(sp)
40010248: 06412483 lw s1,100(sp)
4001024c: 05c12983 lw s3,92(sp)
40010250: 05812a03 lw s4,88(sp)
40010254: 05412a83 lw s5,84(sp)
40010258: 05012b03 lw s6,80(sp)
4001025c: 04c12b83 lw s7,76(sp)
40010260: 04812c03 lw s8,72(sp)
40010264: 04412c83 lw s9,68(sp)
40010268: 04012d03 lw s10,64(sp)
4001026c: 03c12d83 lw s11,60(sp)
40010270: 00090513 mv a0,s2
40010274: 06012903 lw s2,96(sp)
40010278: 07010113 addi sp,sp,112
4001027c: 00008067 ret
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
40010280: 018c1713 slli a4,s8,0x18
40010284: 41875713 srai a4,a4,0x18
40010288: f40742e3 bltz a4,400101cc <msdos_long_to_short+0x138>
return MSDOS_NAME_INVALID;
4001028c: 00000913 li s2,0
40010290: fb1ff06f j 40010240 <msdos_long_to_short+0x1ac>
count++;
40010294: 001c8c93 addi s9,s9,1
while (*name && (count < name_len))
40010298: 01990733 add a4,s2,s9
4001029c: 00074c03 lbu s8,0(a4)
uppercase = true;
400102a0: 00100793 li a5,1
400102a4: 00f12823 sw a5,16(sp)
while (*name && (count < name_len))
400102a8: f60c12e3 bnez s8,4001020c <msdos_long_to_short+0x178>
if (lowercase && uppercase)
400102ac: 01412783 lw a5,20(sp)
return MSDOS_NAME_SHORT;
400102b0: 00100913 li s2,1
if (lowercase && uppercase)
400102b4: f60788e3 beqz a5,40010224 <msdos_long_to_short+0x190>
type = MSDOS_NAME_LONG;
400102b8: 01012783 lw a5,16(sp)
400102bc: 00178913 addi s2,a5,1
400102c0: f65ff06f j 40010224 <msdos_long_to_short+0x190>
if (dot_at >= 0)
400102c4: fff00793 li a5,-1
400102c8: f4f99ce3 bne s3,a5,40010220 <msdos_long_to_short+0x18c>
400102cc: 000c8993 mv s3,s9
400102d0: f2dff06f j 400101fc <msdos_long_to_short+0x168>
if ((lfn[0] == '.') && (lfn_len == 1))
400102d4: 00100793 li a5,1
400102d8: 02f40463 beq s0,a5,40010300 <msdos_long_to_short+0x26c>
if ((lfn[0] == '.') && (lfn[1] == '.') && (lfn_len == 2))
400102dc: 0014c783 lbu a5,1(s1)
400102e0: e2e794e3 bne a5,a4,40010108 <msdos_long_to_short+0x74>
400102e4: 00200693 li a3,2
400102e8: e2d410e3 bne s0,a3,40010108 <msdos_long_to_short+0x74>
sfn[0] = sfn[1] = '.';
400102ec: 01812703 lw a4,24(sp)
return MSDOS_NAME_SHORT;
400102f0: 00100913 li s2,1
sfn[0] = sfn[1] = '.';
400102f4: 00f700a3 sb a5,1(a4)
400102f8: 00f70023 sb a5,0(a4)
return MSDOS_NAME_SHORT;
400102fc: f45ff06f j 40010240 <msdos_long_to_short+0x1ac>
sfn[0] = '.';
40010300: 01812783 lw a5,24(sp)
return MSDOS_NAME_SHORT;
40010304: 00100913 li s2,1
sfn[0] = '.';
40010308: 00e78023 sb a4,0(a5)
return MSDOS_NAME_SHORT;
4001030c: f35ff06f j 40010240 <msdos_long_to_short+0x1ac>
return MSDOS_NAME_SHORT;
40010310: 00100913 li s2,1 <== NOT EXECUTED
40010314: f11ff06f j 40010224 <msdos_long_to_short+0x190> <== NOT EXECUTED
if (count == 8 && !is_dot)
40010318: 00800793 li a5,8
4001031c: ecfc90e3 bne s9,a5,400101dc <msdos_long_to_short+0x148>
40010320: f01ff06f j 40010220 <msdos_long_to_short+0x18c>
40004e30 <msdos_mknod>:
fat_file_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
40004e30: 0000f7b7 lui a5,0xf
40004e34: 00f6f7b3 and a5,a3,a5
40004e38: 000048b7 lui a7,0x4
{
40004e3c: 00068713 mv a4,a3
40004e40: 00058813 mv a6,a1
40004e44: 00060693 mv a3,a2
if (S_ISDIR(mode))
40004e48: 01178e63 beq a5,a7,40004e64 <msdos_mknod+0x34>
{
type = FAT_DIRECTORY;
}
else if (S_ISREG(mode))
40004e4c: 00008637 lui a2,0x8
{
type = FAT_FILE;
40004e50: 00400593 li a1,4
else if (S_ISREG(mode))
40004e54: 02c79063 bne a5,a2,40004e74 <msdos_mknod+0x44>
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
40004e58: 00000793 li a5,0
40004e5c: 00080613 mv a2,a6
40004e60: 0e90a06f j 4000f748 <msdos_creat_node>
type = FAT_DIRECTORY;
40004e64: 00000593 li a1,0
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
40004e68: 00000793 li a5,0
40004e6c: 00080613 mv a2,a6
40004e70: 0d90a06f j 4000f748 <msdos_creat_node>
{
40004e74: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40004e78: 00112623 sw ra,12(sp) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EINVAL);
40004e7c: 0dc160ef jal ra,4001af58 <__errno> <== NOT EXECUTED
return rc;
}
40004e80: 00c12083 lw ra,12(sp) <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EINVAL);
40004e84: 01600793 li a5,22 <== NOT EXECUTED
40004e88: 00f52023 sw a5,0(a0) <== NOT EXECUTED
}
40004e8c: fff00513 li a0,-1 <== NOT EXECUTED
40004e90: 01010113 addi sp,sp,16 <== NOT EXECUTED
40004e94: 00008067 ret <== NOT EXECUTED
40004e98 <msdos_rename>:
const rtems_filesystem_location_info_t *old_loc,
const rtems_filesystem_location_info_t *new_parent_loc,
const char *new_name,
size_t new_namelen
)
{
40004e98: ff010113 addi sp,sp,-16 <== NOT EXECUTED
40004e9c: 00912223 sw s1,4(sp) <== NOT EXECUTED
int rc = RC_OK;
fat_file_fd_t *old_fat_fd = old_loc->node_access;
40004ea0: 0085a483 lw s1,8(a1) <== NOT EXECUTED
{
40004ea4: 00812423 sw s0,8(sp) <== NOT EXECUTED
40004ea8: 00060513 mv a0,a2 <== NOT EXECUTED
40004eac: 00058413 mv s0,a1 <== NOT EXECUTED
40004eb0: 00068613 mv a2,a3 <== NOT EXECUTED
/*
* create new directory entry as "hard link", copying relevant info from
* existing file
*/
rc = msdos_creat_node(new_parent_loc,
40004eb4: 00048793 mv a5,s1 <== NOT EXECUTED
{
40004eb8: 00070693 mv a3,a4 <== NOT EXECUTED
rc = msdos_creat_node(new_parent_loc,
40004ebc: 00200593 li a1,2 <== NOT EXECUTED
40004ec0: 00008737 lui a4,0x8 <== NOT EXECUTED
{
40004ec4: 00112623 sw ra,12(sp) <== NOT EXECUTED
rc = msdos_creat_node(new_parent_loc,
40004ec8: 0810a0ef jal ra,4000f748 <msdos_creat_node> <== NOT EXECUTED
FAT_HARD_LINK,new_name,new_namelen,S_IFREG,
old_fat_fd);
if (rc != RC_OK)
40004ecc: 00050c63 beqz a0,40004ee4 <msdos_rename+0x4c> <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
40004ed0: 00c12083 lw ra,12(sp) <== NOT EXECUTED
40004ed4: 00812403 lw s0,8(sp) <== NOT EXECUTED
40004ed8: 00412483 lw s1,4(sp) <== NOT EXECUTED
40004edc: 01010113 addi sp,sp,16 <== NOT EXECUTED
40004ee0: 00008067 ret <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
40004ee4: 01442503 lw a0,20(s0) <== NOT EXECUTED
}
40004ee8: 00812403 lw s0,8(sp) <== NOT EXECUTED
40004eec: 00c12083 lw ra,12(sp) <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
40004ef0: 02048593 addi a1,s1,32 <== NOT EXECUTED
}
40004ef4: 00412483 lw s1,4(sp) <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
40004ef8: 0e500613 li a2,229 <== NOT EXECUTED
}
40004efc: 01010113 addi sp,sp,16 <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
40004f00: 6f00b06f j 400105f0 <msdos_set_first_char4file_name> <== NOT EXECUTED
40004f04 <msdos_rmnod>:
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
40004f04: fd010113 addi sp,sp,-48
40004f08: 03212023 sw s2,32(sp)
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access;
40004f0c: 0085a903 lw s2,8(a1)
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
40004f10: 0145a503 lw a0,20(a1)
{
40004f14: 01312e23 sw s3,28(sp)
if (fat_fd->fat_file_type == FAT_DIRECTORY)
40004f18: 01092783 lw a5,16(s2)
{
40004f1c: 02112623 sw ra,44(sp)
40004f20: 02812423 sw s0,40(sp)
40004f24: 02912223 sw s1,36(sp)
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
40004f28: 00852983 lw s3,8(a0)
if (fat_fd->fat_file_type == FAT_DIRECTORY)
40004f2c: 02079c63 bnez a5,40004f64 <msdos_rmnod+0x60>
{
bool is_empty = false;
40004f30: 00058493 mv s1,a1
/*
* You cannot remove a node that still has children
*/
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
40004f34: 00f10613 addi a2,sp,15
40004f38: 00090593 mv a1,s2
bool is_empty = false;
40004f3c: 000107a3 sb zero,15(sp)
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
40004f40: 01d0b0ef jal ra,4001075c <msdos_dir_is_empty>
40004f44: 00050413 mv s0,a0
if (rc != RC_OK)
40004f48: 02051863 bnez a0,40004f78 <msdos_rmnod+0x74> <== NEVER TAKEN
{
return rc;
}
if (!is_empty)
40004f4c: 00f14783 lbu a5,15(sp)
40004f50: 08078463 beqz a5,40004fd8 <msdos_rmnod+0xd4>
/*
* We deny attempts to delete open directory (if directory is current
* directory we assume it is open one)
*/
if (fat_fd->links_num > 1)
40004f54: 00892703 lw a4,8(s2)
40004f58: 00100793 li a5,1
40004f5c: 06e7e463 bltu a5,a4,40004fc4 <msdos_rmnod+0xc0>
* not used - mount() not implemenetd yet.
*/
}
/* mark file removed */
rc = msdos_set_first_char4file_name(pathloc->mt_entry, &fat_fd->dir_pos,
40004f60: 0144a503 lw a0,20(s1)
40004f64: 0e500613 li a2,229
40004f68: 02090593 addi a1,s2,32
40004f6c: 6840b0ef jal ra,400105f0 <msdos_set_first_char4file_name>
40004f70: 00050413 mv s0,a0
MSDOS_THIS_DIR_ENTRY_EMPTY);
if (rc != RC_OK)
40004f74: 02050263 beqz a0,40004f98 <msdos_rmnod+0x94> <== ALWAYS TAKEN
}
fat_file_mark_removed(&fs_info->fat, fat_fd);
return rc;
}
40004f78: 02c12083 lw ra,44(sp)
40004f7c: 00040513 mv a0,s0
40004f80: 02812403 lw s0,40(sp)
40004f84: 02412483 lw s1,36(sp)
40004f88: 02012903 lw s2,32(sp)
40004f8c: 01c12983 lw s3,28(sp)
40004f90: 03010113 addi sp,sp,48
40004f94: 00008067 ret
fat_file_mark_removed(&fs_info->fat, fat_fd);
40004f98: 00098513 mv a0,s3
40004f9c: 00090593 mv a1,s2
40004fa0: 4cc0a0ef jal ra,4000f46c <fat_file_mark_removed>
}
40004fa4: 02c12083 lw ra,44(sp)
40004fa8: 00040513 mv a0,s0
40004fac: 02812403 lw s0,40(sp)
40004fb0: 02412483 lw s1,36(sp)
40004fb4: 02012903 lw s2,32(sp)
40004fb8: 01c12983 lw s3,28(sp)
40004fbc: 03010113 addi sp,sp,48
40004fc0: 00008067 ret
rtems_set_errno_and_return_minus_one(EBUSY);
40004fc4: 795150ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40004fc8: 01000793 li a5,16 <== NOT EXECUTED
40004fcc: 00f52023 sw a5,0(a0) <== NOT EXECUTED
40004fd0: fff00413 li s0,-1 <== NOT EXECUTED
40004fd4: fa5ff06f j 40004f78 <msdos_rmnod+0x74> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOTEMPTY);
40004fd8: 781150ef jal ra,4001af58 <__errno>
40004fdc: 05a00793 li a5,90
40004fe0: 00f52023 sw a5,0(a0)
40004fe4: fff00413 li s0,-1
40004fe8: f91ff06f j 40004f78 <msdos_rmnod+0x74>
400105f0 <msdos_set_first_char4file_name>:
{
400105f0: fc010113 addi sp,sp,-64
400105f4: 02812c23 sw s0,56(sp)
msdos_fs_info_t *fs_info = mt_entry->fs_info;
400105f8: 00852403 lw s0,8(a0)
fat_pos_t start = dir_pos->lname;
400105fc: 0085a683 lw a3,8(a1)
40010600: 00c5a703 lw a4,12(a1)
{
40010604: 02912a23 sw s1,52(sp)
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
40010608: 04442783 lw a5,68(s0)
fat_pos_t end = dir_pos->sname;
4001060c: 0005a483 lw s1,0(a1)
{
40010610: 03312623 sw s3,44(sp)
40010614: 02112e23 sw ra,60(sp)
40010618: 03212823 sw s2,48(sp)
4001061c: 00c107a3 sb a2,15(sp)
fat_pos_t start = dir_pos->lname;
40010620: 00d12c23 sw a3,24(sp)
40010624: 00e12e23 sw a4,28(sp)
fat_pos_t end = dir_pos->sname;
40010628: 0045a983 lw s3,4(a1)
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
4001062c: 10978e63 beq a5,s1,40010748 <msdos_set_first_char4file_name+0x158>
dir_block_size = fs_info->fat.vol.bpc;
40010630: 00842903 lw s2,8(s0)
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
40010634: 0085a703 lw a4,8(a1)
40010638: fff00793 li a5,-1
4001063c: 0ef70a63 beq a4,a5,40010730 <msdos_set_first_char4file_name+0x140>
(start.ofs >> fs_info->fat.vol.sec_log2));
40010640: 01c12783 lw a5,28(sp)
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
40010644: 01812583 lw a1,24(sp)
40010648: 0100006f j 40010658 <msdos_set_first_char4file_name+0x68>
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
4001064c: 02078793 addi a5,a5,32
40010650: 00f12e23 sw a5,28(sp)
if (start.ofs >= dir_block_size)
40010654: 0b27f663 bgeu a5,s2,40010700 <msdos_set_first_char4file_name+0x110>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
40010658: ffe58713 addi a4,a1,-2
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
4001065c: 00059863 bnez a1,4001066c <msdos_set_first_char4file_name+0x7c>
40010660: 01644683 lbu a3,22(s0)
40010664: 0036f693 andi a3,a3,3
40010668: 06069863 bnez a3,400106d8 <msdos_set_first_char4file_name+0xe8> <== ALWAYS TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
4001066c: 00544583 lbu a1,5(s0)
40010670: 03c42503 lw a0,60(s0)
40010674: 00b71733 sll a4,a4,a1
40010678: 00a70533 add a0,a4,a0
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
4001067c: 00045603 lhu a2,0(s0)
(start.ofs >> fs_info->fat.vol.sec_log2));
40010680: 00244583 lbu a1,2(s0)
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
40010684: 00f10713 addi a4,sp,15
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
40010688: fff60613 addi a2,a2,-1
(start.ofs >> fs_info->fat.vol.sec_log2));
4001068c: 00b7d5b3 srl a1,a5,a1
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
40010690: 00a585b3 add a1,a1,a0
40010694: 00f67633 and a2,a2,a5
40010698: 00100693 li a3,1
4001069c: 00040513 mv a0,s0
400106a0: 9f9fc0ef jal ra,4000d098 <fat_sector_write>
if (ret < 0)
400106a4: 02054e63 bltz a0,400106e0 <msdos_set_first_char4file_name+0xf0> <== NEVER TAKEN
if ((start.cln == end.cln) && (start.ofs == end.ofs))
400106a8: 01812583 lw a1,24(sp)
400106ac: 01c12783 lw a5,28(sp)
400106b0: f8b49ee3 bne s1,a1,4001064c <msdos_set_first_char4file_name+0x5c>
400106b4: f8f99ce3 bne s3,a5,4001064c <msdos_set_first_char4file_name+0x5c>
}
400106b8: 03c12083 lw ra,60(sp)
400106bc: 03812403 lw s0,56(sp)
400106c0: 03412483 lw s1,52(sp)
400106c4: 03012903 lw s2,48(sp)
400106c8: 02c12983 lw s3,44(sp)
return RC_OK;
400106cc: 00000513 li a0,0
}
400106d0: 04010113 addi sp,sp,64
400106d4: 00008067 ret
return fs_info->vol.rdir_loc;
400106d8: 02842503 lw a0,40(s0)
400106dc: fa1ff06f j 4001067c <msdos_set_first_char4file_name+0x8c>
return -1;
400106e0: fff00513 li a0,-1 <== NOT EXECUTED
}
400106e4: 03c12083 lw ra,60(sp) <== NOT EXECUTED
400106e8: 03812403 lw s0,56(sp) <== NOT EXECUTED
400106ec: 03412483 lw s1,52(sp) <== NOT EXECUTED
400106f0: 03012903 lw s2,48(sp) <== NOT EXECUTED
400106f4: 02c12983 lw s3,44(sp) <== NOT EXECUTED
400106f8: 04010113 addi sp,sp,64 <== NOT EXECUTED
400106fc: 00008067 ret <== NOT EXECUTED
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
40010700: 04442783 lw a5,68(s0)
40010704: 00f49863 bne s1,a5,40010714 <msdos_set_first_char4file_name+0x124>
40010708: 01644783 lbu a5,22(s0) <== NOT EXECUTED
4001070c: 0037f793 andi a5,a5,3 <== NOT EXECUTED
40010710: fa0794e3 bnez a5,400106b8 <msdos_set_first_char4file_name+0xc8> <== NOT EXECUTED
rc = fat_get_fat_cluster(&fs_info->fat, start.cln, &start.cln);
40010714: 01810613 addi a2,sp,24
40010718: 00040513 mv a0,s0
4001071c: 87dfd0ef jal ra,4000df98 <fat_get_fat_cluster>
if ( rc != RC_OK )
40010720: fc0512e3 bnez a0,400106e4 <msdos_set_first_char4file_name+0xf4> <== NEVER TAKEN
start.ofs = 0;
40010724: 00012e23 sw zero,28(sp)
40010728: 00000793 li a5,0
4001072c: f19ff06f j 40010644 <msdos_set_first_char4file_name+0x54>
start = dir_pos->sname;
40010730: 0045a783 lw a5,4(a1)
40010734: 0005a703 lw a4,0(a1)
40010738: 00f12e23 sw a5,28(sp)
(start.ofs >> fs_info->fat.vol.sec_log2));
4001073c: 01c12783 lw a5,28(sp)
start = dir_pos->sname;
40010740: 00e12c23 sw a4,24(sp)
40010744: f01ff06f j 40010644 <msdos_set_first_char4file_name+0x54>
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
40010748: 01644783 lbu a5,22(s0)
4001074c: 0037f793 andi a5,a5,3
40010750: ee0780e3 beqz a5,40010630 <msdos_set_first_char4file_name+0x40> <== NEVER TAKEN
dir_block_size = fs_info->fat.vol.rdir_size;
40010754: 03442903 lw s2,52(s0)
40010758: eddff06f j 40010634 <msdos_set_first_char4file_name+0x44>
40004fec <msdos_statvfs>:
int msdos_statvfs(
const rtems_filesystem_location_info_t *__restrict root_loc,
struct statvfs *__restrict sb)
{
msdos_fs_info_t *fs_info = root_loc->mt_entry->fs_info;
40004fec: 01452783 lw a5,20(a0)
{
40004ff0: fd010113 addi sp,sp,-48
40004ff4: 01512a23 sw s5,20(sp)
msdos_fs_info_t *fs_info = root_loc->mt_entry->fs_info;
40004ff8: 0087aa83 lw s5,8(a5) # f008 <bsp_section_rodata_size+0xc87c>
{
40004ffc: 01412c23 sw s4,24(sp)
40005000: 02812423 sw s0,40(sp)
rtems_recursive_mutex_lock(&fs_info->vol_mutex);
40005004: 0b0a8a13 addi s4,s5,176 # 2000b0 <bsp_section_text_size+0x1db098>
_Mutex_recursive_Acquire( mutex );
40005008: 000a0513 mv a0,s4
4000500c: 00058413 mv s0,a1
40005010: 01312e23 sw s3,28(sp)
40005014: 02112623 sw ra,44(sp)
40005018: 02912223 sw s1,36(sp)
4000501c: 03212023 sw s2,32(sp)
40005020: 764030ef jal ra,40008784 <_Mutex_recursive_Acquire>
fat_vol_t *vol = &fs_info->fat.vol;
msdos_fs_lock(fs_info);
sb->f_bsize = FAT_SECTOR512_SIZE;
sb->f_frsize = vol->bpc;
40005024: 008aa703 lw a4,8(s5)
sb->f_blocks = vol->data_cls;
40005028: 040aa983 lw s3,64(s5)
sb->f_bsize = FAT_SECTOR512_SIZE;
4000502c: 20000693 li a3,512
sb->f_frsize = vol->bpc;
40005030: 00e42223 sw a4,4(s0)
sb->f_ffree = 0;
sb->f_favail = 0;
sb->f_flag = 0;
sb->f_namemax = MSDOS_NAME_MAX_LNF_LEN;
if (vol->free_cls == FAT_UNDEFINED_VALUE)
40005034: 04caa783 lw a5,76(s5)
sb->f_bfree = 0;
40005038: 00000713 li a4,0
sb->f_bsize = FAT_SECTOR512_SIZE;
4000503c: 00d42023 sw a3,0(s0)
sb->f_bfree = 0;
40005040: 00e42a23 sw a4,20(s0)
40005044: 00000693 li a3,0
sb->f_bavail = 0;
40005048: 00e42e23 sw a4,28(s0)
sb->f_namemax = MSDOS_NAME_MAX_LNF_LEN;
4000504c: 0ff00713 li a4,255
40005050: 02e42a23 sw a4,52(s0)
sb->f_blocks = vol->data_cls;
40005054: 01342423 sw s3,8(s0)
40005058: 00042623 sw zero,12(s0)
sb->f_bfree = 0;
4000505c: 00d42823 sw a3,16(s0)
sb->f_bavail = 0;
40005060: 00d42c23 sw a3,24(s0)
sb->f_files = 0; // FAT doesn't store inodes
40005064: 02042023 sw zero,32(s0)
sb->f_ffree = 0;
40005068: 02042223 sw zero,36(s0)
sb->f_favail = 0;
4000506c: 02042423 sw zero,40(s0)
sb->f_flag = 0;
40005070: 02042823 sw zero,48(s0)
if (vol->free_cls == FAT_UNDEFINED_VALUE)
40005074: fff00713 li a4,-1
40005078: 04e78463 beq a5,a4,400050c0 <msdos_statvfs+0xd4>
}
}
}
else
{
sb->f_bfree = vol->free_cls;
4000507c: 00f42823 sw a5,16(s0) <== NOT EXECUTED
40005080: 00042a23 sw zero,20(s0) <== NOT EXECUTED
sb->f_bavail = vol->free_cls;
40005084: 00f42c23 sw a5,24(s0) <== NOT EXECUTED
40005088: 00042e23 sw zero,28(s0) <== NOT EXECUTED
_Mutex_recursive_Release( mutex );
4000508c: 000a0513 mv a0,s4
40005090: 77c030ef jal ra,4000880c <_Mutex_recursive_Release>
}
msdos_fs_unlock(fs_info);
return RC_OK;
40005094: 00000493 li s1,0
}
40005098: 02c12083 lw ra,44(sp)
4000509c: 02812403 lw s0,40(sp)
400050a0: 02012903 lw s2,32(sp)
400050a4: 01c12983 lw s3,28(sp)
400050a8: 01812a03 lw s4,24(sp)
400050ac: 01412a83 lw s5,20(sp)
400050b0: 00048513 mv a0,s1
400050b4: 02412483 lw s1,36(sp)
400050b8: 03010113 addi sp,sp,48
400050bc: 00008067 ret
uint32_t value = 0;
400050c0: 00012623 sw zero,12(sp)
uint32_t data_cls_val = vol->data_cls + 2;
400050c4: 00298993 addi s3,s3,2
uint32_t cur_cl = 2;
400050c8: 00200913 li s2,2
for (; cur_cl < data_cls_val; ++cur_cl)
400050cc: fd3970e3 bgeu s2,s3,4000508c <msdos_statvfs+0xa0>
rc = fat_get_fat_cluster(&fs_info->fat, cur_cl, &value);
400050d0: 00090593 mv a1,s2
400050d4: 00c10613 addi a2,sp,12
400050d8: 000a8513 mv a0,s5
400050dc: 6bd080ef jal ra,4000df98 <fat_get_fat_cluster>
400050e0: 00050493 mv s1,a0
for (; cur_cl < data_cls_val; ++cur_cl)
400050e4: 00190913 addi s2,s2,1
if (rc != RC_OK)
400050e8: 06051263 bnez a0,4000514c <msdos_statvfs+0x160> <== NEVER TAKEN
if (value == FAT_GENFAT_FREE)
400050ec: 00c12783 lw a5,12(sp)
400050f0: 02079e63 bnez a5,4000512c <msdos_statvfs+0x140>
sb->f_bfree++;
400050f4: 01042703 lw a4,16(s0)
sb->f_bavail++;
400050f8: 01842783 lw a5,24(s0)
sb->f_bfree++;
400050fc: 01442503 lw a0,20(s0)
sb->f_bavail++;
40005100: 01c42583 lw a1,28(s0)
sb->f_bfree++;
40005104: 00170613 addi a2,a4,1 # 8001 <bsp_section_rodata_size+0x5875>
sb->f_bavail++;
40005108: 00178693 addi a3,a5,1
sb->f_bfree++;
4000510c: 00e63733 sltu a4,a2,a4
sb->f_bavail++;
40005110: 00f6b7b3 sltu a5,a3,a5
sb->f_bfree++;
40005114: 00a70733 add a4,a4,a0
sb->f_bavail++;
40005118: 00b787b3 add a5,a5,a1
sb->f_bfree++;
4000511c: 00c42823 sw a2,16(s0)
40005120: 00e42a23 sw a4,20(s0)
sb->f_bavail++;
40005124: 00d42c23 sw a3,24(s0)
40005128: 00f42e23 sw a5,28(s0)
for (; cur_cl < data_cls_val; ++cur_cl)
4000512c: f72980e3 beq s3,s2,4000508c <msdos_statvfs+0xa0>
rc = fat_get_fat_cluster(&fs_info->fat, cur_cl, &value);
40005130: 00090593 mv a1,s2
40005134: 00c10613 addi a2,sp,12
40005138: 000a8513 mv a0,s5
4000513c: 65d080ef jal ra,4000df98 <fat_get_fat_cluster>
40005140: 00050493 mv s1,a0
for (; cur_cl < data_cls_val; ++cur_cl)
40005144: 00190913 addi s2,s2,1
if (rc != RC_OK)
40005148: fa0502e3 beqz a0,400050ec <msdos_statvfs+0x100> <== ALWAYS TAKEN
4000514c: 000a0513 mv a0,s4 <== NOT EXECUTED
40005150: 6bc030ef jal ra,4000880c <_Mutex_recursive_Release> <== NOT EXECUTED
return rc;
40005154: f45ff06f j 40005098 <msdos_statvfs+0xac> <== NOT EXECUTED
4000f70c <rtems_dosfs_create_default_converter>:
rtems_dosfs_convert_control super;
uint8_t buffer[MSDOS_NAME_MAX_LFN_BYTES];
} msdos_default_convert_control;
rtems_dosfs_convert_control *rtems_dosfs_create_default_converter(void)
{
4000f70c: ff010113 addi sp,sp,-16
msdos_default_convert_control *self = malloc( sizeof( *self ) );
4000f710: 21400513 li a0,532
{
4000f714: 00112623 sw ra,12(sp)
msdos_default_convert_control *self = malloc( sizeof( *self ) );
4000f718: 948f20ef jal ra,40001860 <malloc>
if ( self != NULL ) {
4000f71c: 02050063 beqz a0,4000f73c <rtems_dosfs_create_default_converter+0x30><== NEVER TAKEN
rtems_dosfs_convert_control *super = &self->super;
super->handler = &msdos_default_convert_handler;
4000f720: 400267b7 lui a5,0x40026
4000f724: da878793 addi a5,a5,-600 # 40025da8 <msdos_default_convert_handler>
super->buffer.data = &self->buffer;
4000f728: 00c50713 addi a4,a0,12
super->handler = &msdos_default_convert_handler;
4000f72c: 00f52023 sw a5,0(a0)
super->buffer.size = sizeof( self->buffer );
4000f730: 20800793 li a5,520
super->buffer.data = &self->buffer;
4000f734: 00e52223 sw a4,4(a0)
super->buffer.size = sizeof( self->buffer );
4000f738: 00f52423 sw a5,8(a0)
}
return &self->super;
}
4000f73c: 00c12083 lw ra,12(sp)
4000f740: 01010113 addi sp,sp,16
4000f744: 00008067 ret
4000570c <rtems_dosfs_create_utf8_converter>:
};
rtems_dosfs_convert_control *rtems_dosfs_create_utf8_converter(
const char *codepage
)
{
4000570c: ff010113 addi sp,sp,-16
40005710: 00912223 sw s1,4(sp)
40005714: 00050493 mv s1,a0
msdos_utf8_convert_control *self = malloc( sizeof( *self ) );
40005718: 42c00513 li a0,1068
{
4000571c: 00812423 sw s0,8(sp)
40005720: 00112623 sw ra,12(sp)
40005724: 01212023 sw s2,0(sp)
msdos_utf8_convert_control *self = malloc( sizeof( *self ) );
40005728: ad4fd0ef jal ra,400029fc <malloc>
4000572c: 00050413 mv s0,a0
if ( self != NULL ) {
40005730: 0a050863 beqz a0,400057e0 <rtems_dosfs_create_utf8_converter+0xd4><== NEVER TAKEN
self->desc_codepage_to_utf8 = iconv_open( "UTF-8", codepage );
40005734: 40033937 lui s2,0x40033
40005738: 00048593 mv a1,s1
4000573c: d5890513 addi a0,s2,-680 # 40032d58 <rtems_filesystem_null_handlers+0x7c>
40005740: 241190ef jal ra,4001f180 <iconv_open>
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
40005744: d5890593 addi a1,s2,-680
self->desc_codepage_to_utf8 = iconv_open( "UTF-8", codepage );
40005748: 00a42623 sw a0,12(s0)
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
4000574c: 00048513 mv a0,s1
40005750: 231190ef jal ra,4001f180 <iconv_open>
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
40005754: 400334b7 lui s1,0x40033
40005758: d6048593 addi a1,s1,-672 # 40032d60 <rtems_filesystem_null_handlers+0x84>
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
4000575c: 00a42823 sw a0,16(s0)
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
40005760: d5890513 addi a0,s2,-680
40005764: 21d190ef jal ra,4001f180 <iconv_open>
40005768: 00a42a23 sw a0,20(s0)
self->desc_utf8_to_utf16 = iconv_open( "UTF-16LE", "UTF-8" );
4000576c: d5890593 addi a1,s2,-680
40005770: d6048513 addi a0,s1,-672
40005774: 20d190ef jal ra,4001f180 <iconv_open>
if (
40005778: 01442703 lw a4,20(s0)
self->desc_utf8_to_utf16 = iconv_open( "UTF-16LE", "UTF-8" );
4000577c: 00a42c23 sw a0,24(s0)
if (
40005780: fff00793 li a5,-1
40005784: 04f70863 beq a4,a5,400057d4 <rtems_dosfs_create_utf8_converter+0xc8>
self->desc_utf16_to_utf8 != INVALID_ICONV_DESC
&& self->desc_utf8_to_codepage != INVALID_ICONV_DESC
40005788: 01042703 lw a4,16(s0)
4000578c: 04f70463 beq a4,a5,400057d4 <rtems_dosfs_create_utf8_converter+0xc8>
&& self->desc_codepage_to_utf8 != INVALID_ICONV_DESC
40005790: 00c42703 lw a4,12(s0)
40005794: 04f70063 beq a4,a5,400057d4 <rtems_dosfs_create_utf8_converter+0xc8>
&& self->desc_utf8_to_utf16 != INVALID_ICONV_DESC
40005798: 02f50e63 beq a0,a5,400057d4 <rtems_dosfs_create_utf8_converter+0xc8>
) {
rtems_dosfs_convert_control *super = &self->super;
super->handler = &msdos_utf8_convert_handler;
4000579c: 400337b7 lui a5,0x40033
400057a0: d9878793 addi a5,a5,-616 # 40032d98 <msdos_utf8_convert_handler>
400057a4: 00f42023 sw a5,0(s0)
super->buffer.data = &self->buffer;
400057a8: 01c40713 addi a4,s0,28
super->buffer.size = sizeof( self->buffer );
400057ac: 41000793 li a5,1040
self = NULL;
}
}
return &self->super;
}
400057b0: 00c12083 lw ra,12(sp)
super->buffer.data = &self->buffer;
400057b4: 00e42223 sw a4,4(s0)
super->buffer.size = sizeof( self->buffer );
400057b8: 00f42423 sw a5,8(s0)
}
400057bc: 00040513 mv a0,s0
400057c0: 00812403 lw s0,8(sp)
400057c4: 00412483 lw s1,4(sp)
400057c8: 00012903 lw s2,0(sp)
400057cc: 01010113 addi sp,sp,16
400057d0: 00008067 ret
msdos_utf8_destroy( &self->super );
400057d4: 00040513 mv a0,s0 <== NOT EXECUTED
400057d8: c85ff0ef jal ra,4000545c <msdos_utf8_destroy> <== NOT EXECUTED
self = NULL;
400057dc: 00000413 li s0,0 <== NOT EXECUTED
}
400057e0: 00c12083 lw ra,12(sp) <== NOT EXECUTED
400057e4: 00040513 mv a0,s0 <== NOT EXECUTED
400057e8: 00812403 lw s0,8(sp) <== NOT EXECUTED
400057ec: 00412483 lw s1,4(sp) <== NOT EXECUTED
400057f0: 00012903 lw s2,0(sp) <== NOT EXECUTED
400057f4: 01010113 addi sp,sp,16 <== NOT EXECUTED
400057f8: 00008067 ret <== NOT EXECUTED
40004bbc <rtems_dosfs_initialize>:
*/
int rtems_dosfs_initialize(
rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data
)
{
40004bbc: ff010113 addi sp,sp,-16
40004bc0: 00812423 sw s0,8(sp)
40004bc4: 00112623 sw ra,12(sp)
40004bc8: 00912223 sw s1,4(sp)
40004bcc: 00050413 mv s0,a0
const rtems_dosfs_mount_options *mount_options = data;
rtems_dosfs_convert_control *converter;
bool converter_created = false;
if (mount_options == NULL || mount_options->converter == NULL) {
40004bd0: 02058c63 beqz a1,40004c08 <rtems_dosfs_initialize+0x4c>
40004bd4: 0005a703 lw a4,0(a1)
40004bd8: 02070863 beqz a4,40004c08 <rtems_dosfs_initialize+0x4c> <== NEVER TAKEN
errno = ENOMEM;
rc = -1;
}
return rc;
}
40004bdc: 00812403 lw s0,8(sp)
40004be0: 00c12083 lw ra,12(sp)
40004be4: 00412483 lw s1,4(sp)
rc = msdos_initialize_support(mt_entry,
40004be8: 400266b7 lui a3,0x40026
40004bec: 40026637 lui a2,0x40026
40004bf0: 400265b7 lui a1,0x40026
40004bf4: dc068693 addi a3,a3,-576 # 40025dc0 <msdos_dir_handlers>
40004bf8: e0060613 addi a2,a2,-512 # 40025e00 <msdos_file_handlers>
40004bfc: 8a458593 addi a1,a1,-1884 # 400258a4 <msdos_ops>
}
40004c00: 01010113 addi sp,sp,16
rc = msdos_initialize_support(mt_entry,
40004c04: 0780006f j 40004c7c <msdos_initialize_support>
converter = rtems_dosfs_create_default_converter();
40004c08: 3050a0ef jal ra,4000f70c <rtems_dosfs_create_default_converter>
40004c0c: 00050493 mv s1,a0
if (converter != NULL) {
40004c10: 04050c63 beqz a0,40004c68 <rtems_dosfs_initialize+0xac> <== NEVER TAKEN
rc = msdos_initialize_support(mt_entry,
40004c14: 400266b7 lui a3,0x40026
40004c18: 40026637 lui a2,0x40026
40004c1c: 400265b7 lui a1,0x40026
40004c20: 00050713 mv a4,a0
40004c24: dc068693 addi a3,a3,-576 # 40025dc0 <msdos_dir_handlers>
40004c28: 00040513 mv a0,s0
40004c2c: e0060613 addi a2,a2,-512 # 40025e00 <msdos_file_handlers>
40004c30: 8a458593 addi a1,a1,-1884 # 400258a4 <msdos_ops>
40004c34: 048000ef jal ra,40004c7c <msdos_initialize_support>
40004c38: 00050413 mv s0,a0
if (rc != 0 && converter_created) {
40004c3c: 00050a63 beqz a0,40004c50 <rtems_dosfs_initialize+0x94> <== ALWAYS TAKEN
(*converter->handler->destroy)(converter);
40004c40: 0004a783 lw a5,0(s1) # 1000 <_ISR_Stack_size> <== NOT EXECUTED
40004c44: 00048513 mv a0,s1 <== NOT EXECUTED
40004c48: 0147a783 lw a5,20(a5) <== NOT EXECUTED
40004c4c: 000780e7 jalr a5 <== NOT EXECUTED
}
40004c50: 00c12083 lw ra,12(sp)
40004c54: 00040513 mv a0,s0
40004c58: 00812403 lw s0,8(sp)
40004c5c: 00412483 lw s1,4(sp)
40004c60: 01010113 addi sp,sp,16
40004c64: 00008067 ret
errno = ENOMEM;
40004c68: 2f0160ef jal ra,4001af58 <__errno> <== NOT EXECUTED
40004c6c: 00c00793 li a5,12 <== NOT EXECUTED
40004c70: 00f52023 sw a5,0(a0) <== NOT EXECUTED
rc = -1;
40004c74: fff00413 li s0,-1 <== NOT EXECUTED
return rc;
40004c78: fd9ff06f j 40004c50 <rtems_dosfs_initialize+0x94> <== NOT EXECUTED