RTEMS-6
Annotated Report
libdosfs
Sun Feb 28 23:44:36 2021
0010ca88 <_fat_block_read>:
uint32_t start,
uint32_t offset,
uint32_t count,
void *buff
)
{
10ca88: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
10ca8c: 461e mov r6, r3
{
10ca8e: b083 sub sp, #12
while (count > 0)
10ca90: 2b00 cmp r3, #0
10ca92: d044 beq.n 10cb1e <_fat_block_read+0x96> <== ALWAYS TAKEN
10ca94: 4605 mov r5, r0
10ca96: 4689 mov r9, r1
10ca98: 4617 mov r7, r2
ssize_t cmpltd = 0;
10ca9a: f04f 0800 mov.w r8, #0
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
10ca9e: f100 0aa0 add.w sl, r0, #160 ; 0xa0
fs_info->c.modified = 0;
10caa2: f44f 7b80 mov.w fp, #256 ; 0x100
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10caa6: f895 e002 ldrb.w lr, [r5, #2]
10caaa: 4628 mov r0, r5
10caac: 7d2a ldrb r2, [r5, #20]
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
10caae: f895 309d ldrb.w r3, [r5, #157] ; 0x9d
10cab2: eba2 020e sub.w r2, r2, lr
10cab6: fa29 f102 lsr.w r1, r9, r2
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10caba: fa01 f402 lsl.w r4, r1, r2
((sector -
10cabe: eba9 0404 sub.w r4, r9, r4
<< fs_info->vol.sec_log2);
10cac2: fa04 f40e lsl.w r4, r4, lr
10cac6: b13b cbz r3, 10cad8 <_fat_block_read+0x50>
10cac8: f8d5 2098 ldr.w r2, [r5, #152] ; 0x98
10cacc: 9101 str r1, [sp, #4]
10cace: 454a cmp r2, r9
10cad0: d00b beq.n 10caea <_fat_block_read+0x62>
10cad2: f7ff ff07 bl 10c8e4 <fat_buf_release.part.0>
10cad6: 9901 ldr r1, [sp, #4]
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
10cad8: 6ee8 ldr r0, [r5, #108] ; 0x6c
10cada: 4652 mov r2, sl
10cadc: f005 fae8 bl 1120b0 <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL)
10cae0: b9f8 cbnz r0, 10cb22 <_fat_block_read+0x9a>
fs_info->c.blk_num = sec_num;
10cae2: f8c5 9098 str.w r9, [r5, #152] ; 0x98
fs_info->c.modified = 0;
10cae6: f8a5 b09c strh.w fp, [r5, #156] ; 0x9c
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));
memcpy((buff + cmpltd), (sec_buf + ofs), c);
10caea: 9b0c ldr r3, [sp, #48] ; 0x30
10caec: 19e1 adds r1, r4, r7
c = MIN(count, (fs_info->vol.bps - ofs));
10caee: 882a ldrh r2, [r5, #0]
count -= c;
cmpltd += c;
sec_num++;
10caf0: f109 0901 add.w r9, r9, #1
memcpy((buff + cmpltd), (sec_buf + ofs), c);
10caf4: eb03 0008 add.w r0, r3, r8
10caf8: f8d5 30a0 ldr.w r3, [r5, #160] ; 0xa0
c = MIN(count, (fs_info->vol.bps - ofs));
10cafc: 1bd4 subs r4, r2, r7
ofs = 0;
10cafe: 2700 movs r7, #0
c = MIN(count, (fs_info->vol.bps - ofs));
10cb00: 42b4 cmp r4, r6
memcpy((buff + cmpltd), (sec_buf + ofs), c);
10cb02: 69db ldr r3, [r3, #28]
c = MIN(count, (fs_info->vol.bps - ofs));
10cb04: bf28 it cs
10cb06: 4634 movcs r4, r6
memcpy((buff + cmpltd), (sec_buf + ofs), c);
10cb08: 4622 mov r2, r4
cmpltd += c;
10cb0a: 44a0 add r8, r4
memcpy((buff + cmpltd), (sec_buf + ofs), c);
10cb0c: 4419 add r1, r3
10cb0e: f008 eb78 blx 115200 <memcpy>
while (count > 0)
10cb12: 1b36 subs r6, r6, r4
10cb14: d1c7 bne.n 10caa6 <_fat_block_read+0x1e>
}
return cmpltd;
}
10cb16: 4640 mov r0, r8
10cb18: b003 add sp, #12
10cb1a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
ssize_t cmpltd = 0;
10cb1e: 4698 mov r8, r3 <== NOT EXECUTED
10cb20: e7f9 b.n 10cb16 <_fat_block_read+0x8e> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
10cb22: f008 f8ad bl 114c80 <__errno> <== NOT EXECUTED
10cb26: 2305 movs r3, #5 <== NOT EXECUTED
return -1;
10cb28: f04f 38ff mov.w r8, #4294967295 ; 0xffffffff <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
10cb2c: 6003 str r3, [r0, #0] <== NOT EXECUTED
if (rc != RC_OK)
10cb2e: e7f2 b.n 10cb16 <_fat_block_read+0x8e> <== NOT EXECUTED
0010c9f8 <fat_buf_access>:
{
10c9f8: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
10c9fc: 461f mov r7, r3
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10c9fe: 7884 ldrb r4, [r0, #2]
10ca00: 4605 mov r5, r0
10ca02: 460e mov r6, r1
10ca04: 4690 mov r8, r2
10ca06: f890 c014 ldrb.w ip, [r0, #20]
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
10ca0a: f890 309d ldrb.w r3, [r0, #157] ; 0x9d
10ca0e: ebac 0c04 sub.w ip, ip, r4
10ca12: fa21 f90c lsr.w r9, r1, ip
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10ca16: fa09 fc0c lsl.w ip, r9, ip
((sector -
10ca1a: eba1 0c0c sub.w ip, r1, ip
<< fs_info->vol.sec_log2);
10ca1e: fa0c f404 lsl.w r4, ip, r4
10ca22: b12b cbz r3, 10ca30 <fat_buf_access+0x38>
10ca24: f8d0 3098 ldr.w r3, [r0, #152] ; 0x98
10ca28: 428b cmp r3, r1
10ca2a: d011 beq.n 10ca50 <fat_buf_access+0x58>
if (fs_info->c.state == FAT_CACHE_EMPTY)
10ca2c: f7ff ff5a bl 10c8e4 <fat_buf_release.part.0>
if (op_type == FAT_OP_TYPE_READ)
10ca30: f1b8 0f01 cmp.w r8, #1
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
10ca34: 6ee8 ldr r0, [r5, #108] ; 0x6c
10ca36: f105 02a0 add.w r2, r5, #160 ; 0xa0
10ca3a: 4649 mov r1, r9
if (op_type == FAT_OP_TYPE_READ)
10ca3c: d010 beq.n 10ca60 <fat_buf_access+0x68>
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
10ca3e: f005 faf9 bl 112034 <rtems_bdbuf_get>
if (sc != RTEMS_SUCCESSFUL)
10ca42: b980 cbnz r0, 10ca66 <fat_buf_access+0x6e>
fs_info->c.modified = 0;
10ca44: f44f 7380 mov.w r3, #256 ; 0x100
fs_info->c.blk_num = sec_num;
10ca48: f8c5 6098 str.w r6, [r5, #152] ; 0x98
fs_info->c.modified = 0;
10ca4c: f8a5 309c strh.w r3, [r5, #156] ; 0x9c
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
10ca50: f8d5 30a0 ldr.w r3, [r5, #160] ; 0xa0
return RC_OK;
10ca54: 2000 movs r0, #0
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
10ca56: 69db ldr r3, [r3, #28]
10ca58: 441c add r4, r3
10ca5a: 603c str r4, [r7, #0]
}
10ca5c: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
10ca60: f005 fb26 bl 1120b0 <rtems_bdbuf_read>
10ca64: e7ed b.n 10ca42 <fat_buf_access+0x4a>
rtems_set_errno_and_return_minus_one(EIO);
10ca66: f008 f90b bl 114c80 <__errno> <== NOT EXECUTED
10ca6a: 2205 movs r2, #5 <== NOT EXECUTED
10ca6c: 4603 mov r3, r0 <== NOT EXECUTED
10ca6e: 601a str r2, [r3, #0] <== NOT EXECUTED
10ca70: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10ca74: e7f2 b.n 10ca5c <fat_buf_access+0x64> <== NOT EXECUTED
10ca76: bf00 nop
0010c8e4 <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)
10c8e4: f890 309c ldrb.w r3, [r0, #156] ; 0x9c <== NOT EXECUTED
fat_buf_release(fat_fs_info_t *fs_info)
10c8e8: b5f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
10c8ea: 4604 mov r4, r0 <== NOT EXECUTED
10c8ec: b083 sub sp, #12 <== 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,
10c8ee: f8d0 00a0 ldr.w r0, [r0, #160] ; 0xa0 <== NOT EXECUTED
if (fs_info->c.modified)
10c8f2: 2b00 cmp r3, #0 <== NOT EXECUTED
10c8f4: d055 beq.n 10c9a2 <fat_buf_release.part.0+0xbe> <== NOT EXECUTED
uint32_t sec_num = fs_info->c.blk_num;
10c8f6: f8d4 3098 ldr.w r3, [r4, #152] ; 0x98 <== NOT EXECUTED
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
10c8fa: 8c22 ldrh r2, [r4, #32] <== NOT EXECUTED
10c8fc: 4293 cmp r3, r2 <== NOT EXECUTED
10c8fe: d20b bcs.n 10c918 <fat_buf_release.part.0+0x34> <== NOT EXECUTED
fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
10c900: f005 fcb4 bl 11226c <rtems_bdbuf_release_modified> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
10c904: 2800 cmp r0, #0 <== NOT EXECUTED
10c906: d150 bne.n 10c9aa <fat_buf_release.part.0+0xc6> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.modified = 0;
10c908: f884 009c strb.w r0, [r4, #156] ; 0x9c <== 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;
10c90c: 2300 movs r3, #0 <== NOT EXECUTED
return RC_OK;
10c90e: 4618 mov r0, r3 <== NOT EXECUTED
fs_info->c.state = FAT_CACHE_EMPTY;
10c910: f884 309d strb.w r3, [r4, #157] ; 0x9d <== NOT EXECUTED
}
10c914: b003 add sp, #12 <== NOT EXECUTED
10c916: bdf0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
10c918: 6aa2 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED
10c91a: 4293 cmp r3, r2 <== NOT EXECUTED
10c91c: d2f0 bcs.n 10c900 <fat_buf_release.part.0+0x1c> <== NOT EXECUTED
if (sec_of_fat && !fs_info->vol.mirror)
10c91e: f894 205c ldrb.w r2, [r4, #92] ; 0x5c <== NOT EXECUTED
10c922: 2a00 cmp r2, #0 <== NOT EXECUTED
10c924: d04c beq.n 10c9c0 <fat_buf_release.part.0+0xdc> <== NOT EXECUTED
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
10c926: f005 fca1 bl 11226c <rtems_bdbuf_release_modified> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
10c92a: 2800 cmp r0, #0 <== NOT EXECUTED
10c92c: d13d bne.n 10c9aa <fat_buf_release.part.0+0xc6> <== NOT EXECUTED
if (sec_of_fat && !fs_info->vol.mirror)
10c92e: f894 305c ldrb.w r3, [r4, #92] ; 0x5c <== NOT EXECUTED
fs_info->c.modified = 0;
10c932: f884 009c strb.w r0, [r4, #156] ; 0x9c <== NOT EXECUTED
if (sec_of_fat && !fs_info->vol.mirror)
10c936: 2b00 cmp r3, #0 <== NOT EXECUTED
10c938: d1e8 bne.n 10c90c <fat_buf_release.part.0+0x28> <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
10c93a: 7d63 ldrb r3, [r4, #21] <== NOT EXECUTED
10c93c: 2b01 cmp r3, #1 <== NOT EXECUTED
10c93e: bf88 it hi <== NOT EXECUTED
10c940: 2601 movhi r6, #1 <== NOT EXECUTED
10c942: d9e3 bls.n 10c90c <fat_buf_release.part.0+0x28> <== NOT EXECUTED
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
10c944: 6a60 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
10c946: aa01 add r2, sp, #4 <== NOT EXECUTED
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
10c948: f8d4 3098 ldr.w r3, [r4, #152] ; 0x98 <== 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);
10c94c: 78a5 ldrb r5, [r4, #2] <== NOT EXECUTED
10c94e: 7d21 ldrb r1, [r4, #20] <== NOT EXECUTED
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
10c950: 6ee7 ldr r7, [r4, #108] ; 0x6c <== NOT EXECUTED
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
10c952: fb00 3306 mla r3, r0, r6, r3 <== NOT EXECUTED
10c956: 1b49 subs r1, r1, r5 <== NOT EXECUTED
10c958: fa23 fc01 lsr.w ip, r3, r1 <== NOT EXECUTED
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10c95c: fa0c f001 lsl.w r0, ip, r1 <== NOT EXECUTED
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
10c960: 4661 mov r1, ip <== 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 -
10c962: 1a1b subs r3, r3, r0 <== NOT EXECUTED
10c964: 4638 mov r0, r7 <== NOT EXECUTED
if (blk_ofs == 0
10c966: fa13 f505 lsls.w r5, r3, r5 <== NOT EXECUTED
10c96a: d104 bne.n 10c976 <fat_buf_release.part.0+0x92> <== NOT EXECUTED
&& fs_info->vol.bps == fs_info->vol.bytes_per_block)
10c96c: f8b4 e000 ldrh.w lr, [r4] <== NOT EXECUTED
10c970: 6923 ldr r3, [r4, #16] <== NOT EXECUTED
10c972: 459e cmp lr, r3 <== NOT EXECUTED
10c974: d021 beq.n 10c9ba <fat_buf_release.part.0+0xd6> <== NOT EXECUTED
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
10c976: f005 fb9b bl 1120b0 <rtems_bdbuf_read> <== NOT EXECUTED
if ( sc != RTEMS_SUCCESSFUL)
10c97a: 2800 cmp r0, #0 <== NOT EXECUTED
10c97c: d133 bne.n 10c9e6 <fat_buf_release.part.0+0x102> <== NOT EXECUTED
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
10c97e: 9b01 ldr r3, [sp, #4] <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
10c980: 3601 adds r6, #1 <== NOT EXECUTED
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
10c982: 8822 ldrh r2, [r4, #0] <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
10c984: b2f6 uxtb r6, r6 <== NOT EXECUTED
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
10c986: f8d4 10a4 ldr.w r1, [r4, #164] ; 0xa4 <== NOT EXECUTED
10c98a: 69d8 ldr r0, [r3, #28] <== NOT EXECUTED
10c98c: 4428 add r0, r5 <== NOT EXECUTED
10c98e: f008 ec38 blx 115200 <memcpy> <== NOT EXECUTED
sc = rtems_bdbuf_release_modified(bd);
10c992: 9801 ldr r0, [sp, #4] <== NOT EXECUTED
10c994: f005 fc6a bl 11226c <rtems_bdbuf_release_modified> <== NOT EXECUTED
if ( sc != RTEMS_SUCCESSFUL)
10c998: bb28 cbnz r0, 10c9e6 <fat_buf_release.part.0+0x102> <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
10c99a: 7d63 ldrb r3, [r4, #21] <== NOT EXECUTED
10c99c: 42b3 cmp r3, r6 <== NOT EXECUTED
10c99e: d8d1 bhi.n 10c944 <fat_buf_release.part.0+0x60> <== NOT EXECUTED
10c9a0: e7b4 b.n 10c90c <fat_buf_release.part.0+0x28> <== NOT EXECUTED
sc = rtems_bdbuf_release(fs_info->c.buf);
10c9a2: f005 fc15 bl 1121d0 <rtems_bdbuf_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
10c9a6: 2800 cmp r0, #0 <== NOT EXECUTED
10c9a8: d0b0 beq.n 10c90c <fat_buf_release.part.0+0x28> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
10c9aa: f008 f969 bl 114c80 <__errno> <== NOT EXECUTED
10c9ae: 2205 movs r2, #5 <== NOT EXECUTED
10c9b0: 4603 mov r3, r0 <== NOT EXECUTED
10c9b2: 601a str r2, [r3, #0] <== NOT EXECUTED
10c9b4: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10c9b8: e7ac b.n 10c914 <fat_buf_release.part.0+0x30> <== NOT EXECUTED
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
10c9ba: f005 fb3b bl 112034 <rtems_bdbuf_get> <== NOT EXECUTED
10c9be: e7dc b.n 10c97a <fat_buf_release.part.0+0x96> <== NOT EXECUTED
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10c9c0: 78a6 ldrb r6, [r4, #2] <== NOT EXECUTED
10c9c2: 7d22 ldrb r2, [r4, #20] <== NOT EXECUTED
fs_info->c.buf->buffer + blk_ofs,
10c9c4: 69c1 ldr r1, [r0, #28] <== NOT EXECUTED
10c9c6: 1b90 subs r0, r2, r6 <== NOT EXECUTED
memcpy(fs_info->sec_buf,
10c9c8: 8822 ldrh r2, [r4, #0] <== NOT EXECUTED
10c9ca: fa23 f500 lsr.w r5, r3, r0 <== NOT EXECUTED
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10c9ce: fa05 f000 lsl.w r0, r5, r0 <== NOT EXECUTED
((sector -
10c9d2: 1a1b subs r3, r3, r0 <== NOT EXECUTED
10c9d4: f8d4 00a4 ldr.w r0, [r4, #164] ; 0xa4 <== NOT EXECUTED
fat_block_num_to_sector_num (fs_info,
fat_sector_num_to_block_num (fs_info, sector)))
<< fs_info->vol.sec_log2);
10c9d8: 40b3 lsls r3, r6 <== NOT EXECUTED
10c9da: 4419 add r1, r3 <== NOT EXECUTED
10c9dc: f008 ec10 blx 115200 <memcpy> <== NOT EXECUTED
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
10c9e0: f8d4 00a0 ldr.w r0, [r4, #160] ; 0xa0 <== NOT EXECUTED
10c9e4: e79f b.n 10c926 <fat_buf_release.part.0+0x42> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
10c9e6: f008 f94b bl 114c80 <__errno> <== NOT EXECUTED
10c9ea: 230c movs r3, #12 <== NOT EXECUTED
10c9ec: 6003 str r3, [r0, #0] <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
10c9ee: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
10c9f2: b003 add sp, #12 <== NOT EXECUTED
10c9f4: bdf0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
10c9f6: bf00 nop
0010cba0 <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)
{
10cba0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10cba4: 4606 mov r6, r0
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
10cba6: 6880 ldr r0, [r0, #8]
{
10cba8: b083 sub sp, #12
10cbaa: f89d b030 ldrb.w fp, [sp, #48] ; 0x30
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
10cbae: 1a85 subs r5, r0, r2
10cbb0: 78b0 ldrb r0, [r6, #2]
10cbb2: 429d cmp r5, r3
10cbb4: bf28 it cs
10cbb6: 461d movcs r5, r3
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10cbb8: 7d33 ldrb r3, [r6, #20]
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10cbba: eba3 0800 sub.w r8, r3, r0
10cbbe: b911 cbnz r1, 10cbc6 <fat_cluster_set+0x26>
10cbc0: 7db4 ldrb r4, [r6, #22] <== NOT EXECUTED
10cbc2: 07a4 lsls r4, r4, #30 <== NOT EXECUTED
10cbc4: d146 bne.n 10cc54 <fat_cluster_set+0xb4> <== NOT EXECUTED
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
10cbc6: 7b37 ldrb r7, [r6, #12]
cln -= FAT_RSRVD_CLN;
10cbc8: 3902 subs r1, #2
10cbca: 6bf4 ldr r4, [r6, #60] ; 0x3c
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;
10cbcc: fa22 f903 lsr.w r9, r2, r3
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
10cbd0: 1aff subs r7, r7, r3
10cbd2: 40b9 lsls r1, r7
10cbd4: fa24 f808 lsr.w r8, r4, r8
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
10cbd8: 4488 add r8, r1
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
10cbda: 44c8 add r8, r9
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
10cbdc: fa09 f903 lsl.w r9, r9, r3
10cbe0: eba2 0909 sub.w r9, r2, r9
while ( (RC_OK == rc)
10cbe4: 2d00 cmp r5, #0
10cbe6: d041 beq.n 10cc6c <fat_cluster_set+0xcc> <== ALWAYS TAKEN
ssize_t bytes_written = 0;
10cbe8: f04f 0a00 mov.w sl, #0
&& (0 < bytes_to_write))
{
uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
10cbec: 6932 ldr r2, [r6, #16]
10cbee: eba2 0409 sub.w r4, r2, r9
10cbf2: 42ac cmp r4, r5
10cbf4: 4627 mov r7, r4
10cbf6: bf28 it cs
10cbf8: 462f movcs r7, r5
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
10cbfa: 463c mov r4, r7
if (0 < bytes_to_write)
10cbfc: b347 cbz r7, 10cc50 <fat_cluster_set+0xb0>
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10cbfe: 1a1b subs r3, r3, r0
if (bytes_to_write == fs_info->vol.bytes_per_block)
10cc00: 42ba cmp r2, r7
10cc02: fa08 f103 lsl.w r1, r8, r3
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
10cc06: bf0c ite eq
10cc08: 2202 moveq r2, #2
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
10cc0a: 2201 movne r2, #1
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
10cc0c: ab01 add r3, sp, #4
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
10cc0e: 4630 mov r0, r6
10cc10: f7ff fef2 bl 10c9f8 <fat_buf_access>
if (RC_OK == rc)
10cc14: b190 cbz r0, 10cc3c <fat_cluster_set+0x9c>
fs_info,
cur_blk,
ofs_blk,
c,
pattern);
if (c != ret)
10cc16: 4604 mov r4, r0 <== NOT EXECUTED
10cc18: 42a7 cmp r7, r4
10cc1a: d005 beq.n 10cc28 <fat_cluster_set+0x88> <== NEVER TAKEN
10cc1c: f04f 3aff mov.w sl, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
if (RC_OK != rc)
return rc;
else
return bytes_written;
}
10cc20: 4650 mov r0, sl
10cc22: b003 add sp, #12
10cc24: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
while ( (RC_OK == rc)
10cc28: 1bed subs r5, r5, r7
bytes_written += ret;
10cc2a: 4482 add sl, r0
++cur_blk;
10cc2c: f108 0801 add.w r8, r8, #1
while ( (RC_OK == rc)
10cc30: d0f6 beq.n 10cc20 <fat_cluster_set+0x80>
10cc32: 7d33 ldrb r3, [r6, #20]
10cc34: f04f 0900 mov.w r9, #0
10cc38: 78b0 ldrb r0, [r6, #2]
10cc3a: e7d7 b.n 10cbec <fat_cluster_set+0x4c>
memset(blk_buf + offset, pattern, bytes_to_write);
10cc3c: 9801 ldr r0, [sp, #4]
10cc3e: 463a mov r2, r7
10cc40: 4659 mov r1, fp
10cc42: 4448 add r0, r9
10cc44: f008 fd4c bl 1156e0 <memset>
fs_info->c.modified = true;
10cc48: f04f 0301 mov.w r3, #1
10cc4c: f886 309c strb.w r3, [r6, #156] ; 0x9c
return bytes_to_write;
10cc50: 4620 mov r0, r4
10cc52: e7e1 b.n 10cc18 <fat_cluster_set+0x78>
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10cc54: 6ab1 ldr r1, [r6, #40] ; 0x28 <== NOT EXECUTED
uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2;
10cc56: fa22 f903 lsr.w r9, r2, r3 <== NOT EXECUTED
10cc5a: fa21 f808 lsr.w r8, r1, r8 <== NOT EXECUTED
cur_blk += blocks_in_offset;
10cc5e: 44c8 add r8, r9 <== NOT EXECUTED
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
10cc60: fa09 f903 lsl.w r9, r9, r3 <== NOT EXECUTED
10cc64: eba2 0909 sub.w r9, r2, r9 <== NOT EXECUTED
while ( (RC_OK == rc)
10cc68: 2d00 cmp r5, #0 <== NOT EXECUTED
10cc6a: d1bd bne.n 10cbe8 <fat_cluster_set+0x48> <== NOT EXECUTED
ssize_t bytes_written = 0;
10cc6c: 46aa mov sl, r5 <== NOT EXECUTED
}
10cc6e: 4650 mov r0, sl <== NOT EXECUTED
10cc70: b003 add sp, #12 <== NOT EXECUTED
10cc72: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
10cc76: bf00 nop
0010cc78 <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)
{
10cc78: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10cc7c: 4606 mov r6, r0
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
10cc7e: 6880 ldr r0, [r0, #8]
{
10cc80: b083 sub sp, #12
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
10cc82: 1a85 subs r5, r0, r2
10cc84: 78b0 ldrb r0, [r6, #2]
10cc86: 429d cmp r5, r3
10cc88: bf28 it cs
10cc8a: 461d movcs r5, r3
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10cc8c: 7d33 ldrb r3, [r6, #20]
10cc8e: eba3 0800 sub.w r8, r3, r0
10cc92: b911 cbnz r1, 10cc9a <fat_cluster_write+0x22>
10cc94: 7db4 ldrb r4, [r6, #22]
10cc96: 07a4 lsls r4, r4, #30
10cc98: d148 bne.n 10cd2c <fat_cluster_write+0xb4> <== NEVER TAKEN
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
10cc9a: 7b37 ldrb r7, [r6, #12]
cln -= FAT_RSRVD_CLN;
10cc9c: 3902 subs r1, #2
10cc9e: 6bf4 ldr r4, [r6, #60] ; 0x3c
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);
10cca0: fa22 f903 lsr.w r9, r2, r3
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
10cca4: 1aff subs r7, r7, r3
10cca6: 40b9 lsls r1, r7
10cca8: fa24 f808 lsr.w r8, r4, r8
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
10ccac: 4488 add r8, r1
ssize_t bytes_written = 0;
uint8_t *buffer = (uint8_t*)buff;
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
10ccae: 44c8 add r8, r9
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
10ccb0: fa09 f903 lsl.w r9, r9, r3
10ccb4: eba2 0909 sub.w r9, r2, r9
while ( (RC_OK == rc)
10ccb8: 2d00 cmp r5, #0
10ccba: d043 beq.n 10cd44 <fat_cluster_write+0xcc> <== ALWAYS TAKEN
ssize_t bytes_written = 0;
10ccbc: f04f 0a00 mov.w sl, #0
fs_info->c.modified = true;
10ccc0: f04f 0b01 mov.w fp, #1
&& (0 < bytes_to_write))
{
c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
10ccc4: 6932 ldr r2, [r6, #16]
10ccc6: eba2 0409 sub.w r4, r2, r9
10ccca: 42ac cmp r4, r5
10cccc: 4627 mov r7, r4
10ccce: bf28 it cs
10ccd0: 462f movcs r7, r5
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
10ccd2: 463c mov r4, r7
if (0 < bytes_to_write)
10ccd4: b347 cbz r7, 10cd28 <fat_cluster_write+0xb0>
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10ccd6: 1a1b subs r3, r3, r0
if (bytes_to_write == fs_info->vol.bytes_per_block)
10ccd8: 42ba cmp r2, r7
10ccda: fa08 f103 lsl.w r1, r8, r3
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
10ccde: bf0c ite eq
10cce0: 2202 moveq r2, #2
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
10cce2: 2201 movne r2, #1
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
10cce4: ab01 add r3, sp, #4
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
10cce6: 4630 mov r0, r6
10cce8: f7ff fe86 bl 10c9f8 <fat_buf_access>
if (RC_OK == rc)
10ccec: b190 cbz r0, 10cd14 <fat_cluster_write+0x9c>
fs_info,
cur_blk,
ofs_blk,
c,
&buffer[bytes_written]);
if (c != ret)
10ccee: 4604 mov r4, r0 <== NOT EXECUTED
10ccf0: 42a7 cmp r7, r4
10ccf2: d005 beq.n 10cd00 <fat_cluster_write+0x88> <== NEVER TAKEN
10ccf4: f04f 3aff mov.w sl, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
if (RC_OK != rc)
return rc;
else
return bytes_written;
}
10ccf8: 4650 mov r0, sl
10ccfa: b003 add sp, #12
10ccfc: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
while ( (RC_OK == rc)
10cd00: 1bed subs r5, r5, r7
bytes_written += ret;
10cd02: 4482 add sl, r0
++cur_blk;
10cd04: f108 0801 add.w r8, r8, #1
while ( (RC_OK == rc)
10cd08: d0f6 beq.n 10ccf8 <fat_cluster_write+0x80> <== NEVER TAKEN
10cd0a: 7d33 ldrb r3, [r6, #20] <== NOT EXECUTED
10cd0c: f04f 0900 mov.w r9, #0 <== NOT EXECUTED
10cd10: 78b0 ldrb r0, [r6, #2] <== NOT EXECUTED
10cd12: e7d7 b.n 10ccc4 <fat_cluster_write+0x4c> <== NOT EXECUTED
memcpy(blk_buf + offset, buf, bytes_to_write);
10cd14: 9801 ldr r0, [sp, #4]
10cd16: 463a mov r2, r7
10cd18: 9b0c ldr r3, [sp, #48] ; 0x30
10cd1a: 4448 add r0, r9
10cd1c: eb03 010a add.w r1, r3, sl
10cd20: f008 ea6e blx 115200 <memcpy>
fs_info->c.modified = true;
10cd24: f886 b09c strb.w fp, [r6, #156] ; 0x9c
return bytes_to_write;
10cd28: 4620 mov r0, r4
10cd2a: e7e1 b.n 10ccf0 <fat_cluster_write+0x78>
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
10cd2c: 6ab1 ldr r1, [r6, #40] ; 0x28
uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2);
10cd2e: fa22 f903 lsr.w r9, r2, r3
10cd32: fa21 f808 lsr.w r8, r1, r8
cur_blk += blocks_in_offset;
10cd36: 44c8 add r8, r9
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
10cd38: fa09 f903 lsl.w r9, r9, r3
10cd3c: eba2 0909 sub.w r9, r2, r9
while ( (RC_OK == rc)
10cd40: 2d00 cmp r5, #0
10cd42: d1bb bne.n 10ccbc <fat_cluster_write+0x44> <== NEVER TAKEN
ssize_t bytes_written = 0;
10cd44: 46aa mov sl, r5 <== NOT EXECUTED
}
10cd46: 4650 mov r0, sl <== NOT EXECUTED
10cd48: b003 add sp, #12 <== NOT EXECUTED
10cd4a: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
10cd4e: bf00 nop
0010dc80 <fat_file_close>:
if (fat_fd->links_num > 1)
10dc80: 688b ldr r3, [r1, #8]
{
10dc82: b570 push {r4, r5, r6, lr}
10dc84: 460c mov r4, r1
10dc86: 4605 mov r5, r0
if (fat_fd->links_num > 1)
10dc88: 2b01 cmp r3, #1
10dc8a: d906 bls.n 10dc9a <fat_file_close+0x1a>
fat_fd->links_num--;
10dc8c: 3b01 subs r3, #1
10dc8e: 608b str r3, [r1, #8]
rc = fat_buf_release(fs_info);
10dc90: 4628 mov r0, r5
}
10dc92: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr}
rc = fat_buf_release(fs_info);
10dc96: f7fe beef b.w 10ca78 <fat_buf_release>
fat_file_update(fs_info, fat_fd);
10dc9a: f7ff feef bl 10da7c <fat_file_update>
if (fat_fd->flags & FAT_FILE_REMOVED)
10dc9e: f894 3030 ldrb.w r3, [r4, #48] ; 0x30
10dca2: f013 0601 ands.w r6, r3, #1
10dca6: d106 bne.n 10dcb6 <fat_file_close+0x36>
if (fat_ino_is_unique(fs_info, fat_fd->ino))
10dca8: 68e1 ldr r1, [r4, #12]
10dcaa: 4628 mov r0, r5
10dcac: f7ff fbb2 bl 10d414 <fat_ino_is_unique>
10dcb0: b1a8 cbz r0, 10dcde <fat_file_close+0x5e>
fat_fd->links_num = 0;
10dcb2: 60a6 str r6, [r4, #8]
10dcb4: e7ec b.n 10dc90 <fat_file_close+0x10>
rc = fat_file_truncate(fs_info, fat_fd, 0);
10dcb6: 2200 movs r2, #0
10dcb8: 4621 mov r1, r4
10dcba: 4628 mov r0, r5
10dcbc: f7ff ff96 bl 10dbec <fat_file_truncate>
if (rc == RC_OK)
10dcc0: 2800 cmp r0, #0
10dcc2: d1e5 bne.n 10dc90 <fat_file_close+0x10> <== ALWAYS TAKEN
previous = the_node->previous;
10dcc4: e9d4 2300 ldrd r2, r3, [r4]
if (fat_ino_is_unique(fs_info, fat_fd->ino))
10dcc8: 4628 mov r0, r5
_hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd);
10dcca: 68e1 ldr r1, [r4, #12]
next->previous = previous;
10dccc: 6053 str r3, [r2, #4]
previous->next = next;
10dcce: 601a str r2, [r3, #0]
if (fat_ino_is_unique(fs_info, fat_fd->ino))
10dcd0: f7ff fba0 bl 10d414 <fat_ino_is_unique>
10dcd4: b958 cbnz r0, 10dcee <fat_file_close+0x6e>
free(fat_fd);
10dcd6: 4620 mov r0, r4
10dcd8: f7f7 fc84 bl 1055e4 <free>
10dcdc: e7d8 b.n 10dc90 <fat_file_close+0x10>
previous = the_node->previous;
10dcde: e9d4 2300 ldrd r2, r3, [r4]
free(fat_fd);
10dce2: 4620 mov r0, r4
next->previous = previous;
10dce4: 6053 str r3, [r2, #4]
previous->next = next;
10dce6: 601a str r2, [r3, #0]
10dce8: f7f7 fc7c bl 1055e4 <free>
10dcec: e7d0 b.n 10dc90 <fat_file_close+0x10>
fat_free_unique_ino(fs_info, fat_fd->ino);
10dcee: 68e1 ldr r1, [r4, #12] <== NOT EXECUTED
10dcf0: 4628 mov r0, r5 <== NOT EXECUTED
10dcf2: f7ff fb7b bl 10d3ec <fat_free_unique_ino> <== NOT EXECUTED
10dcf6: e7ee b.n 10dcd6 <fat_file_close+0x56> <== NOT EXECUTED
0010dd78 <fat_file_extend>:
{
10dd78: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10dd7c: b087 sub sp, #28
10dd7e: 461c mov r4, r3
*a_length = new_length;
10dd80: 9b10 ldr r3, [sp, #64] ; 0x40
{
10dd82: 4690 mov r8, r2
uint32_t chain = 0;
10dd84: 2200 movs r2, #0
10dd86: 9202 str r2, [sp, #8]
*a_length = new_length;
10dd88: 601c str r4, [r3, #0]
if (new_length <= fat_fd->fat_file_size)
10dd8a: 698b ldr r3, [r1, #24]
uint32_t last_cl = 0;
10dd8c: 9204 str r2, [sp, #16]
if (new_length <= fat_fd->fat_file_size)
10dd8e: 42a3 cmp r3, r4
10dd90: d268 bcs.n 10de64 <fat_file_extend+0xec>
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10dd92: 6a0a ldr r2, [r1, #32]
10dd94: 460d mov r5, r1
10dd96: 4607 mov r7, r0
10dd98: 2a01 cmp r2, #1
10dd9a: d069 beq.n 10de70 <fat_file_extend+0xf8>
bytes_remain = (fs_info->vol.bpc -
10dd9c: 68be ldr r6, [r7, #8]
bytes2add = new_length - fat_fd->fat_file_size;
10dd9e: eba4 0a03 sub.w sl, r4, r3
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
10dda2: 1e72 subs r2, r6, #1
10dda4: ea03 0b02 and.w fp, r3, r2
bytes_remain = (fs_info->vol.bpc -
10dda8: eba6 060b sub.w r6, r6, fp
10ddac: 4016 ands r6, r2
if (bytes2add > bytes_remain)
10ddae: 4556 cmp r6, sl
10ddb0: d255 bcs.n 10de5e <fat_file_extend+0xe6>
if (zero_fill && bytes_remain > 0) {
10ddb2: 2e00 cmp r6, #0
10ddb4: bf0c ite eq
10ddb6: 2200 moveq r2, #0
10ddb8: f008 0201 andne.w r2, r8, #1
bytes2add -= bytes_remain;
10ddbc: ebaa 0a06 sub.w sl, sl, r6
if (zero_fill && bytes_remain > 0) {
10ddc0: 2a00 cmp r2, #0
10ddc2: d164 bne.n 10de8e <fat_file_extend+0x116> <== ALWAYS TAKEN
if (bytes2add == 0)
10ddc4: f1ba 0f00 cmp.w sl, #0
10ddc8: d04c beq.n 10de64 <fat_file_extend+0xec>
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
10ddca: f8cd 8004 str.w r8, [sp, #4]
cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1;
10ddce: f10a 38ff add.w r8, sl, #4294967295 ; 0xffffffff
10ddd2: 7b3a ldrb r2, [r7, #12]
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
10ddd4: ab04 add r3, sp, #16
10ddd6: 9300 str r3, [sp, #0]
10ddd8: a902 add r1, sp, #8
10ddda: ab05 add r3, sp, #20
10dddc: 4638 mov r0, r7
cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1;
10ddde: fa28 f802 lsr.w r8, r8, r2
10dde2: f108 0801 add.w r8, r8, #1
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
10dde6: 4642 mov r2, r8
10dde8: f7ff fc8a bl 10d700 <fat_scan_fat_for_free_clusters>
if (rc != RC_OK)
10ddec: 4681 mov r9, r0
10ddee: 2800 cmp r0, #0
10ddf0: d13a bne.n 10de68 <fat_file_extend+0xf0> <== ALWAYS TAKEN
if ((cls_added == 0) && (bytes_remain == 0))
10ddf2: 9b05 ldr r3, [sp, #20]
10ddf4: ea53 0206 orrs.w r2, r3, r6
10ddf8: d040 beq.n 10de7c <fat_file_extend+0x104>
if (cls2add != cls_added)
10ddfa: 4543 cmp r3, r8
10ddfc: d00a beq.n 10de14 <fat_file_extend+0x9c>
uint32_t missing = (cls2add - cls_added) << fs_info->vol.bpc_log2;
10ddfe: 7b3a ldrb r2, [r7, #12]
10de00: eba8 0803 sub.w r8, r8, r3
10de04: fa08 f802 lsl.w r8, r8, r2
new_length -= bytes2add < missing ? bytes2add : missing;
10de08: 45d0 cmp r8, sl
10de0a: bf94 ite ls
10de0c: eba4 0408 subls.w r4, r4, r8
10de10: eba4 040a subhi.w r4, r4, sl
if (cls_added > 0)
10de14: 2b00 cmp r3, #0
10de16: d052 beq.n 10debe <fat_file_extend+0x146>
if ( fat_fd->fat_file_size == 0 )
10de18: 69ab ldr r3, [r5, #24]
10de1a: 2b00 cmp r3, #0
10de1c: d05c beq.n 10ded8 <fat_file_extend+0x160>
if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE)
10de1e: 6be9 ldr r1, [r5, #60] ; 0x3c
10de20: 1c4a adds r2, r1, #1
old_last_cl = fat_fd->map.last_cln;
10de22: bf18 it ne
10de24: 9103 strne r1, [sp, #12]
if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE)
10de26: d062 beq.n 10deee <fat_file_extend+0x176> <== ALWAYS TAKEN
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
10de28: 9a02 ldr r2, [sp, #8]
10de2a: 4638 mov r0, r7
10de2c: f7ff fb70 bl 10d510 <fat_set_fat_cluster>
if ( rc != RC_OK )
10de30: 4603 mov r3, r0
10de32: b970 cbnz r0, 10de52 <fat_file_extend+0xda>
fat_buf_release(fs_info);
10de34: 4638 mov r0, r7
10de36: f7fe fe1f bl 10ca78 <fat_buf_release>
if (fat_fd->fat_file_type == FAT_DIRECTORY)
10de3a: 692b ldr r3, [r5, #16]
fat_fd->map.last_cln = last_cl;
10de3c: 9a04 ldr r2, [sp, #16]
10de3e: 63ea str r2, [r5, #60] ; 0x3c
if (fat_fd->fat_file_type == FAT_DIRECTORY)
10de40: 2b00 cmp r3, #0
10de42: d13c bne.n 10debe <fat_file_extend+0x146>
rc = fat_init_clusters_chain(fs_info, chain);
10de44: 9902 ldr r1, [sp, #8]
10de46: 4638 mov r0, r7
10de48: f7ff fa62 bl 10d310 <fat_init_clusters_chain>
if ( rc != RC_OK )
10de4c: 4603 mov r3, r0
10de4e: 2800 cmp r0, #0
10de50: d035 beq.n 10debe <fat_file_extend+0x146> <== NEVER TAKEN
fat_free_fat_clusters_chain(fs_info, chain);
10de52: 9902 ldr r1, [sp, #8] <== NOT EXECUTED
10de54: 4638 mov r0, r7 <== NOT EXECUTED
return rc;
10de56: 4699 mov r9, r3 <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, chain);
10de58: f7ff fc12 bl 10d680 <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
10de5c: e004 b.n 10de68 <fat_file_extend+0xf0> <== NOT EXECUTED
if (zero_fill && bytes_remain > 0) {
10de5e: f1b8 0f00 cmp.w r8, #0
10de62: d112 bne.n 10de8a <fat_file_extend+0x112>
return RC_OK;
10de64: f04f 0900 mov.w r9, #0
}
10de68: 4648 mov r0, r9
10de6a: b007 add sp, #28
10de6c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10de70: 6a4a ldr r2, [r1, #36] ; 0x24
10de72: 2a00 cmp r2, #0
10de74: d192 bne.n 10dd9c <fat_file_extend+0x24> <== ALWAYS TAKEN
10de76: 7d82 ldrb r2, [r0, #22]
10de78: 0791 lsls r1, r2, #30
10de7a: d08f beq.n 10dd9c <fat_file_extend+0x24> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(ENOSPC);
10de7c: f006 ff00 bl 114c80 <__errno>
10de80: 231c movs r3, #28
10de82: f04f 39ff mov.w r9, #4294967295 ; 0xffffffff
10de86: 6003 str r3, [r0, #0]
10de88: e7ee b.n 10de68 <fat_file_extend+0xf0>
bytes2add = 0;
10de8a: f04f 0a00 mov.w sl, #0
uint32_t cl_start = start >> fs_info->vol.bpc_log2;
10de8e: 7b3a ldrb r2, [r7, #12]
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
10de90: 4629 mov r1, r5
10de92: 4638 mov r0, r7
10de94: fa23 f202 lsr.w r2, r3, r2
10de98: ab05 add r3, sp, #20
10de9a: f7ff fcd3 bl 10d844 <fat_file_lseek>
if (rc != RC_OK)
10de9e: 4681 mov r9, r0
10dea0: 2800 cmp r0, #0
10dea2: d1e1 bne.n 10de68 <fat_file_extend+0xf0> <== ALWAYS TAKEN
bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0);
10dea4: 9000 str r0, [sp, #0]
10dea6: 465a mov r2, fp
10dea8: 9905 ldr r1, [sp, #20]
10deaa: 4633 mov r3, r6
10deac: 4638 mov r0, r7
10deae: f7fe fe77 bl 10cba0 <fat_cluster_set>
if (bytes_remain != bytes_written)
10deb2: 42b0 cmp r0, r6
return -1;
10deb4: bf18 it ne
10deb6: f04f 39ff movne.w r9, #4294967295 ; 0xffffffff
if (bytes_remain != bytes_written)
10deba: d1d5 bne.n 10de68 <fat_file_extend+0xf0> <== ALWAYS TAKEN
10debc: e782 b.n 10ddc4 <fat_file_extend+0x4c>
*a_length = new_length;
10debe: 9b10 ldr r3, [sp, #64] ; 0x40
}
10dec0: 4648 mov r0, r9
*a_length = new_length;
10dec2: 601c str r4, [r3, #0]
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
10dec4: f895 3030 ldrb.w r3, [r5, #48] ; 0x30
fat_fd->fat_file_size = s;
10dec8: 61ac str r4, [r5, #24]
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
10deca: f043 0302 orr.w r3, r3, #2
10dece: f885 3030 strb.w r3, [r5, #48] ; 0x30
}
10ded2: b007 add sp, #28
10ded4: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
fat_fd->map.file_cln = 0;
10ded8: 636b str r3, [r5, #52] ; 0x34
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
10deda: f895 3030 ldrb.w r3, [r5, #48] ; 0x30
10dede: f043 0302 orr.w r3, r3, #2
10dee2: f885 3030 strb.w r3, [r5, #48] ; 0x30
fat_fd->map.disk_cln = chain;
10dee6: 9b02 ldr r3, [sp, #8]
10dee8: 63ab str r3, [r5, #56] ; 0x38
fat_fd->cln = cln;
10deea: 61eb str r3, [r5, #28]
}
10deec: e7a5 b.n 10de3a <fat_file_extend+0xc2>
rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM,
10deee: aa03 add r2, sp, #12 <== NOT EXECUTED
10def0: 3b01 subs r3, #1 <== NOT EXECUTED
10def2: 4629 mov r1, r5 <== NOT EXECUTED
10def4: 9200 str r2, [sp, #0] <== NOT EXECUTED
10def6: 4638 mov r0, r7 <== NOT EXECUTED
10def8: 2201 movs r2, #1 <== NOT EXECUTED
10defa: f7ff fefd bl 10dcf8 <fat_file_ioctl> <== NOT EXECUTED
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
10defe: 9903 ldr r1, [sp, #12] <== NOT EXECUTED
if ( rc != RC_OK )
10df00: 4603 mov r3, r0 <== NOT EXECUTED
10df02: 2800 cmp r0, #0 <== NOT EXECUTED
10df04: d090 beq.n 10de28 <fat_file_extend+0xb0> <== NOT EXECUTED
10df06: e7a4 b.n 10de52 <fat_file_extend+0xda> <== NOT EXECUTED
0010dcf8 <fat_file_ioctl>:
{
10dcf8: b40c push {r2, r3}
10dcfa: b530 push {r4, r5, lr}
10dcfc: b083 sub sp, #12
10dcfe: ab06 add r3, sp, #24
uint32_t cur_cln = 0;
10dd00: 2400 movs r4, #0
{
10dd02: f853 2b04 ldr.w r2, [r3], #4
switch (cmd)
10dd06: 2a01 cmp r2, #1
va_start(ap, cmd);
10dd08: e9cd 4300 strd r4, r3, [sp]
switch (cmd)
10dd0c: d118 bne.n 10dd40 <fat_file_ioctl+0x48> <== ALWAYS TAKEN
ret = va_arg(ap, uint32_t *);
10dd0e: ac09 add r4, sp, #36 ; 0x24
pos = va_arg(ap, uint32_t);
10dd10: 9a07 ldr r2, [sp, #28]
ret = va_arg(ap, uint32_t *);
10dd12: 9401 str r4, [sp, #4]
if ( pos >= fat_fd->fat_file_size ) {
10dd14: 698c ldr r4, [r1, #24]
ret = va_arg(ap, uint32_t *);
10dd16: 685d ldr r5, [r3, #4]
if ( pos >= fat_fd->fat_file_size ) {
10dd18: 4294 cmp r4, r2
10dd1a: d924 bls.n 10dd66 <fat_file_ioctl+0x6e> <== ALWAYS TAKEN
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10dd1c: 6a0b ldr r3, [r1, #32]
10dd1e: 2b01 cmp r3, #1
10dd20: d101 bne.n 10dd26 <fat_file_ioctl+0x2e>
10dd22: 6a4b ldr r3, [r1, #36] ; 0x24
10dd24: b1c3 cbz r3, 10dd58 <fat_file_ioctl+0x60>
cl_start = pos >> fs_info->vol.bpc_log2;
10dd26: 7b03 ldrb r3, [r0, #12]
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
10dd28: 40da lsrs r2, r3
10dd2a: 466b mov r3, sp
10dd2c: f7ff fd8a bl 10d844 <fat_file_lseek>
if ( rc != RC_OK )
10dd30: b908 cbnz r0, 10dd36 <fat_file_ioctl+0x3e>
*ret = cur_cln;
10dd32: 9b00 ldr r3, [sp, #0]
10dd34: 602b str r3, [r5, #0]
}
10dd36: b003 add sp, #12
10dd38: e8bd 4030 ldmia.w sp!, {r4, r5, lr}
10dd3c: b002 add sp, #8
10dd3e: 4770 bx lr
errno = EINVAL;
10dd40: f006 ff9e bl 114c80 <__errno> <== NOT EXECUTED
10dd44: 2216 movs r2, #22 <== NOT EXECUTED
10dd46: 4603 mov r3, r0 <== NOT EXECUTED
10dd48: 601a str r2, [r3, #0] <== NOT EXECUTED
rc = -1;
10dd4a: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
10dd4e: b003 add sp, #12 <== NOT EXECUTED
10dd50: e8bd 4030 ldmia.w sp!, {r4, r5, lr} <== NOT EXECUTED
10dd54: b002 add sp, #8 <== NOT EXECUTED
10dd56: 4770 bx lr <== NOT EXECUTED
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10dd58: 7d84 ldrb r4, [r0, #22]
10dd5a: 07a4 lsls r4, r4, #30
rc = RC_OK;
10dd5c: bf1c itt ne
10dd5e: 4618 movne r0, r3
*ret = 0;
10dd60: 602b strne r3, [r5, #0]
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10dd62: d1e8 bne.n 10dd36 <fat_file_ioctl+0x3e>
10dd64: e7df b.n 10dd26 <fat_file_ioctl+0x2e>
rtems_set_errno_and_return_minus_one( EIO );
10dd66: f006 ff8b bl 114c80 <__errno> <== NOT EXECUTED
10dd6a: 2205 movs r2, #5 <== NOT EXECUTED
10dd6c: 4603 mov r3, r0 <== NOT EXECUTED
10dd6e: 601a str r2, [r3, #0] <== NOT EXECUTED
10dd70: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10dd74: e7df b.n 10dd36 <fat_file_ioctl+0x3e> <== NOT EXECUTED
10dd76: bf00 nop
0010d8b4 <fat_file_open>:
{
10d8b4: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
10d8b8: 468a mov sl, r1
10d8ba: e9d1 5600 ldrd r5, r6, [r1]
10d8be: 4604 mov r4, r0
10d8c0: 4691 mov r9, r2
if (cln == 1)
10d8c2: 2d01 cmp r5, #1
10d8c4: d009 beq.n 10d8da <fat_file_open+0x26>
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d8c6: 2d00 cmp r5, #0
10d8c8: f000 8095 beq.w 10d9f6 <fat_file_open+0x142>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d8cc: 7962 ldrb r2, [r4, #5]
10d8ce: 3d02 subs r5, #2
10d8d0: 4095 lsls r5, r2
10d8d2: 6be2 ldr r2, [r4, #60] ; 0x3c
10d8d4: 4415 add r5, r2
fs_info->vol.sec_mul);
10d8d6: 78e2 ldrb r2, [r4, #3]
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
10d8d8: 4095 lsls r5, r2
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
10d8da: eb05 2556 add.w r5, r5, r6, lsr #9
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
10d8de: f3c6 1643 ubfx r6, r6, #5, #4
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
10d8e2: f8d4 7080 ldr.w r7, [r4, #128] ; 0x80
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
10d8e6: eb06 1505 add.w r5, r6, r5, lsl #4
uint32_t mod = (key1) % FAT_HASH_MODULE;
10d8ea: f006 0601 and.w r6, r6, #1
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
10d8ee: eb06 0646 add.w r6, r6, r6, lsl #1
10d8f2: 00b6 lsls r6, r6, #2
return _Chain_Immutable_head( the_chain )->next;
10d8f4: 59ba ldr r2, [r7, r6]
10d8f6: 4437 add r7, r6
return &the_chain->Tail.Node;
10d8f8: f107 0804 add.w r8, r7, #4
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
10d8fc: 4542 cmp r2, r8
10d8fe: d01e beq.n 10d93e <fat_file_open+0x8a>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d900: e9d2 3008 ldrd r3, r0, [r2, #32]
if (cln == 1)
10d904: 2b01 cmp r3, #1
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d906: f1a3 0102 sub.w r1, r3, #2
if (cln == 1)
10d90a: d00d beq.n 10d928 <fat_file_open+0x74>
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d90c: b923 cbnz r3, 10d918 <fat_file_open+0x64>
10d90e: 7da3 ldrb r3, [r4, #22]
10d910: 079b lsls r3, r3, #30
return fs_info->vol.rdir_loc;
10d912: bf18 it ne
10d914: 6aa3 ldrne r3, [r4, #40] ; 0x28
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d916: d105 bne.n 10d924 <fat_file_open+0x70> <== NEVER TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d918: f894 c005 ldrb.w ip, [r4, #5]
10d91c: 6be3 ldr r3, [r4, #60] ; 0x3c
10d91e: fa01 f10c lsl.w r1, r1, ip
10d922: 440b add r3, r1
fs_info->vol.sec_mul);
10d924: 78e1 ldrb r1, [r4, #3]
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
10d926: 408b lsls r3, r1
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
10d928: eb03 2350 add.w r3, r3, r0, lsr #9
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
10d92c: f3c0 1143 ubfx r1, r0, #5, #4
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
10d930: eb01 1303 add.w r3, r1, r3, lsl #4
if ( (key1) == ck)
10d934: 429d cmp r5, r3
10d936: d056 beq.n 10d9e6 <fat_file_open+0x132>
the_node = the_node->next;
10d938: 6812 ldr r2, [r2, #0]
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
10d93a: 4542 cmp r2, r8
10d93c: d1e0 bne.n 10d900 <fat_file_open+0x4c>
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
10d93e: f8d4 1084 ldr.w r1, [r4, #132] ; 0x84
return _Chain_Immutable_head( the_chain )->next;
10d942: 598a ldr r2, [r1, r6]
10d944: 4431 add r1, r6
return &the_chain->Tail.Node;
10d946: 3104 adds r1, #4
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
10d948: 428a cmp r2, r1
10d94a: d103 bne.n 10d954 <fat_file_open+0xa0> <== ALWAYS TAKEN
10d94c: e05a b.n 10da04 <fat_file_open+0x150>
the_node = the_node->next;
10d94e: 6812 ldr r2, [r2, #0] <== NOT EXECUTED
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
10d950: 428a cmp r2, r1 <== NOT EXECUTED
10d952: d057 beq.n 10da04 <fat_file_open+0x150> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d954: e9d2 3c08 ldrd r3, ip, [r2, #32] <== NOT EXECUTED
if (cln == 1)
10d958: 2b01 cmp r3, #1 <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d95a: f1a3 0002 sub.w r0, r3, #2 <== NOT EXECUTED
if (cln == 1)
10d95e: d00d beq.n 10d97c <fat_file_open+0xc8> <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d960: b923 cbnz r3, 10d96c <fat_file_open+0xb8> <== NOT EXECUTED
10d962: 7da3 ldrb r3, [r4, #22] <== NOT EXECUTED
10d964: 079b lsls r3, r3, #30 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
10d966: bf18 it ne <== NOT EXECUTED
10d968: 6aa3 ldrne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d96a: d105 bne.n 10d978 <fat_file_open+0xc4> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10d96c: f894 e005 ldrb.w lr, [r4, #5] <== NOT EXECUTED
10d970: 6be3 ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
10d972: fa00 f00e lsl.w r0, r0, lr <== NOT EXECUTED
10d976: 4403 add r3, r0 <== NOT EXECUTED
fs_info->vol.sec_mul);
10d978: 78e0 ldrb r0, [r4, #3] <== NOT EXECUTED
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
10d97a: 4083 lsls r3, r0 <== NOT EXECUTED
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
10d97c: eb03 235c add.w r3, r3, ip, lsr #9 <== NOT EXECUTED
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
10d980: f3cc 1043 ubfx r0, ip, #5, #4 <== NOT EXECUTED
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
10d984: eb00 1303 add.w r3, r0, r3, lsl #4 <== NOT EXECUTED
if ( (key1) == ck)
10d988: 429d cmp r5, r3 <== NOT EXECUTED
10d98a: d1e0 bne.n 10d94e <fat_file_open+0x9a> <== NOT EXECUTED
if ( ((key2) == 0) || ((key2) == ffd->ino) )
10d98c: b115 cbz r5, 10d994 <fat_file_open+0xe0> <== NOT EXECUTED
10d98e: 68d3 ldr r3, [r2, #12] <== NOT EXECUTED
10d990: 429d cmp r5, r3 <== NOT EXECUTED
10d992: d1dc bne.n 10d94e <fat_file_open+0x9a> <== NOT EXECUTED
lfat_fd = (*fat_fd) = (fat_file_fd_t*)calloc(1, sizeof(fat_file_fd_t));
10d994: 2150 movs r1, #80 ; 0x50 <== NOT EXECUTED
10d996: 2001 movs r0, #1 <== NOT EXECUTED
10d998: f7fe fba8 bl 10c0ec <calloc> <== NOT EXECUTED
10d99c: 4683 mov fp, r0 <== NOT EXECUTED
10d99e: f8c9 0000 str.w r0, [r9] <== NOT EXECUTED
if ( lfat_fd == NULL )
10d9a2: 2800 cmp r0, #0 <== NOT EXECUTED
10d9a4: d05b beq.n 10da5e <fat_file_open+0x1aa> <== NOT EXECUTED
lfat_fd->flags &= ~FAT_FILE_REMOVED;
10d9a6: f89b 3030 ldrb.w r3, [fp, #48] ; 0x30 <== NOT EXECUTED
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
10d9aa: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
lfat_fd->dir_pos = *dir_pos;
10d9ae: f10b 0720 add.w r7, fp, #32 <== NOT EXECUTED
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
10d9b2: f8cb 503c str.w r5, [fp, #60] ; 0x3c <== NOT EXECUTED
lfat_fd->flags &= ~FAT_FILE_REMOVED;
10d9b6: f023 0301 bic.w r3, r3, #1 <== NOT EXECUTED
10d9ba: f88b 3030 strb.w r3, [fp, #48] ; 0x30 <== NOT EXECUTED
lfat_fd->links_num = 1;
10d9be: 2301 movs r3, #1 <== NOT EXECUTED
10d9c0: f8cb 3008 str.w r3, [fp, #8] <== NOT EXECUTED
lfat_fd->dir_pos = *dir_pos;
10d9c4: e89a 000f ldmia.w sl, {r0, r1, r2, r3} <== NOT EXECUTED
10d9c8: e887 000f stmia.w r7, {r0, r1, r2, r3} <== NOT EXECUTED
lfat_fd->ino = fat_get_unique_ino(fs_info);
10d9cc: 4620 mov r0, r4 <== NOT EXECUTED
10d9ce: f7ff fcc3 bl 10d358 <fat_get_unique_ino> <== NOT EXECUTED
10d9d2: f8cb 000c str.w r0, [fp, #12] <== NOT EXECUTED
if ( lfat_fd->ino == 0 )
10d9d6: 2800 cmp r0, #0 <== NOT EXECUTED
10d9d8: d03d beq.n 10da56 <fat_file_open+0x1a2> <== NOT EXECUTED
rtems_chain_append_unprotected((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link);
10d9da: f8d4 7080 ldr.w r7, [r4, #128] ; 0x80 <== NOT EXECUTED
10d9de: 4437 add r7, r6 <== NOT EXECUTED
return &the_chain->Tail.Node;
10d9e0: f107 0804 add.w r8, r7, #4 <== NOT EXECUTED
10d9e4: e02b b.n 10da3e <fat_file_open+0x18a> <== NOT EXECUTED
lfat_fd->links_num++;
10d9e6: 6893 ldr r3, [r2, #8]
return rc;
10d9e8: 2000 movs r0, #0
(*fat_fd) = lfat_fd;
10d9ea: f8c9 2000 str.w r2, [r9]
lfat_fd->links_num++;
10d9ee: 3301 adds r3, #1
10d9f0: 6093 str r3, [r2, #8]
}
10d9f2: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d9f6: 7d82 ldrb r2, [r0, #22]
10d9f8: 0792 lsls r2, r2, #30
return fs_info->vol.rdir_loc;
10d9fa: bf18 it ne
10d9fc: 6a85 ldrne r5, [r0, #40] ; 0x28
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10d9fe: f47f af6a bne.w 10d8d6 <fat_file_open+0x22> <== NEVER TAKEN
10da02: e763 b.n 10d8cc <fat_file_open+0x18> <== NOT EXECUTED
lfat_fd = (*fat_fd) = (fat_file_fd_t*)calloc(1, sizeof(fat_file_fd_t));
10da04: 2150 movs r1, #80 ; 0x50
10da06: 2001 movs r0, #1
10da08: f7fe fb70 bl 10c0ec <calloc>
10da0c: 4683 mov fp, r0
10da0e: f8c9 0000 str.w r0, [r9]
if ( lfat_fd == NULL )
10da12: b320 cbz r0, 10da5e <fat_file_open+0x1aa>
lfat_fd->flags &= ~FAT_FILE_REMOVED;
10da14: f89b 3030 ldrb.w r3, [fp, #48] ; 0x30
lfat_fd->dir_pos = *dir_pos;
10da18: f10b 0420 add.w r4, fp, #32
lfat_fd->flags &= ~FAT_FILE_REMOVED;
10da1c: f023 0301 bic.w r3, r3, #1
10da20: f88b 3030 strb.w r3, [fp, #48] ; 0x30
lfat_fd->links_num = 1;
10da24: 2301 movs r3, #1
10da26: f8cb 3008 str.w r3, [fp, #8]
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
10da2a: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
10da2e: f8cb 303c str.w r3, [fp, #60] ; 0x3c
lfat_fd->dir_pos = *dir_pos;
10da32: e89a 000f ldmia.w sl, {r0, r1, r2, r3}
10da36: e884 000f stmia.w r4, {r0, r1, r2, r3}
lfat_fd->ino = key;
10da3a: f8cb 500c str.w r5, [fp, #12]
return RC_OK;
10da3e: 2000 movs r0, #0
old_last = tail->previous;
10da40: 68bb ldr r3, [r7, #8]
the_node->next = tail;
10da42: f8cb 8000 str.w r8, [fp]
tail->previous = the_node;
10da46: f8c7 b008 str.w fp, [r7, #8]
old_last->next = the_node;
10da4a: f8c3 b000 str.w fp, [r3]
the_node->previous = old_last;
10da4e: f8cb 3004 str.w r3, [fp, #4]
}
10da52: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
free((*fat_fd));
10da56: f8d9 0000 ldr.w r0, [r9] <== NOT EXECUTED
10da5a: f7f7 fdc3 bl 1055e4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10da5e: f007 f90f bl 114c80 <__errno> <== NOT EXECUTED
10da62: 220c movs r2, #12 <== NOT EXECUTED
10da64: 4603 mov r3, r0 <== NOT EXECUTED
10da66: 601a str r2, [r3, #0] <== NOT EXECUTED
10da68: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10da6c: e7c1 b.n 10d9f2 <fat_file_open+0x13e> <== NOT EXECUTED
10da6e: bf00 nop
0010dacc <fat_file_read>:
{
10dacc: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10dad0: 4604 mov r4, r0
10dad2: b085 sub sp, #20
uint32_t cur_cln = 0;
10dad4: 2000 movs r0, #0
if (count == 0)
10dad6: 461d mov r5, r3
{
10dad8: f8dd 8038 ldr.w r8, [sp, #56] ; 0x38
uint32_t cur_cln = 0;
10dadc: 9003 str r0, [sp, #12]
if (count == 0)
10dade: 2b00 cmp r3, #0
10dae0: d05f beq.n 10dba2 <fat_file_read+0xd6> <== ALWAYS TAKEN
if ( start >= fat_fd->fat_file_size )
10dae2: 698b ldr r3, [r1, #24]
10dae4: 460f mov r7, r1
10dae6: 4691 mov r9, r2
10dae8: 4293 cmp r3, r2
10daea: d954 bls.n 10db96 <fat_file_read+0xca>
if ((count > fat_fd->fat_file_size) ||
10daec: 42ab cmp r3, r5
10daee: d355 bcc.n 10db9c <fat_file_read+0xd0>
(start > fat_fd->fat_file_size - count))
10daf0: 1b5a subs r2, r3, r5
if ((count > fat_fd->fat_file_size) ||
10daf2: 454a cmp r2, r9
10daf4: d352 bcc.n 10db9c <fat_file_read+0xd0>
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10daf6: 6a3b ldr r3, [r7, #32]
10daf8: 2b01 cmp r3, #1
10dafa: d102 bne.n 10db02 <fat_file_read+0x36>
10dafc: 6a7b ldr r3, [r7, #36] ; 0x24
10dafe: 2b00 cmp r3, #0
10db00: d053 beq.n 10dbaa <fat_file_read+0xde> <== NEVER TAKEN
cl_start = start >> fs_info->vol.bpc_log2;
10db02: f894 a00c ldrb.w sl, [r4, #12]
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
10db06: ab03 add r3, sp, #12
10db08: 4639 mov r1, r7
10db0a: 4620 mov r0, r4
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
10db0c: 68a6 ldr r6, [r4, #8]
cl_start = start >> fs_info->vol.bpc_log2;
10db0e: fa29 fa0a lsr.w sl, r9, sl
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
10db12: 4652 mov r2, sl
10db14: f7ff fe96 bl 10d844 <fat_file_lseek>
if (rc != RC_OK)
10db18: 2800 cmp r0, #0
10db1a: d13c bne.n 10db96 <fat_file_read+0xca> <== ALWAYS TAKEN
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
10db1c: 3e01 subs r6, #1
10db1e: ea06 0909 and.w r9, r6, r9
uint32_t cmpltd = 0;
10db22: 4606 mov r6, r0
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
10db24: 4648 mov r0, r9
c = MIN(count, (fs_info->vol.bpc - ofs));
10db26: 68a3 ldr r3, [r4, #8]
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
10db28: 9a03 ldr r2, [sp, #12]
c = MIN(count, (fs_info->vol.bpc - ofs));
10db2a: 1a1b subs r3, r3, r0
10db2c: 42ab cmp r3, r5
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10db2e: f1a2 0102 sub.w r1, r2, #2
10db32: bf28 it cs
10db34: 462b movcs r3, r5
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10db36: b922 cbnz r2, 10db42 <fat_file_read+0x76>
10db38: 7da2 ldrb r2, [r4, #22] <== NOT EXECUTED
10db3a: 0792 lsls r2, r2, #30 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
10db3c: bf18 it ne <== NOT EXECUTED
10db3e: 6aa1 ldrne r1, [r4, #40] ; 0x28 <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10db40: d103 bne.n 10db4a <fat_file_read+0x7e> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10db42: 7962 ldrb r2, [r4, #5]
10db44: 4091 lsls r1, r2
10db46: 6be2 ldr r2, [r4, #60] ; 0x3c
10db48: 4411 add r1, r2
sec += (ofs >> fs_info->vol.sec_log2);
10db4a: f894 c002 ldrb.w ip, [r4, #2]
count -= c;
10db4e: 1aed subs r5, r5, r3
byte = ofs & (fs_info->vol.bps - 1);
10db50: 8822 ldrh r2, [r4, #0]
sec += (ofs >> fs_info->vol.sec_log2);
10db52: fa20 fc0c lsr.w ip, r0, ip
byte = ofs & (fs_info->vol.bps - 1);
10db56: 3a01 subs r2, #1
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
10db58: 4002 ands r2, r0
10db5a: eb08 0006 add.w r0, r8, r6
10db5e: 4461 add r1, ip
10db60: 9000 str r0, [sp, #0]
10db62: 4620 mov r0, r4
cmpltd += c;
10db64: 441e add r6, r3
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
10db66: f7fe ff8f bl 10ca88 <_fat_block_read>
if ( ret < 0 )
10db6a: 2800 cmp r0, #0
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
10db6c: aa03 add r2, sp, #12
if ( ret < 0 )
10db6e: db37 blt.n 10dbe0 <fat_file_read+0x114> <== ALWAYS TAKEN
save_cln = cur_cln;
10db70: f8dd b00c ldr.w fp, [sp, #12]
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
10db74: 4620 mov r0, r4
10db76: 4659 mov r1, fp
10db78: f7ff fc54 bl 10d424 <fat_get_fat_cluster>
if ( rc != RC_OK )
10db7c: b958 cbnz r0, 10db96 <fat_file_read+0xca>
while (count > 0)
10db7e: 2d00 cmp r5, #0
10db80: d1d1 bne.n 10db26 <fat_file_read+0x5a>
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
10db82: 7b22 ldrb r2, [r4, #12]
10db84: f109 33ff add.w r3, r9, #4294967295 ; 0xffffffff
10db88: 4433 add r3, r6
return cmpltd;
10db8a: 4630 mov r0, r6
fat_fd->map.disk_cln = save_cln;
10db8c: f8c7 b038 str.w fp, [r7, #56] ; 0x38
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
10db90: 40d3 lsrs r3, r2
fat_fd->map.file_cln = cl_start +
10db92: 4453 add r3, sl
10db94: 637b str r3, [r7, #52] ; 0x34
}
10db96: b005 add sp, #20
10db98: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
count = fat_fd->fat_file_size - start;
10db9c: eba3 0509 sub.w r5, r3, r9
10dba0: e7a9 b.n 10daf6 <fat_file_read+0x2a>
return cmpltd;
10dba2: 4618 mov r0, r3 <== NOT EXECUTED
}
10dba4: b005 add sp, #20 <== NOT EXECUTED
10dba6: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10dbaa: 7da3 ldrb r3, [r4, #22]
10dbac: 0799 lsls r1, r3, #30
10dbae: d0a8 beq.n 10db02 <fat_file_read+0x36>
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln);
10dbb0: 69fa ldr r2, [r7, #28]
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10dbb2: b1c2 cbz r2, 10dbe6 <fat_file_read+0x11a>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10dbb4: 7963 ldrb r3, [r4, #5] <== NOT EXECUTED
10dbb6: 3a02 subs r2, #2 <== NOT EXECUTED
10dbb8: 409a lsls r2, r3 <== NOT EXECUTED
10dbba: 6be3 ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
10dbbc: 441a add r2, r3 <== NOT EXECUTED
ret = _fat_block_read(fs_info, sec, byte, count, buf);
10dbbe: f8cd 8000 str.w r8, [sp]
10dbc2: 462b mov r3, r5
sec += (start >> fs_info->vol.sec_log2);
10dbc4: 78a1 ldrb r1, [r4, #2]
ret = _fat_block_read(fs_info, sec, byte, count, buf);
10dbc6: 4620 mov r0, r4
sec += (start >> fs_info->vol.sec_log2);
10dbc8: fa29 f101 lsr.w r1, r9, r1
ret = _fat_block_read(fs_info, sec, byte, count, buf);
10dbcc: 4411 add r1, r2
byte = start & (fs_info->vol.bps - 1);
10dbce: 8822 ldrh r2, [r4, #0]
10dbd0: 3a01 subs r2, #1
ret = _fat_block_read(fs_info, sec, byte, count, buf);
10dbd2: ea02 0209 and.w r2, r2, r9
10dbd6: f7fe ff57 bl 10ca88 <_fat_block_read>
if ( ret < 0 )
10dbda: ea40 70e0 orr.w r0, r0, r0, asr #31
10dbde: e7da b.n 10db96 <fat_file_read+0xca>
return -1;
10dbe0: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10dbe4: e7d7 b.n 10db96 <fat_file_read+0xca> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
10dbe6: 6aa2 ldr r2, [r4, #40] ; 0x28
10dbe8: e7e9 b.n 10dbbe <fat_file_read+0xf2>
10dbea: bf00 nop
0010e088 <fat_file_size>:
{
10e088: b5f0 push {r4, r5, r6, r7, lr}
10e08a: b083 sub sp, #12
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10e08c: e9d1 6307 ldrd r6, r3, [r1, #28]
{
10e090: 460d mov r5, r1
10e092: 4604 mov r4, r0
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10e094: 2b01 cmp r3, #1
uint32_t cur_cln = fat_fd->cln;
10e096: 9601 str r6, [sp, #4]
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10e098: d020 beq.n 10e0dc <fat_file_size+0x54>
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10e09a: e9d4 3106 ldrd r3, r1, [r4, #24]
fat_fd->fat_file_size = 0;
10e09e: 2200 movs r2, #0
10e0a0: 61aa str r2, [r5, #24]
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10e0a2: 4033 ands r3, r6
10e0a4: 4299 cmp r1, r3
10e0a6: d80b bhi.n 10e0c0 <fat_file_size+0x38> <== NEVER TAKEN
10e0a8: e013 b.n 10e0d2 <fat_file_size+0x4a> <== NOT EXECUTED
10e0aa: e9d4 3006 ldrd r3, r0, [r4, #24]
10e0ae: 9901 ldr r1, [sp, #4]
fat_fd->fat_file_size += fs_info->vol.bpc;
10e0b0: 69aa ldr r2, [r5, #24]
10e0b2: 68a7 ldr r7, [r4, #8]
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10e0b4: 400b ands r3, r1
10e0b6: 4283 cmp r3, r0
fat_fd->fat_file_size += fs_info->vol.bpc;
10e0b8: 443a add r2, r7
10e0ba: 61aa str r2, [r5, #24]
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10e0bc: d20a bcs.n 10e0d4 <fat_file_size+0x4c>
10e0be: 460e mov r6, r1
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
10e0c0: 4631 mov r1, r6
10e0c2: aa01 add r2, sp, #4
10e0c4: 4620 mov r0, r4
10e0c6: f7ff f9ad bl 10d424 <fat_get_fat_cluster>
if ( rc != RC_OK )
10e0ca: 2800 cmp r0, #0
10e0cc: d0ed beq.n 10e0aa <fat_file_size+0x22> <== NEVER TAKEN
}
10e0ce: b003 add sp, #12
10e0d0: bdf0 pop {r4, r5, r6, r7, pc}
uint32_t save_cln = 0;
10e0d2: 4616 mov r6, r2 <== NOT EXECUTED
return rc;
10e0d4: 2000 movs r0, #0
fat_fd->map.last_cln = save_cln;
10e0d6: 63ee str r6, [r5, #60] ; 0x3c
}
10e0d8: b003 add sp, #12
10e0da: bdf0 pop {r4, r5, r6, r7, pc}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
10e0dc: 6a48 ldr r0, [r1, #36] ; 0x24
10e0de: 2800 cmp r0, #0
10e0e0: d1db bne.n 10e09a <fat_file_size+0x12> <== ALWAYS TAKEN
10e0e2: 7da3 ldrb r3, [r4, #22]
10e0e4: 079b lsls r3, r3, #30
10e0e6: d0d8 beq.n 10e09a <fat_file_size+0x12>
fat_fd->fat_file_size = fs_info->vol.rdir_size;
10e0e8: 6b63 ldr r3, [r4, #52] ; 0x34
10e0ea: 618b str r3, [r1, #24]
return rc;
10e0ec: e7ef b.n 10e0ce <fat_file_size+0x46>
10e0ee: bf00 nop
0010dbec <fat_file_truncate>:
if ( new_length >= fat_fd->fat_file_size )
10dbec: 698b ldr r3, [r1, #24]
{
10dbee: b570 push {r4, r5, r6, lr}
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
10dbf0: 2500 movs r5, #0
{
10dbf2: b082 sub sp, #8
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
10dbf4: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff
if ( new_length >= fat_fd->fat_file_size )
10dbf8: 4293 cmp r3, r2
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
10dbfa: e9cd 5400 strd r5, r4, [sp]
if ( new_length >= fat_fd->fat_file_size )
10dbfe: d91e bls.n 10dc3e <fat_file_truncate+0x52>
assert(fat_fd->fat_file_size);
10dc00: b373 cbz r3, 10dc60 <fat_file_truncate+0x74>
cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2;
10dc02: 6884 ldr r4, [r0, #8]
10dc04: 4605 mov r5, r0
10dc06: 4414 add r4, r2
10dc08: 7b02 ldrb r2, [r0, #12]
10dc0a: 3c01 subs r4, #1
10dc0c: 40d4 lsrs r4, r2
if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size)
10dc0e: fa04 f202 lsl.w r2, r4, r2
10dc12: 4293 cmp r3, r2
10dc14: d913 bls.n 10dc3e <fat_file_truncate+0x52>
if (cl_start != 0)
10dc16: 460e mov r6, r1
10dc18: b124 cbz r4, 10dc24 <fat_file_truncate+0x38>
rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln);
10dc1a: ab01 add r3, sp, #4
10dc1c: 1e62 subs r2, r4, #1
10dc1e: f7ff fe11 bl 10d844 <fat_file_lseek>
if (rc != RC_OK)
10dc22: b968 cbnz r0, 10dc40 <fat_file_truncate+0x54>
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
10dc24: 466b mov r3, sp
10dc26: 4622 mov r2, r4
10dc28: 4631 mov r1, r6
10dc2a: 4628 mov r0, r5
10dc2c: f7ff fe0a bl 10d844 <fat_file_lseek>
if (rc != RC_OK)
10dc30: b930 cbnz r0, 10dc40 <fat_file_truncate+0x54>
rc = fat_free_fat_clusters_chain(fs_info, cur_cln);
10dc32: 9900 ldr r1, [sp, #0]
10dc34: 4628 mov r0, r5
10dc36: f7ff fd23 bl 10d680 <fat_free_fat_clusters_chain>
if (rc != RC_OK)
10dc3a: b908 cbnz r0, 10dc40 <fat_file_truncate+0x54>
if (cl_start != 0)
10dc3c: b914 cbnz r4, 10dc44 <fat_file_truncate+0x58>
return rc;
10dc3e: 2000 movs r0, #0
}
10dc40: b002 add sp, #8
10dc42: bd70 pop {r4, r5, r6, pc}
rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC);
10dc44: 9901 ldr r1, [sp, #4]
10dc46: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff
10dc4a: 4628 mov r0, r5
10dc4c: f7ff fc60 bl 10d510 <fat_set_fat_cluster>
if ( rc != RC_OK )
10dc50: 2800 cmp r0, #0
10dc52: d1f5 bne.n 10dc40 <fat_file_truncate+0x54> <== ALWAYS TAKEN
fat_fd->map.disk_cln = new_last_cln;
10dc54: 9b01 ldr r3, [sp, #4]
fat_fd->map.file_cln = cl_start - 1;
10dc56: 3c01 subs r4, #1
fat_fd->map.disk_cln = new_last_cln;
10dc58: e9c6 430d strd r4, r3, [r6, #52] ; 0x34
fat_fd->map.last_cln = new_last_cln;
10dc5c: 63f3 str r3, [r6, #60] ; 0x3c
10dc5e: e7ef b.n 10dc40 <fat_file_truncate+0x54>
assert(fat_fd->fat_file_size);
10dc60: f64c 0398 movw r3, #51352 ; 0xc898 <== NOT EXECUTED
10dc64: f64c 02dc movw r2, #51420 ; 0xc8dc <== NOT EXECUTED
10dc68: f64c 00b0 movw r0, #51376 ; 0xc8b0 <== NOT EXECUTED
10dc6c: f2c0 0311 movt r3, #17 <== NOT EXECUTED
10dc70: f2c0 0211 movt r2, #17 <== NOT EXECUTED
10dc74: f44f 7139 mov.w r1, #740 ; 0x2e4 <== NOT EXECUTED
10dc78: f2c0 0011 movt r0, #17 <== NOT EXECUTED
10dc7c: f004 fbf0 bl 112460 <__assert_func> <== NOT EXECUTED
0010df08 <fat_file_write>:
{
10df08: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
10df0c: 4615 mov r5, r2
10df0e: b084 sub sp, #16
uint32_t c = 0;
10df10: 2200 movs r2, #0
10df12: 9202 str r2, [sp, #8]
if ( count == 0 )
10df14: 2b00 cmp r3, #0
10df16: d055 beq.n 10dfc4 <fat_file_write+0xbc> <== ALWAYS TAKEN
if (start >= fat_fd->size_limit)
10df18: 694c ldr r4, [r1, #20]
10df1a: 460f mov r7, r1
10df1c: 42ac cmp r4, r5
10df1e: f240 808d bls.w 10e03c <fat_file_write+0x134> <== ALWAYS TAKEN
bool zero_fill = start > fat_fd->fat_file_size;
10df22: 698a ldr r2, [r1, #24]
if (count > fat_fd->size_limit - start)
10df24: 1b64 subs r4, r4, r5
10df26: 429c cmp r4, r3
10df28: 4606 mov r6, r0
10df2a: bf28 it cs
10df2c: 461c movcs r4, r3
rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c);
10df2e: ab02 add r3, sp, #8
10df30: 42aa cmp r2, r5
10df32: eb05 0804 add.w r8, r5, r4
10df36: bf2c ite cs
10df38: 2200 movcs r2, #0
10df3a: 2201 movcc r2, #1
10df3c: 9300 str r3, [sp, #0]
10df3e: 4643 mov r3, r8
10df40: f7ff ff1a bl 10dd78 <fat_file_extend>
if (RC_OK == rc)
10df44: 2800 cmp r0, #0
10df46: d13a bne.n 10dfbe <fat_file_write+0xb6>
if (c != (start + count))
10df48: 9b02 ldr r3, [sp, #8]
10df4a: 4598 cmp r8, r3
cln += (start >> fs_info->vol.bpc_log2);
10df4c: f896 800c ldrb.w r8, [r6, #12]
count = c - start;
10df50: bf18 it ne
10df52: 1b5c subne r4, r3, r5
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
10df54: 6a3b ldr r3, [r7, #32]
10df56: 2b01 cmp r3, #1
cln += (start >> fs_info->vol.bpc_log2);
10df58: fa25 f908 lsr.w r9, r5, r8
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
10df5c: d047 beq.n 10dfee <fat_file_write+0xe6>
uint32_t cur_cln = 0;
10df5e: 2300 movs r3, #0
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
10df60: 464a mov r2, r9
uint32_t cur_cln = 0;
10df62: 9303 str r3, [sp, #12]
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
10df64: 4639 mov r1, r7
10df66: ab03 add r3, sp, #12
10df68: 4630 mov r0, r6
10df6a: f7ff fc6b bl 10d844 <fat_file_lseek>
if (RC_OK == rc)
10df6e: bb20 cbnz r0, 10dfba <fat_file_write+0xb2>
uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2);
10df70: fa09 f208 lsl.w r2, r9, r8
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
10df74: 4680 mov r8, r0
uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2);
10df76: 1aaa subs r2, r5, r2
uint32_t cmpltd = 0;
10df78: 4605 mov r5, r0
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10df7a: f102 3aff add.w sl, r2, #4294967295 ; 0xffffffff
while ( (RC_OK == rc)
10df7e: 2c00 cmp r4, #0
10df80: d055 beq.n 10e02e <fat_file_write+0x126> <== ALWAYS TAKEN
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
10df82: 68b3 ldr r3, [r6, #8]
ret = fat_cluster_write(fs_info,
10df84: 4630 mov r0, r6
&buf[cmpltd]);
10df86: 990c ldr r1, [sp, #48] ; 0x30
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
10df88: 1a9b subs r3, r3, r2
ret = fat_cluster_write(fs_info,
10df8a: 42a3 cmp r3, r4
&buf[cmpltd]);
10df8c: 4429 add r1, r5
ret = fat_cluster_write(fs_info,
10df8e: bf28 it cs
10df90: 4623 movcs r3, r4
10df92: 9100 str r1, [sp, #0]
10df94: 9903 ldr r1, [sp, #12]
10df96: f7fe fe6f bl 10cc78 <fat_cluster_write>
if (0 > ret)
10df9a: 2800 cmp r0, #0
10df9c: db3d blt.n 10e01a <fat_file_write+0x112> <== ALWAYS TAKEN
if (0 < bytes_to_write)
10df9e: 1a24 subs r4, r4, r0
save_cln = cur_cln;
10dfa0: f8dd 800c ldr.w r8, [sp, #12]
cmpltd += ret;
10dfa4: 4405 add r5, r0
if (0 < bytes_to_write)
10dfa6: d111 bne.n 10dfcc <fat_file_write+0xc4>
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10dfa8: 7b32 ldrb r2, [r6, #12]
10dfaa: eb05 030a add.w r3, r5, sl
return cmpltd;
10dfae: 4628 mov r0, r5
fat_fd->map.disk_cln = save_cln;
10dfb0: f8c7 8038 str.w r8, [r7, #56] ; 0x38
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10dfb4: 40d3 lsrs r3, r2
fat_fd->map.file_cln = start_cln +
10dfb6: 444b add r3, r9
10dfb8: 637b str r3, [r7, #52] ; 0x34
if (0 > ret)
10dfba: 2800 cmp r0, #0
10dfbc: db2a blt.n 10e014 <fat_file_write+0x10c> <== ALWAYS TAKEN
}
10dfbe: b004 add sp, #16
10dfc0: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
return cmpltd;
10dfc4: 4618 mov r0, r3 <== NOT EXECUTED
}
10dfc6: b004 add sp, #16 <== NOT EXECUTED
10dfc8: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
10dfcc: aa03 add r2, sp, #12
10dfce: 4641 mov r1, r8
10dfd0: 4630 mov r0, r6
10dfd2: f7ff fa27 bl 10d424 <fat_get_fat_cluster>
ofs_cln = 0;
10dfd6: 2200 movs r2, #0
while ( (RC_OK == rc)
10dfd8: 2800 cmp r0, #0
10dfda: d0d2 beq.n 10df82 <fat_file_write+0x7a> <== NEVER TAKEN
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10dfdc: 7b32 ldrb r2, [r6, #12] <== NOT EXECUTED
10dfde: eb05 030a add.w r3, r5, sl <== NOT EXECUTED
fat_fd->map.disk_cln = save_cln;
10dfe2: f8c7 8038 str.w r8, [r7, #56] ; 0x38 <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10dfe6: 40d3 lsrs r3, r2 <== NOT EXECUTED
fat_fd->map.file_cln = start_cln +
10dfe8: 444b add r3, r9 <== NOT EXECUTED
10dfea: 637b str r3, [r7, #52] ; 0x34 <== NOT EXECUTED
if (RC_OK != rc)
10dfec: e7e5 b.n 10dfba <fat_file_write+0xb2> <== NOT EXECUTED
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
10dfee: 6a7b ldr r3, [r7, #36] ; 0x24
10dff0: 2b00 cmp r3, #0
10dff2: d1b4 bne.n 10df5e <fat_file_write+0x56> <== ALWAYS TAKEN
10dff4: 7db3 ldrb r3, [r6, #22]
10dff6: 079b lsls r3, r3, #30
10dff8: d0b1 beq.n 10df5e <fat_file_write+0x56>
byte = start & (fs_info->vol.bpc -1);
10dffa: 68b2 ldr r2, [r6, #8]
ret = fat_cluster_write(fs_info,
10dffc: 4623 mov r3, r4
cln = fat_fd->cln;
10dffe: 69f9 ldr r1, [r7, #28]
ret = fat_cluster_write(fs_info,
10e000: 4630 mov r0, r6
10e002: 9c0c ldr r4, [sp, #48] ; 0x30
byte = start & (fs_info->vol.bpc -1);
10e004: 3a01 subs r2, #1
ret = fat_cluster_write(fs_info,
10e006: 4449 add r1, r9
10e008: 402a ands r2, r5
10e00a: 9400 str r4, [sp, #0]
10e00c: f7fe fe34 bl 10cc78 <fat_cluster_write>
if (0 > ret)
10e010: 2800 cmp r0, #0
10e012: dad4 bge.n 10dfbe <fat_file_write+0xb6> <== NEVER TAKEN
rc = -1;
10e014: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10e018: e7d1 b.n 10dfbe <fat_file_write+0xb6> <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10e01a: 4455 add r5, sl <== NOT EXECUTED
10e01c: f896 a00c ldrb.w sl, [r6, #12] <== NOT EXECUTED
fat_fd->map.disk_cln = save_cln;
10e020: f8c7 8038 str.w r8, [r7, #56] ; 0x38 <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10e024: fa25 f50a lsr.w r5, r5, sl <== NOT EXECUTED
fat_fd->map.file_cln = start_cln +
10e028: 444d add r5, r9 <== NOT EXECUTED
10e02a: 637d str r5, [r7, #52] ; 0x34 <== NOT EXECUTED
if (0 > ret)
10e02c: e7f2 b.n 10e014 <fat_file_write+0x10c> <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10e02e: 7b33 ldrb r3, [r6, #12] <== NOT EXECUTED
fat_fd->map.disk_cln = save_cln;
10e030: 63b8 str r0, [r7, #56] ; 0x38 <== NOT EXECUTED
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
10e032: fa2a f303 lsr.w r3, sl, r3 <== NOT EXECUTED
fat_fd->map.file_cln = start_cln +
10e036: 444b add r3, r9 <== NOT EXECUTED
10e038: 637b str r3, [r7, #52] ; 0x34 <== NOT EXECUTED
if (0 > ret)
10e03a: e7c0 b.n 10dfbe <fat_file_write+0xb6> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EFBIG);
10e03c: f006 fe20 bl 114c80 <__errno> <== NOT EXECUTED
10e040: 221b movs r2, #27 <== NOT EXECUTED
10e042: 4603 mov r3, r0 <== NOT EXECUTED
10e044: 601a str r2, [r3, #0] <== NOT EXECUTED
10e046: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10e04a: e7b8 b.n 10dfbe <fat_file_write+0xb6> <== NOT EXECUTED
0010e9e4 <fat_file_write_file_size>:
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->dir_pos.sname.cln);
10e9e4: 6a0b ldr r3, [r1, #32]
uint32_t le_new_length = 0;
10e9e6: 2200 movs r2, #0
{
10e9e8: b510 push {r4, lr}
10e9ea: b084 sub sp, #16
10e9ec: 468c mov ip, r1
uint32_t le_new_length = 0;
10e9ee: 9203 str r2, [sp, #12]
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e9f0: b923 cbnz r3, 10e9fc <fat_file_write_file_size+0x18>
10e9f2: 7d82 ldrb r2, [r0, #22]
10e9f4: 0792 lsls r2, r2, #30
return fs_info->vol.rdir_loc;
10e9f6: bf18 it ne
10e9f8: 6a83 ldrne r3, [r0, #40] ; 0x28
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e9fa: d104 bne.n 10ea06 <fat_file_write_file_size+0x22> <== NEVER TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10e9fc: 7942 ldrb r2, [r0, #5]
10e9fe: 3b02 subs r3, #2
10ea00: 6bc1 ldr r1, [r0, #60] ; 0x3c
10ea02: 4093 lsls r3, r2
10ea04: 440b add r3, r1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10ea06: f8dc 4024 ldr.w r4, [ip, #36] ; 0x24
10ea0a: 7881 ldrb r1, [r0, #2]
byte = (fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1));
10ea0c: 8802 ldrh r2, [r0, #0]
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10ea0e: fa24 f101 lsr.w r1, r4, r1
byte = (fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1));
10ea12: 3a01 subs r2, #1
10ea14: 4022 ands r2, r4
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10ea16: 4419 add r1, r3
if (fat_fd->fat_file_type == FAT_DIRECTORY) {
10ea18: f8dc 3010 ldr.w r3, [ip, #16]
10ea1c: b113 cbz r3, 10ea24 <fat_file_write_file_size+0x40>
le_new_length = CT_LE_L(fat_fd->fat_file_size);
10ea1e: f8dc 3018 ldr.w r3, [ip, #24]
10ea22: 9303 str r3, [sp, #12]
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_SIZE_OFFSET, 4,
10ea24: ac03 add r4, sp, #12
10ea26: 2304 movs r3, #4
10ea28: 321c adds r2, #28
10ea2a: 9400 str r4, [sp, #0]
10ea2c: f7fe f880 bl 10cb30 <fat_sector_write>
}
10ea30: 17c0 asrs r0, r0, #31
10ea32: b004 add sp, #16
10ea34: bd10 pop {r4, pc}
10ea36: bf00 nop
0010e970 <fat_file_write_first_cluster_num>:
{
10e970: b5f0 push {r4, r5, r6, r7, lr}
uint16_t le_cl_hi = 0;
10e972: 2200 movs r2, #0
uint32_t new_cln = fat_fd->cln;
10e974: e9d1 7307 ldrd r7, r3, [r1, #28]
{
10e978: b085 sub sp, #20
10e97a: 4604 mov r4, r0
uint16_t le_cl_hi = 0;
10e97c: f8ad 200e strh.w r2, [sp, #14]
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e980: b923 cbnz r3, 10e98c <fat_file_write_first_cluster_num+0x1c>
10e982: 7d82 ldrb r2, [r0, #22]
10e984: 0792 lsls r2, r2, #30
return fs_info->vol.rdir_loc;
10e986: bf18 it ne
10e988: 6a83 ldrne r3, [r0, #40] ; 0x28
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e98a: d104 bne.n 10e996 <fat_file_write_first_cluster_num+0x26> <== NEVER TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10e98c: 7962 ldrb r2, [r4, #5]
10e98e: 3b02 subs r3, #2
10e990: 4093 lsls r3, r2
10e992: 6be2 ldr r2, [r4, #60] ; 0x3c
10e994: 4413 add r3, r2
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e996: 6a4a ldr r2, [r1, #36] ; 0x24
ret1 = fat_sector_write(fs_info, sec,
10e998: 4620 mov r0, r4
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e99a: 78a5 ldrb r5, [r4, #2]
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
10e99c: 8826 ldrh r6, [r4, #0]
le_cl_low = CT_LE_W((uint16_t )(new_cln & 0x0000FFFF));
10e99e: f8ad 700c strh.w r7, [sp, #12]
le_cl_hi = CT_LE_W((uint16_t )((new_cln & 0xFFFF0000) >> 16));
10e9a2: 0c3f lsrs r7, r7, #16
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e9a4: fa22 f505 lsr.w r5, r2, r5
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
10e9a8: 3e01 subs r6, #1
10e9aa: 4016 ands r6, r2
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e9ac: 441d add r5, r3
ret1 = fat_sector_write(fs_info, sec,
10e9ae: ab03 add r3, sp, #12
10e9b0: f106 021a add.w r2, r6, #26
10e9b4: 4629 mov r1, r5
10e9b6: 9300 str r3, [sp, #0]
10e9b8: 2302 movs r3, #2
10e9ba: f7fe f8b9 bl 10cb30 <fat_sector_write>
10e9be: 4603 mov r3, r0
ret2 = fat_sector_write(fs_info, sec,
10e9c0: 4620 mov r0, r4
ret1 = fat_sector_write(fs_info, sec,
10e9c2: 461c mov r4, r3
ret2 = fat_sector_write(fs_info, sec,
10e9c4: f10d 030e add.w r3, sp, #14
10e9c8: 9300 str r3, [sp, #0]
10e9ca: f106 0214 add.w r2, r6, #20
10e9ce: 4629 mov r1, r5
10e9d0: 2302 movs r3, #2
le_cl_hi = CT_LE_W((uint16_t )((new_cln & 0xFFFF0000) >> 16));
10e9d2: f8ad 700e strh.w r7, [sp, #14]
ret2 = fat_sector_write(fs_info, sec,
10e9d6: f7fe f8ab bl 10cb30 <fat_sector_write>
if ( (ret1 < 0) || (ret2 < 0) )
10e9da: 4320 orrs r0, r4
}
10e9dc: 17c0 asrs r0, r0, #31
10e9de: b005 add sp, #20
10e9e0: bdf0 pop {r4, r5, r6, r7, pc}
10e9e2: bf00 nop
0010e89c <fat_file_write_time_and_date>:
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->dir_pos.sname.cln);
10e89c: 6a0b ldr r3, [r1, #32]
{
10e89e: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
10e8a2: 4689 mov r9, r1
10e8a4: b085 sub sp, #20
10e8a6: 4604 mov r4, r0
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e8a8: b923 cbnz r3, 10e8b4 <fat_file_write_time_and_date+0x18>
10e8aa: 7d82 ldrb r2, [r0, #22]
10e8ac: 0792 lsls r2, r2, #30
return fs_info->vol.rdir_loc;
10e8ae: bf18 it ne
10e8b0: 6a83 ldrne r3, [r0, #40] ; 0x28
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e8b2: d104 bne.n 10e8be <fat_file_write_time_and_date+0x22> <== NEVER TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10e8b4: 7962 ldrb r2, [r4, #5]
10e8b6: 3b02 subs r3, #2
10e8b8: 6be5 ldr r5, [r4, #60] ; 0x3c
10e8ba: 4093 lsls r3, r2
10e8bc: 442b add r3, r5
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e8be: f8d9 2024 ldr.w r2, [r9, #36] ; 0x24
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
10e8c2: f10d 070e add.w r7, sp, #14
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e8c6: 78a5 ldrb r5, [r4, #2]
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
10e8c8: 4639 mov r1, r7
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
10e8ca: 8826 ldrh r6, [r4, #0]
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
10e8cc: f8d9 0048 ldr.w r0, [r9, #72] ; 0x48
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e8d0: fa22 f505 lsr.w r5, r2, r5
byte = fat_fd->dir_pos.sname.ofs & (fs_info->vol.bps - 1);
10e8d4: 3e01 subs r6, #1
10e8d6: 4016 ands r6, r2
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
10e8d8: aa03 add r2, sp, #12
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->vol.sec_log2);
10e8da: 441d add r5, r3
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
10e8dc: f003 fed6 bl 11268c <msdos_date_unix2dos>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_WTIME_OFFSET,
10e8e0: ab03 add r3, sp, #12
10e8e2: f106 0216 add.w r2, r6, #22
10e8e6: 4629 mov r1, r5
10e8e8: 9300 str r3, [sp, #0]
10e8ea: 4620 mov r0, r4
10e8ec: 2302 movs r3, #2
10e8ee: f7fe f91f bl 10cb30 <fat_sector_write>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_WDATE_OFFSET,
10e8f2: f106 0218 add.w r2, r6, #24
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_WTIME_OFFSET,
10e8f6: 4680 mov r8, r0
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_WDATE_OFFSET,
10e8f8: 4629 mov r1, r5
10e8fa: 2302 movs r3, #2
10e8fc: 4620 mov r0, r4
10e8fe: 9700 str r7, [sp, #0]
10e900: f7fe f916 bl 10cb30 <fat_sector_write>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_ADATE_OFFSET,
10e904: 2302 movs r3, #2
if ( ret < 0 )
10e906: 2800 cmp r0, #0
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_ADATE_OFFSET,
10e908: f106 0212 add.w r2, r6, #18
10e90c: 4629 mov r1, r5
10e90e: 4620 mov r0, r4
10e910: 9700 str r7, [sp, #0]
rc = -1;
10e912: bfb4 ite lt
10e914: f04f 38ff movlt.w r8, #4294967295 ; 0xffffffff
if ( ret < 0 )
10e918: ea4f 78e8 movge.w r8, r8, asr #31
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_ADATE_OFFSET,
10e91c: f7fe f908 bl 10cb30 <fat_sector_write>
msdos_date_unix2dos(fat_fd->ctime, &date, &time_val);
10e920: aa03 add r2, sp, #12
rc = -1;
10e922: 2800 cmp r0, #0
msdos_date_unix2dos(fat_fd->ctime, &date, &time_val);
10e924: 4639 mov r1, r7
10e926: f8d9 0040 ldr.w r0, [r9, #64] ; 0x40
rc = -1;
10e92a: bfb8 it lt
10e92c: f04f 38ff movlt.w r8, #4294967295 ; 0xffffffff
msdos_date_unix2dos(fat_fd->ctime, &date, &time_val);
10e930: f003 feac bl 11268c <msdos_date_unix2dos>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_CTIME_OFFSET,
10e934: ab03 add r3, sp, #12
10e936: f106 020e add.w r2, r6, #14
10e93a: 4629 mov r1, r5
10e93c: 9300 str r3, [sp, #0]
10e93e: 4620 mov r0, r4
10e940: 2302 movs r3, #2
10e942: f7fe f8f5 bl 10cb30 <fat_sector_write>
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_CDATE_OFFSET,
10e946: f106 0210 add.w r2, r6, #16
rc = -1;
10e94a: 2800 cmp r0, #0
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_CDATE_OFFSET,
10e94c: 4629 mov r1, r5
10e94e: 4620 mov r0, r4
10e950: f04f 0302 mov.w r3, #2
10e954: 9700 str r7, [sp, #0]
rc = -1;
10e956: bfb8 it lt
10e958: f04f 38ff movlt.w r8, #4294967295 ; 0xffffffff
ret = fat_sector_write(fs_info, sec, byte + MSDOS_FILE_CDATE_OFFSET,
10e95c: f7fe f8e8 bl 10cb30 <fat_sector_write>
rc = -1;
10e960: 2800 cmp r0, #0
}
10e962: bfac ite ge
10e964: 4640 movge r0, r8
10e966: f04f 30ff movlt.w r0, #4294967295 ; 0xffffffff
10e96a: b005 add sp, #20
10e96c: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
0010d680 <fat_free_fat_clusters_chain>:
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d680: e9d0 3206 ldrd r3, r2, [r0, #24]
{
10d684: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
uint32_t next_cln = 0;
10d688: 2600 movs r6, #0
{
10d68a: b082 sub sp, #8
10d68c: 4604 mov r4, r0
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d68e: 400b ands r3, r1
{
10d690: 4688 mov r8, r1
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d692: 429a cmp r2, r3
uint32_t next_cln = 0;
10d694: 9601 str r6, [sp, #4]
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d696: d924 bls.n 10d6e2 <fat_free_fat_clusters_chain+0x62> <== ALWAYS TAKEN
uint32_t cur_cln = chain;
10d698: 460d mov r5, r1
int rc = RC_OK, rc1 = RC_OK;
10d69a: 4637 mov r7, r6
10d69c: e00b b.n 10d6b6 <fat_free_fat_clusters_chain+0x36>
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
10d69e: f7ff ff37 bl 10d510 <fat_set_fat_cluster>
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d6a2: e9d4 3206 ldrd r3, r2, [r4, #24]
if ( rc != RC_OK )
10d6a6: 2800 cmp r0, #0
10d6a8: bf18 it ne
10d6aa: 4607 movne r7, r0
cur_cln = next_cln;
10d6ac: 9d01 ldr r5, [sp, #4]
freed_cls_cnt++;
10d6ae: 3601 adds r6, #1
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d6b0: 402b ands r3, r5
10d6b2: 4293 cmp r3, r2
10d6b4: d216 bcs.n 10d6e4 <fat_free_fat_clusters_chain+0x64>
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
10d6b6: 4629 mov r1, r5
10d6b8: aa01 add r2, sp, #4
10d6ba: 4620 mov r0, r4
10d6bc: f7ff feb2 bl 10d424 <fat_get_fat_cluster>
10d6c0: 4602 mov r2, r0
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
10d6c2: 4629 mov r1, r5
10d6c4: 4620 mov r0, r4
if ( rc != RC_OK )
10d6c6: 2a00 cmp r2, #0
10d6c8: d0e9 beq.n 10d69e <fat_free_fat_clusters_chain+0x1e> <== NEVER TAKEN
if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
10d6ca: 6ce3 ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
10d6cc: 4617 mov r7, r2 <== NOT EXECUTED
if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
10d6ce: 1c59 adds r1, r3, #1 <== NOT EXECUTED
fs_info->vol.free_cls += freed_cls_cnt;
10d6d0: bf1c itt ne <== NOT EXECUTED
10d6d2: 199b addne r3, r3, r6 <== NOT EXECUTED
10d6d4: 64e3 strne r3, [r4, #76] ; 0x4c <== NOT EXECUTED
fat_buf_release(fs_info);
10d6d6: f7ff f9cf bl 10ca78 <fat_buf_release> <== NOT EXECUTED
}
10d6da: 4638 mov r0, r7 <== NOT EXECUTED
10d6dc: b002 add sp, #8 <== NOT EXECUTED
10d6de: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
int rc = RC_OK, rc1 = RC_OK;
10d6e2: 4637 mov r7, r6 <== NOT EXECUTED
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
10d6e4: 6ce3 ldr r3, [r4, #76] ; 0x4c
fat_buf_release(fs_info);
10d6e6: 4620 mov r0, r4
fs_info->vol.next_cl = chain;
10d6e8: f8c4 8054 str.w r8, [r4, #84] ; 0x54
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
10d6ec: 1c5a adds r2, r3, #1
fs_info->vol.free_cls += freed_cls_cnt;
10d6ee: bf1c itt ne
10d6f0: 199b addne r3, r3, r6
10d6f2: 64e3 strne r3, [r4, #76] ; 0x4c
fat_buf_release(fs_info);
10d6f4: f7ff f9c0 bl 10ca78 <fat_buf_release>
}
10d6f8: 4638 mov r0, r7
10d6fa: b002 add sp, #8
10d6fc: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
0010d3ec <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);
10d3ec: f8d0 3094 ldr.w r3, [r0, #148] ; 0x94 <== NOT EXECUTED
10d3f0: 2201 movs r2, #1 <== NOT EXECUTED
{
10d3f2: b410 push {r4} <== NOT EXECUTED
FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino);
10d3f4: f8d0 4088 ldr.w r4, [r0, #136] ; 0x88 <== NOT EXECUTED
10d3f8: 1ac9 subs r1, r1, r3 <== NOT EXECUTED
10d3fa: 08c8 lsrs r0, r1, #3 <== NOT EXECUTED
10d3fc: f001 0107 and.w r1, r1, #7 <== NOT EXECUTED
10d400: fa02 f101 lsl.w r1, r2, r1 <== NOT EXECUTED
10d404: 5c23 ldrb r3, [r4, r0] <== NOT EXECUTED
10d406: ea23 0101 bic.w r1, r3, r1 <== NOT EXECUTED
10d40a: 5421 strb r1, [r4, r0] <== NOT EXECUTED
}
10d40c: f85d 4b04 ldr.w r4, [sp], #4 <== NOT EXECUTED
10d410: 4770 bx lr <== NOT EXECUTED
10d412: bf00 nop
0010d424 <fat_get_fat_cluster>:
uint8_t *sec_buf;
uint32_t sec = 0;
uint32_t ofs = 0;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
10d424: 2901 cmp r1, #1
{
10d426: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
10d42a: b082 sub sp, #8
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
10d42c: d928 bls.n 10d480 <fat_get_fat_cluster+0x5c> <== ALWAYS TAKEN
10d42e: 6c03 ldr r3, [r0, #64] ; 0x40
10d430: 460d mov r5, r1
10d432: 4604 mov r4, r0
10d434: 3301 adds r3, #1
10d436: 428b cmp r3, r1
10d438: d322 bcc.n 10d480 <fat_get_fat_cluster+0x5c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
10d43a: 7d83 ldrb r3, [r0, #22]
10d43c: 4690 mov r8, r2
10d43e: 7881 ldrb r1, [r0, #2]
fs_info->vol.afat_loc;
10d440: 6e02 ldr r2, [r0, #96] ; 0x60
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
10d442: 07de lsls r6, r3, #31
10d444: d426 bmi.n 10d494 <fat_get_fat_cluster+0x70>
10d446: 0798 lsls r0, r3, #30
10d448: bf4c ite mi
10d44a: ea4f 0a45 movmi.w sl, r5, lsl #1
10d44e: ea4f 0a85 movpl.w sl, r5, lsl #2
10d452: fa2a f101 lsr.w r1, sl, r1
10d456: eb01 0902 add.w r9, r1, r2
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);
10d45a: 2201 movs r2, #1
10d45c: ab01 add r3, sp, #4
10d45e: 4649 mov r1, r9
10d460: 4620 mov r0, r4
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
10d462: 8827 ldrh r7, [r4, #0]
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
10d464: f7ff fac8 bl 10c9f8 <fat_buf_access>
if (rc != RC_OK)
10d468: 4606 mov r6, r0
10d46a: b978 cbnz r0, 10d48c <fat_get_fat_cluster+0x68>
return rc;
switch ( fs_info->vol.type )
10d46c: 7da2 ldrb r2, [r4, #22]
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
10d46e: 3f01 subs r7, #1
10d470: ea07 070a and.w r7, r7, sl
switch ( fs_info->vol.type )
10d474: 2a02 cmp r2, #2
10d476: d014 beq.n 10d4a2 <fat_get_fat_cluster+0x7e>
10d478: 2a04 cmp r2, #4
10d47a: d01a beq.n 10d4b2 <fat_get_fat_cluster+0x8e>
10d47c: 2a01 cmp r2, #1
10d47e: d020 beq.n 10d4c2 <fat_get_fat_cluster+0x9e> <== NEVER TAKEN
*ret_val = *((uint32_t *)(sec_buf + ofs));
*ret_val = CF_LE_L(*ret_val);
break;
default:
rtems_set_errno_and_return_minus_one(EIO);
10d480: f04f 36ff mov.w r6, #4294967295 ; 0xffffffff <== NOT EXECUTED
10d484: f007 fbfc bl 114c80 <__errno> <== NOT EXECUTED
10d488: 2305 movs r3, #5 <== NOT EXECUTED
10d48a: 6003 str r3, [r0, #0] <== NOT EXECUTED
break;
}
return RC_OK;
}
10d48c: 4630 mov r0, r6 <== NOT EXECUTED
10d48e: b002 add sp, #8 <== NOT EXECUTED
10d490: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
10d494: eb05 0a55 add.w sl, r5, r5, lsr #1
10d498: fa2a f101 lsr.w r1, sl, r1
10d49c: eb01 0902 add.w r9, r1, r2
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
10d4a0: e7db b.n 10d45a <fat_get_fat_cluster+0x36>
*ret_val = *((uint16_t *)(sec_buf + ofs));
10d4a2: 9b01 ldr r3, [sp, #4]
}
10d4a4: 4630 mov r0, r6
*ret_val = *((uint16_t *)(sec_buf + ofs));
10d4a6: 5bdb ldrh r3, [r3, r7]
10d4a8: f8c8 3000 str.w r3, [r8]
}
10d4ac: b002 add sp, #8
10d4ae: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
*ret_val = *((uint32_t *)(sec_buf + ofs));
10d4b2: 9b01 ldr r3, [sp, #4]
}
10d4b4: 4630 mov r0, r6
*ret_val = *((uint32_t *)(sec_buf + ofs));
10d4b6: 59db ldr r3, [r3, r7]
10d4b8: f8c8 3000 str.w r3, [r8]
}
10d4bc: b002 add sp, #8
10d4be: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
if ( ofs == (fs_info->vol.bps - 1) )
10d4c2: 8820 ldrh r0, [r4, #0]
*ret_val = (*(sec_buf + ofs));
10d4c4: 9901 ldr r1, [sp, #4]
if ( ofs == (fs_info->vol.bps - 1) )
10d4c6: 3801 subs r0, #1
*ret_val = (*(sec_buf + ofs));
10d4c8: 5dcb ldrb r3, [r1, r7]
if ( ofs == (fs_info->vol.bps - 1) )
10d4ca: 42b8 cmp r0, r7
*ret_val = (*(sec_buf + ofs));
10d4cc: f8c8 3000 str.w r3, [r8]
if ( ofs == (fs_info->vol.bps - 1) )
10d4d0: d00e beq.n 10d4f0 <fat_get_fat_cluster+0xcc>
*ret_val |= *(sec_buf + ofs + 1) << 8;
10d4d2: 440f add r7, r1
10d4d4: 787a ldrb r2, [r7, #1]
10d4d6: ea43 2302 orr.w r3, r3, r2, lsl #8
if ( FAT_CLUSTER_IS_ODD(cln) )
10d4da: 07ea lsls r2, r5, #31
*ret_val = (*ret_val) >> FAT12_SHIFT;
10d4dc: bf4c ite mi
10d4de: 091b lsrmi r3, r3, #4
*ret_val = (*ret_val) & FAT_FAT12_MASK;
10d4e0: f3c3 030b ubfxpl r3, r3, #0, #12
}
10d4e4: 4630 mov r0, r6
*ret_val = (*ret_val) & FAT_FAT12_MASK;
10d4e6: f8c8 3000 str.w r3, [r8]
}
10d4ea: b002 add sp, #8
10d4ec: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
10d4f0: ab01 add r3, sp, #4
10d4f2: f109 0101 add.w r1, r9, #1
10d4f6: 4620 mov r0, r4
10d4f8: f7ff fa7e bl 10c9f8 <fat_buf_access>
if (rc != RC_OK)
10d4fc: b930 cbnz r0, 10d50c <fat_get_fat_cluster+0xe8>
*ret_val |= *sec_buf << 8;
10d4fe: 9a01 ldr r2, [sp, #4]
10d500: f8d8 3000 ldr.w r3, [r8]
10d504: 7812 ldrb r2, [r2, #0]
10d506: ea43 2302 orr.w r3, r3, r2, lsl #8
10d50a: e7e6 b.n 10d4da <fat_get_fat_cluster+0xb6>
10d50c: 4606 mov r6, r0 <== NOT EXECUTED
10d50e: e7bd b.n 10d48c <fat_get_fat_cluster+0x68> <== NOT EXECUTED
0010d358 <fat_get_unique_ino>:
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
10d358: f8d0 1090 ldr.w r1, [r0, #144] ; 0x90 <== NOT EXECUTED
{
10d35c: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
return (fs_info->uino_base + fs_info->index);
}
fs_info->index++;
if (fs_info->index >= fs_info->uino_pool_size)
fs_info->index = 0;
10d360: 2500 movs r5, #0 <== NOT EXECUTED
{
10d362: 4604 mov r4, r0 <== NOT EXECUTED
}
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
10d364: f06f 4670 mvn.w r6, #4026531840 ; 0xf0000000 <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
10d368: b351 cbz r1, 10d3c0 <fat_get_unique_ino+0x68> <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
10d36a: f8d4 0088 ldr.w r0, [r4, #136] ; 0x88 <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
10d36e: f04f 0c00 mov.w ip, #0 <== NOT EXECUTED
10d372: e006 b.n 10d382 <fat_get_unique_ino+0x2a> <== NOT EXECUTED
fs_info->index++;
10d374: 428a cmp r2, r1 <== NOT EXECUTED
10d376: bf28 it cs <== NOT EXECUTED
10d378: 462a movcs r2, r5 <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
10d37a: 458c cmp ip, r1 <== NOT EXECUTED
fs_info->index++;
10d37c: f8c4 208c str.w r2, [r4, #140] ; 0x8c <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
10d380: d01d beq.n 10d3be <fat_get_unique_ino+0x66> <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
10d382: f8d4 308c ldr.w r3, [r4, #140] ; 0x8c <== NOT EXECUTED
for (j = 0; j < fs_info->uino_pool_size; j++)
10d386: f10c 0c01 add.w ip, ip, #1 <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
10d38a: f003 0707 and.w r7, r3, #7 <== NOT EXECUTED
fs_info->index++;
10d38e: 1c5a adds r2, r3, #1 <== NOT EXECUTED
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
10d390: 08db lsrs r3, r3, #3 <== NOT EXECUTED
10d392: f810 e003 ldrb.w lr, [r0, r3] <== NOT EXECUTED
10d396: 4403 add r3, r0 <== NOT EXECUTED
10d398: fa4e f807 asr.w r8, lr, r7 <== NOT EXECUTED
10d39c: f018 0f01 tst.w r8, #1 <== NOT EXECUTED
10d3a0: d1e8 bne.n 10d374 <fat_get_unique_ino+0x1c> <== NOT EXECUTED
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
10d3a2: 2201 movs r2, #1 <== NOT EXECUTED
10d3a4: fa02 f707 lsl.w r7, r2, r7 <== NOT EXECUTED
10d3a8: ea47 0e0e orr.w lr, r7, lr <== NOT EXECUTED
10d3ac: f883 e000 strb.w lr, [r3] <== NOT EXECUTED
return (fs_info->uino_base + fs_info->index);
10d3b0: f8d4 0094 ldr.w r0, [r4, #148] ; 0x94 <== NOT EXECUTED
10d3b4: f8d4 308c ldr.w r3, [r4, #140] ; 0x8c <== NOT EXECUTED
10d3b8: 4418 add r0, r3 <== NOT EXECUTED
}
else
resrc_unsuff = true;
}
return 0;
}
10d3ba: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
10d3be: 0049 lsls r1, r1, #1 <== NOT EXECUTED
10d3c0: f8d4 3094 ldr.w r3, [r4, #148] ; 0x94 <== NOT EXECUTED
10d3c4: 1af3 subs r3, r6, r3 <== NOT EXECUTED
10d3c6: 428b cmp r3, r1 <== NOT EXECUTED
10d3c8: d90d bls.n 10d3e6 <fat_get_unique_ino+0x8e> <== NOT EXECUTED
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
10d3ca: f8d4 0088 ldr.w r0, [r4, #136] ; 0x88 <== NOT EXECUTED
fs_info->uino_pool_size <<= 1;
10d3ce: f8c4 1090 str.w r1, [r4, #144] ; 0x90 <== NOT EXECUTED
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
10d3d2: f005 f885 bl 1124e0 <realloc> <== NOT EXECUTED
10d3d6: f8c4 0088 str.w r0, [r4, #136] ; 0x88 <== NOT EXECUTED
if (fs_info->uino != NULL)
10d3da: b120 cbz r0, 10d3e6 <fat_get_unique_ino+0x8e> <== NOT EXECUTED
fs_info->index = fs_info->uino_pool_size;
10d3dc: f8d4 1090 ldr.w r1, [r4, #144] ; 0x90 <== NOT EXECUTED
10d3e0: f8c4 108c str.w r1, [r4, #140] ; 0x8c <== NOT EXECUTED
10d3e4: e7c0 b.n 10d368 <fat_get_unique_ino+0x10> <== NOT EXECUTED
return 0;
10d3e6: 2000 movs r0, #0 <== NOT EXECUTED
10d3e8: e7e7 b.n 10d3ba <fat_get_unique_ino+0x62> <== NOT EXECUTED
10d3ea: bf00 nop
0010d310 <fat_init_clusters_chain>:
int
fat_init_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t start_cln
)
{
10d310: b570 push {r4, r5, r6, lr}
10d312: b084 sub sp, #16
10d314: 4604 mov r4, r0
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
10d316: 2500 movs r5, #0
uint32_t cur_cln = start_cln;
10d318: 9103 str r1, [sp, #12]
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d31a: e00e b.n 10d33a <fat_init_clusters_chain+0x2a>
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
10d31c: 68a3 ldr r3, [r4, #8]
10d31e: 9500 str r5, [sp, #0]
10d320: f7ff fc3e bl 10cba0 <fat_cluster_set>
if ( ret != fs_info->vol.bpc )
10d324: 68a1 ldr r1, [r4, #8]
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
10d326: 4603 mov r3, r0
{
return -1;
}
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
10d328: aa03 add r2, sp, #12
10d32a: 4620 mov r0, r4
if ( ret != fs_info->vol.bpc )
10d32c: 4299 cmp r1, r3
10d32e: d10e bne.n 10d34e <fat_init_clusters_chain+0x3e> <== ALWAYS TAKEN
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
10d330: 9903 ldr r1, [sp, #12]
10d332: f000 f877 bl 10d424 <fat_get_fat_cluster>
if ( rc != RC_OK )
10d336: b940 cbnz r0, 10d34a <fat_init_clusters_chain+0x3a>
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d338: 9903 ldr r1, [sp, #12]
10d33a: 69a3 ldr r3, [r4, #24]
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
10d33c: 2200 movs r2, #0
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d33e: 69e6 ldr r6, [r4, #28]
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
10d340: 4620 mov r0, r4
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
10d342: 400b ands r3, r1
10d344: 42b3 cmp r3, r6
10d346: d3e9 bcc.n 10d31c <fat_init_clusters_chain+0xc>
return rc;
}
}
return rc;
10d348: 4610 mov r0, r2
}
10d34a: b004 add sp, #16
10d34c: bd70 pop {r4, r5, r6, pc}
return -1;
10d34e: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
10d352: b004 add sp, #16 <== NOT EXECUTED
10d354: bd70 pop {r4, r5, r6, pc} <== NOT EXECUTED
10d356: bf00 nop
0010cd50 <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)
{
10cd50: 460a mov r2, r1
10cd52: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
char boot_rec[FAT_MAX_BPB_SIZE];
char fs_info_sector[FAT_USEFUL_INFO_SIZE];
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
10cd56: 2300 movs r3, #0
{
10cd58: b0a7 sub sp, #156 ; 0x9c
10cd5a: 4604 mov r4, r0
vol->fd = open(device, O_RDWR);
10cd5c: 2102 movs r1, #2
10cd5e: 4610 mov r0, r2
rtems_bdbuf_buffer *block = NULL;
10cd60: 9308 str r3, [sp, #32]
vol->fd = open(device, O_RDWR);
10cd62: f7f8 ffe1 bl 105d28 <open>
if (vol->fd < 0)
10cd66: 2800 cmp r0, #0
vol->fd = open(device, O_RDWR);
10cd68: 66a0 str r0, [r4, #104] ; 0x68
if (vol->fd < 0)
10cd6a: f2c0 81d4 blt.w 10d116 <fat_init_volume_info+0x3c6> <== ALWAYS TAKEN
{
rtems_set_errno_and_return_minus_one(ENXIO);
}
rc = fstat(vol->fd, &stat_buf);
10cd6e: a90c add r1, sp, #48 ; 0x30
10cd70: f7f8 fc84 bl 10567c <fstat>
if (rc != 0)
10cd74: 2800 cmp r0, #0
10cd76: f040 81aa bne.w 10d0ce <fat_init_volume_info+0x37e> <== ALWAYS TAKEN
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* Must be a block device. */
if (!S_ISBLK(stat_buf.st_mode))
10cd7a: 9b10 ldr r3, [sp, #64] ; 0x40
close(vol->fd);
10cd7c: 6ea0 ldr r0, [r4, #104] ; 0x68
if (!S_ISBLK(stat_buf.st_mode))
10cd7e: f403 4370 and.w r3, r3, #61440 ; 0xf000
10cd82: f5b3 4fc0 cmp.w r3, #24576 ; 0x6000
10cd86: f040 81a3 bne.w 10d0d0 <fat_init_volume_info+0x380> <== ALWAYS TAKEN
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
10cd8a: f244 2109 movw r1, #16905 ; 0x4209
10cd8e: f104 026c add.w r2, r4, #108 ; 0x6c
10cd92: f2c4 0104 movt r1, #16388 ; 0x4004
10cd96: f7ff fa49 bl 10c22c <ioctl>
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) {
10cd9a: 4605 mov r5, r0
10cd9c: 2800 cmp r0, #0
10cd9e: f040 8196 bne.w 10d0ce <fat_init_volume_info+0x37e> <== ALWAYS TAKEN
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
vol->dev = stat_buf.st_rdev;
10cda2: e9dd 6714 ldrd r6, r7, [sp, #80] ; 0x50
/* Read boot record */
/* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */
sc = rtems_bdbuf_read( vol->dd, 0, &block);
10cda6: aa08 add r2, sp, #32
10cda8: 6ee0 ldr r0, [r4, #108] ; 0x6c
10cdaa: 4629 mov r1, r5
vol->dev = stat_buf.st_rdev;
10cdac: e9c4 671c strd r6, r7, [r4, #112] ; 0x70
sc = rtems_bdbuf_read( vol->dd, 0, &block);
10cdb0: f005 f97e bl 1120b0 <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL)
10cdb4: 2800 cmp r0, #0
10cdb6: f040 81a4 bne.w 10d102 <fat_init_volume_info+0x3b2> <== ALWAYS TAKEN
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO);
}
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
10cdba: 9808 ldr r0, [sp, #32]
10cdbc: 69c3 ldr r3, [r0, #28]
10cdbe: 89da ldrh r2, [r3, #14]
10cdc0: f8b3 100b ldrh.w r1, [r3, #11]
10cdc4: f893 b00d ldrb.w fp, [r3, #13]
10cdc8: 9202 str r2, [sp, #8]
10cdca: 7c1a ldrb r2, [r3, #16]
10cdcc: f8b3 8011 ldrh.w r8, [r3, #17]
10cdd0: f8b3 9013 ldrh.w r9, [r3, #19]
10cdd4: 9203 str r2, [sp, #12]
10cdd6: f893 2028 ldrb.w r2, [r3, #40] ; 0x28
10cdda: f8b3 a016 ldrh.w sl, [r3, #22]
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
10cdde: 6a1e ldr r6, [r3, #32]
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
10cde0: 6a5f ldr r7, [r3, #36] ; 0x24
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
10cde2: 9206 str r2, [sp, #24]
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
10cde4: 6ada ldr r2, [r3, #44] ; 0x2c
10cde6: 8e1b ldrh r3, [r3, #48] ; 0x30
10cde8: 9104 str r1, [sp, #16]
10cdea: 9207 str r2, [sp, #28]
10cdec: 9305 str r3, [sp, #20]
sc = rtems_bdbuf_release( block);
10cdee: f005 f9ef bl 1121d0 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
10cdf2: 9904 ldr r1, [sp, #16]
10cdf4: 2800 cmp r0, #0
10cdf6: f040 8184 bne.w 10d102 <fat_init_volume_info+0x3b2> <== ALWAYS TAKEN
(vol->bps != 1024) &&
10cdfa: f5a1 6300 sub.w r3, r1, #2048 ; 0x800
10cdfe: f24f 72ff movw r2, #63487 ; 0xf7ff
10ce02: 401a ands r2, r3
if ( (vol->bps != 512) &&
10ce04: f5a1 7000 sub.w r0, r1, #512 ; 0x200
10ce08: f64f 53ff movw r3, #65023 ; 0xfdff
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
10ce0c: 8021 strh r1, [r4, #0]
if ( (vol->bps != 512) &&
10ce0e: 4003 ands r3, r0
(vol->bps != 2048) &&
10ce10: 2a00 cmp r2, #0
10ce12: bf18 it ne
10ce14: 2b00 cmpne r3, #0
10ce16: f040 816a bne.w 10d0ee <fat_init_volume_info+0x39e> <== ALWAYS TAKEN
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
10ce1a: 058a lsls r2, r1, #22
10ce1c: ea4f 2351 mov.w r3, r1, lsr #9
10ce20: 70e5 strb r5, [r4, #3]
10ce22: d408 bmi.n 10ce36 <fat_init_volume_info+0xe6> <== NEVER TAKEN
10ce24: 2201 movs r2, #1 <== NOT EXECUTED
i >>= 1, vol->sec_mul++);
10ce26: 105b asrs r3, r3, #1 <== NOT EXECUTED
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
10ce28: 1c50 adds r0, r2, #1 <== NOT EXECUTED
10ce2a: 4694 mov ip, r2 <== NOT EXECUTED
10ce2c: b2c2 uxtb r2, r0 <== NOT EXECUTED
10ce2e: 07d8 lsls r0, r3, #31 <== NOT EXECUTED
10ce30: d5f9 bpl.n 10ce26 <fat_init_volume_info+0xd6> <== NOT EXECUTED
10ce32: f884 c003 strb.w ip, [r4, #3] <== NOT EXECUTED
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
10ce36: 07ca lsls r2, r1, #31
10ce38: f04f 0300 mov.w r3, #0
10ce3c: 70a3 strb r3, [r4, #2]
10ce3e: 460b mov r3, r1
10ce40: d408 bmi.n 10ce54 <fat_init_volume_info+0x104> <== ALWAYS TAKEN
10ce42: 2201 movs r2, #1
i >>= 1, vol->sec_log2++);
10ce44: 105b asrs r3, r3, #1
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
10ce46: 1c50 adds r0, r2, #1
10ce48: 4694 mov ip, r2
10ce4a: b2c2 uxtb r2, r0
10ce4c: 07d8 lsls r0, r3, #31
10ce4e: d5f9 bpl.n 10ce44 <fat_init_volume_info+0xf4>
10ce50: f884 c002 strb.w ip, [r4, #2]
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bps, true);
10ce54: 6ee0 ldr r0, [r4, #108] ; 0x6c
10ce56: 2201 movs r2, #1
10ce58: f005 fa74 bl 112344 <rtems_bdbuf_set_block_size>
if (sc != RTEMS_SUCCESSFUL)
10ce5c: 4603 mov r3, r0
10ce5e: 2800 cmp r0, #0
10ce60: f040 8145 bne.w 10d0ee <fat_init_volume_info+0x39e> <== ALWAYS TAKEN
vol->bytes_per_block = vol->bps;
10ce64: 8821 ldrh r1, [r4, #0]
vol->sectors_per_block = 1;
10ce66: 2001 movs r0, #1
vol->bytes_per_block_log2 = vol->sec_log2;
10ce68: 78a2 ldrb r2, [r4, #2]
vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec);
10ce6a: f884 b004 strb.w fp, [r4, #4]
vol->bytes_per_block = vol->bps;
10ce6e: 6121 str r1, [r4, #16]
vol->bytes_per_block_log2 = vol->sec_log2;
10ce70: 7522 strb r2, [r4, #20]
vol->sectors_per_block = 1;
10ce72: 7360 strb r0, [r4, #13]
if (vol->spc == 0)
10ce74: f1bb 0f00 cmp.w fp, #0
10ce78: f000 8139 beq.w 10d0ee <fat_init_volume_info+0x39e> <== ALWAYS TAKEN
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
10ce7c: f01b 0f01 tst.w fp, #1
10ce80: 46dc mov ip, fp
10ce82: 7163 strb r3, [r4, #5]
10ce84: d10c bne.n 10cea0 <fat_init_volume_info+0x150>
i >>= 1, vol->spc_log2++);
10ce86: ea4f 0c6c mov.w ip, ip, asr #1
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
10ce8a: f100 0e01 add.w lr, r0, #1
10ce8e: 4603 mov r3, r0
10ce90: fa5f f08e uxtb.w r0, lr
10ce94: f01c 0f01 tst.w ip, #1
10ce98: d0f5 beq.n 10ce86 <fat_init_volume_info+0x136>
if (vol->spc != UINT32_C(1) << vol->spc_log2)
10ce9a: 2001 movs r0, #1
10ce9c: 7163 strb r3, [r4, #5]
10ce9e: 4098 lsls r0, r3
10cea0: 4583 cmp fp, r0
10cea2: f040 8124 bne.w 10d0ee <fat_init_volume_info+0x39e> <== ALWAYS TAKEN
vol->bpc = ((uint32_t) vol->bps) << vol->spc_log2;
10cea6: fa01 f303 lsl.w r3, r1, r3
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
10ceaa: 2000 movs r0, #0
10ceac: 7320 strb r0, [r4, #12]
10ceae: 07d8 lsls r0, r3, #31
vol->bpc = ((uint32_t) vol->bps) << vol->spc_log2;
10ceb0: 60a3 str r3, [r4, #8]
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
10ceb2: d40b bmi.n 10cecc <fat_init_volume_info+0x17c> <== ALWAYS TAKEN
10ceb4: 2001 movs r0, #1
i >>= 1, vol->bpc_log2++);
10ceb6: 105b asrs r3, r3, #1
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
10ceb8: f100 0c01 add.w ip, r0, #1
10cebc: 4686 mov lr, r0
10cebe: fa5f f08c uxtb.w r0, ip
10cec2: f013 0f01 tst.w r3, #1
10cec6: d0f6 beq.n 10ceb6 <fat_init_volume_info+0x166>
10cec8: f884 e00c strb.w lr, [r4, #12]
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
10cecc: 9b03 ldr r3, [sp, #12]
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
10cece: 1e48 subs r0, r1, #1
10ced0: 9204 str r2, [sp, #16]
10ced2: eb00 1048 add.w r0, r0, r8, lsl #5
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
10ced6: 9a02 ldr r2, [sp, #8]
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
10ced8: f1ba 0f00 cmp.w sl, #0
10cedc: bf18 it ne
10cede: 4657 movne r7, sl
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
10cee0: 7563 strb r3, [r4, #21]
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
10cee2: f1b9 0f00 cmp.w r9, #0
10cee6: bf18 it ne
10cee8: 464e movne r6, r9
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
10ceea: f8a4 802c strh.w r8, [r4, #44] ; 0x2c
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
10ceee: 8422 strh r2, [r4, #32]
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
10cef0: f007 fb56 bl 1145a0 <__divsi3>
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
10cef4: e9dd 2302 ldrd r2, r3, [sp, #8]
vol->data_cls = data_secs / vol->spc;
10cef8: 4659 mov r1, fp
10cefa: 6267 str r7, [r4, #36] ; 0x24
10cefc: 63a6 str r6, [r4, #56] ; 0x38
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
10cefe: fb07 2303 mla r3, r7, r3, r2
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
10cf02: 9a04 ldr r2, [sp, #16]
10cf04: fa00 f202 lsl.w r2, r0, r2
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
10cf08: 62a3 str r3, [r4, #40] ; 0x28
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
10cf0a: e9c4 020c strd r0, r2, [r4, #48] ; 0x30
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
10cf0e: 4418 add r0, r3
10cf10: 63e0 str r0, [r4, #60] ; 0x3c
vol->data_cls = data_secs / vol->spc;
10cf12: 1a30 subs r0, r6, r0
10cf14: f007 fa08 bl 114328 <__udivsi3>
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
10cf18: f640 73f4 movw r3, #4084 ; 0xff4
vol->data_cls = data_secs / vol->spc;
10cf1c: 6420 str r0, [r4, #64] ; 0x40
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
10cf1e: 4298 cmp r0, r3
10cf20: f240 8086 bls.w 10d030 <fat_init_volume_info+0x2e0>
if ( vol->data_cls < FAT_FAT16_MAX_CLN)
10cf24: f64f 73f4 movw r3, #65524 ; 0xfff4
10cf28: 4298 cmp r0, r3
10cf2a: f200 808a bhi.w 10d042 <fat_init_volume_info+0x2f2>
vol->type = FAT_FAT16;
10cf2e: 2102 movs r1, #2
vol->mask = FAT_FAT16_MASK;
10cf30: f64f 72ff movw r2, #65535 ; 0xffff
vol->eoc_val = FAT_FAT16_EOC;
10cf34: f64f 73f8 movw r3, #65528 ; 0xfff8
vol->type = FAT_FAT16;
10cf38: 75a1 strb r1, [r4, #22]
vol->eoc_val = FAT_FAT16_EOC;
10cf3a: e9c4 2306 strd r2, r3, [r4, #24]
}
}
}
else
{
vol->rdir_cl = 0;
10cf3e: 2300 movs r3, #0
vol->mirror = 0;
vol->afat = 0;
vol->free_cls = FAT_UNDEFINED_VALUE;
10cf40: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff
vol->rdir_cl = 0;
10cf44: 6463 str r3, [r4, #68] ; 0x44
vol->mirror = 0;
10cf46: f884 305c strb.w r3, [r4, #92] ; 0x5c
vol->afat = 0;
10cf4a: f884 3064 strb.w r3, [r4, #100] ; 0x64
vol->free_cls = FAT_UNDEFINED_VALUE;
10cf4e: 64e2 str r2, [r4, #76] ; 0x4c
vol->next_cl = FAT_UNDEFINED_VALUE;
10cf50: 6562 str r2, [r4, #84] ; 0x54
if (fs_info->c.state == FAT_CACHE_EMPTY)
10cf52: f894 309d ldrb.w r3, [r4, #157] ; 0x9d
10cf56: b113 cbz r3, 10cf5e <fat_init_volume_info+0x20e>
10cf58: 4620 mov r0, r4
10cf5a: f7ff fcc3 bl 10c8e4 <fat_buf_release.part.0>
}
_fat_block_release(fs_info);
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
10cf5e: 6a61 ldr r1, [r4, #36] ; 0x24
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
10cf60: 2002 movs r0, #2
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
10cf62: f894 2064 ldrb.w r2, [r4, #100] ; 0x64
10cf66: 8c23 ldrh r3, [r4, #32]
10cf68: fb01 3302 mla r3, r1, r2, r3
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
10cf6c: 210c movs r1, #12
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
10cf6e: 6623 str r3, [r4, #96] ; 0x60
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
10cf70: f7ff f8bc bl 10c0ec <calloc>
10cf74: f8c4 0080 str.w r0, [r4, #128] ; 0x80
if ( fs_info->vhash == NULL )
10cf78: 2800 cmp r0, #0
10cf7a: f000 80df beq.w 10d13c <fat_init_volume_info+0x3ec> <== ALWAYS TAKEN
return &the_chain->Tail.Node;
10cf7e: 1d03 adds r3, r0, #4
head->previous = NULL;
10cf80: 2600 movs r6, #0
10cf82: e9c0 3600 strd r3, r6, [r0]
return &the_chain->Tail.Node;
10cf86: f100 030c add.w r3, r0, #12
tail->previous = head;
10cf8a: 6143 str r3, [r0, #20]
return &the_chain->Tail.Node;
10cf8c: f100 0310 add.w r3, r0, #16
head->next = tail;
10cf90: 60c3 str r3, [r0, #12]
}
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));
10cf92: 210c movs r1, #12
tail->previous = head;
10cf94: 6080 str r0, [r0, #8]
head->previous = NULL;
10cf96: 6106 str r6, [r0, #16]
10cf98: 2002 movs r0, #2
10cf9a: f7ff f8a7 bl 10c0ec <calloc>
10cf9e: 4603 mov r3, r0
10cfa0: f8c4 0084 str.w r0, [r4, #132] ; 0x84
if ( fs_info->rhash == NULL )
10cfa4: 2800 cmp r0, #0
10cfa6: f000 80e9 beq.w 10d17c <fat_init_volume_info+0x42c> <== ALWAYS TAKEN
return &the_chain->Tail.Node;
10cfaa: 1d02 adds r2, r0, #4
}
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;
10cfac: 78e1 ldrb r1, [r4, #3]
head->next = tail;
10cfae: 6002 str r2, [r0, #0]
return &the_chain->Tail.Node;
10cfb0: f100 020c add.w r2, r0, #12
tail->previous = head;
10cfb4: 6142 str r2, [r0, #20]
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
10cfb6: f44f 7080 mov.w r0, #256 ; 0x100
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
10cfba: 6ba2 ldr r2, [r4, #56] ; 0x38
fs_info->index = 0;
10cfbc: f8c4 608c str.w r6, [r4, #140] ; 0x8c
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
10cfc0: f8c4 0090 str.w r0, [r4, #144] ; 0x90
head->previous = NULL;
10cfc4: 605e str r6, [r3, #4]
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
10cfc6: 408a lsls r2, r1
10cfc8: 611e str r6, [r3, #16]
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
10cfca: 2101 movs r1, #1
tail->previous = head;
10cfcc: 609b str r3, [r3, #8]
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
10cfce: 0112 lsls r2, r2, #4
10cfd0: f8c4 2094 str.w r2, [r4, #148] ; 0x94
return &the_chain->Tail.Node;
10cfd4: f103 0210 add.w r2, r3, #16
head->next = tail;
10cfd8: 60da str r2, [r3, #12]
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
10cfda: f7ff f887 bl 10c0ec <calloc>
10cfde: f8c4 0088 str.w r0, [r4, #136] ; 0x88
if ( fs_info->uino == NULL )
10cfe2: 2800 cmp r0, #0
10cfe4: f000 80d8 beq.w 10d198 <fat_init_volume_info+0x448> <== ALWAYS 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));
10cfe8: 8820 ldrh r0, [r4, #0]
10cfea: 2101 movs r1, #1
10cfec: f7ff f87e bl 10c0ec <calloc>
10cff0: f8c4 00a4 str.w r0, [r4, #164] ; 0xa4
if (fs_info->sec_buf == NULL)
10cff4: 2800 cmp r0, #0
10cff6: f000 80ab beq.w 10d150 <fat_init_volume_info+0x400> <== ALWAYS TAKEN
return (sec_num & (vol->spc - 1)) == 0;
10cffa: 7923 ldrb r3, [r4, #4]
10cffc: 6be2 ldr r2, [r4, #60] ; 0x3c
10cffe: 3b01 subs r3, #1
/*
* 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)
10d000: 4213 tst r3, r2
10d002: d111 bne.n 10d028 <fat_init_volume_info+0x2d8> <== ALWAYS TAKEN
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
10d004: 7da2 ldrb r2, [r4, #22]
10d006: 2a04 cmp r2, #4
10d008: d002 beq.n 10d010 <fat_init_volume_info+0x2c0>
return (sec_num & (vol->spc - 1)) == 0;
10d00a: 6aa2 ldr r2, [r4, #40] ; 0x28
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
10d00c: 4213 tst r3, r2
10d00e: d10b bne.n 10d028 <fat_init_volume_info+0x2d8> <== ALWAYS TAKEN
{
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true);
10d010: 68a1 ldr r1, [r4, #8]
10d012: 2201 movs r2, #1
10d014: 6ee0 ldr r0, [r4, #108] ; 0x6c
10d016: f005 f995 bl 112344 <rtems_bdbuf_set_block_size>
if (sc == RTEMS_SUCCESSFUL)
10d01a: b928 cbnz r0, 10d028 <fat_init_volume_info+0x2d8>
{
vol->bytes_per_block = vol->bpc;
10d01c: 68a1 ldr r1, [r4, #8]
vol->bytes_per_block_log2 = vol->bpc_log2;
10d01e: 7b22 ldrb r2, [r4, #12]
vol->sectors_per_block = vol->spc;
10d020: 7923 ldrb r3, [r4, #4]
vol->bytes_per_block = vol->bpc;
10d022: 6121 str r1, [r4, #16]
vol->bytes_per_block_log2 = vol->bpc_log2;
10d024: 7522 strb r2, [r4, #20]
vol->sectors_per_block = vol->spc;
10d026: 7363 strb r3, [r4, #13]
}
}
return RC_OK;
}
10d028: 4628 mov r0, r5
10d02a: b027 add sp, #156 ; 0x9c
10d02c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
vol->type = FAT_FAT12;
10d030: 2101 movs r1, #1
vol->mask = FAT_FAT12_MASK;
10d032: f640 72ff movw r2, #4095 ; 0xfff
vol->eoc_val = FAT_FAT12_EOC;
10d036: f640 73f8 movw r3, #4088 ; 0xff8
vol->type = FAT_FAT12;
10d03a: 75a1 strb r1, [r4, #22]
vol->eoc_val = FAT_FAT12_EOC;
10d03c: e9c4 2306 strd r2, r3, [r4, #24]
10d040: e77d b.n 10cf3e <fat_init_volume_info+0x1ee>
else if ( vol->data_cls < FAT_FAT32_MASK - 1 )
10d042: f64f 73fd movw r3, #65533 ; 0xfffd
10d046: f6c0 73ff movt r3, #4095 ; 0xfff
10d04a: 4298 cmp r0, r3
10d04c: d84f bhi.n 10d0ee <fat_init_volume_info+0x39e> <== ALWAYS TAKEN
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
10d04e: 9b07 ldr r3, [sp, #28]
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
10d050: 9a06 ldr r2, [sp, #24]
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
10d052: 6463 str r3, [r4, #68] ; 0x44
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
10d054: f022 037f bic.w r3, r2, #127 ; 0x7f
10d058: f884 305c strb.w r3, [r4, #92] ; 0x5c
vol->eoc_val = FAT_FAT32_EOC;
10d05c: f64f 73f8 movw r3, #65528 ; 0xfff8
10d060: f6c0 73ff movt r3, #4095 ; 0xfff
10d064: 61e3 str r3, [r4, #28]
vol->type = FAT_FAT32;
10d066: 2304 movs r3, #4
10d068: 75a3 strb r3, [r4, #22]
vol->mask = FAT_FAT32_MASK;
10d06a: f06f 4370 mvn.w r3, #4026531840 ; 0xf0000000
10d06e: 61a3 str r3, [r4, #24]
if (vol->mirror)
10d070: 0613 lsls r3, r2, #24
vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM;
10d072: bf4a itet mi
10d074: 9b06 ldrmi r3, [sp, #24]
vol->afat = 0;
10d076: 2300 movpl r3, #0
vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM;
10d078: f003 030f andmi.w r3, r3, #15
10d07c: f884 3064 strb.w r3, [r4, #100] ; 0x64
vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec);
10d080: 9b05 ldr r3, [sp, #20]
10d082: f8a4 3048 strh.w r3, [r4, #72] ; 0x48
if( vol->info_sec == 0 )
10d086: b393 cbz r3, 10d0ee <fat_init_volume_info+0x39e>
ret = _fat_block_read(fs_info, vol->info_sec , 0,
10d088: ae09 add r6, sp, #36 ; 0x24
10d08a: 9905 ldr r1, [sp, #20]
10d08c: 2304 movs r3, #4
10d08e: 2200 movs r2, #0
10d090: 4620 mov r0, r4
10d092: 9600 str r6, [sp, #0]
10d094: f7ff fcf8 bl 10ca88 <_fat_block_read>
if ( ret < 0 )
10d098: 2800 cmp r0, #0
10d09a: db49 blt.n 10d130 <fat_init_volume_info+0x3e0> <== ALWAYS TAKEN
if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) !=
10d09c: 9a09 ldr r2, [sp, #36] ; 0x24
10d09e: f245 2352 movw r3, #21074 ; 0x5252
10d0a2: f2c4 1361 movt r3, #16737 ; 0x4161
10d0a6: 429a cmp r2, r3
10d0a8: d11b bne.n 10d0e2 <fat_init_volume_info+0x392> <== ALWAYS TAKEN
ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO,
10d0aa: f8b4 1048 ldrh.w r1, [r4, #72] ; 0x48
10d0ae: 230c movs r3, #12
10d0b0: f44f 72f2 mov.w r2, #484 ; 0x1e4
10d0b4: 4620 mov r0, r4
10d0b6: 9600 str r6, [sp, #0]
10d0b8: f7ff fce6 bl 10ca88 <_fat_block_read>
if ( ret < 0 )
10d0bc: 2800 cmp r0, #0
10d0be: db31 blt.n 10d124 <fat_init_volume_info+0x3d4> <== ALWAYS TAKEN
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
10d0c0: e9dd 230a ldrd r2, r3, [sp, #40] ; 0x28
vol->free_cls = vol->free_cls_in_fs_info;
10d0c4: e9c4 2213 strd r2, r2, [r4, #76] ; 0x4c
vol->next_cl = vol->next_cl_in_fs_info;
10d0c8: e9c4 3315 strd r3, r3, [r4, #84] ; 0x54
10d0cc: e741 b.n 10cf52 <fat_init_volume_info+0x202>
close(vol->fd);
10d0ce: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
10d0d0: f7f8 fa06 bl 1054e0 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
10d0d4: f007 fdd4 bl 114c80 <__errno> <== NOT EXECUTED
10d0d8: 2306 movs r3, #6 <== NOT EXECUTED
10d0da: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
10d0de: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d0e0: e7a2 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
if (fs_info->c.state == FAT_CACHE_EMPTY)
10d0e2: f894 309d ldrb.w r3, [r4, #157] ; 0x9d <== NOT EXECUTED
10d0e6: b113 cbz r3, 10d0ee <fat_init_volume_info+0x39e> <== NOT EXECUTED
10d0e8: 4620 mov r0, r4 <== NOT EXECUTED
10d0ea: f7ff fbfb bl 10c8e4 <fat_buf_release.part.0> <== NOT EXECUTED
close(vol->fd);
10d0ee: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
10d0f0: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d0f4: f7f8 f9f4 bl 1054e0 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
10d0f8: f007 fdc2 bl 114c80 <__errno> <== NOT EXECUTED
10d0fc: 2316 movs r3, #22 <== NOT EXECUTED
10d0fe: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d100: e792 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
close(vol->fd);
10d102: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
10d104: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d108: f7f8 f9ea bl 1054e0 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
10d10c: f007 fdb8 bl 114c80 <__errno> <== NOT EXECUTED
10d110: 2305 movs r3, #5 <== NOT EXECUTED
10d112: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d114: e788 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
10d116: f007 fdb3 bl 114c80 <__errno> <== NOT EXECUTED
10d11a: 2306 movs r3, #6 <== NOT EXECUTED
10d11c: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
10d120: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d122: e781 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
if (fs_info->c.state == FAT_CACHE_EMPTY)
10d124: f894 309d ldrb.w r3, [r4, #157] ; 0x9d <== NOT EXECUTED
10d128: b113 cbz r3, 10d130 <fat_init_volume_info+0x3e0> <== NOT EXECUTED
10d12a: 4620 mov r0, r4 <== NOT EXECUTED
10d12c: f7ff fbda bl 10c8e4 <fat_buf_release.part.0> <== NOT EXECUTED
close(vol->fd);
10d130: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
return -1;
10d132: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d136: f7f8 f9d3 bl 1054e0 <close> <== NOT EXECUTED
return -1;
10d13a: e775 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
close(vol->fd);
10d13c: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d13e: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d142: f7f8 f9cd bl 1054e0 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d146: f007 fd9b bl 114c80 <__errno> <== NOT EXECUTED
10d14a: 230c movs r3, #12 <== NOT EXECUTED
10d14c: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d14e: e76b b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
close(vol->fd);
10d150: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d152: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d156: f7f8 f9c3 bl 1054e0 <close> <== NOT EXECUTED
free(fs_info->vhash);
10d15a: f8d4 0080 ldr.w r0, [r4, #128] ; 0x80 <== NOT EXECUTED
10d15e: f7f8 fa41 bl 1055e4 <free> <== NOT EXECUTED
free(fs_info->rhash);
10d162: f8d4 0084 ldr.w r0, [r4, #132] ; 0x84 <== NOT EXECUTED
10d166: f7f8 fa3d bl 1055e4 <free> <== NOT EXECUTED
free(fs_info->uino);
10d16a: f8d4 0088 ldr.w r0, [r4, #136] ; 0x88 <== NOT EXECUTED
10d16e: f7f8 fa39 bl 1055e4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d172: f007 fd85 bl 114c80 <__errno> <== NOT EXECUTED
10d176: 230c movs r3, #12 <== NOT EXECUTED
10d178: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d17a: e755 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
close(vol->fd);
10d17c: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d17e: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d182: f7f8 f9ad bl 1054e0 <close> <== NOT EXECUTED
free(fs_info->vhash);
10d186: f8d4 0080 ldr.w r0, [r4, #128] ; 0x80 <== NOT EXECUTED
10d18a: f7f8 fa2b bl 1055e4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d18e: f007 fd77 bl 114c80 <__errno> <== NOT EXECUTED
10d192: 230c movs r3, #12 <== NOT EXECUTED
10d194: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d196: e747 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
close(vol->fd);
10d198: 6ea0 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d19a: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
close(vol->fd);
10d19e: f7f8 f99f bl 1054e0 <close> <== NOT EXECUTED
free(fs_info->vhash);
10d1a2: f8d4 0080 ldr.w r0, [r4, #128] ; 0x80 <== NOT EXECUTED
10d1a6: f7f8 fa1d bl 1055e4 <free> <== NOT EXECUTED
free(fs_info->rhash);
10d1aa: f8d4 0084 ldr.w r0, [r4, #132] ; 0x84 <== NOT EXECUTED
10d1ae: f7f8 fa19 bl 1055e4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
10d1b2: f007 fd65 bl 114c80 <__errno> <== NOT EXECUTED
10d1b6: 230c movs r3, #12 <== NOT EXECUTED
10d1b8: 6003 str r3, [r0, #0] <== NOT EXECUTED
10d1ba: e735 b.n 10d028 <fat_init_volume_info+0x2d8> <== NOT EXECUTED
0010d700 <fat_scan_fat_for_free_clusters>:
{
10d700: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10d704: b087 sub sp, #28
10d706: 461f mov r7, r3
10d708: f89d 3044 ldrb.w r3, [sp, #68] ; 0x44
*cls_added = 0;
10d70c: f04f 0900 mov.w r9, #0
while (*cls_added != count && i < data_cls_val)
10d710: 4692 mov sl, r2
if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls)
10d712: 6d44 ldr r4, [r0, #84] ; 0x54
{
10d714: 4606 mov r6, r0
10d716: e9cd 3102 strd r3, r1, [sp, #8]
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
10d71a: 6c03 ldr r3, [r0, #64] ; 0x40
if (fs_info->vol.next_cl - 2 < fs_info->vol.data_cls)
10d71c: 1ea2 subs r2, r4, #2
*cls_added = 0;
10d71e: f8c7 9000 str.w r9, [r7]
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
10d722: f103 0802 add.w r8, r3, #2
uint32_t cl4find = 2;
10d726: 4293 cmp r3, r2
10d728: bf98 it ls
10d72a: 2402 movls r4, #2
while (*cls_added != count && i < data_cls_val)
10d72c: 45ca cmp sl, r9
10d72e: bf18 it ne
10d730: f1b8 0f02 cmpne.w r8, #2
10d734: d95b bls.n 10d7ee <fat_scan_fat_for_free_clusters+0xee> <== ALWAYS TAKEN
uint32_t i = 2;
10d736: 2502 movs r5, #2
uint32_t save_cln = FAT_UNDEFINED_VALUE;
10d738: f04f 3bff mov.w fp, #4294967295 ; 0xffffffff
10d73c: e017 b.n 10d76e <fat_scan_fat_for_free_clusters+0x6e>
*chain = cl4find;
10d73e: 9b03 ldr r3, [sp, #12]
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
10d740: 4621 mov r1, r4
10d742: 4630 mov r0, r6
*chain = cl4find;
10d744: 601c str r4, [r3, #0]
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
10d746: f7ff fee3 bl 10d510 <fat_set_fat_cluster>
if ( rc != RC_OK )
10d74a: 2800 cmp r0, #0
10d74c: d177 bne.n 10d83e <fat_scan_fat_for_free_clusters+0x13e> <== ALWAYS TAKEN
if (zero_fill)
10d74e: 9b02 ldr r3, [sp, #8]
10d750: 2b00 cmp r3, #0
10d752: d13e bne.n 10d7d2 <fat_scan_fat_for_free_clusters+0xd2>
(*cls_added)++;
10d754: 683b ldr r3, [r7, #0]
10d756: 46a3 mov fp, r4
10d758: 3301 adds r3, #1
10d75a: 603b str r3, [r7, #0]
cl4find++;
10d75c: 3401 adds r4, #1
i++;
10d75e: 3501 adds r5, #1
cl4find = 2;
10d760: 45a0 cmp r8, r4
10d762: bf98 it ls
10d764: 2402 movls r4, #2
while (*cls_added != count && i < data_cls_val)
10d766: 459a cmp sl, r3
10d768: bf18 it ne
10d76a: 45a8 cmpne r8, r5
10d76c: d941 bls.n 10d7f2 <fat_scan_fat_for_free_clusters+0xf2>
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
10d76e: aa05 add r2, sp, #20
10d770: 4621 mov r1, r4
10d772: 4630 mov r0, r6
uint32_t next_cln = 0;
10d774: f8cd 9014 str.w r9, [sp, #20]
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
10d778: f7ff fe54 bl 10d424 <fat_get_fat_cluster>
if ( rc != RC_OK )
10d77c: 2800 cmp r0, #0
10d77e: d14d bne.n 10d81c <fat_scan_fat_for_free_clusters+0x11c> <== ALWAYS TAKEN
if (next_cln == FAT_GENFAT_FREE)
10d780: 9a05 ldr r2, [sp, #20]
if (*cls_added != 0)
10d782: 683b ldr r3, [r7, #0]
if (next_cln == FAT_GENFAT_FREE)
10d784: 2a00 cmp r2, #0
10d786: d1e9 bne.n 10d75c <fat_scan_fat_for_free_clusters+0x5c>
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
10d788: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff
if (*cls_added == 0)
10d78c: 2b00 cmp r3, #0
10d78e: d0d6 beq.n 10d73e <fat_scan_fat_for_free_clusters+0x3e>
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
10d790: 4621 mov r1, r4
10d792: 4630 mov r0, r6
10d794: f7ff febc bl 10d510 <fat_set_fat_cluster>
if ( rc != RC_OK )
10d798: 2800 cmp r0, #0
10d79a: d14e bne.n 10d83a <fat_scan_fat_for_free_clusters+0x13a> <== ALWAYS TAKEN
rc = fat_set_fat_cluster(fs_info, save_cln, cl4find);
10d79c: 4659 mov r1, fp
10d79e: 4622 mov r2, r4
10d7a0: 4630 mov r0, r6
10d7a2: f7ff feb5 bl 10d510 <fat_set_fat_cluster>
if ( rc != RC_OK )
10d7a6: 2800 cmp r0, #0
10d7a8: d0d1 beq.n 10d74e <fat_scan_fat_for_free_clusters+0x4e> <== NEVER TAKEN
10d7aa: 4603 mov r3, r0 <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
10d7ac: 9302 str r3, [sp, #8] <== NOT EXECUTED
10d7ae: 4630 mov r0, r6 <== NOT EXECUTED
10d7b0: 9b03 ldr r3, [sp, #12] <== NOT EXECUTED
10d7b2: 6819 ldr r1, [r3, #0] <== NOT EXECUTED
10d7b4: f7ff ff64 bl 10d680 <fat_free_fat_clusters_chain> <== NOT EXECUTED
(void) fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE);
10d7b8: 2200 movs r2, #0 <== NOT EXECUTED
10d7ba: 4621 mov r1, r4 <== NOT EXECUTED
10d7bc: 4630 mov r0, r6 <== NOT EXECUTED
10d7be: f7ff fea7 bl 10d510 <fat_set_fat_cluster> <== NOT EXECUTED
fat_buf_release(fs_info);
10d7c2: 4630 mov r0, r6 <== NOT EXECUTED
10d7c4: f7ff f958 bl 10ca78 <fat_buf_release> <== NOT EXECUTED
return rc;
10d7c8: 9b02 ldr r3, [sp, #8] <== NOT EXECUTED
}
10d7ca: 4618 mov r0, r3 <== NOT EXECUTED
10d7cc: b007 add sp, #28 <== NOT EXECUTED
10d7ce: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
fat_cluster_set(fs_info, cl4find, 0, fs_info->vol.bpc, 0);
10d7d2: f8cd 9000 str.w r9, [sp]
10d7d6: 2200 movs r2, #0
10d7d8: 68b3 ldr r3, [r6, #8]
10d7da: 4621 mov r1, r4
10d7dc: 4630 mov r0, r6
10d7de: f7ff f9df bl 10cba0 <fat_cluster_set>
if (fs_info->vol.bpc != bytes_written)
10d7e2: 68b3 ldr r3, [r6, #8]
10d7e4: 4283 cmp r3, r0
10d7e6: d0b5 beq.n 10d754 <fat_scan_fat_for_free_clusters+0x54> <== NEVER TAKEN
rc = -1;
10d7e8: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff <== NOT EXECUTED
10d7ec: e7de b.n 10d7ac <fat_scan_fat_for_free_clusters+0xac> <== NOT EXECUTED
uint32_t save_cln = FAT_UNDEFINED_VALUE;
10d7ee: f04f 3bff mov.w fp, #4294967295 ; 0xffffffff <== NOT EXECUTED
*last_cl = save_cln;
10d7f2: 9b10 ldr r3, [sp, #64] ; 0x40
fat_buf_release(fs_info);
10d7f4: 4630 mov r0, r6
*last_cl = save_cln;
10d7f6: f8c3 b000 str.w fp, [r3]
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
10d7fa: 6cf3 ldr r3, [r6, #76] ; 0x4c
fs_info->vol.next_cl = save_cln;
10d7fc: f8c6 b054 str.w fp, [r6, #84] ; 0x54
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
10d800: 1c5a adds r2, r3, #1
fs_info->vol.free_cls -= (*cls_added);
10d802: bf1e ittt ne
10d804: 683a ldrne r2, [r7, #0]
10d806: 1a9b subne r3, r3, r2
10d808: 64f3 strne r3, [r6, #76] ; 0x4c
return RC_OK;
10d80a: 2300 movs r3, #0
10d80c: 9302 str r3, [sp, #8]
fat_buf_release(fs_info);
10d80e: f7ff f933 bl 10ca78 <fat_buf_release>
return RC_OK;
10d812: 9b02 ldr r3, [sp, #8]
}
10d814: 4618 mov r0, r3
10d816: b007 add sp, #28
10d818: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if (*cls_added != 0)
10d81c: 683a ldr r2, [r7, #0] <== NOT EXECUTED
10d81e: 4603 mov r3, r0 <== NOT EXECUTED
10d820: 2a00 cmp r2, #0 <== NOT EXECUTED
10d822: d0f7 beq.n 10d814 <fat_scan_fat_for_free_clusters+0x114> <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
10d824: 9302 str r3, [sp, #8] <== NOT EXECUTED
10d826: 4630 mov r0, r6 <== NOT EXECUTED
10d828: 9b03 ldr r3, [sp, #12] <== NOT EXECUTED
10d82a: 6819 ldr r1, [r3, #0] <== NOT EXECUTED
10d82c: f7ff ff28 bl 10d680 <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
10d830: 9b02 ldr r3, [sp, #8] <== NOT EXECUTED
}
10d832: 4618 mov r0, r3 <== NOT EXECUTED
10d834: b007 add sp, #28 <== NOT EXECUTED
10d836: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
10d83a: 4603 mov r3, r0 <== NOT EXECUTED
10d83c: e7f2 b.n 10d824 <fat_scan_fat_for_free_clusters+0x124> <== NOT EXECUTED
10d83e: 4603 mov r3, r0 <== NOT EXECUTED
10d840: e7e8 b.n 10d814 <fat_scan_fat_for_free_clusters+0x114> <== NOT EXECUTED
10d842: bf00 nop
0010cb30 <fat_sector_write>:
fat_fs_info_t *fs_info,
uint32_t start,
uint32_t offset,
uint32_t count,
const void *buff)
{
10cb30: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10cb34: b083 sub sp, #12
10cb36: f8dd a030 ldr.w sl, [sp, #48] ; 0x30
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
10cb3a: 461d mov r5, r3
10cb3c: b373 cbz r3, 10cb9c <fat_sector_write+0x6c>
10cb3e: 4606 mov r6, r0
10cb40: 460f mov r7, r1
10cb42: 4691 mov r9, r2
ssize_t cmpltd = 0;
10cb44: f04f 0800 mov.w r8, #0
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);
10cb48: f04f 0b01 mov.w fp, #1
10cb4c: e008 b.n 10cb60 <fat_sector_write+0x30>
if (rc != RC_OK)
return -1;
memcpy((sec_buf + ofs), (buff + cmpltd), c);
10cb4e: 9801 ldr r0, [sp, #4]
10cb50: 4448 add r0, r9
fat_buf_mark_modified(fs_info);
count -= c;
cmpltd +=c;
sec_num++;
ofs = 0;
10cb52: 4699 mov r9, r3
memcpy((sec_buf + ofs), (buff + cmpltd), c);
10cb54: f008 eb54 blx 115200 <memcpy>
while(count > 0)
10cb58: 1b2d subs r5, r5, r4
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
10cb5a: f886 b09c strb.w fp, [r6, #156] ; 0x9c
10cb5e: d019 beq.n 10cb94 <fat_sector_write+0x64> <== NEVER TAKEN
c = MIN(count, (fs_info->vol.bps - ofs));
10cb60: 8834 ldrh r4, [r6, #0]
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
10cb62: 4639 mov r1, r7
if (c == fs_info->vol.bytes_per_block)
10cb64: 6932 ldr r2, [r6, #16]
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
10cb66: ab01 add r3, sp, #4
10cb68: 4630 mov r0, r6
sec_num++;
10cb6a: 3701 adds r7, #1
c = MIN(count, (fs_info->vol.bps - ofs));
10cb6c: eba4 0409 sub.w r4, r4, r9
10cb70: 42ac cmp r4, r5
10cb72: bf28 it cs
10cb74: 462c movcs r4, r5
if (c == fs_info->vol.bytes_per_block)
10cb76: 42a2 cmp r2, r4
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
10cb78: bf0c ite eq
10cb7a: 2202 moveq r2, #2
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
10cb7c: 2201 movne r2, #1
10cb7e: f7ff ff3b bl 10c9f8 <fat_buf_access>
memcpy((sec_buf + ofs), (buff + cmpltd), c);
10cb82: eb0a 0108 add.w r1, sl, r8
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
10cb86: 4603 mov r3, r0
memcpy((sec_buf + ofs), (buff + cmpltd), c);
10cb88: 4622 mov r2, r4
cmpltd +=c;
10cb8a: 44a0 add r8, r4
if (rc != RC_OK)
10cb8c: 2800 cmp r0, #0
10cb8e: d0de beq.n 10cb4e <fat_sector_write+0x1e> <== NEVER TAKEN
return -1;
10cb90: f04f 38ff mov.w r8, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
return cmpltd;
}
10cb94: 4640 mov r0, r8
10cb96: b003 add sp, #12
10cb98: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
ssize_t cmpltd = 0;
10cb9c: 4698 mov r8, r3 <== NOT EXECUTED
10cb9e: e7f9 b.n 10cb94 <fat_sector_write+0x64> <== NOT EXECUTED
0010d510 <fat_set_fat_cluster>:
uint16_t fat16_clv = 0;
uint32_t fat32_clv = 0;
uint8_t *sec_buf = NULL;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
10d510: 2901 cmp r1, #1
{
10d512: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
uint8_t *sec_buf = NULL;
10d516: f04f 0300 mov.w r3, #0
{
10d51a: b083 sub sp, #12
uint8_t *sec_buf = NULL;
10d51c: 9301 str r3, [sp, #4]
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
10d51e: f240 80a7 bls.w 10d670 <fat_set_fat_cluster+0x160> <== ALWAYS TAKEN
10d522: 6c03 ldr r3, [r0, #64] ; 0x40
10d524: 460d mov r5, r1
10d526: 4604 mov r4, r0
10d528: 3301 adds r3, #1
10d52a: 428b cmp r3, r1
10d52c: f0c0 80a0 bcc.w 10d670 <fat_set_fat_cluster+0x160> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
10d530: 4616 mov r6, r2
10d532: 7d82 ldrb r2, [r0, #22]
fs_info->vol.afat_loc;
10d534: 6e01 ldr r1, [r0, #96] ; 0x60
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
10d536: 7883 ldrb r3, [r0, #2]
10d538: 07d7 lsls r7, r2, #31
10d53a: d424 bmi.n 10d586 <fat_set_fat_cluster+0x76>
10d53c: 0790 lsls r0, r2, #30
10d53e: bf4c ite mi
10d540: 006f lslmi r7, r5, #1
10d542: 00af lslpl r7, r5, #2
10d544: fa27 f303 lsr.w r3, r7, r3
10d548: eb03 0901 add.w r9, r3, r1
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);
10d54c: 2201 movs r2, #1
10d54e: ab01 add r3, sp, #4
10d550: 4649 mov r1, r9
10d552: 4620 mov r0, r4
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
10d554: f8b4 8000 ldrh.w r8, [r4]
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
10d558: f7ff fa4e bl 10c9f8 <fat_buf_access>
if (rc != RC_OK)
10d55c: b980 cbnz r0, 10d580 <fat_set_fat_cluster+0x70>
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
10d55e: f108 33ff add.w r3, r8, #4294967295 ; 0xffffffff
10d562: 403b ands r3, r7
return rc;
switch ( fs_info->vol.type )
10d564: 7da7 ldrb r7, [r4, #22]
10d566: 2f02 cmp r7, #2
10d568: d014 beq.n 10d594 <fat_set_fat_cluster+0x84>
10d56a: 2f04 cmp r7, #4
10d56c: d037 beq.n 10d5de <fat_set_fat_cluster+0xce>
10d56e: 2f01 cmp r7, #1
10d570: d018 beq.n 10d5a4 <fat_set_fat_cluster+0x94> <== NEVER TAKEN
fat_buf_mark_modified(fs_info);
break;
default:
rtems_set_errno_and_return_minus_one(EIO);
10d572: f007 fb85 bl 114c80 <__errno> <== NOT EXECUTED
10d576: 4603 mov r3, r0 <== NOT EXECUTED
10d578: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10d57c: 2205 movs r2, #5 <== NOT EXECUTED
10d57e: 601a str r2, [r3, #0] <== NOT EXECUTED
break;
}
return RC_OK;
}
10d580: b003 add sp, #12
10d582: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
10d586: eb05 0755 add.w r7, r5, r5, lsr #1
10d58a: fa27 f303 lsr.w r3, r7, r3
10d58e: eb03 0901 add.w r9, r3, r1
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
10d592: e7db b.n 10d54c <fat_set_fat_cluster+0x3c>
*((uint16_t *)(sec_buf + ofs)) =
10d594: 9a01 ldr r2, [sp, #4]
(uint16_t )(CT_LE_W(in_val));
10d596: 52d6 strh r6, [r2, r3]
fs_info->c.modified = true;
10d598: 2301 movs r3, #1
10d59a: f884 309c strb.w r3, [r4, #156] ; 0x9c
}
10d59e: b003 add sp, #12
10d5a0: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
if ( FAT_CLUSTER_IS_ODD(cln) )
10d5a4: 07e9 lsls r1, r5, #31
*(sec_buf + ofs) &= 0x0F;
10d5a6: 9a01 ldr r2, [sp, #4]
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
10d5a8: b2b6 uxth r6, r6
if ( FAT_CLUSTER_IS_ODD(cln) )
10d5aa: d526 bpl.n 10d5fa <fat_set_fat_cluster+0xea>
*(sec_buf + ofs) &= 0x0F;
10d5ac: 5cd1 ldrb r1, [r2, r3]
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
10d5ae: 0136 lsls r6, r6, #4
10d5b0: b2b6 uxth r6, r6
*(sec_buf + ofs) &= 0x0F;
10d5b2: f001 010f and.w r1, r1, #15
10d5b6: 54d1 strb r1, [r2, r3]
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0);
10d5b8: 9901 ldr r1, [sp, #4]
10d5ba: 5cca ldrb r2, [r1, r3]
10d5bc: 4332 orrs r2, r6
10d5be: 54ca strb r2, [r1, r3]
if ( ofs == (fs_info->vol.bps - 1) )
10d5c0: 8822 ldrh r2, [r4, #0]
10d5c2: f884 709c strb.w r7, [r4, #156] ; 0x9c
10d5c6: 3a01 subs r2, #1
10d5c8: 429a cmp r2, r3
10d5ca: d02f beq.n 10d62c <fat_set_fat_cluster+0x11c>
*(sec_buf + ofs + 1) &= 0x00;
10d5cc: 9a01 ldr r2, [sp, #4]
10d5ce: 3301 adds r3, #1
10d5d0: 54d0 strb r0, [r2, r3]
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
10d5d2: 9901 ldr r1, [sp, #4]
10d5d4: 5cca ldrb r2, [r1, r3]
10d5d6: ea42 2616 orr.w r6, r2, r6, lsr #8
10d5da: 54ce strb r6, [r1, r3]
10d5dc: e7d0 b.n 10d580 <fat_set_fat_cluster+0x70>
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
10d5de: 9901 ldr r1, [sp, #4]
fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK));
10d5e0: f026 4670 bic.w r6, r6, #4026531840 ; 0xf0000000
10d5e4: 2501 movs r5, #1
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
10d5e6: 58ca ldr r2, [r1, r3]
10d5e8: f002 4270 and.w r2, r2, #4026531840 ; 0xf0000000
*((uint32_t *)(sec_buf + ofs)) |= fat32_clv;
10d5ec: 4316 orrs r6, r2
10d5ee: 50ce str r6, [r1, r3]
10d5f0: f884 509c strb.w r5, [r4, #156] ; 0x9c
}
10d5f4: b003 add sp, #12
10d5f6: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
*(sec_buf + ofs) &= 0x00;
10d5fa: 54d0 strb r0, [r2, r3]
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
10d5fc: f3c6 060b ubfx r6, r6, #0, #12
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
10d600: 9901 ldr r1, [sp, #4]
10d602: 5cca ldrb r2, [r1, r3]
10d604: 4332 orrs r2, r6
10d606: 54ca strb r2, [r1, r3]
if ( ofs == (fs_info->vol.bps - 1) )
10d608: 8822 ldrh r2, [r4, #0]
10d60a: f884 709c strb.w r7, [r4, #156] ; 0x9c
10d60e: 3a01 subs r2, #1
10d610: 429a cmp r2, r3
10d612: d01e beq.n 10d652 <fat_set_fat_cluster+0x142> <== ALWAYS TAKEN
*(sec_buf + ofs + 1) &= 0xF0;
10d614: 9901 ldr r1, [sp, #4]
10d616: 3301 adds r3, #1
10d618: 5cca ldrb r2, [r1, r3]
10d61a: f022 020f bic.w r2, r2, #15
10d61e: 54ca strb r2, [r1, r3]
*(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8);
10d620: 9901 ldr r1, [sp, #4]
10d622: 5cca ldrb r2, [r1, r3]
10d624: ea42 2616 orr.w r6, r2, r6, lsr #8
10d628: 54ce strb r6, [r1, r3]
10d62a: e7a9 b.n 10d580 <fat_set_fat_cluster+0x70>
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
10d62c: ab01 add r3, sp, #4
10d62e: f109 0101 add.w r1, r9, #1
10d632: 463a mov r2, r7
10d634: 4620 mov r0, r4
10d636: f7ff f9df bl 10c9f8 <fat_buf_access>
if (rc != RC_OK)
10d63a: 2800 cmp r0, #0
10d63c: d1a0 bne.n 10d580 <fat_set_fat_cluster+0x70> <== ALWAYS TAKEN
*sec_buf &= 0x00;
10d63e: 9b01 ldr r3, [sp, #4]
10d640: 7018 strb r0, [r3, #0]
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
10d642: 9a01 ldr r2, [sp, #4]
10d644: 7813 ldrb r3, [r2, #0]
10d646: ea43 2616 orr.w r6, r3, r6, lsr #8
10d64a: 7016 strb r6, [r2, #0]
10d64c: f884 709c strb.w r7, [r4, #156] ; 0x9c
}
10d650: e796 b.n 10d580 <fat_set_fat_cluster+0x70>
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
10d652: ab01 add r3, sp, #4 <== NOT EXECUTED
10d654: f109 0101 add.w r1, r9, #1 <== NOT EXECUTED
10d658: 463a mov r2, r7 <== NOT EXECUTED
10d65a: 4620 mov r0, r4 <== NOT EXECUTED
10d65c: f7ff f9cc bl 10c9f8 <fat_buf_access> <== NOT EXECUTED
if (rc != RC_OK)
10d660: 2800 cmp r0, #0 <== NOT EXECUTED
10d662: d18d bne.n 10d580 <fat_set_fat_cluster+0x70> <== NOT EXECUTED
*sec_buf &= 0xF0;
10d664: 9a01 ldr r2, [sp, #4] <== NOT EXECUTED
10d666: 7813 ldrb r3, [r2, #0] <== NOT EXECUTED
10d668: f023 030f bic.w r3, r3, #15 <== NOT EXECUTED
10d66c: 7013 strb r3, [r2, #0] <== NOT EXECUTED
10d66e: e7e8 b.n 10d642 <fat_set_fat_cluster+0x132> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
10d670: f007 fb06 bl 114c80 <__errno> <== NOT EXECUTED
10d674: 2205 movs r2, #5 <== NOT EXECUTED
10d676: 4603 mov r3, r0 <== NOT EXECUTED
10d678: 601a str r2, [r3, #0] <== NOT EXECUTED
10d67a: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10d67e: e77f b.n 10d580 <fat_set_fat_cluster+0x70> <== NOT EXECUTED
0010d23c <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)
{
10d23c: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr}
10d240: 4605 mov r5, r0
int rc = RC_OK;
int i = 0;
rc = fat_sync(fs_info);
10d242: f7ff ffbb bl 10d1bc <fat_sync>
if ( rc != RC_OK )
10d246: 1e07 subs r7, r0, #0
10d248: 4606 mov r6, r0
rc = -1;
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->vhash + i;
10d24a: f8d5 4080 ldr.w r4, [r5, #128] ; 0x80
if ( rc != RC_OK )
10d24e: bf18 it ne
10d250: 2701 movne r7, #1
10d252: 427f negs r7, r7
return _Chain_Immutable_head( the_chain )->next;
10d254: 46a0 mov r8, r4
10d256: f858 0b04 ldr.w r0, [r8], #4
if ( !_Chain_Is_empty(the_chain))
10d25a: 4580 cmp r8, r0
10d25c: d009 beq.n 10d272 <fat_shutdown_drive+0x36>
new_first = old_first->next;
10d25e: 6803 ldr r3, [r0, #0]
head->next = new_first;
10d260: 6023 str r3, [r4, #0]
new_first->previous = head;
10d262: 605c str r4, [r3, #4]
while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL )
free(node);
10d264: f7f8 f9be bl 1055e4 <free>
return _Chain_Immutable_head( the_chain )->next;
10d268: 6820 ldr r0, [r4, #0]
if ( !_Chain_Is_empty(the_chain))
10d26a: 4580 cmp r8, r0
10d26c: d1f7 bne.n 10d25e <fat_shutdown_drive+0x22>
rtems_chain_control *the_chain = fs_info->vhash + i;
10d26e: f8d5 4080 ldr.w r4, [r5, #128] ; 0x80
return _Chain_Immutable_head( the_chain )->next;
10d272: 46a0 mov r8, r4
return &the_chain->Tail.Node;
10d274: f104 0910 add.w r9, r4, #16
return _Chain_Immutable_head( the_chain )->next;
10d278: f858 0f0c ldr.w r0, [r8, #12]!
if ( !_Chain_Is_empty(the_chain))
10d27c: 4548 cmp r0, r9
10d27e: d008 beq.n 10d292 <fat_shutdown_drive+0x56> <== NEVER TAKEN
new_first = old_first->next;
10d280: 6803 ldr r3, [r0, #0] <== NOT EXECUTED
head->next = new_first;
10d282: 60e3 str r3, [r4, #12] <== NOT EXECUTED
new_first->previous = head;
10d284: f8c3 8004 str.w r8, [r3, #4] <== NOT EXECUTED
free(node);
10d288: f7f8 f9ac bl 1055e4 <free> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
10d28c: 68e0 ldr r0, [r4, #12] <== NOT EXECUTED
if ( !_Chain_Is_empty(the_chain))
10d28e: 4581 cmp r9, r0 <== NOT EXECUTED
10d290: d1f6 bne.n 10d280 <fat_shutdown_drive+0x44> <== NOT EXECUTED
}
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->rhash + i;
10d292: f8d5 4084 ldr.w r4, [r5, #132] ; 0x84
return _Chain_Immutable_head( the_chain )->next;
10d296: 46a0 mov r8, r4
10d298: f858 0b04 ldr.w r0, [r8], #4
if ( !_Chain_Is_empty(the_chain))
10d29c: 4580 cmp r8, r0
10d29e: d009 beq.n 10d2b4 <fat_shutdown_drive+0x78> <== NEVER TAKEN
new_first = old_first->next;
10d2a0: 6803 ldr r3, [r0, #0] <== NOT EXECUTED
head->next = new_first;
10d2a2: 6023 str r3, [r4, #0] <== NOT EXECUTED
new_first->previous = head;
10d2a4: 605c str r4, [r3, #4] <== NOT EXECUTED
while ( (node = rtems_chain_get_unprotected(the_chain)) != NULL )
free(node);
10d2a6: f7f8 f99d bl 1055e4 <free> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
10d2aa: 6820 ldr r0, [r4, #0] <== NOT EXECUTED
if ( !_Chain_Is_empty(the_chain))
10d2ac: 4540 cmp r0, r8 <== NOT EXECUTED
10d2ae: d1f7 bne.n 10d2a0 <fat_shutdown_drive+0x64> <== NOT EXECUTED
rtems_chain_control *the_chain = fs_info->rhash + i;
10d2b0: f8d5 4084 ldr.w r4, [r5, #132] ; 0x84 <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
10d2b4: 46a0 mov r8, r4
return &the_chain->Tail.Node;
10d2b6: f104 0910 add.w r9, r4, #16
return _Chain_Immutable_head( the_chain )->next;
10d2ba: f858 0f0c ldr.w r0, [r8, #12]!
if ( !_Chain_Is_empty(the_chain))
10d2be: 4581 cmp r9, r0
10d2c0: d008 beq.n 10d2d4 <fat_shutdown_drive+0x98> <== NEVER TAKEN
new_first = old_first->next;
10d2c2: 6803 ldr r3, [r0, #0] <== NOT EXECUTED
head->next = new_first;
10d2c4: 60e3 str r3, [r4, #12] <== NOT EXECUTED
new_first->previous = head;
10d2c6: f8c3 8004 str.w r8, [r3, #4] <== NOT EXECUTED
free(node);
10d2ca: f7f8 f98b bl 1055e4 <free> <== NOT EXECUTED
return _Chain_Immutable_head( the_chain )->next;
10d2ce: 68e0 ldr r0, [r4, #12] <== NOT EXECUTED
if ( !_Chain_Is_empty(the_chain))
10d2d0: 4581 cmp r9, r0 <== NOT EXECUTED
10d2d2: d1f6 bne.n 10d2c2 <fat_shutdown_drive+0x86> <== NOT EXECUTED
}
free(fs_info->vhash);
10d2d4: f8d5 0080 ldr.w r0, [r5, #128] ; 0x80
10d2d8: f7f8 f984 bl 1055e4 <free>
free(fs_info->rhash);
10d2dc: f8d5 0084 ldr.w r0, [r5, #132] ; 0x84
10d2e0: f7f8 f980 bl 1055e4 <free>
free(fs_info->uino);
10d2e4: f8d5 0088 ldr.w r0, [r5, #136] ; 0x88
10d2e8: f7f8 f97c bl 1055e4 <free>
free(fs_info->sec_buf);
10d2ec: f8d5 00a4 ldr.w r0, [r5, #164] ; 0xa4
10d2f0: f7f8 f978 bl 1055e4 <free>
close(fs_info->vol.fd);
10d2f4: 6ea8 ldr r0, [r5, #104] ; 0x68
10d2f6: f7f8 f8f3 bl 1054e0 <close>
if (rc)
10d2fa: b916 cbnz r6, 10d302 <fat_shutdown_drive+0xc6>
errno = EIO;
return rc;
}
10d2fc: 4638 mov r0, r7
10d2fe: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc}
errno = EIO;
10d302: f007 fcbd bl 114c80 <__errno> <== NOT EXECUTED
10d306: 2305 movs r3, #5 <== NOT EXECUTED
10d308: 6003 str r3, [r0, #0] <== NOT EXECUTED
}
10d30a: 4638 mov r0, r7 <== NOT EXECUTED
10d30c: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
0010d1bc <fat_sync>:
return RC_OK;
}
int
fat_sync(fat_fs_info_t *fs_info)
{
10d1bc: b5f0 push {r4, r5, r6, r7, lr}
10d1be: 4604 mov r4, r0
if (fs_info->vol.type == FAT_FAT32)
10d1c0: 7d83 ldrb r3, [r0, #22]
{
10d1c2: b085 sub sp, #20
if (fs_info->vol.type == FAT_FAT32)
10d1c4: 2b04 cmp r3, #4
10d1c6: d010 beq.n 10d1ea <fat_sync+0x2e>
return RC_OK;
10d1c8: 2500 movs r5, #0
if (fs_info->c.state == FAT_CACHE_EMPTY)
10d1ca: f894 309d ldrb.w r3, [r4, #157] ; 0x9d
10d1ce: b113 cbz r3, 10d1d6 <fat_sync+0x1a>
10d1d0: 4620 mov r0, r4
10d1d2: f7ff fb87 bl 10c8e4 <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)
10d1d6: 6ee0 ldr r0, [r4, #108] ; 0x6c
10d1d8: f005 f86c bl 1122b4 <rtems_bdbuf_syncdev>
rc = -1;
10d1dc: 2800 cmp r0, #0
10d1de: bf18 it ne
10d1e0: f04f 35ff movne.w r5, #4294967295 ; 0xffffffff
return rc;
}
10d1e4: 4628 mov r0, r5
10d1e6: b005 add sp, #20
10d1e8: bdf0 pop {r4, r5, r6, r7, pc}
uint32_t free_count = fs_info->vol.free_cls;
10d1ea: 6cc2 ldr r2, [r0, #76] ; 0x4c
if (free_count != fs_info->vol.free_cls_in_fs_info)
10d1ec: e9d0 1614 ldrd r1, r6, [r0, #80] ; 0x50
10d1f0: 428a cmp r2, r1
10d1f2: d113 bne.n 10d21c <fat_sync+0x60> <== ALWAYS TAKEN
if (next_free != fs_info->vol.next_cl_in_fs_info)
10d1f4: 6d83 ldr r3, [r0, #88] ; 0x58
10d1f6: 429e cmp r6, r3
10d1f8: d0e6 beq.n 10d1c8 <fat_sync+0xc>
10d1fa: 2500 movs r5, #0
10d1fc: af03 add r7, sp, #12
fs_info->vol.next_cl_in_fs_info = next_free;
10d1fe: 65a6 str r6, [r4, #88] ; 0x58
ret2 = fat_sector_write(fs_info,
10d200: 2304 movs r3, #4
10d202: 9700 str r7, [sp, #0]
10d204: f44f 72f6 mov.w r2, #492 ; 0x1ec
10d208: f8b4 1048 ldrh.w r1, [r4, #72] ; 0x48
10d20c: 4620 mov r0, r4
uint32_t le_next_free = CT_LE_L(next_free);
10d20e: 9603 str r6, [sp, #12]
ret2 = fat_sector_write(fs_info,
10d210: f7ff fc8e bl 10cb30 <fat_sector_write>
if ( (ret1 < 0) || (ret2 < 0) )
10d214: ea45 75d0 orr.w r5, r5, r0, lsr #31
10d218: 426d negs r5, r5
10d21a: e7d6 b.n 10d1ca <fat_sync+0xe>
ret1 = fat_sector_write(fs_info,
10d21c: af03 add r7, sp, #12 <== NOT EXECUTED
fs_info->vol.free_cls_in_fs_info = free_count;
10d21e: 6502 str r2, [r0, #80] ; 0x50 <== NOT EXECUTED
uint32_t le_free_count = CT_LE_L(free_count);
10d220: 9203 str r2, [sp, #12] <== NOT EXECUTED
ret1 = fat_sector_write(fs_info,
10d222: f44f 72f4 mov.w r2, #488 ; 0x1e8 <== NOT EXECUTED
10d226: 9700 str r7, [sp, #0] <== NOT EXECUTED
10d228: f8b0 1048 ldrh.w r1, [r0, #72] ; 0x48 <== NOT EXECUTED
10d22c: f7ff fc80 bl 10cb30 <fat_sector_write> <== NOT EXECUTED
if (next_free != fs_info->vol.next_cl_in_fs_info)
10d230: 6da3 ldr r3, [r4, #88] ; 0x58 <== NOT EXECUTED
if ( (ret1 < 0) || (ret2 < 0) )
10d232: 0fc5 lsrs r5, r0, #31 <== NOT EXECUTED
if (next_free != fs_info->vol.next_cl_in_fs_info)
10d234: 429e cmp r6, r3 <== NOT EXECUTED
10d236: d0ef beq.n 10d218 <fat_sync+0x5c> <== NOT EXECUTED
10d238: e7e1 b.n 10d1fe <fat_sync+0x42> <== NOT EXECUTED
10d23a: bf00 nop
0010e1fc <msdos_creat_node>:
fat_file_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
10e1fc: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10e200: 4683 mov fp, r0
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
10e202: 6940 ldr r0, [r0, #20]
{
10e204: b0ad sub sp, #180 ; 0xb4
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
fat_file_fd_t *fat_fd = NULL;
10e206: 2400 movs r4, #0
{
10e208: 4691 mov r9, r2
10e20a: 9104 str r1, [sp, #16]
uint32_t sec = 0;
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10e20c: 2220 movs r2, #32
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
10e20e: f8d0 a008 ldr.w sl, [r0, #8]
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10e212: 4621 mov r1, r4
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10e214: f04f 37ff mov.w r7, #4294967295 ; 0xffffffff
10e218: a80c add r0, sp, #48 ; 0x30
{
10e21a: 461e mov r6, r3
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
10e21c: f8db 5008 ldr.w r5, [fp, #8]
fat_file_fd_t *fat_fd = NULL;
10e220: 9407 str r4, [sp, #28]
uint16_t time_val = 0;
10e222: f8ad 4018 strh.w r4, [sp, #24]
uint16_t date = 0;
10e226: f8ad 401a strh.w r4, [sp, #26]
dir_pos->sname.ofs = 0;
10e22a: e9cd 4408 strd r4, r4, [sp, #32]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
10e22e: e9cd 770a strd r7, r7, [sp, #40] ; 0x28
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10e232: f007 fa55 bl 1156e0 <memset>
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
10e236: 2240 movs r2, #64 ; 0x40
10e238: 4621 mov r1, r4
10e23a: a81c add r0, sp, #112 ; 0x70
10e23c: f007 fa50 bl 1156e0 <memset>
if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) {
10e240: f5b6 7f82 cmp.w r6, #260 ; 0x104
10e244: f300 8142 bgt.w 10e4cc <msdos_creat_node+0x2d0> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
}
name_type = msdos_long_to_short (fs_info->converter,
10e248: 230b movs r3, #11
10e24a: f8da 00cc ldr.w r0, [sl, #204] ; 0xcc
10e24e: 4632 mov r2, r6
10e250: 9300 str r3, [sp, #0]
10e252: 4649 mov r1, r9
10e254: ab0c add r3, sp, #48 ; 0x30
10e256: f000 fa55 bl 10e704 <msdos_long_to_short>
name, name_len,
MSDOS_DIR_NAME(short_node),
MSDOS_NAME_MAX);
if (name_type == MSDOS_NAME_INVALID) {
10e25a: 9005 str r0, [sp, #20]
10e25c: 2800 cmp r0, #0
10e25e: f000 813b beq.w 10e4d8 <msdos_creat_node+0x2dc> <== ALWAYS TAKEN
/* fill reserved field */
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
/* set up last write date and time */
now = time(NULL);
10e262: 4620 mov r0, r4
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
10e264: f88d 403c strb.w r4, [sp, #60] ; 0x3c
now = time(NULL);
10e268: f009 fe66 bl 117f38 <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;
10e26c: f895 3030 ldrb.w r3, [r5, #48] ; 0x30
10e270: 460f mov r7, r1
fat_fd->ctime = t;
10e272: e9c5 0110 strd r0, r1, [r5, #64] ; 0x40
fat_file_set_ctime_mtime(parent_fat_fd, now);
msdos_date_unix2dos(now, &date, &time_val);
10e276: aa06 add r2, sp, #24
fat_fd->mtime = t;
10e278: e9c5 0112 strd r0, r1, [r5, #72] ; 0x48
10e27c: f10d 011a add.w r1, sp, #26
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
10e280: f043 0302 orr.w r3, r3, #2
now = time(NULL);
10e284: 4680 mov r8, r0
10e286: f885 3030 strb.w r3, [r5, #48] ; 0x30
msdos_date_unix2dos(now, &date, &time_val);
10e28a: f004 f9ff bl 11268c <msdos_date_unix2dos>
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
10e28e: f8bd 301a ldrh.w r3, [sp, #26]
*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;
10e292: 9413 str r4, [sp, #76] ; 0x4c
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
10e294: f8ad 3040 strh.w r3, [sp, #64] ; 0x40
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
10e298: f8ad 3048 strh.w r3, [sp, #72] ; 0x48
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
10e29c: f8ad 3042 strh.w r3, [sp, #66] ; 0x42
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
10e2a0: f8bd 3018 ldrh.w r3, [sp, #24]
10e2a4: f8ad 303e strh.w r3, [sp, #62] ; 0x3e
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
10e2a8: f8ad 3046 strh.w r3, [sp, #70] ; 0x46
if (type == FAT_DIRECTORY) {
10e2ac: 9b04 ldr r3, [sp, #16]
10e2ae: b1d3 cbz r3, 10e2e6 <msdos_creat_node+0xea>
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
}
else if (type == FAT_HARD_LINK) {
10e2b0: 9b04 ldr r3, [sp, #16]
10e2b2: 2b02 cmp r3, #2
10e2b4: f000 80b5 beq.w 10e422 <msdos_creat_node+0x226> <== ALWAYS TAKEN
* 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;
10e2b8: f89d 303b ldrb.w r3, [sp, #59] ; 0x3b
10e2bc: f043 0320 orr.w r3, r3, #32
10e2c0: f88d 303b strb.w r3, [sp, #59] ; 0x3b
/*
* 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,
10e2c4: a90c add r1, sp, #48 ; 0x30
10e2c6: ac08 add r4, sp, #32
10e2c8: 9102 str r1, [sp, #8]
10e2ca: 4633 mov r3, r6
10e2cc: 9905 ldr r1, [sp, #20]
10e2ce: 464a mov r2, r9
10e2d0: 9401 str r4, [sp, #4]
10e2d2: 4658 mov r0, fp
10e2d4: 9100 str r1, [sp, #0]
10e2d6: 2101 movs r1, #1
10e2d8: f001 f980 bl 10f5dc <msdos_get_name_node>
10e2dc: 4604 mov r4, r0
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;
}
10e2de: 4620 mov r0, r4
10e2e0: b02d add sp, #180 ; 0xb4
10e2e2: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rc = msdos_get_name_node(parent_loc, true, name, name_len,
10e2e6: a90c add r1, sp, #48 ; 0x30
10e2e8: 9b05 ldr r3, [sp, #20]
10e2ea: 9102 str r1, [sp, #8]
10e2ec: 464a mov r2, r9
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
10e2ee: f89d 103b ldrb.w r1, [sp, #59] ; 0x3b
rc = msdos_get_name_node(parent_loc, true, name, name_len,
10e2f2: 4658 mov r0, fp
10e2f4: 9300 str r3, [sp, #0]
10e2f6: 4633 mov r3, r6
10e2f8: ae08 add r6, sp, #32
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
10e2fa: f041 0110 orr.w r1, r1, #16
rc = msdos_get_name_node(parent_loc, true, name, name_len,
10e2fe: 9601 str r6, [sp, #4]
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
10e300: f88d 103b strb.w r1, [sp, #59] ; 0x3b
rc = msdos_get_name_node(parent_loc, true, name, name_len,
10e304: 2101 movs r1, #1
10e306: f001 f969 bl 10f5dc <msdos_get_name_node>
if ( rc != RC_OK )
10e30a: 4604 mov r4, r0
10e30c: 2800 cmp r0, #0
10e30e: d1e6 bne.n 10e2de <msdos_creat_node+0xe2> <== ALWAYS TAKEN
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
10e310: aa07 add r2, sp, #28
10e312: 4631 mov r1, r6
10e314: 4650 mov r0, sl
10e316: f7ff facd bl 10d8b4 <fat_file_open>
if (rc != RC_OK)
10e31a: 4604 mov r4, r0
10e31c: b148 cbz r0, 10e332 <msdos_creat_node+0x136>
msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5);
10e31e: f8db 0014 ldr.w r0, [fp, #20] <== NOT EXECUTED
10e322: 22e5 movs r2, #229 ; 0xe5 <== NOT EXECUTED
10e324: 4631 mov r1, r6 <== NOT EXECUTED
10e326: f000 fb87 bl 10ea38 <msdos_set_first_char4file_name> <== NOT EXECUTED
}
10e32a: 4620 mov r0, r4 <== NOT EXECUTED
10e32c: b02d add sp, #180 ; 0xb4 <== NOT EXECUTED
10e32e: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
fat_fd->fat_file_type = FAT_DIRECTORY;
10e332: 9907 ldr r1, [sp, #28]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10e334: f44f 1200 mov.w r2, #2097152 ; 0x200000
10e338: f891 3030 ldrb.w r3, [r1, #48] ; 0x30
fat_fd->fat_file_type = FAT_DIRECTORY;
10e33c: 6108 str r0, [r1, #16]
rc = fat_file_extend(&fs_info->fat,
10e33e: 4650 mov r0, sl
fat_fd->ctime = t;
10e340: f8c1 8040 str.w r8, [r1, #64] ; 0x40
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
10e344: f043 0302 orr.w r3, r3, #2
fat_fd->ctime = t;
10e348: e9c1 7811 strd r7, r8, [r1, #68] ; 0x44
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
10e34c: f881 3030 strb.w r3, [r1, #48] ; 0x30
10e350: f8da 3008 ldr.w r3, [sl, #8]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10e354: 614a str r2, [r1, #20]
rc = fat_file_extend(&fs_info->fat,
10e356: aa14 add r2, sp, #80 ; 0x50
fat_fd->mtime = t;
10e358: 64cf str r7, [r1, #76] ; 0x4c
10e35a: 9200 str r2, [sp, #0]
10e35c: 2201 movs r2, #1
10e35e: f7ff fd0b bl 10dd78 <fat_file_extend>
if (rc != RC_OK)
10e362: 4604 mov r4, r0
10e364: 2800 cmp r0, #0
10e366: d1da bne.n 10e31e <msdos_creat_node+0x122> <== ALWAYS TAKEN
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e368: f64c 2360 movw r3, #51808 ; 0xca60
memcpy(DOT_NODE_P(dot_dotdot), short_node,
10e36c: ac0c add r4, sp, #48 ; 0x30
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e36e: f2c0 0311 movt r3, #17
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
10e372: 9404 str r4, [sp, #16]
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e374: 9305 str r3, [sp, #20]
memcpy(DOT_NODE_P(dot_dotdot), short_node,
10e376: f10d 0c70 add.w ip, sp, #112 ; 0x70
10e37a: cc0f ldmia r4!, {r0, r1, r2, r3}
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
10e37c: 46e6 mov lr, ip
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
10e37e: af24 add r7, sp, #144 ; 0x90
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
10e380: f64c 2964 movw r9, #51812 ; 0xca64
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e384: 46b8 mov r8, r7
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
10e386: f2c0 0911 movt r9, #17
memcpy(DOT_NODE_P(dot_dotdot), short_node,
10e38a: e8ac 000f stmia.w ip!, {r0, r1, r2, r3}
10e38e: e894 000f ldmia.w r4, {r0, r1, r2, r3}
10e392: e88c 000f stmia.w ip, {r0, r1, r2, r3}
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
10e396: 9a04 ldr r2, [sp, #16]
10e398: 4694 mov ip, r2
10e39a: e8bc 000f ldmia.w ip!, {r0, r1, r2, r3}
10e39e: c70f stmia r7!, {r0, r1, r2, r3}
10e3a0: e894 000f ldmia.w r4, {r0, r1, r2, r3}
10e3a4: e887 000f stmia.w r7, {r0, r1, r2, r3}
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
10e3a8: f8d9 2000 ldr.w r2, [r9]
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e3ac: 9b05 ldr r3, [sp, #20]
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
10e3ae: 6810 ldr r0, [r2, #0]
10e3b0: 6851 ldr r1, [r2, #4]
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e3b2: 681b ldr r3, [r3, #0]
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
10e3b4: e8ae 0003 stmia.w lr!, {r0, r1}
10e3b8: 8911 ldrh r1, [r2, #8]
10e3ba: 7a92 ldrb r2, [r2, #10]
10e3bc: f8ae 1000 strh.w r1, [lr]
10e3c0: f88e 2002 strb.w r2, [lr, #2]
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
10e3c4: 6818 ldr r0, [r3, #0]
10e3c6: 6859 ldr r1, [r3, #4]
10e3c8: e8a8 0003 stmia.w r8!, {r0, r1}
10e3cc: 891a ldrh r2, [r3, #8]
10e3ce: 7a9b ldrb r3, [r3, #10]
10e3d0: f8a8 2000 strh.w r2, [r8]
10e3d4: f888 3002 strb.w r3, [r8, #2]
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
10e3d8: 6a2b ldr r3, [r5, #32]
10e3da: 2b01 cmp r3, #1
10e3dc: d062 beq.n 10e4a4 <msdos_creat_node+0x2a8>
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
10e3de: 69eb ldr r3, [r5, #28]
10e3e0: f8ad 30aa strh.w r3, [sp, #170] ; 0xaa
CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
10e3e4: 0c1b lsrs r3, r3, #16
10e3e6: f8ad 30a4 strh.w r3, [sp, #164] ; 0xa4
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
10e3ea: 9907 ldr r1, [sp, #28]
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
10e3ec: ad1c add r5, sp, #112 ; 0x70
10e3ee: 2340 movs r3, #64 ; 0x40
10e3f0: 2200 movs r2, #0
10e3f2: 4650 mov r0, sl
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
10e3f4: 69cc ldr r4, [r1, #28]
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
10e3f6: 9500 str r5, [sp, #0]
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
10e3f8: f8ad 408a strh.w r4, [sp, #138] ; 0x8a
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
10e3fc: 0c24 lsrs r4, r4, #16
10e3fe: f8ad 4084 strh.w r4, [sp, #132] ; 0x84
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
10e402: f7ff fd81 bl 10df08 <fat_file_write>
if (ret < 0)
10e406: 2800 cmp r0, #0
10e408: db59 blt.n 10e4be <msdos_creat_node+0x2c2> <== ALWAYS TAKEN
rc = fat_file_write_first_cluster_num(&fs_info->fat, fat_fd);
10e40a: 9907 ldr r1, [sp, #28]
10e40c: 4650 mov r0, sl
10e40e: f000 faaf bl 10e970 <fat_file_write_first_cluster_num>
if (rc != RC_OK)
10e412: 4604 mov r4, r0
10e414: 2800 cmp r0, #0
10e416: d154 bne.n 10e4c2 <msdos_creat_node+0x2c6> <== ALWAYS TAKEN
fat_file_close(&fs_info->fat, fat_fd);
10e418: 9907 ldr r1, [sp, #28]
10e41a: 4650 mov r0, sl
10e41c: f7ff fc30 bl 10dc80 <fat_file_close>
10e420: e75d b.n 10e2de <msdos_creat_node+0xe2>
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
10e422: 9b37 ldr r3, [sp, #220] ; 0xdc <== NOT EXECUTED
10e424: 6a1b ldr r3, [r3, #32] <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e426: b933 cbnz r3, 10e436 <msdos_creat_node+0x23a> <== NOT EXECUTED
10e428: f89a 2016 ldrb.w r2, [sl, #22] <== NOT EXECUTED
10e42c: 0791 lsls r1, r2, #30 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
10e42e: bf18 it ne <== NOT EXECUTED
10e430: f8da 3028 ldrne.w r3, [sl, #40] ; 0x28 <== NOT EXECUTED
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10e434: d106 bne.n 10e444 <msdos_creat_node+0x248> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10e436: f89a 1005 ldrb.w r1, [sl, #5] <== NOT EXECUTED
10e43a: 3b02 subs r3, #2 <== NOT EXECUTED
10e43c: 408b lsls r3, r1 <== NOT EXECUTED
10e43e: f8da 103c ldr.w r1, [sl, #60] ; 0x3c <== NOT EXECUTED
10e442: 440b add r3, r1 <== NOT EXECUTED
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
10e444: 9a37 ldr r2, [sp, #220] ; 0xdc <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
10e446: 4650 mov r0, sl <== NOT EXECUTED
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
10e448: f89a 1002 ldrb.w r1, [sl, #2] <== NOT EXECUTED
10e44c: 6a52 ldr r2, [r2, #36] ; 0x24 <== NOT EXECUTED
10e44e: fa22 f101 lsr.w r1, r2, r1 <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
10e452: 4419 add r1, r3 <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
10e454: f8ba 3000 ldrh.w r3, [sl] <== NOT EXECUTED
10e458: 3b01 subs r3, #1 <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
10e45a: 401a ands r2, r3 <== NOT EXECUTED
10e45c: ab14 add r3, sp, #80 ; 0x50 <== NOT EXECUTED
10e45e: 9300 str r3, [sp, #0] <== NOT EXECUTED
10e460: 2320 movs r3, #32 <== NOT EXECUTED
10e462: f7fe fb11 bl 10ca88 <_fat_block_read> <== NOT EXECUTED
if (ret < 0) {
10e466: 2800 cmp r0, #0 <== NOT EXECUTED
10e468: db3c blt.n 10e4e4 <msdos_creat_node+0x2e8> <== NOT EXECUTED
*MSDOS_DIR_ATTR(short_node) =*MSDOS_DIR_ATTR(link_node);
10e46a: f89d 305b ldrb.w r3, [sp, #91] ; 0x5b <== NOT EXECUTED
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
10e46e: f043 0320 orr.w r3, r3, #32 <== NOT EXECUTED
10e472: f88d 303b strb.w r3, [sp, #59] ; 0x3b <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME_TENTH(short_node)=*MSDOS_DIR_CRT_TIME_TENTH(link_node);
10e476: f89d 305d ldrb.w r3, [sp, #93] ; 0x5d <== NOT EXECUTED
10e47a: f88d 303d strb.w r3, [sp, #61] ; 0x3d <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
10e47e: f8bd 305e ldrh.w r3, [sp, #94] ; 0x5e <== NOT EXECUTED
10e482: f8ad 303e strh.w r3, [sp, #62] ; 0x3e <== NOT EXECUTED
*MSDOS_DIR_CRT_DATE(short_node) =*MSDOS_DIR_CRT_DATE(link_node);
10e486: f8bd 3060 ldrh.w r3, [sp, #96] ; 0x60 <== NOT EXECUTED
10e48a: f8ad 3040 strh.w r3, [sp, #64] ; 0x40 <== NOT EXECUTED
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
10e48e: 9b1b ldr r3, [sp, #108] ; 0x6c <== NOT EXECUTED
10e490: 9313 str r3, [sp, #76] ; 0x4c <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
10e492: f8bd 306a ldrh.w r3, [sp, #106] ; 0x6a <== NOT EXECUTED
10e496: f8ad 304a strh.w r3, [sp, #74] ; 0x4a <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
10e49a: f8bd 3064 ldrh.w r3, [sp, #100] ; 0x64 <== NOT EXECUTED
10e49e: f8ad 3044 strh.w r3, [sp, #68] ; 0x44 <== NOT EXECUTED
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
10e4a2: e70f b.n 10e2c4 <msdos_creat_node+0xc8> <== NOT EXECUTED
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
10e4a4: 6a6b ldr r3, [r5, #36] ; 0x24
10e4a6: 2b00 cmp r3, #0
10e4a8: d199 bne.n 10e3de <msdos_creat_node+0x1e2> <== ALWAYS TAKEN
10e4aa: f89a 2016 ldrb.w r2, [sl, #22]
10e4ae: 0752 lsls r2, r2, #29
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
10e4b0: bf44 itt mi
10e4b2: f8ad 30aa strhmi.w r3, [sp, #170] ; 0xaa
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
10e4b6: f8ad 30a4 strhmi.w r3, [sp, #164] ; 0xa4
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
10e4ba: d496 bmi.n 10e3ea <msdos_creat_node+0x1ee> <== ALWAYS TAKEN
10e4bc: e78f b.n 10e3de <msdos_creat_node+0x1e2>
rc = -1;
10e4be: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
10e4c2: 9907 ldr r1, [sp, #28] <== NOT EXECUTED
10e4c4: 4650 mov r0, sl <== NOT EXECUTED
10e4c6: f7ff fbdb bl 10dc80 <fat_file_close> <== NOT EXECUTED
10e4ca: e728 b.n 10e31e <msdos_creat_node+0x122> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
10e4cc: f006 fbd8 bl 114c80 <__errno> <== NOT EXECUTED
10e4d0: 235b movs r3, #91 ; 0x5b <== NOT EXECUTED
10e4d2: 463c mov r4, r7 <== NOT EXECUTED
10e4d4: 6003 str r3, [r0, #0] <== NOT EXECUTED
10e4d6: e702 b.n 10e2de <msdos_creat_node+0xe2> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EINVAL);
10e4d8: f006 fbd2 bl 114c80 <__errno> <== NOT EXECUTED
10e4dc: 2316 movs r3, #22 <== NOT EXECUTED
10e4de: 463c mov r4, r7 <== NOT EXECUTED
10e4e0: 6003 str r3, [r0, #0] <== NOT EXECUTED
10e4e2: e6fc b.n 10e2de <msdos_creat_node+0xe2> <== NOT EXECUTED
return -1;
10e4e4: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
10e4e8: e6f9 b.n 10e2de <msdos_creat_node+0xe2> <== NOT EXECUTED
10e4ea: bf00 nop
001127f0 <msdos_date_dos2unix>:
uint32_t y, year;
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
1127f0: f3c1 1345 ubfx r3, r1, #5, #6
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
/*
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
1127f4: f242 3292 movw r2, #9106 ; 0x2392
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
1127f8: ebc3 1303 rsb r3, r3, r3, lsl #4
{
1127fc: b530 push {r4, r5, lr}
if (lastdosdate != dd) {
1127fe: f2c0 0220 movt r2, #32
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
112802: 005b lsls r3, r3, #1
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
112804: f3c1 24c4 ubfx r4, r1, #11, #5
112808: f44f 65e1 mov.w r5, #1800 ; 0x708
11280c: fb05 3304 mla r3, r5, r4, r3
if (lastdosdate != dd) {
112810: 8814 ldrh r4, [r2, #0]
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
112812: f001 011f and.w r1, r1, #31
if (lastdosdate != dd) {
112816: 4284 cmp r4, r0
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
112818: 440b add r3, r1
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
11281a: ea4f 0143 mov.w r1, r3, lsl #1
if (lastdosdate != dd) {
11281e: d04d beq.n 1128bc <msdos_date_dos2unix+0xcc>
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
112820: 0a45 lsrs r5, r0, #9
lastdosdate = dd;
112822: 8010 strh r0, [r2, #0]
for (y = 0; y < year; y++)
112824: f015 0e7f ands.w lr, r5, #127 ; 0x7f
days = 0;
112828: bf08 it eq
11282a: 4673 moveq r3, lr
for (y = 0; y < year; y++)
11282c: d010 beq.n 112850 <msdos_date_dos2unix+0x60> <== ALWAYS TAKEN
days = 0;
11282e: 2300 movs r3, #0
days += y & 0x03 ? 365 : 366;
112830: f44f 7cb7 mov.w ip, #366 ; 0x16e
for (y = 0; y < year; y++)
112834: 461a mov r2, r3
days += y & 0x03 ? 365 : 366;
112836: f240 146d movw r4, #365 ; 0x16d
11283a: e005 b.n 112848 <msdos_date_dos2unix+0x58>
11283c: f012 0f03 tst.w r2, #3
112840: bf14 ite ne
112842: 46a4 movne ip, r4
112844: f44f 7cb7 moveq.w ip, #366 ; 0x16e
for (y = 0; y < year; y++)
112848: 3201 adds r2, #1
days += y & 0x03 ? 365 : 366;
11284a: 4463 add r3, ip
for (y = 0; y < year; y++)
11284c: 4596 cmp lr, r2
11284e: d1f5 bne.n 11283c <msdos_date_dos2unix+0x4c>
months = year & 0x03 ? regyear : leapyear;
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
112850: 0944 lsrs r4, r0, #5
months = year & 0x03 ? regyear : leapyear;
112852: f240 2cac movw ip, #684 ; 0x2ac
112856: f015 0f03 tst.w r5, #3
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
11285a: f004 0e0f and.w lr, r4, #15
months = year & 0x03 ? regyear : leapyear;
11285e: f240 22c4 movw r2, #708 ; 0x2c4
112862: f2c0 0c20 movt ip, #32
112866: f2c0 0220 movt r2, #32
11286a: bf08 it eq
11286c: 4662 moveq r2, ip
if (month == 0) {
11286e: f1be 0f01 cmp.w lr, #1
112872: bf38 it cc
112874: f04f 0e01 movcc.w lr, #1
month = 1;
}
for (m = 0; m < month - 1; m++)
112878: f014 0f0e tst.w r4, #14
11287c: d009 beq.n 112892 <msdos_date_dos2unix+0xa2>
11287e: eb02 0e4e add.w lr, r2, lr, lsl #1
112882: 3a02 subs r2, #2
112884: f1ae 0e04 sub.w lr, lr, #4
days += months[m];
112888: f832 cf02 ldrh.w ip, [r2, #2]!
for (m = 0; m < month - 1; m++)
11288c: 4596 cmp lr, r2
days += months[m];
11288e: 4463 add r3, ip
for (m = 0; m < month - 1; m++)
112890: d1fa bne.n 112888 <msdos_date_dos2unix+0x98> <== ALWAYS TAKEN
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
112892: f000 001f and.w r0, r0, #31
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
112896: f44f 44a3 mov.w r4, #20864 ; 0x5180
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
11289a: 3801 subs r0, #1
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
11289c: f44f 4226 mov.w r2, #42496 ; 0xa600
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
1128a0: 4403 add r3, r0
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
1128a2: f2c0 0401 movt r4, #1
1128a6: f2c1 22ce movt r2, #4814 ; 0x12ce
1128aa: fb04 2003 mla r0, r4, r3, r2
1128ae: f242 3298 movw r2, #9112 ; 0x2398
1128b2: f2c0 0220 movt r2, #32
1128b6: 6010 str r0, [r2, #0]
}
return seconds + lastseconds;
}
1128b8: 4408 add r0, r1
1128ba: bd30 pop {r4, r5, pc}
return seconds + lastseconds;
1128bc: f242 3398 movw r3, #9112 ; 0x2398
1128c0: f2c0 0320 movt r3, #32
1128c4: 6818 ldr r0, [r3, #0]
}
1128c6: 4408 add r0, r1
1128c8: bd30 pop {r4, r5, pc}
1128ca: bf00 nop
0011268c <msdos_date_unix2dos>:
* file timestamps. The passed in unix time is assumed to be in GMT.
*/
void
msdos_date_unix2dos(unsigned int t, uint16_t *ddp,
uint16_t *dtp)
{
11268c: b530 push {r4, r5, lr}
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
11268e: f242 359c movw r5, #9116 ; 0x239c
112692: f2c0 0520 movt r5, #32
112696: 682c ldr r4, [r5, #0]
112698: 4284 cmp r4, r0
11269a: f000 8095 beq.w 1127c8 <msdos_date_unix2dos+0x13c>
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
11269e: f648 0489 movw r4, #34953 ; 0x8889
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
1126a2: f24b 3cc5 movw ip, #46021 ; 0xb3c5
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
1126a6: f6c8 0488 movt r4, #34952 ; 0x8888
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
1126aa: f2c9 1ca2 movt ip, #37282 ; 0x91a2
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
1126ae: fba4 3e00 umull r3, lr, r4, r0
lasttime = t;
1126b2: 6028 str r0, [r5, #0]
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
1126b4: fbac 3c00 umull r3, ip, ip, r0
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
1126b8: ea4f 1e5e mov.w lr, lr, lsr #5
1126bc: fba4 340e umull r3, r4, r4, lr
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
1126c0: ea4f 2cdc mov.w ip, ip, lsr #11
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
1126c4: 0964 lsrs r4, r4, #5
1126c6: ebc4 1404 rsb r4, r4, r4, lsl #4
1126ca: ebae 0484 sub.w r4, lr, r4, lsl #2
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
1126ce: ebce 1e0e rsb lr, lr, lr, lsl #4
1126d2: eba0 038e sub.w r3, r0, lr, lsl #2
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
1126d6: f64a 2eab movw lr, #43691 ; 0xaaab
1126da: f6ca 2eaa movt lr, #43690 ; 0xaaaa
1126de: fbae 5e0c umull r5, lr, lr, ip
1126e2: ea4f 1e1e mov.w lr, lr, lsr #4
1126e6: eb0e 0e4e add.w lr, lr, lr, lsl #1
1126ea: ebac 0ece sub.w lr, ip, lr, lsl #3
1126ee: ea4f 2ece mov.w lr, lr, lsl #11
1126f2: eb0e 1e44 add.w lr, lr, r4, lsl #5
* 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) {
1126f6: f242 348c movw r4, #9100 ; 0x238c
1126fa: f2c0 0420 movt r4, #32
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
1126fe: eb0e 0e53 add.w lr, lr, r3, lsr #1
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
112702: f242 3394 movw r3, #9108 ; 0x2394
112706: f2c0 0320 movt r3, #32
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
11270a: fa1f fe8e uxth.w lr, lr
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
11270e: f8a3 e000 strh.w lr, [r3]
days = t / (SECONDSPERDAY);
112712: f244 5307 movw r3, #17671 ; 0x4507
112716: f2cc 232e movt r3, #49710 ; 0xc22e
11271a: fba3 3000 umull r3, r0, r3, r0
11271e: 0c03 lsrs r3, r0, #16
if (days != lastday) {
112720: 6820 ldr r0, [r4, #0]
112722: 4298 cmp r0, r3
lastday = days;
112724: bf1e ittt ne
112726: 6023 strne r3, [r4, #0]
for (year = 1970;; year++) {
112728: f240 70b2 movwne r0, #1970 ; 0x7b2
inc = year & 0x03 ? 365 : 366;
11272c: f240 146d movwne r4, #365 ; 0x16d
if (days != lastday) {
112730: d10b bne.n 11274a <msdos_date_unix2dos+0xbe>
lastddate += (year - 1980) <<
MSDOS_DD_YEAR_SHIFT;
}
}
*dtp = lastdtime;
*ddp = lastddate;
112732: f242 3390 movw r3, #9104 ; 0x2390
*dtp = lastdtime;
112736: f8a2 e000 strh.w lr, [r2]
*ddp = lastddate;
11273a: f2c0 0320 movt r3, #32
11273e: 881b ldrh r3, [r3, #0]
112740: 800b strh r3, [r1, #0]
}
112742: bd30 pop {r4, r5, pc}
days -= inc;
112744: eba3 030c sub.w r3, r3, ip
for (year = 1970;; year++) {
112748: 3001 adds r0, #1
inc = year & 0x03 ? 365 : 366;
11274a: f010 0503 ands.w r5, r0, #3
11274e: bf14 ite ne
112750: 46a4 movne ip, r4
112752: f44f 7cb7 moveq.w ip, #366 ; 0x16e
if (days < inc)
112756: 4563 cmp r3, ip
112758: d2f4 bcs.n 112744 <msdos_date_unix2dos+0xb8>
months = year & 0x03 ? regyear : leapyear;
11275a: f240 24c4 movw r4, #708 ; 0x2c4
11275e: f240 2cac movw ip, #684 ; 0x2ac
112762: f2c0 0c20 movt ip, #32
112766: f2c0 0420 movt r4, #32
11276a: 2d00 cmp r5, #0
11276c: bf08 it eq
11276e: 4664 moveq r4, ip
for (month = 0; month < 12; month++) {
112770: f04f 0c00 mov.w ip, #0
112774: 3c02 subs r4, #2
if (days < months[month])
112776: f834 5f02 ldrh.w r5, [r4, #2]!
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
11277a: f10c 0c01 add.w ip, ip, #1
if (days < months[month])
11277e: 429d cmp r5, r3
112780: d831 bhi.n 1127e6 <msdos_date_unix2dos+0x15a> <== NEVER TAKEN
for (month = 0; month < 12; month++) {
112782: f1bc 0f0c cmp.w ip, #12 <== NOT EXECUTED
days -= months[month];
112786: eba3 0305 sub.w r3, r3, r5 <== NOT EXECUTED
for (month = 0; month < 12; month++) {
11278a: d1f4 bne.n 112776 <msdos_date_unix2dos+0xea> <== NOT EXECUTED
11278c: f44f 7cd0 mov.w ip, #416 ; 0x1a0 <== NOT EXECUTED
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
112790: f10c 0c01 add.w ip, ip, #1
if (year > 1980)
112794: f240 74bc movw r4, #1980 ; 0x7bc
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
112798: 4463 add r3, ip
if (year > 1980)
11279a: 42a0 cmp r0, r4
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
11279c: b29b uxth r3, r3
lastddate += (year - 1980) <<
11279e: bf8c ite hi
1127a0: f2a0 70bc subwhi r0, r0, #1980 ; 0x7bc
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
1127a4: f242 3090 movwls r0, #9104 ; 0x2390
*dtp = lastdtime;
1127a8: f8a2 e000 strh.w lr, [r2]
lastddate += (year - 1980) <<
1127ac: bf85 ittet hi
1127ae: eb03 2340 addhi.w r3, r3, r0, lsl #9
1127b2: f242 3090 movwhi r0, #9104 ; 0x2390
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
1127b6: f2c0 0020 movtls r0, #32
lastddate += (year - 1980) <<
1127ba: b29b uxthhi r3, r3
1127bc: bf88 it hi
1127be: f2c0 0020 movthi r0, #32
1127c2: 8003 strh r3, [r0, #0]
*ddp = lastddate;
1127c4: 800b strh r3, [r1, #0]
}
1127c6: bd30 pop {r4, r5, pc}
*dtp = lastdtime;
1127c8: f242 3094 movw r0, #9108 ; 0x2394
*ddp = lastddate;
1127cc: f242 3390 movw r3, #9104 ; 0x2390
*dtp = lastdtime;
1127d0: f2c0 0020 movt r0, #32
*ddp = lastddate;
1127d4: f2c0 0320 movt r3, #32
*dtp = lastdtime;
1127d8: f8b0 e000 ldrh.w lr, [r0]
*ddp = lastddate;
1127dc: 881b ldrh r3, [r3, #0]
*dtp = lastdtime;
1127de: f8a2 e000 strh.w lr, [r2]
*ddp = lastddate;
1127e2: 800b strh r3, [r1, #0]
}
1127e4: bd30 pop {r4, r5, pc}
+ ((month + 1) << MSDOS_DD_MONTH_SHIFT);
1127e6: ea4f 1c4c mov.w ip, ip, lsl #5
1127ea: fa1f fc8c uxth.w ip, ip
1127ee: e7cf b.n 112790 <msdos_date_unix2dos+0x104>
0010eb04 <msdos_dir_is_empty>:
{
10eb04: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
10eb08: f64c 19f8 movw r9, #51704 ; 0xc9f8
msdos_fs_info_t *fs_info = mt_entry->fs_info;
10eb0c: f8d0 8008 ldr.w r8, [r0, #8]
(strncmp(MSDOS_DIR_NAME((entry)),
10eb10: f64c 2a04 movw sl, #51716 ; 0xca04
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
10eb14: f2c0 0911 movt r9, #17
(strncmp(MSDOS_DIR_NAME((entry)),
10eb18: f2c0 0a11 movt sl, #17
{
10eb1c: b087 sub sp, #28
*ret_val = false;
10eb1e: 2300 movs r3, #0
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
10eb20: f8b8 6000 ldrh.w r6, [r8]
10eb24: f8d8 70c8 ldr.w r7, [r8, #200] ; 0xc8
{
10eb28: e9cd 1204 strd r1, r2, [sp, #16]
*ret_val = false;
10eb2c: 7013 strb r3, [r2, #0]
uint32_t j = 0, i = 0;
10eb2e: 9303 str r3, [sp, #12]
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
10eb30: 9b03 ldr r3, [sp, #12]
10eb32: 4640 mov r0, r8
10eb34: 9904 ldr r1, [sp, #16]
10eb36: 9700 str r7, [sp, #0]
10eb38: fb03 f206 mul.w r2, r3, r6
10eb3c: 4633 mov r3, r6
10eb3e: f7fe ffc5 bl 10dacc <fat_file_read>
10eb42: b378 cbz r0, 10eba4 <msdos_dir_is_empty+0xa0>
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10eb44: 281f cmp r0, #31
10eb46: dd34 ble.n 10ebb2 <msdos_dir_is_empty+0xae> <== ALWAYS TAKEN
assert(ret == fs_info->fat.vol.bps);
10eb48: f8b8 6000 ldrh.w r6, [r8]
10eb4c: 4286 cmp r6, r0
10eb4e: d133 bne.n 10ebb8 <msdos_dir_is_empty+0xb4> <== ALWAYS TAKEN
char* entry = (char*) fs_info->cl_buf + i;
10eb50: f8d8 70c8 ldr.w r7, [r8, #200] ; 0xc8
for (i = 0;
10eb54: 2500 movs r5, #0
10eb56: 463c mov r4, r7
10eb58: b306 cbz r6, 10eb9c <msdos_dir_is_empty+0x98>
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
10eb5a: f817 b005 ldrb.w fp, [r7, r5]
10eb5e: f1bb 0fe5 cmp.w fp, #229 ; 0xe5
10eb62: d017 beq.n 10eb94 <msdos_dir_is_empty+0x90>
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
10eb64: 7ae3 ldrb r3, [r4, #11]
10eb66: f003 033f and.w r3, r3, #63 ; 0x3f
10eb6a: 2b0f cmp r3, #15
10eb6c: d012 beq.n 10eb94 <msdos_dir_is_empty+0x90>
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
10eb6e: 220b movs r2, #11
10eb70: 4649 mov r1, r9
10eb72: 4620 mov r0, r4
10eb74: f007 fcf2 bl 11655c <strncmp>
MSDOS_ATTR_LFN) ||
10eb78: b160 cbz r0, 10eb94 <msdos_dir_is_empty+0x90>
(strncmp(MSDOS_DIR_NAME((entry)),
10eb7a: 220b movs r2, #11
10eb7c: 4651 mov r1, sl
10eb7e: 4620 mov r0, r4
10eb80: f007 fcec bl 11655c <strncmp>
MSDOS_SHORT_NAME_LEN) == 0) ||
10eb84: b130 cbz r0, 10eb94 <msdos_dir_is_empty+0x90>
return RC_OK;
10eb86: 2000 movs r0, #0
if ((*MSDOS_DIR_NAME(entry)) ==
10eb88: f1bb 0f00 cmp.w fp, #0
10eb8c: d00a beq.n 10eba4 <msdos_dir_is_empty+0xa0>
}
10eb8e: b007 add sp, #28
10eb90: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10eb94: 3520 adds r5, #32
for (i = 0;
10eb96: 3420 adds r4, #32
10eb98: 42b5 cmp r5, r6
10eb9a: d3de bcc.n 10eb5a <msdos_dir_is_empty+0x56>
j++;
10eb9c: 9b03 ldr r3, [sp, #12]
10eb9e: 3301 adds r3, #1
10eba0: 9303 str r3, [sp, #12]
10eba2: e7c5 b.n 10eb30 <msdos_dir_is_empty+0x2c>
*ret_val = true;
10eba4: 9a05 ldr r2, [sp, #20]
10eba6: 2301 movs r3, #1
return RC_OK;
10eba8: 2000 movs r0, #0
*ret_val = true;
10ebaa: 7013 strb r3, [r2, #0]
}
10ebac: b007 add sp, #28
10ebae: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return -1;
10ebb2: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10ebb6: e7ea b.n 10eb8e <msdos_dir_is_empty+0x8a> <== NOT EXECUTED
assert(ret == fs_info->fat.vol.bps);
10ebb8: f64c 13ac movw r3, #51628 ; 0xc9ac <== NOT EXECUTED
10ebbc: f64c 22d0 movw r2, #51920 ; 0xcad0 <== NOT EXECUTED
10ebc0: f64c 10c8 movw r0, #51656 ; 0xc9c8 <== NOT EXECUTED
10ebc4: f2c0 0311 movt r3, #17 <== NOT EXECUTED
10ebc8: f2c0 0211 movt r2, #17 <== NOT EXECUTED
10ebcc: f240 31c6 movw r1, #966 ; 0x3c6 <== NOT EXECUTED
10ebd0: f2c0 0011 movt r0, #17 <== NOT EXECUTED
10ebd4: f003 fc44 bl 112460 <__assert_func> <== NOT EXECUTED
00112cfc <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;
112cfc: 6a43 ldr r3, [r0, #36] ; 0x24
{
112cfe: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
112d02: 4614 mov r4, r2
112d04: b0e3 sub sp, #396 ; 0x18c
112d06: 4680 mov r8, r0
* 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);
112d08: 08e4 lsrs r4, r4, #3
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
112d0a: 689f ldr r7, [r3, #8]
{
112d0c: 910c str r1, [sp, #48] ; 0x30
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
112d0e: f8d8 5018 ldr.w r5, [r8, #24]
rtems_dosfs_convert_control *converter = fs_info->converter;
112d12: f8d7 20cc ldr.w r2, [r7, #204] ; 0xcc
112d16: f107 03b0 add.w r3, r7, #176 ; 0xb0
112d1a: 4618 mov r0, r3
112d1c: 9312 str r3, [sp, #72] ; 0x48
fat_file_fd_t *tmp_fat_fd = NULL;
112d1e: 2300 movs r3, #0
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
112d20: 9508 str r5, [sp, #32]
const rtems_dosfs_convert_handler *convert_handler = converter->handler;
112d22: 6811 ldr r1, [r2, #0]
uint32_t cur_cln = 0;
112d24: e9cd 3315 strd r3, r3, [sp, #84] ; 0x54
uint16_t *lfn_buf = converter->buffer.data;
112d28: 6853 ldr r3, [r2, #4]
rtems_dosfs_convert_control *converter = fs_info->converter;
112d2a: 920a str r2, [sp, #40] ; 0x28
const rtems_dosfs_convert_handler *convert_handler = converter->handler;
112d2c: 910b str r1, [sp, #44] ; 0x2c
uint16_t *lfn_buf = converter->buffer.data;
112d2e: 9309 str r3, [sp, #36] ; 0x24
const size_t buf_size = converter->buffer.size;
112d30: 6893 ldr r3, [r2, #8]
112d32: 9313 str r3, [sp, #76] ; 0x4c
_Mutex_recursive_Acquire( mutex );
112d34: f7f7 f90a bl 109f4c <_Mutex_recursive_Acquire>
start = iop->offset / sizeof(struct dirent);
112d38: f44f 728c mov.w r2, #280 ; 0x118
112d3c: 2300 movs r3, #0
112d3e: e9d8 0102 ldrd r0, r1, [r8, #8]
112d42: f001 fd87 bl 114854 <__aeabi_ldivmod>
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
112d46: f64e 230f movw r3, #59919 ; 0xea0f
112d4a: f44f 728c mov.w r2, #280 ; 0x118
112d4e: f6c0 63a0 movt r3, #3744 ; 0xea0
start = iop->offset / sizeof(struct dirent);
112d52: 9003 str r0, [sp, #12]
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
112d54: fba3 3404 umull r3, r4, r3, r4
* 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 :
112d58: 6a2b ldr r3, [r5, #32]
112d5a: 2b01 cmp r3, #1
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
112d5c: ea4f 0454 mov.w r4, r4, lsr #1
112d60: fb02 f204 mul.w r2, r2, r4
112d64: 9205 str r2, [sp, #20]
fat_fd->fat_file_size :
112d66: f000 816f beq.w 113048 <msdos_dir_read+0x34c>
112d6a: 68bb ldr r3, [r7, #8]
112d6c: 930f str r3, [sp, #60] ; 0x3c
fs_info->fat.vol.bpc;
while (count > 0 && cmpltd >= 0)
112d6e: 9b05 ldr r3, [sp, #20]
112d70: 2b00 cmp r3, #0
112d72: f000 818b beq.w 11308c <msdos_dir_read+0x390> <== ALWAYS TAKEN
* fat-file is already opened by open call, so read it
* Always read directory fat-file from the beggining because of MSDOS
* directories feature :( - we should count elements currently
* present in the directory because there may be holes :)
*/
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
112d76: 2300 movs r3, #0
*/
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
MSDOS_LAST_LONG_ENTRY_MASK)) ||
(lfn_checksum != *MSDOS_DIR_LFN_CHECKSUM(entry)))
{
lfn_start = FAT_FILE_SHORT_NAME;
112d78: 46b9 mov r9, r7
112d7a: 461f mov r7, r3
uint32_t lfn_start = FAT_FILE_SHORT_NAME;
112d7c: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
112d80: 9307 str r3, [sp, #28]
uint32_t lfn_start = FAT_FILE_SHORT_NAME;
112d82: 9204 str r2, [sp, #16]
int lfn_entries = 0;
112d84: 9306 str r3, [sp, #24]
size_t lfn_len = 0;
112d86: e9cd 330d strd r3, r3, [sp, #52] ; 0x34
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
112d8a: f8d9 30c8 ldr.w r3, [r9, #200] ; 0xc8
112d8e: 4648 mov r0, r9
112d90: e9dd 2107 ldrd r2, r1, [sp, #28]
112d94: 9300 str r3, [sp, #0]
112d96: 9b0f ldr r3, [sp, #60] ; 0x3c
112d98: f7fa fe98 bl 10dacc <fat_file_read>
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112d9c: 281f cmp r0, #31
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
112d9e: 9002 str r0, [sp, #8]
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112da0: f340 815e ble.w 113060 <msdos_dir_read+0x364> <== ALWAYS TAKEN
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112da4: 2f00 cmp r7, #0
112da6: f2c0 8144 blt.w 113032 <msdos_dir_read+0x336> <== ALWAYS TAKEN
lfn_start =
112daa: 9b07 ldr r3, [sp, #28]
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112dac: 2420 movs r4, #32
lfn_start =
112dae: 3b20 subs r3, #32
112db0: 9311 str r3, [sp, #68] ; 0x44
112db2: e024 b.n 112dfe <msdos_dir_read+0x102>
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112db4: 9902 ldr r1, [sp, #8]
112db6: ea6f 0b07 mvn.w fp, r7
112dba: ea4f 7bdb mov.w fp, fp, lsr #31
112dbe: 428c cmp r4, r1
112dc0: bf2c ite cs
112dc2: f04f 0a00 movcs.w sl, #0
112dc6: f00b 0a01 andcc.w sl, fp, #1
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
112dca: 280f cmp r0, #15
112dcc: d112 bne.n 112df4 <msdos_dir_read+0xf8>
if (lfn_start == FAT_FILE_SHORT_NAME)
112dce: 9904 ldr r1, [sp, #16]
112dd0: 3101 adds r1, #1
is_first_entry = false;
112dd2: bf18 it ne
112dd4: 2300 movne r3, #0
if (lfn_start == FAT_FILE_SHORT_NAME)
112dd6: f000 80c7 beq.w 112f68 <msdos_dir_read+0x26c>
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
112dda: 9906 ldr r1, [sp, #24]
112ddc: f002 023f and.w r2, r2, #63 ; 0x3f
112de0: 428a cmp r2, r1
112de2: d104 bne.n 112dee <msdos_dir_read+0xf2>
MSDOS_LAST_LONG_ENTRY_MASK)) ||
112de4: 7b72 ldrb r2, [r6, #13]
112de6: 990d ldr r1, [sp, #52] ; 0x34
112de8: 428a cmp r2, r1
112dea: f000 8107 beq.w 112ffc <msdos_dir_read+0x300> <== NEVER TAKEN
lfn_start = FAT_FILE_SHORT_NAME;
112dee: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
112df2: 9304 str r3, [sp, #16]
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112df4: 3420 adds r4, #32
112df6: f1ba 0f00 cmp.w sl, #0
112dfa: f000 8112 beq.w 113022 <msdos_dir_read+0x326>
char* entry = (char*) fs_info->cl_buf + i;
112dfe: f8d9 30c8 ldr.w r3, [r9, #200] ; 0xc8
112e02: f1a4 0520 sub.w r5, r4, #32
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
112e06: 5d5a ldrb r2, [r3, r5]
char* entry = (char*) fs_info->cl_buf + i;
112e08: 195e adds r6, r3, r5
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
112e0a: 2a00 cmp r2, #0
112e0c: f000 8111 beq.w 113032 <msdos_dir_read+0x336>
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) == MSDOS_THIS_DIR_ENTRY_EMPTY)
112e10: 2ae5 cmp r2, #229 ; 0xe5
112e12: f000 808c beq.w 112f2e <msdos_dir_read+0x232>
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
112e16: 7af1 ldrb r1, [r6, #11]
112e18: f011 0f08 tst.w r1, #8
112e1c: f001 003f and.w r0, r1, #63 ; 0x3f
112e20: d1c8 bne.n 112db4 <msdos_dir_read+0xb8>
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
112e22: 280f cmp r0, #15
112e24: f000 8126 beq.w 113074 <msdos_dir_read+0x378> <== ALWAYS TAKEN
fat_dir_pos_t dir_pos;
/*
* Skip active entries until get the entry to start from.
*/
if (start)
112e28: 9b03 ldr r3, [sp, #12]
112e2a: 2b00 cmp r3, #0
112e2c: f040 808b bne.w 112f46 <msdos_dir_read+0x24a>
* unfortunately there is no method to extract ino except to
* open fat-file descriptor :( ... so, open it
*/
/* get number of cluster we are working with */
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
112e30: ab16 add r3, sp, #88 ; 0x58
tmp_dirent.d_type = DT_REG;
112e32: f011 0f10 tst.w r1, #16
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
112e36: 9300 str r3, [sp, #0]
tmp_dirent.d_type = DT_REG;
112e38: bf14 ite ne
112e3a: 2304 movne r3, #4
112e3c: 2308 moveq r3, #8
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
112e3e: 9908 ldr r1, [sp, #32]
112e40: f88d 3082 strb.w r3, [sp, #130] ; 0x82
112e44: 2201 movs r2, #1
112e46: 9b07 ldr r3, [sp, #28]
112e48: 4648 mov r0, r9
112e4a: f7fa ff55 bl 10dcf8 <fat_file_ioctl>
j * bts2rd, &cur_cln);
if (rc != RC_OK)
112e4e: 2800 cmp r0, #0
112e50: f040 80f1 bne.w 113036 <msdos_dir_read+0x33a> <== ALWAYS TAKEN
msdos_fs_unlock(fs_info);
return rc;
}
fat_dir_pos_init(&dir_pos);
dir_pos.sname.cln = cur_cln;
112e54: 9b16 ldr r3, [sp, #88] ; 0x58
dir_pos.sname.ofs = i;
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
112e56: a918 add r1, sp, #96 ; 0x60
112e58: aa15 add r2, sp, #84 ; 0x54
112e5a: 4648 mov r0, r9
dir_pos.sname.cln = cur_cln;
112e5c: e9cd 3518 strd r3, r5, [sp, #96] ; 0x60
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
112e60: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
112e64: e9cd 331a strd r3, r3, [sp, #104] ; 0x68
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
112e68: f7fa fd24 bl 10d8b4 <fat_file_open>
if (rc != RC_OK)
112e6c: 2800 cmp r0, #0
112e6e: f040 80e2 bne.w 113036 <msdos_dir_read+0x33a> <== ALWAYS TAKEN
/* fill in dirent structure */
/* XXX: from what and in what d_off should be computed ?! */
tmp_dirent.d_off = start + cmpltd;
tmp_dirent.d_reclen = sizeof(struct dirent);
tmp_dirent.d_ino = tmp_fat_fd->ino;
112e72: 9b03 ldr r3, [sp, #12]
* convertable to utf8 string. If not return the short file
* name.
*/
if (lfn_start != FAT_FILE_SHORT_NAME)
{
if (lfn_entries == 0 &&
112e74: 9a06 ldr r2, [sp, #24]
tmp_dirent.d_off = start + cmpltd;
112e76: 971e str r7, [sp, #120] ; 0x78
tmp_dirent.d_ino = tmp_fat_fd->ino;
112e78: 931d str r3, [sp, #116] ; 0x74
112e7a: 9b15 ldr r3, [sp, #84] ; 0x54
112e7c: 68db ldr r3, [r3, #12]
112e7e: 931c str r3, [sp, #112] ; 0x70
tmp_dirent.d_off = start + cmpltd;
112e80: 17fb asrs r3, r7, #31
112e82: 931f str r3, [sp, #124] ; 0x7c
if (lfn_entries == 0 &&
112e84: 9b04 ldr r3, [sp, #16]
112e86: 3301 adds r3, #1
112e88: bf18 it ne
112e8a: 2301 movne r3, #1
112e8c: 2a00 cmp r2, #0
112e8e: bf18 it ne
112e90: 2300 movne r3, #0
tmp_dirent.d_reclen = sizeof(struct dirent);
112e92: f44f 728c mov.w r2, #280 ; 0x118
112e96: f8ad 2080 strh.w r2, [sp, #128] ; 0x80
if (lfn_entries == 0 &&
112e9a: 2b00 cmp r3, #0
112e9c: f040 808b bne.w 112fb6 <msdos_dir_read+0x2ba>
112ea0: f10d 0b86 add.w fp, sp, #134 ; 0x86
112ea4: f10d 0a5c add.w sl, sp, #92 ; 0x5c
/*
* 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(
112ea8: 9d09 ldr r5, [sp, #36] ; 0x24
size_t len = sizeof(tmp_dirent.d_name) - 1;
112eaa: 23ff movs r3, #255 ; 0xff
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
112eac: 4631 mov r1, r6
size_t len = sizeof(tmp_dirent.d_name) - 1;
112eae: f8ca 3000 str.w r3, [sl]
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
112eb2: 4628 mov r0, r5
112eb4: f7fb fe98 bl 10ebe8 <msdos_format_dirent_with_dot>
sfn_buf, entry); /* src text */
eno = (*convert_handler->codepage_to_utf8) (
112eb8: 9e0b ldr r6, [sp, #44] ; 0x2c
112eba: b282 uxth r2, r0
112ebc: f8cd a000 str.w sl, [sp]
112ec0: 465b mov r3, fp
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
112ec2: f8ad 0084 strh.w r0, [sp, #132] ; 0x84
eno = (*convert_handler->codepage_to_utf8) (
112ec6: 4629 mov r1, r5
112ec8: 6876 ldr r6, [r6, #4]
112eca: 980a ldr r0, [sp, #40] ; 0x28
112ecc: 47b0 blx r6
converter,
sfn_buf,
tmp_dirent.d_namlen,
(uint8_t *) &tmp_dirent.d_name[0],
&len);
if ( 0 == eno ) {
112ece: 2800 cmp r0, #0
112ed0: d164 bne.n 112f9c <msdos_dir_read+0x2a0> <== ALWAYS TAKEN
tmp_dirent.d_namlen = len;
112ed2: f8da 3000 ldr.w r3, [sl]
tmp_dirent.d_name[len] = '\0';
112ed6: aa1c add r2, sp, #112 ; 0x70
tmp_dirent.d_namlen = len;
112ed8: f8ad 3084 strh.w r3, [sp, #132] ; 0x84
tmp_dirent.d_name[len] = '\0';
112edc: 4413 add r3, r2
112ede: 7598 strb r0, [r3, #22]
112ee0: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
112ee4: 9304 str r3, [sp, #16]
if ( cmpltd >= 0 ) {
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
iop->offset = iop->offset + sizeof(struct dirent);
cmpltd += (sizeof(struct dirent));
count -= (sizeof(struct dirent));
112ee6: 9b05 ldr r3, [sp, #20]
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
112ee8: a91c add r1, sp, #112 ; 0x70
112eea: f44f 728c mov.w r2, #280 ; 0x118
count -= (sizeof(struct dirent));
112eee: f5a3 738c sub.w r3, r3, #280 ; 0x118
112ef2: 9305 str r3, [sp, #20]
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
112ef4: 9b0c ldr r3, [sp, #48] ; 0x30
112ef6: 19d8 adds r0, r3, r7
cmpltd += (sizeof(struct dirent));
112ef8: f507 778c add.w r7, r7, #280 ; 0x118
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
112efc: f002 e980 blx 115200 <memcpy>
iop->offset = iop->offset + sizeof(struct dirent);
112f00: f8d8 3008 ldr.w r3, [r8, #8]
/* inode number extracted, close fat-file */
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
112f04: 4648 mov r0, r9
112f06: 9915 ldr r1, [sp, #84] ; 0x54
iop->offset = iop->offset + sizeof(struct dirent);
112f08: f513 738c adds.w r3, r3, #280 ; 0x118
112f0c: f8c8 3008 str.w r3, [r8, #8]
112f10: f8d8 300c ldr.w r3, [r8, #12]
112f14: f143 0300 adc.w r3, r3, #0
112f18: f8c8 300c str.w r3, [r8, #12]
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
112f1c: f7fa feb0 bl 10dc80 <fat_file_close>
if (rc != RC_OK)
112f20: 2800 cmp r0, #0
112f22: f040 8088 bne.w 113036 <msdos_dir_read+0x33a> <== ALWAYS TAKEN
return rc;
}
}
}
if (count <= 0)
112f26: 9b05 ldr r3, [sp, #20]
112f28: 2b00 cmp r3, #0
112f2a: f000 8082 beq.w 113032 <msdos_dir_read+0x336> <== NEVER TAKEN
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112f2e: 9b02 ldr r3, [sp, #8]
112f30: ea6f 0b07 mvn.w fp, r7
112f34: ea4f 7bdb mov.w fp, fp, lsr #31
112f38: 429c cmp r4, r3
112f3a: bf2c ite cs
112f3c: f04f 0a00 movcs.w sl, #0
112f40: f00b 0a01 andcc.w sl, fp, #1
112f44: e756 b.n 112df4 <msdos_dir_read+0xf8>
start--;
112f46: 3b01 subs r3, #1
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112f48: ea6f 0b07 mvn.w fp, r7
start--;
112f4c: 9303 str r3, [sp, #12]
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
112f4e: ea4f 7bdb mov.w fp, fp, lsr #31
112f52: 9b02 ldr r3, [sp, #8]
112f54: 429c cmp r4, r3
112f56: bf2c ite cs
112f58: f04f 0a00 movcs.w sl, #0
112f5c: f00b 0a01 andcc.w sl, fp, #1
lfn_start = FAT_FILE_SHORT_NAME;
112f60: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
112f64: 9304 str r3, [sp, #16]
112f66: e745 b.n 112df4 <msdos_dir_read+0xf8>
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
112f68: 9310 str r3, [sp, #64] ; 0x40
112f6a: 0653 lsls r3, r2, #25
112f6c: f57f af42 bpl.w 112df4 <msdos_dir_read+0xf8>
lfn_entries = (*MSDOS_DIR_ENTRY_TYPE(entry) &
112f70: f002 033f and.w r3, r2, #63 ; 0x3f
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
112f74: 2100 movs r1, #0
lfn_entries = (*MSDOS_DIR_ENTRY_TYPE(entry) &
112f76: 9306 str r3, [sp, #24]
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
112f78: f10d 0086 add.w r0, sp, #134 ; 0x86
lfn_start =
112f7c: 9b11 ldr r3, [sp, #68] ; 0x44
112f7e: 191a adds r2, r3, r4
112f80: 0953 lsrs r3, r2, #5
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
112f82: f44f 7280 mov.w r2, #256 ; 0x100
lfn_start =
112f86: 9304 str r3, [sp, #16]
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
112f88: 7b73 ldrb r3, [r6, #13]
112f8a: 930d str r3, [sp, #52] ; 0x34
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
112f8c: f002 fba8 bl 1156e0 <memset>
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
112f90: 9b10 ldr r3, [sp, #64] ; 0x40
lfn_len = 0;
112f92: 2100 movs r1, #0
112f94: 910e str r1, [sp, #56] ; 0x38
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
112f96: 5d5a ldrb r2, [r3, r5]
is_first_entry = true;
112f98: 2301 movs r3, #1
112f9a: e71e b.n 112dda <msdos_dir_read+0xde>
cmpltd = -1;
112f9c: f04f 39ff mov.w r9, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = eno;
112fa0: 4605 mov r5, r0 <== NOT EXECUTED
112fa2: f001 fe6d bl 114c80 <__errno> <== NOT EXECUTED
112fa6: 6005 str r5, [r0, #0] <== NOT EXECUTED
_Mutex_recursive_Release( mutex );
112fa8: 9812 ldr r0, [sp, #72] ; 0x48
112faa: f7f7 f801 bl 109fb0 <_Mutex_recursive_Release>
j++;
}
msdos_fs_unlock(fs_info);
return cmpltd;
}
112fae: 4648 mov r0, r9
112fb0: b063 add sp, #396 ; 0x18c
112fb2: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
lfn_checksum == msdos_lfn_checksum(entry)) {
112fb6: 4630 mov r0, r6
112fb8: f7fb fb94 bl 10e6e4 <msdos_lfn_checksum>
if (lfn_entries == 0 &&
112fbc: 9b0d ldr r3, [sp, #52] ; 0x34
112fbe: 4298 cmp r0, r3
112fc0: f47f af6e bne.w 112ea0 <msdos_dir_read+0x1a4> <== ALWAYS TAKEN
size_t len = sizeof(tmp_dirent.d_name) - 1;
112fc4: f10d 0a5c add.w sl, sp, #92 ; 0x5c
112fc8: 23ff movs r3, #255 ; 0xff
eno = (*convert_handler->utf16_to_utf8) (
112fca: f8cd a000 str.w sl, [sp]
112fce: f10d 0b86 add.w fp, sp, #134 ; 0x86
size_t len = sizeof(tmp_dirent.d_name) - 1;
112fd2: f8ca 3000 str.w r3, [sl]
eno = (*convert_handler->utf16_to_utf8) (
112fd6: 9b0b ldr r3, [sp, #44] ; 0x2c
112fd8: 9a0e ldr r2, [sp, #56] ; 0x38
112fda: e9dd 1009 ldrd r1, r0, [sp, #36] ; 0x24
112fde: 68db ldr r3, [r3, #12]
112fe0: 461d mov r5, r3
112fe2: 465b mov r3, fp
112fe4: 47a8 blx r5
if (eno == 0) {
112fe6: 2800 cmp r0, #0
112fe8: f47f af5e bne.w 112ea8 <msdos_dir_read+0x1ac>
tmp_dirent.d_namlen = len;
112fec: f8da 3000 ldr.w r3, [sl]
tmp_dirent.d_name[len] = '\0';
112ff0: aa1c add r2, sp, #112 ; 0x70
tmp_dirent.d_namlen = len;
112ff2: f8ad 3084 strh.w r3, [sp, #132] ; 0x84
tmp_dirent.d_name[len] = '\0';
112ff6: 4413 add r3, r2
112ff8: 7598 strb r0, [r3, #22]
if (lfn_start == FAT_FILE_SHORT_NAME) {
112ffa: e774 b.n 112ee6 <msdos_dir_read+0x1ea>
lfn_entries--;
112ffc: 9a06 ldr r2, [sp, #24]
lfn_len += msdos_get_utf16_string_from_long_entry (
112ffe: 4630 mov r0, r6
113000: 9d13 ldr r5, [sp, #76] ; 0x4c
lfn_entries--;
113002: 1e51 subs r1, r2, #1
offset_lfn = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
113004: eb01 0241 add.w r2, r1, r1, lsl #1
lfn_entries--;
113008: 9106 str r1, [sp, #24]
offset_lfn = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
11300a: eb01 0282 add.w r2, r1, r2, lsl #2
lfn_len += msdos_get_utf16_string_from_long_entry (
11300e: 9909 ldr r1, [sp, #36] ; 0x24
113010: eb01 0142 add.w r1, r1, r2, lsl #1
113014: 1aaa subs r2, r5, r2
113016: f7fb fddf bl 10ebd8 <msdos_get_utf16_string_from_long_entry>
11301a: 9b0e ldr r3, [sp, #56] ; 0x38
11301c: 4403 add r3, r0
11301e: 930e str r3, [sp, #56] ; 0x38
if (count <= 0)
113020: e6e8 b.n 112df4 <msdos_dir_read+0xf8>
while (count > 0 && cmpltd >= 0)
113022: 9b07 ldr r3, [sp, #28]
113024: 9a0f ldr r2, [sp, #60] ; 0x3c
113026: 4413 add r3, r2
113028: 9307 str r3, [sp, #28]
11302a: f1bb 0f00 cmp.w fp, #0
11302e: f47f aeac bne.w 112d8a <msdos_dir_read+0x8e> <== NEVER TAKEN
113032: 46b9 mov r9, r7
113034: e7b8 b.n 112fa8 <msdos_dir_read+0x2ac>
113036: 4603 mov r3, r0 <== NOT EXECUTED
113038: 9812 ldr r0, [sp, #72] ; 0x48 <== NOT EXECUTED
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
11303a: 4699 mov r9, r3 <== NOT EXECUTED
11303c: f7f6 ffb8 bl 109fb0 <_Mutex_recursive_Release> <== NOT EXECUTED
}
113040: 4648 mov r0, r9 <== NOT EXECUTED
113042: b063 add sp, #396 ; 0x18c <== NOT EXECUTED
113044: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
113048: 9a08 ldr r2, [sp, #32]
11304a: 6a53 ldr r3, [r2, #36] ; 0x24
11304c: 2b00 cmp r3, #0
11304e: f47f ae8c bne.w 112d6a <msdos_dir_read+0x6e> <== ALWAYS TAKEN
113052: 7dbb ldrb r3, [r7, #22]
113054: 079b lsls r3, r3, #30
113056: f43f ae88 beq.w 112d6a <msdos_dir_read+0x6e> <== ALWAYS TAKEN
fat_fd->fat_file_size :
11305a: 6993 ldr r3, [r2, #24]
11305c: 930f str r3, [sp, #60] ; 0x3c
11305e: e686 b.n 112d6e <msdos_dir_read+0x72>
113060: 9812 ldr r0, [sp, #72] ; 0x48 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
113062: f04f 39ff mov.w r9, #4294967295 ; 0xffffffff <== NOT EXECUTED
113066: f7f6 ffa3 bl 109fb0 <_Mutex_recursive_Release> <== NOT EXECUTED
11306a: f001 fe09 bl 114c80 <__errno> <== NOT EXECUTED
11306e: 2305 movs r3, #5 <== NOT EXECUTED
113070: 6003 str r3, [r0, #0] <== NOT EXECUTED
113072: e79c b.n 112fae <msdos_dir_read+0x2b2> <== NOT EXECUTED
for (i = 0; i < ret && cmpltd >= 0; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
113074: 9902 ldr r1, [sp, #8] <== NOT EXECUTED
113076: ea6f 0b07 mvn.w fp, r7 <== NOT EXECUTED
11307a: ea4f 7bdb mov.w fp, fp, lsr #31 <== NOT EXECUTED
11307e: 428c cmp r4, r1 <== NOT EXECUTED
113080: bf2c ite cs <== NOT EXECUTED
113082: f04f 0a00 movcs.w sl, #0 <== NOT EXECUTED
113086: f00b 0a01 andcc.w sl, fp, #1 <== NOT EXECUTED
11308a: e6a0 b.n 112dce <msdos_dir_read+0xd2> <== NOT EXECUTED
ssize_t cmpltd = 0;
11308c: f8dd 9014 ldr.w r9, [sp, #20] <== NOT EXECUTED
113090: e78a b.n 112fa8 <msdos_dir_read+0x2ac> <== NOT EXECUTED
113092: bf00 nop
00113258 <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;
113258: 6a41 ldr r1, [r0, #36] ; 0x24
{
11325a: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
11325e: b084 sub sp, #16
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
113260: 6984 ldr r4, [r0, #24]
{
113262: 4699 mov r9, r3
113264: 4615 mov r5, r2
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
113266: 688e ldr r6, [r1, #8]
113268: f106 0ab0 add.w sl, r6, #176 ; 0xb0
_Mutex_recursive_Acquire( mutex );
11326c: 4650 mov r0, sl
11326e: f7f6 fe6d bl 109f4c <_Mutex_recursive_Acquire>
uint32_t old_length;
msdos_fs_lock(fs_info);
old_length = fat_fd->fat_file_size;
113272: 69a7 ldr r7, [r4, #24]
if (length < old_length) {
113274: 42bd cmp r5, r7
113276: f179 0300 sbcs.w r3, r9, #0
11327a: da0d bge.n 113298 <msdos_file_ftruncate+0x40>
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
11327c: 462a mov r2, r5
11327e: 4630 mov r0, r6
113280: 4621 mov r1, r4
113282: f7fa fcb3 bl 10dbec <fat_file_truncate>
errno = ENOSPC;
rc = -1;
}
}
if (rc == RC_OK)
113286: 4680 mov r8, r0
113288: b1b0 cbz r0, 1132b8 <msdos_file_ftruncate+0x60>
_Mutex_recursive_Release( mutex );
11328a: 4650 mov r0, sl <== NOT EXECUTED
11328c: f7f6 fe90 bl 109fb0 <_Mutex_recursive_Release> <== NOT EXECUTED
}
msdos_fs_unlock(fs_info);
return rc;
}
113290: 4640 mov r0, r8 <== NOT EXECUTED
113292: b004 add sp, #16 <== NOT EXECUTED
113294: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
rc = fat_file_extend(&fs_info->fat,
113298: ab03 add r3, sp, #12
11329a: 2201 movs r2, #1
11329c: 9300 str r3, [sp, #0]
11329e: 4621 mov r1, r4
1132a0: 462b mov r3, r5
1132a2: 4630 mov r0, r6
1132a4: f7fa fd68 bl 10dd78 <fat_file_extend>
if (rc == RC_OK && length != new_length) {
1132a8: 4680 mov r8, r0
1132aa: 2800 cmp r0, #0
1132ac: d1ed bne.n 11328a <msdos_file_ftruncate+0x32> <== ALWAYS TAKEN
1132ae: 9b03 ldr r3, [sp, #12]
1132b0: 4548 cmp r0, r9
1132b2: bf08 it eq
1132b4: 42ab cmpeq r3, r5
1132b6: d11a bne.n 1132ee <msdos_file_ftruncate+0x96> <== ALWAYS TAKEN
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
1132b8: f894 3030 ldrb.w r3, [r4, #48] ; 0x30
fat_file_set_ctime_mtime(fat_fd, time(NULL));
1132bc: 2000 movs r0, #0
fat_fd->fat_file_size = s;
1132be: 61a5 str r5, [r4, #24]
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
1132c0: f043 0302 orr.w r3, r3, #2
1132c4: f884 3030 strb.w r3, [r4, #48] ; 0x30
1132c8: f004 fe36 bl 117f38 <time>
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
1132cc: f894 3030 ldrb.w r3, [r4, #48] ; 0x30
fat_fd->ctime = t;
1132d0: e9c4 0110 strd r0, r1, [r4, #64] ; 0x40
fat_fd->mtime = t;
1132d4: 64a0 str r0, [r4, #72] ; 0x48
1132d6: 4650 mov r0, sl
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
1132d8: f043 0302 orr.w r3, r3, #2
fat_fd->mtime = t;
1132dc: 64e1 str r1, [r4, #76] ; 0x4c
fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
1132de: f884 3030 strb.w r3, [r4, #48] ; 0x30
1132e2: f7f6 fe65 bl 109fb0 <_Mutex_recursive_Release>
}
1132e6: 4640 mov r0, r8
1132e8: b004 add sp, #16
1132ea: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
fat_file_truncate(&fs_info->fat, fat_fd, old_length);
1132ee: 463a mov r2, r7 <== NOT EXECUTED
1132f0: 4621 mov r1, r4 <== NOT EXECUTED
1132f2: 4630 mov r0, r6 <== NOT EXECUTED
rc = -1;
1132f4: f04f 38ff mov.w r8, #4294967295 ; 0xffffffff <== NOT EXECUTED
fat_file_truncate(&fs_info->fat, fat_fd, old_length);
1132f8: f7fa fc78 bl 10dbec <fat_file_truncate> <== NOT EXECUTED
errno = ENOSPC;
1132fc: f001 fcc0 bl 114c80 <__errno> <== NOT EXECUTED
113300: 231c movs r3, #28 <== NOT EXECUTED
113302: 6003 str r3, [r0, #0] <== NOT EXECUTED
if (rc == RC_OK)
113304: e7c1 b.n 11328a <msdos_file_ftruncate+0x32> <== NOT EXECUTED
113306: bf00 nop
001128cc <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
1128cc: f891 c000 ldrb.w ip, [r1]
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)
{
1128d0: b530 push {r4, r5, lr}
1128d2: b085 sub sp, #20
1128d4: 9c08 ldr r4, [sp, #32]
if ( src_name[0] == UTF8_FULL_STOP
1128d6: f1bc 0f2e cmp.w ip, #46 ; 0x2e
ssize_t returned_size = 0;
int eno = 0;
size_t name_size;
size_t dest_size = long_name_size;
1128da: 9403 str r4, [sp, #12]
if ( src_name[0] == UTF8_FULL_STOP
1128dc: d01f beq.n 11291e <msdos_filename_utf8_to_long_name_for_compare+0x52><== ALWAYS TAKEN
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
1128de: 2a00 cmp r2, #0
ssize_t size_returned = filename_size;
1128e0: 4694 mov ip, r2
size_returned >= UTF8_FULL_STOP_SIZE
1128e2: bfc8 it gt
1128e4: 188a addgt r2, r1, r2
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
1128e6: dc05 bgt.n 1128f4 <msdos_filename_utf8_to_long_name_for_compare+0x28><== NEVER TAKEN
if (returned_size == 0) {
name_size = msdos_filename_delete_trailing_dots (
&utf8_name[0],
utf8_name_size);
if (name_size > 0) {
1128e8: d10a bne.n 112900 <msdos_filename_utf8_to_long_name_for_compare+0x34><== NOT EXECUTED
&dest_size);
if (eno == 0) {
returned_size = (ssize_t)dest_size;
}
} else {
eno = EINVAL;
1128ea: 2416 movs r4, #22 <== NOT EXECUTED
1128ec: e00f b.n 11290e <msdos_filename_utf8_to_long_name_for_compare+0x42> <== NOT EXECUTED
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
1128ee: f1bc 0c01 subs.w ip, ip, #1
1128f2: d0fa beq.n 1128ea <msdos_filename_utf8_to_long_name_for_compare+0x1e><== ALWAYS TAKEN
&& filename_utf8[i] == UTF8_FULL_STOP;) {
1128f4: f812 ed01 ldrb.w lr, [r2, #-1]!
1128f8: f1be 0f2e cmp.w lr, #46 ; 0x2e
1128fc: d0f7 beq.n 1128ee <msdos_filename_utf8_to_long_name_for_compare+0x22>
name_size = msdos_filename_delete_trailing_dots (
1128fe: 4662 mov r2, ip
eno = (*converter->handler->utf8_normalize_and_fold) (
112900: 6804 ldr r4, [r0, #0]
112902: ad03 add r5, sp, #12
112904: 9500 str r5, [sp, #0]
112906: 6924 ldr r4, [r4, #16]
112908: 47a0 blx r4
if (eno == 0) {
11290a: 4604 mov r4, r0
11290c: b1b0 cbz r0, 11293c <msdos_filename_utf8_to_long_name_for_compare+0x70>
}
}
if ( eno != 0 ) {
errno = eno;
11290e: f002 f9b7 bl 114c80 <__errno> <== NOT EXECUTED
112912: 4603 mov r3, r0 <== NOT EXECUTED
returned_size = -1;
112914: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = eno;
112918: 601c str r4, [r3, #0] <== NOT EXECUTED
}
return returned_size;
}
11291a: b005 add sp, #20 <== NOT EXECUTED
11291c: bd30 pop {r4, r5, pc} <== NOT EXECUTED
&& src_size == UTF8_FULL_STOP_SIZE) {
11291e: 2a01 cmp r2, #1 <== NOT EXECUTED
112920: d00f beq.n 112942 <msdos_filename_utf8_to_long_name_for_compare+0x76><== NOT EXECUTED
&& src_name[1] == UTF8_FULL_STOP
112922: 784d ldrb r5, [r1, #1] <== NOT EXECUTED
&& src_size == ( 2 * UTF8_FULL_STOP_SIZE ) ) {
112924: 2d2e cmp r5, #46 ; 0x2e <== NOT EXECUTED
112926: bf08 it eq <== NOT EXECUTED
112928: 2a02 cmpeq r2, #2 <== NOT EXECUTED
11292a: d1d8 bne.n 1128de <msdos_filename_utf8_to_long_name_for_compare+0x12><== NOT EXECUTED
if (dest_size >= 2 * UTF8_FULL_STOP_SIZE) {
11292c: 2c01 cmp r4, #1 <== NOT EXECUTED
11292e: d90e bls.n 11294e <msdos_filename_utf8_to_long_name_for_compare+0x82><== NOT EXECUTED
returned_size = 2 * UTF8_FULL_STOP_SIZE;
112930: 2002 movs r0, #2 <== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
112932: f883 c000 strb.w ip, [r3] <== NOT EXECUTED
dest_name[1] = UTF8_FULL_STOP;
112936: f883 c001 strb.w ip, [r3, #1] <== NOT EXECUTED
if (returned_size == 0) {
11293a: e7ee b.n 11291a <msdos_filename_utf8_to_long_name_for_compare+0x4e> <== NOT EXECUTED
returned_size = (ssize_t)dest_size;
11293c: 9803 ldr r0, [sp, #12]
}
11293e: b005 add sp, #20
112940: bd30 pop {r4, r5, pc}
if (dest_size >= UTF8_FULL_STOP_SIZE) {
112942: b124 cbz r4, 11294e <msdos_filename_utf8_to_long_name_for_compare+0x82><== NOT EXECUTED
returned_size = UTF8_FULL_STOP_SIZE;
112944: 4610 mov r0, r2 <== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
112946: f883 c000 strb.w ip, [r3] <== NOT EXECUTED
}
11294a: b005 add sp, #20 <== NOT EXECUTED
11294c: bd30 pop {r4, r5, pc} <== NOT EXECUTED
errno = eno;
11294e: f002 f997 bl 114c80 <__errno> <== NOT EXECUTED
112952: 225b movs r2, #91 ; 0x5b <== NOT EXECUTED
112954: 4603 mov r3, r0 <== NOT EXECUTED
112956: 601a str r2, [r3, #0] <== NOT EXECUTED
112958: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
11295c: e7dd b.n 11291a <msdos_filename_utf8_to_long_name_for_compare+0x4e> <== NOT EXECUTED
11295e: bf00 nop
00112960 <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)
{
112960: b5f0 push {r4, r5, r6, r7, lr}
112962: b085 sub sp, #20
112964: 9c0a ldr r4, [sp, #40] ; 0x28
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
112966: 2a00 cmp r2, #0
112968: bfc8 it gt
11296a: 4694 movgt ip, r2
{
11296c: 461e mov r6, r3
11296e: bfc8 it gt
112970: eb01 020c addgt.w r2, r1, ip
size_t name_size_tmp;
int i;
uint16_t c;
unsigned int chars_written;
name_size_tmp = long_name_size;
112974: 9403 str r4, [sp, #12]
for ( i = size_returned - UTF8_FULL_STOP_SIZE;
112976: dc03 bgt.n 112980 <msdos_filename_utf8_to_long_name_for_save+0x20> <== NEVER TAKEN
112978: e009 b.n 11298e <msdos_filename_utf8_to_long_name_for_save+0x2e> <== NOT EXECUTED
11297a: f1bc 0c01 subs.w ip, ip, #1
11297e: d078 beq.n 112a72 <msdos_filename_utf8_to_long_name_for_save+0x112> <== ALWAYS TAKEN
&& filename_utf8[i] == UTF8_FULL_STOP;) {
112980: f812 ed01 ldrb.w lr, [r2, #-1]!
112984: f1be 0f2e cmp.w lr, #46 ; 0x2e
112988: d0f7 beq.n 11297a <msdos_filename_utf8_to_long_name_for_save+0x1a>
name_size = msdos_filename_delete_trailing_dots (
11298a: 4662 mov r2, ip
&utf8_name[0],
utf8_name_size);
if (name_size > 0) {
11298c: e000 b.n 112990 <msdos_filename_utf8_to_long_name_for_save+0x30>
11298e: d070 beq.n 112a72 <msdos_filename_utf8_to_long_name_for_save+0x112> <== NOT EXECUTED
/*
* Finally convert from UTF-8 to UTF-16
*/
eno = (*converter->handler->utf8_to_utf16) (
112990: 6803 ldr r3, [r0, #0]
112992: ad03 add r5, sp, #12
112994: 9500 str r5, [sp, #0]
112996: 689d ldr r5, [r3, #8]
112998: 4633 mov r3, r6
11299a: 47a8 blx r5
converter,
utf8_name,
name_size,
&long_name[0],
&name_size_tmp);
if (eno == 0) {
11299c: 4605 mov r5, r0
11299e: 2800 cmp r0, #0
1129a0: d153 bne.n 112a4a <msdos_filename_utf8_to_long_name_for_save+0xea> <== ALWAYS TAKEN
if (name_size_tmp <= (MSDOS_NAME_MAX_LNF_LEN * MSDOS_NAME_LFN_BYTES_PER_CHAR))
1129a2: 9803 ldr r0, [sp, #12]
1129a4: f5b0 7fff cmp.w r0, #510 ; 0x1fe
1129a8: d84e bhi.n 112a48 <msdos_filename_utf8_to_long_name_for_save+0xe8>
if ( eno == 0 )
{
/*
* Validate the characters and assign them to the UTF-16 file name
*/
for ( i = 0;
1129aa: f06f 0301 mvn.w r3, #1
1129ae: 2800 cmp r0, #0
1129b0: d03f beq.n 112a32 <msdos_filename_utf8_to_long_name_for_save+0xd2> <== ALWAYS TAKEN
retval = codepage_valid_char_map[char_num];
1129b2: f64c 3eb4 movw lr, #52148 ; 0xcbb4
1129b6: 4631 mov r1, r6
1129b8: f2c0 0e11 movt lr, #17
name_size
&& (c = msdos_get_valid_utf16_filename_character ( long_name[i]) );
1129bc: 468c mov ip, r1
1129be: f831 2b02 ldrh.w r2, [r1], #2
if ( char_num <= 0x00ff ) {
1129c2: 2aff cmp r2, #255 ; 0xff
1129c4: d82a bhi.n 112a1c <msdos_filename_utf8_to_long_name_for_save+0xbc>
switch ( char_num )
1129c6: 2a5d cmp r2, #93 ; 0x5d
1129c8: d821 bhi.n 112a0e <msdos_filename_utf8_to_long_name_for_save+0xae>
1129ca: 2a2a cmp r2, #42 ; 0x2a
1129cc: f1a2 032b sub.w r3, r2, #43 ; 0x2b
1129d0: d921 bls.n 112a16 <msdos_filename_utf8_to_long_name_for_save+0xb6>
1129d2: 2b32 cmp r3, #50 ; 0x32
1129d4: d81f bhi.n 112a16 <msdos_filename_utf8_to_long_name_for_save+0xb6> <== ALWAYS TAKEN
1129d6: e8df f003 tbb [pc, r3]
1129da: 2121 .short 0x2121
1129dc: 1e1e211e .word 0x1e1e211e
1129e0: 1e1e1e1e .word 0x1e1e1e1e
1129e4: 1e1e1e1e .word 0x1e1e1e1e
1129e8: 1e211e1e .word 0x1e211e1e
1129ec: 1e1e1e21 .word 0x1e1e1e21
1129f0: 1e1e1e1e .word 0x1e1e1e1e
1129f4: 1e1e1e1e .word 0x1e1e1e1e
1129f8: 1e1e1e1e .word 0x1e1e1e1e
1129fc: 1e1e1e1e .word 0x1e1e1e1e
112a00: 1e1e1e1e .word 0x1e1e1e1e
112a04: 1e1e1e1e .word 0x1e1e1e1e
112a08: 1e211e1e .word 0x1e211e1e
112a0c: 21 .byte 0x21
112a0d: 00 .byte 0x00
112a0e: f1a2 0361 sub.w r3, r2, #97 ; 0x61
112a12: 2b19 cmp r3, #25
112a14: d902 bls.n 112a1c <msdos_filename_utf8_to_long_name_for_save+0xbc>
retval = codepage_valid_char_map[char_num];
112a16: f81e 2002 ldrb.w r2, [lr, r2]
&& (c = msdos_get_valid_utf16_filename_character ( long_name[i]) );
112a1a: b17a cbz r2, 112a3c <msdos_filename_utf8_to_long_name_for_save+0xdc>
for ( i = 0;
112a1c: 3802 subs r0, #2
++i ) {
long_name[i] = c;
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
112a1e: f105 0502 add.w r5, r5, #2
long_name[i] = c;
112a22: f821 2c02 strh.w r2, [r1, #-2]
for ( i = 0;
112a26: d1c9 bne.n 1129bc <msdos_filename_utf8_to_long_name_for_save+0x5c>
long_name[i] = c;
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
}
else if ( name_size != 0 )
eno = EINVAL;
chars_written = returned_size / MSDOS_NAME_LFN_BYTES_PER_CHAR;
112a28: 1068 asrs r0, r5, #1
if ( long_name [chars_written - 1] != UTF16_NULL
112a2a: f100 4300 add.w r3, r0, #2147483648 ; 0x80000000
112a2e: 3b01 subs r3, #1
112a30: 005b lsls r3, r3, #1
112a32: 5af3 ldrh r3, [r6, r3]
112a34: b9fb cbnz r3, 112a76 <msdos_filename_utf8_to_long_name_for_save+0x116>
errno = eno;
returned_size = -1;
}
return returned_size;
}
112a36: 4628 mov r0, r5
112a38: b005 add sp, #20
112a3a: bdf0 pop {r4, r5, r6, r7, pc}
if ( name_size == UTF16_NULL_SIZE && c == UTF16_NULL ) {
112a3c: 2802 cmp r0, #2
112a3e: d10a bne.n 112a56 <msdos_filename_utf8_to_long_name_for_save+0xf6> <== NEVER TAKEN
returned_size += MSDOS_NAME_LFN_BYTES_PER_CHAR;
112a40: 3502 adds r5, #2 <== NOT EXECUTED
long_name[i] = c;
112a42: f8ac 2000 strh.w r2, [ip] <== NOT EXECUTED
112a46: e7ef b.n 112a28 <msdos_filename_utf8_to_long_name_for_save+0xc8> <== NOT EXECUTED
eno = ENAMETOOLONG;
112a48: 255b movs r5, #91 ; 0x5b
errno = eno;
112a4a: f002 f919 bl 114c80 <__errno>
112a4e: 6005 str r5, [r0, #0]
returned_size = -1;
112a50: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff
return returned_size;
112a54: e7ef b.n 112a36 <msdos_filename_utf8_to_long_name_for_save+0xd6>
chars_written = returned_size / MSDOS_NAME_LFN_BYTES_PER_CHAR;
112a56: 1069 asrs r1, r5, #1
if ( long_name [chars_written - 1] != UTF16_NULL
112a58: f101 4300 add.w r3, r1, #2147483648 ; 0x80000000
112a5c: 3b01 subs r3, #1
112a5e: f836 3013 ldrh.w r3, [r6, r3, lsl #1]
112a62: b133 cbz r3, 112a72 <msdos_filename_utf8_to_long_name_for_save+0x112>
&& (returned_size + UTF16_NULL_SIZE ) <= long_name_size ) {
112a64: 3502 adds r5, #2
112a66: 42a5 cmp r5, r4
eno = EINVAL;
112a68: bf9c itt ls
112a6a: 2516 movls r5, #22
long_name[chars_written] = UTF16_NULL;
112a6c: f826 2011 strhls.w r2, [r6, r1, lsl #1]
&& (returned_size + UTF16_NULL_SIZE ) <= long_name_size ) {
112a70: d9eb bls.n 112a4a <msdos_filename_utf8_to_long_name_for_save+0xea> <== NEVER TAKEN
eno = EINVAL;
112a72: 2516 movs r5, #22 <== NOT EXECUTED
112a74: e7e9 b.n 112a4a <msdos_filename_utf8_to_long_name_for_save+0xea> <== NOT EXECUTED
&& (returned_size + UTF16_NULL_SIZE ) <= long_name_size ) {
112a76: 1cab adds r3, r5, #2
112a78: 42a3 cmp r3, r4
112a7a: d8dc bhi.n 112a36 <msdos_filename_utf8_to_long_name_for_save+0xd6> <== ALWAYS TAKEN
long_name[chars_written] = UTF16_NULL;
112a7c: 2300 movs r3, #0
112a7e: f826 3010 strh.w r3, [r6, r0, lsl #1]
if ( eno != 0 ) {
112a82: e7d8 b.n 112a36 <msdos_filename_utf8_to_long_name_for_save+0xd6>
00112a84 <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)
{
112a84: b570 push {r4, r5, r6, lr}
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);
112a86: 2430 movs r4, #48 ; 0x30
{
112a88: b090 sub sp, #64 ; 0x40
112a8a: 461d mov r5, r3
size_t name_size_tmp = sizeof(name_normalized_buf);
112a8c: 9403 str r4, [sp, #12]
if ( src_name[0] == UTF8_FULL_STOP
112a8e: 780c ldrb r4, [r1, #0]
112a90: 2c2e cmp r4, #46 ; 0x2e
112a92: d01e beq.n 112ad2 <msdos_filename_utf8_to_short_name_for_compare+0x4e>
while ( *name_size >= UTF8_FULL_STOP_SIZE
112a94: b94a cbnz r2, 112aaa <msdos_filename_utf8_to_short_name_for_compare+0x26>
if ( eno == 0 ) {
memcpy (&dest_ptr[0], &name_ptr[0], name_size);
returned_size = name_size;
}
} else
eno = EINVAL;
112a96: 2616 movs r6, #22 <== NOT EXECUTED
}
if ( eno != 0 ) {
errno = eno;
112a98: f002 f8f2 bl 114c80 <__errno> <== NOT EXECUTED
112a9c: 4603 mov r3, r0 <== NOT EXECUTED
returned_size = -1;
112a9e: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = eno;
112aa2: 601e str r6, [r3, #0] <== NOT EXECUTED
}
return returned_size;
}
112aa4: b010 add sp, #64 ; 0x40
112aa6: bd70 pop {r4, r5, r6, pc}
112aa8: 4672 mov r2, lr <== NOT EXECUTED
eno = (*converter->handler->utf8_normalize_and_fold) (
112aaa: 6803 ldr r3, [r0, #0]
112aac: ac03 add r4, sp, #12
112aae: 9400 str r4, [sp, #0]
112ab0: 691c ldr r4, [r3, #16]
112ab2: ab04 add r3, sp, #16
112ab4: 47a0 blx r4
if ( eno == ENOMEM ) {
112ab6: 280c cmp r0, #12
name_size = name_size_tmp;
112ab8: 9c03 ldr r4, [sp, #12]
eno = (*converter->handler->utf8_normalize_and_fold) (
112aba: 4606 mov r6, r0
if ( eno == ENOMEM ) {
112abc: d001 beq.n 112ac2 <msdos_filename_utf8_to_short_name_for_compare+0x3e><== ALWAYS TAKEN
if ( eno == 0 ) {
112abe: 2e00 cmp r6, #0
112ac0: d1ea bne.n 112a98 <msdos_filename_utf8_to_short_name_for_compare+0x14><== ALWAYS TAKEN
memcpy (&dest_ptr[0], &name_ptr[0], name_size);
112ac2: 4622 mov r2, r4
112ac4: a904 add r1, sp, #16
112ac6: 4628 mov r0, r5
112ac8: f002 eb9a blx 115200 <memcpy>
returned_size = name_size;
112acc: 4620 mov r0, r4
}
112ace: b010 add sp, #64 ; 0x40
112ad0: bd70 pop {r4, r5, r6, pc}
&& src_size == UTF8_FULL_STOP_SIZE) {
112ad2: 2a01 cmp r2, #1
112ad4: d015 beq.n 112b02 <msdos_filename_utf8_to_short_name_for_compare+0x7e>
&& src_name[1] == UTF8_FULL_STOP
112ad6: 784b ldrb r3, [r1, #1]
&& src_size == ( 2 * UTF8_FULL_STOP_SIZE ) ) {
112ad8: 2b2e cmp r3, #46 ; 0x2e
112ada: bf08 it eq
112adc: 2a02 cmpeq r2, #2
112ade: d016 beq.n 112b0e <msdos_filename_utf8_to_short_name_for_compare+0x8a><== NEVER TAKEN
while ( *name_size >= UTF8_FULL_STOP_SIZE
112ae0: 2a00 cmp r2, #0 <== NOT EXECUTED
112ae2: d0d8 beq.n 112a96 <msdos_filename_utf8_to_short_name_for_compare+0x12><== NOT EXECUTED
112ae4: 1e53 subs r3, r2, #1 <== NOT EXECUTED
112ae6: 468c mov ip, r1 <== NOT EXECUTED
112ae8: 440b add r3, r1 <== NOT EXECUTED
112aea: 440a add r2, r1 <== NOT EXECUTED
112aec: e001 b.n 112af2 <msdos_filename_utf8_to_short_name_for_compare+0x6e> <== NOT EXECUTED
&& **name_utf8 == UTF8_FULL_STOP) {
112aee: f81c 4f01 ldrb.w r4, [ip, #1]! <== NOT EXECUTED
112af2: 2c2e cmp r4, #46 ; 0x2e <== NOT EXECUTED
112af4: eba2 0e0c sub.w lr, r2, ip <== NOT EXECUTED
112af8: 4661 mov r1, ip <== NOT EXECUTED
112afa: d1d5 bne.n 112aa8 <msdos_filename_utf8_to_short_name_for_compare+0x24><== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
112afc: 4563 cmp r3, ip <== NOT EXECUTED
112afe: d1f6 bne.n 112aee <msdos_filename_utf8_to_short_name_for_compare+0x6a><== NOT EXECUTED
112b00: e7c9 b.n 112a96 <msdos_filename_utf8_to_short_name_for_compare+0x12> <== NOT EXECUTED
if (dest_size >= UTF8_FULL_STOP_SIZE) {
112b02: 9b14 ldr r3, [sp, #80] ; 0x50
112b04: b153 cbz r3, 112b1c <msdos_filename_utf8_to_short_name_for_compare+0x98>
returned_size = UTF8_FULL_STOP_SIZE;
112b06: 4610 mov r0, r2
dest_name[0] = UTF8_FULL_STOP;
112b08: 702c strb r4, [r5, #0]
}
112b0a: b010 add sp, #64 ; 0x40
112b0c: bd70 pop {r4, r5, r6, pc}
if (dest_size >= 2 * UTF8_FULL_STOP_SIZE) {
112b0e: 9b14 ldr r3, [sp, #80] ; 0x50
112b10: 2b01 cmp r3, #1
112b12: d903 bls.n 112b1c <msdos_filename_utf8_to_short_name_for_compare+0x98><== ALWAYS TAKEN
returned_size = 2 * UTF8_FULL_STOP_SIZE;
112b14: 2002 movs r0, #2
dest_name[0] = UTF8_FULL_STOP;
112b16: 702c strb r4, [r5, #0]
dest_name[1] = UTF8_FULL_STOP;
112b18: 706c strb r4, [r5, #1]
if (returned_size == 0) {
112b1a: e7c3 b.n 112aa4 <msdos_filename_utf8_to_short_name_for_compare+0x20>
errno = eno;
112b1c: f002 f8b0 bl 114c80 <__errno> <== NOT EXECUTED
112b20: 225b movs r2, #91 ; 0x5b <== NOT EXECUTED
112b22: 4603 mov r3, r0 <== NOT EXECUTED
112b24: 601a str r2, [r3, #0] <== NOT EXECUTED
112b26: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
112b2a: e7bb b.n 112aa4 <msdos_filename_utf8_to_short_name_for_compare+0x20> <== NOT EXECUTED
00112b2c <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)
{
112b2c: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
112b30: 461d mov r5, r3
if ( src_name[0] == UTF8_FULL_STOP
112b32: f891 e000 ldrb.w lr, [r1]
{
112b36: b086 sub sp, #24
if ( src_name[0] == UTF8_FULL_STOP
112b38: f1be 0f2e cmp.w lr, #46 ; 0x2e
112b3c: f000 808f beq.w 112c5e <msdos_filename_utf8_to_short_name_for_save+0x132> <== ALWAYS TAKEN
while ( *name_size >= UTF8_FULL_STOP_SIZE
112b40: b952 cbnz r2, 112b58 <msdos_filename_utf8_to_short_name_for_save+0x2c>
eno = EINVAL;
}
if ( eno != 0 ) {
errno = eno;
return -1;
112b42: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = eno;
112b46: f002 f89b bl 114c80 <__errno> <== NOT EXECUTED
112b4a: 2316 movs r3, #22 <== NOT EXECUTED
112b4c: 6003 str r3, [r0, #0] <== NOT EXECUTED
}
return returned_size;
}
112b4e: 4620 mov r0, r4
112b50: b006 add sp, #24
112b52: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
112b56: 4622 mov r2, r4 <== NOT EXECUTED
name_size_tmp = sizeof ( name_to_format_buf );
112b58: 230c movs r3, #12
eno = (*converter->handler->utf8_to_codepage) (
112b5a: ac02 add r4, sp, #8
name_size_tmp = sizeof ( name_to_format_buf );
112b5c: 9302 str r3, [sp, #8]
eno = (*converter->handler->utf8_to_codepage) (
112b5e: 6803 ldr r3, [r0, #0]
112b60: 9400 str r4, [sp, #0]
112b62: 4e65 ldr r6, [pc, #404] ; (112cf8 <msdos_filename_utf8_to_short_name_for_save+0x1cc>)
112b64: 681c ldr r4, [r3, #0]
112b66: ab03 add r3, sp, #12
112b68: 47a0 blx r4
name_size = name_size_tmp;
112b6a: 9c02 ldr r4, [sp, #8]
for (i = 0; i < name_size; ++i)
112b6c: a803 add r0, sp, #12
112b6e: 1903 adds r3, r0, r4
112b70: 2c00 cmp r4, #0
112b72: d0ec beq.n 112b4e <msdos_filename_utf8_to_short_name_for_save+0x22> <== ALWAYS TAKEN
name_to_format_buf[i] = toupper ( (unsigned char)(name_to_format_buf[i]) );
112b74: f810 1b01 ldrb.w r1, [r0], #1
112b78: f816 c001 ldrb.w ip, [r6, r1]
112b7c: f00c 0c03 and.w ip, ip, #3
112b80: f1bc 0f02 cmp.w ip, #2
112b84: bf04 itt eq
112b86: 3920 subeq r1, #32
112b88: b2c9 uxtbeq r1, r1
for (i = 0; i < name_size; ++i)
112b8a: 4298 cmp r0, r3
name_to_format_buf[i] = toupper ( (unsigned char)(name_to_format_buf[i]) );
112b8c: f800 1c01 strb.w r1, [r0, #-1]
for (i = 0; i < name_size; ++i)
112b90: d1f0 bne.n 112b74 <msdos_filename_utf8_to_short_name_for_save+0x48>
if ( 0x20 == *name_ptr )
112b92: f89d 300c ldrb.w r3, [sp, #12]
112b96: 2b20 cmp r3, #32
112b98: f000 8082 beq.w 112ca0 <msdos_filename_utf8_to_short_name_for_save+0x174>
else if ( 0xE5 == *name_ptr )
112b9c: 2be5 cmp r3, #229 ; 0xe5
dest_ptr[0] = 0x05;
112b9e: bf04 itt eq
112ba0: 2305 moveq r3, #5
112ba2: 702b strbeq r3, [r5, #0]
else if ( 0xE5 == *name_ptr )
112ba4: d008 beq.n 112bb8 <msdos_filename_utf8_to_short_name_for_save+0x8c> <== ALWAYS TAKEN
char c = codepage_valid_char_map[character];
112ba6: f64c 32b4 movw r2, #52148 ; 0xcbb4
112baa: f2c0 0211 movt r2, #17
112bae: 5cd3 ldrb r3, [r2, r3]
c = '_';
112bb0: 2b00 cmp r3, #0
112bb2: bf08 it eq
112bb4: 235f moveq r3, #95 ; 0x5f
dest_ptr[0] = msdos_get_valid_codepage_filename_character(*name_ptr);
112bb6: 702b strb r3, [r5, #0]
--name_size;
112bb8: f104 38ff add.w r8, r4, #4294967295 ; 0xffffffff
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
112bbc: f10d 020d add.w r2, sp, #13
char c = codepage_valid_char_map[character];
112bc0: f64c 36b4 movw r6, #52148 ; 0xcbb4
112bc4: 4629 mov r1, r5
++returned_size;
112bc6: 2401 movs r4, #1
char c = codepage_valid_char_map[character];
112bc8: f2c0 0611 movt r6, #17
--name_size;
112bcc: f108 30ff add.w r0, r8, #4294967295 ; 0xffffffff
112bd0: 4617 mov r7, r2
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
112bd2: f1b8 0f00 cmp.w r8, #0
112bd6: d015 beq.n 112c04 <msdos_filename_utf8_to_short_name_for_save+0xd8>
112bd8: 7813 ldrb r3, [r2, #0]
char c = codepage_valid_char_map[character];
112bda: 3201 adds r2, #1
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
112bdc: 2b2e cmp r3, #46 ; 0x2e
112bde: f000 8087 beq.w 112cf0 <msdos_filename_utf8_to_short_name_for_save+0x1c4>
char c = codepage_valid_char_map[character];
112be2: 5cf3 ldrb r3, [r6, r3]
++returned_size;
112be4: 3401 adds r4, #1
++name_ptr;
112be6: 4617 mov r7, r2
c = '_';
112be8: 2b00 cmp r3, #0
112bea: bf08 it eq
112bec: 235f moveq r3, #95 ; 0x5f
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
112bee: 2c08 cmp r4, #8
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
112bf0: f801 3f01 strb.w r3, [r1, #1]!
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
112bf4: d057 beq.n 112ca6 <msdos_filename_utf8_to_short_name_for_save+0x17a>
--name_size;
112bf6: 4680 mov r8, r0
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
112bf8: 4617 mov r7, r2
--name_size;
112bfa: f108 30ff add.w r0, r8, #4294967295 ; 0xffffffff
for (i = 1; i <= 7 && name_size && *name_ptr != '.'; ++i) {
112bfe: f1b8 0f00 cmp.w r8, #0
112c02: d1e9 bne.n 112bd8 <msdos_filename_utf8_to_short_name_for_save+0xac>
dest_ptr[i] = ' ';
112c04: f1c4 0208 rsb r2, r4, #8
112c08: 1928 adds r0, r5, r4
112c0a: 2120 movs r1, #32
112c0c: f002 fd68 bl 1156e0 <memset>
if ( name_size > 0 && *name_ptr == '.' ) {
112c10: 2608 movs r6, #8
char c = codepage_valid_char_map[character];
112c12: f64c 30b4 movw r0, #52148 ; 0xcbb4
112c16: 19a9 adds r1, r5, r6
112c18: 1e7a subs r2, r7, #1
112c1a: 44b0 add r8, r6
112c1c: f2c0 0011 movt r0, #17
if ( name_size > 0 && *name_ptr == '.' ) {
112c20: 4634 mov r4, r6
for (; i <= 10 && name_size ; i++) {
112c22: 45b0 cmp r8, r6
112c24: d00b beq.n 112c3e <msdos_filename_utf8_to_short_name_for_save+0x112>
char c = codepage_valid_char_map[character];
112c26: f812 3f01 ldrb.w r3, [r2, #1]!
for (; i <= 10 && name_size ; i++) {
112c2a: 3601 adds r6, #1
++returned_size;
112c2c: 3401 adds r4, #1
char c = codepage_valid_char_map[character];
112c2e: 5cc3 ldrb r3, [r0, r3]
c = '_';
112c30: 2b00 cmp r3, #0
112c32: bf08 it eq
112c34: 235f moveq r3, #95 ; 0x5f
for (; i <= 10 && name_size ; i++) {
112c36: 2e0b cmp r6, #11
dest_ptr[i] = msdos_get_valid_codepage_filename_character(*name_ptr);
112c38: f801 3b01 strb.w r3, [r1], #1
for (; i <= 10 && name_size ; i++) {
112c3c: d1f1 bne.n 112c22 <msdos_filename_utf8_to_short_name_for_save+0xf6>
for ( ; i < short_name_size; ++i ) {
112c3e: 9b0c ldr r3, [sp, #48] ; 0x30
112c40: 42b3 cmp r3, r6
112c42: d984 bls.n 112b4e <msdos_filename_utf8_to_short_name_for_save+0x22>
dest_ptr[i] = ' ';
112c44: 9b0c ldr r3, [sp, #48] ; 0x30
112c46: 2120 movs r1, #32
112c48: 19a8 adds r0, r5, r6
++returned_size;
112c4a: 1ba4 subs r4, r4, r6
dest_ptr[i] = ' ';
112c4c: 1b9a subs r2, r3, r6
112c4e: f002 fd47 bl 1156e0 <memset>
++returned_size;
112c52: 9b0c ldr r3, [sp, #48] ; 0x30
112c54: 441c add r4, r3
}
112c56: 4620 mov r0, r4
112c58: b006 add sp, #24
112c5a: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
&& src_size == UTF8_FULL_STOP_SIZE) {
112c5e: 2a01 cmp r2, #1 <== NOT EXECUTED
112c60: d02d beq.n 112cbe <msdos_filename_utf8_to_short_name_for_save+0x192> <== NOT EXECUTED
&& src_name[1] == UTF8_FULL_STOP
112c62: 784b ldrb r3, [r1, #1] <== NOT EXECUTED
&& src_size == ( 2 * UTF8_FULL_STOP_SIZE ) ) {
112c64: 2b2e cmp r3, #46 ; 0x2e <== NOT EXECUTED
112c66: bf08 it eq <== NOT EXECUTED
112c68: 2a02 cmpeq r2, #2 <== NOT EXECUTED
112c6a: d031 beq.n 112cd0 <msdos_filename_utf8_to_short_name_for_save+0x1a4> <== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
112c6c: 2a00 cmp r2, #0 <== NOT EXECUTED
112c6e: f43f af68 beq.w 112b42 <msdos_filename_utf8_to_short_name_for_save+0x16> <== NOT EXECUTED
112c72: 1e53 subs r3, r2, #1 <== NOT EXECUTED
112c74: 468c mov ip, r1 <== NOT EXECUTED
112c76: 440b add r3, r1 <== NOT EXECUTED
112c78: 440a add r2, r1 <== NOT EXECUTED
112c7a: e001 b.n 112c80 <msdos_filename_utf8_to_short_name_for_save+0x154> <== NOT EXECUTED
&& **name_utf8 == UTF8_FULL_STOP) {
112c7c: f81c ef01 ldrb.w lr, [ip, #1]! <== NOT EXECUTED
112c80: f1be 0f2e cmp.w lr, #46 ; 0x2e <== NOT EXECUTED
112c84: 4661 mov r1, ip <== NOT EXECUTED
112c86: eba2 0401 sub.w r4, r2, r1 <== NOT EXECUTED
112c8a: f47f af64 bne.w 112b56 <msdos_filename_utf8_to_short_name_for_save+0x2a> <== NOT EXECUTED
while ( *name_size >= UTF8_FULL_STOP_SIZE
112c8e: 459c cmp ip, r3 <== NOT EXECUTED
112c90: d1f4 bne.n 112c7c <msdos_filename_utf8_to_short_name_for_save+0x150> <== NOT EXECUTED
errno = eno;
112c92: f001 fff5 bl 114c80 <__errno> <== NOT EXECUTED
112c96: 2316 movs r3, #22 <== NOT EXECUTED
return -1;
112c98: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = eno;
112c9c: 6003 str r3, [r0, #0] <== NOT EXECUTED
return -1;
112c9e: e756 b.n 112b4e <msdos_filename_utf8_to_short_name_for_save+0x22> <== NOT EXECUTED
dest_ptr[0] = '_';
112ca0: 235f movs r3, #95 ; 0x5f
112ca2: 702b strb r3, [r5, #0]
112ca4: e788 b.n 112bb8 <msdos_filename_utf8_to_short_name_for_save+0x8c>
if ( name_size > 0 && *name_ptr == '.' ) {
112ca6: 4626 mov r6, r4
112ca8: 2800 cmp r0, #0
112caa: d0c8 beq.n 112c3e <msdos_filename_utf8_to_short_name_for_save+0x112>
112cac: 7813 ldrb r3, [r2, #0]
112cae: 2b2e cmp r3, #46 ; 0x2e
112cb0: bf18 it ne
112cb2: 4680 movne r8, r0
112cb4: d1ac bne.n 112c10 <msdos_filename_utf8_to_short_name_for_save+0xe4>
++name_ptr;
112cb6: 3701 adds r7, #1
--name_size;
112cb8: f1a8 0802 sub.w r8, r8, #2
for (; i < 8; ++i) {
112cbc: e7a8 b.n 112c10 <msdos_filename_utf8_to_short_name_for_save+0xe4>
if (dest_size >= UTF8_FULL_STOP_SIZE) {
112cbe: 9b0c ldr r3, [sp, #48] ; 0x30 <== NOT EXECUTED
112cc0: b17b cbz r3, 112ce2 <msdos_filename_utf8_to_short_name_for_save+0x1b6> <== NOT EXECUTED
returned_size = UTF8_FULL_STOP_SIZE;
112cc2: 4614 mov r4, r2 <== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
112cc4: f885 e000 strb.w lr, [r5] <== NOT EXECUTED
}
112cc8: 4620 mov r0, r4 <== NOT EXECUTED
112cca: b006 add sp, #24 <== NOT EXECUTED
112ccc: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
if (dest_size >= 2 * UTF8_FULL_STOP_SIZE) {
112cd0: 9b0c ldr r3, [sp, #48] ; 0x30 <== NOT EXECUTED
112cd2: 2b01 cmp r3, #1 <== NOT EXECUTED
112cd4: d905 bls.n 112ce2 <msdos_filename_utf8_to_short_name_for_save+0x1b6> <== NOT EXECUTED
returned_size = 2 * UTF8_FULL_STOP_SIZE;
112cd6: 2402 movs r4, #2 <== NOT EXECUTED
dest_name[0] = UTF8_FULL_STOP;
112cd8: f885 e000 strb.w lr, [r5] <== NOT EXECUTED
dest_name[1] = UTF8_FULL_STOP;
112cdc: f885 e001 strb.w lr, [r5, #1] <== NOT EXECUTED
if (returned_size == 0) {
112ce0: e735 b.n 112b4e <msdos_filename_utf8_to_short_name_for_save+0x22> <== NOT EXECUTED
errno = eno;
112ce2: f001 ffcd bl 114c80 <__errno> <== NOT EXECUTED
112ce6: 235b movs r3, #91 ; 0x5b <== NOT EXECUTED
112ce8: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
112cec: 6003 str r3, [r0, #0] <== NOT EXECUTED
if (returned_size == 0) {
112cee: e72e b.n 112b4e <msdos_filename_utf8_to_short_name_for_save+0x22> <== NOT EXECUTED
++name_ptr;
112cf0: 4617 mov r7, r2
--name_size;
112cf2: f108 38ff add.w r8, r8, #4294967295 ; 0xffffffff
112cf6: e785 b.n 112c04 <msdos_filename_utf8_to_short_name_for_save+0xd8>
112cf8: 0011d929 .word 0x0011d929
0010f664 <msdos_find_name>:
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
10f664: 6943 ldr r3, [r0, #20]
{
10f666: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
10f66a: b093 sub sp, #76 ; 0x4c
fat_file_fd_t *fat_fd = NULL;
10f66c: f04f 0800 mov.w r8, #0
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f670: f10d 0928 add.w r9, sp, #40 ; 0x28
{
10f674: 460c mov r4, r1
10f676: 4616 mov r6, r2
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
10f678: 689f ldr r7, [r3, #8]
{
10f67a: 4605 mov r5, r0
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f67c: 2220 movs r2, #32
10f67e: 4641 mov r1, r8
10f680: 4648 mov r0, r9
fat_file_fd_t *fat_fd = NULL;
10f682: f8cd 8014 str.w r8, [sp, #20]
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f686: f006 f82b bl 1156e0 <memset>
name_type = msdos_long_to_short (
10f68a: 230b movs r3, #11
10f68c: 4632 mov r2, r6
10f68e: 4621 mov r1, r4
10f690: f8d7 00cc ldr.w r0, [r7, #204] ; 0xcc
10f694: 9300 str r3, [sp, #0]
10f696: 464b mov r3, r9
10f698: f7ff f834 bl 10e704 <msdos_long_to_short>
rc = msdos_get_name_node(parent_loc, false, name, name_len, name_type,
10f69c: 4633 mov r3, r6
10f69e: ae06 add r6, sp, #24
10f6a0: 4622 mov r2, r4
10f6a2: 9000 str r0, [sp, #0]
10f6a4: 4641 mov r1, r8
10f6a6: 4628 mov r0, r5
10f6a8: f8cd 9008 str.w r9, [sp, #8]
10f6ac: 9601 str r6, [sp, #4]
10f6ae: f7ff ff95 bl 10f5dc <msdos_get_name_node>
if (rc != RC_OK)
10f6b2: 4604 mov r4, r0
10f6b4: bb20 cbnz r0, 10f700 <msdos_find_name+0x9c>
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
10f6b6: f89d 3033 ldrb.w r3, [sp, #51] ; 0x33
10f6ba: 071a lsls r2, r3, #28
10f6bc: d424 bmi.n 10f708 <msdos_find_name+0xa4> <== ALWAYS TAKEN
10f6be: f003 033f and.w r3, r3, #63 ; 0x3f
10f6c2: 2b0f cmp r3, #15
10f6c4: d020 beq.n 10f708 <msdos_find_name+0xa4> <== ALWAYS TAKEN
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
10f6c6: aa05 add r2, sp, #20
10f6c8: 4631 mov r1, r6
10f6ca: 4638 mov r0, r7
10f6cc: f7fe f8f2 bl 10d8b4 <fat_file_open>
if (rc != RC_OK)
10f6d0: 4604 mov r4, r0
10f6d2: b9a8 cbnz r0, 10f700 <msdos_find_name+0x9c>
fat_fd->dir_pos = dir_pos;
10f6d4: f8dd e014 ldr.w lr, [sp, #20]
10f6d8: e896 000f ldmia.w r6, {r0, r1, r2, r3}
if (fat_fd->links_num == 1)
10f6dc: f8de 8008 ldr.w r8, [lr, #8]
fat_fd->dir_pos = dir_pos;
10f6e0: f10e 0c20 add.w ip, lr, #32
10f6e4: e88c 000f stmia.w ip, {r0, r1, r2, r3}
if (fat_fd->links_num == 1)
10f6e8: f1b8 0f01 cmp.w r8, #1
10f6ec: d012 beq.n 10f714 <msdos_find_name+0xb0>
rc = fat_file_close(&fs_info->fat, parent_loc->node_access);
10f6ee: 68a9 ldr r1, [r5, #8]
10f6f0: 4638 mov r0, r7
10f6f2: f7fe fac5 bl 10dc80 <fat_file_close>
if (rc != RC_OK)
10f6f6: 4604 mov r4, r0
10f6f8: 2800 cmp r0, #0
10f6fa: d13e bne.n 10f77a <msdos_find_name+0x116> <== ALWAYS TAKEN
parent_loc->node_access = fat_fd;
10f6fc: 9b05 ldr r3, [sp, #20]
10f6fe: 60ab str r3, [r5, #8]
}
10f700: 4620 mov r0, r4
10f702: b013 add sp, #76 ; 0x4c
10f704: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
return MSDOS_NAME_NOT_FOUND_ERR;
10f708: f647 5401 movw r4, #32001 ; 0x7d01 <== NOT EXECUTED
}
10f70c: 4620 mov r0, r4 <== NOT EXECUTED
10f70e: b013 add sp, #76 ; 0x4c <== NOT EXECUTED
10f710: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
10f714: f8bd 203c ldrh.w r2, [sp, #60] ; 0x3c
10f718: f8bd 3042 ldrh.w r3, [sp, #66] ; 0x42
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f71c: f8bd 103e ldrh.w r1, [sp, #62] ; 0x3e
10f720: f8bd 0040 ldrh.w r0, [sp, #64] ; 0x40
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
10f724: ea43 4302 orr.w r3, r3, r2, lsl #16
10f728: f8ce 301c str.w r3, [lr, #28]
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f72c: f003 f860 bl 1127f0 <msdos_date_dos2unix>
10f730: 9b05 ldr r3, [sp, #20]
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f732: f8bd 1036 ldrh.w r1, [sp, #54] ; 0x36
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f736: 6498 str r0, [r3, #72] ; 0x48
10f738: 64dc str r4, [r3, #76] ; 0x4c
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f73a: f8bd 0038 ldrh.w r0, [sp, #56] ; 0x38
10f73e: f003 f857 bl 1127f0 <msdos_date_dos2unix>
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
10f742: f89d 3033 ldrb.w r3, [sp, #51] ; 0x33
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f746: 9905 ldr r1, [sp, #20]
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
10f748: 06de lsls r6, r3, #27
fat_fd->ctime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
10f74a: 6408 str r0, [r1, #64] ; 0x40
10f74c: 644c str r4, [r1, #68] ; 0x44
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
10f74e: d419 bmi.n 10f784 <msdos_find_name+0x120>
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
10f750: 9b11 ldr r3, [sp, #68] ; 0x44
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
10f752: 2004 movs r0, #4
10f754: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff
10f758: e9c1 0204 strd r0, r2, [r1, #16]
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
10f75c: 618b str r3, [r1, #24]
fat_fd->map.file_cln = 0;
10f75e: 2200 movs r2, #0
10f760: 634a str r2, [r1, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
10f762: 69ca ldr r2, [r1, #28]
10f764: 638a str r2, [r1, #56] ; 0x38
if ((fat_fd->fat_file_size != 0) &&
10f766: b123 cbz r3, 10f772 <msdos_find_name+0x10e>
10f768: 68b8 ldr r0, [r7, #8]
10f76a: 4298 cmp r0, r3
fat_fd->map.last_cln = fat_fd->cln;
10f76c: bf28 it cs
10f76e: 63ca strcs r2, [r1, #60] ; 0x3c
if ((fat_fd->fat_file_size != 0) &&
10f770: d2bd bcs.n 10f6ee <msdos_find_name+0x8a>
fat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
10f772: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
10f776: 63cb str r3, [r1, #60] ; 0x3c
10f778: e7b9 b.n 10f6ee <msdos_find_name+0x8a>
fat_file_close(&fs_info->fat, fat_fd);
10f77a: 9905 ldr r1, [sp, #20] <== NOT EXECUTED
10f77c: 4638 mov r0, r7 <== NOT EXECUTED
10f77e: f7fe fa7f bl 10dc80 <fat_file_close> <== NOT EXECUTED
return rc;
10f782: e7bd b.n 10f700 <msdos_find_name+0x9c> <== NOT EXECUTED
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10f784: f44f 1300 mov.w r3, #2097152 ; 0x200000
rc = fat_file_size(&fs_info->fat, fat_fd);
10f788: 4638 mov r0, r7
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10f78a: e9c1 4304 strd r4, r3, [r1, #16]
rc = fat_file_size(&fs_info->fat, fat_fd);
10f78e: f7fe fc7b bl 10e088 <fat_file_size>
fat_file_close(&fs_info->fat, fat_fd);
10f792: 9905 ldr r1, [sp, #20]
if (rc != RC_OK)
10f794: 4604 mov r4, r0
10f796: 2800 cmp r0, #0
10f798: d1f0 bne.n 10f77c <msdos_find_name+0x118> <== ALWAYS TAKEN
if ((fat_fd->fat_file_size != 0) &&
10f79a: 698b ldr r3, [r1, #24]
10f79c: e7df b.n 10f75e <msdos_find_name+0xfa>
10f79e: bf00 nop
0010ecb4 <msdos_find_name_in_fat_file>:
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry)
{
int retval = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
10ecb4: 6880 ldr r0, [r0, #8]
{
10ecb6: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10ecba: b0bf sub sp, #252 ; 0xfc
10ecbc: 9313 str r3, [sp, #76] ; 0x4c
10ecbe: 4691 mov r9, r2
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;
10ecc0: f8d0 30cc ldr.w r3, [r0, #204] ; 0xcc
msdos_fs_info_t *fs_info = mt_entry->fs_info;
10ecc4: 900a str r0, [sp, #40] ; 0x28
{
10ecc6: 910c str r1, [sp, #48] ; 0x30
void *buffer = converter->buffer.data;
10ecc8: 685a ldr r2, [r3, #4]
rtems_dosfs_convert_control *converter = fs_info->converter;
10ecca: 9312 str r3, [sp, #72] ; 0x48
size_t buffer_size = converter->buffer.size;
10eccc: 689b ldr r3, [r3, #8]
void *buffer = converter->buffer.data;
10ecce: 9211 str r2, [sp, #68] ; 0x44
size_t buffer_size = converter->buffer.size;
10ecd0: 9314 str r3, [sp, #80] ; 0x50
assert(name_utf8_len > 0);
10ecd2: 9b48 ldr r3, [sp, #288] ; 0x120
10ecd4: 2b00 cmp r3, #0
10ecd6: f340 8321 ble.w 10f31c <msdos_find_name_in_fat_file+0x668> <== ALWAYS TAKEN
dir_pos->sname.cln = 0;
10ecda: 9a4a ldr r2, [sp, #296] ; 0x128
10ecdc: 2300 movs r3, #0
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10ecde: 994a ldr r1, [sp, #296] ; 0x128
dir_pos->sname.ofs = 0;
10ece0: e9c2 3300 strd r3, r3, [r2]
fat_dir_pos_init(dir_pos);
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
10ece4: 9b0c ldr r3, [sp, #48] ; 0x30
10ece6: 6a1a ldr r2, [r3, #32]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10ece8: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
10ecec: e9c1 3302 strd r3, r3, [r1, #8]
10ecf0: 2a01 cmp r2, #1
10ecf2: d025 beq.n 10ed40 <msdos_find_name_in_fat_file+0x8c>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
10ecf4: 9b0a ldr r3, [sp, #40] ; 0x28
10ecf6: f8d3 8008 ldr.w r8, [r3, #8]
switch ( name_type ) {
10ecfa: 9b49 ldr r3, [sp, #292] ; 0x124
10ecfc: 2b01 cmp r3, #1
10ecfe: d02a beq.n 10ed56 <msdos_find_name_in_fat_file+0xa2>
10ed00: 2b02 cmp r3, #2
10ed02: d009 beq.n 10ed18 <msdos_find_name_in_fat_file+0x64>
}
else
retval = -1;
break;
default:
errno = EINVAL;
10ed04: f005 ffbc bl 114c80 <__errno>
10ed08: 4603 mov r3, r0
retval = -1;
10ed0a: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff
errno = EINVAL;
10ed0e: 2216 movs r2, #22
10ed10: 601a str r2, [r3, #0]
empty_entry_count
);
}
return retval;
}
10ed12: b03f add sp, #252 ; 0xfc
10ed14: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
name_len_for_save = msdos_filename_utf8_to_long_name_for_save (
10ed18: 9d14 ldr r5, [sp, #80] ; 0x50
10ed1a: f8dd a044 ldr.w sl, [sp, #68] ; 0x44
10ed1e: 9f13 ldr r7, [sp, #76] ; 0x4c
10ed20: 9e12 ldr r6, [sp, #72] ; 0x48
10ed22: 9a48 ldr r2, [sp, #288] ; 0x120
10ed24: 4653 mov r3, sl
10ed26: 4639 mov r1, r7
10ed28: 9500 str r5, [sp, #0]
10ed2a: 4630 mov r0, r6
10ed2c: f003 fe18 bl 112960 <msdos_filename_utf8_to_long_name_for_save>
if (name_len_for_save > 0) {
10ed30: 1e04 subs r4, r0, #0
10ed32: f300 829e bgt.w 10f272 <msdos_find_name_in_fat_file+0x5be>
entry = fs_info->cl_buf;
10ed36: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff
}
10ed3a: b03f add sp, #252 ; 0xfc
10ed3c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
10ed40: 9a0c ldr r2, [sp, #48] ; 0x30
10ed42: 6a53 ldr r3, [r2, #36] ; 0x24
10ed44: 2b00 cmp r3, #0
10ed46: d1d5 bne.n 10ecf4 <msdos_find_name_in_fat_file+0x40> <== ALWAYS TAKEN
10ed48: 9b0a ldr r3, [sp, #40] ; 0x28
10ed4a: 7d9b ldrb r3, [r3, #22]
10ed4c: 079c lsls r4, r3, #30
10ed4e: d0d1 beq.n 10ecf4 <msdos_find_name_in_fat_file+0x40>
bts2rd = fat_fd->fat_file_size;
10ed50: f8d2 8018 ldr.w r8, [r2, #24]
10ed54: e7d1 b.n 10ecfa <msdos_find_name_in_fat_file+0x46>
name_len_for_compare = msdos_filename_utf8_to_short_name_for_compare (
10ed56: 230b movs r3, #11
10ed58: 9a48 ldr r2, [sp, #288] ; 0x120
10ed5a: 9300 str r3, [sp, #0]
10ed5c: e9dd 0112 ldrd r0, r1, [sp, #72] ; 0x48
10ed60: 9b11 ldr r3, [sp, #68] ; 0x44
10ed62: f003 fe8f bl 112a84 <msdos_filename_utf8_to_short_name_for_compare>
if (name_len_for_compare > 0) {
10ed66: 1e03 subs r3, r0, #0
10ed68: 9307 str r3, [sp, #28]
lfn_entries = 0;
10ed6a: bfc4 itt gt
10ed6c: 2300 movgt r3, #0
10ed6e: 930e strgt r3, [sp, #56] ; 0x38
if (name_len_for_compare > 0) {
10ed70: dde1 ble.n 10ed36 <msdos_find_name_in_fat_file+0x82> <== ALWAYS TAKEN
lfn_start->cln = FAT_FILE_SHORT_NAME;
10ed72: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
}
10ed76: 9d07 ldr r5, [sp, #28]
lfn_start->cln = FAT_FILE_SHORT_NAME;
10ed78: 9319 str r3, [sp, #100] ; 0x64
*entry_matched = false;
10ed7a: f04f 0a00 mov.w sl, #0
rtems_dosfs_convert_control *converter = fs_info->converter;
10ed7e: 9b0a ldr r3, [sp, #40] ; 0x28
uint32_t empty_entry_count = 0;
10ed80: 4656 mov r6, sl
uint32_t empty_file_offset = 0;
10ed82: 46d3 mov fp, sl
*entry_matched = false;
10ed84: f88d a05f strb.w sl, [sp, #95] ; 0x5f
uint32_t dir_offset = 0;
10ed88: f8cd a02c str.w sl, [sp, #44] ; 0x2c
rtems_dosfs_convert_control *converter = fs_info->converter;
10ed8c: f8d3 20cc ldr.w r2, [r3, #204] ; 0xcc
10ed90: f8d3 10c8 ldr.w r1, [r3, #200] ; 0xc8
uint32_t entries_per_block = bts2rd / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10ed94: ea4f 1358 mov.w r3, r8, lsr #5
bool empty_space_found = false;
10ed98: e9cd aa08 strd sl, sl, [sp, #32]
rtems_dosfs_convert_control *converter = fs_info->converter;
10ed9c: 920d str r2, [sp, #52] ; 0x34
uint32_t entries_per_block = bts2rd / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10ed9e: 9315 str r3, [sp, #84] ; 0x54
uint8_t lfn_checksum = 0;
10eda0: f8cd a03c str.w sl, [sp, #60] ; 0x3c
while ( (bytes_read = fat_file_read (&fs_info->fat, fat_fd, (dir_offset * bts2rd),
10eda4: 9100 str r1, [sp, #0]
10eda6: 4643 mov r3, r8
10eda8: 990c ldr r1, [sp, #48] ; 0x30
10edaa: 4652 mov r2, sl
10edac: 980a ldr r0, [sp, #40] ; 0x28
10edae: f7fe fe8d bl 10dacc <fat_file_read>
&& rc == RC_OK)
10edb2: 2800 cmp r0, #0
10edb4: f000 8254 beq.w 10f260 <msdos_find_name_in_fat_file+0x5ac>
if (bytes_read < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10edb8: 281f cmp r0, #31
10edba: f340 8247 ble.w 10f24c <msdos_find_name_in_fat_file+0x598> <== ALWAYS TAKEN
assert(bytes_read == bts2rd);
10edbe: 4540 cmp r0, r8
10edc0: f040 82bc bne.w 10f33c <msdos_find_name_in_fat_file+0x688> <== ALWAYS TAKEN
dir_entry < bts2rd && rc == RC_OK && (! filename_matched);
10edc4: 9b0a ldr r3, [sp, #40] ; 0x28
for (dir_entry = 0;
10edc6: 2400 movs r4, #0
10edc8: f8d3 10c8 ldr.w r1, [r3, #200] ; 0xc8
10edcc: f1b8 0f00 cmp.w r8, #0
10edd0: d02d beq.n 10ee2e <msdos_find_name_in_fat_file+0x17a> <== ALWAYS TAKEN
bool entry_empty = (*MSDOS_DIR_ENTRY_TYPE(entry) ==
10edd2: 5d0b ldrb r3, [r1, r4]
char* entry = (char*) fs_info->cl_buf + dir_entry;
10edd4: 190f adds r7, r1, r4
if (*empty_entry_count == 0)
10edd6: b90e cbnz r6, 10eddc <msdos_find_name_in_fat_file+0x128>
*empty_file_offset = dir_offset * bts2rd + dir_entry;
10edd8: eb0a 0b04 add.w fp, sl, r4
if (remainder_empty)
10eddc: 2b00 cmp r3, #0
10edde: f000 80d9 beq.w 10ef94 <msdos_find_name_in_fat_file+0x2e0>
else if (entry_empty)
10ede2: 2be5 cmp r3, #229 ; 0xe5
10ede4: d028 beq.n 10ee38 <msdos_find_name_in_fat_file+0x184>
if (create_node && !empty_space_found)
10ede6: 9a08 ldr r2, [sp, #32]
10ede8: f082 0201 eor.w r2, r2, #1
10edec: ea19 0f02 tst.w r9, r2
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
10edf0: 7afa ldrb r2, [r7, #11]
*empty_entry_count = 0;
10edf2: bf1c itt ne
10edf4: 2600 movne r6, #0
*empty_file_offset = 0;
10edf6: 46b3 movne fp, r6
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
10edf8: f002 003f and.w r0, r2, #63 ; 0x3f
10edfc: 280f cmp r0, #15
10edfe: d026 beq.n 10ee4e <msdos_find_name_in_fat_file+0x19a>
if (entry_matched)
10ee00: f89d 005f ldrb.w r0, [sp, #95] ; 0x5f
10ee04: b380 cbz r0, 10ee68 <msdos_find_name_in_fat_file+0x1b4>
if (lfn_entry ||
10ee06: 9a09 ldr r2, [sp, #36] ; 0x24
10ee08: 2d00 cmp r5, #0
10ee0a: bfd8 it le
10ee0c: 2a00 cmple r2, #0
10ee0e: bf14 ite ne
10ee10: 2501 movne r5, #1
10ee12: 2500 moveq r5, #0
10ee14: f000 819b beq.w 10f14e <msdos_find_name_in_fat_file+0x49a>
}
10ee18: 9d07 ldr r5, [sp, #28]
*entry_matched = false;
10ee1a: f04f 0300 mov.w r3, #0
10ee1e: f88d 305f strb.w r3, [sp, #95] ; 0x5f
lfn_start->cln = FAT_FILE_SHORT_NAME;
10ee22: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
10ee26: 9319 str r3, [sp, #100] ; 0x64
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10ee28: 3420 adds r4, #32
for (dir_entry = 0;
10ee2a: 45a0 cmp r8, r4
10ee2c: d8d1 bhi.n 10edd2 <msdos_find_name_in_fat_file+0x11e>
dir_offset++;
10ee2e: 9b0b ldr r3, [sp, #44] ; 0x2c
10ee30: 44c2 add sl, r8
10ee32: 3301 adds r3, #1
10ee34: 930b str r3, [sp, #44] ; 0x2c
10ee36: e7b5 b.n 10eda4 <msdos_find_name_in_fat_file+0xf0>
if (create_node)
10ee38: f1b9 0f00 cmp.w r9, #0
10ee3c: d0ec beq.n 10ee18 <msdos_find_name_in_fat_file+0x164>
if (*empty_entry_count == (lfn_entries + 1))
10ee3e: 9a0e ldr r2, [sp, #56] ; 0x38
(*empty_entry_count)++;
10ee40: 1c73 adds r3, r6, #1
if (*empty_entry_count == (lfn_entries + 1))
10ee42: 4296 cmp r6, r2
(*empty_entry_count)++;
10ee44: 461e mov r6, r3
empty_space_found = true;
10ee46: bf08 it eq
10ee48: f8cd 9020 streq.w r9, [sp, #32]
10ee4c: e7e4 b.n 10ee18 <msdos_find_name_in_fat_file+0x164>
(lfn_start.cln == FAT_FILE_SHORT_NAME);
10ee4e: 9a19 ldr r2, [sp, #100] ; 0x64
if (is_first_lfn_entry)
10ee50: 1c50 adds r0, r2, #1
10ee52: d04e beq.n 10eef2 <msdos_find_name_in_fat_file+0x23e>
if ((lfn_entry != (*MSDOS_DIR_ENTRY_TYPE(entry) &
10ee54: 9809 ldr r0, [sp, #36] ; 0x24
10ee56: f003 033f and.w r3, r3, #63 ; 0x3f
10ee5a: 4283 cmp r3, r0
10ee5c: d1dc bne.n 10ee18 <msdos_find_name_in_fat_file+0x164> <== ALWAYS TAKEN
MSDOS_LAST_LONG_ENTRY_MASK)) ||
10ee5e: 7b7b ldrb r3, [r7, #13]
10ee60: 980f ldr r0, [sp, #60] ; 0x3c
10ee62: 4283 cmp r3, r0
10ee64: d1d8 bne.n 10ee18 <msdos_find_name_in_fat_file+0x164> <== ALWAYS TAKEN
10ee66: e054 b.n 10ef12 <msdos_find_name_in_fat_file+0x25e>
} else if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_VOLUME_ID)
10ee68: 0710 lsls r0, r2, #28
10ee6a: d4dd bmi.n 10ee28 <msdos_find_name_in_fat_file+0x174>
size_t bytes_converted = buf_size;
10ee6c: 230c movs r3, #12
ssize_t bytes_written = msdos_format_dirent_with_dot(char_buf, entry);
10ee6e: 4639 mov r1, r7
10ee70: a81b add r0, sp, #108 ; 0x6c
size_t bytes_converted = buf_size;
10ee72: 9318 str r3, [sp, #96] ; 0x60
ssize_t bytes_written = msdos_format_dirent_with_dot(char_buf, entry);
10ee74: f7ff feb8 bl 10ebe8 <msdos_format_dirent_with_dot>
if (bytes_written > 0) {
10ee78: 1e02 subs r2, r0, #0
10ee7a: f340 8231 ble.w 10f2e0 <msdos_find_name_in_fat_file+0x62c> <== ALWAYS TAKEN
if (char_buf[0] == 0x05)
10ee7e: f89d 306c ldrb.w r3, [sp, #108] ; 0x6c
eno = (*converter->handler->codepage_to_utf8) (
10ee82: ad18 add r5, sp, #96 ; 0x60
10ee84: a91b add r1, sp, #108 ; 0x6c
if (char_buf[0] == 0x05)
10ee86: 2b05 cmp r3, #5
char_buf[0] = 0xE5;
10ee88: bf04 itt eq
10ee8a: 23e5 moveq r3, #229 ; 0xe5
10ee8c: f88d 306c strbeq.w r3, [sp, #108] ; 0x6c
eno = (*converter->handler->codepage_to_utf8) (
10ee90: 9b0d ldr r3, [sp, #52] ; 0x34
10ee92: 6818 ldr r0, [r3, #0]
10ee94: ab22 add r3, sp, #136 ; 0x88
10ee96: 9500 str r5, [sp, #0]
10ee98: 9310 str r3, [sp, #64] ; 0x40
10ee9a: 6845 ldr r5, [r0, #4]
10ee9c: 980d ldr r0, [sp, #52] ; 0x34
10ee9e: 47a8 blx r5
if (eno == 0)
10eea0: 9b10 ldr r3, [sp, #64] ; 0x40
10eea2: 4605 mov r5, r0
10eea4: 2800 cmp r0, #0
10eea6: d06f beq.n 10ef88 <msdos_find_name_in_fat_file+0x2d4> <== NEVER TAKEN
errno = eno;
10eea8: 9310 str r3, [sp, #64] ; 0x40 <== NOT EXECUTED
10eeaa: f005 fee9 bl 114c80 <__errno> <== NOT EXECUTED
bytes_in_entry = msdos_short_entry_to_utf8_name (
10eeae: 9b10 ldr r3, [sp, #64] ; 0x40 <== NOT EXECUTED
10eeb0: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = eno;
10eeb4: 6005 str r5, [r0, #0] <== NOT EXECUTED
name_len_remaining = msdos_compare_entry_against_filename (
10eeb6: 4619 mov r1, r3
10eeb8: 9b07 ldr r3, [sp, #28]
10eeba: 980d ldr r0, [sp, #52] ; 0x34
10eebc: 9300 str r3, [sp, #0]
10eebe: f10d 035f add.w r3, sp, #95 ; 0x5f
10eec2: 9301 str r3, [sp, #4]
10eec4: 9b11 ldr r3, [sp, #68] ; 0x44
10eec6: f7ff fb6f bl 10e5a8 <msdos_compare_entry_against_filename>
if (entry_matched && name_len_remaining == 0) {
10eeca: f89d 305f ldrb.w r3, [sp, #95] ; 0x5f
10eece: 2800 cmp r0, #0
10eed0: bf14 ite ne
10eed2: 2300 movne r3, #0
10eed4: f003 0301 andeq.w r3, r3, #1
10eed8: 2b00 cmp r3, #0
10eeda: f040 814b bne.w 10f174 <msdos_find_name_in_fat_file+0x4c0>
*entry_matched = false;
10eede: f88d 305f strb.w r3, [sp, #95] ; 0x5f
lfn_start->cln = FAT_FILE_SHORT_NAME;
10eee2: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
}
10eee6: 9d07 ldr r5, [sp, #28]
lfn_start->cln = FAT_FILE_SHORT_NAME;
10eee8: 9319 str r3, [sp, #100] ; 0x64
*name_len_remaining = name_len_for_compare;
10eeea: 9b0a ldr r3, [sp, #40] ; 0x28
10eeec: f8d3 10c8 ldr.w r1, [r3, #200] ; 0xc8
}
10eef0: e79a b.n 10ee28 <msdos_find_name_in_fat_file+0x174>
entry_matched = false;
10eef2: f04f 0300 mov.w r3, #0
10eef6: f88d 305f strb.w r3, [sp, #95] ; 0x5f
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
10eefa: 783b ldrb r3, [r7, #0]
10eefc: 065b lsls r3, r3, #25
10eefe: d593 bpl.n 10ee28 <msdos_find_name_in_fat_file+0x174>
lfn_start.cln = dir_offset;
10ef00: 9b0b ldr r3, [sp, #44] ; 0x2c
lfn_start.ofs = dir_entry;
10ef02: e9cd 3419 strd r3, r4, [sp, #100] ; 0x64
lfn_entry = (*MSDOS_DIR_ENTRY_TYPE(entry)
10ef06: 783b ldrb r3, [r7, #0]
10ef08: f003 033f and.w r3, r3, #63 ; 0x3f
10ef0c: 9309 str r3, [sp, #36] ; 0x24
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
10ef0e: 7b7b ldrb r3, [r7, #13]
10ef10: 930f str r3, [sp, #60] ; 0x3c
lfn_entry--;
10ef12: 9b09 ldr r3, [sp, #36] ; 0x24
10ef14: f1a2 32ff sub.w r2, r2, #4294967295 ; 0xffffffff
10ef18: fab2 f282 clz r2, r2
10ef1c: 4638 mov r0, r7
10ef1e: 0952 lsrs r2, r2, #5
10ef20: a91b add r1, sp, #108 ; 0x6c
10ef22: 3b01 subs r3, #1
10ef24: 9309 str r3, [sp, #36] ; 0x24
size_t bytes_in_utf8 = buf_size;
10ef26: 2370 movs r3, #112 ; 0x70
10ef28: 9318 str r3, [sp, #96] ; 0x60
if (buf_size >= MSDOS_LFN_ENTRY_SIZE) {
10ef2a: f7ff fbb1 bl 10e690 <msdos_get_utf16_string_from_long_entry.part.0>
if (retval >= 0) {
10ef2e: 1e02 subs r2, r0, #0
10ef30: bfb8 it lt
10ef32: ab22 addlt r3, sp, #136 ; 0x88
10ef34: db15 blt.n 10ef62 <msdos_find_name_in_fat_file+0x2ae> <== ALWAYS TAKEN
eno = (*converter->handler->utf16_to_utf8) (
10ef36: 9b0d ldr r3, [sp, #52] ; 0x34
10ef38: af18 add r7, sp, #96 ; 0x60
10ef3a: a91b add r1, sp, #108 ; 0x6c
10ef3c: 6818 ldr r0, [r3, #0]
10ef3e: ab22 add r3, sp, #136 ; 0x88
10ef40: 9700 str r7, [sp, #0]
10ef42: 9310 str r3, [sp, #64] ; 0x40
10ef44: 68c7 ldr r7, [r0, #12]
10ef46: 980d ldr r0, [sp, #52] ; 0x34
10ef48: 47b8 blx r7
if ( eno == 0 ) {
10ef4a: 9b10 ldr r3, [sp, #64] ; 0x40
10ef4c: 4607 mov r7, r0
10ef4e: 2800 cmp r0, #0
10ef50: f000 80f8 beq.w 10f144 <msdos_find_name_in_fat_file+0x490>
errno = eno;
10ef54: 9310 str r3, [sp, #64] ; 0x40
10ef56: f005 fe93 bl 114c80 <__errno>
10ef5a: 9b10 ldr r3, [sp, #64] ; 0x40
bytes_in_entry = msdos_long_entry_to_utf8_name (
10ef5c: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff
errno = eno;
10ef60: 6007 str r7, [r0, #0]
name_len_remaining = msdos_compare_entry_against_filename (
10ef62: 4619 mov r1, r3
10ef64: f10d 035f add.w r3, sp, #95 ; 0x5f
10ef68: 9500 str r5, [sp, #0]
10ef6a: 9301 str r3, [sp, #4]
10ef6c: 980d ldr r0, [sp, #52] ; 0x34
10ef6e: 9b11 ldr r3, [sp, #68] ; 0x44
10ef70: f7ff fb1a bl 10e5a8 <msdos_compare_entry_against_filename>
if (name_len_remaining < 0 || !entry_matched) {
10ef74: 1e05 subs r5, r0, #0
10ef76: db04 blt.n 10ef82 <msdos_find_name_in_fat_file+0x2ce> <== ALWAYS TAKEN
10ef78: f89d 305f ldrb.w r3, [sp, #95] ; 0x5f
10ef7c: 2b00 cmp r3, #0
10ef7e: f040 818e bne.w 10f29e <msdos_find_name_in_fat_file+0x5ea>
*entry_matched = false;
10ef82: f04f 0300 mov.w r3, #0
10ef86: e7aa b.n 10eede <msdos_find_name_in_fat_file+0x22a>
bytes_written = bytes_converted;
10ef88: 9a18 ldr r2, [sp, #96] ; 0x60
if (bytes_in_entry > 0) {
10ef8a: 2a00 cmp r2, #0
10ef8c: d193 bne.n 10eeb6 <msdos_find_name_in_fat_file+0x202> <== NEVER TAKEN
*entry_matched = false;
10ef8e: f88d 205f strb.w r2, [sp, #95] ; 0x5f <== NOT EXECUTED
10ef92: e7a6 b.n 10eee2 <msdos_find_name_in_fat_file+0x22e> <== NOT EXECUTED
if (!create_node)
10ef94: f1b9 0f00 cmp.w r9, #0
10ef98: f000 8166 beq.w 10f268 <msdos_find_name_in_fat_file+0x5b4>
if ( !empty_space_found
10ef9c: 9b08 ldr r3, [sp, #32]
10ef9e: b91b cbnz r3, 10efa8 <msdos_find_name_in_fat_file+0x2f4>
*empty_entry_count +=
10efa0: 9b15 ldr r3, [sp, #84] ; 0x54
10efa2: 4433 add r3, r6
10efa4: eba3 1654 sub.w r6, r3, r4, lsr #5
switch (name_type) {
10efa8: 9b49 ldr r3, [sp, #292] ; 0x124
10efaa: 2b01 cmp r3, #1
10efac: f000 8104 beq.w 10f1b8 <msdos_find_name_in_fat_file+0x504>
10efb0: 2b02 cmp r3, #2
10efb2: f47f aea7 bne.w 10ed04 <msdos_find_name_in_fat_file+0x50> <== ALWAYS TAKEN
name_len_for_save = msdos_filename_utf8_to_long_name_for_save (
10efb6: 9b14 ldr r3, [sp, #80] ; 0x50
10efb8: 9a48 ldr r2, [sp, #288] ; 0x120
10efba: e9dd 0112 ldrd r0, r1, [sp, #72] ; 0x48
10efbe: 9300 str r3, [sp, #0]
10efc0: 9b11 ldr r3, [sp, #68] ; 0x44
10efc2: f003 fccd bl 112960 <msdos_filename_utf8_to_long_name_for_save>
if (name_len_for_save > 0) {
10efc6: 1e07 subs r7, r0, #0
10efc8: f77f aeb5 ble.w 10ed36 <msdos_find_name_in_fat_file+0x82> <== ALWAYS TAKEN
/ MSDOS_LFN_ENTRY_SIZE;
10efcc: f64e 434f movw r3, #60495 ; 0xec4f
lfn_entries = (name_len_for_save + MSDOS_LFN_ENTRY_SIZE - 1)
10efd0: 3719 adds r7, #25
/ MSDOS_LFN_ENTRY_SIZE;
10efd2: f6c4 63c4 movt r3, #20164 ; 0x4ec4
10efd6: fba3 3707 umull r3, r7, r3, r7
10efda: 08ff lsrs r7, r7, #3
if (empty_entry_count < lfn_entries + 1)
10efdc: f107 0a01 add.w sl, r7, #1
10efe0: 45b2 cmp sl, r6
10efe2: d90e bls.n 10f002 <msdos_find_name_in_fat_file+0x34e>
ret = fat_file_extend(&fs_info->fat,
10efe4: 980a ldr r0, [sp, #40] ; 0x28
10efe6: aa22 add r2, sp, #136 ; 0x88
empty_file_offset = fat_fd->fat_file_size -
10efe8: 990c ldr r1, [sp, #48] ; 0x30
ret = fat_file_extend(&fs_info->fat,
10efea: 6883 ldr r3, [r0, #8]
empty_file_offset = fat_fd->fat_file_size -
10efec: 698c ldr r4, [r1, #24]
ret = fat_file_extend(&fs_info->fat,
10efee: 9200 str r2, [sp, #0]
10eff0: 2201 movs r2, #1
10eff2: 4423 add r3, r4
10eff4: f7fe fec0 bl 10dd78 <fat_file_extend>
if (ret != RC_OK)
10eff8: 2800 cmp r0, #0
10effa: f47f ae8a bne.w 10ed12 <msdos_find_name_in_fat_file+0x5e> <== ALWAYS TAKEN
empty_file_offset = fat_fd->fat_file_size -
10effe: eba4 1b46 sub.w fp, r4, r6, lsl #5
if ((*c == ' ') || (*c == '.'))
10f002: 9b4b ldr r3, [sp, #300] ; 0x12c
10f004: f64c 203c movw r0, #51772 ; 0xca3c
slot = (empty_file_offset /
10f008: eb0a 155b add.w r5, sl, fp, lsr #5
if ((*c == ' ') || (*c == '.'))
10f00c: f2c0 0011 movt r0, #17
10f010: 781b ldrb r3, [r3, #0]
10f012: 2b2e cmp r3, #46 ; 0x2e
10f014: bf18 it ne
10f016: 2b20 cmpne r3, #32
*c = '_';
10f018: bf02 ittt eq
10f01a: 9a4b ldreq r2, [sp, #300] ; 0x12c
10f01c: 235f moveq r3, #95 ; 0x5f
10f01e: 7013 strbeq r3, [r2, #0]
if ((*c == ' ') || (*c == '.'))
10f020: 9b4b ldr r3, [sp, #300] ; 0x12c
10f022: 785b ldrb r3, [r3, #1]
10f024: 2b2e cmp r3, #46 ; 0x2e
10f026: bf18 it ne
10f028: 2b20 cmpne r3, #32
*c = '_';
10f02a: bf02 ittt eq
10f02c: 9a4b ldreq r2, [sp, #300] ; 0x12c
10f02e: 235f moveq r3, #95 ; 0x5f
10f030: 7053 strbeq r3, [r2, #1]
for (i = 0; i < 2; i++, c++)
10f032: 9b4b ldr r3, [sp, #300] ; 0x12c
10f034: 1c99 adds r1, r3, #2
10f036: 230c movs r3, #12
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
10f038: fa25 f203 lsr.w r2, r5, r3
for (i = 0; i < 4; i++, c++)
10f03c: 3b04 subs r3, #4
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
10f03e: f002 020f and.w r2, r2, #15
10f042: 5c82 ldrb r2, [r0, r2]
10f044: f801 2b01 strb.w r2, [r1], #1
for (i = 0; i < 4; i++, c++)
10f048: 1d1a adds r2, r3, #4
10f04a: d1f5 bne.n 10f038 <msdos_find_name_in_fat_file+0x384>
*c++ = '~';
10f04c: 9b4b ldr r3, [sp, #300] ; 0x12c
cs = 0;
10f04e: 2600 movs r6, #0
*c++ = '~';
10f050: 984b ldr r0, [sp, #300] ; 0x12c
10f052: 1e5a subs r2, r3, #1
10f054: f103 010a add.w r1, r3, #10
10f058: 237e movs r3, #126 ; 0x7e
10f05a: 7183 strb r3, [r0, #6]
*c = '1';
10f05c: 2331 movs r3, #49 ; 0x31
10f05e: 71c3 strb r3, [r0, #7]
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
10f060: f812 3f01 ldrb.w r3, [r2, #1]!
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
10f064: 4291 cmp r1, r2
10f066: eb03 0356 add.w r3, r3, r6, lsr #1
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
10f06a: eb03 16c6 add.w r6, r3, r6, lsl #7
10f06e: f006 06ff and.w r6, r6, #255 ; 0xff
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
10f072: d1f5 bne.n 10f060 <msdos_find_name_in_fat_file+0x3ac>
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f074: 9b4a ldr r3, [sp, #296] ; 0x128
pos->ofs = file_offset & (bts2rd - 1);
10f076: f108 38ff add.w r8, r8, #4294967295 ; 0xffffffff
10f07a: 9a4a ldr r2, [sp, #296] ; 0x128
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f07c: 9c0c ldr r4, [sp, #48] ; 0x30
10f07e: f8dd 9028 ldr.w r9, [sp, #40] ; 0x28
10f082: 3308 adds r3, #8
10f084: 9300 str r3, [sp, #0]
pos->ofs = file_offset & (bts2rd - 1);
10f086: ea08 030b and.w r3, r8, fp
10f08a: 60d3 str r3, [r2, #12]
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f08c: 4621 mov r1, r4
10f08e: 465b mov r3, fp
10f090: 2201 movs r2, #1
10f092: 4648 mov r0, r9
10f094: f7fe fe30 bl 10dcf8 <fat_file_ioctl>
if (ret != RC_OK)
10f098: 2800 cmp r0, #0
10f09a: f47f ae3a bne.w 10ed12 <msdos_find_name_in_fat_file+0x5e> <== ALWAYS TAKEN
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f09e: 9b4a ldr r3, [sp, #296] ; 0x128
10f0a0: 4621 mov r1, r4
pos->ofs = file_offset & (bts2rd - 1);
10f0a2: 9c4a ldr r4, [sp, #296] ; 0x128
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
10f0a4: 4605 mov r5, r0
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f0a6: 2201 movs r2, #1
length = (lfn_entries + 1) * MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10f0a8: ea4f 1a4a mov.w sl, sl, lsl #5
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f0ac: 9300 str r3, [sp, #0]
* MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10f0ae: 017b lsls r3, r7, #5
10f0b0: 930b str r3, [sp, #44] ; 0x2c
short_file_offset = empty_file_offset + lfn_entries
10f0b2: 445b add r3, fp
pos->ofs = file_offset & (bts2rd - 1);
10f0b4: ea03 0008 and.w r0, r3, r8
*MSDOS_DIR_ENTRY_TYPE(entry) = lfn_entries - lfn_entry;
10f0b8: fa5f f887 uxtb.w r8, r7
pos->ofs = file_offset & (bts2rd - 1);
10f0bc: 6060 str r0, [r4, #4]
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f0be: 4648 mov r0, r9
10f0c0: f7fe fe1a bl 10dcf8 <fat_file_ioctl>
10f0c4: 9b11 ldr r3, [sp, #68] ; 0x44
10f0c6: 464c mov r4, r9
10f0c8: f04f 091a mov.w r9, #26
if (bytes_written == (ssize_t) length)
10f0cc: f8cd a020 str.w sl, [sp, #32]
entry = fs_info->cl_buf;
10f0d0: 9607 str r6, [sp, #28]
10f0d2: fb09 3907 mla r9, r9, r7, r3
10f0d6: f8d4 30c8 ldr.w r3, [r4, #200] ; 0xc8
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
10f0da: 1c5c adds r4, r3, #1
entry = fs_info->cl_buf;
10f0dc: 9309 str r3, [sp, #36] ; 0x24
10f0de: f1a9 091a sub.w r9, r9, #26
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f0e2: 2220 movs r2, #32
10f0e4: 2100 movs r1, #0
10f0e6: 1e60 subs r0, r4, #1
10f0e8: f006 fafa bl 1156e0 <memset>
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
10f0ec: 9b07 ldr r3, [sp, #28]
n = (const uint8_t *) name_converted +
10f0ee: 4649 mov r1, r9
10f0f0: 4622 mov r2, r4
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
10f0f2: 7323 strb r3, [r4, #12]
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f0f4: 2300 movs r3, #0
if (*n != 0 || *(n + 1) != 0)
10f0f6: 7808 ldrb r0, [r1, #0]
uint8_t fill = 0;
10f0f8: 469c mov ip, r3
if (*n != 0 || *(n + 1) != 0)
10f0fa: b9b8 cbnz r0, 10f12c <msdos_find_name_in_fat_file+0x478>
10f0fc: 784e ldrb r6, [r1, #1]
10f0fe: b9ae cbnz r6, 10f12c <msdos_find_name_in_fat_file+0x478>
switch (i)
10f100: 2b04 cmp r3, #4
p [0] = fill;
10f102: f882 c000 strb.w ip, [r2]
p [1] = fill;
10f106: f882 c001 strb.w ip, [r2, #1]
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f10a: f103 0001 add.w r0, r3, #1
fill = 0xff;
10f10e: f04f 0cff mov.w ip, #255 ; 0xff
switch (i)
10f112: d014 beq.n 10f13e <msdos_find_name_in_fat_file+0x48a>
10f114: 2b0a cmp r3, #10
10f116: f000 80e0 beq.w 10f2da <msdos_find_name_in_fat_file+0x626>
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f11a: 280d cmp r0, #13
p += 2;
10f11c: f102 0202 add.w r2, r2, #2
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f120: f000 80c1 beq.w 10f2a6 <msdos_find_name_in_fat_file+0x5f2>
10f124: 4603 mov r3, r0
if (*n != 0 || *(n + 1) != 0)
10f126: 7808 ldrb r0, [r1, #0]
10f128: 2800 cmp r0, #0
10f12a: d0e7 beq.n 10f0fc <msdos_find_name_in_fat_file+0x448>
*p = *n;
10f12c: 7010 strb r0, [r2, #0]
switch (i)
10f12e: 2b04 cmp r3, #4
*(p + 1) = *(n + 1);
10f130: 7848 ldrb r0, [r1, #1]
n += MSDOS_NAME_LFN_BYTES_PER_CHAR;
10f132: f101 0102 add.w r1, r1, #2
*(p + 1) = *(n + 1);
10f136: 7050 strb r0, [r2, #1]
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f138: f103 0001 add.w r0, r3, #1
switch (i)
10f13c: d1ea bne.n 10f114 <msdos_find_name_in_fat_file+0x460>
p += 5;
10f13e: 3205 adds r2, #5
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f140: 4603 mov r3, r0
10f142: e7f0 b.n 10f126 <msdos_find_name_in_fat_file+0x472>
retval = bytes_in_utf8;
10f144: 9a18 ldr r2, [sp, #96] ; 0x60
if (bytes_in_entry > 0) {
10f146: 2a00 cmp r2, #0
10f148: f43f af21 beq.w 10ef8e <msdos_find_name_in_fat_file+0x2da> <== ALWAYS TAKEN
10f14c: e709 b.n 10ef62 <msdos_find_name_in_fat_file+0x2ae>
10f14e: 463a mov r2, r7
10f150: f107 000a add.w r0, r7, #10
10f154: 469c mov ip, r3
10f156: e001 b.n 10f15c <msdos_find_name_in_fat_file+0x4a8>
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
10f158: f812 cf01 ldrb.w ip, [r2, #1]!
10f15c: 086b lsrs r3, r5, #1
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
10f15e: 4290 cmp r0, r2
10f160: eb03 13c5 add.w r3, r3, r5, lsl #7
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
10f164: 4463 add r3, ip
10f166: f003 05ff and.w r5, r3, #255 ; 0xff
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
10f16a: d1f5 bne.n 10f158 <msdos_find_name_in_fat_file+0x4a4>
name_len_remaining > 0 ||
10f16c: 9b0f ldr r3, [sp, #60] ; 0x3c
10f16e: 429d cmp r5, r3
10f170: f47f ae52 bne.w 10ee18 <msdos_find_name_in_fat_file+0x164> <== ALWAYS TAKEN
rc = msdos_on_entry_found (
10f174: 9b0b ldr r3, [sp, #44] ; 0x2c
10f176: 4642 mov r2, r8
10f178: 990c ldr r1, [sp, #48] ; 0x30
10f17a: 980a ldr r0, [sp, #40] ; 0x28
10f17c: 9302 str r3, [sp, #8]
10f17e: 9b4a ldr r3, [sp, #296] ; 0x128
10f180: 9700 str r7, [sp, #0]
10f182: 9403 str r4, [sp, #12]
10f184: 9301 str r3, [sp, #4]
10f186: ab19 add r3, sp, #100 ; 0x64
10f188: 9304 str r3, [sp, #16]
10f18a: 9b4b ldr r3, [sp, #300] ; 0x12c
10f18c: f7ff fa38 bl 10e600 <msdos_on_entry_found>
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10f190: f104 0320 add.w r3, r4, #32
for (dir_entry = 0;
10f194: 4598 cmp r8, r3
10f196: bf94 ite ls
10f198: 2300 movls r3, #0
10f19a: 2301 movhi r3, #1
10f19c: 2800 cmp r0, #0
10f19e: bf18 it ne
10f1a0: 2300 movne r3, #0
10f1a2: 2b00 cmp r3, #0
10f1a4: f000 80af beq.w 10f306 <msdos_find_name_in_fat_file+0x652>
if ( retval == RC_OK
10f1a8: f1b9 0f00 cmp.w r9, #0
10f1ac: f43f adb1 beq.w 10ed12 <msdos_find_name_in_fat_file+0x5e> <== NEVER TAKEN
switch (name_type) {
10f1b0: 9b49 ldr r3, [sp, #292] ; 0x124 <== NOT EXECUTED
10f1b2: 2b01 cmp r3, #1 <== NOT EXECUTED
10f1b4: f47f aefc bne.w 10efb0 <msdos_find_name_in_fat_file+0x2fc> <== NOT EXECUTED
name_len_for_save = msdos_filename_utf8_to_short_name_for_save (
10f1b8: 240b movs r4, #11
10f1ba: 9b11 ldr r3, [sp, #68] ; 0x44
10f1bc: 9a48 ldr r2, [sp, #288] ; 0x120
10f1be: e9dd 0112 ldrd r0, r1, [sp, #72] ; 0x48
10f1c2: 9400 str r4, [sp, #0]
10f1c4: f003 fcb2 bl 112b2c <msdos_filename_utf8_to_short_name_for_save>
if (name_len_for_save > 0 ) {
10f1c8: 2800 cmp r0, #0
10f1ca: f77f adb4 ble.w 10ed36 <msdos_find_name_in_fat_file+0x82> <== ALWAYS TAKEN
if (empty_entry_count < lfn_entries + 1)
10f1ce: 2e00 cmp r6, #0
10f1d0: f000 8089 beq.w 10f2e6 <msdos_find_name_in_fat_file+0x632>
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f1d4: 9a4a ldr r2, [sp, #296] ; 0x128
pos->ofs = file_offset & (bts2rd - 1);
10f1d6: f108 33ff add.w r3, r8, #4294967295 ; 0xffffffff
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f1da: 9c0a ldr r4, [sp, #40] ; 0x28
pos->ofs = file_offset & (bts2rd - 1);
10f1dc: ea03 030b and.w r3, r3, fp
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f1e0: 990c ldr r1, [sp, #48] ; 0x30
10f1e2: 9200 str r2, [sp, #0]
pos->ofs = file_offset & (bts2rd - 1);
10f1e4: 6053 str r3, [r2, #4]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10f1e6: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
10f1ea: e9c2 3302 strd r3, r3, [r2, #8]
return fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
10f1ee: 4620 mov r0, r4
10f1f0: 465b mov r3, fp
10f1f2: 2201 movs r2, #1
10f1f4: f7fe fd80 bl 10dcf8 <fat_file_ioctl>
entry = fs_info->cl_buf;
10f1f8: f8d4 00c8 ldr.w r0, [r4, #200] ; 0xc8
10f1fc: 2320 movs r3, #32
10f1fe: 469a mov sl, r3
10f200: 9308 str r3, [sp, #32]
memcpy(entry, name_dir_entry, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f202: 9c4b ldr r4, [sp, #300] ; 0x12c
bytes_written = fat_file_write(&fs_info->fat, fat_fd,
10f204: 4653 mov r3, sl
10f206: 990c ldr r1, [sp, #48] ; 0x30
10f208: 465a mov r2, fp
memcpy(entry, name_dir_entry, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f20a: 6827 ldr r7, [r4, #0]
10f20c: 6866 ldr r6, [r4, #4]
10f20e: 68a5 ldr r5, [r4, #8]
10f210: 68e4 ldr r4, [r4, #12]
10f212: 6007 str r7, [r0, #0]
10f214: 6046 str r6, [r0, #4]
10f216: 60c4 str r4, [r0, #12]
10f218: 9c4b ldr r4, [sp, #300] ; 0x12c
10f21a: 6085 str r5, [r0, #8]
10f21c: 6927 ldr r7, [r4, #16]
10f21e: 6966 ldr r6, [r4, #20]
10f220: 69a5 ldr r5, [r4, #24]
10f222: 69e4 ldr r4, [r4, #28]
10f224: 6107 str r7, [r0, #16]
10f226: 6146 str r6, [r0, #20]
10f228: 61c4 str r4, [r0, #28]
bytes_written = fat_file_write(&fs_info->fat, fat_fd,
10f22a: 9c0a ldr r4, [sp, #40] ; 0x28
memcpy(entry, name_dir_entry, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f22c: 6185 str r5, [r0, #24]
bytes_written = fat_file_write(&fs_info->fat, fat_fd,
10f22e: f8d4 00c8 ldr.w r0, [r4, #200] ; 0xc8
10f232: 9000 str r0, [sp, #0]
10f234: 4620 mov r0, r4
10f236: f7fe fe67 bl 10df08 <fat_file_write>
if (bytes_written == (ssize_t) length)
10f23a: 9b08 ldr r3, [sp, #32]
10f23c: 4283 cmp r3, r0
return 0;
10f23e: bf08 it eq
10f240: 2000 moveq r0, #0
if (bytes_written == (ssize_t) length)
10f242: f43f ad66 beq.w 10ed12 <msdos_find_name_in_fat_file+0x5e> <== NEVER TAKEN
else if (bytes_written == -1)
10f246: 3001 adds r0, #1 <== NOT EXECUTED
10f248: f43f ad75 beq.w 10ed36 <msdos_find_name_in_fat_file+0x82> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
10f24c: f005 fd18 bl 114c80 <__errno> <== NOT EXECUTED
10f250: 2205 movs r2, #5 <== NOT EXECUTED
10f252: 4603 mov r3, r0 <== NOT EXECUTED
10f254: 601a str r2, [r3, #0] <== NOT EXECUTED
10f256: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
10f25a: b03f add sp, #252 ; 0xfc <== NOT EXECUTED
10f25c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
if (!create_node)
10f260: f1b9 0f00 cmp.w r9, #0
10f264: f47f aea0 bne.w 10efa8 <msdos_find_name_in_fat_file+0x2f4>
rc = MSDOS_NAME_NOT_FOUND_ERR;
10f268: f647 5001 movw r0, #32001 ; 0x7d01
}
10f26c: b03f add sp, #252 ; 0xfc
10f26e: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
name_len_for_compare = msdos_filename_utf8_to_long_name_for_compare (
10f272: 4653 mov r3, sl
10f274: 9a48 ldr r2, [sp, #288] ; 0x120
10f276: 4639 mov r1, r7
10f278: 4630 mov r0, r6
10f27a: 9500 str r5, [sp, #0]
10f27c: f003 fb26 bl 1128cc <msdos_filename_utf8_to_long_name_for_compare>
if (0 >= name_len_for_compare) {
10f280: 1e03 subs r3, r0, #0
10f282: 9307 str r3, [sp, #28]
10f284: f77f ad57 ble.w 10ed36 <msdos_find_name_in_fat_file+0x82> <== ALWAYS TAKEN
/ MSDOS_LFN_ENTRY_SIZE;
10f288: f64e 424f movw r2, #60495 ; 0xec4f
lfn_entries = (name_len_for_save + MSDOS_LFN_ENTRY_SIZE - 1)
10f28c: f104 0319 add.w r3, r4, #25
/ MSDOS_LFN_ENTRY_SIZE;
10f290: f6c4 62c4 movt r2, #20164 ; 0x4ec4
10f294: fba2 2303 umull r2, r3, r2, r3
10f298: 08db lsrs r3, r3, #3
10f29a: 930e str r3, [sp, #56] ; 0x38
10f29c: e569 b.n 10ed72 <msdos_find_name_in_fat_file+0xbe>
10f29e: 9b0a ldr r3, [sp, #40] ; 0x28
10f2a0: f8d3 10c8 ldr.w r1, [r3, #200] ; 0xc8
10f2a4: e5c0 b.n 10ee28 <msdos_find_name_in_fat_file+0x174>
*MSDOS_DIR_ENTRY_TYPE(entry) = lfn_entries - lfn_entry;
10f2a6: eba8 0305 sub.w r3, r8, r5
10f2aa: b2db uxtb r3, r3
if (lfn_entry == 0)
10f2ac: b90d cbnz r5, 10f2b2 <msdos_find_name_in_fat_file+0x5fe>
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
10f2ae: f043 0340 orr.w r3, r3, #64 ; 0x40
10f2b2: f804 3c01 strb.w r3, [r4, #-1]
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
10f2b6: 3501 adds r5, #1
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
10f2b8: 7aa3 ldrb r3, [r4, #10]
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
10f2ba: 42af cmp r7, r5
10f2bc: f1a9 091a sub.w r9, r9, #26
10f2c0: f104 0420 add.w r4, r4, #32
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
10f2c4: f043 030f orr.w r3, r3, #15
10f2c8: f804 3c16 strb.w r3, [r4, #-22]
for (lfn_entry = 0; lfn_entry < lfn_entries; ++lfn_entry) {
10f2cc: f47f af09 bne.w 10f0e2 <msdos_find_name_in_fat_file+0x42e>
entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10f2d0: 9b09 ldr r3, [sp, #36] ; 0x24
10f2d2: 9a0b ldr r2, [sp, #44] ; 0x2c
10f2d4: 4413 add r3, r2
10f2d6: 4618 mov r0, r3
10f2d8: e793 b.n 10f202 <msdos_find_name_in_fat_file+0x54e>
p += 4;
10f2da: 3204 adds r2, #4
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
10f2dc: 4603 mov r3, r0
10f2de: e722 b.n 10f126 <msdos_find_name_in_fat_file+0x472>
eno = EINVAL;
10f2e0: 2516 movs r5, #22 <== NOT EXECUTED
10f2e2: ab22 add r3, sp, #136 ; 0x88 <== NOT EXECUTED
10f2e4: e5e0 b.n 10eea8 <msdos_find_name_in_fat_file+0x1f4> <== NOT EXECUTED
empty_file_offset = fat_fd->fat_file_size -
10f2e6: 9c0c ldr r4, [sp, #48] ; 0x30
ret = fat_file_extend(&fs_info->fat,
10f2e8: a922 add r1, sp, #136 ; 0x88
10f2ea: 980a ldr r0, [sp, #40] ; 0x28
10f2ec: 9a49 ldr r2, [sp, #292] ; 0x124
empty_file_offset = fat_fd->fat_file_size -
10f2ee: f8d4 b018 ldr.w fp, [r4, #24]
ret = fat_file_extend(&fs_info->fat,
10f2f2: 6883 ldr r3, [r0, #8]
10f2f4: 9100 str r1, [sp, #0]
10f2f6: 4621 mov r1, r4
10f2f8: 445b add r3, fp
10f2fa: f7fe fd3d bl 10dd78 <fat_file_extend>
if (ret != RC_OK)
10f2fe: 2800 cmp r0, #0
10f300: f43f af68 beq.w 10f1d4 <msdos_find_name_in_fat_file+0x520> <== ALWAYS TAKEN
10f304: e505 b.n 10ed12 <msdos_find_name_in_fat_file+0x5e>
&& create_node) {
10f306: 2800 cmp r0, #0
10f308: bf14 ite ne
10f30a: f04f 0900 movne.w r9, #0
10f30e: f009 0901 andeq.w r9, r9, #1
if ( retval == RC_OK
10f312: f1b9 0f00 cmp.w r9, #0
10f316: f47f af4b bne.w 10f1b0 <msdos_find_name_in_fat_file+0x4fc> <== ALWAYS TAKEN
10f31a: e4fa b.n 10ed12 <msdos_find_name_in_fat_file+0x5e>
assert(name_utf8_len > 0);
10f31c: f64c 2310 movw r3, #51728 ; 0xca10 <== NOT EXECUTED
10f320: f64c 22b4 movw r2, #51892 ; 0xcab4 <== NOT EXECUTED
10f324: f64c 10c8 movw r0, #51656 ; 0xc9c8 <== NOT EXECUTED
10f328: f2c0 0311 movt r3, #17 <== NOT EXECUTED
10f32c: f2c0 0211 movt r2, #17 <== NOT EXECUTED
10f330: f240 7146 movw r1, #1862 ; 0x746 <== NOT EXECUTED
10f334: f2c0 0011 movt r0, #17 <== NOT EXECUTED
10f338: f003 f892 bl 112460 <__assert_func> <== NOT EXECUTED
assert(bytes_read == bts2rd);
10f33c: f64c 2324 movw r3, #51748 ; 0xca24 <== NOT EXECUTED
10f340: f64c 2294 movw r2, #51860 ; 0xca94 <== NOT EXECUTED
10f344: f64c 10c8 movw r0, #51656 ; 0xc9c8 <== NOT EXECUTED
10f348: f2c0 0311 movt r3, #17 <== NOT EXECUTED
10f34c: f2c0 0211 movt r2, #17 <== NOT EXECUTED
10f350: f240 514d movw r1, #1357 ; 0x54d <== NOT EXECUTED
10f354: f2c0 0011 movt r0, #17 <== NOT EXECUTED
10f358: f003 f882 bl 112460 <__assert_func> <== NOT EXECUTED
0010f35c <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
)
{
10f35c: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10f360: 4689 mov r9, r1
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) &&
10f362: 6a09 ldr r1, [r1, #32]
{
10f364: b083 sub sp, #12
10f366: 4617 mov r7, r2
10f368: 469a mov sl, r3
msdos_fs_info_t *fs_info = mt_entry->fs_info;
10f36a: f8d0 8008 ldr.w r8, [r0, #8]
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
10f36e: 2901 cmp r1, #1
10f370: d04e beq.n 10f410 <msdos_find_node_by_cluster_num_in_fat_file+0xb4>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
10f372: f8d8 6008 ldr.w r6, [r8, #8]
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * bts2rd, bts2rd,
10f376: f8d8 20c8 ldr.w r2, [r8, #200] ; 0xc8
10f37a: f04f 0b00 mov.w fp, #0
10f37e: 9200 str r2, [sp, #0]
10f380: 4633 mov r3, r6
10f382: 465a mov r2, fp
10f384: 4649 mov r1, r9
10f386: 4640 mov r0, r8
10f388: f7fe fba0 bl 10dacc <fat_file_read>
10f38c: b1b8 cbz r0, 10f3be <msdos_find_node_by_cluster_num_in_fat_file+0x62>
fs_info->cl_buf)) != FAT_EOF)
{
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
10f38e: 281f cmp r0, #31
10f390: dd49 ble.n 10f426 <msdos_find_node_by_cluster_num_in_fat_file+0xca> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EIO );
assert(ret == bts2rd);
10f392: 42b0 cmp r0, r6
10f394: d14f bne.n 10f436 <msdos_find_node_by_cluster_num_in_fat_file+0xda> <== ALWAYS TAKEN
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
10f396: f8d8 20c8 ldr.w r2, [r8, #200] ; 0xc8
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10f39a: 2500 movs r5, #0
10f39c: 4614 mov r4, r2
/* if this and all rest entries are empty - return not-found */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
10f39e: 7823 ldrb r3, [r4, #0]
10f3a0: b16b cbz r3, 10f3be <msdos_find_node_by_cluster_num_in_fat_file+0x62>
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)) ==
10f3a2: 2be5 cmp r3, #229 ; 0xe5
10f3a4: d005 beq.n 10f3b2 <msdos_find_node_by_cluster_num_in_fat_file+0x56> <== ALWAYS TAKEN
MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* if get a non-empty entry - compare clusters num */
if (MSDOS_EXTRACT_CLUSTER_NUM(entry) == cl4find)
10f3a6: 8aa3 ldrh r3, [r4, #20]
10f3a8: 8b60 ldrh r0, [r4, #26]
10f3aa: ea40 4003 orr.w r0, r0, r3, lsl #16
10f3ae: 42b8 cmp r0, r7
10f3b0: d00a beq.n 10f3c8 <msdos_find_node_by_cluster_num_in_fat_file+0x6c>
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
10f3b2: 3520 adds r5, #32
10f3b4: 3420 adds r4, #32
10f3b6: 42b5 cmp r5, r6
10f3b8: d3f1 bcc.n 10f39e <msdos_find_node_by_cluster_num_in_fat_file+0x42> <== NEVER TAKEN
memcpy(dir_entry, entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
}
}
j++;
10f3ba: 44b3 add fp, r6 <== NOT EXECUTED
10f3bc: e7df b.n 10f37e <msdos_find_node_by_cluster_num_in_fat_file+0x22> <== NOT EXECUTED
return MSDOS_NAME_NOT_FOUND_ERR;
10f3be: f647 5001 movw r0, #32001 ; 0x7d01 <== NOT EXECUTED
}
return MSDOS_NAME_NOT_FOUND_ERR;
}
10f3c2: b003 add sp, #12 <== NOT EXECUTED
10f3c4: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM, j * bts2rd,
10f3c8: 465b mov r3, fp
10f3ca: 4649 mov r1, r9
10f3cc: 4640 mov r0, r8
10f3ce: 2201 movs r2, #1
10f3d0: f8cd a000 str.w sl, [sp]
10f3d4: f7fe fc90 bl 10dcf8 <fat_file_ioctl>
if (rc != RC_OK)
10f3d8: 2800 cmp r0, #0
10f3da: d1f2 bne.n 10f3c2 <msdos_find_node_by_cluster_num_in_fat_file+0x66> <== ALWAYS TAKEN
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10f3dc: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
memcpy(dir_entry, entry,
10f3e0: 9e0c ldr r6, [sp, #48] ; 0x30
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10f3e2: e9ca 5301 strd r5, r3, [sl, #4]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
10f3e6: f8ca 300c str.w r3, [sl, #12]
memcpy(dir_entry, entry,
10f3ea: 6825 ldr r5, [r4, #0]
10f3ec: 6861 ldr r1, [r4, #4]
10f3ee: 68a2 ldr r2, [r4, #8]
10f3f0: 68e3 ldr r3, [r4, #12]
10f3f2: 6035 str r5, [r6, #0]
10f3f4: 6071 str r1, [r6, #4]
10f3f6: 60b2 str r2, [r6, #8]
10f3f8: 60f3 str r3, [r6, #12]
10f3fa: 6925 ldr r5, [r4, #16]
10f3fc: 6961 ldr r1, [r4, #20]
10f3fe: 69a2 ldr r2, [r4, #24]
10f400: 69e3 ldr r3, [r4, #28]
10f402: 6135 str r5, [r6, #16]
10f404: 6171 str r1, [r6, #20]
10f406: 61b2 str r2, [r6, #24]
10f408: 61f3 str r3, [r6, #28]
}
10f40a: b003 add sp, #12
10f40c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
10f410: f8d9 3024 ldr.w r3, [r9, #36] ; 0x24
10f414: 2b00 cmp r3, #0
10f416: d1ac bne.n 10f372 <msdos_find_node_by_cluster_num_in_fat_file+0x16> <== ALWAYS TAKEN
10f418: f898 3016 ldrb.w r3, [r8, #22]
10f41c: 079b lsls r3, r3, #30
10f41e: d0a8 beq.n 10f372 <msdos_find_node_by_cluster_num_in_fat_file+0x16> <== ALWAYS TAKEN
bts2rd = fat_fd->fat_file_size;
10f420: f8d9 6018 ldr.w r6, [r9, #24]
10f424: e7a7 b.n 10f376 <msdos_find_node_by_cluster_num_in_fat_file+0x1a>
rtems_set_errno_and_return_minus_one( EIO );
10f426: f005 fc2b bl 114c80 <__errno> <== NOT EXECUTED
10f42a: 2205 movs r2, #5 <== NOT EXECUTED
10f42c: 4603 mov r3, r0 <== NOT EXECUTED
10f42e: 601a str r2, [r3, #0] <== NOT EXECUTED
10f430: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
10f434: e7c5 b.n 10f3c2 <msdos_find_node_by_cluster_num_in_fat_file+0x66> <== NOT EXECUTED
assert(ret == bts2rd);
10f436: f64c 2350 movw r3, #51792 ; 0xca50 <== NOT EXECUTED
10f43a: f64c 2268 movw r2, #51816 ; 0xca68 <== NOT EXECUTED
10f43e: f64c 10c8 movw r0, #51656 ; 0xc9c8 <== NOT EXECUTED
10f442: f2c0 0311 movt r3, #17 <== NOT EXECUTED
10f446: f2c0 0211 movt r2, #17 <== NOT EXECUTED
10f44a: f240 71f1 movw r1, #2033 ; 0x7f1 <== NOT EXECUTED
10f44e: f2c0 0011 movt r0, #17 <== NOT EXECUTED
10f452: f003 f805 bl 112460 <__assert_func> <== NOT EXECUTED
10f456: bf00 nop
00106cd8 <msdos_format>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
106cd8: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
106cdc: b0c5 sub sp, #276 ; 0x114
106cde: 468b mov fp, r1
int ret_val = 0;
int fd = -1;
int i;
msdos_format_param_t fmt_params;
memset(&fmt_params, 0, sizeof(fmt_params));
106ce0: 2258 movs r2, #88 ; 0x58
106ce2: 2100 movs r1, #0
{
106ce4: 4604 mov r4, r0
memset(&fmt_params, 0, sizeof(fmt_params));
106ce6: a814 add r0, sp, #80 ; 0x50
{
106ce8: f8cd b01c str.w fp, [sp, #28]
memset(&fmt_params, 0, sizeof(fmt_params));
106cec: f00e fcf8 bl 1156e0 <memset>
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
106cf0: f24c 4254 movw r2, #50260 ; 0xc454
106cf4: 2102 movs r1, #2
106cf6: f2c0 0211 movt r2, #17
106cfa: 4658 mov r0, fp
106cfc: f7ff ff1c bl 106b38 <msdos_format_printf>
fd = open(devname, O_RDWR);
106d00: 2102 movs r1, #2
106d02: 4620 mov r0, r4
106d04: f7ff f810 bl 105d28 <open>
106d08: 4682 mov sl, r0
if (fd == -1) {
106d0a: 3001 adds r0, #1
106d0c: f000 822b beq.w 107166 <msdos_format+0x48e> <== ALWAYS TAKEN
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106d10: f24c 4264 movw r2, #50276 ; 0xc464
106d14: 4623 mov r3, r4
106d16: f2c0 0211 movt r2, #17
106d1a: 2102 movs r1, #2
106d1c: 4658 mov r0, fp
106d1e: f7ff ff0b bl 106b38 <msdos_format_printf>
"stat check: %s\n", devname);
if (ret_val == 0) {
ret_val = fstat(fd, &stat_buf);
106d22: a92a add r1, sp, #168 ; 0xa8
106d24: 4650 mov r0, sl
106d26: f7fe fca9 bl 10567c <fstat>
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
106d2a: f24c 4274 movw r2, #50292 ; 0xc474
ret_val = fstat(fd, &stat_buf);
106d2e: 4606 mov r6, r0
106d30: 9009 str r0, [sp, #36] ; 0x24
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
106d32: 4623 mov r3, r4
106d34: f2c0 0211 movt r2, #17
106d38: 2101 movs r1, #1
106d3a: 4658 mov r0, fp
106d3c: f7ff fefc bl 106b38 <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))) {
106d40: 2e00 cmp r6, #0
106d42: f040 8206 bne.w 107152 <msdos_format+0x47a> <== ALWAYS TAKEN
106d46: 9b2e ldr r3, [sp, #184] ; 0xb8
106d48: f403 4370 and.w r3, r3, #61440 ; 0xf000
106d4c: f5b3 4fc0 cmp.w r3, #24576 ; 0x6000
106d50: f040 81f8 bne.w 107144 <msdos_format+0x46c> <== ALWAYS TAKEN
memset(fmt_params,0,sizeof(*fmt_params));
106d54: 9909 ldr r1, [sp, #36] ; 0x24
106d56: 2258 movs r2, #88 ; 0x58
106d58: a814 add r0, sp, #80 ; 0x50
106d5a: f00e fcc1 bl 1156e0 <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);
106d5e: f244 2102 movw r1, #16898 ; 0x4202
106d62: aa14 add r2, sp, #80 ; 0x50
106d64: f2c4 0104 movt r1, #16388 ; 0x4004
106d68: 4650 mov r0, sl
106d6a: f005 fa5f bl 10c22c <ioctl>
if (ret_val == 0) {
106d6e: 9009 str r0, [sp, #36] ; 0x24
106d70: 2800 cmp r0, #0
106d72: f000 8210 beq.w 107196 <msdos_format+0x4be> <== NEVER TAKEN
if ( fmt_params->totl_sector_cnt == 0 )
106d76: 9a15 ldr r2, [sp, #84] ; 0x54
106d78: 2a00 cmp r2, #0
106d7a: f040 820a bne.w 107192 <msdos_format+0x4ba> <== NEVER TAKEN
errno = EINVAL;
106d7e: f00d ff7f bl 114c80 <__errno>
106d82: 2316 movs r3, #22
106d84: 6003 str r3, [r0, #0]
ret_val = -1;
106d86: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
fmt_params->rsvd_sector_cnt
106d8a: 9c16 ldr r4, [sp, #88] ; 0x58
ret_val = -1;
106d8c: 9309 str r3, [sp, #36] ; 0x24
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
106d8e: 9a18 ldr r2, [sp, #96] ; 0x60
106d90: f89d 3080 ldrb.w r3, [sp, #128] ; 0x80
106d94: fb02 4303 mla r3, r2, r3, r4
if (fmt_params->root_dir_sectors > 0) {
106d98: 9a1b ldr r2, [sp, #108] ; 0x6c
fmt_params->root_dir_start_sec =
106d9a: 931c str r3, [sp, #112] ; 0x70
if (fmt_params->root_dir_sectors > 0) {
106d9c: 2a00 cmp r2, #0
106d9e: f000 839b beq.w 1074d8 <msdos_format+0x800>
fmt_params->root_dir_fmt_sec_cnt = fmt_params->root_dir_sectors;
106da2: 921d str r2, [sp, #116] ; 0x74
if (ret_val == 0) {
106da4: 9b09 ldr r3, [sp, #36] ; 0x24
106da6: 2b00 cmp r3, #0
106da8: f040 81d3 bne.w 107152 <msdos_format+0x47a>
if ((rqdata != NULL) && (rqdata->OEMName != NULL)) {
106dac: 9b07 ldr r3, [sp, #28]
106dae: 2b00 cmp r3, #0
106db0: f000 83c9 beq.w 107546 <msdos_format+0x86e>
106db4: 6819 ldr r1, [r3, #0]
106db6: 2900 cmp r1, #0
106db8: f000 83c5 beq.w 107546 <msdos_format+0x86e>
if (isprint((unsigned char)*from)) {
106dbc: 780a ldrb r2, [r1, #0]
106dbe: 4c14 ldr r4, [pc, #80] ; (106e10 <msdos_format+0x138>)
106dc0: f10d 0383 add.w r3, sp, #131 ; 0x83
106dc4: f10d 068b add.w r6, sp, #139 ; 0x8b
*to = '\0';
106dc8: 2500 movs r5, #0
106dca: e000 b.n 106dce <msdos_format+0xf6>
if (isprint((unsigned char)*from)) {
106dcc: 780a ldrb r2, [r1, #0]
106dce: 5ca0 ldrb r0, [r4, r2]
106dd0: f010 0f97 tst.w r0, #151 ; 0x97
*to++=' ';
106dd4: bf0c ite eq
106dd6: 2220 moveq r2, #32
*to++ = *from++;
106dd8: 3101 addne r1, #1
106dda: 701a strb r2, [r3, #0]
*to = '\0';
106ddc: f803 5f01 strb.w r5, [r3, #1]!
for (cnt = 0; cnt < (sizeof(fmt_params->OEMName)-1); cnt++) {
106de0: 429e cmp r6, r3
106de2: d1f3 bne.n 106dcc <msdos_format+0xf4>
if ((rqdata != NULL) &&
106de4: 9b07 ldr r3, [sp, #28]
from = ""; /* default: make "from" point to empty string */
106de6: f24c 41ec movw r1, #50412 ; 0xc4ec
106dea: f2c0 0111 movt r1, #17
106dee: 461a mov r2, r3
if ((rqdata != NULL) &&
106df0: b143 cbz r3, 106e04 <msdos_format+0x12c>
(rqdata->VolLabel != NULL)) {
106df2: 9b07 ldr r3, [sp, #28]
106df4: 6859 ldr r1, [r3, #4]
if ((rqdata != NULL) &&
106df6: 2900 cmp r1, #0
106df8: f000 8517 beq.w 10782a <msdos_format+0xb52>
fmt_params->VolLabel_present = true;
106dfc: 2301 movs r3, #1
106dfe: f88d 3098 strb.w r3, [sp, #152] ; 0x98
if (isprint((unsigned char)*from)) {
106e02: 780a ldrb r2, [r1, #0]
106e04: f10d 0697 add.w r6, sp, #151 ; 0x97
106e08: ab23 add r3, sp, #140 ; 0x8c
*to = '\0';
106e0a: 2500 movs r5, #0
106e0c: e003 b.n 106e16 <msdos_format+0x13e>
106e0e: bf00 nop
106e10: 0011d929 .word 0x0011d929
if (isprint((unsigned char)*from)) {
106e14: 780a ldrb r2, [r1, #0]
106e16: 5ca0 ldrb r0, [r4, r2]
106e18: f010 0f97 tst.w r0, #151 ; 0x97
*to++=' ';
106e1c: bf0c ite eq
106e1e: 2220 moveq r2, #32
*to++ = *from++;
106e20: 3101 addne r1, #1
106e22: 701a strb r2, [r3, #0]
*to = '\0';
106e24: f803 5f01 strb.w r5, [r3, #1]!
for (cnt = 0; cnt < (sizeof(fmt_params->VolLabel)-1); cnt++) {
106e28: 429e cmp r6, r3
106e2a: d1f3 bne.n 106e14 <msdos_format+0x13c>
rc = rtems_clock_get_tod_timeval(&time_value);
106e2c: a810 add r0, sp, #64 ; 0x40
106e2e: f001 fe0d bl 108a4c <rtems_clock_get_tod_timeval>
if (rc == RTEMS_SUCCESSFUL) {
106e32: 2800 cmp r0, #0
106e34: f040 84f4 bne.w 107820 <msdos_format+0xb48> <== NEVER TAKEN
*volid_ptr = time_value.tv_sec + time_value.tv_sec;
106e38: 9b10 ldr r3, [sp, #64] ; 0x40 <== NOT EXECUTED
106e3a: 005b lsls r3, r3, #1 <== NOT EXECUTED
106e3c: 9327 str r3, [sp, #156] ; 0x9c <== 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);
106e3e: 9814 ldr r0, [sp, #80] ; 0x50
106e40: f7fe fd10 bl 105864 <malloc>
106e44: 9029 str r0, [sp, #164] ; 0xa4
if (fmt_params.sec == NULL) {
106e46: 2800 cmp r0, #0
106e48: f000 8315 beq.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
106e4c: 9b07 ldr r3, [sp, #28]
(rqdata != NULL) &&
106e4e: 469b mov fp, r3
if ((ret_val == 0) &&
106e50: 2b00 cmp r3, #0
106e52: f040 82b8 bne.w 1073c6 <msdos_format+0x6ee>
*/
if (ret_val == 0) {
/*
* Read the current MBR to obtain the partition table.
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106e56: 9f07 ldr r7, [sp, #28]
106e58: f24c 42f0 movw r2, #50416 ; 0xc4f0
106e5c: f2c0 0211 movt r2, #17
106e60: 2102 movs r1, #2
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
106e62: 2500 movs r5, #0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106e64: 4638 mov r0, r7
106e66: f7ff fe67 bl 106b38 <msdos_format_printf>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
106e6a: 4650 mov r0, sl
106e6c: 2200 movs r2, #0
106e6e: 2300 movs r3, #0
106e70: 9500 str r5, [sp, #0]
"read MRB sector\n");
ret_val = msdos_format_read_sec(fd,
106e72: 9e14 ldr r6, [sp, #80] ; 0x50
106e74: 9c29 ldr r4, [sp, #164] ; 0xa4
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
106e76: f005 fa31 bl 10c2dc <lseek>
106e7a: 42a9 cmp r1, r5
106e7c: f2c0 82fb blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
if (0 > read(fd,buffer,sector_size)) {
106e80: 4632 mov r2, r6
106e82: 4621 mov r1, r4
106e84: 4650 mov r0, sl
106e86: f005 faf3 bl 10c470 <read>
106e8a: 42a8 cmp r0, r5
106e8c: f2c0 82f3 blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
0,
fmt_params.bytes_per_sector,
fmt_params.sec);
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106e90: f24c 5204 movw r2, #50436 ; 0xc504
106e94: 2102 movs r1, #2
106e96: f2c0 0211 movt r2, #17
106e9a: 4638 mov r0, r7
106e9c: f7ff fe4c bl 106b38 <msdos_format_printf>
if (fmt_params->totl_sector_cnt < 0x10000) {
106ea0: 9c15 ldr r4, [sp, #84] ; 0x54
106ea2: f5b4 3f80 cmp.w r4, #65536 ; 0x10000
106ea6: f0c0 830f bcc.w 1074c8 <msdos_format+0x7f0>
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
106eaa: 462e mov r6, r5
106eac: fa5f f884 uxtb.w r8, r4
106eb0: 0e25 lsrs r5, r4, #24
106eb2: f3c4 2707 ubfx r7, r4, #8, #8
106eb6: 46b1 mov r9, r6
106eb8: f3c4 4407 ubfx r4, r4, #16, #8
"generate MRB sector\n");
ret_val = msdos_format_gen_mbr(fmt_params.sec,&fmt_params);
106ebc: 9b29 ldr r3, [sp, #164] ; 0xa4
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
106ebe: f44f 72df mov.w r2, #446 ; 0x1be
106ec2: 2100 movs r1, #0
106ec4: 4618 mov r0, r3
106ec6: f00e fc0b bl 1156e0 <memset>
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
106eca: f04f 0c00 mov.w ip, #0
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
106ece: 4603 mov r3, r0
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
106ed0: f8a0 c1fe strh.w ip, [r0, #510] ; 0x1fe
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
106ed4: f04f 0e06 mov.w lr, #6
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
106ed8: f8dd 2083 ldr.w r2, [sp, #131] ; 0x83
106edc: f8dd 1087 ldr.w r1, [sp, #135] ; 0x87
106ee0: f8c0 2003 str.w r2, [r0, #3]
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
106ee4: 9a14 ldr r2, [sp, #80] ; 0x50
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
106ee6: f8c0 1007 str.w r1, [r0, #7]
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
106eea: 2002 movs r0, #2
106eec: 7418 strb r0, [r3, #16]
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
106eee: 72da strb r2, [r3, #11]
106ef0: 0a12 lsrs r2, r2, #8
106ef2: 731a strb r2, [r3, #12]
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
106ef4: e9dd 2116 ldrd r2, r1, [sp, #88] ; 0x58
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
106ef8: 739a strb r2, [r3, #14]
106efa: 0a12 lsrs r2, r2, #8
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
106efc: 7359 strb r1, [r3, #13]
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
106efe: 21ff movs r1, #255 ; 0xff
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
106f00: 73da strb r2, [r3, #15]
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
106f02: 9a1a ldr r2, [sp, #104] ; 0x68
106f04: 745a strb r2, [r3, #17]
106f06: 9a1a ldr r2, [sp, #104] ; 0x68
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
106f08: f883 9013 strb.w r9, [r3, #19]
106f0c: 751e strb r6, [r3, #20]
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
106f0e: 0a12 lsrs r2, r2, #8
106f10: 749a strb r2, [r3, #18]
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
106f12: f89d 2081 ldrb.w r2, [sp, #129] ; 0x81
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
106f16: 7619 strb r1, [r3, #24]
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
106f18: f883 e01a strb.w lr, [r3, #26]
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
106f1c: 755a strb r2, [r3, #21]
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
106f1e: 2201 movs r2, #1
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
106f20: f883 8020 strb.w r8, [r3, #32]
106f24: f883 7021 strb.w r7, [r3, #33] ; 0x21
106f28: f883 4022 strb.w r4, [r3, #34] ; 0x22
106f2c: f883 5023 strb.w r5, [r3, #35] ; 0x23
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
106f30: 771a strb r2, [r3, #28]
if (fmt_params->fattype != FAT_FAT32) {
106f32: f89d 1082 ldrb.w r1, [sp, #130] ; 0x82
106f36: 2904 cmp r1, #4
106f38: f000 842b beq.w 107792 <msdos_format+0xaba>
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
106f3c: 9a18 ldr r2, [sp, #96] ; 0x60
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
106f3e: ac23 add r4, sp, #140 ; 0x8c
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
106f40: f24c 4548 movw r5, #50248 ; 0xc448
106f44: f2c0 0511 movt r5, #17
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
106f48: 759a strb r2, [r3, #22]
106f4a: 0a12 lsrs r2, r2, #8
106f4c: 75da strb r2, [r3, #23]
FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL);
106f4e: 2229 movs r2, #41 ; 0x29
106f50: f883 2026 strb.w r2, [r3, #38] ; 0x26
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
106f54: f24c 423c movw r2, #50236 ; 0xc43c
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
106f58: 9927 ldr r1, [sp, #156] ; 0x9c
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
106f5a: f2c0 0211 movt r2, #17
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
106f5e: f883 1027 strb.w r1, [r3, #39] ; 0x27
106f62: 0a08 lsrs r0, r1, #8
106f64: f883 0028 strb.w r0, [r3, #40] ; 0x28
106f68: 0c08 lsrs r0, r1, #16
106f6a: 0e09 lsrs r1, r1, #24
106f6c: f883 0029 strb.w r0, [r3, #41] ; 0x29
106f70: f883 102a strb.w r1, [r3, #42] ; 0x2a
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
106f74: cc03 ldmia r4!, {r0, r1}
106f76: f8c3 002b str.w r0, [r3, #43] ; 0x2b
106f7a: f8c3 102f str.w r1, [r3, #47] ; 0x2f
106f7e: 8820 ldrh r0, [r4, #0]
106f80: 78a1 ldrb r1, [r4, #2]
106f82: f8a3 0033 strh.w r0, [r3, #51] ; 0x33
106f86: f883 1035 strb.w r1, [r3, #53] ; 0x35
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
106f8a: f89d 1082 ldrb.w r1, [sp, #130] ; 0x82
106f8e: 2901 cmp r1, #1
106f90: bf18 it ne
106f92: 462a movne r2, r5
106f94: ca03 ldmia r2!, {r0, r1}
106f96: f8c3 0036 str.w r0, [r3, #54] ; 0x36
106f9a: f8c3 103a str.w r1, [r3, #58] ; 0x3a
FAT_SET_BR_SIGNATURE(mbr, FAT_BR_SIGNATURE_VAL);
106f9e: 2255 movs r2, #85 ; 0x55
/*
* 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,
106fa0: 9807 ldr r0, [sp, #28]
FAT_SET_BR_SIGNATURE(mbr, FAT_BR_SIGNATURE_VAL);
106fa2: f883 21fe strb.w r2, [r3, #510] ; 0x1fe
106fa6: 22aa movs r2, #170 ; 0xaa
106fa8: f883 21ff strb.w r2, [r3, #511] ; 0x1ff
FAT_SET_VAL8(mbr,0,0xeb);
106fac: 22eb movs r2, #235 ; 0xeb
106fae: 701a strb r2, [r3, #0]
FAT_SET_VAL8(mbr,1,0x3c);
106fb0: 223c movs r2, #60 ; 0x3c
106fb2: 705a strb r2, [r3, #1]
FAT_SET_VAL8(mbr,2,0x90);
106fb4: 2290 movs r2, #144 ; 0x90
106fb6: 709a strb r2, [r3, #2]
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106fb8: f24c 5228 movw r2, #50472 ; 0xc528
106fbc: f2c0 0211 movt r2, #17
106fc0: 2102 movs r1, #2
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
106fc2: 2400 movs r4, #0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106fc4: f7ff fdb8 bl 106b38 <msdos_format_printf>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
106fc8: 4650 mov r0, sl
106fca: 2200 movs r2, #0
106fcc: 2300 movs r3, #0
106fce: 9400 str r4, [sp, #0]
"write MRB sector\n");
ret_val = msdos_format_write_sec(fd,
106fd0: 9e14 ldr r6, [sp, #80] ; 0x50
0,
fmt_params.bytes_per_sector,
fmt_params.sec);
106fd2: 9d29 ldr r5, [sp, #164] ; 0xa4
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
106fd4: f005 f982 bl 10c2dc <lseek>
106fd8: 42a1 cmp r1, r4
106fda: f2c0 824c blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
if (0 > write(fd,buffer,sector_size)) {
106fde: 4632 mov r2, r6
106fe0: 4629 mov r1, r5
106fe2: 4650 mov r0, sl
106fe4: f7ff fc94 bl 106910 <write>
106fe8: 42a0 cmp r0, r4
106fea: f2c0 8244 blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
}
if ((ret_val == 0) &&
106fee: 9b1e ldr r3, [sp, #120] ; 0x78
106ff0: b1db cbz r3, 10702a <msdos_format+0x352>
(fmt_params.mbr_copy_sec != 0)) {
/*
* write copy of MBR
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
106ff2: f24c 523c movw r2, #50492 ; 0xc53c
106ff6: 9807 ldr r0, [sp, #28]
106ff8: f2c0 0211 movt r2, #17
106ffc: 2102 movs r1, #2
106ffe: f7ff fd9b bl 106b38 <msdos_format_printf>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
107002: 9a1e ldr r2, [sp, #120] ; 0x78
107004: 4650 mov r0, sl
107006: 9400 str r4, [sp, #0]
"write back up MRB sector\n");
ret_val = msdos_format_write_sec(fd,
107008: 9c14 ldr r4, [sp, #80] ; 0x50
fmt_params.mbr_copy_sec ,
fmt_params.bytes_per_sector,
fmt_params.sec);
10700a: 9d29 ldr r5, [sp, #164] ; 0xa4
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
10700c: fba4 2302 umull r2, r3, r4, r2
107010: f005 f964 bl 10c2dc <lseek>
107014: 2900 cmp r1, #0
107016: f2c0 822e blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
if (0 > write(fd,buffer,sector_size)) {
10701a: 4622 mov r2, r4
10701c: 4629 mov r1, r5
10701e: 4650 mov r0, sl
107020: f7ff fc76 bl 106910 <write>
107024: 2800 cmp r0, #0
107026: f2c0 8226 blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
10702a: 9b1f ldr r3, [sp, #124] ; 0x7c
10702c: 2b00 cmp r3, #0
10702e: f040 81dd bne.w 1073ec <msdos_format+0x714>
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
ret_val = msdos_format_fill_sectors
107032: 9a18 ldr r2, [sp, #96] ; 0x60
107034: a814 add r0, sp, #80 ; 0x50
(&fmt_params,
rqdata,
fd,
fmt_params.rsvd_sector_cnt, /* start sector */
fmt_params.fat_num*fmt_params.sectors_per_fat,/* sector count */
107036: f89d 3080 ldrb.w r3, [sp, #128] ; 0x80
ret_val = msdos_format_fill_sectors
10703a: 9907 ldr r1, [sp, #28]
10703c: fb02 f303 mul.w r3, r2, r3
107040: 4652 mov r2, sl
107042: 9300 str r3, [sp, #0]
107044: 2300 movs r3, #0
107046: 9301 str r3, [sp, #4]
107048: 9b16 ldr r3, [sp, #88] ; 0x58
10704a: f7ff fdbb bl 106bc4 <msdos_format_fill_sectors>
}
/*
* clear/init root directory
* -> write all directory sectors as 0x00
*/
if (ret_val == 0) {
10704e: 9009 str r0, [sp, #36] ; 0x24
107050: 2800 cmp r0, #0
107052: d17e bne.n 107152 <msdos_format+0x47a> <== ALWAYS TAKEN
ret_val = msdos_format_fill_sectors
107054: 9b09 ldr r3, [sp, #36] ; 0x24
107056: a814 add r0, sp, #80 ; 0x50
107058: 9907 ldr r1, [sp, #28]
10705a: 4652 mov r2, sl
10705c: 9301 str r3, [sp, #4]
10705e: 9b1d ldr r3, [sp, #116] ; 0x74
107060: 9300 str r3, [sp, #0]
107062: 9b1c ldr r3, [sp, #112] ; 0x70
107064: f7ff fdae bl 106bc4 <msdos_format_fill_sectors>
0x00);
}
/*
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
107068: 9009 str r0, [sp, #36] ; 0x24
10706a: 2800 cmp r0, #0
10706c: d171 bne.n 107152 <msdos_format+0x47a> <== ALWAYS TAKEN
10706e: f89d 3098 ldrb.w r3, [sp, #152] ; 0x98
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
107072: 9829 ldr r0, [sp, #164] ; 0xa4
107074: 9a14 ldr r2, [sp, #80] ; 0x50
if ((ret_val == 0) && fmt_params.VolLabel_present) {
107076: 2b00 cmp r3, #0
107078: f040 8201 bne.w 10747e <msdos_format+0x7a6>
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);
10707c: 2100 movs r1, #0
10707e: f00e fb2f bl 1156e0 <memset>
switch(fmt_params.fattype) {
107082: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
107086: 2b02 cmp r3, #2
107088: f000 8229 beq.w 1074de <msdos_format+0x806>
10708c: 2b04 cmp r3, #4
10708e: f000 8242 beq.w 107516 <msdos_format+0x83e>
107092: 2b01 cmp r3, #1
107094: f000 8232 beq.w 1074fc <msdos_format+0x824> <== NEVER TAKEN
/* FAT entry 1: Not dirty, no IO error, EOC */
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
break;
default:
ret_val = -1;
107098: f04f 39ff mov.w r9, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = EINVAL;
10709c: f00d fdf0 bl 114c80 <__errno> <== NOT EXECUTED
1070a0: 2316 movs r3, #22 <== NOT EXECUTED
1070a2: 6003 str r3, [r0, #0] <== NOT EXECUTED
}
if (fmt_params.fattype == FAT_FAT32) {
1070a4: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
1070a8: 2b04 cmp r3, #4
1070aa: d10a bne.n 1070c2 <msdos_format+0x3ea>
/*
* 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);
1070ac: 9b29 ldr r3, [sp, #164] ; 0xa4
1070ae: 22f8 movs r2, #248 ; 0xf8
1070b0: 721a strb r2, [r3, #8]
1070b2: 23ff movs r3, #255 ; 0xff
1070b4: 9a29 ldr r2, [sp, #164] ; 0xa4
1070b6: 7253 strb r3, [r2, #9]
1070b8: 220f movs r2, #15
1070ba: 9929 ldr r1, [sp, #164] ; 0xa4
1070bc: 728b strb r3, [r1, #10]
1070be: 9b29 ldr r3, [sp, #164] ; 0xa4
1070c0: 72da strb r2, [r3, #11]
if (! skip_alignment)
1070c2: f89d 20a0 ldrb.w r2, [sp, #160] ; 0xa0
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
1070c6: e9dd 7316 ldrd r7, r3, [sp, #88] ; 0x58
if (! skip_alignment)
1070ca: b91a cbnz r2, 1070d4 <msdos_format+0x3fc>
return (sectors + clustersize - 1) & ~(clustersize - 1);
1070cc: 441f add r7, r3
1070ce: 425b negs r3, r3
1070d0: 3f01 subs r7, #1
1070d2: 401f ands r7, r3
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
1070d4: f89d 3080 ldrb.w r3, [sp, #128] ; 0x80
1070d8: 2b00 cmp r3, #0
1070da: f000 83ad beq.w 107838 <msdos_format+0xb60> <== ALWAYS TAKEN
1070de: 464c mov r4, r9
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1070e0: 46c8 mov r8, r9
(i < fmt_params.fat_num) && (ret_val == 0);
1070e2: f1b9 0f00 cmp.w r9, #0
1070e6: f040 81c6 bne.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
i++) {
ret_val = msdos_format_write_sec
(fd,
start_sector
+ (i * fmt_params.sectors_per_fat),
1070ea: 9a18 ldr r2, [sp, #96] ; 0x60
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1070ec: 4650 mov r0, sl
ret_val = msdos_format_write_sec
1070ee: 9d14 ldr r5, [sp, #80] ; 0x50
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1070f0: f8cd 8000 str.w r8, [sp]
fmt_params.bytes_per_sector,
fmt_params.sec);
1070f4: 9e29 ldr r6, [sp, #164] ; 0xa4
ret_val = msdos_format_write_sec
1070f6: fb02 7204 mla r2, r2, r4, r7
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1070fa: 3401 adds r4, #1
1070fc: fba2 2305 umull r2, r3, r2, r5
107100: f005 f8ec bl 10c2dc <lseek>
107104: 460b mov r3, r1
if (0 > write(fd,buffer,sector_size)) {
107106: 462a mov r2, r5
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
107108: 2b00 cmp r3, #0
if (0 > write(fd,buffer,sector_size)) {
10710a: 4631 mov r1, r6
10710c: 4650 mov r0, sl
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
10710e: f2c0 81b2 blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
if (0 > write(fd,buffer,sector_size)) {
107112: f7ff fbfd bl 106910 <write>
107116: 2800 cmp r0, #0
107118: f2c0 81ad blt.w 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
(i < fmt_params.fat_num) && (ret_val == 0);
10711c: f89d 3080 ldrb.w r3, [sp, #128] ; 0x80
for (i = 0;
107120: 429c cmp r4, r3
107122: dbe2 blt.n 1070ea <msdos_format+0x412>
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
107124: f1bb 0f00 cmp.w fp, #0
107128: f000 8396 beq.w 107858 <msdos_format+0xb80>
10712c: 9b07 ldr r3, [sp, #28]
10712e: 7ddb ldrb r3, [r3, #23]
107130: b17b cbz r3, 107152 <msdos_format+0x47a>
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
}
static inline int rtems_disk_fd_sync(int fd)
{
return ioctl(fd, RTEMS_BLKIO_SYNCDEV);
107132: f244 2106 movw r1, #16902 ; 0x4206
107136: 4650 mov r0, sl
107138: f2c2 0100 movt r1, #8192 ; 0x2000
10713c: f005 f876 bl 10c22c <ioctl>
107140: 9009 str r0, [sp, #36] ; 0x24
107142: e006 b.n 107152 <msdos_format+0x47a>
errno = ENOTTY;
107144: f00d fd9c bl 114c80 <__errno> <== NOT EXECUTED
107148: 2319 movs r3, #25 <== NOT EXECUTED
ret_val = -1;
10714a: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff <== NOT EXECUTED
10714e: 9209 str r2, [sp, #36] ; 0x24 <== NOT EXECUTED
errno = ENOTTY;
107150: 6003 str r3, [r0, #0] <== NOT EXECUTED
* cleanup:
* sync and unlock disk
* free any data structures (not needed now)
*/
if (fd != -1) {
close(fd);
107152: 4650 mov r0, sl
107154: f7fe f9c4 bl 1054e0 <close>
}
free(fmt_params.sec);
107158: 9829 ldr r0, [sp, #164] ; 0xa4
10715a: f7fe fa43 bl 1055e4 <free>
return ret_val;
}
10715e: 9809 ldr r0, [sp, #36] ; 0x24
107160: b045 add sp, #276 ; 0x114
107162: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107166: 9d07 ldr r5, [sp, #28] <== NOT EXECUTED
107168: f24c 4264 movw r2, #50276 ; 0xc464 <== NOT EXECUTED
10716c: 4623 mov r3, r4 <== NOT EXECUTED
10716e: 2102 movs r1, #2 <== NOT EXECUTED
107170: f2c0 0211 movt r2, #17 <== NOT EXECUTED
ret_val= -1;
107174: f8cd a024 str.w sl, [sp, #36] ; 0x24 <== NOT EXECUTED
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107178: 4628 mov r0, r5 <== NOT EXECUTED
10717a: f7ff fcdd bl 106b38 <msdos_format_printf> <== NOT EXECUTED
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
10717e: f24c 4274 movw r2, #50292 ; 0xc474 <== NOT EXECUTED
107182: 4623 mov r3, r4 <== NOT EXECUTED
107184: 2101 movs r1, #1 <== NOT EXECUTED
107186: f2c0 0211 movt r2, #17 <== NOT EXECUTED
10718a: 4628 mov r0, r5 <== NOT EXECUTED
10718c: f7ff fcd4 bl 106b38 <msdos_format_printf> <== NOT EXECUTED
if (fd != -1) {
107190: e7e2 b.n 107158 <msdos_format+0x480> <== NOT EXECUTED
fmt_params->rsvd_sector_cnt
107192: 9c16 ldr r4, [sp, #88] ; 0x58
107194: e5fb b.n 106d8e <msdos_format+0xb6>
return ioctl(fd, RTEMS_BLKIO_GETSIZE, block_count);
107196: f244 2105 movw r1, #16901 ; 0x4205
10719a: aa15 add r2, sp, #84 ; 0x54
10719c: f2c4 0104 movt r1, #16388 ; 0x4004
1071a0: 4650 mov r0, sl
1071a2: f005 f843 bl 10c22c <ioctl>
if (ret_val == 0) {
1071a6: 9009 str r0, [sp, #36] ; 0x24
1071a8: 2800 cmp r0, #0
1071aa: f47f ade4 bne.w 106d76 <msdos_format+0x9e> <== ALWAYS TAKEN
total_size = (uint64_t)fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
1071ae: e9dd 3414 ldrd r3, r4, [sp, #80] ; 0x50
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
1071b2: f24c 4284 movw r2, #50308 ; 0xc484
1071b6: 9e07 ldr r6, [sp, #28]
1071b8: f2c0 0211 movt r2, #17
1071bc: 2102 movs r1, #2
1071be: 9400 str r4, [sp, #0]
total_size = (uint64_t)fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
1071c0: fba3 5404 umull r5, r4, r3, r4
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
1071c4: 4630 mov r0, r6
1071c6: e9cd 5402 strd r5, r4, [sp, #8]
1071ca: f7ff fcb5 bl 106b38 <msdos_format_printf>
if ((rqdata == NULL) || (rqdata->fat_num == 0)) {
1071ce: 2e00 cmp r6, #0
1071d0: f000 8284 beq.w 1076dc <msdos_format+0xa04>
1071d4: 68f3 ldr r3, [r6, #12]
1071d6: 2b00 cmp r3, #0
1071d8: f000 81bb beq.w 107552 <msdos_format+0x87a>
else if (rqdata->fat_num <= 6) {
1071dc: 2b06 cmp r3, #6
1071de: f200 8330 bhi.w 107842 <msdos_format+0xb6a>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
1071e2: f24c 42c0 movw r2, #50368 ; 0xc4c0
1071e6: 9807 ldr r0, [sp, #28]
1071e8: f2c0 0211 movt r2, #17
1071ec: 2102 movs r1, #2
fmt_params->fat_num = rqdata->fat_num;
1071ee: f88d 3080 strb.w r3, [sp, #128] ; 0x80
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
1071f2: f7ff fca1 bl 106b38 <msdos_format_printf>
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
1071f6: 9b07 ldr r3, [sp, #28]
1071f8: 689b ldr r3, [r3, #8]
1071fa: 2b00 cmp r3, #0
1071fc: f000 8279 beq.w 1076f2 <msdos_format+0xa1a>
if (fmt_params->totl_sector_cnt < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
107200: f640 72f5 movw r2, #4085 ; 0xff5
107204: fb03 f202 mul.w r2, r3, r2
107208: 9915 ldr r1, [sp, #84] ; 0x54
10720a: 4291 cmp r1, r2
10720c: f080 8275 bcs.w 1076fa <msdos_format+0xa22>
fmt_params->fattype = FAT_FAT12;
107210: 2301 movs r3, #1
107212: f88d 3082 strb.w r3, [sp, #130] ; 0x82
fmt_params->sectors_per_cluster = 2;
107216: 2302 movs r3, #2
107218: 9317 str r3, [sp, #92] ; 0x5c
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata, fmt_params );
10721a: 9807 ldr r0, [sp, #28]
10721c: a914 add r1, sp, #80 ; 0x50
10721e: f7ff fcad bl 106b7c <msdos_set_sectors_per_cluster_from_request>
if (ret_val == 0) {
107222: 9009 str r0, [sp, #36] ; 0x24
107224: 2800 cmp r0, #0
107226: f47f ada6 bne.w 106d76 <msdos_format+0x9e> <== ALWAYS TAKEN
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
10722a: f115 4380 adds.w r3, r5, #1073741824 ; 0x40000000
&& fmt_params->totl_sector_cnt > 0 ) {
10722e: 9a09 ldr r2, [sp, #36] ; 0x24
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
107230: ea4f 7393 mov.w r3, r3, lsr #30
107234: f144 0400 adc.w r4, r4, #0
107238: f8cd a03c str.w sl, [sp, #60] ; 0x3c
10723c: ea43 0384 orr.w r3, r3, r4, lsl #2
&& fmt_params->totl_sector_cnt > 0 ) {
107240: 920c str r2, [sp, #48] ; 0x30
107242: 22ff movs r2, #255 ; 0xff
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
107244: 930e str r3, [sp, #56] ; 0x38
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107246: f24c 43d4 movw r3, #50388 ; 0xc4d4
10724a: f2c0 0311 movt r3, #17
&& fmt_params->totl_sector_cnt > 0 ) {
10724e: 920b str r2, [sp, #44] ; 0x2c
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107250: 930d str r3, [sp, #52] ; 0x34
&& fmt_params->totl_sector_cnt > 0 ) {
107252: 9b15 ldr r3, [sp, #84] ; 0x54
107254: 9304 str r3, [sp, #16]
107256: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
&& fmt_params->fattype != fat_type
10725a: 9a0b ldr r2, [sp, #44] ; 0x2c
10725c: 4293 cmp r3, r2
10725e: f000 8259 beq.w 107714 <msdos_format+0xa3c>
&& fmt_params->totl_sector_cnt > 0 ) {
107262: 9b04 ldr r3, [sp, #16]
107264: 2b00 cmp r3, #0
107266: f000 8290 beq.w 10778a <msdos_format+0xab2> <== ALWAYS TAKEN
if (ret_val == 0 && rqdata != NULL)
10726a: 9807 ldr r0, [sp, #28]
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
10726c: 9b17 ldr r3, [sp, #92] ; 0x5c
if (ret_val == 0 && rqdata != NULL)
10726e: 2800 cmp r0, #0
107270: f000 81fe beq.w 107670 <msdos_format+0x998>
fmt_params->skip_alignment = rqdata->skip_alignment;
107274: 7d82 ldrb r2, [r0, #22]
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107276: 2102 movs r1, #2
fmt_params->skip_alignment = rqdata->skip_alignment;
107278: f88d 20a0 strb.w r2, [sp, #160] ; 0xa0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
10727c: 9a0d ldr r2, [sp, #52] ; 0x34
10727e: f7ff fc5b bl 106b38 <msdos_format_printf>
if (fmt_params->fattype == FAT_FAT32) {
107282: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
107286: 2b04 cmp r3, #4
107288: 930b str r3, [sp, #44] ; 0x2c
10728a: f000 81fb beq.w 107684 <msdos_format+0x9ac>
(rqdata->files_per_root_dir > 0)) {
10728e: 9b07 ldr r3, [sp, #28]
fmt_params->rsvd_sector_cnt = 1;
107290: 2401 movs r4, #1
107292: 9416 str r4, [sp, #88] ; 0x58
(rqdata->files_per_root_dir > 0)) {
107294: 691f ldr r7, [r3, #16]
if ((rqdata != NULL) &&
107296: 2f00 cmp r7, #0
107298: f000 8202 beq.w 1076a0 <msdos_format+0x9c8>
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
10729c: 9d0b ldr r5, [sp, #44] ; 0x2c
10729e: 3f01 subs r7, #1
(2*fmt_params->bytes_per_sector/
1072a0: 9e14 ldr r6, [sp, #80] ; 0x50
1072a2: f3c6 111a ubfx r1, r6, #4, #27
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
1072a6: 440f add r7, r1
fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir %
1072a8: 4638 mov r0, r7
1072aa: f00d f96b bl 114584 <__aeabi_uidivmod>
1072ae: 1a78 subs r0, r7, r1
1072b0: 901a str r0, [sp, #104] ; 0x68
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
1072b2: 0140 lsls r0, r0, #5
fmt_params->root_dir_sectors =
1072b4: f106 39ff add.w r9, r6, #4294967295 ; 0xffffffff
/ fmt_params->bytes_per_sector);
1072b8: 4631 mov r1, r6
1072ba: 4448 add r0, r9
1072bc: f00d f834 bl 114328 <__udivsi3>
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
1072c0: 4631 mov r1, r6
/ fmt_params->bytes_per_sector);
1072c2: 9008 str r0, [sp, #32]
fmt_params->root_dir_sectors =
1072c4: 901b str r0, [sp, #108] ; 0x6c
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
1072c6: f44f 3080 mov.w r0, #65536 ; 0x10000
1072ca: f00d f82d bl 114328 <__udivsi3>
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
1072ce: f8dd b05c ldr.w fp, [sp, #92] ; 0x5c
1072d2: 9b15 ldr r3, [sp, #84] ; 0x54
1072d4: f89d 8080 ldrb.w r8, [sp, #128] ; 0x80
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
1072d8: 4583 cmp fp, r0
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
1072da: f89d 70a0 ldrb.w r7, [sp, #160] ; 0xa0
1072de: 9304 str r3, [sp, #16]
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
1072e0: d903 bls.n 1072ea <msdos_format+0x612> <== NEVER TAKEN
sectors_per_cluster /= 2;
1072e2: ea4f 0b5b mov.w fp, fp, lsr #1 <== NOT EXECUTED
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
1072e6: 4583 cmp fp, r0 <== NOT EXECUTED
1072e8: d8fb bhi.n 1072e2 <msdos_format+0x60a> <== NOT EXECUTED
fatdata_sect_cnt = total_sector_cnt
1072ea: 9b04 ldr r3, [sp, #16]
1072ec: 1b1b subs r3, r3, r4
1072ee: 9305 str r3, [sp, #20]
return (sectors + clustersize - 1) & ~(clustersize - 1);
1072f0: 1e63 subs r3, r4, #1
1072f2: 9306 str r3, [sp, #24]
1072f4: 9b08 ldr r3, [sp, #32]
1072f6: 3b01 subs r3, #1
1072f8: 930a str r3, [sp, #40] ; 0x28
if (! skip_alignment)
1072fa: 2f00 cmp r7, #0
1072fc: f040 812b bne.w 107556 <msdos_format+0x87e>
return (sectors + clustersize - 1) & ~(clustersize - 1);
107300: 9a06 ldr r2, [sp, #24]
107302: f1cb 0300 rsb r3, fp, #0
if (fattype == FAT_FAT12) {
107306: 2d01 cmp r5, #1
return (sectors + clustersize - 1) & ~(clustersize - 1);
107308: eb02 000b add.w r0, r2, fp
fatdata_sect_cnt = total_sector_cnt
10730c: 9a04 ldr r2, [sp, #16]
return (sectors + clustersize - 1) & ~(clustersize - 1);
10730e: ea00 0003 and.w r0, r0, r3
fatdata_sect_cnt = total_sector_cnt
107312: eba2 0000 sub.w r0, r2, r0
if (fattype == FAT_FAT12) {
107316: f000 8199 beq.w 10764c <msdos_format+0x974>
else if (fattype == FAT_FAT16) {
10731a: 2d02 cmp r5, #2
10731c: f000 81a4 beq.w 107668 <msdos_format+0x990>
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
107320: 4659 mov r1, fp
107322: f00d f801 bl 114328 <__udivsi3>
107326: 4604 mov r4, r0
fat_capacity = fatdata_cluster_cnt * 4;
107328: 0080 lsls r0, r0, #2
sectors_per_fat = ((fat_capacity
10732a: 4448 add r0, r9
10732c: 4631 mov r1, r6
10732e: f00c fffb bl 114328 <__udivsi3>
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
107332: fb08 fa00 mul.w sl, r8, r0
if (! skip_alignment)
107336: f10b 33ff add.w r3, fp, #4294967295 ; 0xffffffff
return (sectors + clustersize - 1) & ~(clustersize - 1);
10733a: eb0a 0003 add.w r0, sl, r3
if (! skip_alignment)
10733e: b92f cbnz r7, 10734c <msdos_format+0x674>
return (sectors + clustersize - 1) & ~(clustersize - 1);
107340: f1cb 0a00 rsb sl, fp, #0
107344: ea0a 0a00 and.w sl, sl, r0
+ (sectors_per_cluster - 1))
107348: eb0a 0003 add.w r0, sl, r3
/ sectors_per_cluster));
10734c: 4659 mov r1, fp
10734e: f00c ffeb bl 114328 <__udivsi3>
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
107352: 2d01 cmp r5, #1
*data_cluster_cnt = (fatdata_cluster_cnt -
107354: eba4 0400 sub.w r4, r4, r0
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
107358: f000 810c beq.w 107574 <msdos_format+0x89c>
10735c: 2d02 cmp r5, #2
10735e: f040 810d bne.w 10757c <msdos_format+0x8a4>
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
107362: f64f 73f5 movw r3, #65525 ; 0xfff5
107366: 429c cmp r4, r3
107368: f240 812c bls.w 1075c4 <msdos_format+0x8ec>
sectors_per_cluster *= 2;
10736c: ea4f 0b4b mov.w fp, fp, lsl #1
} else if ((sectors_per_cluster * bytes_per_sector)
107370: fb0b f306 mul.w r3, fp, r6
107374: f5b3 3f80 cmp.w r3, #65536 ; 0x10000
107378: d9bf bls.n 1072fa <msdos_format+0x622> <== NEVER TAKEN
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
10737a: 4641 mov r1, r8 <== NOT EXECUTED
10737c: 4650 mov r0, sl <== NOT EXECUTED
10737e: f00c ffd3 bl 114328 <__udivsi3> <== NOT EXECUTED
uint32_t ms_sectors_per_cluster_limit_FAT16 =
107382: 4631 mov r1, r6 <== NOT EXECUTED
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
107384: 9018 str r0, [sp, #96] ; 0x60 <== NOT EXECUTED
uint32_t ms_sectors_per_cluster_limit_FAT16 =
107386: f248 0001 movw r0, #32769 ; 0x8001 <== NOT EXECUTED
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
10738a: f8cd b05c str.w fp, [sp, #92] ; 0x5c <== NOT EXECUTED
uint32_t ms_sectors_per_cluster_limit_FAT16 =
10738e: f00c ffcb bl 114328 <__udivsi3> <== NOT EXECUTED
107392: 4605 mov r5, r0 <== NOT EXECUTED
else if ( number_of_clusters < FAT_FAT16_MAX_CLN
107394: f64f 72f4 movw r2, #65524 ; 0xfff4
107398: 4294 cmp r4, r2
10739a: bf8c ite hi
10739c: 2400 movhi r4, #0
10739e: 2401 movls r4, #1
1073a0: 455d cmp r5, fp
1073a2: bf38 it cc
1073a4: 2400 movcc r4, #0
1073a6: 2c00 cmp r4, #0
1073a8: f000 8184 beq.w 1076b4 <msdos_format+0x9dc>
fattype = FAT_FAT16;
1073ac: 2302 movs r3, #2
if (fat_type != fmt_params->fattype) {
1073ae: 9a0b ldr r2, [sp, #44] ; 0x2c
fmt_params->fattype = msdos_get_fat_type(
1073b0: f88d 3082 strb.w r3, [sp, #130] ; 0x82
if (fat_type != fmt_params->fattype) {
1073b4: 4293 cmp r3, r2
1073b6: f040 8125 bne.w 107604 <msdos_format+0x92c>
while( ret_val == 0
1073ba: 9b0c ldr r3, [sp, #48] ; 0x30
1073bc: 3301 adds r3, #1
1073be: 930c str r3, [sp, #48] ; 0x30
1073c0: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
1073c4: e749 b.n 10725a <msdos_format+0x582>
(rqdata != NULL) &&
1073c6: 9b07 ldr r3, [sp, #28]
1073c8: 7d5b ldrb r3, [r3, #21]
1073ca: b963 cbnz r3, 1073e6 <msdos_format+0x70e>
ret_val = msdos_format_fill_sectors
1073cc: 9a15 ldr r2, [sp, #84] ; 0x54 <== NOT EXECUTED
1073ce: a814 add r0, sp, #80 ; 0x50 <== NOT EXECUTED
1073d0: 9907 ldr r1, [sp, #28] <== NOT EXECUTED
1073d2: 9200 str r2, [sp, #0] <== NOT EXECUTED
1073d4: 22e5 movs r2, #229 ; 0xe5 <== NOT EXECUTED
1073d6: 9201 str r2, [sp, #4] <== NOT EXECUTED
1073d8: 4652 mov r2, sl <== NOT EXECUTED
1073da: f7ff fbf3 bl 106bc4 <msdos_format_fill_sectors> <== NOT EXECUTED
if (ret_val == 0) {
1073de: 9009 str r0, [sp, #36] ; 0x24 <== NOT EXECUTED
1073e0: 2800 cmp r0, #0 <== NOT EXECUTED
1073e2: f47f aeb6 bne.w 107152 <msdos_format+0x47a> <== NOT EXECUTED
*to++=' ';
1073e6: f04f 0b01 mov.w fp, #1
1073ea: e534 b.n 106e56 <msdos_format+0x17e>
ret_val = msdos_format_gen_fsinfo(fmt_params.sec);
1073ec: 9b29 ldr r3, [sp, #164] ; 0xa4
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
1073ee: f44f 7200 mov.w r2, #512 ; 0x200
1073f2: 2100 movs r1, #0
1073f4: 4618 mov r0, r3
1073f6: f00e f973 bl 1156e0 <memset>
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
1073fa: 2252 movs r2, #82 ; 0x52
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO, 0xffffffff);
1073fc: 21ff movs r1, #255 ; 0xff
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
1073fe: 7002 strb r2, [r0, #0]
107400: 7042 strb r2, [r0, #1]
107402: 2261 movs r2, #97 ; 0x61
107404: 7082 strb r2, [r0, #2]
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
107406: f880 21e7 strb.w r2, [r0, #487] ; 0x1e7
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
10740a: 2241 movs r2, #65 ; 0x41
10740c: 70c2 strb r2, [r0, #3]
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
10740e: f880 21e6 strb.w r2, [r0, #486] ; 0x1e6
(fmt_params.fsinfo_sec != 0)) {
107412: 9a1f ldr r2, [sp, #124] ; 0x7c
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO, 0xffffffff);
107414: f880 11e8 strb.w r1, [r0, #488] ; 0x1e8
107418: f880 11e9 strb.w r1, [r0, #489] ; 0x1e9
10741c: f880 11ea strb.w r1, [r0, #490] ; 0x1ea
107420: f880 11eb strb.w r1, [r0, #491] ; 0x1eb
FAT_SET_FSINFO_NEXT_FREE_CLUSTER (fsinfo+FAT_FSI_INFO, 0xffffffff);
107424: f880 11ec strb.w r1, [r0, #492] ; 0x1ec
107428: f880 11ed strb.w r1, [r0, #493] ; 0x1ed
10742c: f880 11ee strb.w r1, [r0, #494] ; 0x1ee
107430: f880 11ef strb.w r1, [r0, #495] ; 0x1ef
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
107434: 2172 movs r1, #114 ; 0x72
107436: f880 11e4 strb.w r1, [r0, #484] ; 0x1e4
10743a: f880 11e5 strb.w r1, [r0, #485] ; 0x1e5
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
10743e: 2155 movs r1, #85 ; 0x55
107440: f880 11fe strb.w r1, [r0, #510] ; 0x1fe
107444: 21aa movs r1, #170 ; 0xaa
107446: f880 11ff strb.w r1, [r0, #511] ; 0x1ff
if ((ret_val == 0) &&
10744a: 2a00 cmp r2, #0
10744c: f43f adf1 beq.w 107032 <msdos_format+0x35a> <== ALWAYS TAKEN
ret_val = msdos_format_write_sec(fd,
107450: 9c14 ldr r4, [sp, #80] ; 0x50
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
107452: 2300 movs r3, #0
107454: 9300 str r3, [sp, #0]
107456: 4650 mov r0, sl
fmt_params.sec);
107458: 9d29 ldr r5, [sp, #164] ; 0xa4
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
10745a: fba2 2304 umull r2, r3, r2, r4
10745e: f004 ff3d bl 10c2dc <lseek>
107462: 2900 cmp r1, #0
107464: db07 blt.n 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
if (0 > write(fd,buffer,sector_size)) {
107466: 4622 mov r2, r4
107468: 4629 mov r1, r5
10746a: 4650 mov r0, sl
10746c: f7ff fa50 bl 106910 <write>
107470: 2800 cmp r0, #0
107472: f6bf adde bge.w 107032 <msdos_format+0x35a> <== NEVER TAKEN
ret_val = -1;
107476: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff <== NOT EXECUTED
10747a: 9309 str r3, [sp, #36] ; 0x24 <== NOT EXECUTED
10747c: e669 b.n 107152 <msdos_format+0x47a> <== NOT EXECUTED
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
10747e: 9d09 ldr r5, [sp, #36] ; 0x24
*MSDOS_DIR_ATTR(fmt_params.sec) = MSDOS_ATTR_VOLUME_ID;
107480: 2408 movs r4, #8
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
107482: 4629 mov r1, r5
107484: f00e f92c bl 1156e0 <memset>
memcpy(MSDOS_DIR_NAME(fmt_params.sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
107488: ab23 add r3, sp, #140 ; 0x8c
10748a: 9a29 ldr r2, [sp, #164] ; 0xa4
10748c: cb03 ldmia r3!, {r0, r1}
10748e: 6010 str r0, [r2, #0]
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
107490: 4650 mov r0, sl
memcpy(MSDOS_DIR_NAME(fmt_params.sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
107492: 6051 str r1, [r2, #4]
107494: 8819 ldrh r1, [r3, #0]
107496: 789b ldrb r3, [r3, #2]
107498: 8111 strh r1, [r2, #8]
10749a: 7293 strb r3, [r2, #10]
*MSDOS_DIR_ATTR(fmt_params.sec) = MSDOS_ATTR_VOLUME_ID;
10749c: 9b29 ldr r3, [sp, #164] ; 0xa4
10749e: 72dc strb r4, [r3, #11]
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1074a0: 9a1c ldr r2, [sp, #112] ; 0x70
ret_val = msdos_format_write_sec
1074a2: 9c14 ldr r4, [sp, #80] ; 0x50
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1074a4: 9500 str r5, [sp, #0]
fmt_params.sec);
1074a6: 9d29 ldr r5, [sp, #164] ; 0xa4
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
1074a8: fba4 2302 umull r2, r3, r4, r2
1074ac: f004 ff16 bl 10c2dc <lseek>
1074b0: 2900 cmp r1, #0
1074b2: dbe0 blt.n 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
if (0 > write(fd,buffer,sector_size)) {
1074b4: 4622 mov r2, r4
1074b6: 4629 mov r1, r5
1074b8: 4650 mov r0, sl
1074ba: f7ff fa29 bl 106910 <write>
1074be: 2800 cmp r0, #0
1074c0: dbd9 blt.n 107476 <msdos_format+0x79e> <== ALWAYS TAKEN
memset(fmt_params.sec,0,fmt_params.bytes_per_sector);
1074c2: 9829 ldr r0, [sp, #164] ; 0xa4
1074c4: 9a14 ldr r2, [sp, #80] ; 0x50
1074c6: e5d9 b.n 10707c <msdos_format+0x3a4>
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
1074c8: fa5f f984 uxtb.w r9, r4
1074cc: f3c4 2607 ubfx r6, r4, #8, #8
1074d0: 462f mov r7, r5
1074d2: 462c mov r4, r5
1074d4: 46a8 mov r8, r5
1074d6: e4f1 b.n 106ebc <msdos_format+0x1e4>
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
1074d8: 9b17 ldr r3, [sp, #92] ; 0x5c
1074da: 931d str r3, [sp, #116] ; 0x74
1074dc: e462 b.n 106da4 <msdos_format+0xcc>
FAT_SET_VAL8(fmt_params.sec,0,fmt_params.media_code);
1074de: 9b29 ldr r3, [sp, #164] ; 0xa4
FAT_SET_VAL16(fmt_params.sec,2,FAT_FAT16_EOC);
1074e0: 21f8 movs r1, #248 ; 0xf8
FAT_SET_VAL8(fmt_params.sec,0,fmt_params.media_code);
1074e2: f89d 2081 ldrb.w r2, [sp, #129] ; 0x81
break;
1074e6: f04f 0900 mov.w r9, #0
FAT_SET_VAL8(fmt_params.sec,0,fmt_params.media_code);
1074ea: 701a strb r2, [r3, #0]
FAT_SET_VAL8(fmt_params.sec,1,0xff);
1074ec: 23ff movs r3, #255 ; 0xff
1074ee: 9a29 ldr r2, [sp, #164] ; 0xa4
1074f0: 7053 strb r3, [r2, #1]
FAT_SET_VAL16(fmt_params.sec,2,FAT_FAT16_EOC);
1074f2: 9a29 ldr r2, [sp, #164] ; 0xa4
1074f4: 7091 strb r1, [r2, #2]
1074f6: 9a29 ldr r2, [sp, #164] ; 0xa4
1074f8: 70d3 strb r3, [r2, #3]
break;
1074fa: e5d3 b.n 1070a4 <msdos_format+0x3cc>
FAT_SET_VAL8(fmt_params.sec,0,(fmt_params.media_code));
1074fc: 9b29 ldr r3, [sp, #164] ; 0xa4
break;
1074fe: f04f 0900 mov.w r9, #0
FAT_SET_VAL8(fmt_params.sec,0,(fmt_params.media_code));
107502: f89d 2081 ldrb.w r2, [sp, #129] ; 0x81
107506: 701a strb r2, [r3, #0]
FAT_SET_VAL8(fmt_params.sec,1,(0x0f | (FAT_FAT12_EOC << 4)));
107508: 228f movs r2, #143 ; 0x8f
10750a: 9b29 ldr r3, [sp, #164] ; 0xa4
10750c: 705a strb r2, [r3, #1]
FAT_SET_VAL8(fmt_params.sec,2,(FAT_FAT12_EOC >> 4));
10750e: 22ff movs r2, #255 ; 0xff
107510: 9b29 ldr r3, [sp, #164] ; 0xa4
107512: 709a strb r2, [r3, #2]
break;
107514: e5c6 b.n 1070a4 <msdos_format+0x3cc>
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
107516: 9b29 ldr r3, [sp, #164] ; 0xa4
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
107518: 20f8 movs r0, #248 ; 0xf8
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
10751a: f89d 2081 ldrb.w r2, [sp, #129] ; 0x81
break;
10751e: f04f 0900 mov.w r9, #0
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
107522: 701a strb r2, [r3, #0]
107524: 23ff movs r3, #255 ; 0xff
107526: 9a29 ldr r2, [sp, #164] ; 0xa4
107528: 7053 strb r3, [r2, #1]
10752a: 9a29 ldr r2, [sp, #164] ; 0xa4
10752c: 7093 strb r3, [r2, #2]
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
10752e: 22cf movs r2, #207 ; 0xcf
FAT_SET_VAL32(fmt_params.sec,0,0xffffff00|fmt_params.media_code);
107530: 9929 ldr r1, [sp, #164] ; 0xa4
107532: 70cb strb r3, [r1, #3]
FAT_SET_VAL32(fmt_params.sec,4,0xc0000000|FAT_FAT32_EOC);
107534: 9929 ldr r1, [sp, #164] ; 0xa4
107536: 7108 strb r0, [r1, #4]
107538: 9929 ldr r1, [sp, #164] ; 0xa4
10753a: 714b strb r3, [r1, #5]
10753c: 9929 ldr r1, [sp, #164] ; 0xa4
10753e: 718b strb r3, [r1, #6]
107540: 9b29 ldr r3, [sp, #164] ; 0xa4
107542: 71da strb r2, [r3, #7]
break;
107544: e5ae b.n 1070a4 <msdos_format+0x3cc>
from = "RTEMS"; /* default: make "from" point to OS Name */
107546: f24c 4134 movw r1, #50228 ; 0xc434
10754a: 2252 movs r2, #82 ; 0x52
10754c: f2c0 0111 movt r1, #17
107550: e435 b.n 106dbe <msdos_format+0xe6>
fmt_params->fat_num = 2;
107552: 2302 movs r3, #2
107554: e645 b.n 1071e2 <msdos_format+0x50a>
if (fattype == FAT_FAT12) {
107556: 2d01 cmp r5, #1
fatdata_sect_cnt = total_sector_cnt
107558: 9805 ldr r0, [sp, #20]
if (fattype == FAT_FAT12) {
10755a: f000 8083 beq.w 107664 <msdos_format+0x98c>
else if (fattype == FAT_FAT16) {
10755e: 2d02 cmp r5, #2
107560: f47f aede bne.w 107320 <msdos_format+0x648> <== ALWAYS TAKEN
return sectors;
107564: 9b08 ldr r3, [sp, #32]
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
107566: 1ac0 subs r0, r0, r3
107568: 4659 mov r1, fp
10756a: f00c fedd bl 114328 <__udivsi3>
10756e: 4604 mov r4, r0
fat_capacity = fatdata_cluster_cnt * 2;
107570: 0040 lsls r0, r0, #1
107572: e6da b.n 10732a <msdos_format+0x652>
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
107574: f640 73f5 movw r3, #4085 ; 0xff5
107578: 429c cmp r4, r3
10757a: d81a bhi.n 1075b2 <msdos_format+0x8da>
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
10757c: 4641 mov r1, r8
10757e: 4650 mov r0, sl
107580: f00c fed2 bl 114328 <__udivsi3>
uint32_t ms_sectors_per_cluster_limit_FAT16 =
107584: 4631 mov r1, r6
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
107586: e9cd b017 strd fp, r0, [sp, #92] ; 0x5c
uint32_t ms_sectors_per_cluster_limit_FAT16 =
10758a: f248 0001 movw r0, #32769 ; 0x8001
10758e: f00c fecb bl 114328 <__udivsi3>
uint32_t ms_sectors_per_cluster_limit_FAT12 =
107592: 4631 mov r1, r6
uint32_t ms_sectors_per_cluster_limit_FAT16 =
107594: 4605 mov r5, r0
uint32_t ms_sectors_per_cluster_limit_FAT12 =
107596: f241 0001 movw r0, #4097 ; 0x1001
10759a: f00c fec5 bl 114328 <__udivsi3>
if ( number_of_clusters < FAT_FAT12_MAX_CLN
10759e: 4583 cmp fp, r0
1075a0: f63f aef8 bhi.w 107394 <msdos_format+0x6bc>
1075a4: f640 72f4 movw r2, #4084 ; 0xff4
1075a8: 4294 cmp r4, r2
1075aa: f63f aef3 bhi.w 107394 <msdos_format+0x6bc>
fattype = FAT_FAT12;
1075ae: 2301 movs r3, #1
1075b0: e6fd b.n 1073ae <msdos_format+0x6d6>
sectors_per_cluster *= 2;
1075b2: ea4f 0b4b mov.w fp, fp, lsl #1
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
1075b6: fb0b f306 mul.w r3, fp, r6
1075ba: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
1075be: f67f ae9c bls.w 1072fa <msdos_format+0x622> <== NEVER TAKEN
1075c2: e6da b.n 10737a <msdos_format+0x6a2> <== NOT EXECUTED
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
1075c4: 4641 mov r1, r8
1075c6: 4650 mov r0, sl
1075c8: f00c feae bl 114328 <__udivsi3>
uint32_t ms_sectors_per_cluster_limit_FAT16 =
1075cc: 4631 mov r1, r6
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
1075ce: e9cd b017 strd fp, r0, [sp, #92] ; 0x5c
uint32_t ms_sectors_per_cluster_limit_FAT16 =
1075d2: f248 0001 movw r0, #32769 ; 0x8001
1075d6: f00c fea7 bl 114328 <__udivsi3>
uint32_t ms_sectors_per_cluster_limit_FAT12 =
1075da: 4631 mov r1, r6
uint32_t ms_sectors_per_cluster_limit_FAT16 =
1075dc: 4605 mov r5, r0
uint32_t ms_sectors_per_cluster_limit_FAT12 =
1075de: f241 0001 movw r0, #4097 ; 0x1001
1075e2: f00c fea1 bl 114328 <__udivsi3>
if ( number_of_clusters < FAT_FAT12_MAX_CLN
1075e6: f640 72f4 movw r2, #4084 ; 0xff4
1075ea: 4558 cmp r0, fp
1075ec: bf34 ite cc
1075ee: 2000 movcc r0, #0
1075f0: 2001 movcs r0, #1
1075f2: 4294 cmp r4, r2
1075f4: bf88 it hi
1075f6: 2000 movhi r0, #0
1075f8: 2800 cmp r0, #0
1075fa: f43f aecb beq.w 107394 <msdos_format+0x6bc> <== NEVER TAKEN
fmt_params->fattype = msdos_get_fat_type(
1075fe: 2301 movs r3, #1 <== NOT EXECUTED
107600: f88d 3082 strb.w r3, [sp, #130] ; 0x82 <== NOT EXECUTED
fmt_params->sectors_per_cluster = 2;
107604: 2302 movs r3, #2
107606: 9317 str r3, [sp, #92] ; 0x5c
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata,
107608: a914 add r1, sp, #80 ; 0x50
10760a: 9807 ldr r0, [sp, #28]
10760c: f7ff fab6 bl 106b7c <msdos_set_sectors_per_cluster_from_request>
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
107610: f89d 2030 ldrb.w r2, [sp, #48] ; 0x30
107614: 990b ldr r1, [sp, #44] ; 0x2c
107616: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
10761a: 428b cmp r3, r1
10761c: bf18 it ne
10761e: 2a01 cmpne r2, #1
--fmt_params->totl_sector_cnt;
107620: 9a15 ldr r2, [sp, #84] ; 0x54
while( ret_val == 0
107622: 990c ldr r1, [sp, #48] ; 0x30
--fmt_params->totl_sector_cnt;
107624: bf8c ite hi
107626: f102 32ff addhi.w r2, r2, #4294967295 ; 0xffffffff
if ( fmt_params->totl_sector_cnt == 0 )
10762a: 9204 strls r2, [sp, #16]
while( ret_val == 0
10762c: f101 0101 add.w r1, r1, #1
--fmt_params->totl_sector_cnt;
107630: bf84 itt hi
107632: 9204 strhi r2, [sp, #16]
107634: 9215 strhi r2, [sp, #84] ; 0x54
while( ret_val == 0
107636: 910c str r1, [sp, #48] ; 0x30
107638: 2800 cmp r0, #0
10763a: f43f ae0e beq.w 10725a <msdos_format+0x582> <== NEVER TAKEN
10763e: f8dd a03c ldr.w sl, [sp, #60] ; 0x3c <== NOT EXECUTED
107642: 9009 str r0, [sp, #36] ; 0x24 <== NOT EXECUTED
if ( fmt_params->totl_sector_cnt == 0 )
107644: 2a00 cmp r2, #0 <== NOT EXECUTED
107646: f43f ab9a beq.w 106d7e <msdos_format+0xa6> <== NOT EXECUTED
10764a: e5a2 b.n 107192 <msdos_format+0x4ba> <== NOT EXECUTED
return (sectors + clustersize - 1) & ~(clustersize - 1);
10764c: 9a0a ldr r2, [sp, #40] ; 0x28
10764e: 445a add r2, fp
107650: 4013 ands r3, r2
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
107652: 1ac0 subs r0, r0, r3
107654: 4659 mov r1, fp
107656: f00c fe67 bl 114328 <__udivsi3>
10765a: 4604 mov r4, r0
fat_capacity = fatdata_cluster_cnt * 3 / 2;
10765c: eb00 0040 add.w r0, r0, r0, lsl #1
107660: 0840 lsrs r0, r0, #1
107662: e662 b.n 10732a <msdos_format+0x652>
return sectors;
107664: 9b08 ldr r3, [sp, #32]
107666: e7f4 b.n 107652 <msdos_format+0x97a>
return (sectors + clustersize - 1) & ~(clustersize - 1);
107668: 9a0a ldr r2, [sp, #40] ; 0x28
10766a: 445a add r2, fp
10766c: 4013 ands r3, r2
10766e: e77a b.n 107566 <msdos_format+0x88e>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107670: 9a0d ldr r2, [sp, #52] ; 0x34
107672: 2102 movs r1, #2
107674: 9807 ldr r0, [sp, #28]
107676: f7ff fa5f bl 106b38 <msdos_format_printf>
if (fmt_params->fattype == FAT_FAT32) {
10767a: f89d 3082 ldrb.w r3, [sp, #130] ; 0x82
10767e: 2b04 cmp r3, #4
107680: 930b str r3, [sp, #44] ; 0x2c
107682: d10b bne.n 10769c <msdos_format+0x9c4>
fmt_params->rsvd_sector_cnt = 32;
107684: 2420 movs r4, #32
fmt_params->files_per_root_dir = 0;
107686: 2000 movs r0, #0
fmt_params->fsinfo_sec = 1;
107688: 2206 movs r2, #6
10768a: 2301 movs r3, #1
10768c: 2504 movs r5, #4
+ fmt_params->bytes_per_sector - 1)
10768e: 9e14 ldr r6, [sp, #80] ; 0x50
fmt_params->rsvd_sector_cnt = 32;
107690: 9416 str r4, [sp, #88] ; 0x58
fmt_params->files_per_root_dir = 0;
107692: 901a str r0, [sp, #104] ; 0x68
fmt_params->fsinfo_sec = 1;
107694: e9cd 231e strd r2, r3, [sp, #120] ; 0x78
107698: 950b str r5, [sp, #44] ; 0x2c
10769a: e60b b.n 1072b4 <msdos_format+0x5dc>
fmt_params->rsvd_sector_cnt = 1;
10769c: 2301 movs r3, #1
10769e: 9316 str r3, [sp, #88] ; 0x58
if (fmt_params->fattype == FAT_FAT16) {
1076a0: 9b0b ldr r3, [sp, #44] ; 0x2c
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
1076a2: 9c16 ldr r4, [sp, #88] ; 0x58
if (fmt_params->fattype == FAT_FAT16) {
1076a4: 2b02 cmp r3, #2
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
1076a6: bf13 iteet ne
1076a8: 9d0b ldrne r5, [sp, #44] ; 0x2c
1076aa: 461d moveq r5, r3
1076ac: f240 17ff movweq r7, #511 ; 0x1ff
1076b0: 273f movne r7, #63 ; 0x3f
1076b2: e5f5 b.n 1072a0 <msdos_format+0x5c8>
fmt_params->fattype = msdos_get_fat_type(
1076b4: f04f 0304 mov.w r3, #4
1076b8: f88d 3082 strb.w r3, [sp, #130] ; 0x82
if (fat_type != fmt_params->fattype) {
1076bc: 9b0b ldr r3, [sp, #44] ; 0x2c
1076be: 2b04 cmp r3, #4
1076c0: f43f ae7b beq.w 1073ba <msdos_format+0x6e2>
if ( (gigs & ( 1 << b) ) != 0 )
1076c4: 980e ldr r0, [sp, #56] ; 0x38
for ( b = 31; b > 0; b-- ) {
1076c6: 231f movs r3, #31
if ( (gigs & ( 1 << b) ) != 0 )
1076c8: 2101 movs r1, #1
1076ca: e001 b.n 1076d0 <msdos_format+0x9f8>
for ( b = 31; b > 0; b-- ) {
1076cc: 3b01 subs r3, #1
1076ce: d01f beq.n 107710 <msdos_format+0xa38> <== ALWAYS TAKEN
if ( (gigs & ( 1 << b) ) != 0 )
1076d0: fa01 f203 lsl.w r2, r1, r3
1076d4: 4210 tst r0, r2
1076d6: d0f9 beq.n 1076cc <msdos_format+0x9f4>
fmt_params->sectors_per_cluster = 1 << b;
1076d8: 9217 str r2, [sp, #92] ; 0x5c
1076da: e795 b.n 107608 <msdos_format+0x930>
fmt_params->fat_num = 2;
1076dc: 2302 movs r3, #2
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
1076de: f24c 42c0 movw r2, #50368 ; 0xc4c0
1076e2: 9807 ldr r0, [sp, #28]
1076e4: f2c0 0211 movt r2, #17
1076e8: 4619 mov r1, r3
fmt_params->fat_num = 2;
1076ea: f88d 3080 strb.w r3, [sp, #128] ; 0x80
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
1076ee: f7ff fa23 bl 106b38 <msdos_format_printf>
{
1076f2: f647 72a8 movw r2, #32680 ; 0x7fa8
uint32_t fat16_sect_per_clust = 32;
1076f6: 2320 movs r3, #32
1076f8: e586 b.n 107208 <msdos_format+0x530>
else if (fmt_params->totl_sector_cnt < FAT_FAT16_MAX_CLN * fat16_sect_per_clust) {
1076fa: f64f 72f5 movw r2, #65525 ; 0xfff5
1076fe: fb02 f303 mul.w r3, r2, r3
107702: 4299 cmp r1, r3
107704: d275 bcs.n 1077f2 <msdos_format+0xb1a>
fmt_params->fattype = FAT_FAT16;
107706: 2302 movs r3, #2
107708: f88d 3082 strb.w r3, [sp, #130] ; 0x82
fmt_params->sectors_per_cluster = 2;
10770c: 9317 str r3, [sp, #92] ; 0x5c
10770e: e584 b.n 10721a <msdos_format+0x542>
107710: 2201 movs r2, #1 <== NOT EXECUTED
107712: e7e1 b.n 1076d8 <msdos_format+0xa00> <== NOT EXECUTED
if ( fmt_params->totl_sector_cnt == 0 )
107714: 9a04 ldr r2, [sp, #16]
107716: f8dd a03c ldr.w sl, [sp, #60] ; 0x3c
10771a: 2a00 cmp r2, #0
10771c: f43f ab2f beq.w 106d7e <msdos_format+0xa6> <== ALWAYS TAKEN
if (FAT_FAT32 != fmt_params->fattype)
107720: 2b04 cmp r3, #4
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
107722: f89d 10a0 ldrb.w r1, [sp, #160] ; 0xa0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
107726: 9a17 ldr r2, [sp, #92] ; 0x5c
if (FAT_FAT32 != fmt_params->fattype)
107728: d00a beq.n 107740 <msdos_format+0xa68>
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
10772a: 981b ldr r0, [sp, #108] ; 0x6c
if (! skip_alignment)
10772c: b919 cbnz r1, 107736 <msdos_format+0xa5e>
return (sectors + clustersize - 1) & ~(clustersize - 1);
10772e: 1813 adds r3, r2, r0
107730: 4250 negs r0, r2
107732: 3b01 subs r3, #1
107734: 4018 ands r0, r3
* (fmt_params->bytes_per_sector / FAT_DIRENTRY_SIZE);
107736: 9b14 ldr r3, [sp, #80] ; 0x50
107738: 095b lsrs r3, r3, #5
10773a: fb00 f303 mul.w r3, r0, r3
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
10773e: 931a str r3, [sp, #104] ; 0x68
fmt_params->rsvd_sector_cnt = loc_align_object (fmt_params->rsvd_sector_cnt,
107740: 9c16 ldr r4, [sp, #88] ; 0x58
if (! skip_alignment)
107742: b921 cbnz r1, 10774e <msdos_format+0xa76>
return (sectors + clustersize - 1) & ~(clustersize - 1);
107744: 1913 adds r3, r2, r4
107746: 4252 negs r2, r2
107748: 3b01 subs r3, #1
10774a: ea03 0402 and.w r4, r3, r2
if ((rqdata != NULL) && (rqdata->media != 0)) {
10774e: 9b07 ldr r3, [sp, #28]
fmt_params->rsvd_sector_cnt = loc_align_object (fmt_params->rsvd_sector_cnt,
107750: 9416 str r4, [sp, #88] ; 0x58
if ((rqdata != NULL) && (rqdata->media != 0)) {
107752: b1ab cbz r3, 107780 <msdos_format+0xaa8>
107754: 7d1d ldrb r5, [r3, #20]
107756: b19d cbz r5, 107780 <msdos_format+0xaa8>
const char valid_media_codes[] =
107758: f24c 5258 movw r2, #50520 ; 0xc558
10775c: ab10 add r3, sp, #64 ; 0x40
10775e: f2c0 0211 movt r2, #17
107762: ca07 ldmia r2, {r0, r1, r2}
107764: c303 stmia r3!, {r0, r1}
if (NULL==memchr(valid_media_codes,
107766: 4629 mov r1, r5
const char valid_media_codes[] =
107768: 701a strb r2, [r3, #0]
if (NULL==memchr(valid_media_codes,
10776a: a810 add r0, sp, #64 ; 0x40
10776c: 2209 movs r2, #9
10776e: f00d fc8f bl 115090 <memchr>
107772: 2800 cmp r0, #0
107774: f43f ab03 beq.w 106d7e <msdos_format+0xa6> <== NEVER TAKEN
fmt_params->media_code = rqdata->media;
107778: f88d 5081 strb.w r5, [sp, #129] ; 0x81 <== NOT EXECUTED
if ((rqdata != NULL) && (rqdata->media != 0)) {
10777c: f7ff bb07 b.w 106d8e <msdos_format+0xb6> <== NOT EXECUTED
fmt_params->media_code = FAT_BR_MEDIA_FIXED;
107780: 23f8 movs r3, #248 ; 0xf8
107782: f88d 3081 strb.w r3, [sp, #129] ; 0x81
107786: f7ff bb02 b.w 106d8e <msdos_format+0xb6>
10778a: f8dd a03c ldr.w sl, [sp, #60] ; 0x3c <== NOT EXECUTED
10778e: f7ff baf6 b.w 106d7e <msdos_format+0xa6> <== NOT EXECUTED
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
107792: 9918 ldr r1, [sp, #96] ; 0x60
FAT_SET_BR_FAT32_ROOT_CLUSTER(mbr , 2); /* put root dir to cluster 2 */
107794: f883 002c strb.w r0, [r3, #44] ; 0x2c
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
107798: f883 2030 strb.w r2, [r3, #48] ; 0x30
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
10779c: f24c 521c movw r2, #50460 ; 0xc51c
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
1077a0: f883 1024 strb.w r1, [r3, #36] ; 0x24
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
1077a4: f2c0 0211 movt r2, #17
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
1077a8: 0a08 lsrs r0, r1, #8
1077aa: f883 0025 strb.w r0, [r3, #37] ; 0x25
1077ae: 0c08 lsrs r0, r1, #16
1077b0: 0e09 lsrs r1, r1, #24
1077b2: f883 0026 strb.w r0, [r3, #38] ; 0x26
1077b6: f883 1027 strb.w r1, [r3, #39] ; 0x27
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
1077ba: ca03 ldmia r2!, {r0, r1}
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
1077bc: 9a1e ldr r2, [sp, #120] ; 0x78
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
1077be: f8c3 c04b str.w ip, [r3, #75] ; 0x4b
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
1077c2: f8c3 0052 str.w r0, [r3, #82] ; 0x52
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
1077c6: f883 2032 strb.w r2, [r3, #50] ; 0x32
1077ca: 0a12 lsrs r2, r2, #8
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
1077cc: f8c3 1056 str.w r1, [r3, #86] ; 0x56
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
1077d0: f8c3 c034 str.w ip, [r3, #52] ; 0x34
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
1077d4: f883 2033 strb.w r2, [r3, #51] ; 0x33
FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL);
1077d8: 2229 movs r2, #41 ; 0x29
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
1077da: f8c3 c038 str.w ip, [r3, #56] ; 0x38
1077de: f8c3 c03c str.w ip, [r3, #60] ; 0x3c
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
1077e2: f8c3 c047 str.w ip, [r3, #71] ; 0x47
1077e6: f8c3 c04e str.w ip, [r3, #78] ; 0x4e
FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL);
1077ea: f883 2042 strb.w r2, [r3, #66] ; 0x42
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
1077ee: f7ff bbd6 b.w 106f9e <msdos_format+0x2c6>
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
1077f2: f115 4180 adds.w r1, r5, #1073741824 ; 0x40000000
fmt_params->fattype = FAT_FAT32;
1077f6: f04f 0204 mov.w r2, #4
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
1077fa: ea4f 7191 mov.w r1, r1, lsr #30
1077fe: f144 0300 adc.w r3, r4, #0
if ((gigs & (1 << b)) != 0)
107802: 2001 movs r0, #1
fmt_params->fattype = FAT_FAT32;
107804: f88d 2082 strb.w r2, [sp, #130] ; 0x82
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
107808: ea41 0183 orr.w r1, r1, r3, lsl #2
for (b = 31; b > 0; b--)
10780c: 231f movs r3, #31
10780e: e001 b.n 107814 <msdos_format+0xb3c>
107810: 3b01 subs r3, #1
107812: d01f beq.n 107854 <msdos_format+0xb7c>
if ((gigs & (1 << b)) != 0)
107814: fa00 f203 lsl.w r2, r0, r3
107818: 4211 tst r1, r2
10781a: d0f9 beq.n 107810 <msdos_format+0xb38>
fmt_params->sectors_per_cluster = 1 << b;
10781c: 9217 str r2, [sp, #92] ; 0x5c
10781e: e4fc b.n 10721a <msdos_format+0x542>
*volid_ptr = rand();
107820: f00e faaa bl 115d78 <rand>
107824: 9027 str r0, [sp, #156] ; 0x9c
107826: f7ff bb0a b.w 106e3e <msdos_format+0x166>
10782a: 460a mov r2, r1
from = ""; /* default: make "from" point to empty string */
10782c: f24c 41ec movw r1, #50412 ; 0xc4ec
107830: f2c0 0111 movt r1, #17
107834: f7ff bae6 b.w 106e04 <msdos_format+0x12c>
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
107838: f109 0301 add.w r3, r9, #1 <== NOT EXECUTED
10783c: ea0b 0b03 and.w fp, fp, r3 <== NOT EXECUTED
107840: e470 b.n 107124 <msdos_format+0x44c> <== NOT EXECUTED
errno = EINVAL;
107842: f00d fa1d bl 114c80 <__errno>
107846: 2316 movs r3, #22
107848: 6003 str r3, [r0, #0]
ret_val = -1;
10784a: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
10784e: 9309 str r3, [sp, #36] ; 0x24
107850: f7ff ba91 b.w 106d76 <msdos_format+0x9e>
107854: 2201 movs r2, #1
107856: e7e1 b.n 10781c <msdos_format+0xb44>
107858: f8cd 9024 str.w r9, [sp, #36] ; 0x24
10785c: e479 b.n 107152 <msdos_format+0x47a>
10785e: bf00 nop
0010ebe8 <msdos_format_dirent_with_dot>:
{
10ebe8: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
10ebec: f101 0808 add.w r8, r1, #8
10ebf0: 4606 mov r6, r0
i > 0 && *src_tmp == ' ';
10ebf2: 4643 mov r3, r8
for (i = MSDOS_SHORT_BASE_LEN, src_tmp = src + MSDOS_SHORT_BASE_LEN - 1;
10ebf4: 2008 movs r0, #8
i > 0 && *src_tmp == ' ';
10ebf6: f813 2d01 ldrb.w r2, [r3, #-1]!
10ebfa: 4607 mov r7, r0
--i,--src_tmp)
10ebfc: 3801 subs r0, #1
i > 0 && *src_tmp == ' ';
10ebfe: 2a20 cmp r2, #32
10ec00: d10e bne.n 10ec20 <msdos_format_dirent_with_dot+0x38>
for (i = MSDOS_SHORT_BASE_LEN, src_tmp = src + MSDOS_SHORT_BASE_LEN - 1;
10ec02: 2800 cmp r0, #0
10ec04: d1f7 bne.n 10ebf6 <msdos_format_dirent_with_dot+0xe> <== NEVER TAKEN
i > 0 && *src_tmp == ' ';
10ec06: 7a8b ldrb r3, [r1, #10]
10ec08: 2b20 cmp r3, #32
10ec0a: d122 bne.n 10ec52 <msdos_format_dirent_with_dot+0x6a>
10ec0c: 7a4b ldrb r3, [r1, #9]
10ec0e: 2b20 cmp r3, #32
10ec10: d140 bne.n 10ec94 <msdos_format_dirent_with_dot+0xac>
10ec12: 7a0b ldrb r3, [r1, #8]
10ec14: 2b20 cmp r3, #32
10ec16: d144 bne.n 10eca2 <msdos_format_dirent_with_dot+0xba>
*dst = '\0'; /* terminate string */
10ec18: 2300 movs r3, #0
10ec1a: 7033 strb r3, [r6, #0]
}
10ec1c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
10ec20: 4d23 ldr r5, [pc, #140] ; (10ecb0 <msdos_format_dirent_with_dot+0xc8>)
10ec22: 468e mov lr, r1
10ec24: 4634 mov r4, r6
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec26: f81e 2b01 ldrb.w r2, [lr], #1
10ec2a: f815 c002 ldrb.w ip, [r5, r2]
while (i-- > 0) {
10ec2e: f1ce 0301 rsb r3, lr, #1
10ec32: 440b add r3, r1
10ec34: 4403 add r3, r0
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec36: f00c 0c03 and.w ip, ip, #3
10ec3a: f1bc 0f01 cmp.w ip, #1
10ec3e: bf04 itt eq
10ec40: 3220 addeq r2, #32
10ec42: b2d2 uxtbeq r2, r2
while (i-- > 0) {
10ec44: 2b00 cmp r3, #0
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec46: f804 2b01 strb.w r2, [r4], #1
while (i-- > 0) {
10ec4a: dcec bgt.n 10ec26 <msdos_format_dirent_with_dot+0x3e>
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec4c: 443e add r6, r7
10ec4e: 4638 mov r0, r7
10ec50: e7d9 b.n 10ec06 <msdos_format_dirent_with_dot+0x1e>
++len; /* dot */
10ec52: 3001 adds r0, #1
--i, --src_tmp)
10ec54: 2402 movs r4, #2
*dst++ = '.'; /* append dot */
10ec56: 4637 mov r7, r6
10ec58: 232e movs r3, #46 ; 0x2e
10ec5a: f807 3b01 strb.w r3, [r7], #1
while (i-- > 0) {
10ec5e: 4d14 ldr r5, [pc, #80] ; (10ecb0 <msdos_format_dirent_with_dot+0xc8>)
--i, --src_tmp)
10ec60: 4639 mov r1, r7
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec62: f818 3b01 ldrb.w r3, [r8], #1
10ec66: 5cea ldrb r2, [r5, r3]
10ec68: f002 0203 and.w r2, r2, #3
10ec6c: 2a01 cmp r2, #1
10ec6e: bf04 itt eq
10ec70: 3320 addeq r3, #32
10ec72: b2db uxtbeq r3, r3
10ec74: f801 3b01 strb.w r3, [r1], #1
while (i-- > 0) {
10ec78: f1c1 0302 rsb r3, r1, #2
10ec7c: 4433 add r3, r6
10ec7e: 4423 add r3, r4
10ec80: 2b00 cmp r3, #0
10ec82: dcee bgt.n 10ec62 <msdos_format_dirent_with_dot+0x7a>
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec84: 1c66 adds r6, r4, #1
*dst = '\0'; /* terminate string */
10ec86: 2300 movs r3, #0
*dst++ = tolower((unsigned char)(*src_tmp++));
10ec88: 443e add r6, r7
10ec8a: 3001 adds r0, #1
++len;
10ec8c: 4420 add r0, r4
*dst = '\0'; /* terminate string */
10ec8e: 7033 strb r3, [r6, #0]
}
10ec90: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
*dst++ = '.'; /* append dot */
10ec94: 4637 mov r7, r6
10ec96: 232e movs r3, #46 ; 0x2e
++len; /* dot */
10ec98: 3001 adds r0, #1
--i, --src_tmp)
10ec9a: 2401 movs r4, #1
*dst++ = '.'; /* append dot */
10ec9c: f807 3b01 strb.w r3, [r7], #1
while (i-- > 0) {
10eca0: e7dd b.n 10ec5e <msdos_format_dirent_with_dot+0x76>
*dst++ = '.'; /* append dot */
10eca2: 4637 mov r7, r6
10eca4: 232e movs r3, #46 ; 0x2e
++len; /* dot */
10eca6: 3001 adds r0, #1
--i, --src_tmp)
10eca8: 2400 movs r4, #0
*dst++ = '.'; /* append dot */
10ecaa: f807 3b01 strb.w r3, [r7], #1
while (i-- > 0) {
10ecae: e7d6 b.n 10ec5e <msdos_format_dirent_with_dot+0x76>
10ecb0: 0011d929 .word 0x0011d929
0010f458 <msdos_get_dotdot_dir_info_cluster_num_and_offset>:
{
10f458: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10f45c: 4615 mov r5, r2
msdos_fs_info_t *fs_info = mt_entry->fs_info;
10f45e: 6887 ldr r7, [r0, #8]
{
10f460: b097 sub sp, #92 ; 0x5c
10f462: 4606 mov r6, r0
10f464: 4688 mov r8, r1
10f466: 4699 mov r9, r3
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f468: aa05 add r2, sp, #20
fat_file_fd_t *fat_fd = NULL;
10f46a: 2300 movs r3, #0
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f46c: 4629 mov r1, r5
10f46e: 4638 mov r0, r7
rtems_dosfs_convert_control *converter = fs_info->converter;
10f470: f8d7 a0cc ldr.w sl, [r7, #204] ; 0xcc
fat_file_fd_t *fat_fd = NULL;
10f474: 9305 str r3, [sp, #20]
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f476: f7fe fa1d bl 10d8b4 <fat_file_open>
if (rc != RC_OK)
10f47a: 4604 mov r4, r0
10f47c: b118 cbz r0, 10f486 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x2e>
}
10f47e: 4620 mov r0, r4
10f480: b017 add sp, #92 ; 0x5c
10f482: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
fat_fd->cln = cln;
10f486: 9905 ldr r1, [sp, #20]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10f488: f44f 1300 mov.w r3, #2097152 ; 0x200000
fat_fd->fat_file_type = FAT_DIRECTORY;
10f48c: 6108 str r0, [r1, #16]
fat_fd->map.file_cln = 0;
10f48e: 6348 str r0, [r1, #52] ; 0x34
rc = fat_file_size(&fs_info->fat, fat_fd);
10f490: 4638 mov r0, r7
fat_fd->cln = cln;
10f492: f8c1 801c str.w r8, [r1, #28]
fat_fd->map.disk_cln = fat_fd->cln;
10f496: f8c1 8038 str.w r8, [r1, #56] ; 0x38
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10f49a: 614b str r3, [r1, #20]
rc = fat_file_size(&fs_info->fat, fat_fd);
10f49c: f7fe fdf4 bl 10e088 <fat_file_size>
if (rc != RC_OK)
10f4a0: 4604 mov r4, r0
10f4a2: 2800 cmp r0, #0
10f4a4: f040 8091 bne.w 10f5ca <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x172><== ALWAYS TAKEN
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f4a8: f10d 0818 add.w r8, sp, #24
10f4ac: 4601 mov r1, r0
10f4ae: 2220 movs r2, #32
10f4b0: 4640 mov r0, r8
10f4b2: f006 f915 bl 1156e0 <memset>
msdos_long_to_short(
10f4b6: f04f 0b0b mov.w fp, #11
10f4ba: f24c 3178 movw r1, #50040 ; 0xc378
10f4be: 4643 mov r3, r8
10f4c0: f2c0 0111 movt r1, #17
10f4c4: 2201 movs r2, #1
10f4c6: 4650 mov r0, sl
10f4c8: f8cd b000 str.w fp, [sp]
10f4cc: f7ff f91a bl 10e704 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, (const uint8_t*)".", 1,
10f4d0: f8cd 800c str.w r8, [sp, #12]
10f4d4: f24c 3378 movw r3, #50040 ; 0xc378
10f4d8: f04f 0801 mov.w r8, #1
10f4dc: 4622 mov r2, r4
10f4de: 9905 ldr r1, [sp, #20]
10f4e0: f2c0 0311 movt r3, #17
10f4e4: 4630 mov r0, r6
10f4e6: 9502 str r5, [sp, #8]
10f4e8: e9cd 8800 strd r8, r8, [sp]
10f4ec: f7ff fbe2 bl 10ecb4 <msdos_find_name_in_fat_file>
if (rc != RC_OK)
10f4f0: 4604 mov r4, r0
10f4f2: 2800 cmp r0, #0
10f4f4: d169 bne.n 10f5ca <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x172><== ALWAYS TAKEN
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f4f6: ab0e add r3, sp, #56 ; 0x38
10f4f8: 4601 mov r1, r0
10f4fa: 2220 movs r2, #32
10f4fc: 4618 mov r0, r3
10f4fe: f006 f8ef bl 1156e0 <memset>
msdos_long_to_short(
10f502: f64c 0194 movw r1, #51348 ; 0xc894
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
10f506: 4603 mov r3, r0
msdos_long_to_short(
10f508: f2c0 0111 movt r1, #17
10f50c: 2202 movs r2, #2
10f50e: 4650 mov r0, sl
10f510: f8cd b000 str.w fp, [sp]
10f514: f7ff f8f6 bl 10e704 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, (const uint8_t*)"..", 2,
10f518: ab0e add r3, sp, #56 ; 0x38
10f51a: 9905 ldr r1, [sp, #20]
10f51c: 9303 str r3, [sp, #12]
10f51e: 2302 movs r3, #2
10f520: 9300 str r3, [sp, #0]
10f522: f64c 0394 movw r3, #51348 ; 0xc894
10f526: 4622 mov r2, r4
10f528: f2c0 0311 movt r3, #17
10f52c: 4630 mov r0, r6
10f52e: e9cd 8501 strd r8, r5, [sp, #4]
10f532: f7ff fbbf bl 10ecb4 <msdos_find_name_in_fat_file>
if (rc != RC_OK)
10f536: 4604 mov r4, r0
fat_file_close(&fs_info->fat, fat_fd);
10f538: 9905 ldr r1, [sp, #20]
10f53a: 4638 mov r0, r7
if (rc != RC_OK)
10f53c: 2c00 cmp r4, #0
10f53e: d146 bne.n 10f5ce <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x176><== ALWAYS TAKEN
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
10f540: f8bd a032 ldrh.w sl, [sp, #50] ; 0x32
10f544: f8bd b02c ldrh.w fp, [sp, #44] ; 0x2c
rc = fat_file_close(&fs_info->fat, fat_fd);
10f548: f7fe fb9a bl 10dc80 <fat_file_close>
if ( rc != RC_OK )
10f54c: 4604 mov r4, r0
10f54e: 2800 cmp r0, #0
10f550: d195 bne.n 10f47e <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x26><== ALWAYS TAKEN
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
10f552: f8bd 204c ldrh.w r2, [sp, #76] ; 0x4c
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f556: 4629 mov r1, r5
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
10f558: f8bd 3052 ldrh.w r3, [sp, #82] ; 0x52
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f55c: 4638 mov r0, r7
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
10f55e: ea53 4302 orrs.w r3, r3, r2, lsl #16
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f562: aa05 add r2, sp, #20
dir_pos->sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
10f564: bf02 ittt eq
10f566: e9c5 8300 strdeq r8, r3, [r5]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10f56a: f04f 33ff moveq.w r3, #4294967295 ; 0xffffffff
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
10f56e: e9c5 3302 strdeq r3, r3, [r5, #8]
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
10f572: f7fe f99f bl 10d8b4 <fat_file_open>
if (rc != RC_OK)
10f576: 4604 mov r4, r0
10f578: 2800 cmp r0, #0
10f57a: d180 bne.n 10f47e <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x26><== ALWAYS TAKEN
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
10f57c: f8bd 204c ldrh.w r2, [sp, #76] ; 0x4c
rc = fat_file_size(&fs_info->fat, fat_fd);
10f580: 4638 mov r0, r7
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
10f582: f8bd 3052 ldrh.w r3, [sp, #82] ; 0x52
fat_fd->cln = fs_info->fat.vol.rdir_cl;
10f586: 9905 ldr r1, [sp, #20]
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
10f588: ea53 4302 orrs.w r3, r3, r2, lsl #16
fat_fd->cln = fs_info->fat.vol.rdir_cl;
10f58c: bf08 it eq
10f58e: 6c7b ldreq r3, [r7, #68] ; 0x44
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node);
10f590: 61cb str r3, [r1, #28]
fat_fd->map.disk_cln = fat_fd->cln;
10f592: 638b str r3, [r1, #56] ; 0x38
fat_fd->fat_file_type = FAT_DIRECTORY;
10f594: 2300 movs r3, #0
10f596: 610b str r3, [r1, #16]
fat_fd->map.file_cln = 0;
10f598: 634b str r3, [r1, #52] ; 0x34
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10f59a: f44f 1300 mov.w r3, #2097152 ; 0x200000
10f59e: 614b str r3, [r1, #20]
rc = fat_file_size(&fs_info->fat, fat_fd);
10f5a0: f7fe fd72 bl 10e088 <fat_file_size>
if (rc != RC_OK)
10f5a4: 4604 mov r4, r0
10f5a6: b980 cbnz r0, 10f5ca <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x172>
rc = msdos_find_node_by_cluster_num_in_fat_file(mt_entry, fat_fd, cl4find,
10f5a8: 9905 ldr r1, [sp, #20]
10f5aa: ea4a 420b orr.w r2, sl, fp, lsl #16
10f5ae: 462b mov r3, r5
10f5b0: f8cd 9000 str.w r9, [sp]
10f5b4: 4630 mov r0, r6
10f5b6: f7ff fed1 bl 10f35c <msdos_find_node_by_cluster_num_in_fat_file>
if (rc != RC_OK)
10f5ba: 4604 mov r4, r0
fat_file_close(&fs_info->fat, fat_fd);
10f5bc: 9905 ldr r1, [sp, #20]
10f5be: 4638 mov r0, r7
if (rc != RC_OK)
10f5c0: b92c cbnz r4, 10f5ce <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x176>
rc = fat_file_close(&fs_info->fat, fat_fd);
10f5c2: f7fe fb5d bl 10dc80 <fat_file_close>
10f5c6: 4604 mov r4, r0
return rc;
10f5c8: e759 b.n 10f47e <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x26>
fat_file_close(&fs_info->fat, fat_fd);
10f5ca: 9905 ldr r1, [sp, #20] <== NOT EXECUTED
10f5cc: 4638 mov r0, r7 <== NOT EXECUTED
10f5ce: f7fe fb57 bl 10dc80 <fat_file_close> <== NOT EXECUTED
}
10f5d2: 4620 mov r0, r4 <== NOT EXECUTED
10f5d4: b017 add sp, #92 ; 0x5c <== NOT EXECUTED
10f5d6: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
10f5da: bf00 nop
0010f5dc <msdos_get_name_node>:
{
10f5dc: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr}
10f5e0: b084 sub sp, #16
10f5e2: 9c0a ldr r4, [sp, #40] ; 0x28
10f5e4: 4688 mov r8, r1
10f5e6: 4615 mov r5, r2
10f5e8: 461a mov r2, r3
10f5ea: 9e0b ldr r6, [sp, #44] ; 0x2c
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
10f5ec: 462b mov r3, r5
{
10f5ee: 9f0c ldr r7, [sp, #48] ; 0x30
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
10f5f0: 9401 str r4, [sp, #4]
{
10f5f2: 4604 mov r4, r0
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
10f5f4: 6881 ldr r1, [r0, #8]
10f5f6: 9200 str r2, [sp, #0]
10f5f8: 4642 mov r2, r8
10f5fa: 9602 str r6, [sp, #8]
10f5fc: 9703 str r7, [sp, #12]
10f5fe: 6940 ldr r0, [r0, #20]
10f600: f7ff fb58 bl 10ecb4 <msdos_find_name_in_fat_file>
if ((rc != RC_OK) && (rc != MSDOS_NAME_NOT_FOUND_ERR))
10f604: f647 5c01 movw ip, #32001 ; 0x7d01
10f608: 2800 cmp r0, #0
10f60a: bf18 it ne
10f60c: 4560 cmpne r0, ip
10f60e: bf14 ite ne
10f610: f04f 0e01 movne.w lr, #1
10f614: f04f 0e00 moveq.w lr, #0
if (!create_node)
10f618: ea58 030e orrs.w r3, r8, lr
10f61c: d002 beq.n 10f624 <msdos_get_name_node+0x48>
}
10f61e: b004 add sp, #16
10f620: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc}
if (rc == MSDOS_NAME_NOT_FOUND_ERR)
10f624: 4560 cmp r0, ip
10f626: d0fa beq.n 10f61e <msdos_get_name_node+0x42>
if (rc == RC_OK)
10f628: 2800 cmp r0, #0
10f62a: d1f8 bne.n 10f61e <msdos_get_name_node+0x42> <== ALWAYS TAKEN
if (strncmp(name, "..", 2) == 0)
10f62c: 782b ldrb r3, [r5, #0]
10f62e: 2b2e cmp r3, #46 ; 0x2e
10f630: d1f5 bne.n 10f61e <msdos_get_name_node+0x42>
10f632: 786b ldrb r3, [r5, #1]
10f634: 2b2e cmp r3, #46 ; 0x2e
10f636: d1f2 bne.n 10f61e <msdos_get_name_node+0x42> <== ALWAYS TAKEN
dotdot_cln = MSDOS_EXTRACT_CLUSTER_NUM((name_dir_entry));
10f638: 8abb ldrh r3, [r7, #20]
10f63a: 8b79 ldrh r1, [r7, #26]
if (dotdot_cln == 0)
10f63c: ea51 4103 orrs.w r1, r1, r3, lsl #16
10f640: d107 bne.n 10f652 <msdos_get_name_node+0x76>
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
10f642: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
dir_pos->sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
10f646: 2201 movs r2, #1
10f648: e9c6 0301 strd r0, r3, [r6, #4]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
10f64c: 60f3 str r3, [r6, #12]
10f64e: 6032 str r2, [r6, #0]
10f650: e7e5 b.n 10f61e <msdos_get_name_node+0x42>
msdos_get_dotdot_dir_info_cluster_num_and_offset(parent_loc->mt_entry,
10f652: 6960 ldr r0, [r4, #20]
10f654: 463b mov r3, r7
10f656: 4632 mov r2, r6
}
10f658: b004 add sp, #16
10f65a: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr}
msdos_get_dotdot_dir_info_cluster_num_and_offset(parent_loc->mt_entry,
10f65e: f7ff befb b.w 10f458 <msdos_get_dotdot_dir_info_cluster_num_and_offset>
10f662: bf00 nop
0010e690 <msdos_get_utf16_string_from_long_entry.part.0>:
msdos_get_utf16_string_from_long_entry (
10e690: b500 push {lr} <== NOT EXECUTED
10e692: 3902 subs r1, #2 <== NOT EXECUTED
memcpy (&entry_string_buf[0], &entry[1], 10 );
10e694: f8d0 c001 ldr.w ip, [r0, #1] <== NOT EXECUTED
10e698: f8d0 3005 ldr.w r3, [r0, #5] <== NOT EXECUTED
10e69c: f8c1 c002 str.w ip, [r1, #2] <== NOT EXECUTED
10e6a0: f8c1 3006 str.w r3, [r1, #6] <== NOT EXECUTED
10e6a4: f8b0 3009 ldrh.w r3, [r0, #9] <== NOT EXECUTED
10e6a8: 814b strh r3, [r1, #10] <== NOT EXECUTED
memcpy (&entry_string_buf[5], &entry[14], 12 );
10e6aa: f8d0 3016 ldr.w r3, [r0, #22] <== NOT EXECUTED
10e6ae: f8d0 e00e ldr.w lr, [r0, #14] <== NOT EXECUTED
10e6b2: f8d0 c012 ldr.w ip, [r0, #18] <== NOT EXECUTED
10e6b6: 614b str r3, [r1, #20] <== NOT EXECUTED
10e6b8: f8c1 e00c str.w lr, [r1, #12] <== NOT EXECUTED
10e6bc: f8c1 c010 str.w ip, [r1, #16] <== NOT EXECUTED
10e6c0: 69c3 ldr r3, [r0, #28] <== NOT EXECUTED
for (chars_in_entry = 0;
10e6c2: 2000 movs r0, #0 <== NOT EXECUTED
memcpy (&entry_string_buf[11], &entry[28], 4 );
10e6c4: 618b str r3, [r1, #24] <== NOT EXECUTED
if (is_first_entry) {
10e6c6: b92a cbnz r2, 10e6d4 <msdos_get_utf16_string_from_long_entry.part.0+0x44><== NOT EXECUTED
10e6c8: 201a movs r0, #26 <== NOT EXECUTED
}
10e6ca: f85d fb04 ldr.w pc, [sp], #4 <== NOT EXECUTED
++chars_in_entry) {
10e6ce: 3001 adds r0, #1 <== NOT EXECUTED
for (chars_in_entry = 0;
10e6d0: 280d cmp r0, #13 <== NOT EXECUTED
10e6d2: d0f9 beq.n 10e6c8 <msdos_get_utf16_string_from_long_entry.part.0+0x38><== NOT EXECUTED
&& entry_string_buf[chars_in_entry] != 0x0000);
10e6d4: f831 3f02 ldrh.w r3, [r1, #2]! <== NOT EXECUTED
10e6d8: 2b00 cmp r3, #0 <== NOT EXECUTED
10e6da: d1f8 bne.n 10e6ce <msdos_get_utf16_string_from_long_entry.part.0+0x3e><== NOT EXECUTED
return chars_in_entry * MSDOS_NAME_LFN_BYTES_PER_CHAR;
10e6dc: 0040 lsls r0, r0, #1 <== NOT EXECUTED
}
10e6de: f85d fb04 ldr.w pc, [sp], #4 <== NOT EXECUTED
10e6e2: bf00 nop
00107928 <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
)
{
107928: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
int rc = RC_OK;
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
10792c: 2400 movs r4, #0
{
10792e: b087 sub sp, #28
107930: 4606 mov r6, r0
107932: 4689 mov r9, r1
fat_dir_pos_t root_pos;
uint32_t cl_buf_size;
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
107934: 2001 movs r0, #1
107936: 21d0 movs r1, #208 ; 0xd0
{
107938: 4617 mov r7, r2
10793a: 4698 mov r8, r3
fat_file_fd_t *fat_fd = NULL;
10793c: 9401 str r4, [sp, #4]
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
10793e: f004 fbd5 bl 10c0ec <calloc>
if (!fs_info)
107942: 2800 cmp r0, #0
107944: d070 beq.n 107a28 <msdos_initialize_support+0x100> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(ENOMEM);
temp_mt_entry->fs_info = fs_info;
fs_info->converter = converter;
107946: 9b0e ldr r3, [sp, #56] ; 0x38
107948: 4604 mov r4, r0
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
10794a: 6bb1 ldr r1, [r6, #56] ; 0x38
temp_mt_entry->fs_info = fs_info;
10794c: 60b0 str r0, [r6, #8]
fs_info->converter = converter;
10794e: f8c0 30cc str.w r3, [r0, #204] ; 0xcc
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
107952: f005 f9fd bl 10cd50 <fat_init_volume_info>
if (rc != RC_OK)
107956: 4605 mov r5, r0
107958: 2800 cmp r0, #0
10795a: d13f bne.n 1079dc <msdos_initialize_support+0xb4> <== ALWAYS 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;
10795c: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff
dir_pos->sname.ofs = 0;
107960: 9003 str r0, [sp, #12]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
107962: e9cd 3304 strd r3, r3, [sp, #16]
* 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);
107966: aa01 add r2, sp, #4
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
107968: 2301 movs r3, #1
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
10796a: a902 add r1, sp, #8
10796c: 4620 mov r0, r4
fs_info->directory_handlers = directory_handlers;
10796e: e9c4 872a strd r8, r7, [r4, #168] ; 0xa8
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
107972: 9302 str r3, [sp, #8]
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
107974: f005 ff9e bl 10d8b4 <fat_file_open>
if (rc != RC_OK)
107978: 4605 mov r5, r0
10797a: bb60 cbnz r0, 1079d6 <msdos_initialize_support+0xae>
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
fat_fd->cln = fs_info->fat.vol.rdir_cl;
10797c: 6c63 ldr r3, [r4, #68] ; 0x44
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10797e: f44f 1200 mov.w r2, #2097152 ; 0x200000
fat_fd->fat_file_type = FAT_DIRECTORY;
107982: 9f01 ldr r7, [sp, #4]
107984: 6138 str r0, [r7, #16]
fat_fd->cln = fs_info->fat.vol.rdir_cl;
107986: 61fb str r3, [r7, #28]
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
107988: e9c7 030d strd r0, r3, [r7, #52] ; 0x34
fat_fd->size_limit = MSDOS_MAX_DIR_LENGTH;
10798c: 617a str r2, [r7, #20]
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
10798e: bb63 cbnz r3, 1079ea <msdos_initialize_support+0xc2>
{
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
107990: 6b60 ldr r0, [r4, #52] ; 0x34
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
107992: 68a3 ldr r3, [r4, #8]
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
107994: 61b8 str r0, [r7, #24]
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
107996: 4298 cmp r0, r3
107998: bf38 it cc
10799a: 4618 movcc r0, r3
return rc;
}
cl_buf_size = fs_info->fat.vol.bpc;
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
10799c: 2101 movs r1, #1
10799e: f004 fba5 bl 10c0ec <calloc>
1079a2: f8c4 00c8 str.w r0, [r4, #200] ; 0xc8
if (fs_info->cl_buf == NULL)
1079a6: b3a8 cbz r0, 107a14 <msdos_initialize_support+0xec>
}
rtems_recursive_mutex_init(&fs_info->vol_mutex,
RTEMS_FILESYSTEM_TYPE_DOSFS);
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
1079a8: 6a72 ldr r2, [r6, #36] ; 0x24
const char *_name)
{
struct _Mutex_recursive_Control _init =
_MUTEX_RECURSIVE_NAMED_INITIALIZER(_name);
*_mutex = _init;
1079aa: f64b 43e0 movw r3, #48352 ; 0xbce0
1079ae: f2c0 0311 movt r3, #17
1079b2: f8c4 30c0 str.w r3, [r4, #192] ; 0xc0
1079b6: 2300 movs r3, #0
1079b8: e9c4 332c strd r3, r3, [r4, #176] ; 0xb0
1079bc: e9c4 332e strd r3, r3, [r4, #184] ; 0xb8
1079c0: f8c4 30c4 str.w r3, [r4, #196] ; 0xc4
1079c4: 6097 str r7, [r2, #8]
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
1079c6: f8c2 8010 str.w r8, [r2, #16]
temp_mt_entry->ops = op_table;
1079ca: f8c6 900c str.w r9, [r6, #12]
return rc;
}
1079ce: 4628 mov r0, r5
1079d0: b007 add sp, #28
1079d2: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
fat_shutdown_drive(&fs_info->fat);
1079d6: 4620 mov r0, r4 <== NOT EXECUTED
1079d8: f005 fc30 bl 10d23c <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
1079dc: 4620 mov r0, r4 <== NOT EXECUTED
1079de: f7fd fe01 bl 1055e4 <free> <== NOT EXECUTED
}
1079e2: 4628 mov r0, r5 <== NOT EXECUTED
1079e4: b007 add sp, #28 <== NOT EXECUTED
1079e6: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
rc = fat_file_size(&fs_info->fat, fat_fd);
1079ea: 4639 mov r1, r7
1079ec: 4620 mov r0, r4
1079ee: f006 fb4b bl 10e088 <fat_file_size>
if ( rc != RC_OK )
1079f2: 4607 mov r7, r0
1079f4: b910 cbnz r0, 1079fc <msdos_initialize_support+0xd4>
cl_buf_size = fs_info->fat.vol.bpc;
1079f6: 68a0 ldr r0, [r4, #8]
fat_file_close(&fs_info->fat, fat_fd);
1079f8: 9f01 ldr r7, [sp, #4]
1079fa: e7cf b.n 10799c <msdos_initialize_support+0x74>
fat_file_close(&fs_info->fat, fat_fd);
1079fc: 9901 ldr r1, [sp, #4] <== NOT EXECUTED
1079fe: 4620 mov r0, r4 <== NOT EXECUTED
107a00: f006 f93e bl 10dc80 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
107a04: 4620 mov r0, r4 <== NOT EXECUTED
return rc;
107a06: 463d mov r5, r7 <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
107a08: f005 fc18 bl 10d23c <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
107a0c: 4620 mov r0, r4 <== NOT EXECUTED
107a0e: f7fd fde9 bl 1055e4 <free> <== NOT EXECUTED
return rc;
107a12: e7dc b.n 1079ce <msdos_initialize_support+0xa6> <== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
107a14: 4639 mov r1, r7 <== NOT EXECUTED
107a16: 4620 mov r0, r4 <== NOT EXECUTED
107a18: f006 f932 bl 10dc80 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
107a1c: 4620 mov r0, r4 <== NOT EXECUTED
107a1e: f005 fc0d bl 10d23c <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
107a22: 4620 mov r0, r4 <== NOT EXECUTED
107a24: f7fd fdde bl 1055e4 <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
107a28: f00d f92a bl 114c80 <__errno> <== NOT EXECUTED
107a2c: 230c movs r3, #12 <== NOT EXECUTED
107a2e: f04f 35ff mov.w r5, #4294967295 ; 0xffffffff <== NOT EXECUTED
107a32: 6003 str r3, [r0, #0] <== NOT EXECUTED
107a34: e7cb b.n 1079ce <msdos_initialize_support+0xa6> <== NOT EXECUTED
107a36: bf00 nop
0010e6e4 <msdos_lfn_checksum>:
cs = 0;
10e6e4: 2300 movs r3, #0 <== NOT EXECUTED
10e6e6: 1e42 subs r2, r0, #1 <== NOT EXECUTED
10e6e8: f100 010a add.w r1, r0, #10 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
10e6ec: f812 0f01 ldrb.w r0, [r2, #1]! <== NOT EXECUTED
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
10e6f0: 428a cmp r2, r1 <== NOT EXECUTED
10e6f2: eb00 0053 add.w r0, r0, r3, lsr #1 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + name[i];
10e6f6: eb00 13c3 add.w r3, r0, r3, lsl #7 <== NOT EXECUTED
10e6fa: f003 03ff and.w r3, r3, #255 ; 0xff <== NOT EXECUTED
for (i = 0; i < MSDOS_SHORT_NAME_LEN; ++i) {
10e6fe: d1f5 bne.n 10e6ec <msdos_lfn_checksum+0x8> <== NOT EXECUTED
}
10e700: 4618 mov r0, r3 <== NOT EXECUTED
10e702: 4770 bx lr <== NOT EXECUTED
0010e704 <msdos_long_to_short>:
{
10e704: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10e708: 4682 mov sl, r0
10e70a: b08b sub sp, #44 ; 0x2c
10e70c: 4618 mov r0, r3
10e70e: 460d mov r5, r1
memset (sfn, ' ', sfn_len);
10e710: 2120 movs r1, #32
{
10e712: 9307 str r3, [sp, #28]
size_t codepage_name_len = converter->buffer.size;
10e714: f8da 3008 ldr.w r3, [sl, #8]
{
10e718: 9204 str r2, [sp, #16]
memset (sfn, ' ', sfn_len);
10e71a: 9a14 ldr r2, [sp, #80] ; 0x50
void *buffer = converter->buffer.data;
10e71c: f8da 4004 ldr.w r4, [sl, #4]
size_t codepage_name_len = converter->buffer.size;
10e720: 9309 str r3, [sp, #36] ; 0x24
memset (sfn, ' ', sfn_len);
10e722: f006 ffdd bl 1156e0 <memset>
if ((lfn[0] == '.') && (lfn_len == 1))
10e726: 782a ldrb r2, [r5, #0]
10e728: 2a2e cmp r2, #46 ; 0x2e
10e72a: f000 8091 beq.w 10e850 <msdos_long_to_short+0x14c>
for (i = 0; i < lfn_len; i++)
10e72e: 9b04 ldr r3, [sp, #16]
10e730: 2b00 cmp r3, #0
10e732: f340 8087 ble.w 10e844 <msdos_long_to_short+0x140> <== ALWAYS TAKEN
10e736: 1e59 subs r1, r3, #1
10e738: f1c5 0001 rsb r0, r5, #1
10e73c: 4429 add r1, r5
10e73e: 462b mov r3, r5
10e740: e003 b.n 10e74a <msdos_long_to_short+0x46>
10e742: 4299 cmp r1, r3
10e744: d07f beq.n 10e846 <msdos_long_to_short+0x142>
if ((lfn[i] != ' ') && (lfn[i] != '.'))
10e746: f813 2f01 ldrb.w r2, [r3, #1]!
10e74a: 2a20 cmp r2, #32
10e74c: bf18 it ne
10e74e: 2a2e cmpne r2, #46 ; 0x2e
10e750: eb00 0203 add.w r2, r0, r3
10e754: d0f5 beq.n 10e742 <msdos_long_to_short+0x3e>
eno = (*converter->handler->utf8_to_codepage) (
10e756: f8da 3000 ldr.w r3, [sl]
10e75a: aa09 add r2, sp, #36 ; 0x24
10e75c: 9200 str r2, [sp, #0]
10e75e: 4629 mov r1, r5
10e760: 9a04 ldr r2, [sp, #16]
10e762: 4650 mov r0, sl
10e764: 681e ldr r6, [r3, #0]
10e766: 4623 mov r3, r4
10e768: 47b0 blx r6
if (eno == EINVAL)
10e76a: 2816 cmp r0, #22
10e76c: d04c beq.n 10e808 <msdos_long_to_short+0x104>
type = msdos_name_type (
10e76e: f8dd 8024 ldr.w r8, [sp, #36] ; 0x24
while (*name && (count < name_len))
10e772: f894 9000 ldrb.w r9, [r4]
10e776: f1b9 0f00 cmp.w r9, #0
10e77a: bf18 it ne
10e77c: f1b8 0f00 cmpne.w r8, #0
10e780: bfcc ite gt
10e782: 2301 movgt r3, #1
10e784: 2300 movle r3, #0
10e786: 9303 str r3, [sp, #12]
10e788: dd7c ble.n 10e884 <msdos_long_to_short+0x180> <== ALWAYS TAKEN
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
10e78a: f64c 1298 movw r2, #51608 ; 0xc998
bool uppercase = false;
10e78e: 2300 movs r3, #0
if (strchr(" +,;=[]", ch) != NULL)
10e790: f64c 1790 movw r7, #51600 ; 0xc990
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
10e794: f2c0 0211 movt r2, #17
int dot_at = -1;
10e798: 46cb mov fp, r9
if (strchr(" +,;=[]", ch) != NULL)
10e79a: f2c0 0711 movt r7, #17
int dot_at = -1;
10e79e: f04f 36ff mov.w r6, #4294967295 ; 0xffffffff
10e7a2: 4699 mov r9, r3
bool uppercase = false;
10e7a4: 9305 str r3, [sp, #20]
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
10e7a6: 9206 str r2, [sp, #24]
bool lowercase = false;
10e7a8: 9302 str r3, [sp, #8]
10e7aa: e027 b.n 10e7fc <msdos_long_to_short+0xf8>
if ((ch == '.') || isalnum((unsigned char)ch) ||
10e7ac: f1bb 0f2e cmp.w fp, #46 ; 0x2e
10e7b0: d044 beq.n 10e83c <msdos_long_to_short+0x138>
10e7b2: 4b39 ldr r3, [pc, #228] ; (10e898 <msdos_long_to_short+0x194>)
10e7b4: f81b 2003 ldrb.w r2, [fp, r3]
10e7b8: 0752 lsls r2, r2, #29
10e7ba: d104 bne.n 10e7c6 <msdos_long_to_short+0xc2>
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
10e7bc: 9806 ldr r0, [sp, #24]
10e7be: 4659 mov r1, fp
10e7c0: f007 fbf6 bl 115fb0 <strchr>
if ((ch == '.') || isalnum((unsigned char)ch) ||
10e7c4: b378 cbz r0, 10e826 <msdos_long_to_short+0x122>
if (dot_at >= 0)
10e7c6: 1c73 adds r3, r6, #1
10e7c8: d05e beq.n 10e888 <msdos_long_to_short+0x184>
if (is_dot || ((count - dot_at) > 3))
10e7ca: eba9 0206 sub.w r2, r9, r6
10e7ce: 2a03 cmp r2, #3
10e7d0: dc1a bgt.n 10e808 <msdos_long_to_short+0x104>
else if ((*name >= 'A') && (*name <= 'Z'))
10e7d2: f1ab 0241 sub.w r2, fp, #65 ; 0x41
10e7d6: 2a19 cmp r2, #25
10e7d8: d92d bls.n 10e836 <msdos_long_to_short+0x132>
lowercase = true;
10e7da: e9dd 3202 ldrd r3, r2, [sp, #8]
else if ((*name >= 'a') && (*name <= 'z'))
10e7de: f1ab 0161 sub.w r1, fp, #97 ; 0x61
lowercase = true;
10e7e2: 2919 cmp r1, #25
10e7e4: bf98 it ls
10e7e6: 4613 movls r3, r2
10e7e8: 9302 str r3, [sp, #8]
while (*name && (count < name_len))
10e7ea: f814 bf01 ldrb.w fp, [r4, #1]!
count++;
10e7ee: f109 0901 add.w r9, r9, #1
while (*name && (count < name_len))
10e7f2: f1bb 0f00 cmp.w fp, #0
10e7f6: bf18 it ne
10e7f8: 45c8 cmpne r8, r9
10e7fa: dd38 ble.n 10e86e <msdos_long_to_short+0x16a>
if (strchr(" +,;=[]", ch) != NULL)
10e7fc: 4659 mov r1, fp
10e7fe: 4638 mov r0, r7
10e800: f007 fbd6 bl 115fb0 <strchr>
10e804: 2800 cmp r0, #0
10e806: d0d1 beq.n 10e7ac <msdos_long_to_short+0xa8>
type = MSDOS_NAME_LONG;
10e808: 2402 movs r4, #2
short_filename_length = msdos_filename_utf8_to_short_name_for_save (
10e80a: 9b14 ldr r3, [sp, #80] ; 0x50
10e80c: 4629 mov r1, r5
10e80e: 9a04 ldr r2, [sp, #16]
10e810: 4650 mov r0, sl
10e812: 9300 str r3, [sp, #0]
10e814: 9b07 ldr r3, [sp, #28]
10e816: f004 f989 bl 112b2c <msdos_filename_utf8_to_short_name_for_save>
if (short_filename_length < 0 ) {
10e81a: 2800 cmp r0, #0
10e81c: db06 blt.n 10e82c <msdos_long_to_short+0x128> <== ALWAYS TAKEN
}
10e81e: 4620 mov r0, r4
10e820: b00b add sp, #44 ; 0x2c
10e822: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
10e826: f01b 0f80 tst.w fp, #128 ; 0x80
10e82a: d1cc bne.n 10e7c6 <msdos_long_to_short+0xc2>
return MSDOS_NAME_INVALID;
10e82c: 2400 movs r4, #0
}
10e82e: 4620 mov r0, r4
10e830: b00b add sp, #44 ; 0x2c
10e832: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
uppercase = true;
10e836: 9b03 ldr r3, [sp, #12]
10e838: 9305 str r3, [sp, #20]
10e83a: e7d6 b.n 10e7ea <msdos_long_to_short+0xe6>
if (dot_at >= 0)
10e83c: 3601 adds r6, #1
10e83e: d1e3 bne.n 10e808 <msdos_long_to_short+0x104>
10e840: 464e mov r6, r9
10e842: e7d2 b.n 10e7ea <msdos_long_to_short+0xe6>
for (i = 0; i < lfn_len; i++)
10e844: 2200 movs r2, #0 <== NOT EXECUTED
if (i == lfn_len)
10e846: 9b04 ldr r3, [sp, #16]
10e848: 4293 cmp r3, r2
10e84a: d184 bne.n 10e756 <msdos_long_to_short+0x52> <== ALWAYS TAKEN
return MSDOS_NAME_INVALID;
10e84c: 2400 movs r4, #0
10e84e: e7ee b.n 10e82e <msdos_long_to_short+0x12a>
if ((lfn[0] == '.') && (lfn_len == 1))
10e850: 9b04 ldr r3, [sp, #16]
10e852: 2b01 cmp r3, #1
10e854: d012 beq.n 10e87c <msdos_long_to_short+0x178>
if ((lfn[0] == '.') && (lfn[1] == '.') && (lfn_len == 2))
10e856: 786b ldrb r3, [r5, #1]
10e858: 9904 ldr r1, [sp, #16]
10e85a: 2b2e cmp r3, #46 ; 0x2e
10e85c: bf08 it eq
10e85e: 2902 cmpeq r1, #2
10e860: f47f af65 bne.w 10e72e <msdos_long_to_short+0x2a>
sfn[0] = sfn[1] = '.';
10e864: 9b07 ldr r3, [sp, #28]
return MSDOS_NAME_SHORT;
10e866: 2401 movs r4, #1
sfn[0] = sfn[1] = '.';
10e868: 705a strb r2, [r3, #1]
10e86a: 701a strb r2, [r3, #0]
return MSDOS_NAME_SHORT;
10e86c: e7d7 b.n 10e81e <msdos_long_to_short+0x11a>
type = MSDOS_NAME_LONG;
10e86e: 9b02 ldr r3, [sp, #8]
10e870: 9a05 ldr r2, [sp, #20]
10e872: 4213 tst r3, r2
10e874: bf0c ite eq
10e876: 2401 moveq r4, #1
10e878: 2402 movne r4, #2
10e87a: e7c6 b.n 10e80a <msdos_long_to_short+0x106>
return MSDOS_NAME_SHORT;
10e87c: 461c mov r4, r3
sfn[0] = '.';
10e87e: 9b07 ldr r3, [sp, #28]
10e880: 701a strb r2, [r3, #0]
return MSDOS_NAME_SHORT;
10e882: e7cc b.n 10e81e <msdos_long_to_short+0x11a>
return MSDOS_NAME_SHORT;
10e884: 2401 movs r4, #1 <== NOT EXECUTED
10e886: e7c0 b.n 10e80a <msdos_long_to_short+0x106> <== NOT EXECUTED
if (count == 8 && !is_dot)
10e888: f1b9 0f08 cmp.w r9, #8
10e88c: d1a1 bne.n 10e7d2 <msdos_long_to_short+0xce>
10e88e: f1bb 0f2e cmp.w fp, #46 ; 0x2e
10e892: d09e beq.n 10e7d2 <msdos_long_to_short+0xce> <== ALWAYS TAKEN
10e894: e7b8 b.n 10e808 <msdos_long_to_short+0x104>
10e896: bf00 nop
10e898: 0011d929 .word 0x0011d929
00107a38 <msdos_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
107a38: b510 push {r4, lr}
fat_file_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
107a3a: f403 4e70 and.w lr, r3, #61440 ; 0xf000
107a3e: f5be 4f80 cmp.w lr, #16384 ; 0x4000
{
107a42: 461c mov r4, r3
107a44: 468c mov ip, r1
107a46: 4613 mov r3, r2
if (S_ISDIR(mode))
107a48: d00c beq.n 107a64 <msdos_mknod+0x2c>
{
type = FAT_DIRECTORY;
}
else if (S_ISREG(mode))
107a4a: f5be 4f00 cmp.w lr, #32768 ; 0x8000
{
type = FAT_FILE;
107a4e: bf08 it eq
107a50: 2104 moveq r1, #4
else if (S_ISREG(mode))
107a52: d109 bne.n 107a68 <msdos_mknod+0x30> <== ALWAYS TAKEN
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
107a54: 9402 str r4, [sp, #8]
107a56: 2400 movs r4, #0
107a58: 9403 str r4, [sp, #12]
107a5a: 4662 mov r2, ip
return rc;
}
107a5c: e8bd 4010 ldmia.w sp!, {r4, lr}
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
107a60: f006 bbcc b.w 10e1fc <msdos_creat_node>
type = FAT_DIRECTORY;
107a64: 2100 movs r1, #0
107a66: e7f5 b.n 107a54 <msdos_mknod+0x1c>
rtems_set_errno_and_return_minus_one(EINVAL);
107a68: f00d f90a bl 114c80 <__errno> <== NOT EXECUTED
107a6c: 2316 movs r3, #22 <== NOT EXECUTED
107a6e: 6003 str r3, [r0, #0] <== NOT EXECUTED
}
107a70: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
107a74: bd10 pop {r4, pc} <== NOT EXECUTED
107a76: bf00 nop
00107a78 <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
)
{
107a78: b530 push {r4, r5, lr} <== NOT EXECUTED
107a7a: 460c mov r4, r1 <== NOT EXECUTED
int rc = RC_OK;
fat_file_fd_t *old_fat_fd = old_loc->node_access;
107a7c: 688d ldr r5, [r1, #8] <== NOT EXECUTED
{
107a7e: b083 sub sp, #12 <== NOT EXECUTED
/*
* create new directory entry as "hard link", copying relevant info from
* existing file
*/
rc = msdos_creat_node(new_parent_loc,
107a80: f44f 4100 mov.w r1, #32768 ; 0x8000 <== NOT EXECUTED
{
107a84: 4610 mov r0, r2 <== NOT EXECUTED
rc = msdos_creat_node(new_parent_loc,
107a86: 9100 str r1, [sp, #0] <== NOT EXECUTED
107a88: 461a mov r2, r3 <== NOT EXECUTED
107a8a: 2102 movs r1, #2 <== NOT EXECUTED
107a8c: 9b06 ldr r3, [sp, #24] <== NOT EXECUTED
107a8e: 9501 str r5, [sp, #4] <== NOT EXECUTED
107a90: f006 fbb4 bl 10e1fc <msdos_creat_node> <== NOT EXECUTED
FAT_HARD_LINK,new_name,new_namelen,S_IFREG,
old_fat_fd);
if (rc != RC_OK)
107a94: b108 cbz r0, 107a9a <msdos_rename+0x22> <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
107a96: b003 add sp, #12 <== NOT EXECUTED
107a98: bd30 pop {r4, r5, pc} <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
107a9a: 6960 ldr r0, [r4, #20] <== NOT EXECUTED
107a9c: 22e5 movs r2, #229 ; 0xe5 <== NOT EXECUTED
107a9e: f105 0120 add.w r1, r5, #32 <== NOT EXECUTED
}
107aa2: b003 add sp, #12 <== NOT EXECUTED
107aa4: e8bd 4030 ldmia.w sp!, {r4, r5, lr} <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
107aa8: f006 bfc6 b.w 10ea38 <msdos_set_first_char4file_name> <== NOT EXECUTED
00107aac <msdos_rmnod>:
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
107aac: b5f0 push {r4, r5, r6, r7, lr}
107aae: b083 sub sp, #12
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access;
107ab0: 688e ldr r6, [r1, #8]
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
107ab2: 6948 ldr r0, [r1, #20]
if (fat_fd->fat_file_type == FAT_DIRECTORY)
107ab4: 6933 ldr r3, [r6, #16]
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
107ab6: 6887 ldr r7, [r0, #8]
if (fat_fd->fat_file_type == FAT_DIRECTORY)
107ab8: b98b cbnz r3, 107ade <msdos_rmnod+0x32>
{
bool is_empty = false;
107aba: 460d mov r5, r1
/*
* You cannot remove a node that still has children
*/
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
107abc: f10d 0207 add.w r2, sp, #7
107ac0: 4631 mov r1, r6
bool is_empty = false;
107ac2: f88d 3007 strb.w r3, [sp, #7]
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
107ac6: f007 f81d bl 10eb04 <msdos_dir_is_empty>
if (rc != RC_OK)
107aca: 4604 mov r4, r0
107acc: b970 cbnz r0, 107aec <msdos_rmnod+0x40>
{
return rc;
}
if (!is_empty)
107ace: f89d 3007 ldrb.w r3, [sp, #7]
107ad2: b1e3 cbz r3, 107b0e <msdos_rmnod+0x62>
/*
* We deny attempts to delete open directory (if directory is current
* directory we assume it is open one)
*/
if (fat_fd->links_num > 1)
107ad4: 68b3 ldr r3, [r6, #8]
107ad6: 2b01 cmp r3, #1
* not used - mount() not implemenetd yet.
*/
}
/* mark file removed */
rc = msdos_set_first_char4file_name(pathloc->mt_entry, &fat_fd->dir_pos,
107ad8: bf98 it ls
107ada: 6968 ldrls r0, [r5, #20]
if (fat_fd->links_num > 1)
107adc: d810 bhi.n 107b00 <msdos_rmnod+0x54> <== ALWAYS TAKEN
rc = msdos_set_first_char4file_name(pathloc->mt_entry, &fat_fd->dir_pos,
107ade: 22e5 movs r2, #229 ; 0xe5
107ae0: f106 0120 add.w r1, r6, #32
107ae4: f006 ffa8 bl 10ea38 <msdos_set_first_char4file_name>
MSDOS_THIS_DIR_ENTRY_EMPTY);
if (rc != RC_OK)
107ae8: 4604 mov r4, r0
107aea: b110 cbz r0, 107af2 <msdos_rmnod+0x46>
}
fat_file_mark_removed(&fs_info->fat, fat_fd);
return rc;
}
107aec: 4620 mov r0, r4
107aee: b003 add sp, #12
107af0: bdf0 pop {r4, r5, r6, r7, pc}
fat_file_mark_removed(&fs_info->fat, fat_fd);
107af2: 4638 mov r0, r7
107af4: 4631 mov r1, r6
107af6: f006 faa9 bl 10e04c <fat_file_mark_removed>
}
107afa: 4620 mov r0, r4
107afc: b003 add sp, #12
107afe: bdf0 pop {r4, r5, r6, r7, pc}
rtems_set_errno_and_return_minus_one(EBUSY);
107b00: f00d f8be bl 114c80 <__errno> <== NOT EXECUTED
107b04: 2310 movs r3, #16 <== NOT EXECUTED
107b06: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
107b0a: 6003 str r3, [r0, #0] <== NOT EXECUTED
107b0c: e7ee b.n 107aec <msdos_rmnod+0x40> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOTEMPTY);
107b0e: f00d f8b7 bl 114c80 <__errno>
107b12: 235a movs r3, #90 ; 0x5a
107b14: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff
107b18: 6003 str r3, [r0, #0]
107b1a: e7e7 b.n 107aec <msdos_rmnod+0x40>
0010ea38 <msdos_set_first_char4file_name>:
{
10ea38: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
10ea3c: 460b mov r3, r1
msdos_fs_info_t *fs_info = mt_entry->fs_info;
10ea3e: 6884 ldr r4, [r0, #8]
{
10ea40: b087 sub sp, #28
fat_pos_t start = dir_pos->lname;
10ea42: 3108 adds r1, #8
10ea44: f10d 0910 add.w r9, sp, #16
fat_pos_t end = dir_pos->sname;
10ea48: 681d ldr r5, [r3, #0]
{
10ea4a: f88d 200f strb.w r2, [sp, #15]
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
10ea4e: 6c62 ldr r2, [r4, #68] ; 0x44
fat_pos_t start = dir_pos->lname;
10ea50: c903 ldmia r1, {r0, r1}
fat_pos_t end = dir_pos->sname;
10ea52: f8d3 8004 ldr.w r8, [r3, #4]
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
10ea56: 42aa cmp r2, r5
fat_pos_t start = dir_pos->lname;
10ea58: e889 0003 stmia.w r9, {r0, r1}
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
10ea5c: d04d beq.n 10eafa <msdos_set_first_char4file_name+0xc2>
dir_block_size = fs_info->fat.vol.bpc;
10ea5e: 68a7 ldr r7, [r4, #8]
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
10ea60: 689a ldr r2, [r3, #8]
10ea62: f10d 060f add.w r6, sp, #15
10ea66: 3201 adds r2, #1
start = dir_pos->sname;
10ea68: bf04 itt eq
10ea6a: e9d3 0100 ldrdeq r0, r1, [r3]
10ea6e: e9c9 0100 strdeq r0, r1, [r9]
(start.ofs >> fs_info->fat.vol.sec_log2));
10ea72: 9a05 ldr r2, [sp, #20]
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
10ea74: 9904 ldr r1, [sp, #16]
10ea76: e002 b.n 10ea7e <msdos_set_first_char4file_name+0x46>
if (start.ofs >= dir_block_size)
10ea78: 42ba cmp r2, r7
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10ea7a: 9205 str r2, [sp, #20]
if (start.ofs >= dir_block_size)
10ea7c: d22e bcs.n 10eadc <msdos_set_first_char4file_name+0xa4>
10ea7e: 1e8b subs r3, r1, #2
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10ea80: b921 cbnz r1, 10ea8c <msdos_set_first_char4file_name+0x54>
10ea82: 7da1 ldrb r1, [r4, #22]
10ea84: 0789 lsls r1, r1, #30
return fs_info->vol.rdir_loc;
10ea86: bf18 it ne
10ea88: 6aa1 ldrne r1, [r4, #40] ; 0x28
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
10ea8a: d104 bne.n 10ea96 <msdos_set_first_char4file_name+0x5e> <== NEVER TAKEN
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
10ea8c: 7961 ldrb r1, [r4, #5]
10ea8e: 6be0 ldr r0, [r4, #60] ; 0x3c
10ea90: fa03 f101 lsl.w r1, r3, r1
10ea94: 4401 add r1, r0
(start.ofs >> fs_info->fat.vol.sec_log2));
10ea96: f894 c002 ldrb.w ip, [r4, #2]
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
10ea9a: 2301 movs r3, #1
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
10ea9c: f8b4 e000 ldrh.w lr, [r4]
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
10eaa0: 4620 mov r0, r4
10eaa2: 9600 str r6, [sp, #0]
(start.ofs >> fs_info->fat.vol.sec_log2));
10eaa4: fa22 fc0c lsr.w ip, r2, ip
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
10eaa8: f10e 3eff add.w lr, lr, #4294967295 ; 0xffffffff
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
10eaac: ea0e 0202 and.w r2, lr, r2
10eab0: 4461 add r1, ip
10eab2: f7fe f83d bl 10cb30 <fat_sector_write>
if (ret < 0)
10eab6: 2800 cmp r0, #0
10eab8: db0b blt.n 10ead2 <msdos_set_first_char4file_name+0x9a> <== ALWAYS TAKEN
if ((start.cln == end.cln) && (start.ofs == end.ofs))
10eaba: e9dd 1304 ldrd r1, r3, [sp, #16]
10eabe: 428d cmp r5, r1
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
10eac0: f103 0220 add.w r2, r3, #32
if ((start.cln == end.cln) && (start.ofs == end.ofs))
10eac4: d1d8 bne.n 10ea78 <msdos_set_first_char4file_name+0x40>
10eac6: 4598 cmp r8, r3
10eac8: d1d6 bne.n 10ea78 <msdos_set_first_char4file_name+0x40>
return RC_OK;
10eaca: 2000 movs r0, #0
}
10eacc: b007 add sp, #28
10eace: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
return -1;
10ead2: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff <== NOT EXECUTED
}
10ead6: b007 add sp, #28 <== NOT EXECUTED
10ead8: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
10eadc: 6c63 ldr r3, [r4, #68] ; 0x44
10eade: 429d cmp r5, r3
10eae0: d102 bne.n 10eae8 <msdos_set_first_char4file_name+0xb0> <== NEVER TAKEN
10eae2: 7da3 ldrb r3, [r4, #22] <== NOT EXECUTED
10eae4: 079b lsls r3, r3, #30 <== NOT EXECUTED
10eae6: d1f0 bne.n 10eaca <msdos_set_first_char4file_name+0x92> <== NOT EXECUTED
rc = fat_get_fat_cluster(&fs_info->fat, start.cln, &start.cln);
10eae8: 464a mov r2, r9
10eaea: 4620 mov r0, r4
10eaec: f7fe fc9a bl 10d424 <fat_get_fat_cluster>
if ( rc != RC_OK )
10eaf0: 2800 cmp r0, #0
10eaf2: d1f0 bne.n 10ead6 <msdos_set_first_char4file_name+0x9e> <== ALWAYS TAKEN
start.ofs = 0;
10eaf4: 4602 mov r2, r0
10eaf6: 9005 str r0, [sp, #20]
10eaf8: e7bc b.n 10ea74 <msdos_set_first_char4file_name+0x3c>
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
10eafa: 7da2 ldrb r2, [r4, #22]
10eafc: 0790 lsls r0, r2, #30
10eafe: d0ae beq.n 10ea5e <msdos_set_first_char4file_name+0x26> <== ALWAYS TAKEN
dir_block_size = fs_info->fat.vol.rdir_size;
10eb00: 6b67 ldr r7, [r4, #52] ; 0x34
10eb02: e7ad b.n 10ea60 <msdos_set_first_char4file_name+0x28>
00107b1c <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;
107b1c: 6943 ldr r3, [r0, #20]
{
107b1e: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr}
107b22: b083 sub sp, #12
107b24: 460c mov r4, r1
msdos_fs_info_t *fs_info = root_loc->mt_entry->fs_info;
107b26: f8d3 9008 ldr.w r9, [r3, #8]
rtems_recursive_mutex_lock(&fs_info->vol_mutex);
107b2a: f109 08b0 add.w r8, r9, #176 ; 0xb0
_Mutex_recursive_Acquire( mutex );
107b2e: 4640 mov r0, r8
107b30: f002 fa0c bl 109f4c <_Mutex_recursive_Acquire>
fat_vol_t *vol = &fs_info->fat.vol;
msdos_fs_lock(fs_info);
sb->f_bsize = FAT_SECTOR512_SIZE;
107b34: f44f 7200 mov.w r2, #512 ; 0x200
sb->f_frsize = vol->bpc;
107b38: f8d9 3008 ldr.w r3, [r9, #8]
sb->f_bsize = FAT_SECTOR512_SIZE;
107b3c: 6022 str r2, [r4, #0]
sb->f_bavail = 0;
sb->f_files = 0; // FAT doesn't store inodes
sb->f_ffree = 0;
sb->f_favail = 0;
sb->f_flag = 0;
sb->f_namemax = MSDOS_NAME_MAX_LNF_LEN;
107b3e: 21ff movs r1, #255 ; 0xff
if (vol->free_cls == FAT_UNDEFINED_VALUE)
107b40: f8d9 204c ldr.w r2, [r9, #76] ; 0x4c
sb->f_bfree = 0;
107b44: efc0 0010 vmov.i32 d16, #0 ; 0x00000000
sb->f_blocks = vol->data_cls;
107b48: f8d9 7040 ldr.w r7, [r9, #64] ; 0x40
sb->f_namemax = MSDOS_NAME_MAX_LNF_LEN;
107b4c: 6361 str r1, [r4, #52] ; 0x34
if (vol->free_cls == FAT_UNDEFINED_VALUE)
107b4e: 1c51 adds r1, r2, #1
sb->f_frsize = vol->bpc;
107b50: 6063 str r3, [r4, #4]
sb->f_blocks = vol->data_cls;
107b52: f04f 0300 mov.w r3, #0
sb->f_bfree = 0;
107b56: edc4 0b04 vstr d16, [r4, #16]
sb->f_blocks = vol->data_cls;
107b5a: e9c4 7302 strd r7, r3, [r4, #8]
sb->f_bavail = 0;
107b5e: edc4 0b06 vstr d16, [r4, #24]
sb->f_ffree = 0;
107b62: e9c4 3308 strd r3, r3, [r4, #32]
sb->f_favail = 0;
107b66: 62a3 str r3, [r4, #40] ; 0x28
sb->f_flag = 0;
107b68: 6323 str r3, [r4, #48] ; 0x30
if (vol->free_cls == FAT_UNDEFINED_VALUE)
107b6a: d00b beq.n 107b84 <msdos_statvfs+0x68> <== NEVER TAKEN
}
}
}
else
{
sb->f_bfree = vol->free_cls;
107b6c: e9c4 2304 strd r2, r3, [r4, #16] <== NOT EXECUTED
sb->f_bavail = vol->free_cls;
107b70: e9c4 2306 strd r2, r3, [r4, #24] <== NOT EXECUTED
_Mutex_recursive_Release( mutex );
107b74: 4640 mov r0, r8
}
msdos_fs_unlock(fs_info);
return RC_OK;
107b76: 2500 movs r5, #0
107b78: f002 fa1a bl 109fb0 <_Mutex_recursive_Release>
}
107b7c: 4628 mov r0, r5
107b7e: b003 add sp, #12
107b80: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc}
uint32_t data_cls_val = vol->data_cls + 2;
107b84: 3702 adds r7, #2
uint32_t value = 0;
107b86: 9301 str r3, [sp, #4]
for (; cur_cl < data_cls_val; ++cur_cl)
107b88: 2f02 cmp r7, #2
107b8a: d9f3 bls.n 107b74 <msdos_statvfs+0x58> <== ALWAYS TAKEN
uint32_t cur_cl = 2;
107b8c: 2602 movs r6, #2
107b8e: e011 b.n 107bb4 <msdos_statvfs+0x98>
if (value == FAT_GENFAT_FREE)
107b90: 9b01 ldr r3, [sp, #4]
107b92: b96b cbnz r3, 107bb0 <msdos_statvfs+0x94>
sb->f_bfree++;
107b94: e9d4 3104 ldrd r3, r1, [r4, #16]
sb->f_bavail++;
107b98: 69a2 ldr r2, [r4, #24]
sb->f_bfree++;
107b9a: 3301 adds r3, #1
107b9c: 6123 str r3, [r4, #16]
107b9e: f141 0100 adc.w r1, r1, #0
sb->f_bavail++;
107ba2: 69e3 ldr r3, [r4, #28]
107ba4: 3201 adds r2, #1
107ba6: 61a2 str r2, [r4, #24]
sb->f_bfree++;
107ba8: 6161 str r1, [r4, #20]
sb->f_bavail++;
107baa: f143 0300 adc.w r3, r3, #0
107bae: 61e3 str r3, [r4, #28]
for (; cur_cl < data_cls_val; ++cur_cl)
107bb0: 42b7 cmp r7, r6
107bb2: d0df beq.n 107b74 <msdos_statvfs+0x58>
rc = fat_get_fat_cluster(&fs_info->fat, cur_cl, &value);
107bb4: 4631 mov r1, r6
107bb6: aa01 add r2, sp, #4
107bb8: 4648 mov r0, r9
for (; cur_cl < data_cls_val; ++cur_cl)
107bba: 3601 adds r6, #1
rc = fat_get_fat_cluster(&fs_info->fat, cur_cl, &value);
107bbc: f005 fc32 bl 10d424 <fat_get_fat_cluster>
if (rc != RC_OK)
107bc0: 4605 mov r5, r0
107bc2: 2800 cmp r0, #0
107bc4: d0e4 beq.n 107b90 <msdos_statvfs+0x74> <== NEVER TAKEN
107bc6: 4640 mov r0, r8 <== NOT EXECUTED
107bc8: f002 f9f2 bl 109fb0 <_Mutex_recursive_Release> <== NOT EXECUTED
}
107bcc: 4628 mov r0, r5 <== NOT EXECUTED
107bce: b003 add sp, #12 <== NOT EXECUTED
107bd0: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
0010839c <rtems_dosfs_create_utf8_converter>:
};
rtems_dosfs_convert_control *rtems_dosfs_create_utf8_converter(
const char *codepage
)
{
10839c: b538 push {r3, r4, r5, lr}
10839e: 4605 mov r5, r0
msdos_utf8_convert_control *self = malloc( sizeof( *self ) );
1083a0: f240 402c movw r0, #1068 ; 0x42c
1083a4: f7fe fb04 bl 1069b0 <malloc>
if ( self != NULL ) {
1083a8: 4604 mov r4, r0
1083aa: 2800 cmp r0, #0
1083ac: d039 beq.n 108422 <rtems_dosfs_create_utf8_converter+0x86> <== ALWAYS TAKEN
self->desc_codepage_to_utf8 = iconv_open( "UTF-8", codepage );
1083ae: f247 003c movw r0, #28732 ; 0x703c
1083b2: 4629 mov r1, r5
1083b4: f2c0 0012 movt r0, #18
1083b8: f00f fa18 bl 1177ec <iconv_open>
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
1083bc: f247 013c movw r1, #28732 ; 0x703c
self->desc_codepage_to_utf8 = iconv_open( "UTF-8", codepage );
1083c0: 4603 mov r3, r0
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
1083c2: f2c0 0112 movt r1, #18
self->desc_codepage_to_utf8 = iconv_open( "UTF-8", codepage );
1083c6: 60e3 str r3, [r4, #12]
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
1083c8: 4628 mov r0, r5
1083ca: f00f fa0f bl 1177ec <iconv_open>
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
1083ce: f247 0144 movw r1, #28740 ; 0x7044
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
1083d2: 4603 mov r3, r0
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
1083d4: f247 003c movw r0, #28732 ; 0x703c
1083d8: f2c0 0112 movt r1, #18
self->desc_utf8_to_codepage = iconv_open( codepage, "UTF-8" );
1083dc: 6123 str r3, [r4, #16]
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
1083de: f2c0 0012 movt r0, #18
1083e2: f00f fa03 bl 1177ec <iconv_open>
self->desc_utf8_to_utf16 = iconv_open( "UTF-16LE", "UTF-8" );
1083e6: f247 013c movw r1, #28732 ; 0x703c
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
1083ea: 4603 mov r3, r0
self->desc_utf8_to_utf16 = iconv_open( "UTF-16LE", "UTF-8" );
1083ec: f247 0044 movw r0, #28740 ; 0x7044
self->desc_utf16_to_utf8 = iconv_open( "UTF-8", "UTF-16LE" );
1083f0: 6163 str r3, [r4, #20]
self->desc_utf8_to_utf16 = iconv_open( "UTF-16LE", "UTF-8" );
1083f2: f2c0 0112 movt r1, #18
1083f6: f2c0 0012 movt r0, #18
1083fa: f00f f9f7 bl 1177ec <iconv_open>
if (
1083fe: 6963 ldr r3, [r4, #20]
self->desc_utf8_to_utf16 = iconv_open( "UTF-16LE", "UTF-8" );
108400: 61a0 str r0, [r4, #24]
if (
108402: 3301 adds r3, #1
108404: d009 beq.n 10841a <rtems_dosfs_create_utf8_converter+0x7e> <== ALWAYS TAKEN
self->desc_utf16_to_utf8 != INVALID_ICONV_DESC
&& self->desc_utf8_to_codepage != INVALID_ICONV_DESC
108406: 6923 ldr r3, [r4, #16]
108408: 3301 adds r3, #1
10840a: d006 beq.n 10841a <rtems_dosfs_create_utf8_converter+0x7e> <== ALWAYS TAKEN
&& self->desc_codepage_to_utf8 != INVALID_ICONV_DESC
10840c: 68e3 ldr r3, [r4, #12]
&& self->desc_utf8_to_utf16 != INVALID_ICONV_DESC
10840e: f1b3 3fff cmp.w r3, #4294967295 ; 0xffffffff
108412: bf18 it ne
108414: f1b0 3fff cmpne.w r0, #4294967295 ; 0xffffffff
108418: d105 bne.n 108426 <rtems_dosfs_create_utf8_converter+0x8a> <== NEVER TAKEN
super->handler = &msdos_utf8_convert_handler;
super->buffer.data = &self->buffer;
super->buffer.size = sizeof( self->buffer );
} else {
msdos_utf8_destroy( &self->super );
10841a: 4620 mov r0, r4 <== NOT EXECUTED
self = NULL;
10841c: 2400 movs r4, #0 <== NOT EXECUTED
msdos_utf8_destroy( &self->super );
10841e: f7ff ff09 bl 108234 <msdos_utf8_destroy> <== NOT EXECUTED
}
}
return &self->super;
}
108422: 4620 mov r0, r4 <== NOT EXECUTED
108424: bd38 pop {r3, r4, r5, pc} <== NOT EXECUTED
super->handler = &msdos_utf8_convert_handler;
108426: f247 027c movw r2, #28796 ; 0x707c
10842a: 4623 mov r3, r4
10842c: f2c0 0212 movt r2, #18
super->buffer.size = sizeof( self->buffer );
108430: f44f 6182 mov.w r1, #1040 ; 0x410
super->handler = &msdos_utf8_convert_handler;
108434: f843 2b1c str.w r2, [r3], #28
}
108438: 4620 mov r0, r4
super->buffer.data = &self->buffer;
10843a: e9c4 3101 strd r3, r1, [r4, #4]
}
10843e: bd38 pop {r3, r4, r5, pc}
001078ac <rtems_dosfs_initialize>:
*/
int rtems_dosfs_initialize(
rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data
)
{
1078ac: b530 push {r4, r5, lr}
1078ae: 4604 mov r4, r0
1078b0: b083 sub sp, #12
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) {
1078b2: b1a1 cbz r1, 1078de <rtems_dosfs_initialize+0x32>
1078b4: 680d ldr r5, [r1, #0]
1078b6: b195 cbz r5, 1078de <rtems_dosfs_initialize+0x32>
} else {
converter = mount_options->converter;
}
if (converter != NULL) {
rc = msdos_initialize_support(mt_entry,
1078b8: f64c 1310 movw r3, #51472 ; 0xc910
1078bc: f64c 1250 movw r2, #51536 ; 0xc950
1078c0: f24c 5164 movw r1, #50532 ; 0xc564
1078c4: f2c0 0311 movt r3, #17
1078c8: f2c0 0211 movt r2, #17
1078cc: f2c0 0111 movt r1, #17
1078d0: 9500 str r5, [sp, #0]
1078d2: f000 f829 bl 107928 <msdos_initialize_support>
1078d6: 4604 mov r4, r0
errno = ENOMEM;
rc = -1;
}
return rc;
}
1078d8: 4620 mov r0, r4
1078da: b003 add sp, #12
1078dc: bd30 pop {r4, r5, pc}
converter = rtems_dosfs_create_default_converter();
1078de: f006 fc7b bl 10e1d8 <rtems_dosfs_create_default_converter>
if (converter != NULL) {
1078e2: 4605 mov r5, r0
1078e4: b1c8 cbz r0, 10791a <rtems_dosfs_initialize+0x6e>
rc = msdos_initialize_support(mt_entry,
1078e6: f64c 1310 movw r3, #51472 ; 0xc910
1078ea: f64c 1250 movw r2, #51536 ; 0xc950
1078ee: f24c 5164 movw r1, #50532 ; 0xc564
1078f2: 4620 mov r0, r4
1078f4: f2c0 0311 movt r3, #17
1078f8: f2c0 0211 movt r2, #17
1078fc: f2c0 0111 movt r1, #17
107900: 9500 str r5, [sp, #0]
107902: f000 f811 bl 107928 <msdos_initialize_support>
if (rc != 0 && converter_created) {
107906: 4604 mov r4, r0
107908: 2800 cmp r0, #0
10790a: d0e5 beq.n 1078d8 <rtems_dosfs_initialize+0x2c> <== NEVER TAKEN
(*converter->handler->destroy)(converter);
10790c: 682b ldr r3, [r5, #0] <== NOT EXECUTED
10790e: 4628 mov r0, r5 <== NOT EXECUTED
107910: 695b ldr r3, [r3, #20] <== NOT EXECUTED
107912: 4798 blx r3 <== NOT EXECUTED
}
107914: 4620 mov r0, r4 <== NOT EXECUTED
107916: b003 add sp, #12 <== NOT EXECUTED
107918: bd30 pop {r4, r5, pc} <== NOT EXECUTED
errno = ENOMEM;
10791a: f00d f9b1 bl 114c80 <__errno> <== NOT EXECUTED
10791e: 230c movs r3, #12 <== NOT EXECUTED
rc = -1;
107920: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff <== NOT EXECUTED
errno = ENOMEM;
107924: 6003 str r3, [r0, #0] <== NOT EXECUTED
return rc;
107926: e7d7 b.n 1078d8 <rtems_dosfs_initialize+0x2c> <== NOT EXECUTED