RTEMS 4.11Annotated Report
Fri Mar 18 22:46:59 2011
0000b1fc <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b1fc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
b200: 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;
b204: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b208: e24dd01c sub sp, sp, #28
b20c: 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 ) {
b210: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b214: 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 ) {
b218: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b21c: 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;
b220: 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 ) {
b224: 2a00007a bcs b414 <_Heap_Allocate_aligned_with_boundary+0x218>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
b228: e3530000 cmp r3, #0
b22c: 1a000076 bne b40c <_Heap_Allocate_aligned_with_boundary+0x210>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b230: 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 ) {
b234: e1570009 cmp r7, r9
b238: 0a000075 beq b414 <_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
b23c: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
b240: 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
b244: e2833007 add r3, r3, #7
b248: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
b24c: 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 ) {
b250: 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 ) {
b254: e599a004 ldr sl, [r9, #4]
b258: e59d2000 ldr r2, [sp]
b25c: e152000a cmp r2, sl
b260: 2a000050 bcs b3a8 <_Heap_Allocate_aligned_with_boundary+0x1ac>
if ( alignment == 0 ) {
b264: 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;
b268: 02894008 addeq r4, r9, #8
b26c: 0a000053 beq b3c0 <_Heap_Allocate_aligned_with_boundary+0x1c4>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b270: 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;
b274: 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;
b278: 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;
b27c: 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;
b280: 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;
b284: e081400a add r4, r1, sl
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b288: 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;
b28c: e0633002 rsb r3, r3, r2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b290: 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
b294: e083a00a add sl, r3, sl
b298: 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;
b29c: e2893008 add r3, r9, #8
b2a0: e58d3008 str r3, [sp, #8]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b2a4: eb001555 bl 10800 <__umodsi3>
b2a8: 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 ) {
b2ac: e15a0004 cmp sl, r4
b2b0: 2a000003 bcs b2c4 <_Heap_Allocate_aligned_with_boundary+0xc8>
b2b4: e1a0000a mov r0, sl
b2b8: e1a01008 mov r1, r8
b2bc: eb00154f bl 10800 <__umodsi3>
b2c0: e060400a rsb r4, r0, sl
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
b2c4: e35b0000 cmp fp, #0
b2c8: 0a000026 beq b368 <_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;
b2cc: e084a005 add sl, r4, r5
b2d0: e1a0000a mov r0, sl
b2d4: e1a0100b mov r1, fp
b2d8: eb001548 bl 10800 <__umodsi3>
b2dc: 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 ) {
b2e0: e15a0000 cmp sl, r0
b2e4: 93a0a000 movls sl, #0
b2e8: 83a0a001 movhi sl, #1
b2ec: e1540000 cmp r4, r0
b2f0: 23a0a000 movcs sl, #0
b2f4: e35a0000 cmp sl, #0
b2f8: 0a00001a beq b368 <_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;
b2fc: e59d1008 ldr r1, [sp, #8]
b300: 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 ) {
b304: e1530000 cmp r3, r0
b308: 958d9018 strls r9, [sp, #24]
b30c: 91a09003 movls r9, r3
b310: 9a000002 bls b320 <_Heap_Allocate_aligned_with_boundary+0x124>
b314: ea000023 b b3a8 <_Heap_Allocate_aligned_with_boundary+0x1ac>
b318: e1590000 cmp r9, r0
b31c: 8a00003e bhi b41c <_Heap_Allocate_aligned_with_boundary+0x220>
return 0;
}
alloc_begin = boundary_line - alloc_size;
b320: e0654000 rsb r4, r5, r0
b324: e1a01008 mov r1, r8
b328: e1a00004 mov r0, r4
b32c: eb001533 bl 10800 <__umodsi3>
b330: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
b334: e084a005 add sl, r4, r5
b338: e1a0000a mov r0, sl
b33c: e1a0100b mov r1, fp
b340: eb00152e bl 10800 <__umodsi3>
b344: 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 ) {
b348: e15a0000 cmp sl, r0
b34c: 93a0a000 movls sl, #0
b350: 83a0a001 movhi sl, #1
b354: e1540000 cmp r4, r0
b358: 23a0a000 movcs sl, #0
b35c: e35a0000 cmp sl, #0
b360: 1affffec bne b318 <_Heap_Allocate_aligned_with_boundary+0x11c>
b364: 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 ) {
b368: e59d2008 ldr r2, [sp, #8]
b36c: e1520004 cmp r2, r4
b370: 8a00000c bhi b3a8 <_Heap_Allocate_aligned_with_boundary+0x1ac>
b374: e59d100c ldr r1, [sp, #12]
b378: e1a00004 mov r0, r4
b37c: eb00151f bl 10800 <__umodsi3>
b380: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000
b384: e28aa8ff add sl, sl, #16711680 ; 0xff0000
b388: e28aacff add sl, sl, #65280 ; 0xff00
b38c: 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);
b390: 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 ) {
b394: e59d1004 ldr r1, [sp, #4]
b398: e060300a rsb r3, r0, sl
b39c: e15a0000 cmp sl, r0
b3a0: 11510003 cmpne r1, r3
b3a4: 9a000005 bls b3c0 <_Heap_Allocate_aligned_with_boundary+0x1c4>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b3a8: 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 ) {
b3ac: e1570009 cmp r7, r9
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b3b0: 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 ) {
b3b4: 0a00001d beq b430 <_Heap_Allocate_aligned_with_boundary+0x234>
b3b8: e1a06003 mov r6, r3
b3bc: eaffffa4 b b254 <_Heap_Allocate_aligned_with_boundary+0x58>
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
b3c0: e3540000 cmp r4, #0
b3c4: 0afffff7 beq b3a8 <_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;
b3c8: e2872048 add r2, r7, #72 ; 0x48
b3cc: e892000c ldm r2, {r2, r3}
b3d0: e2822001 add r2, r2, #1
stats->searches += search_count;
b3d4: 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;
b3d8: e5872048 str r2, [r7, #72] ; 0x48
stats->searches += search_count;
b3dc: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
b3e0: e1a00007 mov r0, r7
b3e4: e1a01009 mov r1, r9
b3e8: e1a02004 mov r2, r4
b3ec: e1a03005 mov r3, r5
b3f0: ebffede7 bl 6b94 <_Heap_Block_allocate>
b3f4: e1a00004 mov r0, r4
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
b3f8: e5973044 ldr r3, [r7, #68] ; 0x44
b3fc: e1530006 cmp r3, r6
stats->max_search = search_count;
b400: 35876044 strcc r6, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
}
b404: e28dd01c add sp, sp, #28
b408: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
b40c: e1550003 cmp r5, r3
b410: 9a000008 bls b438 <_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 ) {
b414: e3a00000 mov r0, #0
b418: eafffff9 b b404 <_Heap_Allocate_aligned_with_boundary+0x208>
b41c: e59d9018 ldr r9, [sp, #24] <== NOT EXECUTED
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b420: 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 ) {
b424: e1570009 cmp r7, r9 <== NOT EXECUTED
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b428: 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 ) {
b42c: 1affffe1 bne b3b8 <_Heap_Allocate_aligned_with_boundary+0x1bc><== NOT EXECUTED
b430: e3a00000 mov r0, #0
b434: eaffffef b b3f8 <_Heap_Allocate_aligned_with_boundary+0x1fc>
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
b438: e3580000 cmp r8, #0
b43c: 01a08002 moveq r8, r2
b440: eaffff7a b b230 <_Heap_Allocate_aligned_with_boundary+0x34>
0000b444 <_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 ) {
b444: e2513000 subs r3, r1, #0
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
b448: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
b44c: 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;
b450: 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 ) {
b454: 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);
b458: e1a00003 mov r0, r3
b45c: e5941010 ldr r1, [r4, #16]
b460: e2435008 sub r5, r3, #8
b464: eb0014e5 bl 10800 <__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
b468: 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);
b46c: 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;
b470: e1550002 cmp r5, r2
b474: 3a00002f bcc b538 <_Heap_Free+0xf4>
b478: e5941024 ldr r1, [r4, #36] ; 0x24
b47c: e1550001 cmp r5, r1
b480: 8a00002c bhi b538 <_Heap_Free+0xf4>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b484: 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;
b488: 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);
b48c: 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;
b490: e1520003 cmp r2, r3
b494: 8a000027 bhi b538 <_Heap_Free+0xf4>
b498: e1510003 cmp r1, r3
b49c: 3a000027 bcc b540 <_Heap_Free+0xfc>
b4a0: e5937004 ldr r7, [r3, #4]
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
b4a4: e2170001 ands r0, r7, #1
b4a8: 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 ));
b4ac: 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;
b4b0: e3c77001 bic r7, r7, #1
b4b4: 03a08000 moveq r8, #0
b4b8: 0a000004 beq b4d0 <_Heap_Free+0x8c>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b4bc: 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;
b4c0: e5900004 ldr r0, [r0, #4]
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
b4c4: e3100001 tst r0, #1
b4c8: 13a08000 movne r8, #0
b4cc: 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 ) ) {
b4d0: e21c0001 ands r0, ip, #1
b4d4: 1a00001b bne b548 <_Heap_Free+0x104>
uintptr_t const prev_size = block->prev_size;
b4d8: 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);
b4dc: 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;
b4e0: e152000a cmp r2, sl
b4e4: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
b4e8: e151000a cmp r1, sl
b4ec: 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;
b4f0: 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) ) {
b4f4: e2100001 ands r0, r0, #1
b4f8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
b4fc: e3580000 cmp r8, #0
b500: 0a000039 beq b5ec <_Heap_Free+0x1a8>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b504: 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;
b508: e0867007 add r7, r6, r7
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b50c: 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;
b510: e087c00c add ip, r7, ip
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b514: 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;
b518: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b51c: 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;
b520: e5832008 str r2, [r3, #8]
next->prev = prev;
b524: 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;
b528: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b52c: 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;
b530: e78ac00c str ip, [sl, ip]
b534: ea00000f b b578 <_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;
b538: e3a00000 mov r0, #0
b53c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
b540: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b544: 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 */
b548: e3580000 cmp r8, #0
b54c: 0a000014 beq b5a4 <_Heap_Free+0x160>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b550: 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;
b554: e0877006 add r7, r7, r6
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b558: 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;
b55c: e3871001 orr r1, r7, #1
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
b560: e5852008 str r2, [r5, #8]
new_block->prev = prev;
b564: e585300c str r3, [r5, #12]
next->prev = new_block;
prev->next = new_block;
b568: e5835008 str r5, [r3, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
b56c: e582500c str r5, [r2, #12]
b570: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
b574: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b578: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
b57c: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b580: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b584: e2422001 sub r2, r2, #1
++stats->frees;
b588: e2833001 add r3, r3, #1
stats->free_size += block_size;
b58c: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b590: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
b594: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b598: e5846030 str r6, [r4, #48] ; 0x30
return( true );
b59c: e3a00001 mov r0, #1
b5a0: 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;
b5a4: e3862001 orr r2, r6, #1
b5a8: e5852004 str r2, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b5ac: e2842038 add r2, r4, #56 ; 0x38
b5b0: 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;
b5b4: 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;
b5b8: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b5bc: 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;
b5c0: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
b5c4: e152000c cmp r2, ip
new_block->next = next;
b5c8: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
b5cc: 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;
b5d0: e5830004 str r0, [r3, #4]
block_before->next = new_block;
next->prev = new_block;
b5d4: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
b5d8: 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;
b5dc: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
b5e0: e5842038 str r2, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
b5e4: 8584203c strhi r2, [r4, #60] ; 0x3c
b5e8: eaffffe2 b b578 <_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;
b5ec: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b5f0: e38c2001 orr r2, ip, #1
b5f4: e58a2004 str r2, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b5f8: e5932004 ldr r2, [r3, #4]
b5fc: e3c22001 bic r2, r2, #1
b600: e5832004 str r2, [r3, #4]
next_block->prev_size = size;
b604: e785c006 str ip, [r5, r6]
b608: eaffffda b b578 <_Heap_Free+0x134>
00012630 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
12630: e92d40f0 push {r4, r5, r6, r7, lr}
12634: e1a04000 mov r4, r0
12638: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
1263c: e1a00001 mov r0, r1
12640: e5941010 ldr r1, [r4, #16]
12644: e1a07002 mov r7, r2
12648: ebfff86c bl 10800 <__umodsi3>
1264c: 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
12650: 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);
12654: 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;
12658: e1500003 cmp r0, r3
1265c: 3a000010 bcc 126a4 <_Heap_Size_of_alloc_area+0x74>
12660: e5942024 ldr r2, [r4, #36] ; 0x24
12664: e1500002 cmp r0, r2
12668: 8a00000d bhi 126a4 <_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;
1266c: e5906004 ldr r6, [r0, #4]
12670: 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);
12674: 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;
12678: e1530006 cmp r3, r6
1267c: 8a000008 bhi 126a4 <_Heap_Size_of_alloc_area+0x74>
12680: e1520006 cmp r2, r6
12684: 3a000008 bcc 126ac <_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;
12688: 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 )
1268c: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
12690: 12655004 rsbne r5, r5, #4
12694: 10856006 addne r6, r5, r6
12698: 15876000 strne r6, [r7]
return true;
1269c: 13a00001 movne r0, #1
126a0: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
126a4: e3a00000 mov r0, #0
126a8: e8bd80f0 pop {r4, r5, r6, r7, pc}
126ac: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
126b0: 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: eb002635 bl 106e8 <__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: eb00087d bl 9088 <_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: eb000868 bl 9060 <_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: eb00083c bl 9078 <_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: eb00100f bl afe4 <_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: eb000813 bl 9060 <_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: eb001a17 bl d894 <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: eb001a12 bl d894 <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: eb001a0c bl d894 <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: eb0007f6 bl 9078 <_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: eb0024bc bl 106e8 <__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: eb0006fb bl 9078 <_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}
00006a98 <_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();
6a98: e59f30b8 ldr r3, [pc, #184] ; 6b58 <_TOD_Validate+0xc0>
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
6a9c: 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) ||
6aa0: 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();
6aa4: 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;
6aa8: 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) ||
6aac: 08bd8010 popeq {r4, pc}
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
6ab0: e3a0093d mov r0, #999424 ; 0xf4000
6ab4: e2800d09 add r0, r0, #576 ; 0x240
6ab8: eb00465a bl 18428 <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
6abc: e5943018 ldr r3, [r4, #24]
6ac0: e1500003 cmp r0, r3
6ac4: 9a00001f bls 6b48 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
6ac8: e5943014 ldr r3, [r4, #20]
6acc: e353003b cmp r3, #59 ; 0x3b
6ad0: 8a00001c bhi 6b48 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
6ad4: e5943010 ldr r3, [r4, #16]
6ad8: e353003b cmp r3, #59 ; 0x3b
6adc: 8a000019 bhi 6b48 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
6ae0: e594300c ldr r3, [r4, #12]
6ae4: e3530017 cmp r3, #23
6ae8: 8a000016 bhi 6b48 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
6aec: 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) ||
6af0: e3500000 cmp r0, #0
6af4: 08bd8010 popeq {r4, pc}
(the_tod->month == 0) ||
6af8: e350000c cmp r0, #12
6afc: 8a000011 bhi 6b48 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
6b00: 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) ||
6b04: e3a03d1f mov r3, #1984 ; 0x7c0
6b08: e2833003 add r3, r3, #3
6b0c: e1520003 cmp r2, r3
6b10: 9a00000c bls 6b48 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
6b14: 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) ||
6b18: e3540000 cmp r4, #0
6b1c: 0a00000b beq 6b50 <_TOD_Validate+0xb8>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
6b20: e3120003 tst r2, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
6b24: 059f3030 ldreq r3, [pc, #48] ; 6b5c <_TOD_Validate+0xc4>
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6b28: 159f302c ldrne r3, [pc, #44] ; 6b5c <_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 ];
6b2c: 0280000d addeq r0, r0, #13
6b30: 07930100 ldreq r0, [r3, r0, lsl #2]
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6b34: 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(
6b38: e1500004 cmp r0, r4
6b3c: 33a00000 movcc r0, #0
6b40: 23a00001 movcs r0, #1
6b44: 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;
6b48: e3a00000 mov r0, #0
6b4c: e8bd8010 pop {r4, pc}
6b50: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
6b54: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000844c <_Thread_queue_Enqueue_priority>:
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
844c: 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
)
{
8450: 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 );
8454: e281403c add r4, r1, #60 ; 0x3c
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
8458: e281c038 add ip, r1, #56 ; 0x38
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
845c: 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 ) )
8460: e3130020 tst r3, #32
head->previous = NULL;
8464: e3a04000 mov r4, #0
8468: e581403c str r4, [r1, #60] ; 0x3c
tail->previous = head;
846c: 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);
8470: 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;
8474: e5905038 ldr r5, [r0, #56] ; 0x38
if ( _Thread_queue_Is_reverse_search( priority ) )
8478: 1a00001e bne 84f8 <_Thread_queue_Enqueue_priority+0xac>
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
847c: e0877087 add r7, r7, r7, lsl #1
8480: 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));
8484: e28c7004 add r7, ip, #4
8488: e080a00c add sl, r0, ip
848c: e0807007 add r7, r0, r7
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
8490: e10f8000 mrs r8, CPSR
8494: e388c080 orr ip, r8, #128 ; 0x80
8498: e129f00c msr CPSR_fc, ip
849c: 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 ) ) {
84a0: e15c0007 cmp ip, r7
84a4: 1a000009 bne 84d0 <_Thread_queue_Enqueue_priority+0x84>
84a8: ea000051 b 85f4 <_Thread_queue_Enqueue_priority+0x1a8>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
__asm__ volatile (
84ac: e10f6000 mrs r6, CPSR
84b0: e129f008 msr CPSR_fc, r8
84b4: 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);
84b8: 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) ) {
84bc: e1150006 tst r5, r6
84c0: 0a000034 beq 8598 <_Thread_queue_Enqueue_priority+0x14c>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
84c4: 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 ) ) {
84c8: e15c0007 cmp ip, r7
84cc: 0a000002 beq 84dc <_Thread_queue_Enqueue_priority+0x90>
search_priority = search_thread->current_priority;
84d0: e59c4014 ldr r4, [ip, #20]
if ( priority <= search_priority )
84d4: e1530004 cmp r3, r4
84d8: 8afffff3 bhi 84ac <_Thread_queue_Enqueue_priority+0x60>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
84dc: e5905030 ldr r5, [r0, #48] ; 0x30
84e0: e3550001 cmp r5, #1
84e4: 0a00002d beq 85a0 <_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;
84e8: e5828000 str r8, [r2]
return the_thread_queue->sync_state;
}
84ec: e1a00005 mov r0, r5
84f0: e8bd05f0 pop {r4, r5, r6, r7, r8, sl}
84f4: e12fff1e bx lr
84f8: e0877087 add r7, r7, r7, lsl #1
84fc: e59fa0f8 ldr sl, [pc, #248] ; 85fc <_Thread_queue_Enqueue_priority+0x1b0>
8500: 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;
8504: e5da4000 ldrb r4, [sl]
8508: e2844001 add r4, r4, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
850c: e10f8000 mrs r8, CPSR
8510: e388c080 orr ip, r8, #128 ; 0x80
8514: e129f00c msr CPSR_fc, ip
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
8518: 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 ) ) {
851c: e15c0007 cmp ip, r7
8520: 1a000009 bne 854c <_Thread_queue_Enqueue_priority+0x100>
8524: ea00000b b 8558 <_Thread_queue_Enqueue_priority+0x10c>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
__asm__ volatile (
8528: e10f6000 mrs r6, CPSR
852c: e129f008 msr CPSR_fc, r8
8530: e129f006 msr CPSR_fc, r6
8534: 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) ) {
8538: e1150006 tst r5, r6
853c: 0a000013 beq 8590 <_Thread_queue_Enqueue_priority+0x144>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
8540: 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 ) ) {
8544: e15c0007 cmp ip, r7
8548: 0a000002 beq 8558 <_Thread_queue_Enqueue_priority+0x10c>
search_priority = search_thread->current_priority;
854c: e59c4014 ldr r4, [ip, #20]
if ( priority >= search_priority )
8550: e1530004 cmp r3, r4
8554: 3afffff3 bcc 8528 <_Thread_queue_Enqueue_priority+0xdc>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8558: e5905030 ldr r5, [r0, #48] ; 0x30
855c: e3550001 cmp r5, #1
8560: 1affffe0 bne 84e8 <_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 )
8564: 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;
8568: e3a03000 mov r3, #0
856c: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
8570: 0a000016 beq 85d0 <_Thread_queue_Enqueue_priority+0x184>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8574: e59c3000 ldr r3, [ip]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8578: e8811008 stm r1, {r3, ip}
search_node->next = the_node;
next_node->previous = the_node;
857c: 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;
8580: e58c1000 str r1, [ip]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
8584: e5810044 str r0, [r1, #68] ; 0x44
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
8588: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
858c: eaffffd6 b 84ec <_Thread_queue_Enqueue_priority+0xa0>
8590: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED
8594: eaffffda b 8504 <_Thread_queue_Enqueue_priority+0xb8> <== NOT EXECUTED
8598: e129f008 msr CPSR_fc, r8
859c: eaffffbb b 8490 <_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 )
85a0: 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;
85a4: e3a03000 mov r3, #0
85a8: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
85ac: 0a000007 beq 85d0 <_Thread_queue_Enqueue_priority+0x184>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
85b0: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
85b4: e581c000 str ip, [r1]
the_node->previous = previous_node;
85b8: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
85bc: e5831000 str r1, [r3]
search_node->previous = the_node;
85c0: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
85c4: e5810044 str r0, [r1, #68] ; 0x44
85c8: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
85cc: eaffffc6 b 84ec <_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;
85d0: 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 );
85d4: e28c203c add r2, ip, #60 ; 0x3c
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
85d8: e881000c stm r1, {r2, r3}
the_node->previous = previous_node;
previous_node->next = the_node;
85dc: e5831000 str r1, [r3]
search_node->previous = the_node;
85e0: e58c1040 str r1, [ip, #64] ; 0x40
the_thread->Wait.queue = the_thread_queue;
85e4: e5810044 str r0, [r1, #68] ; 0x44
85e8: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
85ec: e3a05001 mov r5, #1
85f0: eaffffbd b 84ec <_Thread_queue_Enqueue_priority+0xa0>
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
85f4: e3e04000 mvn r4, #0
85f8: eaffffb7 b 84dc <_Thread_queue_Enqueue_priority+0x90>
00016358 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
16358: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1635c: e24dd024 sub sp, sp, #36 ; 0x24
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
16360: e28d1018 add r1, sp, #24
16364: e28d700c add r7, sp, #12
16368: e281b004 add fp, r1, #4
head->previous = NULL;
tail->previous = head;
1636c: e58d1020 str r1, [sp, #32]
16370: e2801008 add r1, r0, #8
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
16374: e3a03000 mov r3, #0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
16378: e2872004 add r2, r7, #4
1637c: e58d1004 str r1, [sp, #4]
16380: e2801040 add r1, r0, #64 ; 0x40
16384: e58db018 str fp, [sp, #24]
head->previous = NULL;
16388: e58d301c str r3, [sp, #28]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
1638c: e58d200c str r2, [sp, #12]
head->previous = NULL;
16390: e58d3010 str r3, [sp, #16]
tail->previous = head;
16394: e58d7014 str r7, [sp, #20]
16398: e59fa1ac ldr sl, [pc, #428] ; 1654c <_Timer_server_Body+0x1f4>
1639c: e59f91ac ldr r9, [pc, #428] ; 16550 <_Timer_server_Body+0x1f8>
163a0: e58d1008 str r1, [sp, #8]
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
163a4: e58d2000 str r2, [sp]
163a8: e1a04000 mov r4, r0
163ac: e2806030 add r6, r0, #48 ; 0x30
163b0: e2808068 add r8, r0, #104 ; 0x68
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
163b4: e28d2018 add r2, sp, #24
163b8: e5842078 str r2, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
163bc: e59a3000 ldr r3, [sl]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
163c0: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
163c4: e1a02007 mov r2, r7
163c8: e1a00006 mov r0, r6
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
163cc: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
163d0: e0611003 rsb r1, r1, r3
163d4: eb001149 bl 1a900 <_Watchdog_Adjust_to_chain>
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
163d8: e5995000 ldr r5, [r9]
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
163dc: e5942074 ldr r2, [r4, #116] ; 0x74
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
163e0: e1550002 cmp r5, r2
163e4: 8a000022 bhi 16474 <_Timer_server_Body+0x11c>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
163e8: 3a000018 bcc 16450 <_Timer_server_Body+0xf8>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
163ec: e5845074 str r5, [r4, #116] ; 0x74
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
163f0: e5940078 ldr r0, [r4, #120] ; 0x78
163f4: eb0002c2 bl 16f04 <_Chain_Get>
if ( timer == NULL ) {
163f8: e2501000 subs r1, r0, #0
163fc: 0a00000b beq 16430 <_Timer_server_Body+0xd8>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
16400: e5913038 ldr r3, [r1, #56] ; 0x38
16404: e3530001 cmp r3, #1
16408: 0a000015 beq 16464 <_Timer_server_Body+0x10c>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
1640c: e3530003 cmp r3, #3
16410: 1afffff6 bne 163f0 <_Timer_server_Body+0x98>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
16414: e2811010 add r1, r1, #16
16418: e1a00008 mov r0, r8
1641c: eb001162 bl 1a9ac <_Watchdog_Insert>
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
16420: e5940078 ldr r0, [r4, #120] ; 0x78
16424: eb0002b6 bl 16f04 <_Chain_Get>
if ( timer == NULL ) {
16428: e2501000 subs r1, r0, #0
1642c: 1afffff3 bne 16400 <_Timer_server_Body+0xa8>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
16430: e10f2000 mrs r2, CPSR
16434: e3823080 orr r3, r2, #128 ; 0x80
16438: e129f003 msr CPSR_fc, r3
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
1643c: e59d3018 ldr r3, [sp, #24]
16440: e153000b cmp r3, fp
16444: 0a00000f beq 16488 <_Timer_server_Body+0x130>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
16448: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
1644c: eaffffda b 163bc <_Timer_server_Body+0x64> <== NOT EXECUTED
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
16450: e1a00008 mov r0, r8
16454: e3a01001 mov r1, #1
16458: e0652002 rsb r2, r5, r2
1645c: eb0010f5 bl 1a838 <_Watchdog_Adjust>
16460: eaffffe1 b 163ec <_Timer_server_Body+0x94>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
16464: e1a00006 mov r0, r6
16468: e2811010 add r1, r1, #16
1646c: eb00114e bl 1a9ac <_Watchdog_Insert>
16470: eaffffde b 163f0 <_Timer_server_Body+0x98>
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16474: e0621005 rsb r1, r2, r5
16478: e1a00008 mov r0, r8
1647c: e1a02007 mov r2, r7
16480: eb00111e bl 1a900 <_Watchdog_Adjust_to_chain>
16484: eaffffd8 b 163ec <_Timer_server_Body+0x94>
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
16488: e5841078 str r1, [r4, #120] ; 0x78
1648c: e129f002 msr CPSR_fc, r2
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
16490: e59d300c ldr r3, [sp, #12]
16494: e59d1000 ldr r1, [sp]
16498: e1530001 cmp r3, r1
1649c: 0a000015 beq 164f8 <_Timer_server_Body+0x1a0>
164a0: e1a05004 mov r5, r4
164a4: e59d4000 ldr r4, [sp]
164a8: ea000009 b 164d4 <_Timer_server_Body+0x17c>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
164ac: e5932000 ldr r2, [r3]
head->next = new_first;
new_first->previous = head;
164b0: e5827004 str r7, [r2, #4]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
164b4: e58d200c str r2, [sp, #12]
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
164b8: e3a02000 mov r2, #0
164bc: e5832008 str r2, [r3, #8]
164c0: e129f001 msr CPSR_fc, r1
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
164c4: e2830020 add r0, r3, #32
164c8: e8900003 ldm r0, {r0, r1}
164cc: e1a0e00f mov lr, pc
164d0: e593f01c ldr pc, [r3, #28]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
164d4: e10f1000 mrs r1, CPSR
164d8: e3813080 orr r3, r1, #128 ; 0x80
164dc: e129f003 msr CPSR_fc, r3
initialized = false;
}
#endif
return status;
}
164e0: e59d300c ldr r3, [sp, #12]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
164e4: e1530004 cmp r3, r4
164e8: 1affffef bne 164ac <_Timer_server_Body+0x154>
164ec: e1a04005 mov r4, r5
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
164f0: e129f001 msr CPSR_fc, r1
164f4: eaffffae b 163b4 <_Timer_server_Body+0x5c>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
164f8: e3a03000 mov r3, #0
164fc: e5c4307c strb r3, [r4, #124] ; 0x7c
16500: e59f104c ldr r1, [pc, #76] ; 16554 <_Timer_server_Body+0x1fc>
16504: e5913000 ldr r3, [r1]
16508: e2833001 add r3, r3, #1
1650c: e5813000 str r3, [r1]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
16510: e3a01008 mov r1, #8
16514: e5940000 ldr r0, [r4]
16518: eb000f34 bl 1a1f0 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
1651c: e1a00004 mov r0, r4
16520: ebffff60 bl 162a8 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
16524: e1a00004 mov r0, r4
16528: ebffff74 bl 16300 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
1652c: eb000cf6 bl 1990c <_Thread_Enable_dispatch>
ts->active = true;
16530: e3a02001 mov r2, #1
16534: e5c4207c strb r2, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16538: e59d0004 ldr r0, [sp, #4]
1653c: eb00117f bl 1ab40 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16540: e59d0008 ldr r0, [sp, #8]
16544: eb00117d bl 1ab40 <_Watchdog_Remove>
16548: eaffff99 b 163b4 <_Timer_server_Body+0x5c>
00008be8 <_User_extensions_Thread_create>:
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8be8: e92d40f0 push {r4, r5, r6, r7, lr}
return false;
}
}
return true;
}
8bec: e59f5050 ldr r5, [pc, #80] ; 8c44 <_User_extensions_Thread_create+0x5c>
8bf0: e4954004 ldr r4, [r5], #4
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8bf4: e1540005 cmp r4, r5
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8bf8: e1a06000 mov r6, r0
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8bfc: 0a00000e beq 8c3c <_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)(
8c00: e59f7040 ldr r7, [pc, #64] ; 8c48 <_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 ) {
8c04: e5943014 ldr r3, [r4, #20]
8c08: e3530000 cmp r3, #0
status = (*the_extension->Callouts.thread_create)(
8c0c: 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 ) {
8c10: 0a000004 beq 8c28 <_User_extensions_Thread_create+0x40>
status = (*the_extension->Callouts.thread_create)(
8c14: e5970004 ldr r0, [r7, #4]
8c18: e1a0e00f mov lr, pc
8c1c: e12fff13 bx r3
_Thread_Executing,
the_thread
);
if ( !status )
8c20: e3500000 cmp r0, #0
8c24: 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 ) {
8c28: e5944000 ldr r4, [r4]
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8c2c: e1540005 cmp r4, r5
8c30: 1afffff3 bne 8c04 <_User_extensions_Thread_create+0x1c>
if ( !status )
return false;
}
}
return true;
8c34: e3a00001 mov r0, #1
8c38: e8bd80f0 pop {r4, r5, r6, r7, pc}
8c3c: e3a00001 mov r0, #1 <== NOT EXECUTED
}
8c40: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000a9e8 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
a9e8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
a9ec: e1a04000 mov r4, r0
a9f0: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
a9f4: e10f2000 mrs r2, CPSR
a9f8: e3823080 orr r3, r2, #128 ; 0x80
a9fc: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
aa00: e1a07000 mov r7, r0
aa04: 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 ) ) {
aa08: e1530007 cmp r3, r7
aa0c: 0a00001a beq aa7c <_Watchdog_Adjust+0x94>
switch ( direction ) {
aa10: e3510000 cmp r1, #0
aa14: 1a00001a bne aa84 <_Watchdog_Adjust+0x9c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
aa18: e3550000 cmp r5, #0
aa1c: 0a000016 beq aa7c <_Watchdog_Adjust+0x94>
if ( units < _Watchdog_First( header )->delta_interval ) {
aa20: e5936010 ldr r6, [r3, #16]
aa24: e1550006 cmp r5, r6
aa28: 21a01002 movcs r1, r2
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
aa2c: 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 ) {
aa30: 2a000005 bcs aa4c <_Watchdog_Adjust+0x64>
aa34: ea00001a b aaa4 <_Watchdog_Adjust+0xbc> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
aa38: e0555006 subs r5, r5, r6
aa3c: 0a00000d beq aa78 <_Watchdog_Adjust+0x90>
if ( units < _Watchdog_First( header )->delta_interval ) {
aa40: e5936010 ldr r6, [r3, #16]
aa44: e1560005 cmp r6, r5
aa48: 8a000014 bhi aaa0 <_Watchdog_Adjust+0xb8>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
aa4c: e5838010 str r8, [r3, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
aa50: e129f001 msr CPSR_fc, r1
_ISR_Enable( level );
_Watchdog_Tickle( header );
aa54: e1a00004 mov r0, r4
aa58: eb0000a4 bl acf0 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
aa5c: e10f1000 mrs r1, CPSR
aa60: e3813080 orr r3, r1, #128 ; 0x80
aa64: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
aa68: e5942000 ldr r2, [r4]
_Watchdog_Tickle( header );
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
aa6c: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
aa70: e1a03002 mov r3, r2
aa74: 1affffef bne aa38 <_Watchdog_Adjust+0x50>
aa78: e1a02001 mov r2, r1
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
aa7c: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
aa80: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
aa84: e3510001 cmp r1, #1
aa88: 1afffffb bne aa7c <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
aa8c: e5931010 ldr r1, [r3, #16]
aa90: e0815005 add r5, r1, r5
aa94: e5835010 str r5, [r3, #16]
aa98: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
aa9c: 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 (
aaa0: 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;
aaa4: e0655006 rsb r5, r5, r6
aaa8: e5835010 str r5, [r3, #16]
break;
aaac: eafffff2 b aa7c <_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: eb00078a bl 92c0 <_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: ea001ee9 b f050 <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: eb00077a bl 92c0 <_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: eb000771 bl 92c0 <_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>
0000cb60 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
cb60: 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 )
cb64: e2525000 subs r5, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
cb68: e1a04000 mov r4, r0
cb6c: 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;
cb70: 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 )
cb74: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
cb78: e59f9148 ldr r9, [pc, #328] ; ccc8 <rtems_task_mode+0x168>
cb7c: 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;
cb80: e5d7a074 ldrb sl, [r7, #116] ; 0x74
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
cb84: 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 )
cb88: 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;
cb8c: 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;
cb90: 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;
cb94: 03a0ac01 moveq sl, #256 ; 0x100
cb98: 13a0a000 movne sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
cb9c: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
cba0: 138aac02 orrne sl, sl, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
cba4: e35b0000 cmp fp, #0
cba8: 03a0bb01 moveq fp, #1024 ; 0x400
cbac: 13a0b000 movne fp, #0
old_mode |= _ISR_Get_level();
cbb0: ebfff226 bl 9450 <_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;
cbb4: e18bb000 orr fp, fp, r0
old_mode |= _ISR_Get_level();
cbb8: e18ba00a orr sl, fp, sl
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
cbbc: 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;
cbc0: e585a000 str sl, [r5]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
cbc4: 0a000003 beq cbd8 <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
cbc8: e3140c01 tst r4, #256 ; 0x100
cbcc: 13a03000 movne r3, #0
cbd0: 03a03001 moveq r3, #1
cbd4: e5c73074 strb r3, [r7, #116] ; 0x74
if ( mask & RTEMS_TIMESLICE_MASK ) {
cbd8: e3160c02 tst r6, #512 ; 0x200
cbdc: 1a000028 bne cc84 <rtems_task_mode+0x124>
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
cbe0: e3160080 tst r6, #128 ; 0x80
cbe4: 1a00002f bne cca8 <rtems_task_mode+0x148>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
cbe8: e2166b01 ands r6, r6, #1024 ; 0x400
cbec: 0a000012 beq cc3c <rtems_task_mode+0xdc>
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
cbf0: 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 ) {
cbf4: e5d82008 ldrb r2, [r8, #8]
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
cbf8: 13a03000 movne r3, #0
cbfc: 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 ) {
cc00: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cc04: 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 ) {
cc08: 0a00000b beq cc3c <rtems_task_mode+0xdc>
asr->is_enabled = is_asr_enabled;
cc0c: e5c83008 strb r3, [r8, #8]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
__asm__ volatile (
cc10: e10f3000 mrs r3, CPSR
cc14: e3832080 orr r2, r3, #128 ; 0x80
cc18: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
cc1c: e5981018 ldr r1, [r8, #24]
information->signals_pending = information->signals_posted;
cc20: e5982014 ldr r2, [r8, #20]
information->signals_posted = _signals;
cc24: 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;
cc28: e5882018 str r2, [r8, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
cc2c: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
cc30: e5986014 ldr r6, [r8, #20]
cc34: e3560000 cmp r6, #0
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cc38: 13a06001 movne r6, #1
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cc3c: e59f3088 ldr r3, [pc, #136] ; cccc <rtems_task_mode+0x16c>
cc40: e5933000 ldr r3, [r3]
cc44: e3530003 cmp r3, #3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
cc48: 13a00000 movne r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cc4c: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
Thread_Control *executing;
executing = _Thread_Executing;
if ( are_signals_pending ||
cc50: e3560000 cmp r6, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
cc54: e5993004 ldr r3, [r9, #4]
if ( are_signals_pending ||
cc58: 1a000015 bne ccb4 <rtems_task_mode+0x154>
cc5c: e59f2064 ldr r2, [pc, #100] ; ccc8 <rtems_task_mode+0x168>
cc60: e5922008 ldr r2, [r2, #8]
cc64: e1530002 cmp r3, r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
cc68: 01a00006 moveq r0, r6
cc6c: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
cc70: e5d33074 ldrb r3, [r3, #116] ; 0x74
cc74: e3530000 cmp r3, #0
cc78: 1a00000d bne ccb4 <rtems_task_mode+0x154>
cc7c: e1a00006 mov r0, r6 <== NOT EXECUTED
}
cc80: 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) ) {
cc84: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
cc88: 159f3040 ldrne r3, [pc, #64] ; ccd0 <rtems_task_mode+0x170>
cc8c: 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;
cc90: 13a02001 movne r2, #1
cc94: 1587207c strne r2, [r7, #124] ; 0x7c
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
cc98: 15873078 strne r3, [r7, #120] ; 0x78
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
cc9c: 0587307c streq r3, [r7, #124] ; 0x7c
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
cca0: e3160080 tst r6, #128 ; 0x80
cca4: 0affffcf beq cbe8 <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 ) );
cca8: e2040080 and r0, r4, #128 ; 0x80
ccac: ebfff1e2 bl 943c <_CPU_ISR_Set_level>
ccb0: eaffffcc b cbe8 <rtems_task_mode+0x88>
_Thread_Dispatch_necessary = true;
ccb4: e3a03001 mov r3, #1
ccb8: e5c93010 strb r3, [r9, #16]
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
ccbc: ebffec46 bl 7ddc <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
ccc0: e3a00000 mov r0, #0
ccc4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}