RTEMS-6
Annotated Report
libblock
Mon Mar 1 00:30:04 2021
00000000400324b0 <ramdisk_allocate>:
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
400324b0: a9bc7bfd stp x29, x30, [sp, #-64]!
400324b4: 910003fd mov x29, sp
400324b8: a90153f3 stp x19, x20, [sp, #16]
400324bc: aa0003f4 mov x20, x0
struct ramdisk *rd = calloc(1, sizeof(*rd));
400324c0: d2800020 mov x0, #0x1 // #1
{
400324c4: a9025bf5 stp x21, x22, [sp, #32]
400324c8: 2a0103f6 mov w22, w1
400324cc: 2a0203f5 mov w21, w2
struct ramdisk *rd = calloc(1, sizeof(*rd));
400324d0: d2800301 mov x1, #0x18 // #24
{
400324d4: f9001bf7 str x23, [sp, #48]
400324d8: 12001c77 and w23, w3, #0xff
struct ramdisk *rd = calloc(1, sizeof(*rd));
400324dc: 94000041 bl 400325e0 <calloc>
400324e0: aa0003f3 mov x19, x0
if (rd == NULL) {
400324e4: b40000e0 cbz x0, 40032500 <ramdisk_allocate+0x50> <== NEVER TAKEN
return NULL;
}
if (area_begin == NULL) {
400324e8: b4000194 cbz x20, 40032518 <ramdisk_allocate+0x68>
}
rd->block_size = media_block_size;
rd->block_num = media_block_count;
rd->area = area_begin;
rd->trace = trace;
rd->initialized = true;
400324ec: 52800020 mov w0, #0x1 // #1
rd->block_num = media_block_count;
400324f0: 29005676 stp w22, w21, [x19]
rd->area = area_begin;
400324f4: f9000674 str x20, [x19, #8]
rd->initialized = true;
400324f8: 39004260 strb w0, [x19, #16]
rd->trace = trace;
400324fc: 39004a77 strb w23, [x19, #18]
return rd;
}
40032500: aa1303e0 mov x0, x19
40032504: a94153f3 ldp x19, x20, [sp, #16]
40032508: a9425bf5 ldp x21, x22, [sp, #32]
4003250c: f9401bf7 ldr x23, [sp, #48]
40032510: a8c47bfd ldp x29, x30, [sp], #64
40032514: d65f03c0 ret
area_begin = calloc(media_block_count, media_block_size);
40032518: 2a1603e1 mov w1, w22
4003251c: 2a1503e0 mov w0, w21
40032520: 94000030 bl 400325e0 <calloc>
40032524: aa0003f4 mov x20, x0
if (area_begin == NULL) {
40032528: b4000080 cbz x0, 40032538 <ramdisk_allocate+0x88> <== NEVER TAKEN
rd->malloced = true;
4003252c: 52800020 mov w0, #0x1 // #1
40032530: 39004660 strb w0, [x19, #17]
40032534: 17ffffee b 400324ec <ramdisk_allocate+0x3c>
free(rd);
40032538: aa1303e0 mov x0, x19 <== NOT EXECUTED
return NULL;
4003253c: d2800013 mov x19, #0x0 // #0 <== NOT EXECUTED
free(rd);
40032540: 97ffc09c bl 400227b0 <free> <== NOT EXECUTED
return NULL;
40032544: 17ffffef b 40032500 <ramdisk_allocate+0x50> <== NOT EXECUTED
...
00000000400231d0 <ramdisk_free>:
return rd;
}
void ramdisk_free(ramdisk *rd)
{
if (rd != NULL) {
400231d0: b4000220 cbz x0, 40023214 <ramdisk_free+0x44> <== NEVER TAKEN
{
400231d4: a9be7bfd stp x29, x30, [sp, #-32]!
400231d8: 910003fd mov x29, sp
400231dc: f9000bf3 str x19, [sp, #16]
400231e0: aa0003f3 mov x19, x0
if (rd->malloced) {
400231e4: 39404400 ldrb w0, [x0, #17]
400231e8: 350000a0 cbnz w0, 400231fc <ramdisk_free+0x2c>
free(rd->area);
}
free(rd);
400231ec: aa1303e0 mov x0, x19
}
}
400231f0: f9400bf3 ldr x19, [sp, #16]
400231f4: a8c27bfd ldp x29, x30, [sp], #32
free(rd);
400231f8: 140000aa b 400234a0 <free>
free(rd->area);
400231fc: f9400660 ldr x0, [x19, #8]
40023200: 940000a8 bl 400234a0 <free>
free(rd);
40023204: aa1303e0 mov x0, x19
}
40023208: f9400bf3 ldr x19, [sp, #16]
4002320c: a8c27bfd ldp x29, x30, [sp], #32
free(rd);
40023210: 140000a4 b 400234a0 <free>
40023214: d65f03c0 ret <== NOT EXECUTED
...
0000000040022f50 <ramdisk_initialize>:
rtems_device_driver
ramdisk_initialize(
rtems_device_major_number major RTEMS_UNUSED,
rtems_device_minor_number minor RTEMS_UNUSED,
void *arg RTEMS_UNUSED)
{
40022f50: a9b97bfd stp x29, x30, [sp, #-112]!
* This is allocating memory for a RAM disk which will persist for
* the life of the system. RTEMS has no "de-initialize" driver call
* so there is no corresponding free(r). Coverity is correct that
* it is never freed but this is not a problem.
*/
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
40022f54: d2800301 mov x1, #0x18 // #24
{
40022f58: 910003fd mov x29, sp
40022f5c: a90153f3 stp x19, x20, [sp, #16]
40022f60: a9025bf5 stp x21, x22, [sp, #32]
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
40022f64: d00006f6 adrp x22, 40100000 <_IO_Driver_address_table>
40022f68: f94096d4 ldr x20, [x22, #296]
40022f6c: aa1403e0 mov x0, x20
40022f70: 940000c4 bl 40023280 <calloc>
r->trace = false;
40022f74: 3900481f strb wzr, [x0, #18]
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
40022f78: b4000574 cbz x20, 40023024 <ramdisk_initialize+0xd4> <== NEVER TAKEN
rtems_ramdisk_config *c = rtems_ramdisk_configuration;
40022f7c: d00006f4 adrp x20, 40100000 <_IO_Driver_address_table>
40022f80: 91046294 add x20, x20, #0x118
40022f84: aa0003f3 mov x19, x0
40022f88: 9104a2d6 add x22, x22, #0x128
40022f8c: a90363f7 stp x23, x24, [sp, #48]
{
r->malloced = false;
r->initialized = true;
r->area = c->location;
}
rc = rtems_blkdev_create(name, c->block_size, c->block_num,
40022f90: b0000017 adrp x23, 40023000 <ramdisk_initialize+0xb0>
40022f94: 9101c2f7 add x23, x23, #0x70
40022f98: f90023f9 str x25, [sp, #64]
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
40022f9c: d28c85f9 mov x25, #0x642f // #25647
40022fa0: f2aeccb9 movk x25, #0x7665, lsl #16
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
40022fa4: 52800015 mov w21, #0x0 // #0
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
40022fa8: f2ce45f9 movk x25, #0x722f, lsl #32
40022fac: f2ec2c99 movk x25, #0x6164, lsl #48
r->initialized = true;
40022fb0: 52800038 mov w24, #0x1 // #1
40022fb4: d503201f nop
if (c->location == NULL)
40022fb8: f9400683 ldr x3, [x20, #8]
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
40022fbc: f90033f9 str x25, [sp, #96]
r->block_num = c->block_num;
40022fc0: 29400a81 ldp w1, w2, [x20]
name [sizeof(RAMDISK_DEVICE_BASE_NAME) - 1] += i;
40022fc4: 110186a0 add w0, w21, #0x61
r->block_num = c->block_num;
40022fc8: 29000a61 stp w1, w2, [x19]
name [sizeof(RAMDISK_DEVICE_BASE_NAME) - 1] += i;
40022fcc: 39019fe0 strb w0, [sp, #103]
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
40022fd0: 3901a3ff strb wzr, [sp, #104]
if (c->location == NULL)
40022fd4: b4000383 cbz x3, 40023044 <ramdisk_initialize+0xf4>
r->area = c->location;
40022fd8: f9000663 str x3, [x19, #8]
r->initialized = true;
40022fdc: 39004278 strb w24, [x19, #16]
r->malloced = false;
40022fe0: 3900467f strb wzr, [x19, #17]
rc = rtems_blkdev_create(name, c->block_size, c->block_num,
40022fe4: aa1303e4 mov x4, x19
40022fe8: aa1703e3 mov x3, x23
40022fec: 910183e0 add x0, sp, #0x60
40022ff0: 97fffccc bl 40022320 <rtems_blkdev_create>
ramdisk_ioctl, r);
if (rc != RTEMS_SUCCESSFUL)
40022ff4: 34000080 cbz w0, 40023004 <ramdisk_initialize+0xb4> <== ALWAYS TAKEN
{
if (r->malloced)
40022ff8: 39404660 ldrb w0, [x19, #17] <== NOT EXECUTED
40022ffc: 350001e0 cbnz w0, 40023038 <ramdisk_initialize+0xe8> <== NOT EXECUTED
{
free(r->area);
}
r->initialized = false;
40023000: 3900427f strb wzr, [x19, #16] <== NOT EXECUTED
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
40023004: f94002c0 ldr x0, [x22]
40023008: 110006b5 add w21, w21, #0x1
4002300c: 91004294 add x20, x20, #0x10
40023010: 91006273 add x19, x19, #0x18
40023014: eb35401f cmp x0, w21, uxtw
40023018: 54fffd08 b.hi 40022fb8 <ramdisk_initialize+0x68> // b.pmore
4002301c: a94363f7 ldp x23, x24, [sp, #48]
40023020: f94023f9 ldr x25, [sp, #64]
}
}
return RTEMS_SUCCESSFUL;
}
40023024: 52800000 mov w0, #0x0 // #0
40023028: a94153f3 ldp x19, x20, [sp, #16]
4002302c: a9425bf5 ldp x21, x22, [sp, #32]
40023030: a8c77bfd ldp x29, x30, [sp], #112
40023034: d65f03c0 ret
free(r->area);
40023038: f9400660 ldr x0, [x19, #8] <== NOT EXECUTED
4002303c: 94000119 bl 400234a0 <free> <== NOT EXECUTED
40023040: 17fffff0 b 40023000 <ramdisk_initialize+0xb0> <== NOT EXECUTED
r->area = malloc(r->block_size * r->block_num);
40023044: 1b027c20 mul w0, w1, w2
r->malloced = true;
40023048: 39004678 strb w24, [x19, #17]
r->area = malloc(r->block_size * r->block_num);
4002304c: 290b0be1 stp w1, w2, [sp, #88]
40023050: 94000290 bl 40023a90 <malloc>
40023054: f9000660 str x0, [x19, #8]
if (r->area == NULL) /* No enough memory for this disk */
40023058: 294b0be1 ldp w1, w2, [sp, #88]
4002305c: b4fffd20 cbz x0, 40023000 <ramdisk_initialize+0xb0> <== NEVER TAKEN
r->initialized = true;
40023060: 39004278 strb w24, [x19, #16]
40023064: 17ffffe0 b 40022fe4 <ramdisk_initialize+0x94>
...
0000000040023070 <ramdisk_ioctl>:
return 0;
}
int
ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
40023070: a9bc7bfd stp x29, x30, [sp, #-64]!
struct ramdisk *rd = rtems_disk_get_driver_data(dd);
switch (req)
40023074: 528840e4 mov w4, #0x4207 // #16903
40023078: 72a40004 movk w4, #0x2000, lsl #16
{
4002307c: 910003fd mov x29, sp
40023080: a9025bf5 stp x21, x22, [sp, #32]
switch (req)
40023084: 6b04003f cmp w1, w4
static inline void *rtems_disk_get_driver_data(
const rtems_disk_device *dd
)
{
return dd->driver_data;
40023088: f9402816 ldr x22, [x0, #80]
4002308c: 540004c0 b.eq 40023124 <ramdisk_ioctl+0xb4> // b.none
40023090: 52884024 mov w4, #0x4201 // #16897
40023094: 72b80504 movk w4, #0xc028, lsl #16
40023098: 6b04003f cmp w1, w4
4002309c: 54000581 b.ne 4002314c <ramdisk_ioctl+0xdc> // b.any
{
case RTEMS_BLKIO_REQUEST:
{
rtems_blkdev_request *r = argp;
switch (r->req)
400230a0: b9400055 ldr w21, [x2]
400230a4: a90153f3 stp x19, x20, [sp, #16]
400230a8: aa0203f3 mov x19, x2
400230ac: 34000695 cbz w21, 4002317c <ramdisk_ioctl+0x10c>
400230b0: 710006bf cmp w21, #0x1
400230b4: 54000521 b.ne 40023158 <ramdisk_ioctl+0xe8> // b.any <== NEVER TAKEN
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
400230b8: b9401c40 ldr w0, [x2, #28]
400230bc: 9100a054 add x20, x2, #0x28
400230c0: f9001bf7 str x23, [sp, #48]
uint8_t *to = rd->area;
400230c4: f94006d7 ldr x23, [x22, #8]
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
400230c8: 340001a0 cbz w0, 400230fc <ramdisk_ioctl+0x8c> <== NEVER TAKEN
400230cc: 52800015 mov w21, #0x0 // #0
memcpy(to + (sg->block * rd->block_size), sg->buffer, sg->length);
400230d0: 29400a80 ldp w0, w2, [x20]
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
400230d4: 110006b5 add w21, w21, #0x1
memcpy(to + (sg->block * rd->block_size), sg->buffer, sg->length);
400230d8: b94002c3 ldr w3, [x22]
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
400230dc: 91006294 add x20, x20, #0x18
memcpy(to + (sg->block * rd->block_size), sg->buffer, sg->length);
400230e0: f85f0281 ldur x1, [x20, #-16]
400230e4: 1b037c00 mul w0, w0, w3
400230e8: 8b0002e0 add x0, x23, x0
400230ec: 940047a3 bl 40034f78 <memcpy>
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
400230f0: b9401e60 ldr w0, [x19, #28]
400230f4: 6b0002bf cmp w21, w0
400230f8: 54fffec3 b.cc 400230d0 <ramdisk_ioctl+0x60> // b.lo, b.ul, b.last
(*req->done)(req, status);
400230fc: f9400662 ldr x2, [x19, #8]
40023100: aa1303e0 mov x0, x19
40023104: 52800001 mov w1, #0x0 // #0
40023108: d63f0040 blr x2
{
case RTEMS_BLKDEV_REQ_READ:
return ramdisk_read(rd, r);
case RTEMS_BLKDEV_REQ_WRITE:
return ramdisk_write(rd, r);
4002310c: 52800000 mov w0, #0x0 // #0
40023110: a94153f3 ldp x19, x20, [sp, #16]
break;
}
errno = EINVAL;
return -1;
}
40023114: a9425bf5 ldp x21, x22, [sp, #32]
return ramdisk_write(rd, r);
40023118: f9401bf7 ldr x23, [sp, #48]
}
4002311c: a8c47bfd ldp x29, x30, [sp], #64
40023120: d65f03c0 ret
if (rd->free_at_delete_request) {
40023124: 39404ec0 ldrb w0, [x22, #19]
40023128: 350004c0 cbnz w0, 400231c0 <ramdisk_ioctl+0x150>
errno = EINVAL;
4002312c: 940045d8 bl 4003488c <__errno>
40023130: aa0003e1 mov x1, x0
40023134: 528002c2 mov w2, #0x16 // #22
return -1;
40023138: 12800000 mov w0, #0xffffffff // #-1
}
4002313c: a9425bf5 ldp x21, x22, [sp, #32]
errno = EINVAL;
40023140: b9000022 str w2, [x1]
}
40023144: a8c47bfd ldp x29, x30, [sp], #64
40023148: d65f03c0 ret
4002314c: a9425bf5 ldp x21, x22, [sp, #32]
40023150: a8c47bfd ldp x29, x30, [sp], #64
return rtems_blkdev_ioctl (dd, req, argp);
40023154: 14002fd7 b 4002f0b0 <rtems_blkdev_ioctl>
errno = EINVAL;
40023158: 940045cd bl 4003488c <__errno> <== NOT EXECUTED
4002315c: aa0003e1 mov x1, x0 <== NOT EXECUTED
40023160: 528002c2 mov w2, #0x16 // #22 <== NOT EXECUTED
return -1;
40023164: 12800000 mov w0, #0xffffffff // #-1 <== NOT EXECUTED
40023168: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
errno = EINVAL;
4002316c: b9000022 str w2, [x1] <== NOT EXECUTED
}
40023170: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40023174: a8c47bfd ldp x29, x30, [sp], #64 <== NOT EXECUTED
40023178: d65f03c0 ret <== NOT EXECUTED
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
4002317c: b9401c40 ldr w0, [x2, #28]
40023180: 9100a054 add x20, x2, #0x28
40023184: f9001bf7 str x23, [sp, #48]
uint8_t *from = rd->area;
40023188: f94006d7 ldr x23, [x22, #8]
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
4002318c: 34fffb80 cbz w0, 400230fc <ramdisk_ioctl+0x8c> <== NEVER TAKEN
memcpy(sg->buffer, from + (sg->block * rd->block_size), sg->length);
40023190: b9400682 ldr w2, [x20, #4]
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
40023194: 110006b5 add w21, w21, #0x1
memcpy(sg->buffer, from + (sg->block * rd->block_size), sg->length);
40023198: b94002c3 ldr w3, [x22]
4002319c: f9400680 ldr x0, [x20, #8]
400231a0: b8418681 ldr w1, [x20], #24
400231a4: 1b037c21 mul w1, w1, w3
400231a8: 8b0102e1 add x1, x23, x1
400231ac: 94004773 bl 40034f78 <memcpy>
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
400231b0: b9401e60 ldr w0, [x19, #28]
400231b4: 6b0002bf cmp w21, w0
400231b8: 54fffec3 b.cc 40023190 <ramdisk_ioctl+0x120> // b.lo, b.ul, b.last <== NEVER TAKEN
400231bc: 17ffffd0 b 400230fc <ramdisk_ioctl+0x8c>
ramdisk_free(rd);
400231c0: aa1603e0 mov x0, x22
400231c4: 94000003 bl 400231d0 <ramdisk_free>
400231c8: 17ffffd9 b 4002312c <ramdisk_ioctl+0xbc>
400231cc: 00000000 udf #0
00000000400224b0 <ramdisk_register>:
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk
)
{
400224b0: a9bd7bfd stp x29, x30, [sp, #-48]!
400224b4: 910003fd mov x29, sp
400224b8: a9025bf5 stp x21, x22, [sp, #32]
400224bc: 2a0103f5 mov w21, w1
400224c0: aa0303f6 mov x22, x3
rtems_status_code sc = RTEMS_SUCCESSFUL;
ramdisk *rd = NULL;
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, trace);
400224c4: 2a0003e1 mov w1, w0
400224c8: 2a0203e3 mov w3, w2
400224cc: 2a1503e2 mov w2, w21
{
400224d0: a90153f3 stp x19, x20, [sp, #16]
400224d4: 2a0003f4 mov w20, w0
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, trace);
400224d8: d2800000 mov x0, #0x0 // #0
400224dc: 94003ff5 bl 400324b0 <ramdisk_allocate>
if (rd == NULL) {
400224e0: b40001c0 cbz x0, 40022518 <ramdisk_register+0x68> <== NEVER TAKEN
return RTEMS_UNSATISFIED;
}
sc = rtems_blkdev_create(
400224e4: aa0003f3 mov x19, x0
400224e8: 90000083 adrp x3, 40032000 <rtems_blkdev_imfs_write+0xd0>
400224ec: 2a1503e2 mov w2, w21
400224f0: 2a1403e1 mov w1, w20
400224f4: aa1603e0 mov x0, x22
400224f8: aa1303e4 mov x4, x19
400224fc: 910d4063 add x3, x3, #0x350
40022500: 94003f34 bl 400321d0 <rtems_blkdev_create>
media_block_size,
media_block_count,
ramdisk_ioctl,
rd
);
if (sc != RTEMS_SUCCESSFUL) {
40022504: 35000140 cbnz w0, 4002252c <ramdisk_register+0x7c> <== NEVER TAKEN
return RTEMS_UNSATISFIED;
}
return RTEMS_SUCCESSFUL;
}
40022508: a94153f3 ldp x19, x20, [sp, #16]
4002250c: a9425bf5 ldp x21, x22, [sp, #32]
40022510: a8c37bfd ldp x29, x30, [sp], #48
40022514: d65f03c0 ret
return RTEMS_UNSATISFIED;
40022518: 528001a0 mov w0, #0xd // #13 <== NOT EXECUTED
}
4002251c: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40022520: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40022524: a8c37bfd ldp x29, x30, [sp], #48 <== NOT EXECUTED
40022528: d65f03c0 ret <== NOT EXECUTED
ramdisk_free(rd);
4002252c: aa1303e0 mov x0, x19 <== NOT EXECUTED
40022530: 94004008 bl 40032550 <ramdisk_free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
40022534: 528001a0 mov w0, #0xd // #13 <== NOT EXECUTED
40022538: 17fffff4 b 40022508 <ramdisk_register+0x58> <== NOT EXECUTED
4002253c: 00000000 udf #0
000000004002e7c0 <rtems_bdbuf_get>:
{
4002e7c0: a9bd7bfd stp x29, x30, [sp, #-48]!
4002e7c4: 910003fd mov x29, sp
4002e7c8: a90153f3 stp x19, x20, [sp, #16]
4002e7cc: aa0003f3 mov x19, x0
4002e7d0: 2a0103f4 mov w20, w1
4002e7d4: a9025bf5 stp x21, x22, [sp, #32]
4002e7d8: d00006b5 adrp x21, 40104000 <rtems_libio_iops+0x260>
4002e7dc: 910c82b5 add x21, x21, #0x320
4002e7e0: 910122a0 add x0, x21, #0x48
4002e7e4: aa0203f6 mov x22, x2
4002e7e8: 97ffebe6 bl 40029780 <_Mutex_Acquire>
if (block < dd->block_count)
4002e7ec: b9403660 ldr w0, [x19, #52]
4002e7f0: 6b00029f cmp w20, w0
4002e7f4: 54000582 b.cs 4002e8a4 <rtems_bdbuf_get+0xe4> // b.hs, b.nlast <== NEVER TAKEN
4002e7f8: b9403e60 ldr w0, [x19, #60]
if (dd->block_to_media_block_shift >= 0)
4002e7fc: b9402661 ldr w1, [x19, #36]
4002e800: 29458e62 ldp w2, w3, [x19, #44]
4002e804: 37f802c0 tbnz w0, #31, 4002e85c <rtems_bdbuf_get+0x9c> <== NEVER TAKEN
return block << dd->block_to_media_block_shift;
4002e808: 1ac02294 lsl w20, w20, w0
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
4002e80c: aa1303e0 mov x0, x19
4002e810: 0b140021 add w1, w1, w20
4002e814: 97fffeef bl 4002e3d0 <rtems_bdbuf_get_buffer_for_access>
4002e818: aa0003f3 mov x19, x0
switch (bd->state)
4002e81c: b9404000 ldr w0, [x0, #64]
4002e820: 7100081f cmp w0, #0x2
4002e824: 54000300 b.eq 4002e884 <rtems_bdbuf_get+0xc4> // b.none
4002e828: 71001c1f cmp w0, #0x7
4002e82c: 54000341 b.ne 4002e894 <rtems_bdbuf_get+0xd4> // b.any
bd->state = state;
4002e830: 52800080 mov w0, #0x4 // #4
}
4002e834: 52800014 mov w20, #0x0 // #0
bd->state = state;
4002e838: b9004260 str w0, [x19, #64]
_Mutex_Release( mutex );
4002e83c: 910122a0 add x0, x21, #0x48
4002e840: 97ffebec bl 400297f0 <_Mutex_Release>
*bd_ptr = bd;
4002e844: f90002d3 str x19, [x22]
}
4002e848: 2a1403e0 mov w0, w20
4002e84c: a94153f3 ldp x19, x20, [sp, #16]
4002e850: a9425bf5 ldp x21, x22, [sp, #32]
4002e854: a8c37bfd ldp x29, x30, [sp], #48
4002e858: d65f03c0 ret
((((uint64_t) block) * dd->block_size) / dd->media_block_size);
4002e85c: 9ba37e94 umull x20, w20, w3 <== NOT EXECUTED
4002e860: 2a0203e2 mov w2, w2 <== NOT EXECUTED
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
4002e864: aa1303e0 mov x0, x19 <== NOT EXECUTED
return (rtems_blkdev_bnum)
4002e868: 9ac20a94 udiv x20, x20, x2 <== NOT EXECUTED
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
4002e86c: 0b140021 add w1, w1, w20 <== NOT EXECUTED
4002e870: 97fffed8 bl 4002e3d0 <rtems_bdbuf_get_buffer_for_access> <== NOT EXECUTED
4002e874: aa0003f3 mov x19, x0 <== NOT EXECUTED
switch (bd->state)
4002e878: b9404000 ldr w0, [x0, #64] <== NOT EXECUTED
4002e87c: 7100081f cmp w0, #0x2 <== NOT EXECUTED
4002e880: 54fffd41 b.ne 4002e828 <rtems_bdbuf_get+0x68> // b.any <== NOT EXECUTED
bd->state = state;
4002e884: 52800060 mov w0, #0x3 // #3
}
4002e888: 52800014 mov w20, #0x0 // #0
bd->state = state;
4002e88c: b9004260 str w0, [x19, #64]
}
4002e890: 17ffffeb b 4002e83c <rtems_bdbuf_get+0x7c>
switch (bd->state)
4002e894: 7100041f cmp w0, #0x1
4002e898: 540001a0 b.eq 4002e8cc <rtems_bdbuf_get+0x10c> // b.none <== ALWAYS TAKEN
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_2);
4002e89c: 52800141 mov w1, #0xa // #10 <== NOT EXECUTED
4002e8a0: 97fff800 bl 4002c8a0 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
4002e8a4: 910122a0 add x0, x21, #0x48 <== NOT EXECUTED
rtems_bdbuf_buffer *bd = NULL;
4002e8a8: d2800013 mov x19, #0x0 // #0 <== NOT EXECUTED
4002e8ac: 97ffebd1 bl 400297f0 <_Mutex_Release> <== NOT EXECUTED
*bd_ptr = bd;
4002e8b0: f90002d3 str x19, [x22] <== NOT EXECUTED
sc = RTEMS_INVALID_ID;
4002e8b4: 52800094 mov w20, #0x4 // #4 <== NOT EXECUTED
}
4002e8b8: 2a1403e0 mov w0, w20 <== NOT EXECUTED
4002e8bc: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
4002e8c0: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
4002e8c4: a8c37bfd ldp x29, x30, [sp], #48 <== NOT EXECUTED
4002e8c8: d65f03c0 ret <== NOT EXECUTED
bd->state = state;
4002e8cc: 528000a0 mov w0, #0x5 // #5
}
4002e8d0: 52800014 mov w20, #0x0 // #0
bd->state = state;
4002e8d4: b9004260 str w0, [x19, #64]
}
4002e8d8: 17ffffd9 b 4002e83c <rtems_bdbuf_get+0x7c>
4002e8dc: 00000000 udf #0
000000004002e8e0 <rtems_bdbuf_read>:
{
4002e8e0: a9bc7bfd stp x29, x30, [sp, #-64]!
4002e8e4: 910003fd mov x29, sp
4002e8e8: a90153f3 stp x19, x20, [sp, #16]
4002e8ec: aa0003f3 mov x19, x0
4002e8f0: a9025bf5 stp x21, x22, [sp, #32]
_Mutex_Acquire( mutex );
4002e8f4: d00006a0 adrp x0, 40104000 <rtems_libio_iops+0x260>
4002e8f8: 910c8015 add x21, x0, #0x320
4002e8fc: 2a0103f6 mov w22, w1
4002e900: 910122a0 add x0, x21, #0x48
4002e904: a90363f7 stp x23, x24, [sp, #48]
4002e908: aa0203f7 mov x23, x2
4002e90c: 97ffeb9d bl 40029780 <_Mutex_Acquire>
if (block < dd->block_count)
4002e910: b9403660 ldr w0, [x19, #52]
4002e914: 6b0002df cmp w22, w0
4002e918: 54000702 b.cs 4002e9f8 <rtems_bdbuf_read+0x118> // b.hs, b.nlast <== NEVER TAKEN
4002e91c: b9403e60 ldr w0, [x19, #60]
if (dd->block_to_media_block_shift >= 0)
4002e920: b9402661 ldr w1, [x19, #36]
4002e924: 29458e62 ldp w2, w3, [x19, #44]
4002e928: 37f803e0 tbnz w0, #31, 4002e9a4 <rtems_bdbuf_read+0xc4> <== NEVER TAKEN
return block << dd->block_to_media_block_shift;
4002e92c: 1ac022c0 lsl w0, w22, w0
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
4002e930: 0b000021 add w1, w1, w0
4002e934: aa1303e0 mov x0, x19
4002e938: 97fffea6 bl 4002e3d0 <rtems_bdbuf_get_buffer_for_access>
4002e93c: aa0003f4 mov x20, x0
switch (bd->state)
4002e940: b9404000 ldr w0, [x0, #64]
4002e944: 7100081f cmp w0, #0x2
4002e948: 54000420 b.eq 4002e9cc <rtems_bdbuf_read+0xec> // b.none
4002e94c: 71001c1f cmp w0, #0x7
4002e950: 540004c1 b.ne 4002e9e8 <rtems_bdbuf_read+0x108> // b.any
++dd->stats.read_hits;
4002e954: b9405e60 ldr w0, [x19, #92]
bd->state = state;
4002e958: 52800081 mov w1, #0x4 // #4
}
4002e95c: 52800018 mov w24, #0x0 // #0
++dd->stats.read_hits;
4002e960: 11000400 add w0, w0, #0x1
4002e964: b9005e60 str w0, [x19, #92]
bd->state = state;
4002e968: b9004281 str w1, [x20, #64]
if (bdbuf_cache.read_ahead_task != 0
4002e96c: b94182a0 ldr w0, [x21, #384]
4002e970: 34000080 cbz w0, 4002e980 <rtems_bdbuf_read+0xa0>
&& dd->read_ahead.trigger == block
4002e974: b9409261 ldr w1, [x19, #144]
4002e978: 6b0102df cmp w22, w1
4002e97c: 54000820 b.eq 4002ea80 <rtems_bdbuf_read+0x1a0> // b.none
_Mutex_Release( mutex );
4002e980: 910122a0 add x0, x21, #0x48
4002e984: 97ffeb9b bl 400297f0 <_Mutex_Release>
}
4002e988: a9425bf5 ldp x21, x22, [sp, #32]
*bd_ptr = bd;
4002e98c: f90002f4 str x20, [x23]
}
4002e990: 2a1803e0 mov w0, w24
4002e994: a94153f3 ldp x19, x20, [sp, #16]
4002e998: a94363f7 ldp x23, x24, [sp, #48]
4002e99c: a8c47bfd ldp x29, x30, [sp], #64
4002e9a0: d65f03c0 ret
((((uint64_t) block) * dd->block_size) / dd->media_block_size);
4002e9a4: 9ba37ec3 umull x3, w22, w3 <== NOT EXECUTED
4002e9a8: 2a0203e0 mov w0, w2 <== NOT EXECUTED
return (rtems_blkdev_bnum)
4002e9ac: 9ac00860 udiv x0, x3, x0 <== NOT EXECUTED
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
4002e9b0: 0b000021 add w1, w1, w0 <== NOT EXECUTED
4002e9b4: aa1303e0 mov x0, x19 <== NOT EXECUTED
4002e9b8: 97fffe86 bl 4002e3d0 <rtems_bdbuf_get_buffer_for_access> <== NOT EXECUTED
4002e9bc: aa0003f4 mov x20, x0 <== NOT EXECUTED
switch (bd->state)
4002e9c0: b9404000 ldr w0, [x0, #64] <== NOT EXECUTED
4002e9c4: 7100081f cmp w0, #0x2 <== NOT EXECUTED
4002e9c8: 54fffc21 b.ne 4002e94c <rtems_bdbuf_read+0x6c> // b.any <== NOT EXECUTED
++dd->stats.read_hits;
4002e9cc: b9405e60 ldr w0, [x19, #92]
bd->state = state;
4002e9d0: 52800061 mov w1, #0x3 // #3
}
4002e9d4: 52800018 mov w24, #0x0 // #0
++dd->stats.read_hits;
4002e9d8: 11000400 add w0, w0, #0x1
4002e9dc: b9005e60 str w0, [x19, #92]
bd->state = state;
4002e9e0: b9004281 str w1, [x20, #64]
}
4002e9e4: 17ffffe2 b 4002e96c <rtems_bdbuf_read+0x8c>
switch (bd->state)
4002e9e8: 7100041f cmp w0, #0x1
4002e9ec: 540000c0 b.eq 4002ea04 <rtems_bdbuf_read+0x124> // b.none <== ALWAYS TAKEN
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_4);
4002e9f0: 52800161 mov w1, #0xb // #11 <== NOT EXECUTED
4002e9f4: 97fff7ab bl 4002c8a0 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
rtems_bdbuf_buffer *bd = NULL;
4002e9f8: d2800014 mov x20, #0x0 // #0 <== NOT EXECUTED
sc = RTEMS_INVALID_ID;
4002e9fc: 52800098 mov w24, #0x4 // #4 <== NOT EXECUTED
4002ea00: 17ffffe0 b 4002e980 <rtems_bdbuf_read+0xa0> <== NOT EXECUTED
++dd->stats.read_misses;
4002ea04: b9406260 ldr w0, [x19, #96]
if (dd->read_ahead.trigger != block)
4002ea08: b9409261 ldr w1, [x19, #144]
++dd->stats.read_misses;
4002ea0c: 11000400 add w0, w0, #0x1
4002ea10: b9006260 str w0, [x19, #96]
if (dd->read_ahead.trigger != block)
4002ea14: 6b0102df cmp w22, w1
4002ea18: 54000140 b.eq 4002ea40 <rtems_bdbuf_read+0x160> // b.none
return node->next == NULL;
4002ea1c: f9404260 ldr x0, [x19, #128]
if (rtems_bdbuf_is_read_ahead_active (dd))
4002ea20: b40000a0 cbz x0, 4002ea34 <rtems_bdbuf_read+0x154> <== ALWAYS TAKEN
previous = the_node->previous;
4002ea24: f9404661 ldr x1, [x19, #136] <== NOT EXECUTED
next->previous = previous;
4002ea28: f9000401 str x1, [x0, #8] <== NOT EXECUTED
previous->next = next;
4002ea2c: f9000020 str x0, [x1] <== NOT EXECUTED
node->next = NULL;
4002ea30: f900427f str xzr, [x19, #128] <== NOT EXECUTED
dd->read_ahead.trigger = block + 1;
4002ea34: 110006c1 add w1, w22, #0x1
dd->read_ahead.next = block + 2;
4002ea38: 11000ac0 add w0, w22, #0x2
4002ea3c: 29120261 stp w1, w0, [x19, #144]
sc = rtems_bdbuf_execute_read_request (dd, bd, 1);
4002ea40: aa1403e1 mov x1, x20
4002ea44: aa1303e0 mov x0, x19
4002ea48: 52800022 mov w2, #0x1 // #1
4002ea4c: 97fffc4d bl 4002db80 <rtems_bdbuf_execute_read_request>
4002ea50: 2a0003f8 mov w24, w0
if (sc == RTEMS_SUCCESSFUL)
4002ea54: 35000320 cbnz w0, 4002eab8 <rtems_bdbuf_read+0x1d8>
previous = the_node->previous;
4002ea58: a9400a83 ldp x3, x2, [x20]
bd->state = state;
4002ea5c: 52800060 mov w0, #0x3 // #3
++bd->group->users;
4002ea60: f9402681 ldr x1, [x20, #72]
bd->state = state;
4002ea64: b9004280 str w0, [x20, #64]
++bd->group->users;
4002ea68: b9401820 ldr w0, [x1, #24]
next->previous = previous;
4002ea6c: f9000462 str x2, [x3, #8]
previous->next = next;
4002ea70: f9000043 str x3, [x2]
4002ea74: 11000400 add w0, w0, #0x1
4002ea78: b9001820 str w0, [x1, #24]
}
4002ea7c: 17ffffbc b 4002e96c <rtems_bdbuf_read+0x8c>
&& !rtems_bdbuf_is_read_ahead_active (dd))
4002ea80: f9404261 ldr x1, [x19, #128]
4002ea84: b5fff7e1 cbnz x1, 4002e980 <rtems_bdbuf_read+0xa0> <== NEVER TAKEN
if (rtems_chain_is_empty (chain))
4002ea88: f940c6a2 ldr x2, [x21, #392]
4002ea8c: 910642a1 add x1, x21, #0x190
4002ea90: eb01005f cmp x2, x1
4002ea94: 54000160 b.eq 4002eac0 <rtems_bdbuf_read+0x1e0> // b.none <== ALWAYS TAKEN
old_last = tail->previous;
4002ea98: f940cea2 ldr x2, [x21, #408]
the_node->next = tail;
4002ea9c: 910642a1 add x1, x21, #0x190
4002eaa0: f9004261 str x1, [x19, #128]
rtems_chain_append_unprotected (chain, &dd->read_ahead.node);
4002eaa4: 91020260 add x0, x19, #0x80
tail->previous = the_node;
4002eaa8: f900cea0 str x0, [x21, #408]
old_last->next = the_node;
4002eaac: f9000040 str x0, [x2]
the_node->previous = old_last;
4002eab0: f9004662 str x2, [x19, #136]
}
4002eab4: 17ffffb3 b 4002e980 <rtems_bdbuf_read+0xa0>
bd = NULL;
4002eab8: d2800014 mov x20, #0x0 // #0
4002eabc: 17ffffac b 4002e96c <rtems_bdbuf_read+0x8c>
sc = rtems_event_send (bdbuf_cache.read_ahead_task,
4002eac0: 52800041 mov w1, #0x2 // #2
4002eac4: 94000573 bl 40030090 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
4002eac8: 34fffe80 cbz w0, 4002ea98 <rtems_bdbuf_read+0x1b8> <== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_RA_WAKE_UP);
4002eacc: d28000a0 mov x0, #0x5 // #5 <== NOT EXECUTED
4002ead0: 97fff76c bl 4002c880 <rtems_bdbuf_fatal> <== NOT EXECUTED
...
000000004002eae0 <rtems_bdbuf_release>:
if (bd == NULL)
4002eae0: b4000740 cbz x0, 4002ebc8 <rtems_bdbuf_release+0xe8> <== NEVER TAKEN
{
4002eae4: a9be7bfd stp x29, x30, [sp, #-32]!
4002eae8: 910003fd mov x29, sp
4002eaec: a90153f3 stp x19, x20, [sp, #16]
4002eaf0: aa0003f3 mov x19, x0
_Mutex_Acquire( mutex );
4002eaf4: d00006b4 adrp x20, 40104000 <rtems_libio_iops+0x260>
4002eaf8: 910c8294 add x20, x20, #0x320
4002eafc: 91012280 add x0, x20, #0x48
4002eb00: 97ffeb20 bl 40029780 <_Mutex_Acquire>
switch (bd->state)
4002eb04: b9404260 ldr w0, [x19, #64]
4002eb08: 7100101f cmp w0, #0x4
4002eb0c: 54000440 b.eq 4002eb94 <rtems_bdbuf_release+0xb4> // b.none
4002eb10: 54000189 b.ls 4002eb40 <rtems_bdbuf_release+0x60> // b.plast
4002eb14: 51001401 sub w1, w0, #0x5
4002eb18: 7100043f cmp w1, #0x1
4002eb1c: 540005a8 b.hi 4002ebd0 <rtems_bdbuf_release+0xf0> // b.pmore <== NEVER TAKEN
rtems_bdbuf_discard_buffer_after_access (bd);
4002eb20: aa1303e0 mov x0, x19
4002eb24: 97fff8cb bl 4002ce50 <rtems_bdbuf_discard_buffer_after_access>
_Mutex_Release( mutex );
4002eb28: 91012280 add x0, x20, #0x48
4002eb2c: 97ffeb31 bl 400297f0 <_Mutex_Release>
return RTEMS_SUCCESSFUL;
4002eb30: 52800000 mov w0, #0x0 // #0
}
4002eb34: a94153f3 ldp x19, x20, [sp, #16]
4002eb38: a8c27bfd ldp x29, x30, [sp], #32
4002eb3c: d65f03c0 ret
switch (bd->state)
4002eb40: 71000c1f cmp w0, #0x3
4002eb44: 54000461 b.ne 4002ebd0 <rtems_bdbuf_release+0xf0> // b.any <== NEVER TAKEN
--bd->group->users;
4002eb48: f9402663 ldr x3, [x19, #72]
the_node->next = tail;
4002eb4c: 9102a280 add x0, x20, #0xa8
old_last = tail->previous;
4002eb50: f9405a82 ldr x2, [x20, #176]
bd->state = state;
4002eb54: 52800045 mov w5, #0x2 // #2
--bd->group->users;
4002eb58: b9401861 ldr w1, [x3, #24]
if (bd->waiters)
4002eb5c: b9404664 ldr w4, [x19, #68]
--bd->group->users;
4002eb60: 51000421 sub w1, w1, #0x1
4002eb64: b9001861 str w1, [x3, #24]
the_node->next = tail;
4002eb68: f9000260 str x0, [x19]
bd->state = state;
4002eb6c: b9004265 str w5, [x19, #64]
tail->previous = the_node;
4002eb70: f9005a93 str x19, [x20, #176]
old_last->next = the_node;
4002eb74: f9000053 str x19, [x2]
the_node->previous = old_last;
4002eb78: f9000662 str x2, [x19, #8]
if (bd->waiters)
4002eb7c: 340001c4 cbz w4, 4002ebb4 <rtems_bdbuf_release+0xd4>
if (waiters->count > 0)
4002eb80: b940ea80 ldr w0, [x20, #232]
4002eb84: 34fffd20 cbz w0, 4002eb28 <rtems_bdbuf_release+0x48>
_Condition_Broadcast( condition_variable );
4002eb88: 9103c280 add x0, x20, #0xf0
4002eb8c: 94000659 bl 400304f0 <_Condition_Broadcast>
}
4002eb90: 17ffffe6 b 4002eb28 <rtems_bdbuf_release+0x48>
rtems_bdbuf_add_to_modified_list_after_access (bd);
4002eb94: aa1303e0 mov x0, x19
4002eb98: 97fffeba bl 4002e680 <rtems_bdbuf_add_to_modified_list_after_access>
_Mutex_Release( mutex );
4002eb9c: 91012280 add x0, x20, #0x48
4002eba0: 97ffeb14 bl 400297f0 <_Mutex_Release>
return RTEMS_SUCCESSFUL;
4002eba4: 52800000 mov w0, #0x0 // #0
}
4002eba8: a94153f3 ldp x19, x20, [sp, #16]
4002ebac: a8c27bfd ldp x29, x30, [sp], #32
4002ebb0: d65f03c0 ret
if (waiters->count > 0)
4002ebb4: b9413a80 ldr w0, [x20, #312]
4002ebb8: 34fffb80 cbz w0, 4002eb28 <rtems_bdbuf_release+0x48>
_Condition_Broadcast( condition_variable );
4002ebbc: 91050280 add x0, x20, #0x140
4002ebc0: 9400064c bl 400304f0 <_Condition_Broadcast>
}
4002ebc4: 17ffffd9 b 4002eb28 <rtems_bdbuf_release+0x48>
return RTEMS_INVALID_ADDRESS;
4002ebc8: 52800120 mov w0, #0x9 // #9 <== NOT EXECUTED
}
4002ebcc: d65f03c0 ret <== NOT EXECUTED
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_0);
4002ebd0: 52800121 mov w1, #0x9 // #9 <== NOT EXECUTED
4002ebd4: 97fff733 bl 4002c8a0 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
...
000000004002ebe0 <rtems_bdbuf_release_modified>:
if (bd == NULL)
4002ebe0: b4000440 cbz x0, 4002ec68 <rtems_bdbuf_release_modified+0x88> <== NEVER TAKEN
{
4002ebe4: a9be7bfd stp x29, x30, [sp, #-32]!
4002ebe8: 910003fd mov x29, sp
4002ebec: a90153f3 stp x19, x20, [sp, #16]
4002ebf0: aa0003f3 mov x19, x0
_Mutex_Acquire( mutex );
4002ebf4: d00006b4 adrp x20, 40104000 <rtems_libio_iops+0x260>
4002ebf8: 910c8294 add x20, x20, #0x320
4002ebfc: 91012280 add x0, x20, #0x48
4002ec00: 97ffeae0 bl 40029780 <_Mutex_Acquire>
switch (bd->state)
4002ec04: b9404260 ldr w0, [x19, #64]
4002ec08: 7100141f cmp w0, #0x5
4002ec0c: 54000169 b.ls 4002ec38 <rtems_bdbuf_release_modified+0x58> // b.plast
4002ec10: 7100181f cmp w0, #0x6
4002ec14: 54000161 b.ne 4002ec40 <rtems_bdbuf_release_modified+0x60> // b.any<== NEVER TAKEN
rtems_bdbuf_discard_buffer_after_access (bd);
4002ec18: aa1303e0 mov x0, x19
4002ec1c: 97fff88d bl 4002ce50 <rtems_bdbuf_discard_buffer_after_access>
_Mutex_Release( mutex );
4002ec20: 91012280 add x0, x20, #0x48
4002ec24: 97ffeaf3 bl 400297f0 <_Mutex_Release>
return RTEMS_SUCCESSFUL;
4002ec28: 52800000 mov w0, #0x0 // #0
}
4002ec2c: a94153f3 ldp x19, x20, [sp, #16]
4002ec30: a8c27bfd ldp x29, x30, [sp], #32
4002ec34: d65f03c0 ret
switch (bd->state)
4002ec38: 7100081f cmp w0, #0x2
4002ec3c: 54000068 b.hi 4002ec48 <rtems_bdbuf_release_modified+0x68> // b.pmore<== ALWAYS TAKEN
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_6);
4002ec40: 528001a1 mov w1, #0xd // #13 <== NOT EXECUTED
4002ec44: 97fff717 bl 4002c8a0 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
rtems_bdbuf_add_to_modified_list_after_access (bd);
4002ec48: aa1303e0 mov x0, x19
4002ec4c: 97fffe8d bl 4002e680 <rtems_bdbuf_add_to_modified_list_after_access>
4002ec50: 91012280 add x0, x20, #0x48
4002ec54: 97ffeae7 bl 400297f0 <_Mutex_Release>
return RTEMS_SUCCESSFUL;
4002ec58: 52800000 mov w0, #0x0 // #0
}
4002ec5c: a94153f3 ldp x19, x20, [sp, #16]
4002ec60: a8c27bfd ldp x29, x30, [sp], #32
4002ec64: d65f03c0 ret
return RTEMS_INVALID_ADDRESS;
4002ec68: 52800120 mov w0, #0x9 // #9 <== NOT EXECUTED
}
4002ec6c: d65f03c0 ret <== NOT EXECUTED
000000004002eed0 <rtems_bdbuf_set_block_size>:
{
4002eed0: a9bd7bfd stp x29, x30, [sp, #-48]!
if (sync)
4002eed4: 72001c5f tst w2, #0xff
{
4002eed8: 910003fd mov x29, sp
4002eedc: a90153f3 stp x19, x20, [sp, #16]
4002eee0: 2a0103f4 mov w20, w1
4002eee4: aa0003f3 mov x19, x0
4002eee8: a9025bf5 stp x21, x22, [sp, #32]
if (sync)
4002eeec: 54000801 b.ne 4002efec <rtems_bdbuf_set_block_size+0x11c> // b.any
_Mutex_Acquire( mutex );
4002eef0: d00006b5 adrp x21, 40104000 <rtems_libio_iops+0x260>
4002eef4: 910c82b5 add x21, x21, #0x320
4002eef8: 910122a0 add x0, x21, #0x48
sc = RTEMS_INVALID_NUMBER;
4002eefc: 52800156 mov w22, #0xa // #10
4002ef00: 97ffea20 bl 40029780 <_Mutex_Acquire>
if (block_size > 0)
4002ef04: 35000114 cbnz w20, 4002ef24 <rtems_bdbuf_set_block_size+0x54>
_Mutex_Release( mutex );
4002ef08: 910122a0 add x0, x21, #0x48
4002ef0c: 97ffea39 bl 400297f0 <_Mutex_Release>
}
4002ef10: 2a1603e0 mov w0, w22
4002ef14: a94153f3 ldp x19, x20, [sp, #16]
4002ef18: a9425bf5 ldp x21, x22, [sp, #32]
4002ef1c: a8c37bfd ldp x29, x30, [sp], #48
4002ef20: d65f03c0 ret
if (size > bdbuf_config.buffer_max)
4002ef24: f0000081 adrp x1, 40041000 <__trunctfdf2+0x170>
4002ef28: 91368021 add x1, x1, #0xda0
size_t bds_per_group = rtems_bdbuf_bds_per_group (block_size);
4002ef2c: 2a1403e0 mov w0, w20
if (size > bdbuf_config.buffer_max)
4002ef30: b9403c22 ldr w2, [x1, #60]
4002ef34: eb02001f cmp x0, x2
4002ef38: 54fffe88 b.hi 4002ef08 <rtems_bdbuf_set_block_size+0x38> // b.pmore
bufs_per_size = ((size - 1) / bdbuf_config.buffer_min) + 1;
4002ef3c: b9403821 ldr w1, [x1, #56]
4002ef40: d1000400 sub x0, x0, #0x1
4002ef44: 9ac10801 udiv x1, x0, x1
4002ef48: 91000420 add x0, x1, #0x1
for (bds_per_size = 1;
4002ef4c: b4000581 cbz x1, 4002effc <rtems_bdbuf_set_block_size+0x12c>
4002ef50: d2800022 mov x2, #0x1 // #1
4002ef54: d503201f nop
bds_per_size <<= 1)
4002ef58: 8b020042 add x2, x2, x2
for (bds_per_size = 1;
4002ef5c: eb02001f cmp x0, x2
4002ef60: 54ffffc8 b.hi 4002ef58 <rtems_bdbuf_set_block_size+0x88> // b.pmore
return bdbuf_cache.max_bds_per_group / bds_per_size;
4002ef64: f9401ea0 ldr x0, [x21, #56]
if (bds_per_group != 0)
4002ef68: eb02001f cmp x0, x2
return bdbuf_cache.max_bds_per_group / bds_per_size;
4002ef6c: 9ac20802 udiv x2, x0, x2
if (bds_per_group != 0)
4002ef70: 54000423 b.cc 4002eff4 <rtems_bdbuf_set_block_size+0x124> // b.lo, b.ul, b.last<== NEVER TAKEN
uint32_t media_blocks_per_block = block_size / dd->media_block_size;
4002ef74: b9402e65 ldr w5, [x19, #44]
int block_to_media_block_shift = 0;
4002ef78: 52800003 mov w3, #0x0 // #0
uint32_t media_blocks_per_block = block_size / dd->media_block_size;
4002ef7c: 1ac50a81 udiv w1, w20, w5
while ((one << block_to_media_block_shift) < media_blocks_per_block)
4002ef80: 7100043f cmp w1, #0x1
4002ef84: 54000109 b.ls 4002efa4 <rtems_bdbuf_set_block_size+0xd4> // b.plast
4002ef88: 52800024 mov w4, #0x1 // #1
4002ef8c: d503201f nop
++block_to_media_block_shift;
4002ef90: 11000463 add w3, w3, #0x1
while ((one << block_to_media_block_shift) < media_blocks_per_block)
4002ef94: 1ac32080 lsl w0, w4, w3
4002ef98: 6b01001f cmp w0, w1
4002ef9c: 54ffffa3 b.cc 4002ef90 <rtems_bdbuf_set_block_size+0xc0> // b.lo, b.ul, b.last
if ((dd->media_block_size << block_to_media_block_shift) != block_size)
4002efa0: 1ac320a5 lsl w5, w5, w3
dd->block_count = dd->size / media_blocks_per_block;
4002efa4: b9402a64 ldr w4, [x19, #40]
block_to_media_block_shift = -1;
4002efa8: 6b05029f cmp w20, w5
4002efac: 5a9f0063 csinv w3, w3, wzr, eq // eq = none
dd->block_to_media_block_shift = block_to_media_block_shift;
4002efb0: 29070e61 stp w1, w3, [x19, #56]
dd->block_size = block_size;
4002efb4: b9003274 str w20, [x19, #48]
rtems_bdbuf_do_purge_dev (dd);
4002efb8: aa1303e0 mov x0, x19
dd->bds_per_group = bds_per_group;
4002efbc: f9002262 str x2, [x19, #64]
rtems_status_code sc = RTEMS_SUCCESSFUL;
4002efc0: 52800016 mov w22, #0x0 // #0
dd->block_count = dd->size / media_blocks_per_block;
4002efc4: 1ac10881 udiv w1, w4, w1
4002efc8: b9003661 str w1, [x19, #52]
rtems_bdbuf_do_purge_dev (dd);
4002efcc: 97fff7d1 bl 4002cf10 <rtems_bdbuf_do_purge_dev>
4002efd0: 910122a0 add x0, x21, #0x48
4002efd4: 97ffea07 bl 400297f0 <_Mutex_Release>
}
4002efd8: 2a1603e0 mov w0, w22
4002efdc: a94153f3 ldp x19, x20, [sp, #16]
4002efe0: a9425bf5 ldp x21, x22, [sp, #32]
4002efe4: a8c37bfd ldp x29, x30, [sp], #48
4002efe8: d65f03c0 ret
rtems_bdbuf_syncdev (dd);
4002efec: 97ffff7d bl 4002ede0 <rtems_bdbuf_syncdev>
4002eff0: 17ffffc0 b 4002eef0 <rtems_bdbuf_set_block_size+0x20>
sc = RTEMS_INVALID_NUMBER;
4002eff4: 52800156 mov w22, #0xa // #10 <== NOT EXECUTED
4002eff8: 17ffffc4 b 4002ef08 <rtems_bdbuf_set_block_size+0x38> <== NOT EXECUTED
for (bds_per_size = 1;
4002effc: aa0003e2 mov x2, x0
4002f000: 17ffffd9 b 4002ef64 <rtems_bdbuf_set_block_size+0x94>
...
000000004002ec70 <rtems_bdbuf_sync>:
if (bd == NULL)
4002ec70: b4000920 cbz x0, 4002ed94 <rtems_bdbuf_sync+0x124> <== NEVER TAKEN
{
4002ec74: a9bd7bfd stp x29, x30, [sp, #-48]!
4002ec78: 910003fd mov x29, sp
4002ec7c: a90153f3 stp x19, x20, [sp, #16]
4002ec80: aa0003f3 mov x19, x0
4002ec84: f90013f5 str x21, [sp, #32]
_Mutex_Acquire( mutex );
4002ec88: d00006b5 adrp x21, 40104000 <rtems_libio_iops+0x260>
4002ec8c: 910c82b4 add x20, x21, #0x320
4002ec90: 91012280 add x0, x20, #0x48
4002ec94: 97ffeabb bl 40029780 <_Mutex_Acquire>
switch (bd->state)
4002ec98: b9404260 ldr w0, [x19, #64]
4002ec9c: 7100141f cmp w0, #0x5
4002eca0: 54000189 b.ls 4002ecd0 <rtems_bdbuf_sync+0x60> // b.plast
4002eca4: 7100181f cmp w0, #0x6
4002eca8: 54000181 b.ne 4002ecd8 <rtems_bdbuf_sync+0x68> // b.any <== NEVER TAKEN
rtems_bdbuf_discard_buffer_after_access (bd);
4002ecac: aa1303e0 mov x0, x19
4002ecb0: 97fff868 bl 4002ce50 <rtems_bdbuf_discard_buffer_after_access>
_Mutex_Release( mutex );
4002ecb4: 91012280 add x0, x20, #0x48
4002ecb8: 97ffeace bl 400297f0 <_Mutex_Release>
return RTEMS_SUCCESSFUL;
4002ecbc: 52800000 mov w0, #0x0 // #0
}
4002ecc0: a94153f3 ldp x19, x20, [sp, #16]
4002ecc4: f94013f5 ldr x21, [sp, #32]
4002ecc8: a8c37bfd ldp x29, x30, [sp], #48
4002eccc: d65f03c0 ret
switch (bd->state)
4002ecd0: 7100081f cmp w0, #0x2
4002ecd4: 54000068 b.hi 4002ece0 <rtems_bdbuf_sync+0x70> // b.pmore <== ALWAYS TAKEN
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_5);
4002ecd8: 52800181 mov w1, #0xc // #12 <== NOT EXECUTED
4002ecdc: 97fff6f1 bl 4002c8a0 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
old_last = tail->previous;
4002ece0: f9407280 ldr x0, [x20, #224]
bd->state = state;
4002ece4: 52800101 mov w1, #0x8 // #8
the_node->next = tail;
4002ece8: 91036282 add x2, x20, #0xd8
4002ecec: f9000262 str x2, [x19]
4002ecf0: b9004261 str w1, [x19, #64]
if (bd->waiters)
4002ecf4: b9404661 ldr w1, [x19, #68]
tail->previous = the_node;
4002ecf8: f9007293 str x19, [x20, #224]
old_last->next = the_node;
4002ecfc: f9000013 str x19, [x0]
the_node->previous = old_last;
4002ed00: f9000660 str x0, [x19, #8]
4002ed04: 34000061 cbz w1, 4002ed10 <rtems_bdbuf_sync+0xa0>
if (waiters->count > 0)
4002ed08: b940ea80 ldr w0, [x20, #232]
4002ed0c: 350003e0 cbnz w0, 4002ed88 <rtems_bdbuf_sync+0x118>
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
4002ed10: b94322a0 ldr w0, [x21, #800]
4002ed14: 52800081 mov w1, #0x4 // #4
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
4002ed18: 91044295 add x21, x20, #0x110
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
4002ed1c: 940004dd bl 40030090 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
4002ed20: 35000560 cbnz w0, 4002edcc <rtems_bdbuf_sync+0x15c> <== NEVER TAKEN
switch (bd->state)
4002ed24: b9404260 ldr w0, [x19, #64]
4002ed28: 71001c1f cmp w0, #0x7
4002ed2c: 54000088 b.hi 4002ed3c <rtems_bdbuf_sync+0xcc> // b.pmore
4002ed30: 35000140 cbnz w0, 4002ed58 <rtems_bdbuf_sync+0xe8> <== ALWAYS TAKEN
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_9);
4002ed34: 52800201 mov w1, #0x10 // #16 <== NOT EXECUTED
4002ed38: 97fff6da bl 4002c8a0 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
switch (bd->state)
4002ed3c: 51002001 sub w1, w0, #0x8
4002ed40: 7100083f cmp w1, #0x2
4002ed44: 54ffff88 b.hi 4002ed34 <rtems_bdbuf_sync+0xc4> // b.pmore <== NEVER TAKEN
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
4002ed48: aa1503e1 mov x1, x21
4002ed4c: aa1303e0 mov x0, x19
4002ed50: 97fff81c bl 4002cdc0 <rtems_bdbuf_wait>
break;
4002ed54: 17fffff4 b 4002ed24 <rtems_bdbuf_sync+0xb4>
if (bd->waiters == 0
4002ed58: b9404661 ldr w1, [x19, #68]
4002ed5c: 35fffac1 cbnz w1, 4002ecb4 <rtems_bdbuf_sync+0x44>
|| bd->state == RTEMS_BDBUF_STATE_EMPTY))
4002ed60: 51000401 sub w1, w0, #0x1
&& (bd->state == RTEMS_BDBUF_STATE_CACHED
4002ed64: 7100043f cmp w1, #0x1
4002ed68: 54fffa68 b.hi 4002ecb4 <rtems_bdbuf_sync+0x44> // b.pmore <== NEVER TAKEN
if (bd->state == RTEMS_BDBUF_STATE_EMPTY)
4002ed6c: 7100041f cmp w0, #0x1
4002ed70: 54000160 b.eq 4002ed9c <rtems_bdbuf_sync+0x12c> // b.none
if (waiters->count > 0)
4002ed74: b9413a80 ldr w0, [x20, #312]
4002ed78: 34fff9e0 cbz w0, 4002ecb4 <rtems_bdbuf_sync+0x44>
_Condition_Broadcast( condition_variable );
4002ed7c: 91050280 add x0, x20, #0x140
4002ed80: 940005dc bl 400304f0 <_Condition_Broadcast>
}
4002ed84: 17ffffcc b 4002ecb4 <rtems_bdbuf_sync+0x44>
_Condition_Broadcast( condition_variable );
4002ed88: 9103c280 add x0, x20, #0xf0
4002ed8c: 940005d9 bl 400304f0 <_Condition_Broadcast>
}
4002ed90: 17ffffe0 b 4002ed10 <rtems_bdbuf_sync+0xa0>
return RTEMS_INVALID_ADDRESS;
4002ed94: 52800120 mov w0, #0x9 // #9 <== NOT EXECUTED
}
4002ed98: d65f03c0 ret <== NOT EXECUTED
if (rtems_bdbuf_avl_remove (&bdbuf_cache.tree, bd) != 0)
4002ed9c: b9403261 ldr w1, [x19, #48]
4002eda0: f9401660 ldr x0, [x19, #40]
4002eda4: 97fff72f bl 4002ca60 <rtems_bdbuf_avl_remove.constprop.0.isra.0>
4002eda8: 35000160 cbnz w0, 4002edd4 <rtems_bdbuf_sync+0x164> <== NEVER TAKEN
before_node = after_node->next;
4002edac: f9405280 ldr x0, [x20, #160]
the_node->previous = after_node;
4002edb0: 91028281 add x1, x20, #0xa0
4002edb4: f9000661 str x1, [x19, #8]
bd->state = state;
4002edb8: b900427f str wzr, [x19, #64]
after_node->next = the_node;
4002edbc: f9005293 str x19, [x20, #160]
the_node->next = before_node;
4002edc0: f9000260 str x0, [x19]
before_node->previous = the_node;
4002edc4: f9000413 str x19, [x0, #8]
}
4002edc8: 17ffffeb b 4002ed74 <rtems_bdbuf_sync+0x104>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_1);
4002edcc: d28000e0 mov x0, #0x7 // #7 <== NOT EXECUTED
4002edd0: 97fff6ac bl 4002c880 <rtems_bdbuf_fatal> <== NOT EXECUTED
4002edd4: b9404260 ldr w0, [x19, #64] <== NOT EXECUTED
4002edd8: 97fff7f6 bl 4002cdb0 <rtems_bdbuf_remove_from_tree.part.0.isra.0> <== NOT EXECUTED
4002eddc: 00000000 udf #0
000000004002ede0 <rtems_bdbuf_syncdev>:
{
4002ede0: a9bb7bfd stp x29, x30, [sp, #-80]!
4002ede4: 910003fd mov x29, sp
4002ede8: a90153f3 stp x19, x20, [sp, #16]
4002edec: aa0003f4 mov x20, x0
4002edf0: a9025bf5 stp x21, x22, [sp, #32]
_Mutex_Acquire( mutex );
4002edf4: d00006b5 adrp x21, 40104000 <rtems_libio_iops+0x260>
4002edf8: 910c82b3 add x19, x21, #0x320
4002edfc: 9101a276 add x22, x19, #0x68
4002ee00: f9001bf7 str x23, [sp, #48]
4002ee04: aa1603e0 mov x0, x22
4002ee08: 91012277 add x23, x19, #0x48
4002ee0c: 97ffea5d bl 40029780 <_Mutex_Acquire>
4002ee10: aa1703e0 mov x0, x23
4002ee14: 97ffea5b bl 40029780 <_Mutex_Acquire>
bdbuf_cache.sync_active = true;
4002ee18: 52800020 mov w0, #0x1 // #1
4002ee1c: 39022260 strb w0, [x19, #136]
bdbuf_cache.sync_requester = rtems_task_self ();
4002ee20: 94000568 bl 400303c0 <rtems_task_self>
4002ee24: 2a0003e2 mov w2, w0
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
4002ee28: b94322a0 ldr w0, [x21, #800]
4002ee2c: 52800081 mov w1, #0x4 // #4
bdbuf_cache.sync_requester = rtems_task_self ();
4002ee30: b9008e62 str w2, [x19, #140]
bdbuf_cache.sync_device = dd;
4002ee34: f9004a74 str x20, [x19, #144]
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
4002ee38: 94000496 bl 40030090 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
4002ee3c: 35000220 cbnz w0, 4002ee80 <rtems_bdbuf_syncdev+0xa0> <== NEVER TAKEN
_Mutex_Release( mutex );
4002ee40: aa1703e0 mov x0, x23
4002ee44: 97ffea6b bl 400297f0 <_Mutex_Release>
return rtems_event_system_receive(
4002ee48: 910133e3 add x3, sp, #0x4c
4002ee4c: 52800002 mov w2, #0x0 // #0
4002ee50: 52800001 mov w1, #0x0 // #0
4002ee54: 52b00000 mov w0, #0x80000000 // #-2147483648
4002ee58: 940004de bl 400301d0 <rtems_event_system_receive>
if (sc != RTEMS_SUCCESSFUL)
4002ee5c: 35000160 cbnz w0, 4002ee88 <rtems_bdbuf_syncdev+0xa8> <== NEVER TAKEN
4002ee60: aa1603e0 mov x0, x22
4002ee64: 97ffea63 bl 400297f0 <_Mutex_Release>
}
4002ee68: 52800000 mov w0, #0x0 // #0
4002ee6c: a94153f3 ldp x19, x20, [sp, #16]
4002ee70: a9425bf5 ldp x21, x22, [sp, #32]
4002ee74: f9401bf7 ldr x23, [sp, #48]
4002ee78: a8c57bfd ldp x29, x30, [sp], #80
4002ee7c: d65f03c0 ret
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_1);
4002ee80: d28000e0 mov x0, #0x7 // #7 <== NOT EXECUTED
4002ee84: 97fff67f bl 4002c880 <rtems_bdbuf_fatal> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_TRANS_EVNT);
4002ee88: d28002c0 mov x0, #0x16 // #22 <== NOT EXECUTED
4002ee8c: 97fff67d bl 4002c880 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000000040020f90 <rtems_bdpart_create>:
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
40020f90: a9bb7bfd stp x29, x30, [sp, #-80]!
40020f94: aa0003e5 mov x5, x0
40020f98: 910003fd mov x29, sp
40020f9c: a90153f3 stp x19, x20, [sp, #16]
40020fa0: aa0303f3 mov x19, x3
40020fa4: aa0403f4 mov x20, x4
40020fa8: a9025bf5 stp x21, x22, [sp, #32]
40020fac: aa0103f5 mov x21, x1
40020fb0: a90363f7 stp x23, x24, [sp, #48]
40020fb4: aa0203f7 mov x23, x2
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
40020fb8: b4000061 cbz x1, 40020fc4 <rtems_bdpart_create+0x34> <== NEVER TAKEN
&& format->type == RTEMS_BDPART_FORMAT_MBR
40020fbc: b9400020 ldr w0, [x1]
40020fc0: 34000480 cbz w0, 40021050 <rtems_bdpart_create+0xc0> <== ALWAYS TAKEN
&& format->mbr.dos_compatibility;
40020fc4: 52800018 mov w24, #0x0 // #0 <== NOT EXECUTED
rtems_blkdev_bnum disk_end = 0;
rtems_blkdev_bnum pos = 0;
rtems_blkdev_bnum dist_sum = 0;
rtems_blkdev_bnum record_space =
dos_compatibility ? RTEMS_BDPART_MBR_CYLINDER_SIZE : 1;
40020fc8: 52800036 mov w22, #0x1 // #1 <== NOT EXECUTED
40020fcc: b9004fff str wzr, [sp, #76]
size_t i = 0;
/* Check if we have something to do */
if (count == 0) {
/* Nothing to do */
return RTEMS_SUCCESSFUL;
40020fd0: 52800000 mov w0, #0x0 // #0
if (count == 0) {
40020fd4: b4000354 cbz x20, 4002103c <rtems_bdpart_create+0xac> <== NEVER TAKEN
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
40020fd8: f10002ff cmp x23, #0x0
return RTEMS_INVALID_ADDRESS;
40020fdc: 52800120 mov w0, #0x9 // #9
if (format == NULL || pt == NULL || dist == NULL) {
40020fe0: fa401a64 ccmp x19, #0x0, #0x4, ne // ne = any
40020fe4: fa401aa4 ccmp x21, #0x0, #0x4, ne // ne = any
40020fe8: 540002a0 b.eq 4002103c <rtems_bdpart_create+0xac> // b.none <== NEVER TAKEN
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, NULL, NULL, &disk_end);
40020fec: aa0503e0 mov x0, x5
40020ff0: 910133e3 add x3, sp, #0x4c
40020ff4: d2800002 mov x2, #0x0 // #0
40020ff8: d2800001 mov x1, #0x0 // #0
40020ffc: 94000131 bl 400214c0 <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
40021000: d2800006 mov x6, #0x0 // #0
if (sc != RTEMS_SUCCESSFUL) {
40021004: 340000a0 cbz w0, 40021018 <rtems_bdpart_create+0x88> <== ALWAYS TAKEN
40021008: 1400000d b 4002103c <rtems_bdpart_create+0xac> <== NOT EXECUTED
for (i = 0; i < count; ++i) {
4002100c: eb07029f cmp x20, x7
40021010: 540002c0 b.eq 40021068 <rtems_bdpart_create+0xd8> // b.none
40021014: aa0703e6 mov x6, x7
unsigned prev_sum = dist_sum;
dist_sum += dist [i];
40021018: b8667a65 ldr w5, [x19, x6, lsl #2]
for (i = 0; i < count; ++i) {
4002101c: 910004c7 add x7, x6, #0x1
40021020: 2b0000a1 adds w1, w5, w0
40021024: 1a9f37e0 cset w0, cs // cs = hs, nlast
if (dist_sum < prev_sum) {
return RTEMS_INVALID_NUMBER;
}
if (dist [i] == 0) {
40021028: 710000bf cmp w5, #0x0
4002102c: 7a401800 ccmp w0, #0x0, #0x0, ne // ne = any
dist_sum += dist [i];
40021030: 2a0103e0 mov w0, w1
if (dist [i] == 0) {
40021034: 54fffec0 b.eq 4002100c <rtems_bdpart_create+0x7c> // b.none <== ALWAYS TAKEN
return RTEMS_INVALID_NUMBER;
40021038: 52800140 mov w0, #0xa // #10 <== NOT EXECUTED
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
return RTEMS_SUCCESSFUL;
}
4002103c: a94153f3 ldp x19, x20, [sp, #16]
40021040: a9425bf5 ldp x21, x22, [sp, #32]
40021044: a94363f7 ldp x23, x24, [sp, #48]
40021048: a8c57bfd ldp x29, x30, [sp], #80
4002104c: d65f03c0 ret
&& format->mbr.dos_compatibility;
40021050: 39402020 ldrb w0, [x1, #8]
40021054: 528007f6 mov w22, #0x3f // #63
40021058: 7100001f cmp w0, #0x0
4002105c: 1a9f07f8 cset w24, ne // ne = any
40021060: 1a9f16d6 csinc w22, w22, wzr, ne // ne = any
40021064: 17ffffda b 40020fcc <rtems_bdpart_create+0x3c>
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
40021068: b94002a2 ldr w2, [x21]
return RTEMS_NOT_IMPLEMENTED;
4002106c: 52800300 mov w0, #0x18 // #24
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
40021070: 35fffe62 cbnz w2, 4002103c <rtems_bdpart_create+0xac> <== NEVER TAKEN
disk_end -= (disk_end % record_space);
40021074: b9404fec ldr w12, [sp, #76]
overhead += record_space;
40021078: 510004c4 sub w4, w6, #0x1
4002107c: f10010ff cmp x7, #0x4
if (dos_compatibility) {
40021080: 35000518 cbnz w24, 40021120 <rtems_bdpart_create+0x190> <== ALWAYS TAKEN
overhead += record_space;
40021084: 1b167c84 mul w4, w4, w22 <== NOT EXECUTED
40021088: 1a968084 csel w4, w4, w22, hi // hi = pmore <== NOT EXECUTED
if ((overhead + count) > disk_end) {
4002108c: 8b2440e2 add x2, x7, w4, uxtw
return RTEMS_IO_ERROR;
40021090: 52800360 mov w0, #0x1b // #27
if ((overhead + count) > disk_end) {
40021094: eb2c405f cmp x2, w12, uxtw
40021098: 54fffd28 b.hi 4002103c <rtems_bdpart_create+0xac> // b.pmore <== NEVER TAKEN
free_space = disk_end - overhead;
4002109c: 4b040184 sub w4, w12, w4
for (i = 0; i < count; ++i) {
400210a0: aa1703e8 mov x8, x23
pos = record_space;
400210a4: 2a1603e0 mov w0, w22
for (i = 0; i < count; ++i) {
400210a8: d2800002 mov x2, #0x0 // #0
400210ac: 14000012 b 400210f4 <rtems_bdpart_create+0x164>
if (s == 0) {
400210b0: 6b01007f cmp w3, w1
400210b4: 54000043 b.cc 400210bc <rtems_bdpart_create+0x12c> // b.lo, b.ul, b.last<== NEVER TAKEN
s /= dist_sum;
400210b8: 1ac10865 udiv w5, w3, w1
if (count > 4 && i > 2) {
400210bc: f10010ff cmp x7, #0x4
400210c0: 0b1600a9 add w9, w5, w22
s += record_space - (s % record_space);
400210c4: 1ad608a3 udiv w3, w5, w22
pos += record_space;
400210c8: fa428840 ccmp x2, #0x2, #0x0, hi // hi = pmore
400210cc: 1a808160 csel w0, w11, w0, hi // hi = pmore
p->begin = pos;
400210d0: b9000100 str w0, [x8]
for (i = 0; i < count; ++i) {
400210d4: eb0200df cmp x6, x2
400210d8: 9100c108 add x8, x8, #0x30
400210dc: aa0a03e2 mov x2, x10
s += record_space - (s % record_space);
400210e0: 1b169465 msub w5, w3, w22, w5
if (count > 4 && i > 2) {
400210e4: 4b050000 sub w0, w0, w5
pos += s;
400210e8: 0b000120 add w0, w9, w0
p->end = pos;
400210ec: b81d4100 stur w0, [x8, #-44]
for (i = 0; i < count; ++i) {
400210f0: 54000260 b.eq 4002113c <rtems_bdpart_create+0x1ac> // b.none
rtems_blkdev_bnum s = free_space * dist [i];
400210f4: b8627a63 ldr w3, [x19, x2, lsl #2]
pos += record_space;
400210f8: 0b16000b add w11, w0, w22
for (i = 0; i < count; ++i) {
400210fc: 9100044a add x10, x2, #0x1
s = 1;
40021100: 52800025 mov w5, #0x1 // #1
if (s < free_space || s < dist [i]) {
40021104: 6b04007f cmp w3, w4
40021108: 1a842069 csel w9, w3, w4, cs // cs = hs, nlast
rtems_blkdev_bnum s = free_space * dist [i];
4002110c: 1b047c63 mul w3, w3, w4
if (s < free_space || s < dist [i]) {
40021110: 6b09007f cmp w3, w9
40021114: 54fffce2 b.cs 400210b0 <rtems_bdpart_create+0x120> // b.hs, b.nlast<== ALWAYS TAKEN
return RTEMS_INVALID_NUMBER;
40021118: 52800140 mov w0, #0xa // #10 <== NOT EXECUTED
4002111c: 17ffffc8 b 4002103c <rtems_bdpart_create+0xac> <== NOT EXECUTED
disk_end -= (disk_end % record_space);
40021120: 1ad60980 udiv w0, w12, w22
overhead += record_space;
40021124: 1b167c84 mul w4, w4, w22
40021128: 1a968084 csel w4, w4, w22, hi // hi = pmore
disk_end -= (disk_end % record_space);
4002112c: 1b16b000 msub w0, w0, w22, w12
overhead += (count - 1) * record_space;
40021130: 1b0612c4 madd w4, w22, w6, w4
disk_end -= (disk_end % record_space);
40021134: 4b00018c sub w12, w12, w0
overhead += (count - 1) * record_space;
40021138: 17ffffd5 b 4002108c <rtems_bdpart_create+0xfc>
pt [count - 1].end = disk_end;
4002113c: d2800601 mov x1, #0x30 // #48
return RTEMS_SUCCESSFUL;
40021140: 52800000 mov w0, #0x0 // #0
pt [count - 1].end = disk_end;
40021144: 9b015ce7 madd x7, x7, x1, x23
40021148: b81d40ec stur w12, [x7, #-44]
return RTEMS_SUCCESSFUL;
4002114c: 17ffffbc b 4002103c <rtems_bdpart_create+0xac>
0000000040021150 <rtems_bdpart_dump>:
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
40021150: a9b87bfd stp x29, x30, [sp, #-128]!
40021154: 910003fd mov x29, sp
40021158: a90153f3 stp x19, x20, [sp, #16]
4002115c: aa0103f4 mov x20, x1
40021160: a90363f7 stp x23, x24, [sp, #48]
40021164: aa0003f8 mov x24, x0
size_t i = 0;
printf(
40021168: b0000100 adrp x0, 40042000 <test_state_strings+0x50>
4002116c: 91008000 add x0, x0, #0x20
40021170: 97ffff84 bl 40020f80 <__wrap_puts>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | LAST | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
40021174: b4000614 cbz x20, 40021234 <rtems_bdpart_dump+0xe4> <== NEVER TAKEN
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
40021178: 90000117 adrp x23, 40041000 <__trunctfdf2+0x170>
4002117c: 913f82f7 add x23, x23, #0xfe0
40021180: 91002318 add x24, x24, #0x8
for (i = 0; i < count; ++i) {
40021184: d2800013 mov x19, #0x0 // #0
40021188: a9025bf5 stp x21, x22, [sp, #32]
4002118c: b0000115 adrp x21, 40042000 <test_state_strings+0x50>
40021190: 9105c2b5 add x21, x21, #0x170
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
break;
default:
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
40021194: b0000116 adrp x22, 40042000 <test_state_strings+0x50>
40021198: 910582d6 add x22, x22, #0x160
4002119c: 14000013 b 400211e8 <rtems_bdpart_dump+0x98>
switch (type_mbr) {
400211a0: 39411fe1 ldrb w1, [sp, #71]
400211a4: 7100303f cmp w1, #0xc
400211a8: 54000820 b.eq 400212ac <rtems_bdpart_dump+0x15c> // b.none <== NEVER TAKEN
400211ac: 54000668 b.hi 40021278 <rtems_bdpart_dump+0x128> // b.pmore <== NEVER TAKEN
400211b0: 7100103f cmp w1, #0x4
400211b4: 54000760 b.eq 400212a0 <rtems_bdpart_dump+0x150> // b.none <== NEVER TAKEN
type = "FAT 32";
400211b8: b0000100 adrp x0, 40042000 <test_state_strings+0x50>
400211bc: 91002003 add x3, x0, #0x8
switch (type_mbr) {
400211c0: 71002c3f cmp w1, #0xb
400211c4: 54000441 b.ne 4002124c <rtems_bdpart_dump+0xfc> // b.any <== NEVER TAKEN
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
400211c8: 297f0b01 ldp w1, w2, [x24, #-8]
for (i = 0; i < count; ++i) {
400211cc: 91000673 add x19, x19, #0x1
printf(
400211d0: aa1503e0 mov x0, x21
for (i = 0; i < count; ++i) {
400211d4: 9100c318 add x24, x24, #0x30
printf(
400211d8: 51000442 sub w2, w2, #0x1
400211dc: 97ffff45 bl 40020ef0 <__wrap_printf>
for (i = 0; i < count; ++i) {
400211e0: eb13029f cmp x20, x19
400211e4: 54000260 b.eq 40021230 <rtems_bdpart_dump+0xe0> // b.none
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
400211e8: 91011fe1 add x1, sp, #0x47
400211ec: aa1803e0 mov x0, x24
uint8_t type_mbr = 0;
400211f0: 39011fff strb wzr, [sp, #71]
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
400211f4: 940000a3 bl 40021480 <rtems_bdpart_to_mbr_partition_type>
400211f8: 72001c1f tst w0, #0xff
400211fc: 54fffd21 b.ne 400211a0 <rtems_bdpart_dump+0x50> // b.any <== ALWAYS TAKEN
uuid_unparse_lower( type, str);
40021200: aa1803e0 mov x0, x24 <== NOT EXECUTED
40021204: 910123e1 add x1, sp, #0x48 <== NOT EXECUTED
40021208: 940019aa bl 400278b0 <uuid_unparse_lower> <== NOT EXECUTED
for (i = 0; i < count; ++i) {
4002120c: 91000673 add x19, x19, #0x1 <== NOT EXECUTED
printf(
40021210: 297f0b01 ldp w1, w2, [x24, #-8] <== NOT EXECUTED
type = type_buffer;
40021214: 910123e3 add x3, sp, #0x48 <== NOT EXECUTED
printf(
40021218: aa1503e0 mov x0, x21 <== NOT EXECUTED
for (i = 0; i < count; ++i) {
4002121c: 9100c318 add x24, x24, #0x30 <== NOT EXECUTED
printf(
40021220: 51000442 sub w2, w2, #0x1 <== NOT EXECUTED
40021224: 97ffff33 bl 40020ef0 <__wrap_printf> <== NOT EXECUTED
for (i = 0; i < count; ++i) {
40021228: eb13029f cmp x20, x19 <== NOT EXECUTED
4002122c: 54fffde1 b.ne 400211e8 <rtems_bdpart_dump+0x98> // b.any <== NOT EXECUTED
40021230: a9425bf5 ldp x21, x22, [sp, #32]
p->end - 1U,
type
);
}
puts( "------------+------------+-----------------------------------------------------");
40021234: b0000100 adrp x0, 40042000 <test_state_strings+0x50>
40021238: 91044000 add x0, x0, #0x110
}
4002123c: a94153f3 ldp x19, x20, [sp, #16]
40021240: a94363f7 ldp x23, x24, [sp, #48]
40021244: a8c87bfd ldp x29, x30, [sp], #128
puts( "------------+------------+-----------------------------------------------------");
40021248: 17ffff4e b 40020f80 <__wrap_puts>
type = "FAT 12";
4002124c: 90000100 adrp x0, 40041000 <__trunctfdf2+0x170> <== NOT EXECUTED
40021250: 913fc003 add x3, x0, #0xff0 <== NOT EXECUTED
switch (type_mbr) {
40021254: 7100043f cmp w1, #0x1 <== NOT EXECUTED
40021258: 54fffb80 b.eq 400211c8 <rtems_bdpart_dump+0x78> // b.none <== NOT EXECUTED
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
4002125c: 2a0103e3 mov w3, w1 <== NOT EXECUTED
40021260: aa1603e2 mov x2, x22 <== NOT EXECUTED
40021264: 910123e0 add x0, sp, #0x48 <== NOT EXECUTED
40021268: d2800681 mov x1, #0x34 // #52 <== NOT EXECUTED
4002126c: 94004fd9 bl 400351d0 <snprintf> <== NOT EXECUTED
type = type_buffer;
40021270: 910123e3 add x3, sp, #0x48 <== NOT EXECUTED
break;
40021274: 17ffffd5 b 400211c8 <rtems_bdpart_dump+0x78> <== NOT EXECUTED
switch (type_mbr) {
40021278: 7100383f cmp w1, #0xe <== NOT EXECUTED
4002127c: 540000c0 b.eq 40021294 <rtems_bdpart_dump+0x144> // b.none <== NOT EXECUTED
40021280: 7103683f cmp w1, #0xda <== NOT EXECUTED
40021284: 54fffec1 b.ne 4002125c <rtems_bdpart_dump+0x10c> // b.any <== NOT EXECUTED
type = "DATA";
40021288: b0000103 adrp x3, 40042000 <test_state_strings+0x50> <== NOT EXECUTED
4002128c: 91006063 add x3, x3, #0x18 <== NOT EXECUTED
40021290: 17ffffce b 400211c8 <rtems_bdpart_dump+0x78> <== NOT EXECUTED
type = "FAT 16 LBA";
40021294: 90000103 adrp x3, 40041000 <__trunctfdf2+0x170> <== NOT EXECUTED
40021298: 913fe063 add x3, x3, #0xff8 <== NOT EXECUTED
4002129c: 17ffffcb b 400211c8 <rtems_bdpart_dump+0x78> <== NOT EXECUTED
switch (type_mbr) {
400212a0: b0000103 adrp x3, 40042000 <test_state_strings+0x50> <== NOT EXECUTED
400212a4: 91004063 add x3, x3, #0x10 <== NOT EXECUTED
400212a8: 17ffffc8 b 400211c8 <rtems_bdpart_dump+0x78> <== NOT EXECUTED
type = "FAT 32 LBA";
400212ac: aa1703e3 mov x3, x23 <== NOT EXECUTED
400212b0: 17ffffc6 b 400211c8 <rtems_bdpart_dump+0x78> <== NOT EXECUTED
...
00000000400214c0 <rtems_bdpart_get_disk_data>:
{
400214c0: a9bb7bfd stp x29, x30, [sp, #-80]!
400214c4: 910003fd mov x29, sp
400214c8: a90153f3 stp x19, x20, [sp, #16]
400214cc: aa0303f4 mov x20, x3
400214d0: a9025bf5 stp x21, x22, [sp, #32]
400214d4: aa0203f6 mov x22, x2
sc = RTEMS_INVALID_NAME;
400214d8: 52800075 mov w21, #0x3 // #3
{
400214dc: f9001bf7 str x23, [sp, #48]
400214e0: aa0103f7 mov x23, x1
fd = open( disk_name, O_RDWR);
400214e4: 52800041 mov w1, #0x2 // #2
rtems_disk_device *dd = NULL;
400214e8: f90027ff str xzr, [sp, #72]
fd = open( disk_name, O_RDWR);
400214ec: 94000b71 bl 400242b0 <open>
if (fd < 0) {
400214f0: 37f80220 tbnz w0, #31, 40021534 <rtems_bdpart_get_disk_data+0x74> <== NEVER TAKEN
400214f4: d2884121 mov x1, #0x4209 // #16905
400214f8: f2a80101 movk x1, #0x4008, lsl #16
400214fc: 2a0003f3 mov w19, w0
40021500: 910123e2 add x2, sp, #0x48
40021504: 9400087f bl 40023700 <ioctl>
if (rv != 0) {
40021508: 35000220 cbnz w0, 4002154c <rtems_bdpart_get_disk_data+0x8c> <== NEVER TAKEN
disk_begin = dd->start;
4002150c: f94027e0 ldr x0, [sp, #72]
sc = RTEMS_IO_ERROR;
40021510: 52800375 mov w21, #0x1b // #27
*disk_end = dd->size;
40021514: 29448801 ldp w1, w2, [x0, #36]
40021518: b9000282 str w2, [x20]
if (disk_begin != 0) {
4002151c: b9403002 ldr w2, [x0, #48]
40021520: 7107fc5f cmp w2, #0x1ff
40021524: 7a408820 ccmp w1, #0x0, #0x0, hi // hi = pmore
40021528: 54000160 b.eq 40021554 <rtems_bdpart_get_disk_data+0x94> // b.none <== ALWAYS TAKEN
close( fd);
4002152c: 2a1303e0 mov w0, w19
40021530: 94000764 bl 400232c0 <close>
}
40021534: 2a1503e0 mov w0, w21
40021538: a94153f3 ldp x19, x20, [sp, #16]
4002153c: a9425bf5 ldp x21, x22, [sp, #32]
40021540: f9401bf7 ldr x23, [sp, #48]
40021544: a8c57bfd ldp x29, x30, [sp], #80
40021548: d65f03c0 ret
sc = RTEMS_INVALID_NAME;
4002154c: 52800075 mov w21, #0x3 // #3 <== NOT EXECUTED
40021550: 17fffff7 b 4002152c <rtems_bdpart_get_disk_data+0x6c> <== NOT EXECUTED
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
40021554: f10002ff cmp x23, #0x0
40021558: fa401ac4 ccmp x22, #0x0, #0x4, ne // ne = any
4002155c: 54000140 b.eq 40021584 <rtems_bdpart_get_disk_data+0xc4> // b.none
*fd_ptr = fd;
40021560: b90002f3 str w19, [x23]
*dd_ptr = dd;
40021564: 52800015 mov w21, #0x0 // #0
40021568: f90002c0 str x0, [x22]
}
4002156c: 2a1503e0 mov w0, w21
40021570: a94153f3 ldp x19, x20, [sp, #16]
40021574: a9425bf5 ldp x21, x22, [sp, #32]
40021578: f9401bf7 ldr x23, [sp, #48]
4002157c: a8c57bfd ldp x29, x30, [sp], #80
40021580: d65f03c0 ret
rtems_status_code sc = RTEMS_SUCCESSFUL;
40021584: 52800015 mov w21, #0x0 // #0
40021588: 17ffffe9 b 4002152c <rtems_bdpart_get_disk_data+0x6c>
4002158c: 00000000 udf #0
0000000040021590 <rtems_bdpart_read>:
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
40021590: a9b87bfd stp x29, x30, [sp, #-128]!
40021594: 910003fd mov x29, sp
40021598: a90153f3 stp x19, x20, [sp, #16]
4002159c: a9025bf5 stp x21, x22, [sp, #32]
400215a0: aa0203f6 mov x22, x2
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
400215a4: d100c042 sub x2, x2, #0x30
400215a8: a9068bff stp xzr, x2, [sp, #104]
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
400215ac: b4000563 cbz x3, 40021658 <rtems_bdpart_read+0xc8> <== NEVER TAKEN
400215b0: aa0103f5 mov x21, x1
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
rtems_blkdev_bnum disk_end = 0;
size_t i = 0;
const uint8_t *data = NULL;
int fd = -1;
400215b4: 12800001 mov w1, #0xffffffff // #-1
400215b8: a90363f7 stp x23, x24, [sp, #48]
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
400215bc: f10002bf cmp x21, #0x0
400215c0: aa0303f4 mov x20, x3
rtems_blkdev_bnum disk_end = 0;
400215c4: 290bffff stp wzr, wzr, [sp, #92]
if (format == NULL || pt == NULL || count == NULL) {
400215c8: fa401ac4 ccmp x22, #0x0, #0x4, ne // ne = any
int fd = -1;
400215cc: b90067e1 str w1, [sp, #100]
rtems_disk_device *dd = NULL;
400215d0: f9003fff str xzr, [sp, #120]
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
400215d4: f9400077 ldr x23, [x3]
if (format == NULL || pt == NULL || count == NULL) {
400215d8: 540003e0 b.eq 40021654 <rtems_bdpart_read+0xc4> // b.none <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
}
/* Set count to a save value */
*count = 0;
400215dc: f900029f str xzr, [x20]
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
400215e0: 910183e3 add x3, sp, #0x60
400215e4: 9101e3e2 add x2, sp, #0x78
400215e8: 910193e1 add x1, sp, #0x64
400215ec: 97ffffb5 bl 400214c0 <rtems_bdpart_get_disk_data>
400215f0: 2a0003f3 mov w19, w0
if (sc != RTEMS_SUCCESSFUL) {
400215f4: 340000e0 cbz w0, 40021610 <rtems_bdpart_read+0x80> <== ALWAYS TAKEN
if (block != NULL) {
rtems_bdbuf_release( block);
}
return esc;
}
400215f8: 2a1303e0 mov w0, w19 <== NOT EXECUTED
400215fc: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021600: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40021604: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
40021608: a8c87bfd ldp x29, x30, [sp], #128 <== NOT EXECUTED
4002160c: d65f03c0 ret <== NOT EXECUTED
sc = rtems_bdpart_read_record( dd, 0, &block);
40021610: f9403fe0 ldr x0, [sp, #120]
40021614: 9101a3e2 add x2, sp, #0x68
40021618: 52800001 mov w1, #0x0 // #0
4002161c: 97ffff6d bl 400213d0 <rtems_bdpart_read_record>
40021620: 2a0003f3 mov w19, w0
if (sc != RTEMS_SUCCESSFUL) {
40021624: 34000260 cbz w0, 40021670 <rtems_bdpart_read+0xe0> <== ALWAYS TAKEN
if (fd >= 0) {
40021628: b94067e1 ldr w1, [sp, #100]
4002162c: 36f80e21 tbz w1, #31, 400217f0 <rtems_bdpart_read+0x260> <== ALWAYS TAKEN
if (block != NULL) {
40021630: f94037e0 ldr x0, [sp, #104] <== NOT EXECUTED
40021634: b4fffe20 cbz x0, 400215f8 <rtems_bdpart_read+0x68> <== NOT EXECUTED
rtems_bdbuf_release( block);
40021638: 9400352a bl 4002eae0 <rtems_bdbuf_release>
}
4002163c: 2a1303e0 mov w0, w19
40021640: a94153f3 ldp x19, x20, [sp, #16]
40021644: a9425bf5 ldp x21, x22, [sp, #32]
40021648: a94363f7 ldp x23, x24, [sp, #48]
4002164c: a8c87bfd ldp x29, x30, [sp], #128
40021650: d65f03c0 ret
40021654: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
return RTEMS_INVALID_ADDRESS;
40021658: 52800133 mov w19, #0x9 // #9 <== NOT EXECUTED
}
4002165c: 2a1303e0 mov w0, w19 <== NOT EXECUTED
40021660: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021664: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40021668: a8c87bfd ldp x29, x30, [sp], #128 <== NOT EXECUTED
4002166c: d65f03c0 ret <== NOT EXECUTED
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
40021670: f94037e0 ldr x0, [sp, #104]
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
40021674: d2800601 mov x1, #0x30 // #48
40021678: f90023f9 str x25, [sp, #64]
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
4002167c: 910173e3 add x3, sp, #0x5c
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
40021680: 9b015af7 madd x23, x23, x1, x22
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
40021684: 9101c3e1 add x1, sp, #0x70
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
40021688: f9401c19 ldr x25, [x0, #56]
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
4002168c: aa1703e2 mov x2, x23
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
40021690: 9106fb38 add x24, x25, #0x1be
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
40021694: aa1803e0 mov x0, x24
40021698: 97ffff0a bl 400212c0 <rtems_bdpart_read_mbr_partition>
4002169c: 2a0003f3 mov w19, w0
if (sc != RTEMS_SUCCESSFUL) {
400216a0: 35000b20 cbnz w0, 40021804 <rtems_bdpart_read+0x274> <== NEVER TAKEN
400216a4: f9403be0 ldr x0, [sp, #112]
if (rtems_bdpart_mbr_partition_type( p->type) == RTEMS_BDPART_MBR_GPT) {
400216a8: 39402000 ldrb w0, [x0, #8]
400216ac: 7103b81f cmp w0, #0xee
400216b0: 54000b40 b.eq 40021818 <rtems_bdpart_read+0x288> // b.none <== NEVER TAKEN
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
400216b4: f94037e0 ldr x0, [sp, #104]
400216b8: f9401c01 ldr x1, [x0, #56]
format->type = RTEMS_BDPART_FORMAT_MBR;
400216bc: b90002bf str wzr, [x21]
400216c0: 9106ec20 add x0, x1, #0x1bb
400216c4: 9106dc21 add x1, x1, #0x1b7
value = (value << 8) + data [i];
400216c8: 385ff402 ldrb w2, [x0], #-1
for (i = 3; i >= 0; --i) {
400216cc: eb00003f cmp x1, x0
value = (value << 8) + data [i];
400216d0: 0b132053 add w19, w2, w19, lsl #8
for (i = 3; i >= 0; --i) {
400216d4: 54ffffa1 b.ne 400216c8 <rtems_bdpart_read+0x138> // b.any
}
return value;
400216d8: 9107bb39 add x25, x25, #0x1ee
format->mbr.dos_compatibility = true;
400216dc: 52800020 mov w0, #0x1 // #1
format->mbr.disk_id = rtems_uint32_from_little_endian(
400216e0: b90006b3 str w19, [x21, #4]
format->mbr.dos_compatibility = true;
400216e4: 390022a0 strb w0, [x21, #8]
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
400216e8: 91004318 add x24, x24, #0x10
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
400216ec: 910173e3 add x3, sp, #0x5c
400216f0: aa1803e0 mov x0, x24
400216f4: aa1703e2 mov x2, x23
400216f8: 9101c3e1 add x1, sp, #0x70
400216fc: 97fffef1 bl 400212c0 <rtems_bdpart_read_mbr_partition>
for (i = 1; i < 4; ++i) {
40021700: eb19031f cmp x24, x25
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
40021704: 2a0003f3 mov w19, w0
if (sc != RTEMS_SUCCESSFUL) {
40021708: 350007e0 cbnz w0, 40021804 <rtems_bdpart_read+0x274> <== NEVER TAKEN
for (i = 1; i < 4; ++i) {
4002170c: 54fffee1 b.ne 400216e8 <rtems_bdpart_read+0x158> // b.any
ebr = ep_begin;
40021710: b9405ff5 ldr w21, [sp, #92]
while (ebr != 0) {
40021714: 34000955 cbz w21, 4002183c <rtems_bdpart_read+0x2ac> <== NEVER TAKEN
sc = rtems_bdpart_read_record( dd, ebr, &block);
40021718: f9403fe0 ldr x0, [sp, #120]
4002171c: 9101a3e2 add x2, sp, #0x68
40021720: 2a1503e1 mov w1, w21
40021724: 97ffff2b bl 400213d0 <rtems_bdpart_read_record>
if (sc != RTEMS_SUCCESSFUL) {
40021728: 350007e0 cbnz w0, 40021824 <rtems_bdpart_read+0x294> <== NEVER TAKEN
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
4002172c: f94037e0 ldr x0, [sp, #104]
sc = rtems_bdpart_read_mbr_partition(
40021730: aa1703e2 mov x2, x23
40021734: 9101c3e1 add x1, sp, #0x70
40021738: d2800003 mov x3, #0x0 // #0
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
4002173c: f9401c00 ldr x0, [x0, #56]
sc = rtems_bdpart_read_mbr_partition(
40021740: 9106f800 add x0, x0, #0x1be
40021744: 97fffedf bl 400212c0 <rtems_bdpart_read_mbr_partition>
40021748: 2a0003e4 mov w4, w0
if (sc != RTEMS_SUCCESSFUL) {
4002174c: 35000720 cbnz w0, 40021830 <rtems_bdpart_read+0x2a0> <== NEVER TAKEN
tmp = p->begin + ebr;
40021750: f9403be3 ldr x3, [sp, #112]
40021754: b9400060 ldr w0, [x3]
40021758: 0b150001 add w1, w0, w21
if (tmp > p->begin) {
4002175c: 6b01001f cmp w0, w1
40021760: 54000562 b.cs 4002180c <rtems_bdpart_read+0x27c> // b.hs, b.nlast <== NEVER TAKEN
tmp = p->end + ebr;
40021764: b9400460 ldr w0, [x3, #4]
p->begin = tmp;
40021768: b9000061 str w1, [x3]
tmp = p->end + ebr;
4002176c: 0b150015 add w21, w0, w21
if (tmp > p->end) {
40021770: 6b15001f cmp w0, w21
40021774: 540004c2 b.cs 4002180c <rtems_bdpart_read+0x27c> // b.hs, b.nlast <== NEVER TAKEN
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
40021778: f94037e0 ldr x0, [sp, #104]
4002177c: f9401c06 ldr x6, [x0, #56]
p->end = tmp;
40021780: b9000475 str w21, [x3, #4]
for (i = 3; i >= 0; --i) {
40021784: 910764c1 add x1, x6, #0x1d9
40021788: 910754c5 add x5, x6, #0x1d5
value = (value << 8) + data [i];
4002178c: 385ff422 ldrb w2, [x1], #-1
for (i = 3; i >= 0; --i) {
40021790: eb0100bf cmp x5, x1
value = (value << 8) + data [i];
40021794: 0b042044 add w4, w2, w4, lsl #8
for (i = 3; i >= 0; --i) {
40021798: 54ffffa1 b.ne 4002178c <rtems_bdpart_read+0x1fc> // b.any
if (ebr != 0) {
4002179c: 394748c1 ldrb w1, [x6, #466]
400217a0: 7100009f cmp w4, #0x0
400217a4: 7a451820 ccmp w1, #0x5, #0x0, ne // ne = any
400217a8: 54000140 b.eq 400217d0 <rtems_bdpart_read+0x240> // b.none
*count = (size_t) (p - pt + 1);
400217ac: cb160060 sub x0, x3, x22
400217b0: b201f3e1 mov x1, #0xaaaaaaaaaaaaaaaa // #-6148914691236517206
400217b4: f2955561 movk x1, #0xaaab
400217b8: 9344fc00 asr x0, x0, #4
400217bc: f94023f9 ldr x25, [sp, #64]
400217c0: 9b017c00 mul x0, x0, x1
400217c4: 91000400 add x0, x0, #0x1
400217c8: f9000280 str x0, [x20]
400217cc: 17ffff97 b 40021628 <rtems_bdpart_read+0x98>
tmp = ebr + ep_begin;
400217d0: b9405ff5 ldr w21, [sp, #92]
400217d4: 0b150095 add w21, w4, w21
if (tmp > ebr) {
400217d8: 6b0402bf cmp w21, w4
400217dc: 54fff9e8 b.hi 40021718 <rtems_bdpart_read+0x188> // b.pmore <== ALWAYS TAKEN
if (fd >= 0) {
400217e0: b94067e1 ldr w1, [sp, #100] <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
400217e4: 52800373 mov w19, #0x1b // #27 <== NOT EXECUTED
400217e8: f94023f9 ldr x25, [sp, #64] <== NOT EXECUTED
if (fd >= 0) {
400217ec: 37fff261 tbnz w1, #31, 40021638 <rtems_bdpart_read+0xa8> <== NOT EXECUTED
close( fd);
400217f0: 2a0103e0 mov w0, w1
400217f4: 940006b3 bl 400232c0 <close>
if (block != NULL) {
400217f8: f94037e0 ldr x0, [sp, #104]
400217fc: b5fff1e0 cbnz x0, 40021638 <rtems_bdpart_read+0xa8> <== ALWAYS TAKEN
40021800: 17ffff7e b 400215f8 <rtems_bdpart_read+0x68> <== NOT EXECUTED
40021804: f94023f9 ldr x25, [sp, #64] <== NOT EXECUTED
40021808: 17ffff88 b 40021628 <rtems_bdpart_read+0x98> <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
4002180c: 52800373 mov w19, #0x1b // #27 <== NOT EXECUTED
40021810: f94023f9 ldr x25, [sp, #64] <== NOT EXECUTED
40021814: 17ffff85 b 40021628 <rtems_bdpart_read+0x98> <== NOT EXECUTED
esc = RTEMS_NOT_IMPLEMENTED;
40021818: 52800313 mov w19, #0x18 // #24 <== NOT EXECUTED
4002181c: f94023f9 ldr x25, [sp, #64] <== NOT EXECUTED
40021820: 17ffff82 b 40021628 <rtems_bdpart_read+0x98> <== NOT EXECUTED
40021824: 2a0003f3 mov w19, w0 <== NOT EXECUTED
40021828: f94023f9 ldr x25, [sp, #64] <== NOT EXECUTED
4002182c: 17ffff7f b 40021628 <rtems_bdpart_read+0x98> <== NOT EXECUTED
40021830: 2a0003f3 mov w19, w0 <== NOT EXECUTED
40021834: f94023f9 ldr x25, [sp, #64] <== NOT EXECUTED
40021838: 17ffff7c b 40021628 <rtems_bdpart_read+0x98> <== NOT EXECUTED
*count = (size_t) (p - pt + 1);
4002183c: f9403be3 ldr x3, [sp, #112] <== NOT EXECUTED
40021840: 17ffffdb b 400217ac <rtems_bdpart_read+0x21c> <== NOT EXECUTED
...
0000000040021850 <rtems_bdpart_register>:
rtems_status_code rtems_bdpart_register(
const char *disk_name,
const rtems_bdpart_partition *pt,
size_t count
)
{
40021850: a9ba7bfd stp x29, x30, [sp, #-96]!
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_blkdev_bnum disk_end = 0;
char *logical_disk_name = NULL;
char *logical_disk_marker = NULL;
size_t i = 0;
int fd = -1;
40021854: 12800004 mov w4, #0xffffffff // #-1
{
40021858: 910003fd mov x29, sp
rtems_disk_device *dd = NULL;
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
4002185c: 910143e3 add x3, sp, #0x50
{
40021860: a90153f3 stp x19, x20, [sp, #16]
40021864: aa0103f3 mov x19, x1
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
40021868: 910153e1 add x1, sp, #0x54
{
4002186c: a9025bf5 stp x21, x22, [sp, #32]
40021870: aa0203f6 mov x22, x2
40021874: aa0003f5 mov x21, x0
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
40021878: 910163e2 add x2, sp, #0x58
{
4002187c: a90363f7 stp x23, x24, [sp, #48]
int fd = -1;
40021880: 290a13ff stp wzr, w4, [sp, #80]
rtems_disk_device *dd = NULL;
40021884: f9002fff str xzr, [sp, #88]
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
40021888: 97ffff0e bl 400214c0 <rtems_bdpart_get_disk_data>
4002188c: 2a0003f8 mov w24, w0
if (sc != RTEMS_SUCCESSFUL) {
40021890: 340000e0 cbz w0, 400218ac <rtems_bdpart_register+0x5c> <== ALWAYS TAKEN
free( logical_disk_name);
close( fd);
return esc;
}
40021894: 2a1803e0 mov w0, w24 <== NOT EXECUTED
40021898: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
4002189c: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
400218a0: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
400218a4: a8c67bfd ldp x29, x30, [sp], #96 <== NOT EXECUTED
400218a8: d65f03c0 ret <== NOT EXECUTED
size_t disk_name_size = strlen( disk_name);
400218ac: aa1503e0 mov x0, x21
400218b0: 94004fa6 bl 40035748 <strlen>
400218b4: aa0003f4 mov x20, x0
char *logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
400218b8: 91001000 add x0, x0, #0x4
400218bc: 94000875 bl 40023a90 <malloc>
400218c0: aa0003f7 mov x23, x0
if (logical_disk_name != NULL) {
400218c4: b40003c0 cbz x0, 4002193c <rtems_bdpart_register+0xec> <== NEVER TAKEN
memcpy( logical_disk_name, disk_name, disk_name_size);
400218c8: aa1403e2 mov x2, x20
400218cc: aa1503e1 mov x1, x21
400218d0: a9046bf9 stp x25, x26, [sp, #64]
*marker = logical_disk_name + disk_name_size;
400218d4: 8b14001a add x26, x0, x20
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
400218d8: b0000119 adrp x25, 40042000 <test_state_strings+0x50>
400218dc: 91066339 add x25, x25, #0x198
for (i = 0; i < count; ++i) {
400218e0: d2800014 mov x20, #0x0 // #0
memcpy( logical_disk_name, disk_name, disk_name_size);
400218e4: 94004da5 bl 40034f78 <memcpy>
if (logical_disk_name == NULL) {
400218e8: 14000006 b 40021900 <rtems_bdpart_register+0xb0>
sc = rtems_blkdev_create_partition(
400218ec: 29400e62 ldp w2, w3, [x19]
if (sc != RTEMS_SUCCESSFUL) {
400218f0: 9100c273 add x19, x19, #0x30
sc = rtems_blkdev_create_partition(
400218f4: 4b020063 sub w3, w3, w2
400218f8: 940002c2 bl 40022400 <rtems_blkdev_create_partition>
if (sc != RTEMS_SUCCESSFUL) {
400218fc: 35000340 cbnz w0, 40021964 <rtems_bdpart_register+0x114> <== NEVER TAKEN
for (i = 0; i < count; ++i) {
40021900: eb16029f cmp x20, x22
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
40021904: aa1903e2 mov x2, x25
40021908: aa1a03e0 mov x0, x26
4002190c: 91000694 add x20, x20, #0x1
40021910: d2800081 mov x1, #0x4 // #4
for (i = 0; i < count; ++i) {
40021914: 540002a0 b.eq 40021968 <rtems_bdpart_register+0x118> // b.none
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
40021918: aa1403e3 mov x3, x20
4002191c: 94004e2d bl 400351d0 <snprintf>
40021920: 2a0003e2 mov w2, w0
sc = rtems_blkdev_create_partition(
40021924: aa1503e1 mov x1, x21
40021928: aa1703e0 mov x0, x23
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
4002192c: 71000c5f cmp w2, #0x3
40021930: 54fffded b.le 400218ec <rtems_bdpart_register+0x9c> <== ALWAYS TAKEN
40021934: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
sc = RTEMS_INVALID_NAME;
40021938: 52800078 mov w24, #0x3 // #3 <== NOT EXECUTED
free( logical_disk_name);
4002193c: aa1703e0 mov x0, x23
40021940: 940006d8 bl 400234a0 <free>
close( fd);
40021944: b94057e0 ldr w0, [sp, #84]
40021948: 9400065e bl 400232c0 <close>
}
4002194c: 2a1803e0 mov w0, w24
40021950: a94153f3 ldp x19, x20, [sp, #16]
40021954: a9425bf5 ldp x21, x22, [sp, #32]
40021958: a94363f7 ldp x23, x24, [sp, #48]
4002195c: a8c67bfd ldp x29, x30, [sp], #96
40021960: d65f03c0 ret
40021964: 2a0003f8 mov w24, w0 <== NOT EXECUTED
40021968: a9446bf9 ldp x25, x26, [sp, #64]
4002196c: 17fffff4 b 4002193c <rtems_bdpart_register+0xec>
0000000040021970 <rtems_bdpart_register_from_disk>:
rtems_status_code rtems_bdpart_register_from_disk( const char *disk_name)
{
40021970: d10d03ff sub sp, sp, #0x340
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdpart_format format;
rtems_bdpart_partition pt [RTEMS_BDPART_PARTITION_NUMBER_HINT];
size_t count = RTEMS_BDPART_PARTITION_NUMBER_HINT;
40021974: d2800204 mov x4, #0x10 // #16
/* Read partitions */
sc = rtems_bdpart_read( disk_name, &format, pt, &count);
40021978: 910103e2 add x2, sp, #0x40
4002197c: 910083e3 add x3, sp, #0x20
40021980: 9100a3e1 add x1, sp, #0x28
{
40021984: a9007bfd stp x29, x30, [sp]
40021988: 910003fd mov x29, sp
4002198c: f9000bf3 str x19, [sp, #16]
40021990: aa0003f3 mov x19, x0
size_t count = RTEMS_BDPART_PARTITION_NUMBER_HINT;
40021994: f90013e4 str x4, [sp, #32]
sc = rtems_bdpart_read( disk_name, &format, pt, &count);
40021998: 97fffefe bl 40021590 <rtems_bdpart_read>
if (sc != RTEMS_SUCCESSFUL) {
4002199c: 350000a0 cbnz w0, 400219b0 <rtems_bdpart_register_from_disk+0x40> <== NEVER TAKEN
return sc;
}
/* Register partitions */
return rtems_bdpart_register( disk_name, pt, count);
400219a0: f94013e2 ldr x2, [sp, #32]
400219a4: 910103e1 add x1, sp, #0x40
400219a8: aa1303e0 mov x0, x19
400219ac: 97ffffa9 bl 40021850 <rtems_bdpart_register>
}
400219b0: a9407bfd ldp x29, x30, [sp]
400219b4: f9400bf3 ldr x19, [sp, #16]
400219b8: 910d03ff add sp, sp, #0x340
400219bc: d65f03c0 ret
00000000400219c0 <rtems_bdpart_unregister>:
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt RTEMS_UNUSED,
size_t count
)
{
400219c0: a9bb7bfd stp x29, x30, [sp, #-80]!
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_blkdev_bnum disk_end = 0;
char *logical_disk_name = NULL;
char *logical_disk_marker = NULL;
size_t i = 0;
int fd = -1;
400219c4: 12800004 mov w4, #0xffffffff // #-1
{
400219c8: 910003fd mov x29, sp
rtems_disk_device *dd = NULL;
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
400219cc: 910103e3 add x3, sp, #0x40
400219d0: 910113e1 add x1, sp, #0x44
{
400219d4: a90153f3 stp x19, x20, [sp, #16]
400219d8: aa0203f4 mov x20, x2
400219dc: aa0003f3 mov x19, x0
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
400219e0: 910123e2 add x2, sp, #0x48
{
400219e4: a9025bf5 stp x21, x22, [sp, #32]
int fd = -1;
400219e8: 290813ff stp wzr, w4, [sp, #64]
rtems_disk_device *dd = NULL;
400219ec: f90027ff str xzr, [sp, #72]
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
400219f0: 97fffeb4 bl 400214c0 <rtems_bdpart_get_disk_data>
400219f4: 2a0003f6 mov w22, w0
if (sc != RTEMS_SUCCESSFUL) {
400219f8: 340000c0 cbz w0, 40021a10 <rtems_bdpart_unregister+0x50> <== ALWAYS TAKEN
free( logical_disk_name);
close( fd);
return esc;
}
400219fc: 2a1603e0 mov w0, w22 <== NOT EXECUTED
40021a00: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021a04: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40021a08: a8c57bfd ldp x29, x30, [sp], #80 <== NOT EXECUTED
40021a0c: d65f03c0 ret <== NOT EXECUTED
size_t disk_name_size = strlen( disk_name);
40021a10: aa1303e0 mov x0, x19
40021a14: a90363f7 stp x23, x24, [sp, #48]
40021a18: 94004f4c bl 40035748 <strlen>
40021a1c: aa0003f7 mov x23, x0
char *logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
40021a20: 91001000 add x0, x0, #0x4
40021a24: 9400081b bl 40023a90 <malloc>
40021a28: aa0003f5 mov x21, x0
if (logical_disk_name != NULL) {
40021a2c: b40002e0 cbz x0, 40021a88 <rtems_bdpart_unregister+0xc8> <== NEVER TAKEN
memcpy( logical_disk_name, disk_name, disk_name_size);
40021a30: aa1303e1 mov x1, x19
40021a34: aa1703e2 mov x2, x23
*marker = logical_disk_name + disk_name_size;
40021a38: 8b170018 add x24, x0, x23
for (i = 0; i < count; ++i) {
40021a3c: d2800013 mov x19, #0x0 // #0
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
40021a40: b0000117 adrp x23, 40042000 <test_state_strings+0x50>
40021a44: 910662f7 add x23, x23, #0x198
memcpy( logical_disk_name, disk_name, disk_name_size);
40021a48: 94004d4c bl 40034f78 <memcpy>
if (logical_disk_name == NULL) {
40021a4c: 14000004 b 40021a5c <rtems_bdpart_unregister+0x9c>
rv = unlink( logical_disk_name);
40021a50: aa1503e0 mov x0, x21
40021a54: 94000f4b bl 40025780 <unlink>
if (rv != 0) {
40021a58: 35000180 cbnz w0, 40021a88 <rtems_bdpart_unregister+0xc8> <== NEVER TAKEN
for (i = 0; i < count; ++i) {
40021a5c: eb14027f cmp x19, x20
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
40021a60: aa1703e2 mov x2, x23
40021a64: aa1803e0 mov x0, x24
40021a68: 91000673 add x19, x19, #0x1
40021a6c: d2800081 mov x1, #0x4 // #4
for (i = 0; i < count; ++i) {
40021a70: 540000c0 b.eq 40021a88 <rtems_bdpart_unregister+0xc8> // b.none
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
40021a74: aa1303e3 mov x3, x19
40021a78: 94004dd6 bl 400351d0 <snprintf>
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
40021a7c: 71000c1f cmp w0, #0x3
40021a80: 54fffe8d b.le 40021a50 <rtems_bdpart_unregister+0x90> <== ALWAYS TAKEN
sc = RTEMS_INVALID_NAME;
40021a84: 52800076 mov w22, #0x3 // #3 <== NOT EXECUTED
free( logical_disk_name);
40021a88: aa1503e0 mov x0, x21
40021a8c: 94000685 bl 400234a0 <free>
close( fd);
40021a90: b94047e0 ldr w0, [sp, #68]
40021a94: 9400060b bl 400232c0 <close>
}
40021a98: 2a1603e0 mov w0, w22
40021a9c: a94153f3 ldp x19, x20, [sp, #16]
40021aa0: a9425bf5 ldp x21, x22, [sp, #32]
close( fd);
40021aa4: a94363f7 ldp x23, x24, [sp, #48]
}
40021aa8: a8c57bfd ldp x29, x30, [sp], #80
40021aac: d65f03c0 ret
0000000040021b50 <rtems_bdpart_write>:
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
40021b50: a9b87bfd stp x29, x30, [sp, #-128]!
40021b54: 910003fd mov x29, sp
40021b58: a9025bf5 stp x21, x22, [sp, #32]
40021b5c: aa0103f6 mov x22, x1
40021b60: aa0303f5 mov x21, x3
40021b64: a90363f7 stp x23, x24, [sp, #48]
40021b68: a9046bf9 stp x25, x26, [sp, #64]
40021b6c: aa0203f9 mov x25, x2
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
40021b70: b4000061 cbz x1, 40021b7c <rtems_bdpart_write+0x2c> <== NEVER TAKEN
&& format->type == RTEMS_BDPART_FORMAT_MBR
40021b74: b9400021 ldr w1, [x1]
40021b78: 340006e1 cbz w1, 40021c54 <rtems_bdpart_write+0x104> <== ALWAYS TAKEN
&& format->mbr.dos_compatibility;
40021b7c: 52800018 mov w24, #0x0 // #0 <== NOT EXECUTED
rtems_bdbuf_buffer *block = NULL;
rtems_blkdev_bnum disk_end = 0;
rtems_blkdev_bnum record_space =
dos_compatibility ? RTEMS_BDPART_MBR_CYLINDER_SIZE : 1;
40021b80: 5280003a mov w26, #0x1 // #1 <== NOT EXECUTED
rtems_blkdev_bnum disk_end = 0;
40021b84: b9006bff str wzr, [sp, #104] <== NOT EXECUTED
rtems_bdbuf_buffer *block = NULL;
40021b88: f9003bff str xzr, [sp, #112] <== NOT EXECUTED
size_t ppc = 0; /* Primary partition count */
size_t i = 0;
uint8_t *data = NULL;
int fd = -1;
40021b8c: 12800001 mov w1, #0xffffffff // #-1
40021b90: b9006fe1 str w1, [sp, #108]
rtems_disk_device *dd = NULL;
40021b94: f9003fff str xzr, [sp, #120]
/* Check if we have something to do */
if (count == 0) {
/* Nothing to do */
return RTEMS_SUCCESSFUL;
40021b98: 52800017 mov w23, #0x0 // #0
if (count == 0) {
40021b9c: b4000515 cbz x21, 40021c3c <rtems_bdpart_write+0xec> <== NEVER TAKEN
}
/* Check parameter */
if (format == NULL || pt == NULL) {
40021ba0: f10002df cmp x22, #0x0
return RTEMS_INVALID_ADDRESS;
40021ba4: 52800137 mov w23, #0x9 // #9
if (format == NULL || pt == NULL) {
40021ba8: fa401b24 ccmp x25, #0x0, #0x4, ne // ne = any
40021bac: 54000480 b.eq 40021c3c <rtems_bdpart_write+0xec> // b.none <== NEVER TAKEN
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
40021bb0: 9101a3e3 add x3, sp, #0x68
40021bb4: 9101e3e2 add x2, sp, #0x78
40021bb8: 9101b3e1 add x1, sp, #0x6c
40021bbc: 97fffe41 bl 400214c0 <rtems_bdpart_get_disk_data>
40021bc0: 2a0003f7 mov w23, w0
if (sc != RTEMS_SUCCESSFUL) {
40021bc4: 350003c0 cbnz w0, 40021c3c <rtems_bdpart_write+0xec> <== NEVER TAKEN
return sc;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
40021bc8: a90153f3 stp x19, x20, [sp, #16]
disk_end -= (disk_end % record_space);
40021bcc: b9406be3 ldr w3, [sp, #104]
if (dos_compatibility) {
40021bd0: 35000518 cbnz w24, 40021c70 <rtems_bdpart_write+0x120> <== ALWAYS TAKEN
dos_compatibility ? RTEMS_BDPART_MBR_CYLINDER_SIZE : 1;
40021bd4: aa1903e0 mov x0, x25
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
40021bd8: d2800013 mov x19, #0x0 // #0
40021bdc: 14000009 b 40021c00 <rtems_bdpart_write+0xb0>
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that partitions do not overlap */
if (i > 0 && pt [i - 1].end > p->begin) {
40021be0: b4000093 cbz x19, 40021bf0 <rtems_bdpart_write+0xa0>
40021be4: b85d4001 ldur w1, [x0, #-44]
40021be8: 6b01009f cmp w4, w1
40021bec: 540001a3 b.cc 40021c20 <rtems_bdpart_write+0xd0> // b.lo, b.ul, b.last<== NEVER TAKEN
for (i = 0; i < count; ++i) {
40021bf0: 9100c000 add x0, x0, #0x30
40021bf4: eb1402bf cmp x21, x20
40021bf8: 540005c0 b.eq 40021cb0 <rtems_bdpart_write+0x160> // b.none
40021bfc: aa1403f3 mov x19, x20
if (p->begin >= disk_end || p->end > disk_end) {
40021c00: b9400004 ldr w4, [x0]
for (i = 0; i < count; ++i) {
40021c04: 91000674 add x20, x19, #0x1
if (p->begin >= disk_end || p->end > disk_end) {
40021c08: 6b03009f cmp w4, w3
40021c0c: 540000a2 b.cs 40021c20 <rtems_bdpart_write+0xd0> // b.hs, b.nlast <== NEVER TAKEN
40021c10: b9400405 ldr w5, [x0, #4]
if (p->begin >= p->end) {
40021c14: 6b05009f cmp w4, w5
40021c18: 7a4330a2 ccmp w5, w3, #0x2, cc // cc = lo, ul, last
40021c1c: 54fffe29 b.ls 40021be0 <rtems_bdpart_write+0x90> // b.plast <== ALWAYS TAKEN
esc = RTEMS_INVALID_NUMBER;
40021c20: 52800157 mov w23, #0xa // #10 <== NOT EXECUTED
}
}
cleanup:
if (fd >= 0) {
40021c24: b9406fe0 ldr w0, [sp, #108]
40021c28: 36f803c0 tbz w0, #31, 40021ca0 <rtems_bdpart_write+0x150> <== ALWAYS TAKEN
close( fd);
}
if (block != NULL) {
40021c2c: f9403be0 ldr x0, [sp, #112] <== NOT EXECUTED
40021c30: b40002a0 cbz x0, 40021c84 <rtems_bdpart_write+0x134> <== NOT EXECUTED
rtems_bdbuf_sync( block);
40021c34: 9400340f bl 4002ec70 <rtems_bdbuf_sync>
40021c38: a94153f3 ldp x19, x20, [sp, #16]
}
return esc;
}
40021c3c: 2a1703e0 mov w0, w23
40021c40: a9425bf5 ldp x21, x22, [sp, #32]
40021c44: a94363f7 ldp x23, x24, [sp, #48]
40021c48: a9446bf9 ldp x25, x26, [sp, #64]
40021c4c: a8c87bfd ldp x29, x30, [sp], #128
40021c50: d65f03c0 ret
&& format->mbr.dos_compatibility;
40021c54: 394022c1 ldrb w1, [x22, #8]
40021c58: 34fff921 cbz w1, 40021b7c <rtems_bdpart_write+0x2c> <== NEVER TAKEN
40021c5c: 52800038 mov w24, #0x1 // #1
dos_compatibility ? RTEMS_BDPART_MBR_CYLINDER_SIZE : 1;
40021c60: 528007fa mov w26, #0x3f // #63
rtems_blkdev_bnum disk_end = 0;
40021c64: b9006bff str wzr, [sp, #104]
rtems_bdbuf_buffer *block = NULL;
40021c68: f9003bff str xzr, [sp, #112]
rtems_blkdev_bnum record_space =
40021c6c: 17ffffc8 b 40021b8c <rtems_bdpart_write+0x3c>
disk_end -= (disk_end % record_space);
40021c70: 1ada0860 udiv w0, w3, w26
40021c74: 1b1a8c00 msub w0, w0, w26, w3
40021c78: 4b000063 sub w3, w3, w0
40021c7c: b9006be3 str w3, [sp, #104]
40021c80: 17ffffd5 b 40021bd4 <rtems_bdpart_write+0x84>
}
40021c84: 2a1703e0 mov w0, w23 <== NOT EXECUTED
40021c88: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021c8c: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40021c90: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
40021c94: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
40021c98: a8c87bfd ldp x29, x30, [sp], #128 <== NOT EXECUTED
40021c9c: d65f03c0 ret <== NOT EXECUTED
close( fd);
40021ca0: 94000588 bl 400232c0 <close>
if (block != NULL) {
40021ca4: f9403be0 ldr x0, [sp, #112]
40021ca8: b5fffc60 cbnz x0, 40021c34 <rtems_bdpart_write+0xe4> <== ALWAYS TAKEN
40021cac: 17fffff6 b 40021c84 <rtems_bdpart_write+0x134> <== NOT EXECUTED
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
40021cb0: b94002c0 ldr w0, [x22]
esc = RTEMS_NOT_IMPLEMENTED;
40021cb4: 52800317 mov w23, #0x18 // #24
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
40021cb8: 35fffb60 cbnz w0, 40021c24 <rtems_bdpart_write+0xd4> <== NEVER TAKEN
ppc = count <= 4 ? count : 3;
40021cbc: f10012bf cmp x21, #0x4
40021cc0: 540001e9 b.ls 40021cfc <rtems_bdpart_write+0x1ac> // b.plast <== NEVER TAKEN
if (dos_compatibility && pt [0].begin != RTEMS_BDPART_MBR_CYLINDER_SIZE) {
40021cc4: 350015f8 cbnz w24, 40021f80 <rtems_bdpart_write+0x430> <== ALWAYS TAKEN
40021cc8: d2800603 mov x3, #0x30 // #48
40021ccc: 91024320 add x0, x25, #0x90
40021cd0: 9b036683 madd x3, x20, x3, x25
40021cd4: 14000003 b 40021ce0 <rtems_bdpart_write+0x190>
for (i = ppc; i < count; ++i) {
40021cd8: eb03001f cmp x0, x3
40021cdc: 540001e0 b.eq 40021d18 <rtems_bdpart_write+0x1c8> // b.none
if ((pt [i].begin - pt [i - 1].end) < record_space) {
40021ce0: b85d4002 ldur w2, [x0, #-44]
for (i = ppc; i < count; ++i) {
40021ce4: 9100c000 add x0, x0, #0x30
if ((pt [i].begin - pt [i - 1].end) < record_space) {
40021ce8: b85d0001 ldur w1, [x0, #-48]
40021cec: 4b020021 sub w1, w1, w2
40021cf0: 6b1a003f cmp w1, w26
40021cf4: 54ffff22 b.cs 40021cd8 <rtems_bdpart_write+0x188> // b.hs, b.nlast <== ALWAYS TAKEN
40021cf8: 17ffffca b 40021c20 <rtems_bdpart_write+0xd0> <== NOT EXECUTED
if (dos_compatibility && pt [0].begin != RTEMS_BDPART_MBR_CYLINDER_SIZE) {
40021cfc: 340000b8 cbz w24, 40021d10 <rtems_bdpart_write+0x1c0> <== NOT EXECUTED
40021d00: b9400320 ldr w0, [x25] <== NOT EXECUTED
esc = RTEMS_INVALID_NUMBER;
40021d04: 52800157 mov w23, #0xa // #10 <== NOT EXECUTED
if (dos_compatibility && pt [0].begin != RTEMS_BDPART_MBR_CYLINDER_SIZE) {
40021d08: 7100fc1f cmp w0, #0x3f <== NOT EXECUTED
40021d0c: 54fff8c1 b.ne 40021c24 <rtems_bdpart_write+0xd4> // b.any <== NOT EXECUTED
40021d10: aa1403f8 mov x24, x20 <== NOT EXECUTED
40021d14: 14000002 b 40021d1c <rtems_bdpart_write+0x1cc> <== NOT EXECUTED
40021d18: d2800078 mov x24, #0x3 // #3
40021d1c: 91002335 add x21, x25, #0x8
40021d20: d2800617 mov x23, #0x30 // #48
40021d24: 9b175697 madd x23, x20, x23, x21
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
40021d28: 91019fe1 add x1, sp, #0x67
40021d2c: aa1503e0 mov x0, x21
uint8_t type = 0;
40021d30: 39019fff strb wzr, [sp, #103]
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
40021d34: 97fffdd3 bl 40021480 <rtems_bdpart_to_mbr_partition_type>
40021d38: 72001c1f tst w0, #0xff
40021d3c: 54001180 b.eq 40021f6c <rtems_bdpart_write+0x41c> // b.none <== NEVER TAKEN
if (p->flags > 0xffU) {
40021d40: f94012a0 ldr x0, [x21, #32]
for (i = 0; i < count; ++i) {
40021d44: 9100c2b5 add x21, x21, #0x30
if (p->flags > 0xffU) {
40021d48: f103fc1f cmp x0, #0xff
40021d4c: 54001108 b.hi 40021f6c <rtems_bdpart_write+0x41c> // b.pmore <== NEVER TAKEN
for (i = 0; i < count; ++i) {
40021d50: eb1702bf cmp x21, x23
40021d54: 54fffea1 b.ne 40021d28 <rtems_bdpart_write+0x1d8> // b.any
sc = rtems_bdpart_new_record( dd, 0, &block);
40021d58: f9403fe0 ldr x0, [sp, #120]
40021d5c: 9101c3e2 add x2, sp, #0x70
40021d60: 52800001 mov w1, #0x0 // #0
40021d64: 97ffff53 bl 40021ab0 <rtems_bdpart_new_record>
40021d68: 2a0003f7 mov w23, w0
if (sc != RTEMS_SUCCESSFUL) {
40021d6c: 35fff5c0 cbnz w0, 40021c24 <rtems_bdpart_write+0xd4> <== NEVER TAKEN
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
40021d70: f9403be3 ldr x3, [sp, #112]
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
40021d74: aa1903e2 mov x2, x25
rtems_uint32_to_little_endian(
40021d78: b94006c1 ldr w1, [x22, #4]
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
40021d7c: f9401c60 ldr x0, [x3, #56]
{
int i;
for (i = 0; i < 4; ++i) {
data [i] = (uint8_t) value;
value >>= 8;
40021d80: 53087c26 lsr w6, w1, #8
40021d84: 53107c25 lsr w5, w1, #16
40021d88: 53187c24 lsr w4, w1, #24
data [i] = (uint8_t) value;
40021d8c: 3906e001 strb w1, [x0, #440]
40021d90: 3906e406 strb w6, [x0, #441]
40021d94: 3906e805 strb w5, [x0, #442]
40021d98: 3906ec04 strb w4, [x0, #443]
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
40021d9c: f9401c61 ldr x1, [x3, #56]
40021da0: 9106f820 add x0, x1, #0x1be
for (i = 0; i < ppc; ++i) {
40021da4: 8b181021 add x1, x1, x24, lsl #4
40021da8: 9106f82c add x12, x1, #0x1be
40021dac: d503201f nop
rtems_bdpart_write_mbr_partition(
40021db0: 29400443 ldp w3, w1, [x2]
for (i = 0; i < ppc; ++i) {
40021db4: 9100c042 add x2, x2, #0x30
40021db8: 385d804b ldurb w11, [x2, #-40]
rtems_bdpart_write_mbr_partition(
40021dbc: 4b030021 sub w1, w1, w3
40021dc0: 385f8044 ldurb w4, [x2, #-8]
value >>= 8;
40021dc4: 53087c6a lsr w10, w3, #8
40021dc8: 53107c69 lsr w9, w3, #16
40021dcc: 53087c27 lsr w7, w1, #8
40021dd0: 53107c26 lsr w6, w1, #16
40021dd4: 53187c25 lsr w5, w1, #24
40021dd8: 53187c68 lsr w8, w3, #24
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
40021ddc: 3900100b strb w11, [x0, #4]
data [i] = (uint8_t) value;
40021de0: 39002003 strb w3, [x0, #8]
40021de4: 3900240a strb w10, [x0, #9]
40021de8: 39002809 strb w9, [x0, #10]
40021dec: 39002c08 strb w8, [x0, #11]
40021df0: 39003001 strb w1, [x0, #12]
40021df4: 39003407 strb w7, [x0, #13]
40021df8: 39003806 strb w6, [x0, #14]
40021dfc: 39003c05 strb w5, [x0, #15]
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
40021e00: 38010404 strb w4, [x0], #16
for (i = 0; i < ppc; ++i) {
40021e04: eb0c001f cmp x0, x12
40021e08: 54fffd41 b.ne 40021db0 <rtems_bdpart_write+0x260> // b.any
if (ppc != count) {
40021e0c: eb18029f cmp x20, x24
40021e10: 54fff0a0 b.eq 40021c24 <rtems_bdpart_write+0xd4> // b.none <== NEVER TAKEN
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
40021e14: d2800602 mov x2, #0x30 // #48
rtems_bdpart_write_mbr_partition(
40021e18: b9406be1 ldr w1, [sp, #104]
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
40021e1c: 528000b5 mov w21, #0x5 // #5
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
40021e20: 9b027f02 mul x2, x24, x2
rtems_bdpart_write_mbr_partition(
40021e24: 0b010341 add w1, w26, w1
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
40021e28: 8b020336 add x22, x25, x2
40021e2c: b8626b34 ldr w20, [x25, x2]
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
40021e30: 3900001f strb wzr, [x0]
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
40021e34: 4b1a0283 sub w3, w20, w26
rtems_bdpart_write_mbr_partition(
40021e38: 4b140021 sub w1, w1, w20
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
40021e3c: 39001015 strb w21, [x0, #4]
value >>= 8;
40021e40: 53087c69 lsr w9, w3, #8
40021e44: 53107c68 lsr w8, w3, #16
40021e48: 53187c67 lsr w7, w3, #24
40021e4c: 53087c26 lsr w6, w1, #8
40021e50: 53107c25 lsr w5, w1, #16
40021e54: 53187c24 lsr w4, w1, #24
data [i] = (uint8_t) value;
40021e58: 39002003 strb w3, [x0, #8]
40021e5c: 39002409 strb w9, [x0, #9]
40021e60: 39002808 strb w8, [x0, #10]
40021e64: 39002c07 strb w7, [x0, #11]
40021e68: 39003001 strb w1, [x0, #12]
40021e6c: 39003406 strb w6, [x0, #13]
40021e70: 39003805 strb w5, [x0, #14]
40021e74: 39003c04 strb w4, [x0, #15]
for (i = ppc; i < count; ++i) {
40021e78: 54ffed69 b.ls 40021c24 <rtems_bdpart_write+0xd4> // b.plast <== NEVER TAKEN
ebr = p->begin - record_space;
40021e7c: b8626b22 ldr w2, [x25, x2]
40021e80: a90573fb stp x27, x28, [sp, #80]
40021e84: aa1603fc mov x28, x22
40021e88: aa1803fb mov x27, x24
sc = rtems_bdpart_new_record( dd, ebr, &block);
40021e8c: f9403fe0 ldr x0, [sp, #120]
40021e90: 4b1a0041 sub w1, w2, w26
40021e94: 9101c3e2 add x2, sp, #0x70
40021e98: 97ffff06 bl 40021ab0 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
40021e9c: 350006c0 cbnz w0, 40021f74 <rtems_bdpart_write+0x424> <== NEVER TAKEN
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
40021ea0: f9403be3 ldr x3, [sp, #112]
for (i = ppc; i < count; ++i) {
40021ea4: 91000762 add x2, x27, #0x1
rtems_bdpart_write_mbr_partition(
40021ea8: 294006c4 ldp w4, w1, [x22]
for (i = ppc; i < count; ++i) {
40021eac: eb13037f cmp x27, x19
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
40021eb0: f9401c60 ldr x0, [x3, #56]
rtems_bdpart_write_mbr_partition(
40021eb4: 4b040021 sub w1, w1, w4
40021eb8: 394022c7 ldrb w7, [x22, #8]
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
40021ebc: aa0203fb mov x27, x2
rtems_bdpart_write_mbr_partition(
40021ec0: 3940a2c8 ldrb w8, [x22, #40]
value >>= 8;
40021ec4: 53087c26 lsr w6, w1, #8
40021ec8: 53107c25 lsr w5, w1, #16
40021ecc: 53187c24 lsr w4, w1, #24
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
40021ed0: 3906f808 strb w8, [x0, #446]
40021ed4: 9100c2d6 add x22, x22, #0x30
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
40021ed8: 39070807 strb w7, [x0, #450]
data [i] = (uint8_t) value;
40021edc: 3907181a strb w26, [x0, #454]
40021ee0: 39071c1f strb wzr, [x0, #455]
40021ee4: 3907201f strb wzr, [x0, #456]
40021ee8: 3907241f strb wzr, [x0, #457]
40021eec: 39072801 strb w1, [x0, #458]
40021ef0: 39072c06 strb w6, [x0, #459]
40021ef4: 39073005 strb w5, [x0, #460]
40021ef8: 39073404 strb w4, [x0, #461]
for (i = ppc; i < count; ++i) {
40021efc: 540003e0 b.eq 40021f78 <rtems_bdpart_write+0x428> // b.none
if (i > ppc) {
40021f00: eb18005f cmp x2, x24
rtems_blkdev_bnum begin = p->begin - record_space;
40021f04: b9403382 ldr w2, [x28, #48]
if (i > ppc) {
40021f08: 540002e9 b.ls 40021f64 <rtems_bdpart_write+0x414> // b.plast <== NEVER TAKEN
rtems_bdpart_write_mbr_partition(
40021f0c: b9406be1 ldr w1, [sp, #104]
40021f10: 4b140044 sub w4, w2, w20
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1,
40021f14: f9401c60 ldr x0, [x3, #56]
rtems_bdpart_write_mbr_partition(
40021f18: 0b010341 add w1, w26, w1
40021f1c: 4b020021 sub w1, w1, w2
value >>= 8;
40021f20: 53087c88 lsr w8, w4, #8
40021f24: 53107c87 lsr w7, w4, #16
40021f28: 53187c86 lsr w6, w4, #24
40021f2c: 53187c22 lsr w2, w1, #24
40021f30: 53087c25 lsr w5, w1, #8
40021f34: 53107c23 lsr w3, w1, #16
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
40021f38: 3907381f strb wzr, [x0, #462]
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
40021f3c: 39074815 strb w21, [x0, #466]
data [i] = (uint8_t) value;
40021f40: 39075804 strb w4, [x0, #470]
40021f44: 39075c08 strb w8, [x0, #471]
40021f48: 39076007 strb w7, [x0, #472]
40021f4c: 39076406 strb w6, [x0, #473]
40021f50: 39076801 strb w1, [x0, #474]
40021f54: 39076c05 strb w5, [x0, #475]
40021f58: 39077003 strb w3, [x0, #476]
40021f5c: 39077402 strb w2, [x0, #477]
ebr = p->begin - record_space;
40021f60: b9403382 ldr w2, [x28, #48]
40021f64: 9100c39c add x28, x28, #0x30
40021f68: 17ffffc9 b 40021e8c <rtems_bdpart_write+0x33c>
goto cleanup;
40021f6c: 52800097 mov w23, #0x4 // #4 <== NOT EXECUTED
40021f70: 17ffff2d b 40021c24 <rtems_bdpart_write+0xd4> <== NOT EXECUTED
40021f74: 2a0003f7 mov w23, w0 <== NOT EXECUTED
40021f78: a94573fb ldp x27, x28, [sp, #80]
40021f7c: 17ffff2a b 40021c24 <rtems_bdpart_write+0xd4>
if (dos_compatibility && pt [0].begin != RTEMS_BDPART_MBR_CYLINDER_SIZE) {
40021f80: b9400320 ldr w0, [x25]
40021f84: 7100fc1f cmp w0, #0x3f
40021f88: 54ffea00 b.eq 40021cc8 <rtems_bdpart_write+0x178> // b.none <== ALWAYS TAKEN
40021f8c: 17ffff25 b 40021c20 <rtems_bdpart_write+0xd0> <== NOT EXECUTED
0000000040022400 <rtems_blkdev_create_partition>:
const char *partition,
const char *parent_block_device,
rtems_blkdev_bnum media_block_begin,
rtems_blkdev_bnum media_block_count
)
{
40022400: a9b57bfd stp x29, x30, [sp, #-176]!
40022404: 910003fd mov x29, sp
40022408: a90153f3 stp x19, x20, [sp, #16]
if (sc != RTEMS_SUCCESSFUL) {
close(fd);
}
} else {
sc = RTEMS_INVALID_ID;
4002240c: 52800094 mov w20, #0x4 // #4
{
40022410: a9025bf5 stp x21, x22, [sp, #32]
40022414: 2a0203f6 mov w22, w2
40022418: 2a0303f5 mov w21, w3
4002241c: a90363f7 stp x23, x24, [sp, #48]
40022420: aa0003f7 mov x23, x0
int fd = open(parent_block_device, O_RDWR);
40022424: aa0103e0 mov x0, x1
40022428: 52800041 mov w1, #0x2 // #2
4002242c: 940007a1 bl 400242b0 <open>
if (fd >= 0) {
40022430: 37f80180 tbnz w0, #31, 40022460 <rtems_blkdev_create_partition+0x60>
rv = fstat(fd, &st);
40022434: 2a0003f3 mov w19, w0
40022438: 910123e1 add x1, sp, #0x48
4002243c: 94000459 bl 400235a0 <fstat>
if (rv == 0 && S_ISBLK(st.st_mode)) {
40022440: 350001c0 cbnz w0, 40022478 <rtems_blkdev_create_partition+0x78> <== NEVER TAKEN
40022444: b9405be0 ldr w0, [sp, #88]
sc = RTEMS_INVALID_NODE;
40022448: 528002b4 mov w20, #0x15 // #21
if (rv == 0 && S_ISBLK(st.st_mode)) {
4002244c: 12140c00 and w0, w0, #0xf000
40022450: 7140181f cmp w0, #0x6, lsl #12
40022454: 54000160 b.eq 40022480 <rtems_blkdev_create_partition+0x80> // b.none
close(fd);
40022458: 2a1303e0 mov w0, w19
4002245c: 94000399 bl 400232c0 <close>
}
return sc;
}
40022460: 2a1403e0 mov w0, w20
40022464: a94153f3 ldp x19, x20, [sp, #16]
40022468: a9425bf5 ldp x21, x22, [sp, #32]
4002246c: a94363f7 ldp x23, x24, [sp, #48]
40022470: a8cb7bfd ldp x29, x30, [sp], #176
40022474: d65f03c0 ret
sc = RTEMS_INVALID_NODE;
40022478: 528002b4 mov w20, #0x15 // #21 <== NOT EXECUTED
4002247c: 17fffff7 b 40022458 <rtems_blkdev_create_partition+0x58> <== NOT EXECUTED
40022480: 910103e2 add x2, sp, #0x40
40022484: 2a1303e0 mov w0, w19
40022488: d2884121 mov x1, #0x4209 // #16905
4002248c: f2a80101 movk x1, #0x4008, lsl #16
sc = RTEMS_NOT_IMPLEMENTED;
40022490: 52800314 mov w20, #0x18 // #24
40022494: 9400049b bl 40023700 <ioctl>
if (rv == 0) {
40022498: 35fffe00 cbnz w0, 40022458 <rtems_blkdev_create_partition+0x58>
rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx));
4002249c: d2801400 mov x0, #0xa0 // #160
sc = RTEMS_NO_MEMORY;
400224a0: 52800354 mov w20, #0x1a // #26
rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx));
400224a4: 9400057b bl 40023a90 <malloc>
400224a8: aa0003f8 mov x24, x0
if (ctx != NULL) {
400224ac: b4fffd60 cbz x0, 40022458 <rtems_blkdev_create_partition+0x58>
sc = rtems_disk_init_log(
400224b0: f94023e1 ldr x1, [sp, #64]
400224b4: 2a1503e3 mov w3, w21
400224b8: 2a1603e2 mov w2, w22
400224bc: 9400003d bl 400225b0 <rtems_disk_init_log>
400224c0: 2a0003f4 mov w20, w0
if (sc == RTEMS_SUCCESSFUL) {
400224c4: 350001a0 cbnz w0, 400224f8 <rtems_blkdev_create_partition+0xf8>
rv = IMFS_make_generic_node(
400224c8: 90000102 adrp x2, 40042000 <test_state_strings+0x50>
400224cc: aa1703e0 mov x0, x23
400224d0: aa1803e3 mov x3, x24
400224d4: 91068042 add x2, x2, #0x1a0
400224d8: 528c3fe1 mov w1, #0x61ff // #25087
ctx->fd = fd;
400224dc: b9009b13 str w19, [x24, #152]
rv = IMFS_make_generic_node(
400224e0: 940010b4 bl 400267b0 <IMFS_make_generic_node>
if (rv != 0) {
400224e4: 34fffbe0 cbz w0, 40022460 <rtems_blkdev_create_partition+0x60>
free(ctx);
400224e8: aa1803e0 mov x0, x24
sc = RTEMS_UNSATISFIED;
400224ec: 528001b4 mov w20, #0xd // #13
free(ctx);
400224f0: 940003ec bl 400234a0 <free>
if (sc != RTEMS_SUCCESSFUL) {
400224f4: 17ffffd9 b 40022458 <rtems_blkdev_create_partition+0x58>
free(ctx);
400224f8: aa1803e0 mov x0, x24
400224fc: 940003e9 bl 400234a0 <free>
if (sc != RTEMS_SUCCESSFUL) {
40022500: 17ffffd6 b 40022458 <rtems_blkdev_create_partition+0x58>
...
0000000040021560 <rtems_blkdev_generic_ioctl>:
rtems_device_driver
rtems_blkdev_generic_ioctl(
rtems_device_major_number major RTEMS_UNUSED,
rtems_device_minor_number minor RTEMS_UNUSED,
void * arg)
{
40021560: a9be7bfd stp x29, x30, [sp, #-32]!
rtems_libio_ioctl_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
if (args->command != RTEMS_BLKIO_REQUEST)
40021564: d2884020 mov x0, #0x4201 // #16897
40021568: f2b80500 movk x0, #0xc028, lsl #16
{
4002156c: 910003fd mov x29, sp
if (args->command != RTEMS_BLKIO_REQUEST)
40021570: f9400441 ldr x1, [x2, #8]
{
40021574: f9000bf3 str x19, [sp, #16]
40021578: aa0203f3 mov x19, x2
if (args->command != RTEMS_BLKIO_REQUEST)
4002157c: eb00003f cmp x1, x0
40021580: 54000160 b.eq 400215ac <rtems_blkdev_generic_ioctl+0x4c> // b.none <== NEVER TAKEN
rtems_disk_device *dd = iop->data1;
40021584: f9400040 ldr x0, [x2]
{
args->ioctl_return = dd->ioctl(dd,
40021588: f9400842 ldr x2, [x2, #16]
rtems_disk_device *dd = iop->data1;
4002158c: f9402400 ldr x0, [x0, #72]
args->ioctl_return = dd->ioctl(dd,
40021590: f9402403 ldr x3, [x0, #72]
40021594: d63f0060 blr x3
40021598: b9001a60 str w0, [x19, #24]
*/
args->ioctl_return = -1;
}
return RTEMS_SUCCESSFUL;
}
4002159c: 52800000 mov w0, #0x0 // #0
400215a0: f9400bf3 ldr x19, [sp, #16]
400215a4: a8c27bfd ldp x29, x30, [sp], #32
400215a8: d65f03c0 ret
args->ioctl_return = -1;
400215ac: 12800000 mov w0, #0xffffffff // #-1 <== NOT EXECUTED
400215b0: b9001840 str w0, [x2, #24] <== NOT EXECUTED
}
400215b4: 52800000 mov w0, #0x0 // #0 <== NOT EXECUTED
400215b8: f9400bf3 ldr x19, [sp, #16] <== NOT EXECUTED
400215bc: a8c27bfd ldp x29, x30, [sp], #32 <== NOT EXECUTED
400215c0: d65f03c0 ret <== NOT EXECUTED
...
00000000400212f0 <rtems_blkdev_generic_read>:
rtems_device_driver
rtems_blkdev_generic_read(
rtems_device_major_number major RTEMS_UNUSED,
rtems_device_minor_number minor RTEMS_UNUSED,
void * arg)
{
400212f0: a9ba7bfd stp x29, x30, [sp, #-96]! <== NOT EXECUTED
400212f4: 910003fd mov x29, sp <== NOT EXECUTED
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
uint32_t block_size = dd->block_size;
char *buf = args->buffer;
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
400212f8: a9400041 ldp x1, x0, [x2] <== NOT EXECUTED
{
400212fc: a9046bf9 stp x25, x26, [sp, #64] <== NOT EXECUTED
40021300: a90363f7 stp x23, x24, [sp, #48] <== NOT EXECUTED
40021304: aa0203f7 mov x23, x2 <== NOT EXECUTED
40021308: a90153f3 stp x19, x20, [sp, #16] <== NOT EXECUTED
rtems_disk_device *dd = iop->data1;
4002130c: f9402439 ldr x25, [x1, #72] <== NOT EXECUTED
{
40021310: a9025bf5 stp x21, x22, [sp, #32] <== NOT EXECUTED
uint32_t count = args->count;
40021314: b9401855 ldr w21, [x2, #24] <== NOT EXECUTED
char *buf = args->buffer;
40021318: f9400856 ldr x22, [x2, #16] <== NOT EXECUTED
uint32_t block_size = dd->block_size;
4002131c: b9403338 ldr w24, [x25, #48] <== NOT EXECUTED
uint32_t blkofs = (uint32_t) (args->offset % block_size);
args->bytes_moved = 0;
40021320: b900205f str wzr, [x2, #32] <== NOT EXECUTED
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
40021324: 2a1803f4 mov w20, w24 <== NOT EXECUTED
40021328: 9ad40c1a sdiv x26, x0, x20 <== NOT EXECUTED
uint32_t blkofs = (uint32_t) (args->offset % block_size);
4002132c: 1b148354 msub w20, w26, w20, w0 <== NOT EXECUTED
while (count > 0)
40021330: 35000235 cbnz w21, 40021374 <rtems_blkdev_generic_read+0x84> <== NOT EXECUTED
40021334: 14000023 b 400213c0 <rtems_blkdev_generic_read+0xd0> <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
if (copy > count)
copy = count;
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
40021338: f9402fe1 ldr x1, [sp, #88] <== NOT EXECUTED
rc = rtems_bdbuf_release(diskbuf);
args->bytes_moved += copy;
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
4002133c: 8b0402d6 add x22, x22, x4 <== NOT EXECUTED
blkofs = 0;
block++;
40021340: 1100075a add w26, w26, #0x1 <== NOT EXECUTED
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
40021344: f9401c21 ldr x1, [x1, #56] <== NOT EXECUTED
40021348: 8b344021 add x1, x1, w20, uxtw <== NOT EXECUTED
4002134c: 940045ca bl 40032a74 <memcpy> <== NOT EXECUTED
rc = rtems_bdbuf_release(diskbuf);
40021350: f9402fe0 ldr x0, [sp, #88] <== NOT EXECUTED
40021354: 94002ae3 bl 4002bee0 <rtems_bdbuf_release> <== NOT EXECUTED
40021358: 2a0003f4 mov w20, w0 <== NOT EXECUTED
args->bytes_moved += copy;
4002135c: b94022e3 ldr w3, [x23, #32] <== NOT EXECUTED
while (count > 0)
40021360: 6b1302b5 subs w21, w21, w19 <== NOT EXECUTED
args->bytes_moved += copy;
40021364: 0b130063 add w3, w3, w19 <== NOT EXECUTED
40021368: b90022e3 str w3, [x23, #32] <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
4002136c: 350003a0 cbnz w0, 400213e0 <rtems_blkdev_generic_read+0xf0> <== NOT EXECUTED
while (count > 0)
40021370: 54000280 b.eq 400213c0 <rtems_blkdev_generic_read+0xd0> // b.none <== NOT EXECUTED
rc = rtems_bdbuf_read(dd, block, &diskbuf);
40021374: 910163e2 add x2, sp, #0x58 <== NOT EXECUTED
40021378: 2a1a03e1 mov w1, w26 <== NOT EXECUTED
4002137c: aa1903e0 mov x0, x25 <== NOT EXECUTED
40021380: 94002a58 bl 4002bce0 <rtems_bdbuf_read> <== NOT EXECUTED
copy = block_size - blkofs;
40021384: 4b140303 sub w3, w24, w20 <== NOT EXECUTED
rc = rtems_bdbuf_read(dd, block, &diskbuf);
40021388: 2a0003e1 mov w1, w0 <== NOT EXECUTED
4002138c: 6b15007f cmp w3, w21 <== NOT EXECUTED
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
40021390: aa1603e0 mov x0, x22 <== NOT EXECUTED
40021394: 1a959064 csel w4, w3, w21, ls // ls = plast <== NOT EXECUTED
40021398: 1a959073 csel w19, w3, w21, ls // ls = plast <== NOT EXECUTED
4002139c: aa0403e2 mov x2, x4 <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
400213a0: 34fffcc1 cbz w1, 40021338 <rtems_blkdev_generic_read+0x48> <== NOT EXECUTED
}
return rc;
}
400213a4: 2a0103e0 mov w0, w1 <== NOT EXECUTED
400213a8: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
400213ac: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
400213b0: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
400213b4: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
400213b8: a8c67bfd ldp x29, x30, [sp], #96 <== NOT EXECUTED
400213bc: d65f03c0 ret <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
400213c0: 52800001 mov w1, #0x0 // #0 <== NOT EXECUTED
}
400213c4: 2a0103e0 mov w0, w1 <== NOT EXECUTED
400213c8: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
400213cc: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
400213d0: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
400213d4: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
400213d8: a8c67bfd ldp x29, x30, [sp], #96 <== NOT EXECUTED
400213dc: d65f03c0 ret <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
400213e0: 2a0003e1 mov w1, w0 <== NOT EXECUTED
}
400213e4: 2a0103e0 mov w0, w1 <== NOT EXECUTED
400213e8: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
400213ec: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
400213f0: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
400213f4: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
400213f8: a8c67bfd ldp x29, x30, [sp], #96 <== NOT EXECUTED
400213fc: d65f03c0 ret <== NOT EXECUTED
0000000040021400 <rtems_blkdev_generic_write>:
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major RTEMS_UNUSED,
rtems_device_minor_number minor RTEMS_UNUSED,
void * arg)
{
40021400: a9ba7bfd stp x29, x30, [sp, #-96]! <== NOT EXECUTED
40021404: 910003fd mov x29, sp <== NOT EXECUTED
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
uint32_t block_size = dd->block_size;
char *buf = args->buffer;
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
40021408: a9400041 ldp x1, x0, [x2] <== NOT EXECUTED
{
4002140c: a90363f7 stp x23, x24, [sp, #48] <== NOT EXECUTED
40021410: a90153f3 stp x19, x20, [sp, #16] <== NOT EXECUTED
uint32_t count = args->count;
40021414: b9401854 ldr w20, [x2, #24] <== NOT EXECUTED
{
40021418: a9046bf9 stp x25, x26, [sp, #64] <== NOT EXECUTED
rtems_disk_device *dd = iop->data1;
4002141c: f9402438 ldr x24, [x1, #72] <== NOT EXECUTED
{
40021420: a9025bf5 stp x21, x22, [sp, #32] <== NOT EXECUTED
40021424: aa0203f6 mov x22, x2 <== NOT EXECUTED
char *buf = args->buffer;
40021428: f9400855 ldr x21, [x2, #16] <== NOT EXECUTED
uint32_t block_size = dd->block_size;
4002142c: b9403317 ldr w23, [x24, #48] <== NOT EXECUTED
uint32_t blkofs = (uint32_t) (args->offset % block_size);
args->bytes_moved = 0;
40021430: b900205f str wzr, [x2, #32] <== NOT EXECUTED
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
40021434: 2a1703f3 mov w19, w23 <== NOT EXECUTED
40021438: 9ad30c1a sdiv x26, x0, x19 <== NOT EXECUTED
uint32_t blkofs = (uint32_t) (args->offset % block_size);
4002143c: 1b138353 msub w19, w26, w19, w0 <== NOT EXECUTED
while (count > 0)
40021440: 35000314 cbnz w20, 400214a0 <rtems_blkdev_generic_write+0xa0> <== NOT EXECUTED
40021444: 14000028 b 400214e4 <rtems_blkdev_generic_write+0xe4> <== NOT EXECUTED
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
if ((blkofs == 0) && (count >= block_size))
rc = rtems_bdbuf_get(dd, block, &diskbuf);
40021448: 940029de bl 4002bbc0 <rtems_bdbuf_get> <== NOT EXECUTED
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
4002144c: 4b1302e3 sub w3, w23, w19 <== NOT EXECUTED
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
40021450: aa1503e1 mov x1, x21 <== NOT EXECUTED
40021454: 6b14007f cmp w3, w20 <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
40021458: 350003a0 cbnz w0, 400214cc <rtems_blkdev_generic_write+0xcc> <== NOT EXECUTED
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
4002145c: f9402fe0 ldr x0, [sp, #88] <== NOT EXECUTED
40021460: 1a949062 csel w2, w3, w20, ls // ls = plast <== NOT EXECUTED
40021464: 1a949079 csel w25, w3, w20, ls // ls = plast <== NOT EXECUTED
rc = rtems_bdbuf_release_modified(diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
40021468: 8b0202b5 add x21, x21, x2 <== NOT EXECUTED
blkofs = 0;
block++;
4002146c: 1100075a add w26, w26, #0x1 <== NOT EXECUTED
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
40021470: f9401c00 ldr x0, [x0, #56] <== NOT EXECUTED
40021474: 8b334000 add x0, x0, w19, uxtw <== NOT EXECUTED
40021478: 9400457f bl 40032a74 <memcpy> <== NOT EXECUTED
args->bytes_moved += copy;
4002147c: b94022c1 ldr w1, [x22, #32] <== NOT EXECUTED
rc = rtems_bdbuf_release_modified(diskbuf);
40021480: f9402fe0 ldr x0, [sp, #88] <== NOT EXECUTED
args->bytes_moved += copy;
40021484: 0b190021 add w1, w1, w25 <== NOT EXECUTED
40021488: b90022c1 str w1, [x22, #32] <== NOT EXECUTED
rc = rtems_bdbuf_release_modified(diskbuf);
4002148c: 94002ad5 bl 4002bfe0 <rtems_bdbuf_release_modified> <== NOT EXECUTED
40021490: 2a0003f3 mov w19, w0 <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
40021494: 350001c0 cbnz w0, 400214cc <rtems_blkdev_generic_write+0xcc> <== NOT EXECUTED
while (count > 0)
40021498: 6b190294 subs w20, w20, w25 <== NOT EXECUTED
4002149c: 54000240 b.eq 400214e4 <rtems_blkdev_generic_write+0xe4> // b.none <== NOT EXECUTED
if ((blkofs == 0) && (count >= block_size))
400214a0: 7100027f cmp w19, #0x0 <== NOT EXECUTED
rc = rtems_bdbuf_read(dd, block, &diskbuf);
400214a4: 2a1a03e1 mov w1, w26 <== NOT EXECUTED
400214a8: 910163e2 add x2, sp, #0x58 <== NOT EXECUTED
400214ac: aa1803e0 mov x0, x24 <== NOT EXECUTED
if ((blkofs == 0) && (count >= block_size))
400214b0: 7a5402e2 ccmp w23, w20, #0x2, eq // eq = none <== NOT EXECUTED
400214b4: 54fffca9 b.ls 40021448 <rtems_blkdev_generic_write+0x48> // b.plast<== NOT EXECUTED
rc = rtems_bdbuf_read(dd, block, &diskbuf);
400214b8: 94002a0a bl 4002bce0 <rtems_bdbuf_read> <== NOT EXECUTED
copy = block_size - blkofs;
400214bc: 4b1302e3 sub w3, w23, w19 <== NOT EXECUTED
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
400214c0: aa1503e1 mov x1, x21 <== NOT EXECUTED
400214c4: 6b14007f cmp w3, w20 <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
400214c8: 34fffca0 cbz w0, 4002145c <rtems_blkdev_generic_write+0x5c> <== NOT EXECUTED
}
return rc;
}
400214cc: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
400214d0: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
400214d4: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
400214d8: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
400214dc: a8c67bfd ldp x29, x30, [sp], #96 <== NOT EXECUTED
400214e0: d65f03c0 ret <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
400214e4: 52800000 mov w0, #0x0 // #0 <== NOT EXECUTED
}
400214e8: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
400214ec: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
400214f0: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
400214f4: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
400214f8: a8c67bfd ldp x29, x30, [sp], #96 <== NOT EXECUTED
400214fc: d65f03c0 ret <== NOT EXECUTED
000000004002f0b0 <rtems_blkdev_ioctl>:
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
switch (req)
4002f0b0: 52884064 mov w4, #0x4203 // #16899
4002f0b4: 72a80084 movk w4, #0x4004, lsl #16
{
4002f0b8: aa0003e3 mov x3, x0
switch (req)
4002f0bc: 6b04003f cmp w1, w4
4002f0c0: 54000940 b.eq 4002f1e8 <rtems_blkdev_ioctl+0x138> // b.none
{
4002f0c4: a9bf7bfd stp x29, x30, [sp, #-16]!
4002f0c8: 910003fd mov x29, sp
switch (req)
4002f0cc: 54000229 b.ls 4002f110 <rtems_blkdev_ioctl+0x60> // b.plast
4002f0d0: 52884164 mov w4, #0x420b // #16907
4002f0d4: 72a80104 movk w4, #0x4008, lsl #16
4002f0d8: 6b04003f cmp w1, w4
4002f0dc: 540008e0 b.eq 4002f1f8 <rtems_blkdev_ioctl+0x148> // b.none
4002f0e0: 540004a9 b.ls 4002f174 <rtems_blkdev_ioctl+0xc4> // b.plast
4002f0e4: 52884083 mov w3, #0x4204 // #16900
4002f0e8: 72b00083 movk w3, #0x8004, lsl #16
4002f0ec: 6b03003f cmp w1, w3
4002f0f0: 540008c1 b.ne 4002f208 <rtems_blkdev_ioctl+0x158> // b.any <== NEVER TAKEN
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
break;
case RTEMS_BLKIO_SETBLKSIZE:
sc = rtems_bdbuf_set_block_size(dd, *(uint32_t *) argp, true);
4002f0f4: b9400041 ldr w1, [x2]
4002f0f8: 52800022 mov w2, #0x1 // #1
4002f0fc: 97ffff75 bl 4002eed0 <rtems_bdbuf_set_block_size>
if (sc != RTEMS_SUCCESSFUL) {
4002f100: 350005e0 cbnz w0, 4002f1bc <rtems_blkdev_ioctl+0x10c> <== NEVER TAKEN
int rc = 0;
4002f104: 52800000 mov w0, #0x0 // #0
rc = -1;
break;
}
return rc;
}
4002f108: a8c17bfd ldp x29, x30, [sp], #16
4002f10c: d65f03c0 ret
switch (req)
4002f110: 52884184 mov w4, #0x420c // #16908
4002f114: 72a40004 movk w4, #0x2000, lsl #16
4002f118: 6b04003f cmp w1, w4
4002f11c: 54000440 b.eq 4002f1a4 <rtems_blkdev_ioctl+0xf4> // b.none
4002f120: 54000149 b.ls 4002f148 <rtems_blkdev_ioctl+0x98> // b.plast
4002f124: 52884040 mov w0, #0x4202 // #16898
4002f128: 72a80080 movk w0, #0x4004, lsl #16
4002f12c: 6b00003f cmp w1, w0
4002f130: 540006c1 b.ne 4002f208 <rtems_blkdev_ioctl+0x158> // b.any <== NEVER TAKEN
*(uint32_t *) argp = dd->media_block_size;
4002f134: b9402c61 ldr w1, [x3, #44]
int rc = 0;
4002f138: 52800000 mov w0, #0x0 // #0
*(uint32_t *) argp = dd->media_block_size;
4002f13c: b9000041 str w1, [x2]
}
4002f140: a8c17bfd ldp x29, x30, [sp], #16
4002f144: d65f03c0 ret
switch (req)
4002f148: 528840c2 mov w2, #0x4206 // #16902
4002f14c: 72a40002 movk w2, #0x2000, lsl #16
4002f150: 6b02003f cmp w1, w2
4002f154: 54000300 b.eq 4002f1b4 <rtems_blkdev_ioctl+0x104> // b.none
4002f158: 11001042 add w2, w2, #0x4
4002f15c: 6b02003f cmp w1, w2
4002f160: 54000541 b.ne 4002f208 <rtems_blkdev_ioctl+0x158> // b.any
rtems_bdbuf_purge_dev(dd);
4002f164: 97ffff4b bl 4002ee90 <rtems_bdbuf_purge_dev>
int rc = 0;
4002f168: 52800000 mov w0, #0x0 // #0
}
4002f16c: a8c17bfd ldp x29, x30, [sp], #16
4002f170: d65f03c0 ret
switch (req)
4002f174: 528840a0 mov w0, #0x4205 // #16901
4002f178: 72a80080 movk w0, #0x4004, lsl #16
4002f17c: 6b00003f cmp w1, w0
4002f180: 540002a0 b.eq 4002f1d4 <rtems_blkdev_ioctl+0x124> // b.none
4002f184: 52884120 mov w0, #0x4209 // #16905
4002f188: 72a80100 movk w0, #0x4008, lsl #16
4002f18c: 6b00003f cmp w1, w0
4002f190: 540003c1 b.ne 4002f208 <rtems_blkdev_ioctl+0x158> // b.any <== NEVER TAKEN
*(rtems_disk_device **) argp = dd;
4002f194: f9000043 str x3, [x2]
int rc = 0;
4002f198: 52800000 mov w0, #0x0 // #0
}
4002f19c: a8c17bfd ldp x29, x30, [sp], #16
4002f1a0: d65f03c0 ret
rtems_bdbuf_reset_device_stats(dd);
4002f1a4: 97ffffaf bl 4002f060 <rtems_bdbuf_reset_device_stats>
int rc = 0;
4002f1a8: 52800000 mov w0, #0x0 // #0
}
4002f1ac: a8c17bfd ldp x29, x30, [sp], #16
4002f1b0: d65f03c0 ret
sc = rtems_bdbuf_syncdev(dd);
4002f1b4: 97ffff0b bl 4002ede0 <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL) {
4002f1b8: 34fffa60 cbz w0, 4002f104 <rtems_blkdev_ioctl+0x54> <== ALWAYS TAKEN
errno = EIO;
4002f1bc: 940015b4 bl 4003488c <__errno> <== NOT EXECUTED
4002f1c0: aa0003e1 mov x1, x0 <== NOT EXECUTED
4002f1c4: 528000a2 mov w2, #0x5 // #5 <== NOT EXECUTED
rc = -1;
4002f1c8: 12800000 mov w0, #0xffffffff // #-1 <== NOT EXECUTED
errno = EIO;
4002f1cc: b9000022 str w2, [x1] <== NOT EXECUTED
rc = -1;
4002f1d0: 17ffffce b 4002f108 <rtems_blkdev_ioctl+0x58> <== NOT EXECUTED
*(rtems_blkdev_bnum *) argp = dd->size;
4002f1d4: b9402861 ldr w1, [x3, #40]
int rc = 0;
4002f1d8: 52800000 mov w0, #0x0 // #0
*(rtems_blkdev_bnum *) argp = dd->size;
4002f1dc: b9000041 str w1, [x2]
}
4002f1e0: a8c17bfd ldp x29, x30, [sp], #16
4002f1e4: d65f03c0 ret
*(uint32_t *) argp = dd->block_size;
4002f1e8: b9403061 ldr w1, [x3, #48]
int rc = 0;
4002f1ec: 52800000 mov w0, #0x0 // #0
*(uint32_t *) argp = dd->block_size;
4002f1f0: b9000041 str w1, [x2]
}
4002f1f4: d65f03c0 ret
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
4002f1f8: aa0203e1 mov x1, x2
4002f1fc: 97ffff85 bl 4002f010 <rtems_bdbuf_get_device_stats>
int rc = 0;
4002f200: 52800000 mov w0, #0x0 // #0
4002f204: 17ffffc1 b 4002f108 <rtems_blkdev_ioctl+0x58>
errno = EINVAL;
4002f208: 940015a1 bl 4003488c <__errno>
4002f20c: aa0003e1 mov x1, x0
4002f210: 528002c2 mov w2, #0x16 // #22
rc = -1;
4002f214: 12800000 mov w0, #0xffffffff // #-1
errno = EINVAL;
4002f218: b9000022 str w2, [x1]
}
4002f21c: a8c17bfd ldp x29, x30, [sp], #16
4002f220: d65f03c0 ret
...
0000000040021b10 <rtems_disk_create_log>:
{
40021b10: a9b97bfd stp x29, x30, [sp, #-112]!
40021b14: 910003fd mov x29, sp
40021b18: a9025bf5 stp x21, x22, [sp, #32]
_Mutex_Acquire( mutex );
40021b1c: f00006f5 adrp x21, 40100000 <_RTEMS_tasks_Information>
40021b20: 9103a2b5 add x21, x21, #0xe8
40021b24: a9046bf9 stp x25, x26, [sp, #64]
diskdevs_protected = true;
40021b28: d0000719 adrp x25, 40103000 <_Thread_Heads+0x8>
{
40021b2c: aa0003f6 mov x22, x0
40021b30: 2a0303fa mov w26, w3
40021b34: aa1503e0 mov x0, x21
40021b38: a90153f3 stp x19, x20, [sp, #16]
40021b3c: aa0103f3 mov x19, x1
40021b40: a90363f7 stp x23, x24, [sp, #48]
40021b44: 2a0203f7 mov w23, w2
diskdevs_protected = true;
40021b48: 52800038 mov w24, #0x1 // #1
{
40021b4c: f9002bfb str x27, [sp, #80]
40021b50: aa0403fb mov x27, x4
char *alloc_name = NULL;
40021b54: a9067fff stp xzr, xzr, [sp, #96]
40021b58: 94001552 bl 400270a0 <_Mutex_Acquire>
phys_dd = get_disk_entry(phys, true);
40021b5c: aa1303e0 mov x0, x19
40021b60: 2a1803e1 mov w1, w24
diskdevs_protected = true;
40021b64: 39208338 strb w24, [x25, #2080]
phys_dd = get_disk_entry(phys, true);
40021b68: 97fffe9a bl 400215d0 <get_disk_entry>
if (phys_dd == NULL) {
40021b6c: b4000560 cbz x0, 40021c18 <rtems_disk_create_log+0x108>
sc = create_disk(dev, name, &dd, &alloc_name);
40021b70: aa0003f4 mov x20, x0
40021b74: aa1b03e1 mov x1, x27
40021b78: 9101a3e3 add x3, sp, #0x68
40021b7c: 910183e2 add x2, sp, #0x60
40021b80: aa1603e0 mov x0, x22
40021b84: 97fffeb7 bl 40021660 <create_disk>
40021b88: 2a0003f3 mov w19, w0
if (sc != RTEMS_SUCCESSFUL) {
40021b8c: 350001c0 cbnz w0, 40021bc4 <rtems_disk_create_log+0xb4>
sc = rtems_disk_init_log(
40021b90: f94033e0 ldr x0, [sp, #96]
40021b94: 2a1703e2 mov w2, w23
40021b98: aa1403e1 mov x1, x20
40021b9c: 2a1a03e3 mov w3, w26
40021ba0: 94000114 bl 40021ff0 <rtems_disk_init_log>
40021ba4: 2a0003f3 mov w19, w0
++phys_dd->uses;
40021ba8: b9402280 ldr w0, [x20, #32]
dd->name = alloc_name;
40021bac: a9460be1 ldp x1, x2, [sp, #96]
dd->dev = dev;
40021bb0: f9000036 str x22, [x1]
dd->name = alloc_name;
40021bb4: f9000c22 str x2, [x1, #24]
++phys_dd->uses;
40021bb8: 11000400 add w0, w0, #0x1
40021bbc: b9002280 str w0, [x20, #32]
if (sc != RTEMS_SUCCESSFUL) {
40021bc0: 35000193 cbnz w19, 40021bf0 <rtems_disk_create_log+0xe0>
_Mutex_Release( mutex );
40021bc4: aa1503e0 mov x0, x21
diskdevs_protected = false;
40021bc8: 3920833f strb wzr, [x25, #2080]
40021bcc: 94001551 bl 40027110 <_Mutex_Release>
}
40021bd0: 2a1303e0 mov w0, w19
40021bd4: a94153f3 ldp x19, x20, [sp, #16]
40021bd8: a9425bf5 ldp x21, x22, [sp, #32]
40021bdc: a94363f7 ldp x23, x24, [sp, #48]
40021be0: a9446bf9 ldp x25, x26, [sp, #64]
40021be4: f9402bfb ldr x27, [sp, #80]
40021be8: a8c77bfd ldp x29, x30, [sp], #112
40021bec: d65f03c0 ret
dd->ioctl = null_handler;
40021bf0: 90000000 adrp x0, 40021000 <Init+0x700>
40021bf4: 91194000 add x0, x0, #0x650
40021bf8: f9002420 str x0, [x1, #72]
dd = get_disk_entry(dev, true);
40021bfc: aa1603e0 mov x0, x22
40021c00: 2a1803e1 mov w1, w24
40021c04: 97fffe73 bl 400215d0 <get_disk_entry>
if (dd == NULL) {
40021c08: b4fffde0 cbz x0, 40021bc4 <rtems_disk_create_log+0xb4> <== NEVER TAKEN
dd->deleted = true;
40021c0c: 39016018 strb w24, [x0, #88]
rtems_disk_cleanup(dd);
40021c10: 97ffff1c bl 40021880 <rtems_disk_cleanup.constprop.0>
return RTEMS_SUCCESSFUL;
40021c14: 17ffffec b 40021bc4 <rtems_disk_create_log+0xb4>
40021c18: aa1503e0 mov x0, x21
diskdevs_protected = false;
40021c1c: 3920833f strb wzr, [x25, #2080]
return RTEMS_INVALID_ID;
40021c20: 52800093 mov w19, #0x4 // #4
40021c24: 9400153b bl 40027110 <_Mutex_Release>
}
40021c28: 2a1303e0 mov w0, w19
40021c2c: a94153f3 ldp x19, x20, [sp, #16]
40021c30: a9425bf5 ldp x21, x22, [sp, #32]
40021c34: a94363f7 ldp x23, x24, [sp, #48]
40021c38: a9446bf9 ldp x25, x26, [sp, #64]
40021c3c: f9402bfb ldr x27, [sp, #80]
40021c40: a8c77bfd ldp x29, x30, [sp], #112
40021c44: d65f03c0 ret
...
0000000040021a00 <rtems_disk_create_phys>:
{
40021a00: a9b97bfd stp x29, x30, [sp, #-112]!
40021a04: 910003fd mov x29, sp
40021a08: a90153f3 stp x19, x20, [sp, #16]
char *alloc_name = NULL;
40021a0c: a9067fff stp xzr, xzr, [sp, #96]
if (handler == NULL) {
40021a10: b4000723 cbz x3, 40021af4 <rtems_disk_create_phys+0xf4>
mutex->_Queue._name = name;
}
static __inline void rtems_mutex_lock( rtems_mutex *mutex )
{
_Mutex_Acquire( mutex );
40021a14: a9025bf5 stp x21, x22, [sp, #32]
40021a18: f00006f6 adrp x22, 40100000 <_RTEMS_tasks_Information>
40021a1c: 9103a2d6 add x22, x22, #0xe8
40021a20: a90363f7 stp x23, x24, [sp, #48]
diskdevs_protected = true;
40021a24: d0000718 adrp x24, 40103000 <_Thread_Heads+0x8>
40021a28: aa0503f3 mov x19, x5
40021a2c: aa0003f5 mov x21, x0
40021a30: 2a0103f7 mov w23, w1
40021a34: aa0303f4 mov x20, x3
40021a38: aa1603e0 mov x0, x22
40021a3c: a9046bf9 stp x25, x26, [sp, #64]
40021a40: 2a0203fa mov w26, w2
40021a44: 52800039 mov w25, #0x1 // #1
40021a48: f9002bfb str x27, [sp, #80]
40021a4c: aa0403fb mov x27, x4
40021a50: 94001594 bl 400270a0 <_Mutex_Acquire>
40021a54: 39208319 strb w25, [x24, #2080]
sc = create_disk(dev, name, &dd, &alloc_name);
40021a58: aa1303e1 mov x1, x19
40021a5c: 9101a3e3 add x3, sp, #0x68
40021a60: 910183e2 add x2, sp, #0x60
40021a64: aa1503e0 mov x0, x21
40021a68: 97fffefe bl 40021660 <create_disk>
40021a6c: 2a0003f3 mov w19, w0
if (sc != RTEMS_SUCCESSFUL) {
40021a70: 35000180 cbnz w0, 40021aa0 <rtems_disk_create_phys+0xa0>
sc = rtems_disk_init_phys(
40021a74: f94033e0 ldr x0, [sp, #96]
40021a78: 2a1703e1 mov w1, w23
40021a7c: aa1b03e4 mov x4, x27
40021a80: aa1403e3 mov x3, x20
40021a84: 2a1a03e2 mov w2, w26
40021a88: 94000132 bl 40021f50 <rtems_disk_init_phys>
40021a8c: 2a0003f3 mov w19, w0
dd->name = alloc_name;
40021a90: a94603e1 ldp x1, x0, [sp, #96]
dd->dev = dev;
40021a94: f9000035 str x21, [x1]
dd->name = alloc_name;
40021a98: f9000c20 str x0, [x1, #24]
if (sc != RTEMS_SUCCESSFUL) {
40021a9c: 35000193 cbnz w19, 40021acc <rtems_disk_create_phys+0xcc>
}
static __inline void rtems_mutex_unlock( rtems_mutex *mutex )
{
_Mutex_Release( mutex );
40021aa0: aa1603e0 mov x0, x22
diskdevs_protected = false;
40021aa4: 3920831f strb wzr, [x24, #2080]
40021aa8: 9400159a bl 40027110 <_Mutex_Release>
}
40021aac: 2a1303e0 mov w0, w19
40021ab0: a94153f3 ldp x19, x20, [sp, #16]
return RTEMS_SUCCESSFUL;
40021ab4: a9425bf5 ldp x21, x22, [sp, #32]
40021ab8: a94363f7 ldp x23, x24, [sp, #48]
40021abc: a9446bf9 ldp x25, x26, [sp, #64]
40021ac0: f9402bfb ldr x27, [sp, #80]
}
40021ac4: a8c77bfd ldp x29, x30, [sp], #112
40021ac8: d65f03c0 ret
dd->ioctl = null_handler;
40021acc: 90000000 adrp x0, 40021000 <Init+0x700>
40021ad0: 91194000 add x0, x0, #0x650
40021ad4: f9002420 str x0, [x1, #72]
static rtems_status_code
disk_delete_locked(dev_t dev)
{
rtems_disk_device *dd = NULL;
dd = get_disk_entry(dev, true);
40021ad8: aa1503e0 mov x0, x21
40021adc: 2a1903e1 mov w1, w25
40021ae0: 97fffebc bl 400215d0 <get_disk_entry>
if (dd == NULL) {
40021ae4: b4fffde0 cbz x0, 40021aa0 <rtems_disk_create_phys+0xa0> <== NEVER TAKEN
return RTEMS_INVALID_ID;
}
dd->deleted = true;
40021ae8: 39016019 strb w25, [x0, #88]
rtems_disk_cleanup(dd);
40021aec: 97ffff65 bl 40021880 <rtems_disk_cleanup.constprop.0>
return RTEMS_SUCCESSFUL;
40021af0: 17ffffec b 40021aa0 <rtems_disk_create_phys+0xa0>
return RTEMS_INVALID_ADDRESS;
40021af4: 52800133 mov w19, #0x9 // #9
}
40021af8: 2a1303e0 mov w0, w19
40021afc: a94153f3 ldp x19, x20, [sp, #16]
40021b00: a8c77bfd ldp x29, x30, [sp], #112
40021b04: d65f03c0 ret
...
0000000040021c50 <rtems_disk_delete>:
}
rtems_status_code
rtems_disk_delete(dev_t dev)
{
40021c50: a9bd7bfd stp x29, x30, [sp, #-48]!
40021c54: 910003fd mov x29, sp
40021c58: a90153f3 stp x19, x20, [sp, #16]
_Mutex_Acquire( mutex );
40021c5c: f00006f3 adrp x19, 40100000 <_RTEMS_tasks_Information>
40021c60: 9103a273 add x19, x19, #0xe8
40021c64: f90013f5 str x21, [sp, #32]
diskdevs_protected = true;
40021c68: d0000715 adrp x21, 40103000 <_Thread_Heads+0x8>
{
40021c6c: aa0003f4 mov x20, x0
40021c70: aa1303e0 mov x0, x19
40021c74: 9400150b bl 400270a0 <_Mutex_Acquire>
diskdevs_protected = true;
40021c78: 52800025 mov w5, #0x1 // #1
dd = get_disk_entry(dev, true);
40021c7c: aa1403e0 mov x0, x20
40021c80: 2a0503e1 mov w1, w5
diskdevs_protected = true;
40021c84: 392082a5 strb w5, [x21, #2080]
dd = get_disk_entry(dev, true);
40021c88: 97fffe52 bl 400215d0 <get_disk_entry>
if (dd == NULL) {
40021c8c: b4000180 cbz x0, 40021cbc <rtems_disk_delete+0x6c> <== NEVER TAKEN
dd->deleted = true;
40021c90: 39016005 strb w5, [x0, #88]
return RTEMS_SUCCESSFUL;
40021c94: 52800014 mov w20, #0x0 // #0
rtems_disk_cleanup(dd);
40021c98: 97fffefa bl 40021880 <rtems_disk_cleanup.constprop.0>
diskdevs_protected = false;
40021c9c: 392082bf strb wzr, [x21, #2080]
_Mutex_Release( mutex );
40021ca0: aa1303e0 mov x0, x19
40021ca4: 9400151b bl 40027110 <_Mutex_Release>
disk_lock();
sc = disk_delete_locked(dev);
disk_unlock();
return sc;
}
40021ca8: 2a1403e0 mov w0, w20
40021cac: a94153f3 ldp x19, x20, [sp, #16]
40021cb0: f94013f5 ldr x21, [sp, #32]
40021cb4: a8c37bfd ldp x29, x30, [sp], #48
40021cb8: d65f03c0 ret
40021cbc: aa1303e0 mov x0, x19 <== NOT EXECUTED
return RTEMS_INVALID_ID;
40021cc0: 52800094 mov w20, #0x4 // #4 <== NOT EXECUTED
diskdevs_protected = false;
40021cc4: 392082bf strb wzr, [x21, #2080] <== NOT EXECUTED
40021cc8: 94001512 bl 40027110 <_Mutex_Release> <== NOT EXECUTED
}
40021ccc: 2a1403e0 mov w0, w20 <== NOT EXECUTED
40021cd0: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021cd4: f94013f5 ldr x21, [sp, #32] <== NOT EXECUTED
40021cd8: a8c37bfd ldp x29, x30, [sp], #48 <== NOT EXECUTED
40021cdc: d65f03c0 ret <== NOT EXECUTED
0000000040021ea0 <rtems_disk_io_done>:
rtems_status_code
rtems_disk_io_done(void)
{
40021ea0: a9bc7bfd stp x29, x30, [sp, #-64]!
40021ea4: 910003fd mov x29, sp
40021ea8: a90363f7 stp x23, x24, [sp, #48]
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
for (major = 0; major < disktab_size; ++major) {
40021eac: d0000718 adrp x24, 40103000 <_Thread_Heads+0x8>
40021eb0: b9483300 ldr w0, [x24, #2096]
{
40021eb4: a90153f3 stp x19, x20, [sp, #16]
40021eb8: a9025bf5 stp x21, x22, [sp, #32]
rtems_disk_device_table *dtab = disktab + major;
40021ebc: d0000716 adrp x22, 40103000 <_Thread_Heads+0x8>
40021ec0: f94416d3 ldr x19, [x22, #2088]
for (major = 0; major < disktab_size; ++major) {
40021ec4: 34000300 cbz w0, 40021f24 <rtems_disk_io_done+0x84> <== NEVER TAKEN
40021ec8: 9120c317 add x23, x24, #0x830
40021ecc: 52800015 mov w21, #0x0 // #0
rtems_disk_device_table *dtab = disktab + major;
40021ed0: d37c7ea0 ubfiz x0, x21, #4, #32
40021ed4: 8b000274 add x20, x19, x0
for (minor = 0; minor < dtab->size; ++minor) {
rtems_disk_device *dd = dtab->minor [minor];
40021ed8: f8606a61 ldr x1, [x19, x0]
for (minor = 0; minor < dtab->size; ++minor) {
40021edc: b9400a82 ldr w2, [x20, #8]
40021ee0: 34000162 cbz w2, 40021f0c <rtems_disk_io_done+0x6c>
40021ee4: 52800013 mov w19, #0x0 // #0
rtems_disk_device *dd = dtab->minor [minor];
40021ee8: f8735820 ldr x0, [x1, w19, uxtw #3]
for (minor = 0; minor < dtab->size; ++minor) {
40021eec: 11000673 add w19, w19, #0x1
if (dd != NULL) {
40021ef0: b4000080 cbz x0, 40021f00 <rtems_disk_io_done+0x60> <== ALWAYS TAKEN
free_disk_device(dd);
40021ef4: 97fffe4b bl 40021820 <free_disk_device> <== NOT EXECUTED
40021ef8: b9400a82 ldr w2, [x20, #8] <== NOT EXECUTED
}
}
free(dtab->minor);
40021efc: f9400281 ldr x1, [x20] <== NOT EXECUTED
for (minor = 0; minor < dtab->size; ++minor) {
40021f00: 6b13005f cmp w2, w19
40021f04: 54ffff28 b.hi 40021ee8 <rtems_disk_io_done+0x48> // b.pmore
}
free(disktab);
40021f08: f94416d3 ldr x19, [x22, #2088]
free(dtab->minor);
40021f0c: aa0103e0 mov x0, x1
40021f10: 94000198 bl 40022570 <free>
for (major = 0; major < disktab_size; ++major) {
40021f14: 110006b5 add w21, w21, #0x1
40021f18: b94002e0 ldr w0, [x23]
40021f1c: 6b15001f cmp w0, w21
40021f20: 54fffd88 b.hi 40021ed0 <rtems_disk_io_done+0x30> // b.pmore
free(disktab);
40021f24: aa1303e0 mov x0, x19
40021f28: 94000192 bl 40022570 <free>
disktab = NULL;
disktab_size = 0;
return RTEMS_SUCCESSFUL;
}
40021f2c: 52800000 mov w0, #0x0 // #0
disktab = NULL;
40021f30: f90416df str xzr, [x22, #2088]
disktab_size = 0;
40021f34: b908331f str wzr, [x24, #2096]
}
40021f38: a94153f3 ldp x19, x20, [sp, #16]
40021f3c: a9425bf5 ldp x21, x22, [sp, #32]
40021f40: a94363f7 ldp x23, x24, [sp, #48]
40021f44: a8c47bfd ldp x29, x30, [sp], #64
40021f48: d65f03c0 ret
40021f4c: 00000000 udf #0
0000000040021e20 <rtems_disk_io_initialize>:
}
}
rtems_status_code
rtems_disk_io_initialize(void)
{
40021e20: a9be7bfd stp x29, x30, [sp, #-32]!
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
40021e24: 52800000 mov w0, #0x0 // #0
{
40021e28: 910003fd mov x29, sp
40021e2c: a90153f3 stp x19, x20, [sp, #16]
if (disktab_size > 0) {
40021e30: d0000713 adrp x19, 40103000 <_Thread_Heads+0x8>
40021e34: b9483261 ldr w1, [x19, #2096]
40021e38: 34000081 cbz w1, 40021e48 <rtems_disk_io_initialize+0x28> <== ALWAYS TAKEN
}
disktab_size = size;
return RTEMS_SUCCESSFUL;
}
40021e3c: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021e40: a8c27bfd ldp x29, x30, [sp], #32 <== NOT EXECUTED
40021e44: d65f03c0 ret <== NOT EXECUTED
disktab = calloc(size, sizeof(rtems_disk_device_table));
40021e48: d0000714 adrp x20, 40103000 <_Thread_Heads+0x8>
40021e4c: d2800201 mov x1, #0x10 // #16
40021e50: d2800100 mov x0, #0x8 // #8
40021e54: 94000143 bl 40022360 <calloc>
40021e58: f9041680 str x0, [x20, #2088]
if (disktab == NULL) {
40021e5c: b4000180 cbz x0, 40021e8c <rtems_disk_io_initialize+0x6c> <== NEVER TAKEN
sc = rtems_bdbuf_init();
40021e60: 94002748 bl 4002bb80 <rtems_bdbuf_init>
if (sc != RTEMS_SUCCESSFUL) {
40021e64: 350000c0 cbnz w0, 40021e7c <rtems_disk_io_initialize+0x5c> <== NEVER TAKEN
disktab_size = size;
40021e68: 52800101 mov w1, #0x8 // #8
40021e6c: b9083261 str w1, [x19, #2096]
}
40021e70: a94153f3 ldp x19, x20, [sp, #16]
40021e74: a8c27bfd ldp x29, x30, [sp], #32
40021e78: d65f03c0 ret
free(disktab);
40021e7c: f9441680 ldr x0, [x20, #2088] <== NOT EXECUTED
40021e80: 940001bc bl 40022570 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
40021e84: 528001a0 mov w0, #0xd // #13 <== NOT EXECUTED
40021e88: 17ffffed b 40021e3c <rtems_disk_io_initialize+0x1c> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40021e8c: 52800340 mov w0, #0x1a // #26 <== NOT EXECUTED
40021e90: 17ffffeb b 40021e3c <rtems_disk_io_initialize+0x1c> <== NOT EXECUTED
...
0000000040021ce0 <rtems_disk_obtain>:
rtems_disk_device *
rtems_disk_obtain(dev_t dev)
{
40021ce0: a9bd7bfd stp x29, x30, [sp, #-48]!
40021ce4: 910003fd mov x29, sp
40021ce8: a90153f3 stp x19, x20, [sp, #16]
#else
static inline uint64_t AArch64_interrupt_disable( void )
{
uint64_t level;
__asm__ volatile (
40021cec: d53b4225 mrs x5, daif
40021cf0: d50342df msr daifset, #0x2
rtems_disk_device *dd = NULL;
rtems_interrupt_lock_context lock_context;
rtems_interrupt_lock_acquire(&diskdevs_lock, &lock_context);
if (!diskdevs_protected) {
40021cf4: d0000714 adrp x20, 40103000 <_Thread_Heads+0x8>
40021cf8: 39608281 ldrb w1, [x20, #2080]
40021cfc: 72001c3f tst w1, #0xff
40021d00: 54000121 b.ne 40021d24 <rtems_disk_obtain+0x44> // b.any <== NEVER TAKEN
/* Frequent and quickest case */
dd = get_disk_entry(dev, false);
40021d04: 97fffe33 bl 400215d0 <get_disk_entry>
40021d08: aa0003f3 mov x19, x0
return level;
}
static inline void AArch64_interrupt_enable( uint64_t level )
{
__asm__ volatile (
40021d0c: 92407ca5 and x5, x5, #0xffffffff
40021d10: d51b4225 msr daif, x5
dd = get_disk_entry(dev, false);
disk_unlock();
}
return dd;
}
40021d14: aa1303e0 mov x0, x19
40021d18: a94153f3 ldp x19, x20, [sp, #16]
40021d1c: a8c37bfd ldp x29, x30, [sp], #48
40021d20: d65f03c0 ret
40021d24: aa0003f3 mov x19, x0 <== NOT EXECUTED
rtems_interrupt_lock_release(&diskdevs_lock, &lock_context);
40021d28: f90013f5 str x21, [sp, #32] <== NOT EXECUTED
40021d2c: 92407ca5 and x5, x5, #0xffffffff <== NOT EXECUTED
40021d30: d51b4225 msr daif, x5 <== NOT EXECUTED
_Mutex_Acquire( mutex );
40021d34: f00006f5 adrp x21, 40100000 <_RTEMS_tasks_Information> <== NOT EXECUTED
40021d38: 9103a2b5 add x21, x21, #0xe8 <== NOT EXECUTED
40021d3c: aa1503e0 mov x0, x21 <== NOT EXECUTED
40021d40: 940014d8 bl 400270a0 <_Mutex_Acquire> <== NOT EXECUTED
diskdevs_protected = true;
40021d44: 52800022 mov w2, #0x1 // #1 <== NOT EXECUTED
dd = get_disk_entry(dev, false);
40021d48: 52800001 mov w1, #0x0 // #0 <== NOT EXECUTED
diskdevs_protected = true;
40021d4c: 39208282 strb w2, [x20, #2080] <== NOT EXECUTED
dd = get_disk_entry(dev, false);
40021d50: aa1303e0 mov x0, x19 <== NOT EXECUTED
40021d54: 97fffe1f bl 400215d0 <get_disk_entry> <== NOT EXECUTED
diskdevs_protected = false;
40021d58: 3920829f strb wzr, [x20, #2080] <== NOT EXECUTED
dd = get_disk_entry(dev, false);
40021d5c: aa0003f3 mov x19, x0 <== NOT EXECUTED
_Mutex_Release( mutex );
40021d60: aa1503e0 mov x0, x21 <== NOT EXECUTED
40021d64: 940014eb bl 40027110 <_Mutex_Release> <== NOT EXECUTED
}
40021d68: aa1303e0 mov x0, x19 <== NOT EXECUTED
40021d6c: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021d70: f94013f5 ldr x21, [sp, #32] <== NOT EXECUTED
40021d74: a8c37bfd ldp x29, x30, [sp], #48 <== NOT EXECUTED
40021d78: d65f03c0 ret <== NOT EXECUTED
40021d7c: 00000000 udf #0
0000000040021d80 <rtems_disk_release>:
rtems_status_code
rtems_disk_release(rtems_disk_device *dd)
{
40021d80: a9bd7bfd stp x29, x30, [sp, #-48]!
40021d84: 910003fd mov x29, sp
40021d88: a90153f3 stp x19, x20, [sp, #16]
rtems_interrupt_lock_context lock_context;
dev_t dev = dd->dev;
40021d8c: f9400014 ldr x20, [x0]
__asm__ volatile (
40021d90: d53b4222 mrs x2, daif
40021d94: d50342df msr daifset, #0x2
unsigned uses = 0;
bool deleted = false;
rtems_interrupt_lock_acquire(&diskdevs_lock, &lock_context);
uses = --dd->uses;
40021d98: b9402001 ldr w1, [x0, #32]
deleted = dd->deleted;
40021d9c: 39416003 ldrb w3, [x0, #88]
uses = --dd->uses;
40021da0: 71000421 subs w1, w1, #0x1
40021da4: b9002001 str w1, [x0, #32]
__asm__ volatile (
40021da8: 92407c40 and x0, x2, #0xffffffff
40021dac: d51b4220 msr daif, x0
rtems_interrupt_lock_release(&diskdevs_lock, &lock_context);
if (uses == 0 && deleted) {
40021db0: 7a400864 ccmp w3, #0x0, #0x4, eq // eq = none
40021db4: 540000a1 b.ne 40021dc8 <rtems_disk_release+0x48> // b.any
rtems_disk_delete(dev);
}
return RTEMS_SUCCESSFUL;
}
40021db8: 52800000 mov w0, #0x0 // #0
40021dbc: a94153f3 ldp x19, x20, [sp, #16]
40021dc0: a8c37bfd ldp x29, x30, [sp], #48
40021dc4: d65f03c0 ret
_Mutex_Acquire( mutex );
40021dc8: f00006f3 adrp x19, 40100000 <_RTEMS_tasks_Information>
40021dcc: 9103a273 add x19, x19, #0xe8
40021dd0: f90013f5 str x21, [sp, #32]
diskdevs_protected = true;
40021dd4: d0000715 adrp x21, 40103000 <_Thread_Heads+0x8>
40021dd8: aa1303e0 mov x0, x19
40021ddc: 940014b1 bl 400270a0 <_Mutex_Acquire>
40021de0: 52800025 mov w5, #0x1 // #1
dd = get_disk_entry(dev, true);
40021de4: aa1403e0 mov x0, x20
40021de8: 2a0503e1 mov w1, w5
diskdevs_protected = true;
40021dec: 392082a5 strb w5, [x21, #2080]
dd = get_disk_entry(dev, true);
40021df0: 97fffdf8 bl 400215d0 <get_disk_entry>
if (dd == NULL) {
40021df4: b4000060 cbz x0, 40021e00 <rtems_disk_release+0x80> <== NEVER TAKEN
dd->deleted = true;
40021df8: 39016005 strb w5, [x0, #88]
rtems_disk_cleanup(dd);
40021dfc: 97fffea1 bl 40021880 <rtems_disk_cleanup.constprop.0>
_Mutex_Release( mutex );
40021e00: aa1303e0 mov x0, x19
diskdevs_protected = false;
40021e04: 392082bf strb wzr, [x21, #2080]
40021e08: 940014c2 bl 40027110 <_Mutex_Release>
}
40021e0c: 52800000 mov w0, #0x0 // #0
40021e10: a94153f3 ldp x19, x20, [sp, #16]
40021e14: f94013f5 ldr x21, [sp, #32]
40021e18: a8c37bfd ldp x29, x30, [sp], #48
40021e1c: d65f03c0 ret
00000000400245e0 <rtems_fdisk_initialize>:
*/
rtems_device_driver
rtems_fdisk_initialize (rtems_device_major_number major,
rtems_device_minor_number minor,
void* arg RTEMS_UNUSED)
{
400245e0: a9b87bfd stp x29, x30, [sp, #-128]!
400245e4: 910003fd mov x29, sp
400245e8: a90363f7 stp x23, x24, [sp, #48]
400245ec: 2a0003f8 mov w24, w0
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
400245f0: d2804000 mov x0, #0x200 // #512
{
400245f4: a90573fb stp x27, x28, [sp, #80]
400245f8: b90067f8 str w24, [sp, #100]
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
400245fc: 9400037d bl 400253f0 <malloc>
40024600: f0000761 adrp x1, 40113000 <flashdisk_data+0xf2a0>
40024604: f907a020 str x0, [x1, #3904]
if (!rtems_fdisk_crc16_factor)
40024608: b4001f60 cbz x0, 400249f4 <rtems_fdisk_initialize+0x414> <== NEVER TAKEN
4002460c: aa0003e6 mov x6, x0
40024610: d2800004 mov x4, #0x0 // #0
40024614: 128f7ee3 mov w3, #0xffff8408 // #-31736
40024618: a90153f3 stp x19, x20, [sp, #16]
4002461c: d503201f nop
uint16_t v = b;
40024620: 12003c80 and w0, w4, #0xffff
for (i = 8; i--;)
40024624: 5280011b mov w27, #0x8 // #8
v = v & 1 ? (v >> 1) ^ pattern : v >> 1;
40024628: 72000002 ands w2, w0, #0x1
4002462c: 53017c00 lsr w0, w0, #1
40024630: 4a030001 eor w1, w0, w3
40024634: 12003c21 and w1, w1, #0xffff
40024638: 1a810000 csel w0, w0, w1, eq // eq = none
for (i = 8; i--;)
4002463c: 7100077b subs w27, w27, #0x1
40024640: 54ffff41 b.ne 40024628 <rtems_fdisk_initialize+0x48> // b.any
rtems_fdisk_crc16_factor[b] = v & 0xffff;
40024644: 782478c0 strh w0, [x6, x4, lsl #1]
for (b = 0; b < 256; b++)
40024648: 91000484 add x4, x4, #0x1
4002464c: f104009f cmp x4, #0x100
40024650: 54fffe81 b.ne 40024620 <rtems_fdisk_initialize+0x40> // b.any
sc = rtems_fdisk_crc16_gen_factors (0x8408);
if (sc != RTEMS_SUCCESSFUL)
return sc;
fd = calloc (rtems_flashdisk_configuration_size, sizeof (*fd));
40024654: 900006e0 adrp x0, 40100000 <_IO_Driver_address_table>
40024658: b9411014 ldr w20, [x0, #272]
4002465c: d2801a01 mov x1, #0xd0 // #208
40024660: 2a1403e0 mov w0, w20
40024664: 94000127 bl 40024b00 <calloc>
40024668: aa0003f3 mov x19, x0
if (!fd)
4002466c: b4001c20 cbz x0, 400249f0 <rtems_fdisk_initialize+0x410> <== NEVER TAKEN
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++, fd++)
40024670: 34001e34 cbz w20, 40024a34 <rtems_fdisk_initialize+0x454> <== NEVER TAKEN
40024674: a9025bf5 stp x21, x22, [sp, #32]
const rtems_flashdisk_config* c = rtems_flashdisk_configuration;
40024678: d0000156 adrp x22, 4004e000 <_User_extensions_Initial_extensions+0x30>
4002467c: 910822d6 add x22, x22, #0x208
40024680: 52800194 mov w20, #0xc // #12
40024684: a9046bf9 stp x25, x26, [sp, #64]
static __inline void
_Mutex_Initialize_named(struct _Mutex_Control *_mutex, const char *_name)
{
struct _Mutex_Control _init = _MUTEX_NAMED_INITIALIZER(_name);
*_mutex = _init;
40024688: f0000159 adrp x25, 4004f000 <black_list.3+0x9d0>
4002468c: 9105a320 add x0, x25, #0x168
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++, fd++)
40024690: b90063ff str wzr, [sp, #96]
40024694: f90037e0 str x0, [sp, #104]
{
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
40024698: d28c85e4 mov x4, #0x642f // #25647
4002469c: f2aecca4 movk x4, #0x7665, lsl #16
400246a0: 52800c20 mov w0, #0x61 // #97
400246a4: f2ccc5e4 movk x4, #0x662f, lsl #32
400246a8: f2ec8c84 movk x4, #0x6464, lsl #48
uint32_t blocks = 0;
int ret;
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
400246ac: b94067e5 ldr w5, [sp, #100]
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
400246b0: 294066dc ldp w28, w25, [x22]
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
400246b4: f9003be4 str x4, [sp, #112]
fd->unavail_blocks = c->unavail_blocks;
400246b8: 294256c3 ldp w3, w21, [x22, #16]
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
400246bc: 7900f3e0 strh w0, [sp, #120]
fd->avail_compact_segs = c->avail_compact_segs;
400246c0: 294306c2 ldp w2, w1, [x22, #24]
fd->compact_segs = c->compact_segs;
400246c4: 29010a63 stp w3, w2, [x19, #8]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
400246c8: b94063e4 ldr w4, [sp, #96]
fd->info_level = c->info_level;
400246cc: b94022c0 ldr w0, [x22, #32]
fd->minor = minor;
400246d0: 29001265 stp w5, w4, [x19]
fd->block_size = c->block_size;
400246d4: 29027261 stp w1, w28, [x19, #16]
fd->unavail_blocks = c->unavail_blocks;
400246d8: b9002675 str w21, [x19, #36]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
400246dc: 3901e7e4 strb w4, [sp, #121]
fd->info_level = c->info_level;
400246e0: b900ca60 str w0, [x19, #200]
for (device = 0; device < c->device_count; device++)
400246e4: 34000459 cbz w25, 4002476c <rtems_fdisk_initialize+0x18c> <== NEVER TAKEN
400246e8: f94006c1 ldr x1, [x22, #8]
400246ec: 5100072b sub w11, w25, #0x1
400246f0: 52800300 mov w0, #0x18 // #24
uint32_t blocks = 0;
400246f4: 52800018 mov w24, #0x0 // #0
400246f8: 9100602a add x10, x1, #0x18
400246fc: 9ba0296b umaddl x11, w11, w0, x10
for (s = 0; s < dd->segment_count; s++)
40024700: b9400020 ldr w0, [x1]
40024704: 340002a0 cbz w0, 40024758 <rtems_fdisk_initialize+0x178> <== NEVER TAKEN
40024708: f9400424 ldr x4, [x1, #8]
4002470c: 51000400 sub w0, w0, #0x1
uint32_t count = 0;
40024710: 52800006 mov w6, #0x0 // #0
40024714: 91003083 add x3, x4, #0xc
40024718: 9bb40c08 umaddl x8, w0, w20, x3
4002471c: d503201f nop
return sd->size / page_size;
40024720: b9400880 ldr w0, [x4, #8]
for (s = 0; s < dd->segment_count; s++)
40024724: eb03011f cmp x8, x3
rtems_fdisk_page_desc_pages (sd, page_size)) * sd->count;
40024728: 79400087 ldrh w7, [x4]
for (s = 0; s < dd->segment_count; s++)
4002472c: aa0303e4 mov x4, x3
40024730: 91003063 add x3, x3, #0xc
return sd->size / page_size;
40024734: 1adc0800 udiv w0, w0, w28
uint32_t bytes = pages * sizeof (rtems_fdisk_page_desc);
40024738: 531d7001 lsl w1, w0, #3
(rtems_fdisk_pages_in_segment (sd, page_size) -
4002473c: 51000400 sub w0, w0, #0x1
return ((bytes - 1) / page_size) + 1;
40024740: 51000421 sub w1, w1, #0x1
40024744: 1adc0821 udiv w1, w1, w28
(rtems_fdisk_pages_in_segment (sd, page_size) -
40024748: 4b010000 sub w0, w0, w1
count +=
4002474c: 1b071806 madd w6, w0, w7, w6
for (s = 0; s < dd->segment_count; s++)
40024750: 54fffe81 b.ne 40024720 <rtems_fdisk_initialize+0x140> // b.any <== NEVER TAKEN
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
40024754: 0b060318 add w24, w24, w6
for (device = 0; device < c->device_count; device++)
40024758: eb0a017f cmp x11, x10
4002475c: aa0a03e1 mov x1, x10
40024760: 54000080 b.eq 40024770 <rtems_fdisk_initialize+0x190> // b.none <== ALWAYS TAKEN
40024764: 9100614a add x10, x10, #0x18 <== NOT EXECUTED
40024768: 17ffffe6 b 40024700 <rtems_fdisk_initialize+0x120> <== NOT EXECUTED
uint32_t blocks = 0;
4002476c: 52800018 mov w24, #0x0 // #0 <== NOT EXECUTED
c->block_size);
/*
* One copy buffer of a page size.
*/
fd->copy_buffer = malloc (c->block_size);
40024770: 2a1c03e0 mov w0, w28
40024774: 9400031f bl 400253f0 <malloc>
40024778: f9006260 str x0, [x19, #192]
if (!fd->copy_buffer)
4002477c: b4001560 cbz x0, 40024a28 <rtems_fdisk_initialize+0x448> <== NEVER TAKEN
return RTEMS_NO_MEMORY;
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
40024780: 2a1803e0 mov w0, w24
40024784: d2800201 mov x1, #0x10 // #16
40024788: 940000de bl 40024b00 <calloc>
4002478c: f9000e60 str x0, [x19, #24]
if (!fd->blocks)
40024790: b40014c0 cbz x0, 40024a28 <rtems_fdisk_initialize+0x448> <== NEVER TAKEN
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
40024794: 2a1903e0 mov w0, w25
40024798: d2800301 mov x1, #0x18 // #24
fd->block_count = blocks;
4002479c: b9002278 str w24, [x19, #32]
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
400247a0: 940000d8 bl 40024b00 <calloc>
400247a4: f9001a60 str x0, [x19, #48]
if (!fd->devices)
400247a8: b4001400 cbz x0, 40024a28 <rtems_fdisk_initialize+0x448> <== NEVER TAKEN
400247ac: f94037e5 ldr x5, [sp, #104]
return RTEMS_NO_MEMORY;
rtems_mutex_init (&fd->lock, "Flash Disk");
sc = rtems_blkdev_create(name, c->block_size, blocks - fd->unavail_blocks,
400247b0: 4b150302 sub w2, w24, w21
400247b4: 2a1c03e1 mov w1, w28
400247b8: 9101c3e0 add x0, sp, #0x70
400247bc: aa1303e4 mov x4, x19
400247c0: f0ffffe3 adrp x3, 40023000 <rtems_fdisk_recover_block_mappings>
400247c4: 910ec063 add x3, x3, #0x3b0
400247c8: 29147e7f stp wzr, wzr, [x19, #160]
400247cc: a90afe7f stp xzr, xzr, [x19, #168]
400247d0: f9005e65 str x5, [x19, #184]
400247d4: 940032f7 bl 400313b0 <rtems_blkdev_create>
400247d8: 2a0003f5 mov w21, w0
rtems_fdisk_ioctl, fd);
if (sc != RTEMS_SUCCESSFUL)
400247dc: 35000d00 cbnz w0, 4002497c <rtems_fdisk_initialize+0x39c> <== NEVER TAKEN
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
400247e0: b94006d5 ldr w21, [x22, #4]
400247e4: 34000755 cbz w21, 400248cc <rtems_fdisk_initialize+0x2ec> <== NEVER TAKEN
400247e8: f94006d9 ldr x25, [x22, #8]
400247ec: 5280001c mov w28, #0x0 // #0
400247f0: f9401a78 ldr x24, [x19, #48]
400247f4: d503201f nop
for (segment = 0; segment < dd->segment_count; segment++)
400247f8: b9400320 ldr w0, [x25]
400247fc: 340004e0 cbz w0, 40024898 <rtems_fdisk_initialize+0x2b8> <== NEVER TAKEN
40024800: f9400721 ldr x1, [x25, #8]
40024804: 51000417 sub w23, w0, #0x1
uint32_t count = 0;
40024808: 5280001a mov w26, #0x0 // #0
4002480c: 91003020 add x0, x1, #0xc
40024810: 9bb402e3 umaddl x3, w23, w20, x0
40024814: d503201f nop
count += dd->segments[segment].count;
40024818: 79400022 ldrh w2, [x1]
for (segment = 0; segment < dd->segment_count; segment++)
4002481c: eb00007f cmp x3, x0
40024820: aa0003e1 mov x1, x0
40024824: 91003000 add x0, x0, #0xc
count += dd->segments[segment].count;
40024828: 0b02035a add w26, w26, w2
for (segment = 0; segment < dd->segment_count; segment++)
4002482c: 54ffff61 b.ne 40024818 <rtems_fdisk_initialize+0x238> // b.any <== NEVER TAKEN
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
fd->devices[device].segments = calloc (segment_count,
40024830: 2a1a03e0 mov w0, w26
40024834: d2800801 mov x1, #0x40 // #64
40024838: 940000b2 bl 40024b00 <calloc>
4002483c: f9000300 str x0, [x24]
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
40024840: b4000de0 cbz x0, 400249fc <rtems_fdisk_initialize+0x41c> <== NEVER TAKEN
40024844: f9400723 ldr x3, [x25, #8]
40024848: 91003066 add x6, x3, #0xc
4002484c: 9bb41aea umaddl x10, w23, w20, x6
const rtems_fdisk_segment_desc* sd;
uint32_t seg_segment;
sd = &c->devices[device].segments[segment];
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
40024850: 79400064 ldrh w4, [x3]
40024854: 34000184 cbz w4, 40024884 <rtems_fdisk_initialize+0x2a4> <== NEVER TAKEN
40024858: aa0003e1 mov x1, x0
4002485c: 52800002 mov w2, #0x0 // #0
{
sc->descriptor = sd;
40024860: f9000423 str x3, [x1, #8]
sc->device = device;
sc->segment = seg_segment;
40024864: 2902083c stp w28, w2, [x1, #16]
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
40024868: 11000442 add w2, w2, #0x1
sc->erased = 0;
4002486c: b900383f str wzr, [x1, #56]
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
40024870: 6b04005f cmp w2, w4
40024874: 91010021 add x1, x1, #0x40
40024878: 54ffff41 b.ne 40024860 <rtems_fdisk_initialize+0x280> // b.any
4002487c: d37a7c42 ubfiz x2, x2, #6, #32
40024880: 8b020000 add x0, x0, x2
for (segment = 0; segment < c->devices[device].segment_count; segment++)
40024884: eb06015f cmp x10, x6
40024888: aa0603e3 mov x3, x6
4002488c: 54000120 b.eq 400248b0 <rtems_fdisk_initialize+0x2d0> // b.none <== ALWAYS TAKEN
40024890: 910030c6 add x6, x6, #0xc <== NOT EXECUTED
40024894: 17ffffef b 40024850 <rtems_fdisk_initialize+0x270> <== NOT EXECUTED
fd->devices[device].segments = calloc (segment_count,
40024898: d2800801 mov x1, #0x40 // #64 <== NOT EXECUTED
4002489c: d2800000 mov x0, #0x0 // #0 <== NOT EXECUTED
400248a0: 94000098 bl 40024b00 <calloc> <== NOT EXECUTED
400248a4: f9000300 str x0, [x24] <== NOT EXECUTED
if (!fd->devices[device].segments)
400248a8: b4000aa0 cbz x0, 400249fc <rtems_fdisk_initialize+0x41c> <== NOT EXECUTED
uint32_t count = 0;
400248ac: 5280001a mov w26, #0x0 // #0 <== NOT EXECUTED
}
}
fd->devices[device].segment_count = segment_count;
400248b0: b9000b1a str w26, [x24, #8]
for (device = 0; device < c->device_count; device++)
400248b4: 1100079c add w28, w28, #0x1
fd->devices[device].descriptor = &c->devices[device];
400248b8: f9000b19 str x25, [x24, #16]
for (device = 0; device < c->device_count; device++)
400248bc: 6b15039f cmp w28, w21
400248c0: 91006339 add x25, x25, #0x18
400248c4: 91006318 add x24, x24, #0x18
400248c8: 54fff981 b.ne 400247f8 <rtems_fdisk_initialize+0x218> // b.any <== NEVER TAKEN
}
fd->device_count = c->device_count;
ret = rtems_fdisk_recover_block_mappings (fd);
400248cc: aa1303e0 mov x0, x19
fd->device_count = c->device_count;
400248d0: b9003a75 str w21, [x19, #56]
ret = rtems_fdisk_recover_block_mappings (fd);
400248d4: 97fff9cb bl 40023000 <rtems_fdisk_recover_block_mappings>
400248d8: 2a0003fc mov w28, w0
if (ret)
400248dc: 35000660 cbnz w0, 400249a8 <rtems_fdisk_initialize+0x3c8> <== NEVER TAKEN
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
strerror (ret), ret);
return ret;
}
ret = rtems_fdisk_compact (fd);
400248e0: aa1303e0 mov x0, x19
400248e4: 97fff913 bl 40022d30 <rtems_fdisk_compact>
400248e8: 2a0003fc mov w28, w0
if (ret)
400248ec: 35000240 cbnz w0, 40024934 <rtems_fdisk_initialize+0x354> <== NEVER TAKEN
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++, fd++)
400248f0: b94063e1 ldr w1, [sp, #96]
400248f4: 900006e0 adrp x0, 40100000 <_IO_Driver_address_table>
400248f8: b9411000 ldr w0, [x0, #272]
400248fc: 9100a2d6 add x22, x22, #0x28
40024900: 11000421 add w1, w1, #0x1
40024904: b90063e1 str w1, [sp, #96]
40024908: 91034273 add x19, x19, #0xd0
4002490c: 6b01001f cmp w0, w1
40024910: 54ffec48 b.hi 40024698 <rtems_fdisk_initialize+0xb8> // b.pmore <== NEVER TAKEN
40024914: a94153f3 ldp x19, x20, [sp, #16]
40024918: a9425bf5 ldp x21, x22, [sp, #32]
4002491c: a9446bf9 ldp x25, x26, [sp, #64]
return ret;
}
}
return RTEMS_SUCCESSFUL;
}
40024920: 2a1b03e0 mov w0, w27
40024924: a94363f7 ldp x23, x24, [sp, #48]
40024928: a94573fb ldp x27, x28, [sp, #80]
4002492c: a8c87bfd ldp x29, x30, [sp], #128
40024930: d65f03c0 ret
unlink (name);
40024934: 9101c3e0 add x0, sp, #0x70 <== NOT EXECUTED
40024938: 94000a4a bl 40027260 <unlink> <== NOT EXECUTED
free (fd->copy_buffer);
4002493c: f9406260 ldr x0, [x19, #192] <== NOT EXECUTED
return ret;
40024940: 2a1c03f5 mov w21, w28 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40024944: 2a1503fb mov w27, w21 <== NOT EXECUTED
free (fd->copy_buffer);
40024948: 9400012e bl 40024e00 <free> <== NOT EXECUTED
free (fd->blocks);
4002494c: f9400e60 ldr x0, [x19, #24] <== NOT EXECUTED
40024950: 9400012c bl 40024e00 <free> <== NOT EXECUTED
free (fd->devices);
40024954: f9401a60 ldr x0, [x19, #48] <== NOT EXECUTED
40024958: 9400012a bl 40024e00 <free> <== NOT EXECUTED
rtems_fdisk_error ("compacting of disk failed: %s (%d)",
4002495c: 2a1c03e0 mov w0, w28 <== NOT EXECUTED
40024960: 940073e5 bl 400418f4 <strerror> <== NOT EXECUTED
40024964: 2a1c03e2 mov w2, w28 <== NOT EXECUTED
40024968: aa0003e1 mov x1, x0 <== NOT EXECUTED
4002496c: f0000140 adrp x0, 4004f000 <black_list.3+0x9d0> <== NOT EXECUTED
40024970: 9106e000 add x0, x0, #0x1b8 <== NOT EXECUTED
40024974: 97fff5bb bl 40022060 <rtems_fdisk_error> <== NOT EXECUTED
return ret;
40024978: 17ffffe7 b 40024914 <rtems_fdisk_initialize+0x334> <== NOT EXECUTED
free (fd->copy_buffer);
4002497c: f9406260 ldr x0, [x19, #192] <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40024980: 2a1503fb mov w27, w21 <== NOT EXECUTED
free (fd->copy_buffer);
40024984: 9400011f bl 40024e00 <free> <== NOT EXECUTED
free (fd->blocks);
40024988: f9400e60 ldr x0, [x19, #24] <== NOT EXECUTED
4002498c: 9400011d bl 40024e00 <free> <== NOT EXECUTED
free (fd->devices);
40024990: f9401a60 ldr x0, [x19, #48] <== NOT EXECUTED
40024994: 9400011b bl 40024e00 <free> <== NOT EXECUTED
rtems_fdisk_error ("disk create phy failed");
40024998: f0000140 adrp x0, 4004f000 <black_list.3+0x9d0> <== NOT EXECUTED
4002499c: 9105e000 add x0, x0, #0x178 <== NOT EXECUTED
400249a0: 97fff5b0 bl 40022060 <rtems_fdisk_error> <== NOT EXECUTED
return sc;
400249a4: 17ffffdc b 40024914 <rtems_fdisk_initialize+0x334> <== NOT EXECUTED
unlink (name);
400249a8: 9101c3e0 add x0, sp, #0x70 <== NOT EXECUTED
400249ac: 94000a2d bl 40027260 <unlink> <== NOT EXECUTED
free (fd->copy_buffer);
400249b0: f9406260 ldr x0, [x19, #192] <== NOT EXECUTED
return ret;
400249b4: 2a1c03f5 mov w21, w28 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
400249b8: 2a1503fb mov w27, w21 <== NOT EXECUTED
free (fd->copy_buffer);
400249bc: 94000111 bl 40024e00 <free> <== NOT EXECUTED
free (fd->blocks);
400249c0: f9400e60 ldr x0, [x19, #24] <== NOT EXECUTED
400249c4: 9400010f bl 40024e00 <free> <== NOT EXECUTED
free (fd->devices);
400249c8: f9401a60 ldr x0, [x19, #48] <== NOT EXECUTED
400249cc: 9400010d bl 40024e00 <free> <== NOT EXECUTED
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
400249d0: 2a1c03e0 mov w0, w28 <== NOT EXECUTED
400249d4: 940073c8 bl 400418f4 <strerror> <== NOT EXECUTED
400249d8: 2a1c03e2 mov w2, w28 <== NOT EXECUTED
400249dc: aa0003e1 mov x1, x0 <== NOT EXECUTED
400249e0: f0000140 adrp x0, 4004f000 <black_list.3+0x9d0> <== NOT EXECUTED
400249e4: 91064000 add x0, x0, #0x190 <== NOT EXECUTED
400249e8: 97fff59e bl 40022060 <rtems_fdisk_error> <== NOT EXECUTED
return ret;
400249ec: 17ffffca b 40024914 <rtems_fdisk_initialize+0x334> <== NOT EXECUTED
400249f0: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
return RTEMS_NO_MEMORY;
400249f4: 5280035b mov w27, #0x1a // #26 <== NOT EXECUTED
400249f8: 17ffffca b 40024920 <rtems_fdisk_initialize+0x340> <== NOT EXECUTED
unlink (name);
400249fc: 9101c3e0 add x0, sp, #0x70 <== NOT EXECUTED
40024a00: 94000a18 bl 40027260 <unlink> <== NOT EXECUTED
free (fd->copy_buffer);
40024a04: f9406260 ldr x0, [x19, #192] <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40024a08: 52800355 mov w21, #0x1a // #26 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40024a0c: 2a1503fb mov w27, w21 <== NOT EXECUTED
free (fd->copy_buffer);
40024a10: 940000fc bl 40024e00 <free> <== NOT EXECUTED
free (fd->blocks);
40024a14: f9400e60 ldr x0, [x19, #24] <== NOT EXECUTED
40024a18: 940000fa bl 40024e00 <free> <== NOT EXECUTED
free (fd->devices);
40024a1c: f9401a60 ldr x0, [x19, #48] <== NOT EXECUTED
40024a20: 940000f8 bl 40024e00 <free> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40024a24: 17ffffbc b 40024914 <rtems_fdisk_initialize+0x334> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40024a28: 52800355 mov w21, #0x1a // #26 <== NOT EXECUTED
40024a2c: 2a1503fb mov w27, w21 <== NOT EXECUTED
40024a30: 17ffffb9 b 40024914 <rtems_fdisk_initialize+0x334> <== NOT EXECUTED
40024a34: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40024a38: 17ffffba b 40024920 <rtems_fdisk_initialize+0x340> <== NOT EXECUTED
40024a3c: 00000000 udf #0
0000000040022dd0 <rtems_ide_part_table_initialize>:
* RTEMS_NO_MEMOTY if cannot have not enough memory,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
rtems_status_code
rtems_ide_part_table_initialize(const char *dev_name)
{
40022dd0: a9b97bfd stp x29, x30, [sp, #-112]!
rtems_part_desc_t *part_desc;
/* logical device name /dev/hdxyy */
char name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
disk_desc = (rtems_disk_desc_t *) calloc(1, sizeof(rtems_disk_desc_t));
40022dd4: d2804301 mov x1, #0x218 // #536
{
40022dd8: 910003fd mov x29, sp
40022ddc: a9025bf5 stp x21, x22, [sp, #32]
40022de0: aa0003f6 mov x22, x0
disk_desc = (rtems_disk_desc_t *) calloc(1, sizeof(rtems_disk_desc_t));
40022de4: d2800020 mov x0, #0x1 // #1
{
40022de8: a9046bf9 stp x25, x26, [sp, #64]
disk_desc = (rtems_disk_desc_t *) calloc(1, sizeof(rtems_disk_desc_t));
40022dec: 94000125 bl 40023280 <calloc>
if (disk_desc == NULL)
40022df0: b4000ac0 cbz x0, 40022f48 <rtems_ide_part_table_initialize+0x178> <== NEVER TAKEN
{
return RTEMS_NO_MEMORY;
}
/* get partition table */
rc = partition_table_get(dev_name, disk_desc);
40022df4: aa0003e1 mov x1, x0
40022df8: a90363f7 stp x23, x24, [sp, #48]
40022dfc: aa0003f8 mov x24, x0
40022e00: aa1603e0 mov x0, x22
40022e04: 97fffeb7 bl 400228e0 <partition_table_get>
40022e08: 2a0003fa mov w26, w0
if (rc != RTEMS_SUCCESSFUL)
40022e0c: 350008e0 cbnz w0, 40022f28 <rtems_ide_part_table_initialize+0x158> <== NEVER TAKEN
free(disk_desc);
return rc;
}
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
40022e10: b9401f00 ldr w0, [x24, #28]
40022e14: 91008317 add x23, x24, #0x20
40022e18: a90153f3 stp x19, x20, [sp, #16]
40022e1c: 7100001f cmp w0, #0x0
40022e20: 540004ed b.le 40022ebc <rtems_ide_part_table_initialize+0xec> <== NEVER TAKEN
40022e24: 91008317 add x23, x24, #0x20
40022e28: 90000119 adrp x25, 40042000 <test_state_strings+0x50>
40022e2c: 91090339 add x25, x25, #0x240
40022e30: aa1703f4 mov x20, x23
40022e34: 52800013 mov w19, #0x0 // #0
40022e38: f9002bfb str x27, [sp, #80]
rc = rtems_blkdev_create_partition(name, dev_name, part_desc->start,
part_desc->size);
if (rc != RTEMS_SUCCESSFUL)
{
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
40022e3c: 9000011b adrp x27, 40042000 <test_state_strings+0x50>
40022e40: 9109237b add x27, x27, #0x248
40022e44: 14000004 b 40022e54 <rtems_ide_part_table_initialize+0x84>
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
40022e48: b9401f00 ldr w0, [x24, #28]
40022e4c: 6b00027f cmp w19, w0
40022e50: 5400034a b.ge 40022eb8 <rtems_ide_part_table_initialize+0xe8> // b.tcont
sprintf(name, "%s%d", dev_name, part_num + 1);
40022e54: 11000673 add w19, w19, #0x1
40022e58: aa1903e1 mov x1, x25
40022e5c: 2a1303e3 mov w3, w19
40022e60: aa1603e2 mov x2, x22
40022e64: 910183e0 add x0, sp, #0x60
40022e68: 94004931 bl 4003532c <sprintf>
part_desc = disk_desc->partitions[part_num];
40022e6c: f9400283 ldr x3, [x20]
rc = rtems_blkdev_create_partition(name, dev_name, part_desc->start,
40022e70: aa1603e1 mov x1, x22
40022e74: 910183e0 add x0, sp, #0x60
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
40022e78: 91002294 add x20, x20, #0x8
if (part_desc == NULL)
40022e7c: b4fffe63 cbz x3, 40022e48 <rtems_ide_part_table_initialize+0x78>
rc = rtems_blkdev_create_partition(name, dev_name, part_desc->start,
40022e80: 29408c62 ldp w2, w3, [x3, #4]
40022e84: 97fffd5f bl 40022400 <rtems_blkdev_create_partition>
40022e88: 2a0003f5 mov w21, w0
if (rc != RTEMS_SUCCESSFUL)
40022e8c: 34fffde0 cbz w0, 40022e48 <rtems_ide_part_table_initialize+0x78> <== ALWAYS TAKEN
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
40022e90: 97fff7cc bl 40020dc0 <__getreent> <== NOT EXECUTED
40022e94: f9400800 ldr x0, [x0, #16] <== NOT EXECUTED
40022e98: 2a1503e3 mov w3, w21 <== NOT EXECUTED
40022e9c: 910183e2 add x2, sp, #0x60 <== NOT EXECUTED
40022ea0: aa1b03e1 mov x1, x27 <== NOT EXECUTED
40022ea4: 94004769 bl 40034c48 <fprintf> <== NOT EXECUTED
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
40022ea8: b9401f00 ldr w0, [x24, #28] <== NOT EXECUTED
40022eac: 6b00027f cmp w19, w0 <== NOT EXECUTED
40022eb0: 54fffd2b b.lt 40022e54 <rtems_ide_part_table_initialize+0x84> // b.tstop<== NOT EXECUTED
40022eb4: d503201f nop <== NOT EXECUTED
40022eb8: f9402bfb ldr x27, [sp, #80]
40022ebc: 91010316 add x22, x24, #0x40
partition_free(disk_desc->partitions[part_num]);
40022ec0: f94002f4 ldr x20, [x23]
if (part_desc == NULL)
40022ec4: b40001b4 cbz x20, 40022ef8 <rtems_ide_part_table_initialize+0x128>
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
40022ec8: 39400680 ldrb w0, [x20, #1]
if (is_extended(part_desc->sys_type))
40022ecc: 12001800 and w0, w0, #0x7f
40022ed0: 7100141f cmp w0, #0x5
40022ed4: 540000e1 b.ne 40022ef0 <rtems_ide_part_table_initialize+0x120> // b.any<== ALWAYS TAKEN
40022ed8: 91008293 add x19, x20, #0x20 <== NOT EXECUTED
40022edc: 91010295 add x21, x20, #0x40 <== NOT EXECUTED
partition_free(part_desc->sub_part[part_num]);
40022ee0: f8408660 ldr x0, [x19], #8 <== NOT EXECUTED
40022ee4: 97ffff07 bl 40022b00 <partition_free> <== NOT EXECUTED
for (part_num = 0;
40022ee8: eb15027f cmp x19, x21 <== NOT EXECUTED
40022eec: 54ffffa1 b.ne 40022ee0 <rtems_ide_part_table_initialize+0x110> // b.any<== NOT EXECUTED
free(part_desc);
40022ef0: aa1403e0 mov x0, x20
40022ef4: 9400016b bl 400234a0 <free>
for (part_num = 0;
40022ef8: 910022f7 add x23, x23, #0x8
40022efc: eb1602ff cmp x23, x22
40022f00: 54fffe01 b.ne 40022ec0 <rtems_ide_part_table_initialize+0xf0> // b.any
free(disk_desc);
40022f04: aa1803e0 mov x0, x24
40022f08: 94000166 bl 400234a0 <free>
}
40022f0c: a94153f3 ldp x19, x20, [sp, #16]
40022f10: a94363f7 ldp x23, x24, [sp, #48]
}
partition_table_free(disk_desc);
return RTEMS_SUCCESSFUL;
}
40022f14: 2a1a03e0 mov w0, w26
40022f18: a9425bf5 ldp x21, x22, [sp, #32]
40022f1c: a9446bf9 ldp x25, x26, [sp, #64]
40022f20: a8c77bfd ldp x29, x30, [sp], #112
40022f24: d65f03c0 ret
free(disk_desc);
40022f28: aa1803e0 mov x0, x24 <== NOT EXECUTED
40022f2c: 9400015d bl 400234a0 <free> <== NOT EXECUTED
}
40022f30: 2a1a03e0 mov w0, w26 <== NOT EXECUTED
40022f34: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
return rc;
40022f38: a94363f7 ldp x23, x24, [sp, #48] <== NOT EXECUTED
}
40022f3c: a9446bf9 ldp x25, x26, [sp, #64] <== NOT EXECUTED
40022f40: a8c77bfd ldp x29, x30, [sp], #112 <== NOT EXECUTED
40022f44: d65f03c0 ret <== NOT EXECUTED
return RTEMS_NO_MEMORY;
40022f48: 5280035a mov w26, #0x1a // #26 <== NOT EXECUTED
40022f4c: 17fffff2 b 40022f14 <rtems_ide_part_table_initialize+0x144> <== NOT EXECUTED
0000000040021ab0 <rtems_sparse_disk_create_and_register>:
{
40021ab0: a9bc7bfd stp x29, x30, [sp, #-64]!
40021ab4: 910003fd mov x29, sp
40021ab8: a90153f3 stp x19, x20, [sp, #16]
40021abc: 2a0103f4 mov w20, w1
size_t const alloc_size = sizeof( rtems_sparse_disk )
40021ac0: d2800a01 mov x1, #0x50 // #80
40021ac4: 8b225021 add x1, x1, w2, uxtw #4
{
40021ac8: 2a0203f3 mov w19, w2
size_t const data_size = blocks_with_buffer * media_block_size;
40021acc: 1b027e82 mul w2, w20, w2
{
40021ad0: a9025bf5 stp x21, x22, [sp, #32]
40021ad4: aa0003f5 mov x21, x0
40021ad8: 2a0303f6 mov w22, w3
rtems_sparse_disk *const sd = (rtems_sparse_disk *) malloc(
40021adc: 8b010040 add x0, x2, x1
{
40021ae0: f9001bf7 str x23, [sp, #48]
40021ae4: 12001c97 and w23, w4, #0xff
rtems_sparse_disk *const sd = (rtems_sparse_disk *) malloc(
40021ae8: 940001a6 bl 40022180 <malloc>
if ( sparse_disk != NULL ) {
40021aec: b40001c0 cbz x0, 40021b24 <rtems_sparse_disk_create_and_register+0x74> <== NEVER TAKEN
sc = rtems_sparse_disk_register(
40021af0: aa0003e1 mov x1, x0
40021af4: 2a1703e5 mov w5, w23
40021af8: 2a1603e4 mov w4, w22
40021afc: 2a1303e3 mov w3, w19
40021b00: 2a1403e2 mov w2, w20
40021b04: aa1503e0 mov x0, x21
}
40021b08: a94153f3 ldp x19, x20, [sp, #16]
sc = rtems_sparse_disk_register(
40021b0c: 90000006 adrp x6, 40021000 <Init+0x440>
40021b10: 911c00c6 add x6, x6, #0x700
}
40021b14: a9425bf5 ldp x21, x22, [sp, #32]
40021b18: f9401bf7 ldr x23, [sp, #48]
40021b1c: a8c47bfd ldp x29, x30, [sp], #64
sc = rtems_sparse_disk_register(
40021b20: 17ffffa0 b 400219a0 <rtems_sparse_disk_register>
}
40021b24: 52800340 mov w0, #0x1a // #26 <== NOT EXECUTED
40021b28: a94153f3 ldp x19, x20, [sp, #16] <== NOT EXECUTED
40021b2c: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40021b30: f9401bf7 ldr x23, [sp, #48] <== NOT EXECUTED
40021b34: a8c47bfd ldp x29, x30, [sp], #64 <== NOT EXECUTED
40021b38: d65f03c0 ret <== NOT EXECUTED
40021b3c: 00000000 udf #0
00000000400219a0 <rtems_sparse_disk_register>:
uint8_t fill_pattern,
rtems_sparse_disk_delete_handler sparse_disk_delete )
{
rtems_status_code sc;
if ( blocks_with_buffer <= media_block_count ) {
400219a0: 6b04007f cmp w3, w4
400219a4: 54000069 b.ls 400219b0 <rtems_sparse_disk_register+0x10> // b.plast<== ALWAYS TAKEN
sparse_disk_ioctl,
sparse_disk
);
}
} else {
sc = RTEMS_INVALID_NUMBER;
400219a8: 52800140 mov w0, #0xa // #10 <== NOT EXECUTED
}
return sc;
}
400219ac: d65f03c0 ret <== NOT EXECUTED
{
400219b0: a9bb7bfd stp x29, x30, [sp, #-80]!
400219b4: 910003fd mov x29, sp
400219b8: a9025bf5 stp x21, x22, [sp, #32]
400219bc: aa0103f5 mov x21, x1
if ( NULL == sd )
400219c0: b40006a1 cbz x1, 40021a94 <rtems_sparse_disk_register+0xf4> <== NEVER TAKEN
memset( data, 0, sizeof( rtems_sparse_disk ) + key_table_size );
400219c4: d2800a07 mov x7, #0x50 // #80
400219c8: 2a0203f6 mov w22, w2
400219cc: a90153f3 stp x19, x20, [sp, #16]
400219d0: 2a0303f4 mov w20, w3
400219d4: 8b2350f3 add x19, x7, w3, uxtw #4
400219d8: aa1303e2 mov x2, x19
400219dc: 52800001 mov w1, #0x0 // #0
400219e0: a90363f7 stp x23, x24, [sp, #48]
400219e4: 2a0403f7 mov w23, w4
400219e8: aa0003f8 mov x24, x0
400219ec: aa1503e0 mov x0, x21
400219f0: a9046bf9 stp x25, x26, [sp, #64]
400219f4: 12001cba and w26, w5, #0xff
400219f8: aa0603f9 mov x25, x6
400219fc: 9400669a bl 4003b464 <memset>
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
40021a00: 1b167e82 mul w2, w20, w22
sd->fill_pattern = fill_pattern;
40021a04: 390102ba strb w26, [x21, #64]
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
40021a08: 8b1302b3 add x19, x21, x19
40021a0c: 2a1a03e1 mov w1, w26
40021a10: aa1303e0 mov x0, x19
40021a14: 94006694 bl 4003b464 <memset>
static __inline void
_Mutex_Initialize_named(struct _Mutex_Control *_mutex, const char *_name)
{
struct _Mutex_Control _init = _MUTEX_NAMED_INITIALIZER(_name);
*_mutex = _init;
40021a18: a9007ebf stp xzr, xzr, [x21]
data += sizeof( rtems_sparse_disk );
40021a1c: 910142a1 add x1, x21, #0x50
40021a20: f0000120 adrp x0, 40048000 <bsp_section_rodata_begin+0x78>
40021a24: 911bc000 add x0, x0, #0x6f0
40021a28: a90102bf stp xzr, x0, [x21, #16]
sd->blocks_with_buffer = blocks_with_buffer;
40021a2c: b90022b4 str w20, [x21, #32]
sd->delete_handler = sparse_disk_delete;
40021a30: f9001eb9 str x25, [x21, #56]
sd->key_table = (rtems_sparse_disk_key *) data;
40021a34: f90026a1 str x1, [x21, #72]
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
40021a38: 34000154 cbz w20, 40021a60 <rtems_sparse_disk_register+0xc0> <== NEVER TAKEN
40021a3c: 51000683 sub w3, w20, #0x1
40021a40: 9101a2b4 add x20, x21, #0x68
40021a44: 2a1603e1 mov w1, w22
40021a48: 910162a5 add x5, x21, #0x58
40021a4c: 8b235294 add x20, x20, w3, uxtw #4
sd->key_table[i].data = data;
40021a50: f80104b3 str x19, [x5], #16
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
40021a54: 8b010273 add x19, x19, x1
40021a58: eb1400bf cmp x5, x20
40021a5c: 54ffffa1 b.ne 40021a50 <rtems_sparse_disk_register+0xb0> // b.any
sc = rtems_blkdev_create(
40021a60: 2a1703e2 mov w2, w23
40021a64: aa1803e0 mov x0, x24
40021a68: a94153f3 ldp x19, x20, [sp, #16]
40021a6c: aa1503e4 mov x4, x21
40021a70: a94363f7 ldp x23, x24, [sp, #48]
40021a74: 2a1603e1 mov w1, w22
40021a78: a9446bf9 ldp x25, x26, [sp, #64]
sd->media_block_size = media_block_size;
40021a7c: b90032b6 str w22, [x21, #48]
}
40021a80: a9425bf5 ldp x21, x22, [sp, #32]
sc = rtems_blkdev_create(
40021a84: 90000003 adrp x3, 40021000 <Init+0x440>
40021a88: 911c4063 add x3, x3, #0x710
}
40021a8c: a8c57bfd ldp x29, x30, [sp], #80
sc = rtems_blkdev_create(
40021a90: 140029c8 b 4002c1b0 <rtems_blkdev_create>
return RTEMS_INVALID_ADDRESS;
40021a94: 52800120 mov w0, #0x9 // #9 <== NOT EXECUTED
}
40021a98: a9425bf5 ldp x21, x22, [sp, #32] <== NOT EXECUTED
40021a9c: a8c57bfd ldp x29, x30, [sp], #80 <== NOT EXECUTED
40021aa0: d65f03c0 ret <== NOT EXECUTED
...