RTEMS 4.11Annotated Report
Fri Mar 11 19:14:47 2011
0000b1f8 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b1f8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
b1fc: e1a08002 mov r8, r2
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
b200: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b204: e24dd01c sub sp, sp, #28
b208: e1a05001 mov r5, r1
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
b20c: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b210: e1a07000 mov r7, r0
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
b214: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b218: e1a0b003 mov fp, r3
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
b21c: e58d200c str r2, [sp, #12]
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
b220: 2a00007a bcs b410 <_Heap_Allocate_aligned_with_boundary+0x218>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
b224: e3530000 cmp r3, #0
b228: 1a000076 bne b408 <_Heap_Allocate_aligned_with_boundary+0x210>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b22c: e5979008 ldr r9, [r7, #8]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b230: e1570009 cmp r7, r9
b234: 0a000075 beq b410 <_Heap_Allocate_aligned_with_boundary+0x218>
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;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
b238: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
b23c: e2651004 rsb r1, r5, #4
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;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
b240: e2833007 add r3, r3, #7
b244: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
b248: e58d1014 str r1, [sp, #20]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b24c: e3a06001 mov 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 ) {
b250: e599a004 ldr sl, [r9, #4]
b254: e59d2000 ldr r2, [sp]
b258: e152000a cmp r2, sl
b25c: 2a000050 bcs b3a4 <_Heap_Allocate_aligned_with_boundary+0x1ac>
if ( alignment == 0 ) {
b260: 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;
b264: 02894008 addeq r4, r9, #8
b268: 0a000053 beq b3bc <_Heap_Allocate_aligned_with_boundary+0x1c4>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b26c: e5973014 ldr r3, [r7, #20]
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_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
b270: e59d1014 ldr r1, [sp, #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;
b274: e59d2010 ldr r2, [sp, #16]
- 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;
b278: e3caa001 bic sl, sl, #1
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;
b27c: e089a00a add sl, r9, sl
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_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
b280: e081400a add r4, r1, sl
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b284: e58d3004 str r3, [sp, #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;
b288: e0633002 rsb r3, r3, r2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b28c: e1a00004 mov r0, r4
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;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
b290: e083a00a add sl, r3, sl
b294: e1a01008 mov r1, r8
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
b298: e2893008 add r3, r9, #8
b29c: e58d3008 str r3, [sp, #8]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b2a0: eb001555 bl 107fc <__umodsi3>
b2a4: e0604004 rsb r4, r0, r4
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 ) {
b2a8: e15a0004 cmp sl, r4
b2ac: 2a000003 bcs b2c0 <_Heap_Allocate_aligned_with_boundary+0xc8>
b2b0: e1a0000a mov r0, sl
b2b4: e1a01008 mov r1, r8
b2b8: eb00154f bl 107fc <__umodsi3>
b2bc: e060400a rsb r4, r0, sl
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
b2c0: e35b0000 cmp fp, #0
b2c4: 0a000026 beq b364 <_Heap_Allocate_aligned_with_boundary+0x16c>
/* 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;
b2c8: e084a005 add sl, r4, r5
b2cc: e1a0000a mov r0, sl
b2d0: e1a0100b mov r1, fp
b2d4: eb001548 bl 107fc <__umodsi3>
b2d8: e060000a rsb r0, r0, sl
/* 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 ) {
b2dc: e15a0000 cmp sl, r0
b2e0: 93a0a000 movls sl, #0
b2e4: 83a0a001 movhi sl, #1
b2e8: e1540000 cmp r4, r0
b2ec: 23a0a000 movcs sl, #0
b2f0: e35a0000 cmp sl, #0
b2f4: 0a00001a beq b364 <_Heap_Allocate_aligned_with_boundary+0x16c>
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
b2f8: e59d1008 ldr r1, [sp, #8]
b2fc: e0813005 add r3, 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 ) {
b300: e1530000 cmp r3, r0
b304: 958d9018 strls r9, [sp, #24]
b308: 91a09003 movls r9, r3
b30c: 9a000002 bls b31c <_Heap_Allocate_aligned_with_boundary+0x124>
b310: ea000023 b b3a4 <_Heap_Allocate_aligned_with_boundary+0x1ac>
b314: e1590000 cmp r9, r0
b318: 8a00003e bhi b418 <_Heap_Allocate_aligned_with_boundary+0x220>
return 0;
}
alloc_begin = boundary_line - alloc_size;
b31c: e0654000 rsb r4, r5, r0
b320: e1a01008 mov r1, r8
b324: e1a00004 mov r0, r4
b328: eb001533 bl 107fc <__umodsi3>
b32c: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
b330: e084a005 add sl, r4, r5
b334: e1a0000a mov r0, sl
b338: e1a0100b mov r1, fp
b33c: eb00152e bl 107fc <__umodsi3>
b340: e060000a rsb r0, r0, sl
/* 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 ) {
b344: e15a0000 cmp sl, r0
b348: 93a0a000 movls sl, #0
b34c: 83a0a001 movhi sl, #1
b350: e1540000 cmp r4, r0
b354: 23a0a000 movcs sl, #0
b358: e35a0000 cmp sl, #0
b35c: 1affffec bne b314 <_Heap_Allocate_aligned_with_boundary+0x11c>
b360: e59d9018 ldr r9, [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 ) {
b364: e59d2008 ldr r2, [sp, #8]
b368: e1520004 cmp r2, r4
b36c: 8a00000c bhi b3a4 <_Heap_Allocate_aligned_with_boundary+0x1ac>
b370: e59d100c ldr r1, [sp, #12]
b374: e1a00004 mov r0, r4
b378: eb00151f bl 107fc <__umodsi3>
b37c: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000
b380: e28aa8ff add sl, sl, #16711680 ; 0xff0000
b384: e28aacff add sl, sl, #65280 ; 0xff00
b388: e28aa0f8 add sl, sl, #248 ; 0xf8
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
b38c: e08aa004 add sl, sl, r4
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;
if ( free_size >= min_block_size || free_size == 0 ) {
b390: e59d1004 ldr r1, [sp, #4]
b394: e060300a rsb r3, r0, sl
b398: e15a0000 cmp sl, r0
b39c: 11510003 cmpne r1, r3
b3a0: 9a000005 bls b3bc <_Heap_Allocate_aligned_with_boundary+0x1c4>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b3a4: e5999008 ldr r9, [r9, #8]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b3a8: e1570009 cmp r7, r9
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b3ac: e2863001 add r3, r6, #1
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b3b0: 0a00001d beq b42c <_Heap_Allocate_aligned_with_boundary+0x234>
b3b4: e1a06003 mov r6, r3
b3b8: eaffffa4 b b250 <_Heap_Allocate_aligned_with_boundary+0x58>
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
b3bc: e3540000 cmp r4, #0
b3c0: 0afffff7 beq b3a4 <_Heap_Allocate_aligned_with_boundary+0x1ac>
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
b3c4: e2872048 add r2, r7, #72 ; 0x48
b3c8: e892000c ldm r2, {r2, r3}
b3cc: e2822001 add r2, r2, #1
stats->searches += search_count;
b3d0: e0833006 add r3, r3, r6
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
b3d4: e5872048 str r2, [r7, #72] ; 0x48
stats->searches += search_count;
b3d8: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
b3dc: e1a00007 mov r0, r7
b3e0: e1a01009 mov r1, r9
b3e4: e1a02004 mov r2, r4
b3e8: e1a03005 mov r3, r5
b3ec: ebffede8 bl 6b94 <_Heap_Block_allocate>
b3f0: e1a00004 mov r0, r4
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
b3f4: e5973044 ldr r3, [r7, #68] ; 0x44
b3f8: e1530006 cmp r3, r6
stats->max_search = search_count;
b3fc: 35876044 strcc r6, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
}
b400: e28dd01c add sp, sp, #28
b404: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
b408: e1550003 cmp r5, r3
b40c: 9a000008 bls b434 <_Heap_Allocate_aligned_with_boundary+0x23c>
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b410: e3a00000 mov r0, #0
b414: eafffff9 b b400 <_Heap_Allocate_aligned_with_boundary+0x208>
b418: e59d9018 ldr r9, [sp, #24] <== NOT EXECUTED
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b41c: e5999008 ldr r9, [r9, #8] <== NOT EXECUTED
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b420: e1570009 cmp r7, r9 <== NOT EXECUTED
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b424: e2863001 add r3, r6, #1 <== NOT EXECUTED
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
b428: 1affffe1 bne b3b4 <_Heap_Allocate_aligned_with_boundary+0x1bc><== NOT EXECUTED
b42c: e3a00000 mov r0, #0
b430: eaffffef b b3f4 <_Heap_Allocate_aligned_with_boundary+0x1fc>
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
b434: e3580000 cmp r8, #0
b438: 01a08002 moveq r8, r2
b43c: eaffff7a b b22c <_Heap_Allocate_aligned_with_boundary+0x34>
0000b440 <_Heap_Free>:
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
b440: e2513000 subs r3, r1, #0
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
b444: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
b448: e1a04000 mov r4, r0
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
b44c: 03a00001 moveq r0, #1
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
b450: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b454: e1a00003 mov r0, r3
b458: e5941010 ldr r1, [r4, #16]
b45c: e2435008 sub r5, r3, #8
b460: eb0014e5 bl 107fc <__umodsi3>
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
b464: e5942020 ldr r2, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
b468: e0605005 rsb r5, r0, r5
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;
b46c: e1550002 cmp r5, r2
b470: 3a00002f bcc b534 <_Heap_Free+0xf4>
b474: e5941024 ldr r1, [r4, #36] ; 0x24
b478: e1550001 cmp r5, r1
b47c: 8a00002c bhi b534 <_Heap_Free+0xf4>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b480: e595c004 ldr ip, [r5, #4]
- 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;
b484: e3cc6001 bic r6, ip, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
b488: e0853006 add r3, r5, r6
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;
b48c: e1520003 cmp r2, r3
b490: 8a000027 bhi b534 <_Heap_Free+0xf4>
b494: e1510003 cmp r1, r3
b498: 3a000027 bcc b53c <_Heap_Free+0xfc>
b49c: e5937004 ldr r7, [r3, #4]
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
b4a0: e2170001 ands r0, r7, #1
b4a4: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
b4a8: e1510003 cmp r1, r3
- 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;
b4ac: e3c77001 bic r7, r7, #1
b4b0: 03a08000 moveq r8, #0
b4b4: 0a000004 beq b4cc <_Heap_Free+0x8c>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b4b8: e0830007 add r0, r3, r7
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;
b4bc: e5900004 ldr r0, [r0, #4]
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
b4c0: e3100001 tst r0, #1
b4c4: 13a08000 movne r8, #0
b4c8: 03a08001 moveq r8, #1
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
b4cc: e21c0001 ands r0, ip, #1
b4d0: 1a00001b bne b544 <_Heap_Free+0x104>
uintptr_t const prev_size = block->prev_size;
b4d4: e595c000 ldr ip, [r5]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
b4d8: e06ca005 rsb sl, ip, r5
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;
b4dc: e152000a cmp r2, sl
b4e0: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
b4e4: e151000a cmp r1, sl
b4e8: 38bd85f0 popcc {r4, r5, r6, r7, r8, sl, pc}
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;
b4ec: e59a0004 ldr r0, [sl, #4]
return( false );
}
/* As we always coalesce free blocks, the block that preceedes prev_block
must have been used. */
if ( !_Heap_Is_prev_used ( prev_block) ) {
b4f0: e2100001 ands r0, r0, #1
b4f4: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
b4f8: e3580000 cmp r8, #0
b4fc: 0a000039 beq b5e8 <_Heap_Free+0x1a8>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b500: e5940038 ldr r0, [r4, #56] ; 0x38
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
b504: e0867007 add r7, r6, r7
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b508: e5932008 ldr r2, [r3, #8]
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
b50c: e087c00c add ip, r7, ip
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b510: e593300c ldr r3, [r3, #12]
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b514: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b518: e38c1001 orr r1, ip, #1
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
prev->next = next;
b51c: e5832008 str r2, [r3, #8]
next->prev = prev;
b520: e582300c str r3, [r2, #12]
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b524: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b528: e58a1004 str r1, [sl, #4]
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
b52c: e78ac00c str ip, [sl, ip]
b530: ea00000f b b574 <_Heap_Free+0x134>
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
return false;
b534: e3a00000 mov r0, #0
b538: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
b53c: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b540: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
b544: e3580000 cmp r8, #0
b548: 0a000014 beq b5a0 <_Heap_Free+0x160>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b54c: e5932008 ldr r2, [r3, #8]
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
b550: e0877006 add r7, r7, r6
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b554: e593300c ldr r3, [r3, #12]
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b558: e3871001 orr r1, r7, #1
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
b55c: e5852008 str r2, [r5, #8]
new_block->prev = prev;
b560: e585300c str r3, [r5, #12]
next->prev = new_block;
prev->next = new_block;
b564: e5835008 str r5, [r3, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
b568: e582500c str r5, [r2, #12]
b56c: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
b570: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b574: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
b578: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b57c: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b580: e2422001 sub r2, r2, #1
++stats->frees;
b584: e2833001 add r3, r3, #1
stats->free_size += block_size;
b588: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b58c: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
b590: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b594: e5846030 str r6, [r4, #48] ; 0x30
return( true );
b598: e3a00001 mov r0, #1
b59c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
b5a0: e3862001 orr r2, r6, #1
b5a4: e5852004 str r2, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b5a8: e2842038 add r2, r4, #56 ; 0x38
b5ac: e8921004 ldm r2, {r2, ip}
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b5b0: e5930004 ldr r0, [r3, #4]
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
b5b4: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b5b8: e2822001 add r2, r2, #1
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b5bc: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
b5c0: e152000c cmp r2, ip
new_block->next = next;
b5c4: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
b5c8: e585400c str r4, [r5, #12]
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b5cc: e5830004 str r0, [r3, #4]
block_before->next = new_block;
next->prev = new_block;
b5d0: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
b5d4: e7856006 str r6, [r5, r6]
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
b5d8: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
b5dc: e5842038 str r2, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
b5e0: 8584203c strhi r2, [r4, #60] ; 0x3c
b5e4: eaffffe2 b b574 <_Heap_Free+0x134>
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
b5e8: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b5ec: e38c2001 orr r2, ip, #1
b5f0: e58a2004 str r2, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b5f4: e5932004 ldr r2, [r3, #4]
b5f8: e3c22001 bic r2, r2, #1
b5fc: e5832004 str r2, [r3, #4]
next_block->prev_size = size;
b600: e785c006 str ip, [r5, r6]
b604: eaffffda b b574 <_Heap_Free+0x134>
0001262c <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
1262c: e92d40f0 push {r4, r5, r6, r7, lr}
12630: e1a04000 mov r4, r0
12634: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
12638: e1a00001 mov r0, r1
1263c: e5941010 ldr r1, [r4, #16]
12640: e1a07002 mov r7, r2
12644: ebfff86c bl 107fc <__umodsi3>
12648: e2456008 sub r6, r5, #8
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
1264c: e5943020 ldr r3, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
12650: e0600006 rsb r0, r0, r6
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;
12654: e1500003 cmp r0, r3
12658: 3a000010 bcc 126a0 <_Heap_Size_of_alloc_area+0x74>
1265c: e5942024 ldr r2, [r4, #36] ; 0x24
12660: e1500002 cmp r0, r2
12664: 8a00000d bhi 126a0 <_Heap_Size_of_alloc_area+0x74>
- 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;
12668: e5906004 ldr r6, [r0, #4]
1266c: e3c66001 bic r6, r6, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
12670: e0806006 add r6, r0, r6
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;
12674: e1530006 cmp r3, r6
12678: 8a000008 bhi 126a0 <_Heap_Size_of_alloc_area+0x74>
1267c: e1520006 cmp r2, r6
12680: 3a000008 bcc 126a8 <_Heap_Size_of_alloc_area+0x7c>
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;
12684: e5960004 ldr r0, [r6, #4]
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
12688: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
1268c: 12655004 rsbne r5, r5, #4
12690: 10856006 addne r6, r5, r6
12694: 15876000 strne r6, [r7]
return true;
12698: 13a00001 movne r0, #1
1269c: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
126a0: e3a00000 mov r0, #0
126a4: e8bd80f0 pop {r4, r5, r6, r7, pc}
126a8: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
126ac: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000793c <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
793c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
7940: e59f35d8 ldr r3, [pc, #1496] ; 7f20 <_Heap_Walk+0x5e4>
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
7944: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
7948: e5933000 ldr r3, [r3]
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
794c: e59f25d0 ldr r2, [pc, #1488] ; 7f24 <_Heap_Walk+0x5e8>
7950: e59f95d0 ldr r9, [pc, #1488] ; 7f28 <_Heap_Walk+0x5ec>
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7954: e1a0a001 mov sl, r1
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
7958: 11a09002 movne r9, r2
Heap_Control *heap,
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
795c: e5901010 ldr r1, [r0, #16]
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
7960: e3530003 cmp r3, #3
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
7964: e5902014 ldr r2, [r0, #20]
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
7968: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
796c: e24dd038 sub sp, sp, #56 ; 0x38
7970: e1a04000 mov r4, r0
uintptr_t const page_size = heap->page_size;
7974: e58d1024 str r1, [sp, #36] ; 0x24
uintptr_t const min_block_size = heap->min_block_size;
7978: e58d2028 str r2, [sp, #40] ; 0x28
Heap_Block *const first_block = heap->first_block;
797c: e5908020 ldr r8, [r0, #32]
Heap_Block *const last_block = heap->last_block;
7980: e58d302c str r3, [sp, #44] ; 0x2c
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
7984: 0a000002 beq 7994 <_Heap_Walk+0x58>
}
block = next_block;
} while ( block != first_block );
return true;
7988: e3a00001 mov r0, #1
}
798c: e28dd038 add sp, sp, #56 ; 0x38
7990: 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)(
7994: e594101c ldr r1, [r4, #28]
7998: e5900018 ldr r0, [r0, #24]
799c: e2842008 add r2, r4, #8
79a0: e892000c ldm r2, {r2, r3}
79a4: e59dc028 ldr ip, [sp, #40] ; 0x28
79a8: e58d1008 str r1, [sp, #8]
79ac: e59d102c ldr r1, [sp, #44] ; 0x2c
79b0: e58d0004 str r0, [sp, #4]
79b4: e58d1010 str r1, [sp, #16]
79b8: e58d2014 str r2, [sp, #20]
79bc: e58d3018 str r3, [sp, #24]
79c0: e59f2564 ldr r2, [pc, #1380] ; 7f2c <_Heap_Walk+0x5f0>
79c4: e58dc000 str ip, [sp]
79c8: e58d800c str r8, [sp, #12]
79cc: e1a0000a mov r0, sl
79d0: e3a01000 mov r1, #0
79d4: e59d3024 ldr r3, [sp, #36] ; 0x24
79d8: e1a0e00f mov lr, pc
79dc: e12fff19 bx r9
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
79e0: e59d2024 ldr r2, [sp, #36] ; 0x24
79e4: e3520000 cmp r2, #0
79e8: 0a000026 beq 7a88 <_Heap_Walk+0x14c>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
79ec: e59d3024 ldr r3, [sp, #36] ; 0x24
79f0: e2135007 ands r5, r3, #7
79f4: 1a00002a bne 7aa4 <_Heap_Walk+0x168>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
79f8: e59d0028 ldr r0, [sp, #40] ; 0x28
79fc: e59d1024 ldr r1, [sp, #36] ; 0x24
7a00: ebffe57f bl 1004 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
7a04: e250b000 subs fp, r0, #0
7a08: 1a00002c bne 7ac0 <_Heap_Walk+0x184>
7a0c: e2880008 add r0, r8, #8
7a10: e59d1024 ldr r1, [sp, #36] ; 0x24
7a14: ebffe57a bl 1004 <__umodsi3>
);
return false;
}
if (
7a18: e2506000 subs r6, r0, #0
7a1c: 1a00002f bne 7ae0 <_Heap_Walk+0x1a4>
block = next_block;
} while ( block != first_block );
return true;
}
7a20: e598b004 ldr fp, [r8, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
7a24: e21b5001 ands r5, fp, #1
7a28: 0a0000fc beq 7e20 <_Heap_Walk+0x4e4>
- 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;
7a2c: e59dc02c ldr ip, [sp, #44] ; 0x2c
7a30: e59c3004 ldr r3, [ip, #4]
7a34: e3c33001 bic r3, r3, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
7a38: e08c3003 add r3, ip, r3
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;
7a3c: e5935004 ldr r5, [r3, #4]
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
7a40: e2155001 ands r5, r5, #1
7a44: 0a000008 beq 7a6c <_Heap_Walk+0x130>
);
return false;
}
if (
7a48: e1580003 cmp r8, r3
7a4c: 0a00002b beq 7b00 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
7a50: e1a0000a mov r0, sl
7a54: e3a01001 mov r1, #1
7a58: e59f24d0 ldr r2, [pc, #1232] ; 7f30 <_Heap_Walk+0x5f4>
7a5c: e1a0e00f mov lr, pc
7a60: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7a64: e1a00006 mov r0, r6
7a68: eaffffc7 b 798c <_Heap_Walk+0x50>
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
7a6c: e1a0000a mov r0, sl
7a70: e3a01001 mov r1, #1
7a74: e59f24b8 ldr r2, [pc, #1208] ; 7f34 <_Heap_Walk+0x5f8>
7a78: e1a0e00f mov lr, pc
7a7c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7a80: e1a00005 mov r0, r5
7a84: eaffffc0 b 798c <_Heap_Walk+0x50>
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
(*printer)( source, true, "page size is zero\n" );
7a88: e1a0000a mov r0, sl
7a8c: e3a01001 mov r1, #1
7a90: e59f24a0 ldr r2, [pc, #1184] ; 7f38 <_Heap_Walk+0x5fc>
7a94: e1a0e00f mov lr, pc
7a98: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7a9c: e59d0024 ldr r0, [sp, #36] ; 0x24
7aa0: eaffffb9 b 798c <_Heap_Walk+0x50>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
7aa4: e1a0000a mov r0, sl
7aa8: e3a01001 mov r1, #1
7aac: e59f2488 ldr r2, [pc, #1160] ; 7f3c <_Heap_Walk+0x600>
7ab0: e1a0e00f mov lr, pc
7ab4: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7ab8: e3a00000 mov r0, #0
7abc: eaffffb2 b 798c <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
7ac0: e1a0000a mov r0, sl
7ac4: e3a01001 mov r1, #1
7ac8: e59f2470 ldr r2, [pc, #1136] ; 7f40 <_Heap_Walk+0x604>
7acc: e59d3028 ldr r3, [sp, #40] ; 0x28
7ad0: e1a0e00f mov lr, pc
7ad4: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7ad8: e1a00005 mov r0, r5
7adc: eaffffaa b 798c <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
7ae0: e1a0000a mov r0, sl
7ae4: e3a01001 mov r1, #1
7ae8: e59f2454 ldr r2, [pc, #1108] ; 7f44 <_Heap_Walk+0x608>
7aec: e1a03008 mov r3, r8
7af0: e1a0e00f mov lr, pc
7af4: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7af8: e1a0000b mov r0, fp
7afc: eaffffa2 b 798c <_Heap_Walk+0x50>
block = next_block;
} while ( block != first_block );
return true;
}
7b00: e5946008 ldr r6, [r4, #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 ) {
7b04: e1540006 cmp r4, r6
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
7b08: e5947010 ldr r7, [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 ) {
7b0c: 05943020 ldreq r3, [r4, #32]
7b10: 0a00002c beq 7bc8 <_Heap_Walk+0x28c>
block = next_block;
} while ( block != first_block );
return true;
}
7b14: e5943020 ldr r3, [r4, #32]
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;
7b18: e1530006 cmp r3, r6
7b1c: 8a0000c6 bhi 7e3c <_Heap_Walk+0x500>
7b20: e594c024 ldr ip, [r4, #36] ; 0x24
7b24: e15c0006 cmp ip, r6
7b28: 3a0000c3 bcc 7e3c <_Heap_Walk+0x500>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7b2c: e2860008 add r0, r6, #8
7b30: e1a01007 mov r1, r7
7b34: e58d3020 str r3, [sp, #32]
7b38: e58dc01c str ip, [sp, #28]
7b3c: ebffe530 bl 1004 <__umodsi3>
);
return false;
}
if (
7b40: e3500000 cmp r0, #0
7b44: e59d3020 ldr r3, [sp, #32]
7b48: e59dc01c ldr ip, [sp, #28]
7b4c: 1a0000d8 bne 7eb4 <_Heap_Walk+0x578>
- 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;
7b50: e5962004 ldr r2, [r6, #4]
7b54: e3c22001 bic r2, r2, #1
block = next_block;
} while ( block != first_block );
return true;
}
7b58: e0862002 add r2, r6, r2
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;
7b5c: e5922004 ldr r2, [r2, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7b60: e3120001 tst r2, #1
7b64: 1a0000db bne 7ed8 <_Heap_Walk+0x59c>
7b68: e58d8030 str r8, [sp, #48] ; 0x30
7b6c: e58db034 str fp, [sp, #52] ; 0x34
7b70: e1a02004 mov r2, r4
7b74: e1a08003 mov r8, r3
7b78: e1a0b00c mov fp, ip
);
return false;
}
if ( free_block->prev != prev_block ) {
7b7c: e596100c ldr r1, [r6, #12]
7b80: e1510002 cmp r1, r2
7b84: 1a0000dc bne 7efc <_Heap_Walk+0x5c0>
return false;
}
prev_block = free_block;
free_block = free_block->next;
7b88: e5965008 ldr r5, [r6, #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 ) {
7b8c: e1540005 cmp r4, r5
7b90: 0a000009 beq 7bbc <_Heap_Walk+0x280>
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;
7b94: e1580005 cmp r8, r5
7b98: 9a00007d bls 7d94 <_Heap_Walk+0x458>
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
(*printer)(
7b9c: e1a0000a mov r0, sl
7ba0: e3a01001 mov r1, #1
7ba4: e59f239c ldr r2, [pc, #924] ; 7f48 <_Heap_Walk+0x60c>
7ba8: e1a03005 mov r3, r5
7bac: e1a0e00f mov lr, pc
7bb0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7bb4: e3a00000 mov r0, #0
7bb8: eaffff73 b 798c <_Heap_Walk+0x50>
7bbc: e1a03008 mov r3, r8
7bc0: e28d8030 add r8, sp, #48 ; 0x30
7bc4: e8980900 ldm r8, {r8, fp}
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7bc8: e1a06008 mov r6, r8
- 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;
7bcc: e3cb7001 bic r7, fp, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
7bd0: e0875006 add r5, r7, r6
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;
7bd4: e1530005 cmp r3, r5
7bd8: 9a000008 bls 7c00 <_Heap_Walk+0x2c4>
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
(*printer)(
7bdc: e1a0000a mov r0, sl
7be0: e58d5000 str r5, [sp]
7be4: e3a01001 mov r1, #1
7be8: e59f235c ldr r2, [pc, #860] ; 7f4c <_Heap_Walk+0x610>
7bec: e1a03006 mov r3, r6
7bf0: e1a0e00f mov lr, pc
7bf4: e12fff19 bx r9
"block 0x%08x: next block 0x%08x not in heap\n",
block,
next_block
);
return false;
7bf8: e3a00000 mov r0, #0
7bfc: eaffff62 b 798c <_Heap_Walk+0x50>
7c00: e5943024 ldr r3, [r4, #36] ; 0x24
7c04: e1530005 cmp r3, r5
7c08: 3afffff3 bcc 7bdc <_Heap_Walk+0x2a0>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7c0c: e59d1024 ldr r1, [sp, #36] ; 0x24
7c10: e1a00007 mov r0, r7
7c14: ebffe4fa bl 1004 <__umodsi3>
uintptr_t const block_begin = (uintptr_t) block;
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;
bool const is_not_last_block = block != last_block;
7c18: e59d102c ldr r1, [sp, #44] ; 0x2c
7c1c: e0563001 subs r3, r6, r1
7c20: 13a03001 movne r3, #1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
7c24: e3500000 cmp r0, #0
7c28: 0a000001 beq 7c34 <_Heap_Walk+0x2f8>
7c2c: e3530000 cmp r3, #0
7c30: 1a000083 bne 7e44 <_Heap_Walk+0x508>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
7c34: e59d2028 ldr r2, [sp, #40] ; 0x28
7c38: e1520007 cmp r2, r7
7c3c: 9a000001 bls 7c48 <_Heap_Walk+0x30c>
7c40: e3530000 cmp r3, #0
7c44: 1a000087 bne 7e68 <_Heap_Walk+0x52c>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
7c48: e1560005 cmp r6, r5
7c4c: 3a000001 bcc 7c58 <_Heap_Walk+0x31c>
7c50: e3530000 cmp r3, #0
7c54: 1a00008d bne 7e90 <_Heap_Walk+0x554>
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;
7c58: e5953004 ldr r3, [r5, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
7c5c: e3130001 tst r3, #1
7c60: e20bb001 and fp, fp, #1
7c64: 0a000018 beq 7ccc <_Heap_Walk+0x390>
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
7c68: e35b0000 cmp fp, #0
7c6c: 0a00000c beq 7ca4 <_Heap_Walk+0x368>
(*printer)(
7c70: e58d7000 str r7, [sp]
7c74: e1a0000a mov r0, sl
7c78: e3a01000 mov r1, #0
7c7c: e59f22cc ldr r2, [pc, #716] ; 7f50 <_Heap_Walk+0x614>
7c80: e1a03006 mov r3, r6
7c84: e1a0e00f mov lr, pc
7c88: e12fff19 bx r9
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
7c8c: e1580005 cmp r8, r5
7c90: 0affff3c beq 7988 <_Heap_Walk+0x4c>
7c94: e595b004 ldr fp, [r5, #4]
7c98: e5943020 ldr r3, [r4, #32]
7c9c: e1a06005 mov r6, r5
7ca0: eaffffc9 b 7bcc <_Heap_Walk+0x290>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
7ca4: e58d7000 str r7, [sp]
7ca8: e5963000 ldr r3, [r6]
7cac: e1a0000a mov r0, sl
7cb0: e58d3004 str r3, [sp, #4]
7cb4: e1a0100b mov r1, fp
7cb8: e59f2294 ldr r2, [pc, #660] ; 7f54 <_Heap_Walk+0x618>
7cbc: e1a03006 mov r3, r6
7cc0: e1a0e00f mov lr, pc
7cc4: e12fff19 bx r9
7cc8: eaffffef b 7c8c <_Heap_Walk+0x350>
false,
"block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n",
block,
block_size,
block->prev,
block->prev == first_free_block ?
7ccc: e596200c ldr r2, [r6, #12]
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)(
7cd0: e5943008 ldr r3, [r4, #8]
7cd4: e1530002 cmp r3, r2
block = next_block;
} while ( block != first_block );
return true;
}
7cd8: e594100c ldr r1, [r4, #12]
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)(
7cdc: 059f0274 ldreq r0, [pc, #628] ; 7f58 <_Heap_Walk+0x61c>
7ce0: 0a000003 beq 7cf4 <_Heap_Walk+0x3b8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
7ce4: e59f3270 ldr r3, [pc, #624] ; 7f5c <_Heap_Walk+0x620>
7ce8: e1540002 cmp r4, r2
7cec: e59f026c ldr r0, [pc, #620] ; 7f60 <_Heap_Walk+0x624>
7cf0: 01a00003 moveq r0, r3
block->next,
block->next == last_free_block ?
7cf4: e5963008 ldr r3, [r6, #8]
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)(
7cf8: e1510003 cmp r1, r3
7cfc: 059f1260 ldreq r1, [pc, #608] ; 7f64 <_Heap_Walk+0x628>
7d00: 0a000003 beq 7d14 <_Heap_Walk+0x3d8>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
7d04: e59fc25c ldr ip, [pc, #604] ; 7f68 <_Heap_Walk+0x62c>
7d08: e1540003 cmp r4, r3
7d0c: e59f124c ldr r1, [pc, #588] ; 7f60 <_Heap_Walk+0x624>
7d10: 01a0100c moveq 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)(
7d14: e58d2004 str r2, [sp, #4]
7d18: e58d0008 str r0, [sp, #8]
7d1c: e58d300c str r3, [sp, #12]
7d20: e58d1010 str r1, [sp, #16]
7d24: e1a03006 mov r3, r6
7d28: e58d7000 str r7, [sp]
7d2c: e1a0000a mov r0, sl
7d30: e3a01000 mov r1, #0
7d34: e59f2230 ldr r2, [pc, #560] ; 7f6c <_Heap_Walk+0x630>
7d38: e1a0e00f mov lr, pc
7d3c: e12fff19 bx r9
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
7d40: e5953000 ldr r3, [r5]
7d44: e1570003 cmp r7, r3
7d48: 1a000021 bne 7dd4 <_Heap_Walk+0x498>
);
return false;
}
if ( !prev_used ) {
7d4c: e35b0000 cmp fp, #0
7d50: 0a00002a beq 7e00 <_Heap_Walk+0x4c4>
block = next_block;
} while ( block != first_block );
return true;
}
7d54: 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 ) {
7d58: e1540003 cmp r4, r3
7d5c: 0a000004 beq 7d74 <_Heap_Walk+0x438>
if ( free_block == block ) {
7d60: e1560003 cmp r6, r3
7d64: 0affffc8 beq 7c8c <_Heap_Walk+0x350>
return true;
}
free_block = free_block->next;
7d68: 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 ) {
7d6c: e1540003 cmp r4, r3
7d70: 1afffffa bne 7d60 <_Heap_Walk+0x424>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
7d74: e1a0000a mov r0, sl
7d78: e3a01001 mov r1, #1
7d7c: e59f21ec ldr r2, [pc, #492] ; 7f70 <_Heap_Walk+0x634>
7d80: e1a03006 mov r3, r6
7d84: e1a0e00f mov lr, pc
7d88: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7d8c: e3a00000 mov r0, #0
7d90: eafffefd b 798c <_Heap_Walk+0x50>
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;
7d94: e155000b cmp r5, fp
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7d98: e2850008 add r0, r5, #8
7d9c: e1a01007 mov r1, r7
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;
7da0: 8affff7d bhi 7b9c <_Heap_Walk+0x260>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7da4: ebffe496 bl 1004 <__umodsi3>
);
return false;
}
if (
7da8: e3500000 cmp r0, #0
7dac: 1a000041 bne 7eb8 <_Heap_Walk+0x57c>
- 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;
7db0: e5953004 ldr r3, [r5, #4]
7db4: e3c33001 bic r3, r3, #1
block = next_block;
} while ( block != first_block );
return true;
}
7db8: e0833005 add r3, r3, r5
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;
7dbc: e5933004 ldr r3, [r3, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7dc0: e3130001 tst r3, #1
7dc4: 1a000044 bne 7edc <_Heap_Walk+0x5a0>
7dc8: e1a02006 mov r2, r6
7dcc: e1a06005 mov r6, r5
7dd0: eaffff69 b 7b7c <_Heap_Walk+0x240>
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
(*printer)(
7dd4: e58d3004 str r3, [sp, #4]
7dd8: e1a0000a mov r0, sl
7ddc: e58d7000 str r7, [sp]
7de0: e58d5008 str r5, [sp, #8]
7de4: e3a01001 mov r1, #1
7de8: e59f2184 ldr r2, [pc, #388] ; 7f74 <_Heap_Walk+0x638>
7dec: e1a03006 mov r3, r6
7df0: e1a0e00f mov lr, pc
7df4: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7df8: e3a00000 mov r0, #0
7dfc: eafffee2 b 798c <_Heap_Walk+0x50>
return false;
}
if ( !prev_used ) {
(*printer)(
7e00: e1a0000a mov r0, sl
7e04: e3a01001 mov r1, #1
7e08: e59f2168 ldr r2, [pc, #360] ; 7f78 <_Heap_Walk+0x63c>
7e0c: e1a03006 mov r3, r6
7e10: e1a0e00f mov lr, pc
7e14: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7e18: e1a0000b mov r0, fp
7e1c: eafffeda b 798c <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
7e20: e1a0000a mov r0, sl
7e24: e3a01001 mov r1, #1
7e28: e59f214c ldr r2, [pc, #332] ; 7f7c <_Heap_Walk+0x640>
7e2c: e1a0e00f mov lr, pc
7e30: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7e34: e1a00005 mov r0, r5
7e38: eafffed3 b 798c <_Heap_Walk+0x50>
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;
7e3c: e1a05006 mov r5, r6 <== NOT EXECUTED
7e40: eaffff55 b 7b9c <_Heap_Walk+0x260> <== NOT EXECUTED
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
7e44: e1a0000a mov r0, sl
7e48: e58d7000 str r7, [sp]
7e4c: e3a01001 mov r1, #1
7e50: e59f2128 ldr r2, [pc, #296] ; 7f80 <_Heap_Walk+0x644>
7e54: e1a03006 mov r3, r6
7e58: e1a0e00f mov lr, pc
7e5c: e12fff19 bx r9
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
7e60: e3a00000 mov r0, #0
7e64: eafffec8 b 798c <_Heap_Walk+0x50>
}
if ( block_size < min_block_size && is_not_last_block ) {
(*printer)(
7e68: e58d2004 str r2, [sp, #4]
7e6c: e1a0000a mov r0, sl
7e70: e58d7000 str r7, [sp]
7e74: e3a01001 mov r1, #1
7e78: e59f2104 ldr r2, [pc, #260] ; 7f84 <_Heap_Walk+0x648>
7e7c: e1a03006 mov r3, r6
7e80: e1a0e00f mov lr, pc
7e84: e12fff19 bx r9
block,
block_size,
min_block_size
);
return false;
7e88: e3a00000 mov r0, #0
7e8c: eafffebe b 798c <_Heap_Walk+0x50>
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
(*printer)(
7e90: e1a0000a mov r0, sl
7e94: e58d5000 str r5, [sp]
7e98: e3a01001 mov r1, #1
7e9c: e59f20e4 ldr r2, [pc, #228] ; 7f88 <_Heap_Walk+0x64c>
7ea0: e1a03006 mov r3, r6
7ea4: e1a0e00f mov lr, pc
7ea8: e12fff19 bx r9
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
7eac: e3a00000 mov r0, #0
7eb0: eafffeb5 b 798c <_Heap_Walk+0x50>
);
return false;
}
if (
7eb4: e1a05006 mov r5, r6 <== NOT EXECUTED
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
7eb8: e1a0000a mov r0, sl
7ebc: e3a01001 mov r1, #1
7ec0: e59f20c4 ldr r2, [pc, #196] ; 7f8c <_Heap_Walk+0x650>
7ec4: e1a03005 mov r3, r5
7ec8: e1a0e00f mov lr, pc
7ecc: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7ed0: e3a00000 mov r0, #0
7ed4: eafffeac b 798c <_Heap_Walk+0x50>
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7ed8: e1a05006 mov r5, r6 <== NOT EXECUTED
(*printer)(
7edc: e1a0000a mov r0, sl
7ee0: e3a01001 mov r1, #1
7ee4: e59f20a4 ldr r2, [pc, #164] ; 7f90 <_Heap_Walk+0x654>
7ee8: e1a03005 mov r3, r5
7eec: e1a0e00f mov lr, pc
7ef0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7ef4: e3a00000 mov r0, #0
7ef8: eafffea3 b 798c <_Heap_Walk+0x50>
return false;
}
if ( free_block->prev != prev_block ) {
(*printer)(
7efc: e58d1000 str r1, [sp]
7f00: e1a0000a mov r0, sl
7f04: e3a01001 mov r1, #1
7f08: e59f2084 ldr r2, [pc, #132] ; 7f94 <_Heap_Walk+0x658>
7f0c: e1a03006 mov r3, r6
7f10: e1a0e00f mov lr, pc
7f14: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7f18: e3a00000 mov r0, #0
7f1c: eafffe9a b 798c <_Heap_Walk+0x50>
00006de0 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6de0: 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 )
6de4: e5904034 ldr r4, [r0, #52] ; 0x34
6de8: e3540000 cmp r4, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6dec: e24dd014 sub sp, sp, #20
6df0: e1a05000 mov r5, r0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6df4: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6df8: 0a00009a beq 7068 <_Objects_Extend_information+0x288>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
6dfc: e1d081b4 ldrh r8, [r0, #20]
6e00: e1d0a1b0 ldrh sl, [r0, #16]
6e04: e1a01008 mov r1, r8
6e08: e1a0000a mov r0, sl
6e0c: eb002634 bl 106e4 <__aeabi_uidiv>
6e10: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
6e14: e1b03823 lsrs r3, r3, #16
6e18: 0a000098 beq 7080 <_Objects_Extend_information+0x2a0>
if ( information->object_blocks[ block ] == NULL ) {
6e1c: e5949000 ldr r9, [r4]
6e20: e3590000 cmp r9, #0
6e24: 01a01008 moveq r1, r8
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6e28: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
6e2c: 01a04009 moveq r4, r9
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
6e30: 0a00000c beq 6e68 <_Objects_Extend_information+0x88>
6e34: e1a02004 mov r2, r4
6e38: e1a01008 mov r1, r8
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
6e3c: e1a06007 mov r6, r7
index_base = minimum_index;
block = 0;
6e40: e3a04000 mov r4, #0
6e44: ea000002 b 6e54 <_Objects_Extend_information+0x74>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
6e48: e5b29004 ldr r9, [r2, #4]!
6e4c: e3590000 cmp r9, #0
6e50: 0a000004 beq 6e68 <_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++ ) {
6e54: e2844001 add r4, r4, #1
6e58: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
6e5c: e0866008 add r6, r6, r8
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
6e60: 8afffff8 bhi 6e48 <_Objects_Extend_information+0x68>
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
6e64: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
6e68: 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 ) {
6e6c: e35a0801 cmp sl, #65536 ; 0x10000
6e70: 2a000062 bcs 7000 <_Objects_Extend_information+0x220>
/*
* 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 ) {
6e74: e5d52012 ldrb r2, [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;
6e78: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
6e7c: e3520000 cmp r2, #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;
6e80: e0000091 mul r0, r1, r0
if ( information->auto_extend ) {
6e84: 1a00005f bne 7008 <_Objects_Extend_information+0x228>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
6e88: e58d3000 str r3, [sp]
6e8c: eb00087c bl 9084 <_Workspace_Allocate_or_fatal_error>
6e90: e59d3000 ldr r3, [sp]
6e94: e1a08000 mov r8, r0
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
6e98: e3590000 cmp r9, #0
6e9c: 0a000038 beq 6f84 <_Objects_Extend_information+0x1a4>
*/
/*
* Up the block count and maximum
*/
block_count++;
6ea0: e283b001 add fp, r3, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6ea4: e08b008b add r0, fp, fp, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
6ea8: e08a0000 add r0, sl, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6eac: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
6eb0: e1a00100 lsl r0, r0, #2
6eb4: e58d3000 str r3, [sp]
6eb8: eb000867 bl 905c <_Workspace_Allocate>
if ( !object_blocks ) {
6ebc: e2509000 subs r9, r0, #0
6ec0: e59d3000 ldr r3, [sp]
6ec4: 0a000072 beq 7094 <_Objects_Extend_information+0x2b4>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
6ec8: e1d521b0 ldrh r2, [r5, #16]
6ecc: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
6ed0: e089c10b add ip, r9, fp, lsl #2
6ed4: e089b18b add fp, r9, fp, lsl #3
6ed8: 3a000050 bcc 7020 <_Objects_Extend_information+0x240>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6edc: e3570000 cmp r7, #0
6ee0: 13a02000 movne r2, #0
6ee4: 11a0100b movne r1, fp
local_table[ index ] = NULL;
6ee8: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6eec: 0a000003 beq 6f00 <_Objects_Extend_information+0x120>
6ef0: e2822001 add r2, r2, #1
6ef4: e1570002 cmp r7, r2
local_table[ index ] = NULL;
6ef8: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6efc: 8afffffb bhi 6ef0 <_Objects_Extend_information+0x110>
6f00: 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 );
6f04: e1d511b4 ldrh r1, [r5, #20]
6f08: e0861001 add r1, r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6f0c: e3a00000 mov r0, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
6f10: e1560001 cmp r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6f14: e7890003 str r0, [r9, r3]
inactive_per_block[block_count] = 0;
6f18: e78c0003 str r0, [ip, r3]
for ( index=index_base ;
6f1c: 2a000005 bcs 6f38 <_Objects_Extend_information+0x158>
6f20: e08b2106 add r2, fp, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
6f24: e1a03006 mov r3, r6
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
index++ ) {
6f28: 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 ;
6f2c: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
6f30: 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 ;
6f34: 3afffffb bcc 6f28 <_Objects_Extend_information+0x148>
6f38: e10f3000 mrs r3, CPSR
6f3c: e3832080 orr r2, r3, #128 ; 0x80
6f40: e129f002 msr CPSR_fc, r2
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6f44: e5952000 ldr r2, [r5]
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(
6f48: e1d510b4 ldrh r1, [r5, #4]
6f4c: 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;
6f50: e1a0a80a lsl sl, sl, #16
6f54: e3822801 orr r2, r2, #65536 ; 0x10000
6f58: e1a0a82a lsr sl, sl, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6f5c: e1822d81 orr r2, r2, r1, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6f60: e182200a orr r2, r2, sl
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
6f64: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
6f68: e585c030 str ip, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
6f6c: e5859034 str r9, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
6f70: e585b01c str fp, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
6f74: e1c5a1b0 strh sl, [r5, #16]
information->maximum_id = _Objects_Build_id(
6f78: e585200c str r2, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
6f7c: e129f003 msr CPSR_fc, r3
information->maximum
);
_ISR_Enable( level );
_Workspace_Free( old_tables );
6f80: eb00083b bl 9074 <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6f84: e5953034 ldr r3, [r5, #52] ; 0x34
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6f88: e28d7008 add r7, sp, #8
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6f8c: e7838104 str r8, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6f90: e1a01008 mov r1, r8
6f94: e1a00007 mov r0, r7
6f98: e1d521b4 ldrh r2, [r5, #20]
6f9c: e5953018 ldr r3, [r5, #24]
6fa0: eb00100e bl afe0 <_Chain_Initialize>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6fa4: e1a04104 lsl r4, r4, #2
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6fa8: 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 ) {
6fac: ea000009 b 6fd8 <_Objects_Extend_information+0x1f8>
6fb0: e5953000 ldr r3, [r5]
the_object->id = _Objects_Build_id(
6fb4: e1d520b4 ldrh r2, [r5, #4]
6fb8: e1a03c03 lsl r3, r3, #24
6fbc: e3833801 orr r3, r3, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6fc0: e1833d82 orr r3, r3, r2, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6fc4: e1833006 orr r3, r3, r6
6fc8: e5813008 str r3, [r1, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
6fcc: e1a00008 mov r0, r8
6fd0: ebfffcea bl 6380 <_Chain_Append>
index++;
6fd4: 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 ) {
6fd8: e1a00007 mov r0, r7
6fdc: ebfffcfa bl 63cc <_Chain_Get>
6fe0: e2501000 subs r1, r0, #0
6fe4: 1afffff1 bne 6fb0 <_Objects_Extend_information+0x1d0>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
6fe8: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6fec: e1d531b4 ldrh r3, [r5, #20]
6ff0: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
6ff4: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
6ff8: e7813004 str r3, [r1, r4]
information->inactive =
6ffc: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
7000: e28dd014 add sp, sp, #20
7004: 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 );
7008: e58d3000 str r3, [sp]
700c: eb000812 bl 905c <_Workspace_Allocate>
if ( !new_object_block )
7010: e2508000 subs r8, r0, #0
7014: e59d3000 ldr r3, [sp]
7018: 1affff9e bne 6e98 <_Objects_Extend_information+0xb8>
701c: eafffff7 b 7000 <_Objects_Extend_information+0x220>
/*
* 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,
7020: e1a03103 lsl r3, r3, #2
7024: e5951034 ldr r1, [r5, #52] ; 0x34
7028: e1a02003 mov r2, r3
702c: e88d1008 stm sp, {r3, ip}
7030: eb001a16 bl d890 <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
7034: e89d1008 ldm sp, {r3, ip}
7038: e1a0000c mov r0, ip
703c: e1a02003 mov r2, r3
7040: e5951030 ldr r1, [r5, #48] ; 0x30
7044: eb001a11 bl d890 <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
7048: e1d521b0 ldrh r2, [r5, #16]
704c: e0872002 add r2, r7, r2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
7050: e1a0000b mov r0, fp
7054: e595101c ldr r1, [r5, #28]
7058: e1a02102 lsl r2, r2, #2
705c: eb001a0b bl d890 <memcpy>
7060: e89d1008 ldm sp, {r3, ip}
7064: eaffffa6 b 6f04 <_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 )
7068: e1d0a1b0 ldrh sl, [r0, #16]
706c: e1d011b4 ldrh r1, [r0, #20]
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7070: e1a06007 mov r6, r7
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7074: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
7078: e1a03004 mov r3, r4
707c: eaffff79 b 6e68 <_Objects_Extend_information+0x88>
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7080: e1a01008 mov r1, r8 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7084: e1a06007 mov r6, r7 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7088: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
708c: e1a04003 mov r4, r3 <== NOT EXECUTED
7090: eaffff74 b 6e68 <_Objects_Extend_information+0x88> <== NOT EXECUTED
(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 );
7094: e1a00008 mov r0, r8
7098: eb0007f5 bl 9074 <_Workspace_Free>
return;
709c: eaffffd7 b 7000 <_Objects_Extend_information+0x220>
000073d4 <_Objects_Shrink_information>:
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
73d4: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
73d8: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
73dc: e1d051b4 ldrh r5, [r0, #20]
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
73e0: e1a06000 mov r6, r0
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
73e4: e1d001b0 ldrh r0, [r0, #16]
73e8: e1a01005 mov r1, r5
73ec: e0640000 rsb r0, r4, r0
73f0: eb0024bb bl 106e4 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
73f4: e3500000 cmp r0, #0
73f8: 08bd80f0 popeq {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
73fc: e5962030 ldr r2, [r6, #48] ; 0x30
7400: e5923000 ldr r3, [r2]
7404: e1550003 cmp r5, r3
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
7408: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
740c: 1a000005 bne 7428 <_Objects_Shrink_information+0x54>
7410: ea000008 b 7438 <_Objects_Shrink_information+0x64> <== NOT EXECUTED
7414: e5b21004 ldr r1, [r2, #4]!
7418: e1550001 cmp r5, r1
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
741c: e0844005 add r4, r4, r5
7420: e1a07103 lsl r7, r3, #2
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] ==
7424: 0a000004 beq 743c <_Objects_Shrink_information+0x68>
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
7428: e2833001 add r3, r3, #1
742c: e1500003 cmp r0, r3
7430: 8afffff7 bhi 7414 <_Objects_Shrink_information+0x40>
7434: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
7438: e3a07000 mov r7, #0 <== NOT EXECUTED
information->allocation_size ) {
/*
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) _Chain_First( &information->Inactive );
743c: e5960020 ldr r0, [r6, #32]
7440: ea000002 b 7450 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
7444: e3550000 cmp r5, #0
7448: 0a00000b beq 747c <_Objects_Shrink_information+0xa8>
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
744c: e1a00005 mov r0, r5
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) _Chain_First( &information->Inactive );
do {
index = _Objects_Get_index( the_object->id );
7450: e1d030b8 ldrh r3, [r0, #8]
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
7454: e1530004 cmp r3, r4
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
7458: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
745c: 3afffff8 bcc 7444 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
7460: e1d621b4 ldrh r2, [r6, #20]
7464: e0842002 add r2, r4, r2
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
7468: e1530002 cmp r3, r2
746c: 2afffff4 bcs 7444 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
7470: ebfffbcd bl 63ac <_Chain_Extract>
}
}
while ( the_object );
7474: e3550000 cmp r5, #0
7478: 1afffff3 bne 744c <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
747c: e5963034 ldr r3, [r6, #52] ; 0x34
7480: e7930007 ldr r0, [r3, r7]
7484: eb0006fa bl 9074 <_Workspace_Free>
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
7488: e1d602bc ldrh r0, [r6, #44] ; 0x2c
748c: e1d631b4 ldrh r3, [r6, #20]
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
7490: e5961034 ldr r1, [r6, #52] ; 0x34
information->inactive_per_block[ block ] = 0;
7494: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
7498: e0633000 rsb r3, r3, r0
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
749c: e7815007 str r5, [r1, r7]
information->inactive_per_block[ block ] = 0;
74a0: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
74a4: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
74a8: e8bd80f0 pop {r4, r5, r6, r7, pc}
00006a8c <_TOD_Validate>:
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
6a8c: e59f30b8 ldr r3, [pc, #184] ; 6b4c <_TOD_Validate+0xc0>
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
6a90: e92d4010 push {r4, lr}
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
6a94: e2504000 subs r4, r0, #0
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
6a98: e593100c ldr r1, [r3, #12]
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
6a9c: 01a00004 moveq r0, r4
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
6aa0: 08bd8010 popeq {r4, pc}
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
6aa4: e3a0093d mov r0, #999424 ; 0xf4000
6aa8: e2800d09 add r0, r0, #576 ; 0x240
6aac: eb00467e bl 184ac <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
6ab0: e5943018 ldr r3, [r4, #24]
6ab4: e1500003 cmp r0, r3
6ab8: 9a00001f bls 6b3c <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
6abc: e5943014 ldr r3, [r4, #20]
6ac0: e353003b cmp r3, #59 ; 0x3b
6ac4: 8a00001c bhi 6b3c <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
6ac8: e5943010 ldr r3, [r4, #16]
6acc: e353003b cmp r3, #59 ; 0x3b
6ad0: 8a000019 bhi 6b3c <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
6ad4: e594300c ldr r3, [r4, #12]
6ad8: e3530017 cmp r3, #23
6adc: 8a000016 bhi 6b3c <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
6ae0: e5940004 ldr r0, [r4, #4]
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
6ae4: e3500000 cmp r0, #0
6ae8: 08bd8010 popeq {r4, pc}
(the_tod->month == 0) ||
6aec: e350000c cmp r0, #12
6af0: 8a000011 bhi 6b3c <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
6af4: e5942000 ldr r2, [r4]
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
6af8: e3a03d1f mov r3, #1984 ; 0x7c0
6afc: e2833003 add r3, r3, #3
6b00: e1520003 cmp r2, r3
6b04: 9a00000c bls 6b3c <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
6b08: e5944008 ldr r4, [r4, #8]
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
6b0c: e3540000 cmp r4, #0
6b10: 0a00000b beq 6b44 <_TOD_Validate+0xb8>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
6b14: e3120003 tst r2, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
6b18: 059f3030 ldreq r3, [pc, #48] ; 6b50 <_TOD_Validate+0xc4>
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6b1c: 159f302c ldrne r3, [pc, #44] ; 6b50 <_TOD_Validate+0xc4>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
6b20: 0280000d addeq r0, r0, #13
6b24: 07930100 ldreq r0, [r3, r0, lsl #2]
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6b28: 17930100 ldrne r0, [r3, r0, lsl #2]
* false - if the the_tod is invalid
*
* NOTE: This routine only works for leap-years through 2099.
*/
bool _TOD_Validate(
6b2c: e1500004 cmp r0, r4
6b30: 33a00000 movcc r0, #0
6b34: 23a00001 movcs r0, #1
6b38: e8bd8010 pop {r4, pc}
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
6b3c: e3a00000 mov r0, #0
6b40: e8bd8010 pop {r4, pc}
6b44: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
6b48: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00008448 <_Thread_queue_Enqueue_priority>:
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
8448: 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
)
{
844c: e92d05f0 push {r4, r5, r6, r7, r8, sl}
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
8450: e281403c add r4, r1, #60 ; 0x3c
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
8454: e281c038 add ip, r1, #56 ; 0x38
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8458: e5814038 str r4, [r1, #56] ; 0x38
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
845c: e3130020 tst r3, #32
head->previous = NULL;
8460: e3a04000 mov r4, #0
8464: e581403c str r4, [r1, #60] ; 0x3c
tail->previous = head;
8468: e581c040 str ip, [r1, #64] ; 0x40
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
846c: e1a07323 lsr r7, r3, #6
_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 ];
block_state = the_thread_queue->state;
8470: e5905038 ldr r5, [r0, #56] ; 0x38
if ( _Thread_queue_Is_reverse_search( priority ) )
8474: 1a00001e bne 84f4 <_Thread_queue_Enqueue_priority+0xac>
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8478: e0877087 add r7, r7, r7, lsl #1
847c: e1a0c107 lsl ip, r7, #2
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Tail(the_chain));
8480: e28c7004 add r7, ip, #4
8484: e080a00c add sl, r0, ip
8488: e0807007 add r7, r0, r7
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
848c: e10f8000 mrs r8, CPSR
8490: e388c080 orr ip, r8, #128 ; 0x80
8494: e129f00c msr CPSR_fc, ip
8498: e59ac000 ldr ip, [sl]
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
849c: e15c0007 cmp ip, r7
84a0: 1a000009 bne 84cc <_Thread_queue_Enqueue_priority+0x84>
84a4: ea000051 b 85f0 <_Thread_queue_Enqueue_priority+0x1a8>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
__asm__ volatile (
84a8: e10f6000 mrs r6, CPSR
84ac: e129f008 msr CPSR_fc, r8
84b0: e129f006 msr CPSR_fc, r6
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
84b4: e59c6010 ldr r6, [ip, #16]
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) ) {
84b8: e1150006 tst r5, r6
84bc: 0a000034 beq 8594 <_Thread_queue_Enqueue_priority+0x14c>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
84c0: e59cc000 ldr ip, [ip]
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
84c4: e15c0007 cmp ip, r7
84c8: 0a000002 beq 84d8 <_Thread_queue_Enqueue_priority+0x90>
search_priority = search_thread->current_priority;
84cc: e59c4014 ldr r4, [ip, #20]
if ( priority <= search_priority )
84d0: e1530004 cmp r3, r4
84d4: 8afffff3 bhi 84a8 <_Thread_queue_Enqueue_priority+0x60>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
84d8: e5905030 ldr r5, [r0, #48] ; 0x30
84dc: e3550001 cmp r5, #1
84e0: 0a00002d beq 859c <_Thread_queue_Enqueue_priority+0x154>
* 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;
84e4: e5828000 str r8, [r2]
return the_thread_queue->sync_state;
}
84e8: e1a00005 mov r0, r5
84ec: e8bd05f0 pop {r4, r5, r6, r7, r8, sl}
84f0: e12fff1e bx lr
84f4: e0877087 add r7, r7, r7, lsl #1
84f8: e59fa0f8 ldr sl, [pc, #248] ; 85f8 <_Thread_queue_Enqueue_priority+0x1b0>
84fc: e0807107 add r7, r0, r7, lsl #2
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8500: e5da4000 ldrb r4, [sl]
8504: e2844001 add r4, r4, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
8508: e10f8000 mrs r8, CPSR
850c: e388c080 orr ip, r8, #128 ; 0x80
8510: e129f00c msr CPSR_fc, ip
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8514: e597c008 ldr ip, [r7, #8]
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8518: e15c0007 cmp ip, r7
851c: 1a000009 bne 8548 <_Thread_queue_Enqueue_priority+0x100>
8520: ea00000b b 8554 <_Thread_queue_Enqueue_priority+0x10c>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
__asm__ volatile (
8524: e10f6000 mrs r6, CPSR
8528: e129f008 msr CPSR_fc, r8
852c: e129f006 msr CPSR_fc, r6
8530: e59c6010 ldr r6, [ip, #16]
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) ) {
8534: e1150006 tst r5, r6
8538: 0a000013 beq 858c <_Thread_queue_Enqueue_priority+0x144>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
853c: e59cc004 ldr ip, [ip, #4]
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8540: e15c0007 cmp ip, r7
8544: 0a000002 beq 8554 <_Thread_queue_Enqueue_priority+0x10c>
search_priority = search_thread->current_priority;
8548: e59c4014 ldr r4, [ip, #20]
if ( priority >= search_priority )
854c: e1530004 cmp r3, r4
8550: 3afffff3 bcc 8524 <_Thread_queue_Enqueue_priority+0xdc>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8554: e5905030 ldr r5, [r0, #48] ; 0x30
8558: e3550001 cmp r5, #1
855c: 1affffe0 bne 84e4 <_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 )
8560: e1530004 cmp r3, r4
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8564: e3a03000 mov r3, #0
8568: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
856c: 0a000016 beq 85cc <_Thread_queue_Enqueue_priority+0x184>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8570: e59c3000 ldr r3, [ip]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8574: e8811008 stm r1, {r3, ip}
search_node->next = the_node;
next_node->previous = the_node;
8578: e5831004 str r1, [r3, #4]
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;
857c: e58c1000 str r1, [ip]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
8580: e5810044 str r0, [r1, #68] ; 0x44
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
8584: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8588: eaffffd6 b 84e8 <_Thread_queue_Enqueue_priority+0xa0>
858c: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED
8590: eaffffda b 8500 <_Thread_queue_Enqueue_priority+0xb8> <== NOT EXECUTED
8594: e129f008 msr CPSR_fc, r8
8598: eaffffbb b 848c <_Thread_queue_Enqueue_priority+0x44>
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( priority == search_priority )
859c: e1530004 cmp r3, r4
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
85a0: e3a03000 mov r3, #0
85a4: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
85a8: 0a000007 beq 85cc <_Thread_queue_Enqueue_priority+0x184>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
85ac: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
85b0: e581c000 str ip, [r1]
the_node->previous = previous_node;
85b4: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
85b8: e5831000 str r1, [r3]
search_node->previous = the_node;
85bc: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
85c0: e5810044 str r0, [r1, #68] ; 0x44
85c4: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
85c8: eaffffc6 b 84e8 <_Thread_queue_Enqueue_priority+0xa0>
_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;
85cc: e59c3040 ldr r3, [ip, #64] ; 0x40
the_thread->Wait.queue = the_thread_queue;
_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 );
85d0: e28c203c add r2, ip, #60 ; 0x3c
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
85d4: e881000c stm r1, {r2, r3}
the_node->previous = previous_node;
previous_node->next = the_node;
85d8: e5831000 str r1, [r3]
search_node->previous = the_node;
85dc: e58c1040 str r1, [ip, #64] ; 0x40
the_thread->Wait.queue = the_thread_queue;
85e0: e5810044 str r0, [r1, #68] ; 0x44
85e4: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
85e8: e3a05001 mov r5, #1
85ec: eaffffbd b 84e8 <_Thread_queue_Enqueue_priority+0xa0>
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
85f0: e3e04000 mvn r4, #0
85f4: eaffffb7 b 84d8 <_Thread_queue_Enqueue_priority+0x90>
00008be4 <_User_extensions_Thread_create>:
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8be4: e92d40f0 push {r4, r5, r6, r7, lr}
return false;
}
}
return true;
}
8be8: e59f5050 ldr r5, [pc, #80] ; 8c40 <_User_extensions_Thread_create+0x5c>
8bec: e4954004 ldr r4, [r5], #4
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8bf0: e1540005 cmp r4, r5
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8bf4: e1a06000 mov r6, r0
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8bf8: 0a00000e beq 8c38 <_User_extensions_Thread_create+0x54>
the_node = the_node->next ) {
the_extension = (User_extensions_Control *) the_node;
if ( the_extension->Callouts.thread_create != NULL ) {
status = (*the_extension->Callouts.thread_create)(
8bfc: e59f7040 ldr r7, [pc, #64] ; 8c44 <_User_extensions_Thread_create+0x60>
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
the_extension = (User_extensions_Control *) the_node;
if ( the_extension->Callouts.thread_create != NULL ) {
8c00: e5943014 ldr r3, [r4, #20]
8c04: e3530000 cmp r3, #0
status = (*the_extension->Callouts.thread_create)(
8c08: e1a01006 mov r1, r6
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
the_extension = (User_extensions_Control *) the_node;
if ( the_extension->Callouts.thread_create != NULL ) {
8c0c: 0a000004 beq 8c24 <_User_extensions_Thread_create+0x40>
status = (*the_extension->Callouts.thread_create)(
8c10: e5970004 ldr r0, [r7, #4]
8c14: e1a0e00f mov lr, pc
8c18: e12fff13 bx r3
_Thread_Executing,
the_thread
);
if ( !status )
8c1c: e3500000 cmp r0, #0
8c20: 08bd80f0 popeq {r4, r5, r6, r7, pc}
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
8c24: e5944000 ldr r4, [r4]
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8c28: e1540005 cmp r4, r5
8c2c: 1afffff3 bne 8c00 <_User_extensions_Thread_create+0x1c>
if ( !status )
return false;
}
}
return true;
8c30: e3a00001 mov r0, #1
8c34: e8bd80f0 pop {r4, r5, r6, r7, pc}
8c38: e3a00001 mov r0, #1 <== NOT EXECUTED
}
8c3c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000aa6c <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
aa6c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
aa70: e1a04000 mov r4, r0
aa74: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
aa78: e10f2000 mrs r2, CPSR
aa7c: e3823080 orr r3, r2, #128 ; 0x80
aa80: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
aa84: e1a07000 mov r7, r0
aa88: e4973004 ldr r3, [r7], #4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
aa8c: e1530007 cmp r3, r7
aa90: 0a00001a beq ab00 <_Watchdog_Adjust+0x94>
switch ( direction ) {
aa94: e3510000 cmp r1, #0
aa98: 1a00001a bne ab08 <_Watchdog_Adjust+0x9c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
aa9c: e3550000 cmp r5, #0
aaa0: 0a000016 beq ab00 <_Watchdog_Adjust+0x94>
if ( units < _Watchdog_First( header )->delta_interval ) {
aaa4: e5936010 ldr r6, [r3, #16]
aaa8: e1550006 cmp r5, r6
aaac: 21a01002 movcs r1, r2
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
aab0: 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 ) {
aab4: 2a000005 bcs aad0 <_Watchdog_Adjust+0x64>
aab8: ea00001a b ab28 <_Watchdog_Adjust+0xbc> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
aabc: e0555006 subs r5, r5, r6
aac0: 0a00000d beq aafc <_Watchdog_Adjust+0x90>
if ( units < _Watchdog_First( header )->delta_interval ) {
aac4: e5936010 ldr r6, [r3, #16]
aac8: e1560005 cmp r6, r5
aacc: 8a000014 bhi ab24 <_Watchdog_Adjust+0xb8>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
aad0: e5838010 str r8, [r3, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
aad4: e129f001 msr CPSR_fc, r1
_ISR_Enable( level );
_Watchdog_Tickle( header );
aad8: e1a00004 mov r0, r4
aadc: eb0000a4 bl ad74 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
aae0: e10f1000 mrs r1, CPSR
aae4: e3813080 orr r3, r1, #128 ; 0x80
aae8: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
aaec: e5942000 ldr r2, [r4]
_Watchdog_Tickle( header );
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
aaf0: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
aaf4: e1a03002 mov r3, r2
aaf8: 1affffef bne aabc <_Watchdog_Adjust+0x50>
aafc: e1a02001 mov r2, r1
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
ab00: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
ab04: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
ab08: e3510001 cmp r1, #1
ab0c: 1afffffb bne ab00 <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
ab10: e5931010 ldr r1, [r3, #16]
ab14: e0815005 add r5, r1, r5
ab18: e5835010 str r5, [r3, #16]
ab1c: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
ab20: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
ab24: e1a02001 mov r2, r1
_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;
ab28: e0655006 rsb r5, r5, r6
ab2c: e5835010 str r5, [r3, #16]
break;
ab30: eafffff2 b ab00 <_Watchdog_Adjust+0x94>
000073bc <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() )
73bc: e59f3150 ldr r3, [pc, #336] ; 7514 <rtems_io_register_driver+0x158>
73c0: 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;
73c4: e59f314c ldr r3, [pc, #332] ; 7518 <rtems_io_register_driver+0x15c>
if ( rtems_interrupt_is_in_progress() )
73c8: 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
)
{
73cc: e92d4030 push {r4, r5, lr}
73d0: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
73d4: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
73d8: 13a00012 movne r0, #18
rtems_device_major_number *registered_major
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
73dc: 18bd8030 popne {r4, r5, pc}
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
73e0: e3520000 cmp r2, #0
73e4: 0a00003f beq 74e8 <rtems_io_register_driver+0x12c>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
if ( driver_table == NULL )
73e8: e3510000 cmp r1, #0
if ( registered_major == NULL )
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
73ec: e5820000 str r0, [r2]
if ( driver_table == NULL )
73f0: 0a00003c beq 74e8 <rtems_io_register_driver+0x12c>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
73f4: e591c000 ldr ip, [r1]
73f8: e35c0000 cmp ip, #0
73fc: 0a000036 beq 74dc <rtems_io_register_driver+0x120>
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
7400: e1500004 cmp r0, r4
7404: 9a000027 bls 74a8 <rtems_io_register_driver+0xec>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
7408: e59f010c ldr r0, [pc, #268] ; 751c <rtems_io_register_driver+0x160>
740c: e590c000 ldr ip, [r0]
7410: e28cc001 add ip, ip, #1
7414: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
7418: e3540000 cmp r4, #0
741c: 1a000023 bne 74b0 <rtems_io_register_driver+0xf4>
static rtems_status_code rtems_io_obtain_major_number(
rtems_device_major_number *major
)
{
rtems_device_major_number n = _IO_Number_of_drivers;
7420: e593c000 ldr ip, [r3]
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
7424: e35c0000 cmp ip, #0
7428: 0a000030 beq 74f0 <rtems_io_register_driver+0x134>
742c: e59fe0ec ldr lr, [pc, #236] ; 7520 <rtems_io_register_driver+0x164>
7430: e59e3000 ldr r3, [lr]
7434: ea000003 b 7448 <rtems_io_register_driver+0x8c>
7438: e2844001 add r4, r4, #1
743c: e15c0004 cmp ip, r4
7440: e2833018 add r3, r3, #24
7444: 9a000005 bls 7460 <rtems_io_register_driver+0xa4>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7448: e5930000 ldr r0, [r3]
744c: e3500000 cmp r0, #0
7450: 1afffff8 bne 7438 <rtems_io_register_driver+0x7c>
7454: e5930004 ldr r0, [r3, #4]
7458: e3500000 cmp r0, #0
745c: 1afffff5 bne 7438 <rtems_io_register_driver+0x7c>
}
/* Assigns invalid value in case of failure */
*major = m;
if ( m != n )
7460: e15c0004 cmp ip, r4
7464: 1084c084 addne ip, r4, r4, lsl #1
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
7468: e5824000 str r4, [r2]
if ( m != n )
746c: 11a0c18c lslne ip, ip, #3
7470: 0a00001f beq 74f4 <rtems_io_register_driver+0x138>
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
7474: e59e5000 ldr r5, [lr]
7478: e1a0e001 mov lr, r1
747c: e8be000f ldm lr!, {r0, r1, r2, r3}
7480: e085c00c add ip, r5, ip
7484: e8ac000f stmia ip!, {r0, r1, r2, r3}
7488: e89e0003 ldm lr, {r0, r1}
748c: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
7490: eb000789 bl 92bc <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
7494: e3a01000 mov r1, #0
7498: e1a00004 mov r0, r4
749c: e1a02001 mov r2, r1
}
74a0: e8bd4030 pop {r4, r5, lr}
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
74a4: ea001ee8 b f04c <rtems_io_initialize>
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
74a8: e3a0000a mov r0, #10
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
74ac: e8bd8030 pop {r4, r5, pc}
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
74b0: e59fe068 ldr lr, [pc, #104] ; 7520 <rtems_io_register_driver+0x164>
74b4: e084c084 add ip, r4, r4, lsl #1
74b8: e59e3000 ldr r3, [lr]
74bc: e1a0c18c lsl ip, ip, #3
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
74c0: e793000c ldr r0, [r3, ip]
74c4: e3500000 cmp r0, #0
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
74c8: e083300c add r3, r3, ip
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
74cc: 0a00000b beq 7500 <rtems_io_register_driver+0x144>
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();
74d0: eb000779 bl 92bc <_Thread_Enable_dispatch>
return RTEMS_RESOURCE_IN_USE;
74d4: e3a0000c mov r0, #12
74d8: e8bd8030 pop {r4, r5, pc}
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
74dc: e591c004 ldr ip, [r1, #4]
74e0: e35c0000 cmp ip, #0
74e4: 1affffc5 bne 7400 <rtems_io_register_driver+0x44>
if ( driver_table == NULL )
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
74e8: e3a00009 mov r0, #9
74ec: e8bd8030 pop {r4, r5, pc}
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
74f0: 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();
74f4: eb000770 bl 92bc <_Thread_Enable_dispatch>
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
74f8: e3a00005 mov r0, #5
if ( major == 0 ) {
rtems_status_code sc = rtems_io_obtain_major_number( registered_major );
if ( sc != RTEMS_SUCCESSFUL ) {
_Thread_Enable_dispatch();
return sc;
74fc: e8bd8030 pop {r4, r5, pc}
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
7500: e5933004 ldr r3, [r3, #4]
7504: e3530000 cmp r3, #0
7508: 1afffff0 bne 74d0 <rtems_io_register_driver+0x114>
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
750c: e5824000 str r4, [r2]
7510: eaffffd7 b 7474 <rtems_io_register_driver+0xb8>
0000cb5c <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
cb5c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
cb60: e2525000 subs r5, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
cb64: e1a04000 mov r4, r0
cb68: e1a06001 mov r6, r1
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
cb6c: 03a00009 moveq r0, #9
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
cb70: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
cb74: e59f9148 ldr r9, [pc, #328] ; ccc4 <rtems_task_mode+0x168>
cb78: e5997004 ldr r7, [r9, #4]
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
cb7c: e5d7a074 ldrb sl, [r7, #116] ; 0x74
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
cb80: e59780f4 ldr r8, [r7, #244] ; 0xf4
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
cb84: e597307c ldr r3, [r7, #124] ; 0x7c
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
cb88: e35a0000 cmp sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
cb8c: e5d8b008 ldrb fp, [r8, #8]
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
cb90: 03a0ac01 moveq sl, #256 ; 0x100
cb94: 13a0a000 movne sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
cb98: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
cb9c: 138aac02 orrne sl, sl, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
cba0: e35b0000 cmp fp, #0
cba4: 03a0bb01 moveq fp, #1024 ; 0x400
cba8: 13a0b000 movne fp, #0
old_mode |= _ISR_Get_level();
cbac: ebfff226 bl 944c <_CPU_ISR_Get_level>
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
cbb0: e18bb000 orr fp, fp, r0
old_mode |= _ISR_Get_level();
cbb4: e18ba00a orr sl, fp, sl
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
cbb8: e3160c01 tst r6, #256 ; 0x100
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
old_mode |= _ISR_Get_level();
*previous_mode_set = old_mode;
cbbc: e585a000 str sl, [r5]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
cbc0: 0a000003 beq cbd4 <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
cbc4: e3140c01 tst r4, #256 ; 0x100
cbc8: 13a03000 movne r3, #0
cbcc: 03a03001 moveq r3, #1
cbd0: e5c73074 strb r3, [r7, #116] ; 0x74
if ( mask & RTEMS_TIMESLICE_MASK ) {
cbd4: e3160c02 tst r6, #512 ; 0x200
cbd8: 1a000028 bne cc80 <rtems_task_mode+0x124>
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
cbdc: e3160080 tst r6, #128 ; 0x80
cbe0: 1a00002f bne cca4 <rtems_task_mode+0x148>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
cbe4: e2166b01 ands r6, r6, #1024 ; 0x400
cbe8: 0a000012 beq cc38 <rtems_task_mode+0xdc>
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
cbec: e3140b01 tst r4, #1024 ; 0x400
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
cbf0: e5d82008 ldrb r2, [r8, #8]
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
cbf4: 13a03000 movne r3, #0
cbf8: 03a03001 moveq r3, #1
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
cbfc: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cc00: 03a06000 moveq r6, #0
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
cc04: 0a00000b beq cc38 <rtems_task_mode+0xdc>
asr->is_enabled = is_asr_enabled;
cc08: e5c83008 strb r3, [r8, #8]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
cc0c: e10f3000 mrs r3, CPSR
cc10: e3832080 orr r2, r3, #128 ; 0x80
cc14: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
cc18: e5981018 ldr r1, [r8, #24]
information->signals_pending = information->signals_posted;
cc1c: e5982014 ldr r2, [r8, #20]
information->signals_posted = _signals;
cc20: e5881014 str r1, [r8, #20]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
cc24: e5882018 str r2, [r8, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
cc28: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
cc2c: e5986014 ldr r6, [r8, #20]
cc30: e3560000 cmp r6, #0
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cc34: 13a06001 movne r6, #1
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cc38: e59f3088 ldr r3, [pc, #136] ; ccc8 <rtems_task_mode+0x16c>
cc3c: e5933000 ldr r3, [r3]
cc40: e3530003 cmp r3, #3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
cc44: 13a00000 movne r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cc48: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
Thread_Control *executing;
executing = _Thread_Executing;
if ( are_signals_pending ||
cc4c: e3560000 cmp r6, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
cc50: e5993004 ldr r3, [r9, #4]
if ( are_signals_pending ||
cc54: 1a000015 bne ccb0 <rtems_task_mode+0x154>
cc58: e59f2064 ldr r2, [pc, #100] ; ccc4 <rtems_task_mode+0x168>
cc5c: e5922008 ldr r2, [r2, #8]
cc60: e1530002 cmp r3, r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
cc64: 01a00006 moveq r0, r6
cc68: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
cc6c: e5d33074 ldrb r3, [r3, #116] ; 0x74
cc70: e3530000 cmp r3, #0
cc74: 1a00000d bne ccb0 <rtems_task_mode+0x154>
cc78: e1a00006 mov r0, r6 <== NOT EXECUTED
}
cc7c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
*/
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
cc80: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
cc84: 159f3040 ldrne r3, [pc, #64] ; cccc <rtems_task_mode+0x170>
cc88: 15933000 ldrne r3, [r3]
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
cc8c: 13a02001 movne r2, #1
cc90: 1587207c strne r2, [r7, #124] ; 0x7c
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
cc94: 15873078 strne r3, [r7, #120] ; 0x78
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
cc98: 0587307c streq r3, [r7, #124] ; 0x7c
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
cc9c: e3160080 tst r6, #128 ; 0x80
cca0: 0affffcf beq cbe4 <rtems_task_mode+0x88>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
cca4: e2040080 and r0, r4, #128 ; 0x80
cca8: ebfff1e2 bl 9438 <_CPU_ISR_Set_level>
ccac: eaffffcc b cbe4 <rtems_task_mode+0x88>
_Thread_Dispatch_necessary = true;
ccb0: e3a03001 mov r3, #1
ccb4: e5c93010 strb r3, [r9, #16]
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
ccb8: ebffec46 bl 7dd8 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
ccbc: e3a00000 mov r0, #0
ccc0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}