RTEMS 4.10Annotated Report
Fri May 21 17:51:59 2010
0000ae78 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ae78: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ae7c: e1a08002 mov r8, r2
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
ae80: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ae84: e24dd01c sub sp, sp, #28
ae88: e1a05001 mov r5, r1
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
ae8c: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ae90: e1a07000 mov r7, r0
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
ae94: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
ae98: e1a0b003 mov fp, r3
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
ae9c: e590a008 ldr sl, [r0, #8]
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
aea0: e58d200c str r2, [sp, #12]
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
aea4: 2a000076 bcs b084 <_Heap_Allocate_aligned_with_boundary+0x20c>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
aea8: e3530000 cmp r3, #0
aeac: 1a000072 bne b07c <_Heap_Allocate_aligned_with_boundary+0x204>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
aeb0: e157000a cmp r7, sl
aeb4: 03a06000 moveq r6, #0
aeb8: 0a000074 beq b090 <_Heap_Allocate_aligned_with_boundary+0x218>
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
aebc: e59d300c ldr r3, [sp, #12]
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
aec0: e2651004 rsb r1, r5, #4
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
aec4: e2833007 add r3, r3, #7
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
aec8: e3a06000 mov r6, #0
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
aecc: e58d3010 str r3, [sp, #16]
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
aed0: e58d1014 str r1, [sp, #20]
aed4: ea000004 b aeec <_Heap_Allocate_aligned_with_boundary+0x74>
boundary
);
}
}
if ( alloc_begin != 0 ) {
aed8: e3540000 cmp r4, #0
aedc: 1a000059 bne b048 <_Heap_Allocate_aligned_with_boundary+0x1d0>
break;
}
block = block->next;
aee0: e59aa008 ldr sl, [sl, #8]
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
aee4: e157000a cmp r7, sl
aee8: 0a000068 beq b090 <_Heap_Allocate_aligned_with_boundary+0x218>
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
aeec: e59a9004 ldr r9, [sl, #4]
aef0: e59d2000 ldr r2, [sp]
aef4: e1520009 cmp r2, r9
while ( block != free_list_tail ) {
_HAssert( _Heap_Is_prev_used( block ) );
/* Statistics */
++search_count;
aef8: e2866001 add r6, r6, #1
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
aefc: 2afffff7 bcs aee0 <_Heap_Allocate_aligned_with_boundary+0x68>
if ( alignment == 0 ) {
af00: e3580000 cmp r8, #0
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
af04: 028a4008 addeq r4, sl, #8
af08: 0afffff2 beq aed8 <_Heap_Allocate_aligned_with_boundary+0x60>
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
af0c: e59d1014 ldr r1, [sp, #20]
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
af10: e3c99001 bic r9, r9, #1
af14: e08a9009 add r9, sl, r9
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
af18: e5973014 ldr r3, [r7, #20]
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
af1c: e59d2010 ldr r2, [sp, #16]
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
af20: e0814009 add r4, r1, r9
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
af24: e58d3004 str r3, [sp, #4]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
af28: e1a00004 mov r0, r4
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
af2c: e0633002 rsb r3, r3, r2
af30: e1a01008 mov r1, r8
af34: e0839009 add r9, r3, r9
af38: eb003106 bl 17358 <__umodsi3>
af3c: e0604004 rsb r4, r0, r4
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
af40: e28a3008 add r3, sl, #8
uintptr_t alloc_begin = alloc_end - alloc_size;
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
af44: e1590004 cmp r9, r4
af48: e58d3008 str r3, [sp, #8]
af4c: 2a000003 bcs af60 <_Heap_Allocate_aligned_with_boundary+0xe8>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
af50: e1a00009 mov r0, r9
af54: e1a01008 mov r1, r8
af58: eb0030fe bl 17358 <__umodsi3>
af5c: e0604009 rsb r4, r0, r9
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
af60: e35b0000 cmp fp, #0
af64: 0a000025 beq b000 <_Heap_Allocate_aligned_with_boundary+0x188>
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment );
}
alloc_end = alloc_begin + alloc_size;
af68: e0849005 add r9, r4, r5
af6c: e1a00009 mov r0, r9
af70: e1a0100b mov r1, fp
af74: eb0030f7 bl 17358 <__umodsi3>
af78: e0600009 rsb r0, r0, r9
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
af7c: e1590000 cmp r9, r0
af80: 93a03000 movls r3, #0
af84: 83a03001 movhi r3, #1
af88: e1540000 cmp r4, r0
af8c: 23a03000 movcs r3, #0
af90: e3530000 cmp r3, #0
af94: 0a000019 beq b000 <_Heap_Allocate_aligned_with_boundary+0x188>
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
af98: e59d1008 ldr r1, [sp, #8]
af9c: e0819005 add r9, r1, r5
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
afa0: e1590000 cmp r9, r0
afa4: 958d6018 strls r6, [sp, #24]
afa8: 9a000002 bls afb8 <_Heap_Allocate_aligned_with_boundary+0x140>
afac: eaffffcb b aee0 <_Heap_Allocate_aligned_with_boundary+0x68>
afb0: e1590000 cmp r9, r0
afb4: 8a000037 bhi b098 <_Heap_Allocate_aligned_with_boundary+0x220>
return 0;
}
alloc_begin = boundary_line - alloc_size;
afb8: e0654000 rsb r4, r5, r0
afbc: e1a01008 mov r1, r8
afc0: e1a00004 mov r0, r4
afc4: eb0030e3 bl 17358 <__umodsi3>
afc8: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
afcc: e0846005 add r6, r4, r5
afd0: e1a00006 mov r0, r6
afd4: e1a0100b mov r1, fp
afd8: eb0030de bl 17358 <__umodsi3>
afdc: e0600006 rsb r0, r0, r6
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
afe0: e1560000 cmp r6, r0
afe4: 93a03000 movls r3, #0
afe8: 83a03001 movhi r3, #1
afec: e1540000 cmp r4, r0
aff0: 23a03000 movcs r3, #0
aff4: e3530000 cmp r3, #0
aff8: 1affffec bne afb0 <_Heap_Allocate_aligned_with_boundary+0x138>
affc: e59d6018 ldr r6, [sp, #24]
boundary_line = _Heap_Align_down( alloc_end, boundary );
}
}
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
b000: e59d2008 ldr r2, [sp, #8]
b004: e1520004 cmp r2, r4
b008: 8affffb4 bhi aee0 <_Heap_Allocate_aligned_with_boundary+0x68>
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
b00c: e59d100c ldr r1, [sp, #12]
b010: e1a00004 mov r0, r4
b014: eb0030cf bl 17358 <__umodsi3>
b018: e26a94ff rsb r9, sl, #-16777216 ; 0xff000000
b01c: e28998ff add r9, r9, #16711680 ; 0xff0000
b020: e2899cff add r9, r9, #65280 ; 0xff00
b024: e28990f8 add r9, r9, #248 ; 0xf8
b028: e0899004 add r9, r9, r4
if ( free_size >= min_block_size || free_size == 0 ) {
b02c: e59d1004 ldr r1, [sp, #4]
b030: e0603009 rsb r3, r0, r9
b034: e1590000 cmp r9, r0
b038: 11510003 cmpne r1, r3
b03c: 8affffa7 bhi aee0 <_Heap_Allocate_aligned_with_boundary+0x68>
boundary
);
}
}
if ( alloc_begin != 0 ) {
b040: e3540000 cmp r4, #0
b044: 0affffa5 beq aee0 <_Heap_Allocate_aligned_with_boundary+0x68>
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
b048: e597304c ldr r3, [r7, #76] ; 0x4c
b04c: e0833006 add r3, r3, r6
b050: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
b054: e1a0100a mov r1, sl
b058: e1a03005 mov r3, r5
b05c: e1a00007 mov r0, r7
b060: e1a02004 mov r2, r4
b064: ebffec24 bl 60fc <_Heap_Block_allocate>
b068: e1a00004 mov r0, r4
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
Heap_Statistics *const stats = &heap->stats;
b06c: e5973044 ldr r3, [r7, #68] ; 0x44
b070: e1530006 cmp r3, r6
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
b074: 35876044 strcc r6, [r7, #68] ; 0x44
b078: ea000002 b b088 <_Heap_Allocate_aligned_with_boundary+0x210>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
b07c: e1550003 cmp r5, r3
b080: 9a000006 bls b0a0 <_Heap_Allocate_aligned_with_boundary+0x228>
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
b084: e3a00000 mov r0, #0
}
return (void *) alloc_begin;
}
b088: e28dd01c add sp, sp, #28
b08c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
b090: e3a00000 mov r0, #0
b094: eafffff4 b b06c <_Heap_Allocate_aligned_with_boundary+0x1f4>
b098: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED
b09c: eaffff8f b aee0 <_Heap_Allocate_aligned_with_boundary+0x68><== NOT EXECUTED
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
b0a0: e3580000 cmp r8, #0
b0a4: 01a08002 moveq r8, r2
b0a8: eaffff80 b aeb0 <_Heap_Allocate_aligned_with_boundary+0x38>
00006e8c <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
6e8c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = heap->first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6e90: e59f35d0 ldr r3, [pc, #1488] ; 7468 <_Heap_Walk+0x5dc>
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = heap->first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
6e94: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6e98: e5933000 ldr r3, [r3]
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = heap->first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
6e9c: e59f25c8 ldr r2, [pc, #1480] ; 746c <_Heap_Walk+0x5e0>
6ea0: e59fa5c8 ldr sl, [pc, #1480] ; 7470 <_Heap_Walk+0x5e4>
6ea4: 01a0a002 moveq sl, r2
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6ea8: e3530003 cmp r3, #3
Heap_Control *heap,
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
6eac: e5902010 ldr r2, [r0, #16]
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const last_block = heap->last_block;
6eb0: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
6eb4: e24dd038 sub sp, sp, #56 ; 0x38
6eb8: e1a04000 mov r4, r0
6ebc: e1a08001 mov r8, r1
uintptr_t const page_size = heap->page_size;
6ec0: e58d2020 str r2, [sp, #32]
uintptr_t const min_block_size = heap->min_block_size;
6ec4: e590b014 ldr fp, [r0, #20]
Heap_Block *const last_block = heap->last_block;
6ec8: e58d3024 str r3, [sp, #36] ; 0x24
Heap_Block *block = heap->first_block;
6ecc: e5905020 ldr r5, [r0, #32]
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6ed0: 0a000002 beq 6ee0 <_Heap_Walk+0x54>
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
}
while ( block != last_block ) {
6ed4: e3a00001 mov r0, #1
block = next_block;
}
return true;
}
6ed8: e28dd038 add sp, sp, #56 ; 0x38
6edc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
(*printer)(
6ee0: e5900018 ldr r0, [r0, #24]
6ee4: e594101c ldr r1, [r4, #28]
6ee8: e2842008 add r2, r4, #8
6eec: e892000c ldm r2, {r2, r3}
6ef0: e59dc024 ldr ip, [sp, #36] ; 0x24
6ef4: e98d0003 stmib sp, {r0, r1}
6ef8: e58d2014 str r2, [sp, #20]
6efc: e58d3018 str r3, [sp, #24]
6f00: e59f256c ldr r2, [pc, #1388] ; 7474 <_Heap_Walk+0x5e8>
6f04: e58db000 str fp, [sp]
6f08: e58d500c str r5, [sp, #12]
6f0c: e58dc010 str ip, [sp, #16]
6f10: e1a00008 mov r0, r8
6f14: e3a01000 mov r1, #0
6f18: e59d3020 ldr r3, [sp, #32]
6f1c: e1a0e00f mov lr, pc
6f20: e12fff1a bx sl
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
6f24: e59d2020 ldr r2, [sp, #32]
6f28: e3520000 cmp r2, #0
6f2c: 0a000032 beq 6ffc <_Heap_Walk+0x170>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
6f30: e59d3020 ldr r3, [sp, #32]
6f34: e2139003 ands r9, r3, #3
6f38: 1a000036 bne 7018 <_Heap_Walk+0x18c>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
6f3c: e1a0000b mov r0, fp
6f40: e59d1020 ldr r1, [sp, #32]
6f44: ebffe733 bl c18 <__umodsi3>
6f48: e2506000 subs r6, r0, #0
6f4c: 1a000038 bne 7034 <_Heap_Walk+0x1a8>
);
return false;
}
if (
6f50: e2850008 add r0, r5, #8
6f54: e59d1020 ldr r1, [sp, #32]
6f58: ebffe72e bl c18 <__umodsi3>
6f5c: e2509000 subs r9, r0, #0
6f60: 1a00003b bne 7054 <_Heap_Walk+0x1c8>
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
6f64: e5957004 ldr r7, [r5, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
6f68: e2176001 ands r6, r7, #1
6f6c: 0a000040 beq 7074 <_Heap_Walk+0x1e8>
);
return false;
}
if ( first_block->prev_size != page_size ) {
6f70: e5953000 ldr r3, [r5]
6f74: e59dc020 ldr ip, [sp, #32]
6f78: e15c0003 cmp ip, r3
6f7c: 1a000016 bne 6fdc <_Heap_Walk+0x150>
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
6f80: e59d2024 ldr r2, [sp, #36] ; 0x24
6f84: e5923004 ldr r3, [r2, #4]
6f88: e3c33001 bic r3, r3, #1
6f8c: e0823003 add r3, r2, r3
6f90: e5939004 ldr r9, [r3, #4]
6f94: e2199001 ands r9, r9, #1
6f98: 0a000112 beq 73e8 <_Heap_Walk+0x55c>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
6f9c: e5949008 ldr r9, [r4, #8]
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
6fa0: e5943010 ldr r3, [r4, #16]
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
6fa4: e1540009 cmp r4, r9
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
6fa8: e58d3028 str r3, [sp, #40] ; 0x28
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
6fac: 0a00006c beq 7164 <_Heap_Walk+0x2d8>
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
6fb0: e594c020 ldr ip, [r4, #32]
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
6fb4: e15c0009 cmp ip, r9
6fb8: 9a000034 bls 7090 <_Heap_Walk+0x204>
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
(*printer)(
6fbc: e1a00008 mov r0, r8
6fc0: e1a03009 mov r3, r9
6fc4: e3a01001 mov r1, #1
6fc8: e59f24a8 ldr r2, [pc, #1192] ; 7478 <_Heap_Walk+0x5ec>
6fcc: e1a0e00f mov lr, pc
6fd0: e12fff1a bx sl
6fd4: e3a00000 mov r0, #0
6fd8: eaffffbe b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( first_block->prev_size != page_size ) {
(*printer)(
6fdc: e1a00008 mov r0, r8
6fe0: e58dc000 str ip, [sp]
6fe4: e3a01001 mov r1, #1
6fe8: e59f248c ldr r2, [pc, #1164] ; 747c <_Heap_Walk+0x5f0>
6fec: e1a0e00f mov lr, pc
6ff0: e12fff1a bx sl
6ff4: e1a00009 mov r0, r9
6ff8: eaffffb6 b 6ed8 <_Heap_Walk+0x4c>
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
(*printer)( source, true, "page size is zero\n" );
6ffc: e1a00008 mov r0, r8
7000: e3a01001 mov r1, #1
7004: e59f2474 ldr r2, [pc, #1140] ; 7480 <_Heap_Walk+0x5f4>
7008: e1a0e00f mov lr, pc
700c: e12fff1a bx sl
7010: e59d0020 ldr r0, [sp, #32]
7014: eaffffaf b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
7018: e1a00008 mov r0, r8
701c: e3a01001 mov r1, #1
7020: e59f245c ldr r2, [pc, #1116] ; 7484 <_Heap_Walk+0x5f8>
7024: e1a0e00f mov lr, pc
7028: e12fff1a bx sl
702c: e3a00000 mov r0, #0
7030: eaffffa8 b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
7034: e1a00008 mov r0, r8
7038: e1a0300b mov r3, fp
703c: e3a01001 mov r1, #1
7040: e59f2440 ldr r2, [pc, #1088] ; 7488 <_Heap_Walk+0x5fc>
7044: e1a0e00f mov lr, pc
7048: e12fff1a bx sl
704c: e1a00009 mov r0, r9
7050: eaffffa0 b 6ed8 <_Heap_Walk+0x4c>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
7054: e1a00008 mov r0, r8
7058: e1a03005 mov r3, r5
705c: e3a01001 mov r1, #1
7060: e59f2424 ldr r2, [pc, #1060] ; 748c <_Heap_Walk+0x600>
7064: e1a0e00f mov lr, pc
7068: e12fff1a bx sl
706c: e1a00006 mov r0, r6
7070: eaffff98 b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
7074: e1a00008 mov r0, r8
7078: e3a01001 mov r1, #1
707c: e59f240c ldr r2, [pc, #1036] ; 7490 <_Heap_Walk+0x604>
7080: e1a0e00f mov lr, pc
7084: e12fff1a bx sl
7088: e1a00006 mov r0, r6
708c: eaffff91 b 6ed8 <_Heap_Walk+0x4c>
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
7090: e5942024 ldr r2, [r4, #36] ; 0x24
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
7094: e1520009 cmp r2, r9
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
7098: e58d202c str r2, [sp, #44] ; 0x2c
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
709c: 3affffc6 bcc 6fbc <_Heap_Walk+0x130>
);
return false;
}
if (
70a0: e2890008 add r0, r9, #8
70a4: e1a01003 mov r1, r3
70a8: e58dc01c str ip, [sp, #28]
70ac: ebffe6d9 bl c18 <__umodsi3>
70b0: e3500000 cmp r0, #0
70b4: e59dc01c ldr ip, [sp, #28]
70b8: 1a0000d1 bne 7404 <_Heap_Walk+0x578>
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
70bc: e5993004 ldr r3, [r9, #4]
70c0: e3c33001 bic r3, r3, #1
70c4: e0893003 add r3, r9, r3
70c8: e5933004 ldr r3, [r3, #4]
70cc: e3130001 tst r3, #1
70d0: 1a0000dc bne 7448 <_Heap_Walk+0x5bc>
);
return false;
}
if ( free_block->prev != prev_block ) {
70d4: e599200c ldr r2, [r9, #12]
70d8: e1540002 cmp r4, r2
70dc: 1a0000d0 bne 7424 <_Heap_Walk+0x598>
70e0: e58d7030 str r7, [sp, #48] ; 0x30
70e4: e58db034 str fp, [sp, #52] ; 0x34
70e8: e59d702c ldr r7, [sp, #44] ; 0x2c
70ec: e59db028 ldr fp, [sp, #40] ; 0x28
70f0: e58d502c str r5, [sp, #44] ; 0x2c
70f4: e58d6028 str r6, [sp, #40] ; 0x28
70f8: e1a0600c mov r6, ip
70fc: ea000011 b 7148 <_Heap_Walk+0x2bc>
7100: e1590006 cmp r9, r6
7104: 3affffac bcc 6fbc <_Heap_Walk+0x130>
7108: e1570009 cmp r7, r9
);
return false;
}
if (
710c: e2890008 add r0, r9, #8
7110: e1a0100b mov r1, fp
7114: 3affffa8 bcc 6fbc <_Heap_Walk+0x130>
7118: ebffe6be bl c18 <__umodsi3>
711c: e3500000 cmp r0, #0
7120: 1a0000b7 bne 7404 <_Heap_Walk+0x578>
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7124: e5993004 ldr r3, [r9, #4]
7128: e3c33001 bic r3, r3, #1
712c: e0833009 add r3, r3, r9
7130: e5933004 ldr r3, [r3, #4]
7134: e3130001 tst r3, #1
7138: 1a0000c2 bne 7448 <_Heap_Walk+0x5bc>
);
return false;
}
if ( free_block->prev != prev_block ) {
713c: e599200c ldr r2, [r9, #12]
7140: e1520005 cmp r2, r5
7144: 1a0000b6 bne 7424 <_Heap_Walk+0x598>
(*printer)(
7148: e1a05009 mov r5, r9
return false;
}
prev_block = free_block;
free_block = free_block->next;
714c: e5999008 ldr r9, [r9, #8]
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
7150: e1540009 cmp r4, r9
7154: 1affffe9 bne 7100 <_Heap_Walk+0x274>
7158: e28d502c add r5, sp, #44 ; 0x2c
715c: e89508a0 ldm r5, {r5, r7, fp}
7160: e59d6028 ldr r6, [sp, #40] ; 0x28
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
}
while ( block != last_block ) {
7164: e59d3024 ldr r3, [sp, #36] ; 0x24
7168: e1530005 cmp r3, r5
"block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n",
block,
block->prev,
block->prev == first_free_block ?
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
716c: 158db028 strne fp, [sp, #40] ; 0x28
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
}
while ( block != last_block ) {
7170: 0affff57 beq 6ed4 <_Heap_Walk+0x48>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
7174: e3c77001 bic r7, r7, #1
uintptr_t const block_size = _Heap_Block_size( block );
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
if ( prev_used ) {
7178: e21610ff ands r1, r6, #255 ; 0xff
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
717c: e0876005 add r6, r7, r5
7180: 0a000012 beq 71d0 <_Heap_Walk+0x344>
(*printer)(
7184: e1a03005 mov r3, r5
7188: e58d7000 str r7, [sp]
718c: e1a00008 mov r0, r8
7190: e3a01000 mov r1, #0
7194: e59f22f8 ldr r2, [pc, #760] ; 7494 <_Heap_Walk+0x608>
7198: e1a0e00f mov lr, pc
719c: e12fff1a bx sl
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
71a0: e5943020 ldr r3, [r4, #32]
71a4: e1530006 cmp r3, r6
71a8: 9a000013 bls 71fc <_Heap_Walk+0x370>
block->prev_size
);
}
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
(*printer)(
71ac: e1a00008 mov r0, r8
71b0: e58d6000 str r6, [sp]
71b4: e1a03005 mov r3, r5
71b8: e3a01001 mov r1, #1
71bc: e59f22d4 ldr r2, [pc, #724] ; 7498 <_Heap_Walk+0x60c>
71c0: e1a0e00f mov lr, pc
71c4: e12fff1a bx sl
71c8: e3a00000 mov r0, #0
"block 0x%08x: next block 0x%08x not in heap\n",
block,
next_block
);
return false;
71cc: eaffff41 b 6ed8 <_Heap_Walk+0x4c>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
71d0: e58d7000 str r7, [sp]
71d4: e5953000 ldr r3, [r5]
71d8: e1a00008 mov r0, r8
71dc: e58d3004 str r3, [sp, #4]
71e0: e59f22b4 ldr r2, [pc, #692] ; 749c <_Heap_Walk+0x610>
71e4: e1a03005 mov r3, r5
71e8: e1a0e00f mov lr, pc
71ec: e12fff1a bx sl
71f0: e5943020 ldr r3, [r4, #32]
71f4: e1530006 cmp r3, r6
71f8: 8affffeb bhi 71ac <_Heap_Walk+0x320>
71fc: e5943024 ldr r3, [r4, #36] ; 0x24
7200: e1530006 cmp r3, r6
7204: 3affffe8 bcc 71ac <_Heap_Walk+0x320>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) ) {
7208: e1a00007 mov r0, r7
720c: e59d1020 ldr r1, [sp, #32]
7210: ebffe680 bl c18 <__umodsi3>
7214: e2509000 subs r9, r0, #0
7218: 1a000055 bne 7374 <_Heap_Walk+0x4e8>
);
return false;
}
if ( block_size < min_block_size ) {
721c: e59d3028 ldr r3, [sp, #40] ; 0x28
7220: e1530007 cmp r3, r7
7224: 8a00005b bhi 7398 <_Heap_Walk+0x50c>
);
return false;
}
if ( next_block_begin <= block_begin ) {
7228: e1550006 cmp r5, r6
722c: 2a000064 bcs 73c4 <_Heap_Walk+0x538>
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
7230: e5963004 ldr r3, [r6, #4]
7234: e3130001 tst r3, #1
7238: 1a000036 bne 7318 <_Heap_Walk+0x48c>
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
723c: e595b004 ldr fp, [r5, #4]
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
7240: e595200c ldr r2, [r5, #12]
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
7244: e5943008 ldr r3, [r4, #8]
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
7248: e3cb7001 bic r7, fp, #1
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
724c: e1530002 cmp r3, r2
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap )
{
return _Heap_Free_list_tail(heap)->prev;
7250: e594100c ldr r1, [r4, #12]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
7254: e0859007 add r9, r5, r7
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
7258: 059f0240 ldreq r0, [pc, #576] ; 74a0 <_Heap_Walk+0x614>
725c: 0a000003 beq 7270 <_Heap_Walk+0x3e4>
"block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n",
block,
block->prev,
block->prev == first_free_block ?
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
7260: e59fc23c ldr ip, [pc, #572] ; 74a4 <_Heap_Walk+0x618>
7264: e1520004 cmp r2, r4
7268: e59f0238 ldr r0, [pc, #568] ; 74a8 <_Heap_Walk+0x61c>
726c: 11a0000c movne r0, ip
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
7270: e5953008 ldr r3, [r5, #8]
7274: e1510003 cmp r1, r3
7278: 059f122c ldreq r1, [pc, #556] ; 74ac <_Heap_Walk+0x620>
727c: 0a000003 beq 7290 <_Heap_Walk+0x404>
" (= first)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last)"
: (block->next == free_list_tail ? " (= tail)" : "")
7280: e59fc21c ldr ip, [pc, #540] ; 74a4 <_Heap_Walk+0x618>
7284: e1530004 cmp r3, r4
7288: e59f1220 ldr r1, [pc, #544] ; 74b0 <_Heap_Walk+0x624>
728c: 11a0100c movne r1, ip
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
7290: e58d2000 str r2, [sp]
7294: e98d0009 stmib sp, {r0, r3}
7298: e58d100c str r1, [sp, #12]
729c: e1a03005 mov r3, r5
72a0: e1a00008 mov r0, r8
72a4: e3a01000 mov r1, #0
72a8: e59f2204 ldr r2, [pc, #516] ; 74b4 <_Heap_Walk+0x628>
72ac: e1a0e00f mov lr, pc
72b0: e12fff1a bx sl
block->next == last_free_block ?
" (= last)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
72b4: e5993000 ldr r3, [r9]
72b8: e1570003 cmp r7, r3
72bc: 0a00000a beq 72ec <_Heap_Walk+0x460>
(*printer)(
72c0: e58d3004 str r3, [sp, #4]
72c4: e1a00008 mov r0, r8
72c8: e58d7000 str r7, [sp]
72cc: e58d9008 str r9, [sp, #8]
72d0: e1a03005 mov r3, r5
72d4: e3a01001 mov r1, #1
72d8: e59f21d8 ldr r2, [pc, #472] ; 74b8 <_Heap_Walk+0x62c>
72dc: e1a0e00f mov lr, pc
72e0: e12fff1a bx sl
72e4: e3a00000 mov r0, #0
72e8: eafffefa b 6ed8 <_Heap_Walk+0x4c>
);
return false;
}
if ( !prev_used ) {
72ec: e21b9001 ands r9, fp, #1
72f0: 0a000017 beq 7354 <_Heap_Walk+0x4c8>
72f4: e5943008 ldr r3, [r4, #8]
)
{
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *free_block = _Heap_Free_list_first( heap );
while ( free_block != free_list_tail ) {
72f8: e1530004 cmp r3, r4
72fc: 1a000003 bne 7310 <_Heap_Walk+0x484>
7300: ea00000b b 7334 <_Heap_Walk+0x4a8> <== NOT EXECUTED
if ( free_block == block ) {
return true;
}
free_block = free_block->next;
7304: e5933008 ldr r3, [r3, #8]
)
{
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *free_block = _Heap_Free_list_first( heap );
while ( free_block != free_list_tail ) {
7308: e1530004 cmp r3, r4
730c: 0a000008 beq 7334 <_Heap_Walk+0x4a8>
if ( free_block == block ) {
7310: e1530005 cmp r3, r5
7314: 1afffffa bne 7304 <_Heap_Walk+0x478>
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
}
while ( block != last_block ) {
7318: e59d2024 ldr r2, [sp, #36] ; 0x24
731c: e1520006 cmp r2, r6
7320: 0afffeeb beq 6ed4 <_Heap_Walk+0x48>
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
7324: e5967004 ldr r7, [r6, #4]
7328: e1a05006 mov r5, r6
732c: e2076001 and r6, r7, #1
7330: eaffff8f b 7174 <_Heap_Walk+0x2e8>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
7334: e1a00008 mov r0, r8
7338: e1a03005 mov r3, r5
733c: e3a01001 mov r1, #1
7340: e59f2174 ldr r2, [pc, #372] ; 74bc <_Heap_Walk+0x630>
7344: e1a0e00f mov lr, pc
7348: e12fff1a bx sl
734c: e3a00000 mov r0, #0
7350: eafffee0 b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( !prev_used ) {
(*printer)(
7354: e1a00008 mov r0, r8
7358: e1a03005 mov r3, r5
735c: e3a01001 mov r1, #1
7360: e59f2158 ldr r2, [pc, #344] ; 74c0 <_Heap_Walk+0x634>
7364: e1a0e00f mov lr, pc
7368: e12fff1a bx sl
736c: e1a00009 mov r0, r9
7370: eafffed8 b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) ) {
(*printer)(
7374: e1a00008 mov r0, r8
7378: e58d7000 str r7, [sp]
737c: e1a03005 mov r3, r5
7380: e3a01001 mov r1, #1
7384: e59f2138 ldr r2, [pc, #312] ; 74c4 <_Heap_Walk+0x638>
7388: e1a0e00f mov lr, pc
738c: e12fff1a bx sl
7390: e3a00000 mov r0, #0
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
7394: eafffecf b 6ed8 <_Heap_Walk+0x4c>
}
if ( block_size < min_block_size ) {
(*printer)(
7398: e58d3004 str r3, [sp, #4]
739c: e1a00008 mov r0, r8
73a0: e1a0b003 mov fp, r3
73a4: e58d7000 str r7, [sp]
73a8: e1a03005 mov r3, r5
73ac: e3a01001 mov r1, #1
73b0: e59f2110 ldr r2, [pc, #272] ; 74c8 <_Heap_Walk+0x63c>
73b4: e1a0e00f mov lr, pc
73b8: e12fff1a bx sl
73bc: e1a00009 mov r0, r9
block,
block_size,
min_block_size
);
return false;
73c0: eafffec4 b 6ed8 <_Heap_Walk+0x4c>
}
if ( next_block_begin <= block_begin ) {
(*printer)(
73c4: e1a00008 mov r0, r8
73c8: e58d6000 str r6, [sp]
73cc: e1a03005 mov r3, r5
73d0: e3a01001 mov r1, #1
73d4: e59f20f0 ldr r2, [pc, #240] ; 74cc <_Heap_Walk+0x640>
73d8: e1a0e00f mov lr, pc
73dc: e12fff1a bx sl
73e0: e1a00009 mov r0, r9
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
73e4: eafffebb b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
73e8: e1a00008 mov r0, r8
73ec: e3a01001 mov r1, #1
73f0: e59f20d8 ldr r2, [pc, #216] ; 74d0 <_Heap_Walk+0x644>
73f4: e1a0e00f mov lr, pc
73f8: e12fff1a bx sl
73fc: e1a00009 mov r0, r9
7400: eafffeb4 b 6ed8 <_Heap_Walk+0x4c>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
7404: e1a00008 mov r0, r8
7408: e1a03009 mov r3, r9
740c: e3a01001 mov r1, #1
7410: e59f20bc ldr r2, [pc, #188] ; 74d4 <_Heap_Walk+0x648>
7414: e1a0e00f mov lr, pc
7418: e12fff1a bx sl
741c: e3a00000 mov r0, #0
7420: eafffeac b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( free_block->prev != prev_block ) {
(*printer)(
7424: e58d2000 str r2, [sp]
7428: e1a00008 mov r0, r8
742c: e1a03009 mov r3, r9
7430: e3a01001 mov r1, #1
7434: e59f209c ldr r2, [pc, #156] ; 74d8 <_Heap_Walk+0x64c>
7438: e1a0e00f mov lr, pc
743c: e12fff1a bx sl
7440: e3a00000 mov r0, #0
7444: eafffea3 b 6ed8 <_Heap_Walk+0x4c>
return false;
}
if ( _Heap_Is_used( free_block ) ) {
(*printer)(
7448: e1a00008 mov r0, r8
744c: e1a03009 mov r3, r9
7450: e3a01001 mov r1, #1
7454: e59f2080 ldr r2, [pc, #128] ; 74dc <_Heap_Walk+0x650>
7458: e1a0e00f mov lr, pc
745c: e12fff1a bx sl
7460: e3a00000 mov r0, #0
7464: eafffe9b b 6ed8 <_Heap_Walk+0x4c>
0000636c <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
636c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6370: e5908034 ldr r8, [r0, #52] ; 0x34
6374: e3580000 cmp r8, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6378: e24dd014 sub sp, sp, #20
637c: e1a05000 mov r5, r0
/*
* Search for a free block of indexes. The block variable ends up set
* to block_count + 1 if the table needs to be extended.
*/
minimum_index = _Objects_Get_index( information->minimum_id );
6380: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6384: 0a00009c beq 65fc <_Objects_Extend_information+0x290>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
6388: e1d091b4 ldrh r9, [r0, #20]
638c: e1d0a1b0 ldrh sl, [r0, #16]
6390: e1a01009 mov r1, r9
6394: e1a0000a mov r0, sl
6398: eb0043aa bl 17248 <__aeabi_uidiv>
639c: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
63a0: e1b03823 lsrs r3, r3, #16
63a4: 01a01009 moveq r1, r9
63a8: 01a06007 moveq r6, r7
63ac: 01a04003 moveq r4, r3
63b0: 0a00000f beq 63f4 <_Objects_Extend_information+0x88>
if ( information->object_blocks[ block ] == NULL )
63b4: e5984000 ldr r4, [r8]
63b8: e3540000 cmp r4, #0
63bc: 11a01009 movne r1, r9
63c0: 11a06007 movne r6, r7
63c4: 13a04000 movne r4, #0
63c8: 01a01009 moveq r1, r9
63cc: 01a06007 moveq r6, r7
63d0: 1a000003 bne 63e4 <_Objects_Extend_information+0x78>
63d4: ea000006 b 63f4 <_Objects_Extend_information+0x88> <== NOT EXECUTED
63d8: e7982104 ldr r2, [r8, r4, lsl #2]
63dc: e3520000 cmp r2, #0
63e0: 0a000003 beq 63f4 <_Objects_Extend_information+0x88>
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
63e4: e2844001 add r4, r4, #1
63e8: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL )
break;
else
index_base += information->allocation_size;
63ec: e0866009 add r6, r6, r9
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
63f0: 8afffff8 bhi 63d8 <_Objects_Extend_information+0x6c>
else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
63f4: e08aa001 add sl, sl, r1
/*
* We need to limit the number of objects to the maximum number
* representable in the index portion of the object Id. In the
* case of 16-bit Ids, this is only 256 object instances.
*/
if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
63f8: e35a0801 cmp sl, #65536 ; 0x10000
63fc: 2a000064 bcs 6594 <_Objects_Extend_information+0x228>
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
6400: e5d50012 ldrb r0, [r5, #18]
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
6404: e5952018 ldr r2, [r5, #24]
if ( information->auto_extend ) {
6408: e3500000 cmp r0, #0
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
640c: e0000192 mul r0, r2, r1
if ( information->auto_extend ) {
6410: 1a000061 bne 659c <_Objects_Extend_information+0x230>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
6414: e58d3000 str r3, [sp]
6418: eb000835 bl 84f4 <_Workspace_Allocate_or_fatal_error>
641c: e59d3000 ldr r3, [sp]
6420: e1a09000 mov r9, r0
}
/*
* If the index_base is the maximum we need to grow the tables.
*/
if (index_base >= information->maximum ) {
6424: e1d521b0 ldrh r2, [r5, #16]
6428: e1560002 cmp r6, r2
642c: 3a000038 bcc 6514 <_Objects_Extend_information+0x1a8>
*/
/*
* Up the block count and maximum
*/
block_count++;
6430: e283c001 add ip, r3, #1
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
6434: e08c008c add r0, ip, ip, lsl #1
6438: e08a0000 add r0, sl, r0
643c: e0800007 add r0, r0, r7
6440: e1a00100 lsl r0, r0, #2
6444: e88d1008 stm sp, {r3, ip}
6448: eb000835 bl 8524 <_Workspace_Allocate>
if ( !object_blocks ) {
644c: e250b000 subs fp, r0, #0
6450: e89d1008 ldm sp, {r3, ip}
6454: 0a00006e beq 6614 <_Objects_Extend_information+0x2a8>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
6458: e1d521b0 ldrh r2, [r5, #16]
645c: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
6460: e08b818c add r8, fp, ip, lsl #3
6464: e08bc10c add ip, fp, ip, lsl #2
6468: 3a000051 bcc 65b4 <_Objects_Extend_information+0x248>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
646c: e3570000 cmp r7, #0
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
6470: 13a02000 movne r2, #0
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
local_table[ index ] = NULL;
6474: 11a01002 movne r1, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6478: 0a000003 beq 648c <_Objects_Extend_information+0x120>
local_table[ index ] = NULL;
647c: e7881102 str r1, [r8, r2, lsl #2]
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6480: e2822001 add r2, r2, #1
6484: e1570002 cmp r7, r2
6488: 8afffffb bhi 647c <_Objects_Extend_information+0x110>
648c: e1a03103 lsl r3, r3, #2
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
6490: e1d511b4 ldrh r1, [r5, #20]
6494: e0861001 add r1, r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6498: e3a00000 mov r0, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
649c: e1560001 cmp r6, r1
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
64a0: e78c0003 str r0, [ip, r3]
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
64a4: e78b0003 str r0, [fp, r3]
inactive_per_block[block_count] = 0;
for ( index=index_base ;
64a8: 2a000005 bcs 64c4 <_Objects_Extend_information+0x158>
64ac: e0882106 add r2, r8, r6, lsl #2
64b0: e1a03006 mov r3, r6
index < ( information->allocation_size + index_base );
index++ ) {
64b4: e2833001 add r3, r3, #1
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
64b8: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
64bc: e4820004 str r0, [r2], #4
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
64c0: 3afffffb bcc 64b4 <_Objects_Extend_information+0x148>
64c4: e10f3000 mrs r3, CPSR
64c8: e3832080 orr r2, r3, #128 ; 0x80
64cc: e129f002 msr CPSR_fc, r2
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
64d0: e5952000 ldr r2, [r5]
64d4: e1d510b4 ldrh r1, [r5, #4]
64d8: e1a02c02 lsl r2, r2, #24
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
64dc: e1a0a80a lsl sl, sl, #16
information->maximum_id = _Objects_Build_id(
64e0: e3822801 orr r2, r2, #65536 ; 0x10000
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
64e4: e1a0a82a lsr sl, sl, #16
information->maximum_id = _Objects_Build_id(
64e8: e1822d81 orr r2, r2, r1, lsl #27
64ec: e182200a orr r2, r2, sl
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
64f0: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
64f4: e585c030 str ip, [r5, #48] ; 0x30
information->local_table = local_table;
64f8: e585801c str r8, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
64fc: e585200c str r2, [r5, #12]
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
6500: e1c5a1b0 strh sl, [r5, #16]
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
6504: e585b034 str fp, [r5, #52] ; 0x34
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
6508: e129f003 msr CPSR_fc, r3
information->maximum
);
_ISR_Enable( level );
if ( old_tables )
650c: e3500000 cmp r0, #0
_Workspace_Free( old_tables );
6510: 1b000809 blne 853c <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6514: e5953034 ldr r3, [r5, #52] ; 0x34
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6518: e28d7008 add r7, sp, #8
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
651c: e7839104 str r9, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6520: e1a01009 mov r1, r9
6524: e1a00007 mov r0, r7
6528: e1d521b4 ldrh r2, [r5, #20]
652c: e5953018 ldr r3, [r5, #24]
6530: eb0011ae bl abf0 <_Chain_Initialize>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6534: e1a04104 lsl r4, r4, #2
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6538: e2858020 add r8, r5, #32
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
653c: ea000008 b 6564 <_Objects_Extend_information+0x1f8>
the_object->id = _Objects_Build_id(
6540: e5952000 ldr r2, [r5]
6544: e1d5c0b4 ldrh ip, [r5, #4]
6548: e1a02c02 lsl r2, r2, #24
654c: e3822801 orr r2, r2, #65536 ; 0x10000
6550: e1822d8c orr r2, r2, ip, lsl #27
6554: e1822006 orr r2, r2, r6
6558: e5832008 str r2, [r3, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
655c: ebfffd18 bl 59c4 <_Chain_Append>
index++;
6560: e2866001 add r6, r6, #1
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
6564: e1a00007 mov r0, r7
6568: ebfffd20 bl 59f0 <_Chain_Get>
656c: e2503000 subs r3, r0, #0
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6570: e1a01003 mov r1, r3
6574: e1a00008 mov r0, r8
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
6578: 1afffff0 bne 6540 <_Objects_Extend_information+0x1d4>
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
657c: e1d531b4 ldrh r3, [r5, #20]
information->inactive =
6580: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6584: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
6588: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
658c: e7813004 str r3, [r1, r4]
information->inactive =
6590: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
6594: e28dd014 add sp, sp, #20
6598: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
new_object_block = _Workspace_Allocate( block_size );
659c: e58d3000 str r3, [sp]
65a0: eb0007df bl 8524 <_Workspace_Allocate>
if ( !new_object_block )
65a4: e2509000 subs r9, r0, #0
65a8: e59d3000 ldr r3, [sp]
65ac: 1affff9c bne 6424 <_Objects_Extend_information+0xb8>
65b0: eafffff7 b 6594 <_Objects_Extend_information+0x228>
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
65b4: e1a03103 lsl r3, r3, #2
65b8: e1a02003 mov r2, r3
65bc: e5951034 ldr r1, [r5, #52] ; 0x34
65c0: e88d1008 stm sp, {r3, ip}
65c4: eb001faa bl e474 <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
65c8: e89d1008 ldm sp, {r3, ip}
65cc: e1a0000c mov r0, ip
65d0: e1a02003 mov r2, r3
65d4: e5951030 ldr r1, [r5, #48] ; 0x30
65d8: eb001fa5 bl e474 <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
65dc: e1d521b0 ldrh r2, [r5, #16]
65e0: e0872002 add r2, r7, r2
65e4: e1a02102 lsl r2, r2, #2
65e8: e1a00008 mov r0, r8
65ec: e595101c ldr r1, [r5, #28]
65f0: eb001f9f bl e474 <memcpy>
65f4: e89d1008 ldm sp, {r3, ip}
65f8: eaffffa4 b 6490 <_Objects_Extend_information+0x124>
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
65fc: e1a04008 mov r4, r8
6600: e1d0a1b0 ldrh sl, [r0, #16]
6604: e1d011b4 ldrh r1, [r0, #20]
6608: e1a06007 mov r6, r7
660c: e1a03008 mov r3, r8
6610: eaffff77 b 63f4 <_Objects_Extend_information+0x88>
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
6614: e1a00009 mov r0, r9
6618: eb0007c7 bl 853c <_Workspace_Free>
return;
661c: eaffffdc b 6594 <_Objects_Extend_information+0x228>
00006130 <_POSIX_Condition_variables_Wait_support>:
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
6130: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
6134: e1a04001 mov r4, r1
6138: e24dd004 sub sp, sp, #4
613c: e1a06000 mov r6, r0
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
6140: e1a0100d mov r1, sp
6144: e1a00004 mov r0, r4
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
6148: e1a08002 mov r8, r2
614c: e20370ff and r7, r3, #255 ; 0xff
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
6150: eb000075 bl 632c <_POSIX_Mutex_Get>
6154: e3500000 cmp r0, #0
6158: 0a00000a beq 6188 <_POSIX_Condition_variables_Wait_support+0x58>
*/
RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void )
{
RTEMS_COMPILER_MEMORY_BARRIER();
_Thread_Dispatch_disable_level -= 1;
615c: e59f30dc ldr r3, [pc, #220] ; 6240 <_POSIX_Condition_variables_Wait_support+0x110>
6160: e5932000 ldr r2, [r3]
6164: e2422001 sub r2, r2, #1
6168: e5832000 str r2, [r3]
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
616c: e1a0100d mov r1, sp
6170: e1a00006 mov r0, r6
6174: ebffff76 bl 5f54 <_POSIX_Condition_variables_Get>
switch ( location ) {
6178: e59d3000 ldr r3, [sp]
617c: e3530000 cmp r3, #0
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
6180: e1a0a000 mov sl, r0
switch ( location ) {
6184: 0a000003 beq 6198 <_POSIX_Condition_variables_Wait_support+0x68>
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
if ( mutex_status )
6188: e3a05016 mov r5, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
618c: e1a00005 mov r0, r5
6190: e28dd004 add sp, sp, #4
6194: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
the_cond = _POSIX_Condition_variables_Get( cond, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
6198: e5903014 ldr r3, [r0, #20]
619c: e3530000 cmp r3, #0
61a0: 0a000005 beq 61bc <_POSIX_Condition_variables_Wait_support+0x8c>
61a4: e5942000 ldr r2, [r4]
61a8: e1530002 cmp r3, r2
61ac: 0a000002 beq 61bc <_POSIX_Condition_variables_Wait_support+0x8c>
_Thread_Enable_dispatch();
61b0: eb000c6f bl 9374 <_Thread_Enable_dispatch>
61b4: e3a05016 mov r5, #22
return EINVAL;
61b8: eafffff3 b 618c <_POSIX_Condition_variables_Wait_support+0x5c>
}
(void) pthread_mutex_unlock( mutex );
61bc: e1a00004 mov r0, r4
61c0: eb0000e3 bl 6554 <pthread_mutex_unlock>
_Thread_Enable_dispatch();
return EINVAL;
}
*/
if ( !already_timedout ) {
61c4: e3570000 cmp r7, #0
61c8: 0a000006 beq 61e8 <_POSIX_Condition_variables_Wait_support+0xb8>
status = _Thread_Executing->Wait.return_code;
if ( status && status != ETIMEDOUT )
return status;
} else {
_Thread_Enable_dispatch();
61cc: eb000c68 bl 9374 <_Thread_Enable_dispatch>
61d0: e3a05074 mov r5, #116 ; 0x74
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
61d4: e1a00004 mov r0, r4
61d8: eb0000bc bl 64d0 <pthread_mutex_lock>
if ( mutex_status )
61dc: e3500000 cmp r0, #0
61e0: 0affffe9 beq 618c <_POSIX_Condition_variables_Wait_support+0x5c>
61e4: eaffffe7 b 6188 <_POSIX_Condition_variables_Wait_support+0x58>
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
61e8: e59f5054 ldr r5, [pc, #84] ; 6244 <_POSIX_Condition_variables_Wait_support+0x114>
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
61ec: e5942000 ldr r2, [r4]
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
61f0: e5953000 ldr r3, [r5]
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
61f4: e58a2014 str r2, [sl, #20]
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
61f8: e5837034 str r7, [r3, #52] ; 0x34
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
61fc: e5961000 ldr r1, [r6]
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
6200: e28a2018 add r2, sl, #24
_Thread_Executing->Wait.id = *cond;
6204: e5831020 str r1, [r3, #32]
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
6208: e3a01001 mov r1, #1
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
620c: e5832044 str r2, [r3, #68] ; 0x44
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
6210: e1a00002 mov r0, r2
6214: e58a1048 str r1, [sl, #72] ; 0x48
6218: e59f2028 ldr r2, [pc, #40] ; 6248 <_POSIX_Condition_variables_Wait_support+0x118>
621c: e1a01008 mov r1, r8
6220: eb000d99 bl 988c <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
6224: eb000c52 bl 9374 <_Thread_Enable_dispatch>
/*
* Switch ourself out because we blocked as a result of the
* _Thread_queue_Enqueue.
*/
status = _Thread_Executing->Wait.return_code;
6228: e5953000 ldr r3, [r5]
622c: e5935034 ldr r5, [r3, #52] ; 0x34
if ( status && status != ETIMEDOUT )
6230: e3550074 cmp r5, #116 ; 0x74
6234: 13550000 cmpne r5, #0
6238: 0affffe5 beq 61d4 <_POSIX_Condition_variables_Wait_support+0xa4>
623c: eaffffd2 b 618c <_POSIX_Condition_variables_Wait_support+0x5c><== NOT EXECUTED
0000d884 <_POSIX_signals_Clear_process_signals>:
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
d884: e10f2000 mrs r2, CPSR
d888: e3823080 orr r3, r2, #128 ; 0x80
d88c: e129f003 msr CPSR_fc, r3
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
d890: e59f1064 ldr r1, [pc, #100] ; d8fc <_POSIX_signals_Clear_process_signals+0x78>
d894: e0803080 add r3, r0, r0, lsl #1
d898: e7911103 ldr r1, [r1, r3, lsl #2]
d89c: e3510002 cmp r1, #2
d8a0: e1a01103 lsl r1, r3, #2
d8a4: 0a00000c beq d8dc <_POSIX_signals_Clear_process_signals+0x58>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
d8a8: e59f3050 ldr r3, [pc, #80] ; d900 <_POSIX_signals_Clear_process_signals+0x7c>
d8ac: e5931000 ldr r1, [r3]
d8b0: e3a0c001 mov ip, #1
d8b4: e2400001 sub r0, r0, #1
d8b8: e1c1001c bic r0, r1, ip, lsl r0
if ( !_POSIX_signals_Pending )
d8bc: e3500000 cmp r0, #0
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
d8c0: e5830000 str r0, [r3]
if ( !_POSIX_signals_Pending )
_Thread_Do_post_task_switch_extension--;
d8c4: 059f3038 ldreq r3, [pc, #56] ; d904 <_POSIX_signals_Clear_process_signals+0x80>
d8c8: 05931000 ldreq r1, [r3]
d8cc: 02411001 subeq r1, r1, #1
d8d0: 05831000 streq r1, [r3]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
d8d4: e129f002 msr CPSR_fc, r2
}
_ISR_Enable( level );
}
d8d8: e12fff1e bx lr
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
d8dc: e59fc024 ldr ip, [pc, #36] ; d908 <_POSIX_signals_Clear_process_signals+0x84>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
d8e0: e79c3103 ldr r3, [ip, r3, lsl #2]
d8e4: e08c1001 add r1, ip, r1
d8e8: e2811004 add r1, r1, #4
d8ec: e1530001 cmp r3, r1
d8f0: 0affffec beq d8a8 <_POSIX_signals_Clear_process_signals+0x24>
d8f4: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
_POSIX_signals_Pending &= ~mask;
if ( !_POSIX_signals_Pending )
_Thread_Do_post_task_switch_extension--;
}
_ISR_Enable( level );
}
d8f8: e12fff1e bx lr <== NOT EXECUTED
000076ac <_Thread_queue_Enqueue_priority>:
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
76ac: e5913014 ldr r3, [r1, #20]
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
76b0: e92d05f0 push {r4, r5, r6, r7, r8, sl}
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
76b4: e1a0c323 lsr ip, r3, #6
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
76b8: e281503c add r5, r1, #60 ; 0x3c
76bc: e08cc08c add ip, ip, ip, lsl #1
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
76c0: e3130020 tst r3, #32
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
76c4: e2814038 add r4, r1, #56 ; 0x38
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
76c8: e5815038 str r5, [r1, #56] ; 0x38
the_chain->permanent_null = NULL;
76cc: e3a05000 mov r5, #0
76d0: e581503c str r5, [r1, #60] ; 0x3c
the_chain->last = _Chain_Head(the_chain);
76d4: e5814040 str r4, [r1, #64] ; 0x40
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
76d8: e080c10c add ip, r0, ip, lsl #2
block_state = the_thread_queue->state;
76dc: e5906038 ldr r6, [r0, #56] ; 0x38
76e0: 159fa178 ldrne sl, [pc, #376] ; 7860 <_Thread_queue_Enqueue_priority+0x1b4>
if ( _Thread_queue_Is_reverse_search( priority ) )
76e4: 1a00001c bne 775c <_Thread_queue_Enqueue_priority+0xb0>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
76e8: e28ca004 add sl, ip, #4
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
76ec: e10f8000 mrs r8, CPSR
76f0: e3884080 orr r4, r8, #128 ; 0x80
76f4: e129f004 msr CPSR_fc, r4
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
76f8: e59c4000 ldr r4, [ip]
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
76fc: e154000a cmp r4, sl
7700: 1a000009 bne 772c <_Thread_queue_Enqueue_priority+0x80>
7704: ea000052 b 7854 <_Thread_queue_Enqueue_priority+0x1a8>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7708: e10f7000 mrs r7, CPSR
770c: e129f008 msr CPSR_fc, r8
7710: e129f007 msr CPSR_fc, r7
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
7714: e5947010 ldr r7, [r4, #16]
7718: e1160007 tst r6, r7
771c: 0a000033 beq 77f0 <_Thread_queue_Enqueue_priority+0x144>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
7720: e5944000 ldr r4, [r4]
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7724: e154000a cmp r4, sl
7728: 0a000002 beq 7738 <_Thread_queue_Enqueue_priority+0x8c>
search_priority = search_thread->current_priority;
772c: e5945014 ldr r5, [r4, #20]
if ( priority <= search_priority )
7730: e1530005 cmp r3, r5
7734: 8afffff3 bhi 7708 <_Thread_queue_Enqueue_priority+0x5c>
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7738: e1a06008 mov r6, r8
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
773c: e590c030 ldr ip, [r0, #48] ; 0x30
7740: e35c0001 cmp ip, #1
7744: 0a00002b beq 77f8 <_Thread_queue_Enqueue_priority+0x14c>
* For example, the blocking thread could have been given
* the mutex by an ISR or timed out.
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
7748: e5826000 str r6, [r2]
return the_thread_queue->sync_state;
774c: e1a0000c mov r0, ip
}
7750: e8bd05f0 pop {r4, r5, r6, r7, r8, sl}
7754: e12fff1e bx lr
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
7758: e129f008 msr CPSR_fc, r8
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
775c: e5da5000 ldrb r5, [sl]
7760: e2855001 add r5, r5, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
7764: e10f8000 mrs r8, CPSR
7768: e3884080 orr r4, r8, #128 ; 0x80
776c: e129f004 msr CPSR_fc, r4
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
7770: e59c4008 ldr r4, [ip, #8]
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
7774: e154000c cmp r4, ip
7778: 1a000009 bne 77a4 <_Thread_queue_Enqueue_priority+0xf8>
777c: ea00000b b 77b0 <_Thread_queue_Enqueue_priority+0x104>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
7780: e10f7000 mrs r7, CPSR
7784: e129f008 msr CPSR_fc, r8
7788: e129f007 msr CPSR_fc, r7
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
778c: e5947010 ldr r7, [r4, #16]
7790: e1160007 tst r6, r7
7794: 0affffef beq 7758 <_Thread_queue_Enqueue_priority+0xac>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
7798: e5944004 ldr r4, [r4, #4]
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
779c: e154000c cmp r4, ip
77a0: 0a000002 beq 77b0 <_Thread_queue_Enqueue_priority+0x104>
search_priority = search_thread->current_priority;
77a4: e5945014 ldr r5, [r4, #20]
if ( priority >= search_priority )
77a8: e1530005 cmp r3, r5
77ac: 3afffff3 bcc 7780 <_Thread_queue_Enqueue_priority+0xd4>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
77b0: e590c030 ldr ip, [r0, #48] ; 0x30
77b4: e35c0001 cmp ip, #1
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->last;
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
77b8: e1a06008 mov r6, r8
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
77bc: 1affffe1 bne 7748 <_Thread_queue_Enqueue_priority+0x9c>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
77c0: e1530005 cmp r3, r5
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
77c4: e3a03000 mov r3, #0
77c8: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
77cc: 0a000016 beq 782c <_Thread_queue_Enqueue_priority+0x180>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
77d0: e5943000 ldr r3, [r4]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
77d4: e8810018 stm r1, {r3, r4}
search_node->next = the_node;
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
77d8: e5810044 str r0, [r1, #68] ; 0x44
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
search_node->next = the_node;
77dc: e5841000 str r1, [r4]
next_node->previous = the_node;
77e0: e5831004 str r1, [r3, #4]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
77e4: e129f008 msr CPSR_fc, r8
77e8: e3a00001 mov r0, #1
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
77ec: eaffffd7 b 7750 <_Thread_queue_Enqueue_priority+0xa4>
77f0: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED
77f4: eaffffbc b 76ec <_Thread_queue_Enqueue_priority+0x40> <== NOT EXECUTED
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
77f8: e1530005 cmp r3, r5
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
77fc: e3a03000 mov r3, #0
7800: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
7804: 0a000008 beq 782c <_Thread_queue_Enqueue_priority+0x180>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
7808: e5943004 ldr r3, [r4, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
780c: e5814000 str r4, [r1]
the_node->previous = previous_node;
7810: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
search_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
7814: e5810044 str r0, [r1, #68] ; 0x44
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
previous_node->next = the_node;
7818: e5831000 str r1, [r3]
search_node->previous = the_node;
781c: e5841004 str r1, [r4, #4]
7820: e129f008 msr CPSR_fc, r8
7824: e3a00001 mov r0, #1
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7828: eaffffc8 b 7750 <_Thread_queue_Enqueue_priority+0xa4>
782c: e284403c add r4, r4, #60 ; 0x3c
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
7830: e5943004 ldr r3, [r4, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
7834: e5814000 str r4, [r1]
the_node->previous = previous_node;
7838: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
search_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
783c: e5810044 str r0, [r1, #68] ; 0x44
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
previous_node->next = the_node;
7840: e5831000 str r1, [r3]
search_node->previous = the_node;
7844: e5841004 str r1, [r4, #4]
7848: e129f006 msr CPSR_fc, r6
784c: e3a00001 mov r0, #1
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7850: eaffffbe b 7750 <_Thread_queue_Enqueue_priority+0xa4>
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) header->first;
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7854: e1a06008 mov r6, r8
7858: e3e05000 mvn r5, #0
785c: eaffffb6 b 773c <_Thread_queue_Enqueue_priority+0x90>
000162d0 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
162d0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
162d4: e24dd024 sub sp, sp, #36 ; 0x24
162d8: e28d700c add r7, sp, #12
162dc: e28d2018 add r2, sp, #24
162e0: e1a04000 mov r4, r0
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
162e4: e3a03000 mov r3, #0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
162e8: e282a004 add sl, r2, #4
162ec: e2872004 add r2, r7, #4
162f0: e58d2000 str r2, [sp]
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
162f4: e58d301c str r3, [sp, #28]
the_chain->last = _Chain_Head(the_chain);
162f8: e28d0018 add r0, sp, #24
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
162fc: e58d200c str r2, [sp, #12]
the_chain->permanent_null = NULL;
16300: e58d3010 str r3, [sp, #16]
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16304: e2842008 add r2, r4, #8
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16308: e2843040 add r3, r4, #64 ; 0x40
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
1630c: e58da018 str sl, [sp, #24]
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
16310: e58d0020 str r0, [sp, #32]
16314: e58d7014 str r7, [sp, #20]
16318: e59f91a0 ldr r9, [pc, #416] ; 164c0 <_Timer_server_Body+0x1f0>
1631c: e59fb1a0 ldr fp, [pc, #416] ; 164c4 <_Timer_server_Body+0x1f4>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16320: e58d2008 str r2, [sp, #8]
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16324: e58d3004 str r3, [sp, #4]
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16328: e2846030 add r6, r4, #48 ; 0x30
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
1632c: e2848068 add r8, r4, #104 ; 0x68
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
16330: e28d0018 add r0, sp, #24
16334: e5840078 str r0, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
16338: e5993000 ldr r3, [r9]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
1633c: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16340: e1a00006 mov r0, r6
16344: e0611003 rsb r1, r1, r3
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
16348: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
1634c: e1a02007 mov r2, r7
16350: eb00111f bl 1a7d4 <_Watchdog_Adjust_to_chain>
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
16354: e59b5000 ldr r5, [fp]
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
16358: e5941074 ldr r1, [r4, #116] ; 0x74
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
1635c: e1550001 cmp r5, r1
16360: 8a000022 bhi 163f0 <_Timer_server_Body+0x120>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
16364: 3a000018 bcc 163cc <_Timer_server_Body+0xfc>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
16368: e5845074 str r5, [r4, #116] ; 0x74
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
1636c: e5940078 ldr r0, [r4, #120] ; 0x78
16370: eb00025c bl 16ce8 <_Chain_Get>
if ( timer == NULL ) {
16374: e3500000 cmp r0, #0
16378: 0a00000b beq 163ac <_Timer_server_Body+0xdc>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
1637c: e5903038 ldr r3, [r0, #56] ; 0x38
16380: e3530001 cmp r3, #1
16384: 0a000015 beq 163e0 <_Timer_server_Body+0x110>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
16388: e3530003 cmp r3, #3
1638c: 1afffff6 bne 1636c <_Timer_server_Body+0x9c>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
16390: e2801010 add r1, r0, #16
16394: e1a00008 mov r0, r8
16398: eb00113c bl 1a890 <_Watchdog_Insert>
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
1639c: e5940078 ldr r0, [r4, #120] ; 0x78
163a0: eb000250 bl 16ce8 <_Chain_Get>
if ( timer == NULL ) {
163a4: e3500000 cmp r0, #0
163a8: 1afffff3 bne 1637c <_Timer_server_Body+0xac>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
163ac: e10f2000 mrs r2, CPSR
163b0: e3823080 orr r3, r2, #128 ; 0x80
163b4: e129f003 msr CPSR_fc, r3
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
163b8: e59d3018 ldr r3, [sp, #24]
163bc: e15a0003 cmp sl, r3
163c0: 0a00000f beq 16404 <_Timer_server_Body+0x134>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
163c4: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
163c8: eaffffda b 16338 <_Timer_server_Body+0x68> <== NOT EXECUTED
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
163cc: e0652001 rsb r2, r5, r1
163d0: e1a00008 mov r0, r8
163d4: e3a01001 mov r1, #1
163d8: eb0010ce bl 1a718 <_Watchdog_Adjust>
163dc: eaffffe1 b 16368 <_Timer_server_Body+0x98>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
163e0: e2801010 add r1, r0, #16
163e4: e1a00006 mov r0, r6
163e8: eb001128 bl 1a890 <_Watchdog_Insert>
163ec: eaffffde b 1636c <_Timer_server_Body+0x9c>
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
163f0: e0611005 rsb r1, r1, r5
163f4: e1a00008 mov r0, r8
163f8: e1a02007 mov r2, r7
163fc: eb0010f4 bl 1a7d4 <_Watchdog_Adjust_to_chain>
16400: eaffffd8 b 16368 <_Timer_server_Body+0x98>
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
16404: e5840078 str r0, [r4, #120] ; 0x78
16408: e129f002 msr CPSR_fc, r2
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
1640c: e59d300c ldr r3, [sp, #12]
16410: e59d2000 ldr r2, [sp]
16414: e1520003 cmp r2, r3
16418: 159d5000 ldrne r5, [sp]
1641c: 1a00000a bne 1644c <_Timer_server_Body+0x17c>
16420: ea000011 b 1646c <_Timer_server_Body+0x19c>
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
16424: e5932000 ldr r2, [r3]
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
16428: e3a00000 mov r0, #0
the_chain->first = new_first;
1642c: e58d200c str r2, [sp, #12]
16430: e5830008 str r0, [r3, #8]
new_first->previous = _Chain_Head(the_chain);
16434: e5827004 str r7, [r2, #4]
16438: e129f001 msr CPSR_fc, r1
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
1643c: e2830020 add r0, r3, #32
16440: e8900003 ldm r0, {r0, r1}
16444: e1a0e00f mov lr, pc
16448: e593f01c ldr pc, [r3, #28]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
1644c: e10f1000 mrs r1, CPSR
16450: e3813080 orr r3, r1, #128 ; 0x80
16454: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
16458: e59d300c ldr r3, [sp, #12]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
1645c: e1550003 cmp r5, r3
16460: 1affffef bne 16424 <_Timer_server_Body+0x154>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
16464: e129f001 msr CPSR_fc, r1
16468: eaffffb0 b 16330 <_Timer_server_Body+0x60>
}
} else {
ts->active = false;
1646c: e3a02000 mov r2, #0
16470: e5c4207c strb r2, [r4, #124] ; 0x7c
16474: e59f004c ldr r0, [pc, #76] ; 164c8 <_Timer_server_Body+0x1f8>
16478: e5903000 ldr r3, [r0]
1647c: e2833001 add r3, r3, #1
16480: e5803000 str r3, [r0]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
16484: e3a01008 mov r1, #8
16488: e5940000 ldr r0, [r4]
1648c: eb000e25 bl 19d28 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
16490: e1a00004 mov r0, r4
16494: ebffff61 bl 16220 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
16498: e1a00004 mov r0, r4
1649c: ebffff75 bl 16278 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
164a0: eb000b62 bl 19230 <_Thread_Enable_dispatch>
ts->active = true;
164a4: e3a02001 mov r2, #1
164a8: e5c4207c strb r2, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
164ac: e59d0008 ldr r0, [sp, #8]
164b0: eb001159 bl 1aa1c <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
164b4: e59d0004 ldr r0, [sp, #4]
164b8: eb001157 bl 1aa1c <_Watchdog_Remove>
164bc: eaffff9b b 16330 <_Timer_server_Body+0x60>
0000a1c8 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
a1c8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
a1cc: e1a04000 mov r4, r0
a1d0: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a1d4: e10f3000 mrs r3, CPSR
a1d8: e3832080 orr r2, r3, #128 ; 0x80
a1dc: e129f002 msr CPSR_fc, r2
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
a1e0: e1a07000 mov r7, r0
a1e4: e4972004 ldr r2, [r7], #4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
a1e8: e1520007 cmp r2, r7
a1ec: 0a000018 beq a254 <_Watchdog_Adjust+0x8c>
switch ( direction ) {
a1f0: e3510000 cmp r1, #0
a1f4: 1a000018 bne a25c <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a1f8: e3550000 cmp r5, #0
a1fc: 0a000014 beq a254 <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a200: e5926010 ldr r6, [r2, #16]
a204: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a208: 23a08001 movcs r8, #1
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
a20c: 2a000005 bcs a228 <_Watchdog_Adjust+0x60>
a210: ea000018 b a278 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a214: e0555006 subs r5, r5, r6
a218: 0a00000d beq a254 <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a21c: e5926010 ldr r6, [r2, #16]
a220: e1560005 cmp r6, r5
a224: 8a000013 bhi a278 <_Watchdog_Adjust+0xb0>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a228: e5828010 str r8, [r2, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a22c: e129f003 msr CPSR_fc, r3
_ISR_Enable( level );
_Watchdog_Tickle( header );
a230: e1a00004 mov r0, r4
a234: eb0000a0 bl a4bc <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a238: e10f3000 mrs r3, CPSR
a23c: e3832080 orr r2, r3, #128 ; 0x80
a240: e129f002 msr CPSR_fc, r2
a244: e5941000 ldr r1, [r4]
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
a248: e1570001 cmp r7, r1
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) header->first );
a24c: e1a02001 mov r2, r1
a250: 1affffef bne a214 <_Watchdog_Adjust+0x4c>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a254: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a258: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
a25c: e3510001 cmp r1, #1
a260: 1afffffb bne a254 <_Watchdog_Adjust+0x8c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
a264: e5921010 ldr r1, [r2, #16]
a268: e0815005 add r5, r1, r5
a26c: e5825010 str r5, [r2, #16]
a270: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a274: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
a278: e0655006 rsb r5, r5, r6
a27c: e5825010 str r5, [r2, #16]
break;
a280: eafffff3 b a254 <_Watchdog_Adjust+0x8c>
0000d5a8 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
d5a8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
d5ac: e24dd00c sub sp, sp, #12
d5b0: e1a04000 mov r4, r0
d5b4: e1a05001 mov r5, r1
d5b8: e1a08002 mov r8, r2
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
d5bc: ebfffc1d bl c638 <getpid>
d5c0: e1500004 cmp r0, r4
d5c4: 1a000095 bne d820 <killinfo+0x278>
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed.
*/
if ( !sig )
d5c8: e3550000 cmp r5, #0
d5cc: 0a000098 beq d834 <killinfo+0x28c>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
d5d0: e2453001 sub r3, r5, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
d5d4: e353001f cmp r3, #31
d5d8: 8a000095 bhi d834 <killinfo+0x28c>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
d5dc: e59f627c ldr r6, [pc, #636] ; d860 <killinfo+0x2b8>
d5e0: e1a07085 lsl r7, r5, #1
d5e4: e0872005 add r2, r7, r5
d5e8: e0862102 add r2, r6, r2, lsl #2
d5ec: e5922008 ldr r2, [r2, #8]
d5f0: e3520001 cmp r2, #1
d5f4: 0a000039 beq d6e0 <killinfo+0x138>
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
d5f8: e3550008 cmp r5, #8
d5fc: 13550004 cmpne r5, #4
d600: 0a000039 beq d6ec <killinfo+0x144>
d604: e355000b cmp r5, #11
d608: 0a000037 beq d6ec <killinfo+0x144>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
d60c: e3a04001 mov r4, #1
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
d610: e58d4004 str r4, [sp, #4]
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
d614: e58d5000 str r5, [sp]
siginfo->si_code = SI_USER;
if ( !value ) {
d618: e3580000 cmp r8, #0
d61c: e1a04314 lsl r4, r4, r3
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
d620: 15983000 ldrne r3, [r8]
d624: 158d3008 strne r3, [sp, #8]
d628: e59f3234 ldr r3, [pc, #564] ; d864 <killinfo+0x2bc>
d62c: e5932000 ldr r2, [r3]
d630: e2822001 add r2, r2, #1
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
if ( !value ) {
siginfo->si_value.sival_int = 0;
d634: 058d8008 streq r8, [sp, #8]
d638: e5832000 str r2, [r3]
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
d63c: e59f3224 ldr r3, [pc, #548] ; d868 <killinfo+0x2c0>
d640: e5930000 ldr r0, [r3]
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
d644: e5903108 ldr r3, [r0, #264] ; 0x108
d648: e59330cc ldr r3, [r3, #204] ; 0xcc
d64c: e1d43003 bics r3, r4, r3
d650: 1a000014 bne d6a8 <killinfo+0x100>
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
d654: e59f1210 ldr r1, [pc, #528] ; d86c <killinfo+0x2c4>
d658: e4913004 ldr r3, [r1], #4
d65c: e1530001 cmp r3, r1
d660: 0a000036 beq d740 <killinfo+0x198>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
d664: e5932030 ldr r2, [r3, #48] ; 0x30
d668: e1140002 tst r4, r2
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
d66c: e1a00003 mov r0, r3
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
d670: e5932108 ldr r2, [r3, #264] ; 0x108
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
d674: 0a000008 beq d69c <killinfo+0xf4>
d678: ea00000a b d6a8 <killinfo+0x100>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
d67c: e5933000 ldr r3, [r3]
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = the_chain->first ;
d680: e1530001 cmp r3, r1
d684: 0a00002d beq d740 <killinfo+0x198>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
d688: e5932030 ldr r2, [r3, #48] ; 0x30 <== NOT EXECUTED
d68c: e1140002 tst r4, r2 <== NOT EXECUTED
for ( the_node = the_chain->first ;
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
d690: e1a00003 mov r0, r3 <== NOT EXECUTED
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
d694: e5932108 ldr r2, [r3, #264] ; 0x108 <== NOT EXECUTED
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
d698: 1a000002 bne d6a8 <killinfo+0x100> <== NOT EXECUTED
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
d69c: e59220cc ldr r2, [r2, #204] ; 0xcc
d6a0: e1d42002 bics r2, r4, r2
d6a4: 0afffff4 beq d67c <killinfo+0xd4>
* thread needs to do the post context switch extension so it can
* evaluate the signals pending.
*/
process_it:
the_thread->do_post_task_switch_extension = true;
d6a8: e3a03001 mov r3, #1
d6ac: e5c03074 strb r3, [r0, #116] ; 0x74
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
d6b0: e1a01005 mov r1, r5
d6b4: e1a0200d mov r2, sp
d6b8: eb0000a5 bl d954 <_POSIX_signals_Unblock_thread>
d6bc: e3500000 cmp r0, #0
d6c0: 1a00001b bne d734 <killinfo+0x18c>
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
d6c4: e0875005 add r5, r7, r5
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
d6c8: e1a00004 mov r0, r4
d6cc: eb00008e bl d90c <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
d6d0: e7963105 ldr r3, [r6, r5, lsl #2]
d6d4: e3530002 cmp r3, #2
d6d8: 0a000007 beq d6fc <killinfo+0x154>
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
d6dc: ebffe681 bl 70e8 <_Thread_Enable_dispatch>
d6e0: e3a00000 mov r0, #0
return 0;
}
d6e4: e28dd00c add sp, sp, #12
d6e8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
return pthread_kill( pthread_self(), sig );
d6ec: eb000123 bl db80 <pthread_self>
d6f0: e1a01005 mov r1, r5
d6f4: eb0000e3 bl da88 <pthread_kill>
d6f8: eafffff9 b d6e4 <killinfo+0x13c>
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
d6fc: e59f016c ldr r0, [pc, #364] ; d870 <killinfo+0x2c8>
d700: ebffe0ba bl 59f0 <_Chain_Get>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
d704: e250c000 subs ip, r0, #0
d708: 0a00004e beq d848 <killinfo+0x2a0>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
d70c: e1a0300d mov r3, sp
d710: e8930007 ldm r3, {r0, r1, r2}
d714: e28c3008 add r3, ip, #8
d718: e8830007 stm r3, {r0, r1, r2}
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
d71c: e59f0150 ldr r0, [pc, #336] ; d874 <killinfo+0x2cc>
d720: e1a0100c mov r1, ip
d724: e0800105 add r0, r0, r5, lsl #2
d728: ebffe0a5 bl 59c4 <_Chain_Append>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
d72c: ebffe66d bl 70e8 <_Thread_Enable_dispatch>
d730: eaffffea b d6e0 <killinfo+0x138>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
_Thread_Enable_dispatch();
d734: ebffe66b bl 70e8 <_Thread_Enable_dispatch>
d738: e3a00000 mov r0, #0
return 0;
d73c: eaffffe8 b d6e4 <killinfo+0x13c>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
d740: e59f3130 ldr r3, [pc, #304] ; d878 <killinfo+0x2d0>
d744: e5d3c000 ldrb ip, [r3]
d748: e59f812c ldr r8, [pc, #300] ; d87c <killinfo+0x2d4>
d74c: e28cc001 add ip, ip, #1
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
d750: e3a0a000 mov sl, #0
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and ITRON is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
d754: e5983008 ldr r3, [r8, #8]
d758: e3530000 cmp r3, #0
d75c: 0a000020 beq d7e4 <killinfo+0x23c>
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
d760: e5933004 ldr r3, [r3, #4]
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
d764: e1d301b0 ldrh r0, [r3, #16]
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
d768: e3500000 cmp r0, #0
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
d76c: e593e01c ldr lr, [r3, #28]
for ( index = 1 ; index <= maximum ; index++ ) {
d770: 0a00001b beq d7e4 <killinfo+0x23c>
d774: e3a03001 mov r3, #1
the_thread = (Thread_Control *) object_table[ index ];
d778: e79e2103 ldr r2, [lr, r3, lsl #2]
if ( !the_thread )
d77c: e3520000 cmp r2, #0
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
d780: e2833001 add r3, r3, #1
the_thread = (Thread_Control *) object_table[ index ];
if ( !the_thread )
d784: 0a000014 beq d7dc <killinfo+0x234>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
d788: e5921014 ldr r1, [r2, #20]
d78c: e151000c cmp r1, ip
d790: 8a000011 bhi d7dc <killinfo+0x234>
DEBUG_STEP("2");
/*
* If this thread is not interested, then go on to the next thread.
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
d794: e5929108 ldr r9, [r2, #264] ; 0x108
d798: e59990cc ldr r9, [r9, #204] ; 0xcc
d79c: e1d49009 bics r9, r4, r9
d7a0: 0a00000d beq d7dc <killinfo+0x234>
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( the_thread->current_priority < interested_priority ) {
d7a4: e151000c cmp r1, ip
d7a8: 3a000009 bcc d7d4 <killinfo+0x22c>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( !_States_Is_ready( interested->current_state ) ) {
d7ac: e59a9010 ldr r9, [sl, #16]
d7b0: e3590000 cmp r9, #0
d7b4: 0a000008 beq d7dc <killinfo+0x234>
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
d7b8: e592b010 ldr fp, [r2, #16]
d7bc: e35b0000 cmp fp, #0
d7c0: 0a000003 beq d7d4 <killinfo+0x22c>
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
d7c4: e3190201 tst r9, #268435456 ; 0x10000000
d7c8: 1a000003 bne d7dc <killinfo+0x234>
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
d7cc: e31b0201 tst fp, #268435456 ; 0x10000000
d7d0: 0a000001 beq d7dc <killinfo+0x234>
d7d4: e1a0c001 mov ip, r1
d7d8: e1a0a002 mov sl, r2
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
d7dc: e1500003 cmp r0, r3
d7e0: 2affffe4 bcs d778 <killinfo+0x1d0>
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
d7e4: e59f3094 ldr r3, [pc, #148] ; d880 <killinfo+0x2d8>
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
d7e8: e2888004 add r8, r8, #4
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
d7ec: e1580003 cmp r8, r3
d7f0: 1affffd7 bne d754 <killinfo+0x1ac>
}
}
}
}
if ( interested ) {
d7f4: e35a0000 cmp sl, #0
d7f8: 0affffb1 beq d6c4 <killinfo+0x11c>
d7fc: e1a0000a mov r0, sl
* thread needs to do the post context switch extension so it can
* evaluate the signals pending.
*/
process_it:
the_thread->do_post_task_switch_extension = true;
d800: e3a03001 mov r3, #1
d804: e5c03074 strb r3, [r0, #116] ; 0x74
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
d808: e1a01005 mov r1, r5
d80c: e1a0200d mov r2, sp
d810: eb00004f bl d954 <_POSIX_signals_Unblock_thread>
d814: e3500000 cmp r0, #0
d818: 0affffa9 beq d6c4 <killinfo+0x11c>
d81c: eaffffc4 b d734 <killinfo+0x18c> <== NOT EXECUTED
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
d820: eb000105 bl dc3c <__errno>
d824: e3a03003 mov r3, #3
d828: e5803000 str r3, [r0]
d82c: e3e00000 mvn r0, #0
d830: eaffffab b d6e4 <killinfo+0x13c>
*/
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
d834: eb000100 bl dc3c <__errno>
d838: e3a03016 mov r3, #22
d83c: e5803000 str r3, [r0]
d840: e3e00000 mvn r0, #0
d844: eaffffa6 b d6e4 <killinfo+0x13c>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_Thread_Enable_dispatch();
d848: ebffe626 bl 70e8 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
d84c: eb0000fa bl dc3c <__errno>
d850: e3a0300b mov r3, #11
d854: e5803000 str r3, [r0]
d858: e3e00000 mvn r0, #0
d85c: eaffffa0 b d6e4 <killinfo+0x13c>
00006360 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
6360: e92d4030 push {r4, r5, lr}
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
6364: e2505000 subs r5, r0, #0
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
6368: e24dd00c sub sp, sp, #12
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
636c: 0a00001d beq 63e8 <pthread_rwlock_timedrdlock+0x88>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
6370: e1a00001 mov r0, r1
6374: e28d1004 add r1, sp, #4
6378: eb00197a bl c968 <_POSIX_Absolute_timeout_to_ticks>
637c: e5951000 ldr r1, [r5]
6380: e1a04000 mov r4, r0
6384: e28d2008 add r2, sp, #8
6388: e59f0090 ldr r0, [pc, #144] ; 6420 <pthread_rwlock_timedrdlock+0xc0>
638c: eb000a84 bl 8da4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
6390: e59dc008 ldr ip, [sp, #8]
6394: e35c0000 cmp ip, #0
6398: 1a000012 bne 63e8 <pthread_rwlock_timedrdlock+0x88>
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
639c: e5951000 ldr r1, [r5]
int _EXFUN(pthread_rwlock_init,
(pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr));
int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedrdlock,
63a0: e3540003 cmp r4, #3
63a4: 13a05000 movne r5, #0
63a8: 03a05001 moveq r5, #1
63ac: e2800010 add r0, r0, #16
63b0: e59d3004 ldr r3, [sp, #4]
63b4: e1a02005 mov r2, r5
63b8: e58dc000 str ip, [sp]
63bc: eb000725 bl 8058 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
63c0: eb000cb2 bl 9690 <_Thread_Enable_dispatch>
if ( !do_wait ) {
63c4: e3550000 cmp r5, #0
63c8: 1a00000f bne 640c <pthread_rwlock_timedrdlock+0xac>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
63cc: e59f3050 ldr r3, [pc, #80] ; 6424 <pthread_rwlock_timedrdlock+0xc4>
63d0: e5933000 ldr r3, [r3]
63d4: e5930034 ldr r0, [r3, #52] ; 0x34
63d8: e3500002 cmp r0, #2
63dc: 0a000004 beq 63f4 <pthread_rwlock_timedrdlock+0x94>
break;
}
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
63e0: eb000042 bl 64f0 <_POSIX_RWLock_Translate_core_RWLock_return_code>
63e4: ea000000 b 63ec <pthread_rwlock_timedrdlock+0x8c>
63e8: e3a00016 mov r0, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
63ec: e28dd00c add sp, sp, #12
63f0: e8bd8030 pop {r4, r5, pc}
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
switch (status) {
63f4: e3540000 cmp r4, #0
63f8: 0afffffa beq 63e8 <pthread_rwlock_timedrdlock+0x88>
63fc: e3540002 cmp r4, #2
6400: 93a00074 movls r0, #116 ; 0x74
6404: 9afffff8 bls 63ec <pthread_rwlock_timedrdlock+0x8c>
6408: eafffff4 b 63e0 <pthread_rwlock_timedrdlock+0x80> <== NOT EXECUTED
640c: e59f3010 ldr r3, [pc, #16] ; 6424 <pthread_rwlock_timedrdlock+0xc4>
6410: e5933000 ldr r3, [r3]
6414: e5930034 ldr r0, [r3, #52] ; 0x34
break;
}
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
6418: eb000034 bl 64f0 <_POSIX_RWLock_Translate_core_RWLock_return_code>
641c: eafffff2 b 63ec <pthread_rwlock_timedrdlock+0x8c>
00006428 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
6428: e92d4030 push {r4, r5, lr}
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
642c: e2505000 subs r5, r0, #0
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
6430: e24dd00c sub sp, sp, #12
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
6434: 0a00001d beq 64b0 <pthread_rwlock_timedwrlock+0x88>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
6438: e1a00001 mov r0, r1
643c: e28d1004 add r1, sp, #4
6440: eb001948 bl c968 <_POSIX_Absolute_timeout_to_ticks>
6444: e5951000 ldr r1, [r5]
6448: e1a04000 mov r4, r0
644c: e28d2008 add r2, sp, #8
6450: e59f0090 ldr r0, [pc, #144] ; 64e8 <pthread_rwlock_timedwrlock+0xc0>
6454: eb000a52 bl 8da4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
6458: e59dc008 ldr ip, [sp, #8]
645c: e35c0000 cmp ip, #0
6460: 1a000012 bne 64b0 <pthread_rwlock_timedwrlock+0x88>
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
6464: e5951000 ldr r1, [r5]
(pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedwrlock,
6468: e3540003 cmp r4, #3
646c: 13a05000 movne r5, #0
6470: 03a05001 moveq r5, #1
6474: e2800010 add r0, r0, #16
6478: e59d3004 ldr r3, [sp, #4]
647c: e1a02005 mov r2, r5
6480: e58dc000 str ip, [sp]
6484: eb00072a bl 8134 <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
6488: eb000c80 bl 9690 <_Thread_Enable_dispatch>
if ( !do_wait &&
648c: e3550000 cmp r5, #0
6490: 1a00000f bne 64d4 <pthread_rwlock_timedwrlock+0xac>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
6494: e59f3050 ldr r3, [pc, #80] ; 64ec <pthread_rwlock_timedwrlock+0xc4>
6498: e5933000 ldr r3, [r3]
649c: e5930034 ldr r0, [r3, #52] ; 0x34
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
64a0: e3500002 cmp r0, #2
64a4: 0a000004 beq 64bc <pthread_rwlock_timedwrlock+0x94>
case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
break;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
64a8: eb000010 bl 64f0 <_POSIX_RWLock_Translate_core_RWLock_return_code>
64ac: ea000000 b 64b4 <pthread_rwlock_timedwrlock+0x8c>
64b0: e3a00016 mov r0, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
64b4: e28dd00c add sp, sp, #12
64b8: e8bd8030 pop {r4, r5, pc}
);
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
switch (status) {
64bc: e3540000 cmp r4, #0
64c0: 0afffffa beq 64b0 <pthread_rwlock_timedwrlock+0x88>
64c4: e3540002 cmp r4, #2
64c8: 93a00074 movls r0, #116 ; 0x74
64cc: 9afffff8 bls 64b4 <pthread_rwlock_timedwrlock+0x8c>
64d0: eafffff4 b 64a8 <pthread_rwlock_timedwrlock+0x80> <== NOT EXECUTED
64d4: e59f3010 ldr r3, [pc, #16] ; 64ec <pthread_rwlock_timedwrlock+0xc4>
64d8: e5933000 ldr r3, [r3]
64dc: e5930034 ldr r0, [r3, #52] ; 0x34
case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE:
break;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
64e0: eb000002 bl 64f0 <_POSIX_RWLock_Translate_core_RWLock_return_code>
64e4: eafffff2 b 64b4 <pthread_rwlock_timedwrlock+0x8c>
00007168 <rtems_io_register_driver>:
rtems_device_major_number *registered_major
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
7168: e59f3144 ldr r3, [pc, #324] ; 72b4 <rtems_io_register_driver+0x14c>
716c: e593c000 ldr ip, [r3]
rtems_device_major_number major,
const rtems_driver_address_table *driver_table,
rtems_device_major_number *registered_major
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
7170: e59f3140 ldr r3, [pc, #320] ; 72b8 <rtems_io_register_driver+0x150>
if ( rtems_interrupt_is_in_progress() )
7174: e35c0000 cmp ip, #0
rtems_status_code rtems_io_register_driver(
rtems_device_major_number major,
const rtems_driver_address_table *driver_table,
rtems_device_major_number *registered_major
)
{
7178: e92d4010 push {r4, lr}
717c: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
7180: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
7184: 13a00012 movne r0, #18
7188: 18bd8010 popne {r4, pc}
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
718c: e3520000 cmp r2, #0
7190: 0a00003c beq 7288 <rtems_io_register_driver+0x120>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
if ( driver_table == NULL )
7194: e3510000 cmp r1, #0
if ( registered_major == NULL )
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
7198: e5820000 str r0, [r2]
if ( driver_table == NULL )
719c: 0a000039 beq 7288 <rtems_io_register_driver+0x120>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
71a0: e591c000 ldr ip, [r1]
71a4: e35c0000 cmp ip, #0
71a8: 0a000033 beq 727c <rtems_io_register_driver+0x114>
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
71ac: e1500004 cmp r0, r4
71b0: 93a0000a movls r0, #10
71b4: 98bd8010 popls {r4, pc}
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
71b8: e59f00fc ldr r0, [pc, #252] ; 72bc <rtems_io_register_driver+0x154>
71bc: e590c000 ldr ip, [r0]
71c0: e28cc001 add ip, ip, #1
71c4: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
71c8: e3540000 cmp r4, #0
71cc: 1a000020 bne 7254 <rtems_io_register_driver+0xec>
static rtems_status_code rtems_io_obtain_major_number(
rtems_device_major_number *major
)
{
rtems_device_major_number n = _IO_Number_of_drivers;
71d0: e593e000 ldr lr, [r3]
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
71d4: e35e0000 cmp lr, #0
71d8: 0a00002c beq 7290 <rtems_io_register_driver+0x128>
71dc: e59f30dc ldr r3, [pc, #220] ; 72c0 <rtems_io_register_driver+0x158>
71e0: e593c000 ldr ip, [r3]
71e4: e1a0300c mov r3, ip
71e8: ea000003 b 71fc <rtems_io_register_driver+0x94>
71ec: e2844001 add r4, r4, #1
71f0: e15e0004 cmp lr, r4
71f4: e2833018 add r3, r3, #24
71f8: 9a000005 bls 7214 <rtems_io_register_driver+0xac>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
71fc: e5930000 ldr r0, [r3]
7200: e3500000 cmp r0, #0
7204: 1afffff8 bne 71ec <rtems_io_register_driver+0x84>
7208: e5930004 ldr r0, [r3, #4]
720c: e3500000 cmp r0, #0
7210: 1afffff5 bne 71ec <rtems_io_register_driver+0x84>
}
/* Assigns invalid value in case of failure */
*major = m;
if ( m != n )
7214: e15e0004 cmp lr, r4
7218: 10843084 addne r3, r4, r4, lsl #1
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
721c: e5824000 str r4, [r2]
if ( m != n )
7220: 108cc183 addne ip, ip, r3, lsl #3
7224: 0a00001a beq 7294 <rtems_io_register_driver+0x12c>
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
7228: e1a0e001 mov lr, r1
722c: e8be000f ldm lr!, {r0, r1, r2, r3}
7230: e8ac000f stmia ip!, {r0, r1, r2, r3}
7234: e89e0003 ldm lr, {r0, r1}
7238: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
723c: eb00069b bl 8cb0 <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
7240: e3a01000 mov r1, #0
7244: e1a00004 mov r0, r4
7248: e1a02001 mov r2, r1
}
724c: e8bd4010 pop {r4, lr}
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
7250: ea00239d b 100cc <rtems_io_initialize>
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
7254: e59f3064 ldr r3, [pc, #100] ; 72c0 <rtems_io_register_driver+0x158>
7258: e5933000 ldr r3, [r3]
725c: e084c084 add ip, r4, r4, lsl #1
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7260: e793018c ldr r0, [r3, ip, lsl #3]
7264: e3500000 cmp r0, #0
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
7268: e083c18c add ip, r3, ip, lsl #3
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
726c: 0a00000b beq 72a0 <rtems_io_register_driver+0x138>
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
7270: eb00068e bl 8cb0 <_Thread_Enable_dispatch>
7274: e3a0000c mov r0, #12
return RTEMS_RESOURCE_IN_USE;
7278: e8bd8010 pop {r4, pc}
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
727c: e591c004 ldr ip, [r1, #4]
7280: e35c0000 cmp ip, #0
7284: 1affffc8 bne 71ac <rtems_io_register_driver+0x44>
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
7288: e3a00009 mov r0, #9
}
728c: e8bd8010 pop {r4, pc}
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
7290: e5824000 str r4, [r2] <== NOT EXECUTED
if ( major == 0 ) {
rtems_status_code sc = rtems_io_obtain_major_number( registered_major );
if ( sc != RTEMS_SUCCESSFUL ) {
_Thread_Enable_dispatch();
7294: eb000685 bl 8cb0 <_Thread_Enable_dispatch>
7298: e3a00005 mov r0, #5
return sc;
729c: e8bd8010 pop {r4, pc}
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
72a0: e59c3004 ldr r3, [ip, #4]
72a4: e3530000 cmp r3, #0
72a8: 1afffff0 bne 7270 <rtems_io_register_driver+0x108>
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
72ac: e5824000 str r4, [r2]
72b0: eaffffdc b 7228 <rtems_io_register_driver+0xc0>
00005a54 <sched_get_priority_min>:
int sched_get_priority_min(
int policy
)
{
switch ( policy ) {
5a54: e3500004 cmp r0, #4
#include <rtems/posix/priority.h>
int sched_get_priority_min(
int policy
)
{
5a58: e52de004 push {lr} ; (str lr, [sp, #-4]!)
switch ( policy ) {
5a5c: 9a000004 bls 5a74 <sched_get_priority_min+0x20>
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
5a60: eb002436 bl eb40 <__errno>
5a64: e3a03016 mov r3, #22
5a68: e5803000 str r3, [r0]
5a6c: e3e00000 mvn r0, #0
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
5a70: e49df004 pop {pc} ; (ldr pc, [sp], #4)
int sched_get_priority_min(
int policy
)
{
switch ( policy ) {
5a74: e3a03001 mov r3, #1
5a78: e1a00013 lsl r0, r3, r0
5a7c: e3100017 tst r0, #23
5a80: 11a00003 movne r0, r3
5a84: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
5a88: eb00242c bl eb40 <__errno> <== NOT EXECUTED
5a8c: e3a03016 mov r3, #22 <== NOT EXECUTED
5a90: e5803000 str r3, [r0] <== NOT EXECUTED
5a94: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
5a98: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
0000809c <sem_timedwait>:
int sem_timedwait(
sem_t *sem,
const struct timespec *abstime
)
{
809c: e92d4010 push {r4, lr}
80a0: e24dd004 sub sp, sp, #4
80a4: e1a04000 mov r4, r0
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
80a8: e1a00001 mov r0, r1
80ac: e1a0100d mov r1, sp
80b0: eb0015c4 bl d7c8 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
80b4: e3500003 cmp r0, #3
80b8: 0a000005 beq 80d4 <sem_timedwait+0x38>
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
80bc: e1a00004 mov r0, r4 <== NOT EXECUTED
80c0: e3a01000 mov r1, #0 <== NOT EXECUTED
80c4: e59d2000 ldr r2, [sp] <== NOT EXECUTED
80c8: eb00187f bl e2cc <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED
break;
}
}
return lock_status;
}
80cc: e28dd004 add sp, sp, #4
80d0: e8bd8010 pop {r4, pc}
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
80d4: e1a00004 mov r0, r4
80d8: e3a01001 mov r1, #1
80dc: e59d2000 ldr r2, [sp]
80e0: eb001879 bl e2cc <_POSIX_Semaphore_Wait_support>
80e4: eafffff8 b 80cc <sem_timedwait+0x30>