RTEMS 4.11Annotated Report
Wed Jan 26 16:09:03 2011
00016f6c <_CORE_message_queue_Broadcast>:
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
16f6c: e590304c ldr r3, [r0, #76] ; 0x4c
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
16f70: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
16f74: e1530002 cmp r3, r2
Objects_Id id __attribute__((unused)),
CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)),
#endif
uint32_t *count
)
{
16f78: e1a07000 mov r7, r0
16f7c: e1a05002 mov r5, r2
16f80: e1a08001 mov r8, r1
16f84: e59da020 ldr sl, [sp, #32]
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
16f88: 3a000016 bcc 16fe8 <_CORE_message_queue_Broadcast+0x7c>
* NOTE: This check is critical because threads can block on
* send and receive and this ensures that we are broadcasting
* the message to threads waiting to receive -- not to send.
*/
if ( the_message_queue->number_of_pending_messages != 0 ) {
16f8c: e5906048 ldr r6, [r0, #72] ; 0x48
16f90: e3560000 cmp r6, #0
*count = 0;
16f94: 13a00000 movne r0, #0
16f98: 158a0000 strne r0, [sl]
* NOTE: This check is critical because threads can block on
* send and receive and this ensures that we are broadcasting
* the message to threads waiting to receive -- not to send.
*/
if ( the_message_queue->number_of_pending_messages != 0 ) {
16f9c: 18bd85f0 popne {r4, r5, r6, r7, r8, sl, pc}
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16fa0: e1a00007 mov r0, r7
16fa4: eb000abc bl 19a9c <_Thread_queue_Dequeue>
16fa8: e2504000 subs r4, r0, #0
16fac: 0a00000a beq 16fdc <_CORE_message_queue_Broadcast+0x70>
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
16fb0: e594002c ldr r0, [r4, #44] ; 0x2c
16fb4: e1a01008 mov r1, r8
16fb8: e1a02005 mov r2, r5
16fbc: eb002045 bl 1f0d8 <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
16fc0: e5943028 ldr r3, [r4, #40] ; 0x28
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16fc4: e1a00007 mov r0, r7
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
16fc8: e5835000 str r5, [r3]
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16fcc: eb000ab2 bl 19a9c <_Thread_queue_Dequeue>
16fd0: e2504000 subs r4, r0, #0
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
16fd4: e2866001 add r6, r6, #1
/*
* There must be no pending messages if there is a thread waiting to
* receive a message.
*/
number_broadcasted = 0;
while ((the_thread =
16fd8: 1afffff4 bne 16fb0 <_CORE_message_queue_Broadcast+0x44>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
16fdc: e58a6000 str r6, [sl]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
16fe0: e1a00004 mov r0, r4
16fe4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
16fe8: e3a00001 mov r0, #1 <== NOT EXECUTED
#endif
}
*count = number_broadcasted;
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
16fec: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000aff0 <_CORE_mutex_Seize_interrupt_trylock>:
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
aff0: e59f215c ldr r2, [pc, #348] ; b154 <_CORE_mutex_Seize_interrupt_trylock+0x164>
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
aff4: e590c050 ldr ip, [r0, #80] ; 0x50
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__)
int _CORE_mutex_Seize_interrupt_trylock(
CORE_mutex_Control *the_mutex,
ISR_Level *level_p
)
{
aff8: e1a03000 mov r3, r0
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
affc: e5922004 ldr r2, [r2, #4]
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
b000: e3a00000 mov r0, #0
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
b004: e15c0000 cmp ip, r0
b008: e92d40f0 push {r4, r5, r6, r7, lr}
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
b00c: e5820034 str r0, [r2, #52] ; 0x34
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
b010: 0a00000e beq b050 <_CORE_mutex_Seize_interrupt_trylock+0x60>
return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p );
}
b014: e593c048 ldr ip, [r3, #72] ; 0x48
the_mutex->lock = CORE_MUTEX_LOCKED;
the_mutex->holder = executing;
the_mutex->holder_id = executing->Object.id;
b018: e5925008 ldr r5, [r2, #8]
the_mutex->nest_count = 1;
b01c: e3a04001 mov r4, #1
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
b020: e35c0002 cmp ip, #2
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
the_mutex->lock = CORE_MUTEX_LOCKED;
b024: e5830050 str r0, [r3, #80] ; 0x50
the_mutex->holder = executing;
b028: e583205c str r2, [r3, #92] ; 0x5c
the_mutex->holder_id = executing->Object.id;
b02c: e5835060 str r5, [r3, #96] ; 0x60
the_mutex->nest_count = 1;
b030: e5834054 str r4, [r3, #84] ; 0x54
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
b034: 0a000013 beq b088 <_CORE_mutex_Seize_interrupt_trylock+0x98>
b038: e35c0003 cmp ip, #3
b03c: 0a000018 beq b0a4 <_CORE_mutex_Seize_interrupt_trylock+0xb4>
b040: e5913000 ldr r3, [r1]
b044: e129f003 msr CPSR_fc, r3
executing->resource_count++;
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
_ISR_Enable( *level_p );
return 0;
b048: e3a00000 mov r0, #0
b04c: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
b050: e593005c ldr r0, [r3, #92] ; 0x5c
b054: e1520000 cmp r2, r0
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
b058: 13a00001 movne r0, #1
/*
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
b05c: 18bd80f0 popne {r4, r5, r6, r7, pc}
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
b060: e5930040 ldr r0, [r3, #64] ; 0x40
b064: e3500000 cmp r0, #0
b068: 1a00001e bne b0e8 <_CORE_mutex_Seize_interrupt_trylock+0xf8>
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
b06c: e5932054 ldr r2, [r3, #84] ; 0x54
b070: e2822001 add r2, r2, #1
b074: e5832054 str r2, [r3, #84] ; 0x54
b078: e5913000 ldr r3, [r1]
b07c: e129f003 msr CPSR_fc, r3
_ISR_Enable( *level_p );
return 0;
b080: e3a00000 mov r0, #0
b084: e8bd80f0 pop {r4, r5, r6, r7, pc}
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
b088: e592301c ldr r3, [r2, #28]
b08c: e2833001 add r3, r3, #1
b090: e582301c str r3, [r2, #28]
b094: e5913000 ldr r3, [r1]
b098: e129f003 msr CPSR_fc, r3
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
_ISR_Enable( *level_p );
return 0;
b09c: e3a00000 mov r0, #0
b0a0: e8bd80f0 pop {r4, r5, r6, r7, pc}
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
b0a4: e592c01c ldr ip, [r2, #28]
*/
{
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
b0a8: e593704c ldr r7, [r3, #76] ; 0x4c
current = executing->current_priority;
b0ac: e5926014 ldr r6, [r2, #20]
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
b0b0: e08c5004 add r5, ip, r4
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
b0b4: e1570006 cmp r7, r6
_Chain_Prepend_unprotected( &executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = executing->current_priority;
#endif
executing->resource_count++;
b0b8: e582501c str r5, [r2, #28]
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
b0bc: 0a000020 beq b144 <_CORE_mutex_Seize_interrupt_trylock+0x154>
_ISR_Enable( *level_p );
return 0;
}
if ( current > ceiling ) {
b0c0: 3a000012 bcc b110 <_CORE_mutex_Seize_interrupt_trylock+0x120>
);
_Thread_Enable_dispatch();
return 0;
}
/* if ( current < ceiling ) */ {
executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
b0c4: e3a05006 mov r5, #6
b0c8: e5825034 str r5, [r2, #52] ; 0x34
the_mutex->lock = CORE_MUTEX_UNLOCKED;
b0cc: e5834050 str r4, [r3, #80] ; 0x50
the_mutex->nest_count = 0; /* undo locking above */
b0d0: e5830054 str r0, [r3, #84] ; 0x54
executing->resource_count--; /* undo locking above */
b0d4: e582c01c str ip, [r2, #28]
b0d8: e5913000 ldr r3, [r1]
b0dc: e129f003 msr CPSR_fc, r3
_ISR_Enable( *level_p );
return 0;
b0e0: e3a00000 mov r0, #0
b0e4: e8bd80f0 pop {r4, r5, r6, r7, pc}
* At this point, we know the mutex was not available. If this thread
* is the thread that has locked the mutex, let's see if we are allowed
* to nest access.
*/
if ( _Thread_Is_executing( the_mutex->holder ) ) {
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
b0e8: e3500001 cmp r0, #1
b0ec: 0a000001 beq b0f8 <_CORE_mutex_Seize_interrupt_trylock+0x108>
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
b0f0: e3a00001 mov r0, #1
b0f4: e8bd80f0 pop {r4, r5, r6, r7, pc}
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
_ISR_Enable( *level_p );
return 0;
case CORE_MUTEX_NESTING_IS_ERROR:
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
b0f8: e3a03002 mov r3, #2 <== NOT EXECUTED
b0fc: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED
b100: e5913000 ldr r3, [r1] <== NOT EXECUTED
b104: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
_ISR_Enable( *level_p );
return 0;
b108: e3a00000 mov r0, #0 <== NOT EXECUTED
b10c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
b110: e59f2040 ldr r2, [pc, #64] ; b158 <_CORE_mutex_Seize_interrupt_trylock+0x168>
b114: e5920000 ldr r0, [r2]
b118: e2800001 add r0, r0, #1
b11c: e5820000 str r0, [r2]
b120: e5912000 ldr r2, [r1]
b124: e129f002 msr CPSR_fc, r2
}
if ( current > ceiling ) {
_Thread_Disable_dispatch();
_ISR_Enable( *level_p );
_Thread_Change_priority(
b128: e3a02000 mov r2, #0
b12c: e593005c ldr r0, [r3, #92] ; 0x5c
b130: e593104c ldr r1, [r3, #76] ; 0x4c
b134: ebfff202 bl 7944 <_Thread_Change_priority>
the_mutex->holder,
the_mutex->Attributes.priority_ceiling,
false
);
_Thread_Enable_dispatch();
b138: ebfff33c bl 7e30 <_Thread_Enable_dispatch>
return 0;
b13c: e3a00000 mov r0, #0
b140: e8bd80f0 pop {r4, r5, r6, r7, pc}
b144: e5913000 ldr r3, [r1]
b148: e129f003 msr CPSR_fc, r3
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
_ISR_Enable( *level_p );
return 0;
b14c: e3a00000 mov r0, #0
b150: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000b1c4 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b1c4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
b1c8: 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;
b1cc: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b1d0: e24dd01c sub sp, sp, #28
b1d4: 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 ) {
b1d8: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b1dc: 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 ) {
b1e0: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
b1e4: 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;
b1e8: 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 ) {
b1ec: 2a00007a bcs b3dc <_Heap_Allocate_aligned_with_boundary+0x218>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
b1f0: e3530000 cmp r3, #0
b1f4: 1a000076 bne b3d4 <_Heap_Allocate_aligned_with_boundary+0x210>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b1f8: 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 ) {
b1fc: e1570009 cmp r7, r9
b200: 0a000075 beq b3dc <_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
b204: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
b208: 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
b20c: e2833007 add r3, r3, #7
b210: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
b214: 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 ) {
b218: 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 ) {
b21c: e599a004 ldr sl, [r9, #4]
b220: e59d2000 ldr r2, [sp]
b224: e152000a cmp r2, sl
b228: 2a000050 bcs b370 <_Heap_Allocate_aligned_with_boundary+0x1ac>
if ( alignment == 0 ) {
b22c: 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;
b230: 02894008 addeq r4, r9, #8
b234: 0a000053 beq b388 <_Heap_Allocate_aligned_with_boundary+0x1c4>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b238: 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;
b23c: 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;
b240: 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;
b244: 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;
b248: 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;
b24c: e081400a add r4, r1, sl
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
b250: 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;
b254: e0633002 rsb r3, r3, r2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b258: 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
b25c: e083a00a add sl, r3, sl
b260: 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;
b264: e2893008 add r3, r9, #8
b268: e58d3008 str r3, [sp, #8]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b26c: eb00159b bl 108e0 <__umodsi3>
b270: 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 ) {
b274: e15a0004 cmp sl, r4
b278: 2a000003 bcs b28c <_Heap_Allocate_aligned_with_boundary+0xc8>
b27c: e1a0000a mov r0, sl
b280: e1a01008 mov r1, r8
b284: eb001595 bl 108e0 <__umodsi3>
b288: e060400a rsb r4, r0, sl
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
b28c: e35b0000 cmp fp, #0
b290: 0a000026 beq b330 <_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;
b294: e084a005 add sl, r4, r5
b298: e1a0000a mov r0, sl
b29c: e1a0100b mov r1, fp
b2a0: eb00158e bl 108e0 <__umodsi3>
b2a4: 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 ) {
b2a8: e15a0000 cmp sl, r0
b2ac: 93a0a000 movls sl, #0
b2b0: 83a0a001 movhi sl, #1
b2b4: e1540000 cmp r4, r0
b2b8: 23a0a000 movcs sl, #0
b2bc: e35a0000 cmp sl, #0
b2c0: 0a00001a beq b330 <_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;
b2c4: e59d1008 ldr r1, [sp, #8]
b2c8: 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 ) {
b2cc: e1530000 cmp r3, r0
b2d0: 958d9018 strls r9, [sp, #24]
b2d4: 91a09003 movls r9, r3
b2d8: 9a000002 bls b2e8 <_Heap_Allocate_aligned_with_boundary+0x124>
b2dc: ea000023 b b370 <_Heap_Allocate_aligned_with_boundary+0x1ac>
b2e0: e1590000 cmp r9, r0
b2e4: 8a00003e bhi b3e4 <_Heap_Allocate_aligned_with_boundary+0x220>
return 0;
}
alloc_begin = boundary_line - alloc_size;
b2e8: e0654000 rsb r4, r5, r0
b2ec: e1a01008 mov r1, r8
b2f0: e1a00004 mov r0, r4
b2f4: eb001579 bl 108e0 <__umodsi3>
b2f8: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
b2fc: e084a005 add sl, r4, r5
b300: e1a0000a mov r0, sl
b304: e1a0100b mov r1, fp
b308: eb001574 bl 108e0 <__umodsi3>
b30c: 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 ) {
b310: e15a0000 cmp sl, r0
b314: 93a0a000 movls sl, #0
b318: 83a0a001 movhi sl, #1
b31c: e1540000 cmp r4, r0
b320: 23a0a000 movcs sl, #0
b324: e35a0000 cmp sl, #0
b328: 1affffec bne b2e0 <_Heap_Allocate_aligned_with_boundary+0x11c>
b32c: 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 ) {
b330: e59d2008 ldr r2, [sp, #8]
b334: e1520004 cmp r2, r4
b338: 8a00000c bhi b370 <_Heap_Allocate_aligned_with_boundary+0x1ac>
b33c: e59d100c ldr r1, [sp, #12]
b340: e1a00004 mov r0, r4
b344: eb001565 bl 108e0 <__umodsi3>
b348: e269a4ff rsb sl, r9, #-16777216 ; 0xff000000
b34c: e28aa8ff add sl, sl, #16711680 ; 0xff0000
b350: e28aacff add sl, sl, #65280 ; 0xff00
b354: 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);
b358: 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 ) {
b35c: e59d1004 ldr r1, [sp, #4]
b360: e060300a rsb r3, r0, sl
b364: e15a0000 cmp sl, r0
b368: 11510003 cmpne r1, r3
b36c: 9a000005 bls b388 <_Heap_Allocate_aligned_with_boundary+0x1c4>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b370: 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 ) {
b374: e1570009 cmp r7, r9
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b378: 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 ) {
b37c: 0a00001d beq b3f8 <_Heap_Allocate_aligned_with_boundary+0x234>
b380: e1a06003 mov r6, r3
b384: eaffffa4 b b21c <_Heap_Allocate_aligned_with_boundary+0x58>
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
b388: e3540000 cmp r4, #0
b38c: 0afffff7 beq b370 <_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;
b390: e2872048 add r2, r7, #72 ; 0x48
b394: e892000c ldm r2, {r2, r3}
b398: e2822001 add r2, r2, #1
stats->searches += search_count;
b39c: 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;
b3a0: e5872048 str r2, [r7, #72] ; 0x48
stats->searches += search_count;
b3a4: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
b3a8: e1a00007 mov r0, r7
b3ac: e1a01009 mov r1, r9
b3b0: e1a02004 mov r2, r4
b3b4: e1a03005 mov r3, r5
b3b8: ebffee0a bl 6be8 <_Heap_Block_allocate>
b3bc: e1a00004 mov r0, r4
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
b3c0: e5973044 ldr r3, [r7, #68] ; 0x44
b3c4: e1530006 cmp r3, r6
stats->max_search = search_count;
b3c8: 35876044 strcc r6, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
}
b3cc: e28dd01c add sp, sp, #28
b3d0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
b3d4: e1550003 cmp r5, r3
b3d8: 9a000008 bls b400 <_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 ) {
b3dc: e3a00000 mov r0, #0
b3e0: eafffff9 b b3cc <_Heap_Allocate_aligned_with_boundary+0x208>
b3e4: e59d9018 ldr r9, [sp, #24] <== NOT EXECUTED
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b3e8: 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 ) {
b3ec: e1570009 cmp r7, r9 <== NOT EXECUTED
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
b3f0: 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 ) {
b3f4: 1affffe1 bne b380 <_Heap_Allocate_aligned_with_boundary+0x1bc><== NOT EXECUTED
b3f8: e3a00000 mov r0, #0
b3fc: eaffffef b b3c0 <_Heap_Allocate_aligned_with_boundary+0x1fc>
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
b400: e3580000 cmp r8, #0
b404: 01a08002 moveq r8, r2
b408: eaffff7a b b1f8 <_Heap_Allocate_aligned_with_boundary+0x34>
0000b754 <_Heap_Extend>:
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
b754: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
b758: e1a05000 mov r5, r0
uintptr_t const free_size = stats->free_size;
uintptr_t extend_first_block_size = 0;
uintptr_t extended_size = 0;
bool extend_area_ok = false;
if ( extend_area_end < extend_area_begin ) {
b75c: e0916002 adds r6, r1, r2
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
b760: e1a04001 mov r4, r1
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const first_block = heap->first_block;
b764: e5908020 ldr r8, [r0, #32]
Heap_Block *extend_last_block = NULL;
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr;
uintptr_t const extend_area_end = extend_area_begin + extend_area_size;
uintptr_t const free_size = stats->free_size;
b768: e5951030 ldr r1, [r5, #48] ; 0x30
Heap_Block *merge_above_block = NULL;
Heap_Block *link_below_block = NULL;
Heap_Block *link_above_block = NULL;
Heap_Block *extend_first_block = NULL;
Heap_Block *extend_last_block = NULL;
uintptr_t const page_size = heap->page_size;
b76c: e5900010 ldr r0, [r0, #16]
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
b770: e24dd024 sub sp, sp, #36 ; 0x24
Heap_Block *start_block = first_block;
Heap_Block *merge_below_block = NULL;
Heap_Block *merge_above_block = NULL;
Heap_Block *link_below_block = NULL;
Heap_Block *link_above_block = NULL;
Heap_Block *extend_first_block = NULL;
b774: e3a07000 mov r7, #0
Heap_Control *heap,
void *extend_area_begin_ptr,
uintptr_t extend_area_size,
uintptr_t *extended_size_ptr
)
{
b778: e58d3010 str r3, [sp, #16]
Heap_Block *merge_above_block = NULL;
Heap_Block *link_below_block = NULL;
Heap_Block *link_above_block = NULL;
Heap_Block *extend_first_block = NULL;
Heap_Block *extend_last_block = NULL;
uintptr_t const page_size = heap->page_size;
b77c: e58d0008 str r0, [sp, #8]
Heap_Block *start_block = first_block;
Heap_Block *merge_below_block = NULL;
Heap_Block *merge_above_block = NULL;
Heap_Block *link_below_block = NULL;
Heap_Block *link_above_block = NULL;
Heap_Block *extend_first_block = NULL;
b780: e58d7020 str r7, [sp, #32]
Heap_Block *extend_last_block = NULL;
b784: e58d701c str r7, [sp, #28]
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
b788: e5953014 ldr r3, [r5, #20]
uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr;
uintptr_t const extend_area_end = extend_area_begin + extend_area_size;
uintptr_t const free_size = stats->free_size;
b78c: e58d1018 str r1, [sp, #24]
uintptr_t extend_first_block_size = 0;
uintptr_t extended_size = 0;
bool extend_area_ok = false;
if ( extend_area_end < extend_area_begin ) {
return false;
b790: 21a00007 movcs r0, r7
uintptr_t const free_size = stats->free_size;
uintptr_t extend_first_block_size = 0;
uintptr_t extended_size = 0;
bool extend_area_ok = false;
if ( extend_area_end < extend_area_begin ) {
b794: 3a000001 bcc b7a0 <_Heap_Extend+0x4c>
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
}
b798: e28dd024 add sp, sp, #36 ; 0x24
b79c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if ( extend_area_end < extend_area_begin ) {
return false;
}
extend_area_ok = _Heap_Get_first_and_last_block(
b7a0: e28dc020 add ip, sp, #32
b7a4: e1a01002 mov r1, r2
b7a8: e58dc000 str ip, [sp]
b7ac: e1a00004 mov r0, r4
b7b0: e28dc01c add ip, sp, #28
b7b4: e59d2008 ldr r2, [sp, #8]
b7b8: e58dc004 str ip, [sp, #4]
b7bc: ebffed74 bl 6d94 <_Heap_Get_first_and_last_block>
page_size,
min_block_size,
&extend_first_block,
&extend_last_block
);
if (!extend_area_ok ) {
b7c0: e3500000 cmp r0, #0
b7c4: 0afffff3 beq b798 <_Heap_Extend+0x44>
b7c8: e58d700c str r7, [sp, #12]
b7cc: e58d7014 str r7, [sp, #20]
b7d0: e1a09008 mov r9, r8
b7d4: e1a0b007 mov fp, r7
return false;
}
do {
uintptr_t const sub_area_begin = (start_block != first_block) ?
(uintptr_t) start_block : heap->area_begin;
b7d8: e1590008 cmp r9, r8
b7dc: 05953018 ldreq r3, [r5, #24]
uintptr_t const sub_area_end = start_block->prev_size;
b7e0: e599a000 ldr sl, [r9]
return false;
}
do {
uintptr_t const sub_area_begin = (start_block != first_block) ?
(uintptr_t) start_block : heap->area_begin;
b7e4: 11a03009 movne r3, r9
uintptr_t const sub_area_end = start_block->prev_size;
Heap_Block *const end_block =
_Heap_Block_of_alloc_area( sub_area_end, page_size );
if (
b7e8: e1530006 cmp r3, r6
b7ec: 3154000a cmpcc r4, sl
b7f0: 3a00006c bcc b9a8 <_Heap_Extend+0x254>
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
}
if ( extend_area_end == sub_area_begin ) {
b7f4: e1530006 cmp r3, r6
b7f8: 058d9014 streq r9, [sp, #20]
b7fc: 0a000001 beq b808 <_Heap_Extend+0xb4>
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
b800: e156000a cmp r6, sl
b804: 31a0b009 movcc fp, r9
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b808: e1a0000a mov r0, sl
b80c: e59d1008 ldr r1, [sp, #8]
b810: eb001586 bl 10e30 <__umodsi3>
b814: e24a3008 sub r3, sl, #8
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
b818: e15a0004 cmp sl, r4
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
b81c: e0603003 rsb r3, r0, r3
start_block->prev_size = extend_area_end;
b820: 05896000 streq r6, [r9]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area(
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
b824: 058d300c streq r3, [sp, #12]
merge_below_block = start_block;
} else if ( extend_area_end < sub_area_end ) {
link_below_block = start_block;
}
if ( sub_area_end == extend_area_begin ) {
b828: 0a000001 beq b834 <_Heap_Extend+0xe0>
b82c: e154000a cmp r4, sl
b830: 81a07003 movhi r7, 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;
b834: e5939004 ldr r9, [r3, #4]
b838: e3c99001 bic r9, r9, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
b83c: e0839009 add r9, r3, r9
} else if ( sub_area_end < extend_area_begin ) {
link_above_block = end_block;
}
start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) );
} while ( start_block != first_block );
b840: e1580009 cmp r8, r9
b844: 1affffe3 bne b7d8 <_Heap_Extend+0x84>
if ( extend_area_begin < heap->area_begin ) {
b848: e5953018 ldr r3, [r5, #24]
b84c: e1540003 cmp r4, r3
heap->area_begin = extend_area_begin;
b850: 35854018 strcc r4, [r5, #24]
}
start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) );
} while ( start_block != first_block );
if ( extend_area_begin < heap->area_begin ) {
b854: 3a000002 bcc b864 <_Heap_Extend+0x110>
heap->area_begin = extend_area_begin;
} else if ( heap->area_end < extend_area_end ) {
b858: e595301c ldr r3, [r5, #28]
b85c: e1560003 cmp r6, r3
heap->area_end = extend_area_end;
b860: 8585601c strhi r6, [r5, #28]
}
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
b864: e28d201c add r2, sp, #28
b868: e892000c ldm r2, {r2, r3}
extend_last_block->prev_size = extend_first_block_size;
extend_last_block->size_and_flag = 0;
_Heap_Protection_block_initialize( heap, extend_last_block );
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
b86c: e595c020 ldr ip, [r5, #32]
heap->area_begin = extend_area_begin;
} else if ( heap->area_end < extend_area_end ) {
heap->area_end = extend_area_end;
}
extend_first_block_size =
b870: e0631002 rsb r1, r3, r2
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
extend_first_block->prev_size = extend_area_end;
extend_first_block->size_and_flag =
extend_first_block_size | HEAP_PREV_BLOCK_USED;
b874: e3810001 orr r0, r1, #1
}
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
extend_first_block->prev_size = extend_area_end;
b878: e5836000 str r6, [r3]
extend_last_block->prev_size = extend_first_block_size;
extend_last_block->size_and_flag = 0;
_Heap_Protection_block_initialize( heap, extend_last_block );
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
b87c: e15c0003 cmp ip, r3
extend_first_block->prev_size = extend_area_end;
extend_first_block->size_and_flag =
extend_first_block_size | HEAP_PREV_BLOCK_USED;
_Heap_Protection_block_initialize( heap, extend_first_block );
extend_last_block->prev_size = extend_first_block_size;
b880: e5821000 str r1, [r2]
extend_last_block->size_and_flag = 0;
b884: e3a01000 mov r1, #0
extend_first_block_size =
(uintptr_t) extend_last_block - (uintptr_t) extend_first_block;
extend_first_block->prev_size = extend_area_end;
extend_first_block->size_and_flag =
b888: e5830004 str r0, [r3, #4]
extend_first_block_size | HEAP_PREV_BLOCK_USED;
_Heap_Protection_block_initialize( heap, extend_first_block );
extend_last_block->prev_size = extend_first_block_size;
extend_last_block->size_and_flag = 0;
b88c: e5821004 str r1, [r2, #4]
_Heap_Protection_block_initialize( heap, extend_last_block );
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
heap->first_block = extend_first_block;
b890: 85853020 strhi r3, [r5, #32]
extend_last_block->prev_size = extend_first_block_size;
extend_last_block->size_and_flag = 0;
_Heap_Protection_block_initialize( heap, extend_last_block );
if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) {
b894: 8a000002 bhi b8a4 <_Heap_Extend+0x150>
heap->first_block = extend_first_block;
} else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) {
b898: e5953024 ldr r3, [r5, #36] ; 0x24
b89c: e1530002 cmp r3, r2
heap->last_block = extend_last_block;
b8a0: 35852024 strcc r2, [r5, #36] ; 0x24
}
if ( merge_below_block != NULL ) {
b8a4: e59d3014 ldr r3, [sp, #20]
b8a8: e3530000 cmp r3, #0
b8ac: 0a000050 beq b9f4 <_Heap_Extend+0x2a0>
Heap_Control *heap,
uintptr_t extend_area_begin,
Heap_Block *first_block
)
{
uintptr_t const page_size = heap->page_size;
b8b0: e5958010 ldr r8, [r5, #16] <== NOT EXECUTED
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
b8b4: e2844008 add r4, r4, #8 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
uintptr_t value,
uintptr_t alignment
)
{
uintptr_t remainder = value % alignment;
b8b8: e1a00004 mov r0, r4 <== NOT EXECUTED
b8bc: e1a01008 mov r1, r8 <== NOT EXECUTED
b8c0: eb00155a bl 10e30 <__umodsi3> <== NOT EXECUTED
if ( remainder != 0 ) {
b8c4: e3500000 cmp r0, #0 <== NOT EXECUTED
return value - remainder + alignment;
b8c8: 10844008 addne r4, r4, r8 <== NOT EXECUTED
b8cc: 10604004 rsbne r4, r0, r4 <== NOT EXECUTED
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
b8d0: e59dc014 ldr ip, [sp, #20] <== NOT EXECUTED
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
uintptr_t const new_first_block_begin =
b8d4: e2441008 sub r1, r4, #8 <== NOT EXECUTED
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
b8d8: e59c2000 ldr r2, [ip] <== NOT EXECUTED
uintptr_t const new_first_block_alloc_begin =
_Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size );
uintptr_t const new_first_block_begin =
new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE;
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
b8dc: e061300c rsb r3, r1, ip <== NOT EXECUTED
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED;
b8e0: e3833001 orr r3, r3, #1 <== NOT EXECUTED
uintptr_t const first_block_begin = (uintptr_t) first_block;
uintptr_t const new_first_block_size =
first_block_begin - new_first_block_begin;
Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin;
new_first_block->prev_size = first_block->prev_size;
b8e4: e5042008 str r2, [r4, #-8] <== NOT EXECUTED
new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED;
b8e8: e5813004 str r3, [r1, #4] <== NOT EXECUTED
_Heap_Free_block( heap, new_first_block );
b8ec: e1a00005 mov r0, r5 <== NOT EXECUTED
b8f0: ebffff8f bl b734 <_Heap_Free_block> <== NOT EXECUTED
link_below_block,
extend_last_block
);
}
if ( merge_above_block != NULL ) {
b8f4: e59d000c ldr r0, [sp, #12]
b8f8: e3500000 cmp r0, #0
b8fc: 0a00002b beq b9b0 <_Heap_Extend+0x25c>
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const last_block_new_size = _Heap_Align_down(
extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE,
b900: e2466008 sub r6, r6, #8
uintptr_t extend_area_end
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const last_block_new_size = _Heap_Align_down(
b904: e0606006 rsb r6, r0, r6
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b908: e5951010 ldr r1, [r5, #16]
b90c: e1a00006 mov r0, r6
b910: eb001546 bl 10e30 <__umodsi3>
);
Heap_Block *const new_last_block =
_Heap_Block_at( last_block, last_block_new_size );
new_last_block->size_and_flag =
(last_block->size_and_flag - last_block_new_size)
b914: e59d100c ldr r1, [sp, #12]
b918: e5913004 ldr r3, [r1, #4]
b91c: e0606006 rsb r6, r0, r6
b920: e0663003 rsb r3, r6, r3
page_size
);
Heap_Block *const new_last_block =
_Heap_Block_at( last_block, last_block_new_size );
new_last_block->size_and_flag =
b924: e0862001 add r2, r6, r1
(last_block->size_and_flag - last_block_new_size)
| HEAP_PREV_BLOCK_USED;
b928: e3833001 orr r3, r3, #1
page_size
);
Heap_Block *const new_last_block =
_Heap_Block_at( last_block, last_block_new_size );
new_last_block->size_and_flag =
b92c: e5823004 str r3, [r2, #4]
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
b930: e5913004 ldr r3, [r1, #4]
b934: e2033001 and r3, r3, #1
block->size_and_flag = size | flag;
b938: e1866003 orr r6, r6, r3
b93c: e5816004 str r6, [r1, #4]
(last_block->size_and_flag - last_block_new_size)
| HEAP_PREV_BLOCK_USED;
_Heap_Block_set_size( last_block, last_block_new_size );
_Heap_Free_block( heap, last_block );
b940: e1a00005 mov r0, r5
b944: ebffff7a bl b734 <_Heap_Free_block>
extend_first_block,
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
b948: e59d200c ldr r2, [sp, #12]
b94c: e59d3014 ldr r3, [sp, #20]
b950: e3520000 cmp r2, #0
b954: 03530000 cmpeq r3, #0
b958: 0a000021 beq b9e4 <_Heap_Extend+0x290>
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
}
b95c: e5953024 ldr r3, [r5, #36] ; 0x24
* This feature will be used to terminate the scattered heap area list. See
* also _Heap_Extend().
*/
RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
{
_Heap_Block_set_size(
b960: e595c020 ldr ip, [r5, #32]
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
b964: e5930004 ldr r0, [r3, #4]
_Heap_Free_block( heap, extend_first_block );
}
_Heap_Set_last_block_size( heap );
extended_size = stats->free_size - free_size;
b968: e5952030 ldr r2, [r5, #48] ; 0x30
* This feature will be used to terminate the scattered heap area list. See
* also _Heap_Extend().
*/
RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap )
{
_Heap_Block_set_size(
b96c: e063c00c rsb ip, r3, ip
b970: e59d4018 ldr r4, [sp, #24]
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
b974: e2000001 and r0, r0, #1
/* Statistics */
stats->size += extended_size;
b978: e595102c ldr r1, [r5, #44] ; 0x2c
block->size_and_flag = size | flag;
b97c: e18c0000 orr r0, ip, r0
if ( extended_size_ptr != NULL )
b980: e59dc010 ldr ip, [sp, #16]
_Heap_Free_block( heap, extend_first_block );
}
_Heap_Set_last_block_size( heap );
extended_size = stats->free_size - free_size;
b984: e0642002 rsb r2, r4, r2
/* Statistics */
stats->size += extended_size;
if ( extended_size_ptr != NULL )
b988: e35c0000 cmp ip, #0
_Heap_Set_last_block_size( heap );
extended_size = stats->free_size - free_size;
/* Statistics */
stats->size += extended_size;
b98c: e0811002 add r1, r1, r2
b990: e5830004 str r0, [r3, #4]
b994: e585102c str r1, [r5, #44] ; 0x2c
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
return true;
b998: 13a00001 movne r0, #1
/* Statistics */
stats->size += extended_size;
if ( extended_size_ptr != NULL )
*extended_size_ptr = extended_size;
b99c: 158c2000 strne r2, [ip]
return true;
b9a0: 03a00001 moveq r0, #1
b9a4: eaffff7b b b798 <_Heap_Extend+0x44>
_Heap_Block_of_alloc_area( sub_area_end, page_size );
if (
sub_area_end > extend_area_begin && extend_area_end > sub_area_begin
) {
return false;
b9a8: e3a00000 mov r0, #0
b9ac: eaffff79 b b798 <_Heap_Extend+0x44>
);
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
b9b0: e3570000 cmp r7, #0
b9b4: 0affffe3 beq b948 <_Heap_Extend+0x1f4>
RTEMS_INLINE_ROUTINE void _Heap_Block_set_size(
Heap_Block *block,
uintptr_t size
)
{
uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED;
b9b8: e5973004 ldr r3, [r7, #4]
)
{
uintptr_t const link_begin = (uintptr_t) link;
uintptr_t const first_block_begin = (uintptr_t) first_block;
_Heap_Block_set_size( link, first_block_begin - link_begin );
b9bc: e59d2020 ldr r2, [sp, #32]
b9c0: e2033001 and r3, r3, #1
b9c4: e0672002 rsb r2, r7, r2
block->size_and_flag = size | flag;
b9c8: e1822003 orr r2, r2, r3
b9cc: e5872004 str r2, [r7, #4]
}
if ( merge_above_block != NULL ) {
_Heap_Merge_above( heap, merge_above_block, extend_area_end );
} else if ( link_above_block != NULL ) {
_Heap_Link_above(
b9d0: e59d301c ldr r3, [sp, #28]
uintptr_t const link_begin = (uintptr_t) link;
uintptr_t const first_block_begin = (uintptr_t) first_block;
_Heap_Block_set_size( link, first_block_begin - link_begin );
last_block->size_and_flag |= HEAP_PREV_BLOCK_USED;
b9d4: e5932004 ldr r2, [r3, #4]
b9d8: e3822001 orr r2, r2, #1
b9dc: e5832004 str r2, [r3, #4]
b9e0: eaffffd8 b b948 <_Heap_Extend+0x1f4>
extend_last_block
);
}
if ( merge_below_block == NULL && merge_above_block == NULL ) {
_Heap_Free_block( heap, extend_first_block );
b9e4: e1a00005 mov r0, r5
b9e8: e59d1020 ldr r1, [sp, #32]
b9ec: ebffff50 bl b734 <_Heap_Free_block>
b9f0: eaffffd9 b b95c <_Heap_Extend+0x208>
heap->last_block = extend_last_block;
}
if ( merge_below_block != NULL ) {
_Heap_Merge_below( heap, extend_area_begin, merge_below_block );
} else if ( link_below_block != NULL ) {
b9f4: e35b0000 cmp fp, #0
{
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const link_begin = (uintptr_t) link;
last_block->size_and_flag =
(link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED;
b9f8: 1062b00b rsbne fp, r2, fp
b9fc: 138bb001 orrne fp, fp, #1
)
{
uintptr_t const last_block_begin = (uintptr_t) last_block;
uintptr_t const link_begin = (uintptr_t) link;
last_block->size_and_flag =
ba00: 1582b004 strne fp, [r2, #4]
ba04: eaffffba b b8f4 <_Heap_Extend+0x1a0>
0000b40c <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
b40c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
b410: e1a04000 mov r4, r0
b414: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
b418: e1a00001 mov r0, r1
b41c: e5941010 ldr r1, [r4, #16]
b420: eb00152e bl 108e0 <__umodsi3>
b424: e2455008 sub r5, 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
b428: 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);
b42c: 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;
b430: e1550003 cmp r5, r3
b434: 3a00002f bcc b4f8 <_Heap_Free+0xec>
b438: e5941024 ldr r1, [r4, #36] ; 0x24
b43c: e1550001 cmp r5, r1
b440: 8a00002c bhi b4f8 <_Heap_Free+0xec>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b444: 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;
b448: 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);
b44c: e0852006 add r2, 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;
b450: e1530002 cmp r3, r2
b454: 8a000027 bhi b4f8 <_Heap_Free+0xec>
b458: e1510002 cmp r1, r2
b45c: 3a000027 bcc b500 <_Heap_Free+0xf4>
b460: e5927004 ldr r7, [r2, #4]
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
b464: e2170001 ands r0, r7, #1
b468: 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 ));
b46c: e1510002 cmp r1, r2
- 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;
b470: e3c77001 bic r7, r7, #1
b474: 03a08000 moveq r8, #0
b478: 0a000004 beq b490 <_Heap_Free+0x84>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b47c: e0820007 add r0, r2, 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;
b480: e5900004 ldr r0, [r0, #4]
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
b484: e3100001 tst r0, #1
b488: 13a08000 movne r8, #0
b48c: 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 ) ) {
b490: e21c0001 ands r0, ip, #1
b494: 1a00001b bne b508 <_Heap_Free+0xfc>
uintptr_t const prev_size = block->prev_size;
b498: 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);
b49c: 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;
b4a0: e153000a cmp r3, sl
b4a4: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
b4a8: e151000a cmp r1, sl
b4ac: 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;
b4b0: 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) ) {
b4b4: e2100001 ands r0, r0, #1
b4b8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
b4bc: e3580000 cmp r8, #0
b4c0: 0a000039 beq b5ac <_Heap_Free+0x1a0>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
b4c4: 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;
b4c8: e0867007 add r7, r6, r7
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b4cc: e5923008 ldr r3, [r2, #8]
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
b4d0: e087c00c add ip, r7, ip
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b4d4: e592200c ldr r2, [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;
b4d8: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b4dc: 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;
b4e0: e5823008 str r3, [r2, #8]
next->prev = prev;
b4e4: e583200c str r2, [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;
b4e8: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b4ec: 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;
b4f0: e78ac00c str ip, [sl, ip]
b4f4: ea00000f b b538 <_Heap_Free+0x12c>
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
b4f8: e3a00000 mov r0, #0
b4fc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
b500: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b504: 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 */
b508: e3580000 cmp r8, #0
b50c: 0a000014 beq b564 <_Heap_Free+0x158>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b510: e5923008 ldr r3, [r2, #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;
b514: e0877006 add r7, r7, r6
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
b518: e592200c ldr r2, [r2, #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;
b51c: e3871001 orr r1, r7, #1
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
b520: e5853008 str r3, [r5, #8]
new_block->prev = prev;
b524: e585200c str r2, [r5, #12]
next->prev = new_block;
prev->next = new_block;
b528: e5825008 str r5, [r2, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
b52c: e583500c str r5, [r3, #12]
b530: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
b534: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b538: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
b53c: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b540: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b544: e2422001 sub r2, r2, #1
++stats->frees;
b548: e2833001 add r3, r3, #1
stats->free_size += block_size;
b54c: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
b550: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
b554: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
b558: e5846030 str r6, [r4, #48] ; 0x30
return( true );
b55c: e3a00001 mov r0, #1
b560: 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;
b564: e3863001 orr r3, r6, #1
b568: e5853004 str r3, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b56c: e2843038 add r3, r4, #56 ; 0x38
b570: e8931008 ldm r3, {r3, 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;
b574: e5920004 ldr r0, [r2, #4]
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
b578: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
b57c: e2833001 add r3, r3, #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;
b580: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
b584: e153000c cmp r3, ip
new_block->next = next;
b588: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
b58c: 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;
b590: e5820004 str r0, [r2, #4]
block_before->next = new_block;
next->prev = new_block;
b594: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
b598: 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;
b59c: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
b5a0: e5843038 str r3, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
b5a4: 8584303c strhi r3, [r4, #60] ; 0x3c
b5a8: eaffffe2 b b538 <_Heap_Free+0x12c>
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;
b5ac: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
b5b0: e38c3001 orr r3, ip, #1
b5b4: e58a3004 str r3, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
b5b8: e5923004 ldr r3, [r2, #4]
b5bc: e3c33001 bic r3, r3, #1
b5c0: e5823004 str r3, [r2, #4]
next_block->prev_size = size;
b5c4: e785c006 str ip, [r5, r6]
b5c8: eaffffda b b538 <_Heap_Free+0x12c>
00012710 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
12710: e92d40f0 push {r4, r5, r6, r7, lr}
12714: e1a04000 mov r4, r0
12718: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
1271c: e1a00001 mov r0, r1
12720: e5941010 ldr r1, [r4, #16]
12724: e1a07002 mov r7, r2
12728: ebfff86c bl 108e0 <__umodsi3>
1272c: 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
12730: 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);
12734: 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;
12738: e1500003 cmp r0, r3
1273c: 3a000010 bcc 12784 <_Heap_Size_of_alloc_area+0x74>
12740: e5942024 ldr r2, [r4, #36] ; 0x24
12744: e1500002 cmp r0, r2
12748: 8a00000d bhi 12784 <_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;
1274c: e5906004 ldr r6, [r0, #4]
12750: 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);
12754: 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;
12758: e1530006 cmp r3, r6
1275c: 8a000008 bhi 12784 <_Heap_Size_of_alloc_area+0x74>
12760: e1520006 cmp r2, r6
12764: 3a000008 bcc 1278c <_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;
12768: 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 )
1276c: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
12770: 12655004 rsbne r5, r5, #4
12774: 10856006 addne r6, r5, r6
12778: 15876000 strne r6, [r7]
return true;
1277c: 13a00001 movne r0, #1
12780: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
12784: e3a00000 mov r0, #0
12788: e8bd80f0 pop {r4, r5, r6, r7, pc}
1278c: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
12790: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00007958 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7958: 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() ) ) {
795c: e59f35d8 ldr r3, [pc, #1496] ; 7f3c <_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;
7960: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
7964: 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;
7968: e59f25d0 ldr r2, [pc, #1488] ; 7f40 <_Heap_Walk+0x5e8>
796c: e59f95d0 ldr r9, [pc, #1488] ; 7f44 <_Heap_Walk+0x5ec>
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7970: 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;
7974: 11a09002 movne r9, r2
Heap_Control *heap,
int source,
bool dump
)
{
uintptr_t const page_size = heap->page_size;
7978: 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() ) ) {
797c: 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;
7980: e5902014 ldr r2, [r0, #20]
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
7984: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
7988: e24dd038 sub sp, sp, #56 ; 0x38
798c: e1a04000 mov r4, r0
uintptr_t const page_size = heap->page_size;
7990: e58d1024 str r1, [sp, #36] ; 0x24
uintptr_t const min_block_size = heap->min_block_size;
7994: e58d2028 str r2, [sp, #40] ; 0x28
Heap_Block *const first_block = heap->first_block;
7998: e5908020 ldr r8, [r0, #32]
Heap_Block *const last_block = heap->last_block;
799c: 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() ) ) {
79a0: 0a000002 beq 79b0 <_Heap_Walk+0x58>
}
block = next_block;
} while ( block != first_block );
return true;
79a4: e3a00001 mov r0, #1
}
79a8: e28dd038 add sp, sp, #56 ; 0x38
79ac: 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)(
79b0: e594101c ldr r1, [r4, #28]
79b4: e5900018 ldr r0, [r0, #24]
79b8: e2842008 add r2, r4, #8
79bc: e892000c ldm r2, {r2, r3}
79c0: e59dc028 ldr ip, [sp, #40] ; 0x28
79c4: e58d1008 str r1, [sp, #8]
79c8: e59d102c ldr r1, [sp, #44] ; 0x2c
79cc: e58d0004 str r0, [sp, #4]
79d0: e58d1010 str r1, [sp, #16]
79d4: e58d2014 str r2, [sp, #20]
79d8: e58d3018 str r3, [sp, #24]
79dc: e59f2564 ldr r2, [pc, #1380] ; 7f48 <_Heap_Walk+0x5f0>
79e0: e58dc000 str ip, [sp]
79e4: e58d800c str r8, [sp, #12]
79e8: e1a0000a mov r0, sl
79ec: e3a01000 mov r1, #0
79f0: e59d3024 ldr r3, [sp, #36] ; 0x24
79f4: e1a0e00f mov lr, pc
79f8: e12fff19 bx r9
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
79fc: e59d2024 ldr r2, [sp, #36] ; 0x24
7a00: e3520000 cmp r2, #0
7a04: 0a000026 beq 7aa4 <_Heap_Walk+0x14c>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
7a08: e59d3024 ldr r3, [sp, #36] ; 0x24
7a0c: e2135007 ands r5, r3, #7
7a10: 1a00002a bne 7ac0 <_Heap_Walk+0x168>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7a14: e59d0028 ldr r0, [sp, #40] ; 0x28
7a18: e59d1024 ldr r1, [sp, #36] ; 0x24
7a1c: ebffe56f bl fe0 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
7a20: e250b000 subs fp, r0, #0
7a24: 1a00002c bne 7adc <_Heap_Walk+0x184>
7a28: e2880008 add r0, r8, #8
7a2c: e59d1024 ldr r1, [sp, #36] ; 0x24
7a30: ebffe56a bl fe0 <__umodsi3>
);
return false;
}
if (
7a34: e2506000 subs r6, r0, #0
7a38: 1a00002f bne 7afc <_Heap_Walk+0x1a4>
block = next_block;
} while ( block != first_block );
return true;
}
7a3c: e598b004 ldr fp, [r8, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
7a40: e21b5001 ands r5, fp, #1
7a44: 0a0000fc beq 7e3c <_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;
7a48: e59dc02c ldr ip, [sp, #44] ; 0x2c
7a4c: e59c3004 ldr r3, [ip, #4]
7a50: 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);
7a54: 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;
7a58: e5935004 ldr r5, [r3, #4]
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
7a5c: e2155001 ands r5, r5, #1
7a60: 0a000008 beq 7a88 <_Heap_Walk+0x130>
);
return false;
}
if (
7a64: e1580003 cmp r8, r3
7a68: 0a00002b beq 7b1c <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
7a6c: e1a0000a mov r0, sl <== NOT EXECUTED
7a70: e3a01001 mov r1, #1 <== NOT EXECUTED
7a74: e59f24d0 ldr r2, [pc, #1232] ; 7f4c <_Heap_Walk+0x5f4> <== NOT EXECUTED
7a78: e1a0e00f mov lr, pc <== NOT EXECUTED
7a7c: e12fff19 bx r9 <== NOT EXECUTED
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7a80: e1a00006 mov r0, r6 <== NOT EXECUTED
7a84: eaffffc7 b 79a8 <_Heap_Walk+0x50> <== NOT EXECUTED
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
7a88: e1a0000a mov r0, sl
7a8c: e3a01001 mov r1, #1
7a90: e59f24b8 ldr r2, [pc, #1208] ; 7f50 <_Heap_Walk+0x5f8>
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: e1a00005 mov r0, r5
7aa0: eaffffc0 b 79a8 <_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" );
7aa4: e1a0000a mov r0, sl
7aa8: e3a01001 mov r1, #1
7aac: e59f24a0 ldr r2, [pc, #1184] ; 7f54 <_Heap_Walk+0x5fc>
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: e59d0024 ldr r0, [sp, #36] ; 0x24
7abc: eaffffb9 b 79a8 <_Heap_Walk+0x50>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
7ac0: e1a0000a mov r0, sl
7ac4: e3a01001 mov r1, #1
7ac8: e59f2488 ldr r2, [pc, #1160] ; 7f58 <_Heap_Walk+0x600>
7acc: e1a0e00f mov lr, pc
7ad0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7ad4: e3a00000 mov r0, #0
7ad8: eaffffb2 b 79a8 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
7adc: e1a0000a mov r0, sl
7ae0: e3a01001 mov r1, #1
7ae4: e59f2470 ldr r2, [pc, #1136] ; 7f5c <_Heap_Walk+0x604>
7ae8: e59d3028 ldr r3, [sp, #40] ; 0x28
7aec: e1a0e00f mov lr, pc
7af0: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7af4: e1a00005 mov r0, r5
7af8: eaffffaa b 79a8 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
7afc: e1a0000a mov r0, sl
7b00: e3a01001 mov r1, #1
7b04: e59f2454 ldr r2, [pc, #1108] ; 7f60 <_Heap_Walk+0x608>
7b08: e1a03008 mov r3, r8
7b0c: e1a0e00f mov lr, pc
7b10: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7b14: e1a0000b mov r0, fp
7b18: eaffffa2 b 79a8 <_Heap_Walk+0x50>
block = next_block;
} while ( block != first_block );
return true;
}
7b1c: 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 ) {
7b20: e1540006 cmp r4, r6
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
7b24: 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 ) {
7b28: 05943020 ldreq r3, [r4, #32]
7b2c: 0a00002c beq 7be4 <_Heap_Walk+0x28c>
block = next_block;
} while ( block != first_block );
return true;
}
7b30: 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;
7b34: e1530006 cmp r3, r6
7b38: 8a0000c6 bhi 7e58 <_Heap_Walk+0x500>
7b3c: e594c024 ldr ip, [r4, #36] ; 0x24
7b40: e15c0006 cmp ip, r6
7b44: 3a0000c3 bcc 7e58 <_Heap_Walk+0x500>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7b48: e2860008 add r0, r6, #8
7b4c: e1a01007 mov r1, r7
7b50: e58d3020 str r3, [sp, #32]
7b54: e58dc01c str ip, [sp, #28]
7b58: ebffe520 bl fe0 <__umodsi3>
);
return false;
}
if (
7b5c: e3500000 cmp r0, #0
7b60: e59d3020 ldr r3, [sp, #32]
7b64: e59dc01c ldr ip, [sp, #28]
7b68: 1a0000d8 bne 7ed0 <_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;
7b6c: e5962004 ldr r2, [r6, #4]
7b70: e3c22001 bic r2, r2, #1
block = next_block;
} while ( block != first_block );
return true;
}
7b74: 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;
7b78: e5922004 ldr r2, [r2, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7b7c: e3120001 tst r2, #1
7b80: 1a0000db bne 7ef4 <_Heap_Walk+0x59c>
7b84: e58d8030 str r8, [sp, #48] ; 0x30
7b88: e58db034 str fp, [sp, #52] ; 0x34
7b8c: e1a02004 mov r2, r4
7b90: e1a08003 mov r8, r3
7b94: e1a0b00c mov fp, ip
);
return false;
}
if ( free_block->prev != prev_block ) {
7b98: e596100c ldr r1, [r6, #12]
7b9c: e1510002 cmp r1, r2
7ba0: 1a0000dc bne 7f18 <_Heap_Walk+0x5c0>
return false;
}
prev_block = free_block;
free_block = free_block->next;
7ba4: 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 ) {
7ba8: e1540005 cmp r4, r5
7bac: 0a000009 beq 7bd8 <_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;
7bb0: e1580005 cmp r8, r5
7bb4: 9a00007d bls 7db0 <_Heap_Walk+0x458>
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
(*printer)(
7bb8: e1a0000a mov r0, sl
7bbc: e3a01001 mov r1, #1
7bc0: e59f239c ldr r2, [pc, #924] ; 7f64 <_Heap_Walk+0x60c>
7bc4: e1a03005 mov r3, r5
7bc8: e1a0e00f mov lr, pc
7bcc: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7bd0: e3a00000 mov r0, #0
7bd4: eaffff73 b 79a8 <_Heap_Walk+0x50>
7bd8: e1a03008 mov r3, r8
7bdc: e28d8030 add r8, sp, #48 ; 0x30
7be0: e8980900 ldm r8, {r8, fp}
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7be4: 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;
7be8: 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);
7bec: 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;
7bf0: e1530005 cmp r3, r5
7bf4: 9a000008 bls 7c1c <_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)(
7bf8: e1a0000a mov r0, sl
7bfc: e58d5000 str r5, [sp]
7c00: e3a01001 mov r1, #1
7c04: e59f235c ldr r2, [pc, #860] ; 7f68 <_Heap_Walk+0x610>
7c08: e1a03006 mov r3, r6
7c0c: e1a0e00f mov lr, pc
7c10: e12fff19 bx r9
"block 0x%08x: next block 0x%08x not in heap\n",
block,
next_block
);
return false;
7c14: e3a00000 mov r0, #0
7c18: eaffff62 b 79a8 <_Heap_Walk+0x50>
7c1c: e5943024 ldr r3, [r4, #36] ; 0x24
7c20: e1530005 cmp r3, r5
7c24: 3afffff3 bcc 7bf8 <_Heap_Walk+0x2a0>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7c28: e59d1024 ldr r1, [sp, #36] ; 0x24
7c2c: e1a00007 mov r0, r7
7c30: ebffe4ea bl fe0 <__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;
7c34: e59d102c ldr r1, [sp, #44] ; 0x2c
7c38: e0563001 subs r3, r6, r1
7c3c: 13a03001 movne r3, #1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
7c40: e3500000 cmp r0, #0
7c44: 0a000001 beq 7c50 <_Heap_Walk+0x2f8>
7c48: e3530000 cmp r3, #0
7c4c: 1a000083 bne 7e60 <_Heap_Walk+0x508>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
7c50: e59d2028 ldr r2, [sp, #40] ; 0x28
7c54: e1520007 cmp r2, r7
7c58: 9a000001 bls 7c64 <_Heap_Walk+0x30c>
7c5c: e3530000 cmp r3, #0
7c60: 1a000087 bne 7e84 <_Heap_Walk+0x52c>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
7c64: e1560005 cmp r6, r5
7c68: 3a000001 bcc 7c74 <_Heap_Walk+0x31c>
7c6c: e3530000 cmp r3, #0
7c70: 1a00008d bne 7eac <_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;
7c74: e5953004 ldr r3, [r5, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
7c78: e3130001 tst r3, #1
7c7c: e20bb001 and fp, fp, #1
7c80: 0a000018 beq 7ce8 <_Heap_Walk+0x390>
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
7c84: e35b0000 cmp fp, #0
7c88: 0a00000c beq 7cc0 <_Heap_Walk+0x368>
(*printer)(
7c8c: e58d7000 str r7, [sp]
7c90: e1a0000a mov r0, sl
7c94: e3a01000 mov r1, #0
7c98: e59f22cc ldr r2, [pc, #716] ; 7f6c <_Heap_Walk+0x614>
7c9c: e1a03006 mov r3, r6
7ca0: e1a0e00f mov lr, pc
7ca4: e12fff19 bx r9
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
7ca8: e1580005 cmp r8, r5
7cac: 0affff3c beq 79a4 <_Heap_Walk+0x4c>
7cb0: e595b004 ldr fp, [r5, #4]
7cb4: e5943020 ldr r3, [r4, #32]
7cb8: e1a06005 mov r6, r5
7cbc: eaffffc9 b 7be8 <_Heap_Walk+0x290>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
7cc0: e58d7000 str r7, [sp]
7cc4: e5963000 ldr r3, [r6]
7cc8: e1a0000a mov r0, sl
7ccc: e58d3004 str r3, [sp, #4]
7cd0: e1a0100b mov r1, fp
7cd4: e59f2294 ldr r2, [pc, #660] ; 7f70 <_Heap_Walk+0x618>
7cd8: e1a03006 mov r3, r6
7cdc: e1a0e00f mov lr, pc
7ce0: e12fff19 bx r9
7ce4: eaffffef b 7ca8 <_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 ?
7ce8: 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)(
7cec: e5943008 ldr r3, [r4, #8]
7cf0: e1530002 cmp r3, r2
block = next_block;
} while ( block != first_block );
return true;
}
7cf4: 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)(
7cf8: 059f0274 ldreq r0, [pc, #628] ; 7f74 <_Heap_Walk+0x61c>
7cfc: 0a000003 beq 7d10 <_Heap_Walk+0x3b8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
7d00: e59f3270 ldr r3, [pc, #624] ; 7f78 <_Heap_Walk+0x620>
7d04: e1540002 cmp r4, r2
7d08: e59f026c ldr r0, [pc, #620] ; 7f7c <_Heap_Walk+0x624>
7d0c: 01a00003 moveq r0, r3
block->next,
block->next == last_free_block ?
7d10: 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)(
7d14: e1510003 cmp r1, r3
7d18: 059f1260 ldreq r1, [pc, #608] ; 7f80 <_Heap_Walk+0x628>
7d1c: 0a000003 beq 7d30 <_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)" : "")
7d20: e59fc25c ldr ip, [pc, #604] ; 7f84 <_Heap_Walk+0x62c>
7d24: e1540003 cmp r4, r3
7d28: e59f124c ldr r1, [pc, #588] ; 7f7c <_Heap_Walk+0x624>
7d2c: 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)(
7d30: e58d2004 str r2, [sp, #4]
7d34: e58d0008 str r0, [sp, #8]
7d38: e58d300c str r3, [sp, #12]
7d3c: e58d1010 str r1, [sp, #16]
7d40: e1a03006 mov r3, r6
7d44: e58d7000 str r7, [sp]
7d48: e1a0000a mov r0, sl
7d4c: e3a01000 mov r1, #0
7d50: e59f2230 ldr r2, [pc, #560] ; 7f88 <_Heap_Walk+0x630>
7d54: e1a0e00f mov lr, pc
7d58: e12fff19 bx r9
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
7d5c: e5953000 ldr r3, [r5]
7d60: e1570003 cmp r7, r3
7d64: 1a000021 bne 7df0 <_Heap_Walk+0x498>
);
return false;
}
if ( !prev_used ) {
7d68: e35b0000 cmp fp, #0
7d6c: 0a00002a beq 7e1c <_Heap_Walk+0x4c4>
block = next_block;
} while ( block != first_block );
return true;
}
7d70: 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 ) {
7d74: e1540003 cmp r4, r3
7d78: 0a000004 beq 7d90 <_Heap_Walk+0x438>
if ( free_block == block ) {
7d7c: e1560003 cmp r6, r3
7d80: 0affffc8 beq 7ca8 <_Heap_Walk+0x350>
return true;
}
free_block = free_block->next;
7d84: 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 ) {
7d88: e1540003 cmp r4, r3
7d8c: 1afffffa bne 7d7c <_Heap_Walk+0x424>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
7d90: e1a0000a mov r0, sl
7d94: e3a01001 mov r1, #1
7d98: e59f21ec ldr r2, [pc, #492] ; 7f8c <_Heap_Walk+0x634>
7d9c: e1a03006 mov r3, r6
7da0: e1a0e00f mov lr, pc
7da4: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7da8: e3a00000 mov r0, #0
7dac: eafffefd b 79a8 <_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;
7db0: e155000b cmp r5, fp
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7db4: e2850008 add r0, r5, #8
7db8: 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;
7dbc: 8affff7d bhi 7bb8 <_Heap_Walk+0x260>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
7dc0: ebffe486 bl fe0 <__umodsi3>
);
return false;
}
if (
7dc4: e3500000 cmp r0, #0
7dc8: 1a000041 bne 7ed4 <_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;
7dcc: e5953004 ldr r3, [r5, #4]
7dd0: e3c33001 bic r3, r3, #1
block = next_block;
} while ( block != first_block );
return true;
}
7dd4: 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;
7dd8: e5933004 ldr r3, [r3, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7ddc: e3130001 tst r3, #1
7de0: 1a000044 bne 7ef8 <_Heap_Walk+0x5a0>
7de4: e1a02006 mov r2, r6
7de8: e1a06005 mov r6, r5
7dec: eaffff69 b 7b98 <_Heap_Walk+0x240>
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
(*printer)(
7df0: e58d3004 str r3, [sp, #4]
7df4: e1a0000a mov r0, sl
7df8: e58d7000 str r7, [sp]
7dfc: e58d5008 str r5, [sp, #8]
7e00: e3a01001 mov r1, #1
7e04: e59f2184 ldr r2, [pc, #388] ; 7f90 <_Heap_Walk+0x638>
7e08: e1a03006 mov r3, r6
7e0c: e1a0e00f mov lr, pc
7e10: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7e14: e3a00000 mov r0, #0
7e18: eafffee2 b 79a8 <_Heap_Walk+0x50>
return false;
}
if ( !prev_used ) {
(*printer)(
7e1c: e1a0000a mov r0, sl
7e20: e3a01001 mov r1, #1
7e24: e59f2168 ldr r2, [pc, #360] ; 7f94 <_Heap_Walk+0x63c>
7e28: e1a03006 mov r3, r6
7e2c: e1a0e00f mov lr, pc
7e30: e12fff19 bx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
7e34: e1a0000b mov r0, fp
7e38: eafffeda b 79a8 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
7e3c: e1a0000a mov r0, sl
7e40: e3a01001 mov r1, #1
7e44: e59f214c ldr r2, [pc, #332] ; 7f98 <_Heap_Walk+0x640>
7e48: e1a0e00f mov lr, pc
7e4c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7e50: e1a00005 mov r0, r5
7e54: eafffed3 b 79a8 <_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;
7e58: e1a05006 mov r5, r6 <== NOT EXECUTED
7e5c: eaffff55 b 7bb8 <_Heap_Walk+0x260> <== NOT EXECUTED
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
7e60: e1a0000a mov r0, sl
7e64: e58d7000 str r7, [sp]
7e68: e3a01001 mov r1, #1
7e6c: e59f2128 ldr r2, [pc, #296] ; 7f9c <_Heap_Walk+0x644>
7e70: e1a03006 mov r3, r6
7e74: e1a0e00f mov lr, pc
7e78: e12fff19 bx r9
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
7e7c: e3a00000 mov r0, #0
7e80: eafffec8 b 79a8 <_Heap_Walk+0x50>
}
if ( block_size < min_block_size && is_not_last_block ) {
(*printer)(
7e84: e58d2004 str r2, [sp, #4]
7e88: e1a0000a mov r0, sl
7e8c: e58d7000 str r7, [sp]
7e90: e3a01001 mov r1, #1
7e94: e59f2104 ldr r2, [pc, #260] ; 7fa0 <_Heap_Walk+0x648>
7e98: e1a03006 mov r3, r6
7e9c: e1a0e00f mov lr, pc
7ea0: e12fff19 bx r9
block,
block_size,
min_block_size
);
return false;
7ea4: e3a00000 mov r0, #0
7ea8: eafffebe b 79a8 <_Heap_Walk+0x50>
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
(*printer)(
7eac: e1a0000a mov r0, sl
7eb0: e58d5000 str r5, [sp]
7eb4: e3a01001 mov r1, #1
7eb8: e59f20e4 ldr r2, [pc, #228] ; 7fa4 <_Heap_Walk+0x64c>
7ebc: e1a03006 mov r3, r6
7ec0: e1a0e00f mov lr, pc
7ec4: e12fff19 bx r9
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
7ec8: e3a00000 mov r0, #0
7ecc: eafffeb5 b 79a8 <_Heap_Walk+0x50>
);
return false;
}
if (
7ed0: e1a05006 mov r5, r6 <== NOT EXECUTED
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
7ed4: e1a0000a mov r0, sl
7ed8: e3a01001 mov r1, #1
7edc: e59f20c4 ldr r2, [pc, #196] ; 7fa8 <_Heap_Walk+0x650>
7ee0: e1a03005 mov r3, r5
7ee4: e1a0e00f mov lr, pc
7ee8: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7eec: e3a00000 mov r0, #0
7ef0: eafffeac b 79a8 <_Heap_Walk+0x50>
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
7ef4: e1a05006 mov r5, r6 <== NOT EXECUTED
(*printer)(
7ef8: e1a0000a mov r0, sl
7efc: e3a01001 mov r1, #1
7f00: e59f20a4 ldr r2, [pc, #164] ; 7fac <_Heap_Walk+0x654>
7f04: e1a03005 mov r3, r5
7f08: e1a0e00f mov lr, pc
7f0c: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7f10: e3a00000 mov r0, #0
7f14: eafffea3 b 79a8 <_Heap_Walk+0x50>
return false;
}
if ( free_block->prev != prev_block ) {
(*printer)(
7f18: e58d1000 str r1, [sp]
7f1c: e1a0000a mov r0, sl
7f20: e3a01001 mov r1, #1
7f24: e59f2084 ldr r2, [pc, #132] ; 7fb0 <_Heap_Walk+0x658>
7f28: e1a03006 mov r3, r6
7f2c: e1a0e00f mov lr, pc
7f30: e12fff19 bx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
7f34: e3a00000 mov r0, #0
7f38: eafffe9a b 79a8 <_Heap_Walk+0x50>
00006e34 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6e34: 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 )
6e38: e5904034 ldr r4, [r0, #52] ; 0x34
6e3c: e3540000 cmp r4, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
6e40: e24dd014 sub sp, sp, #20
6e44: 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 );
6e48: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
6e4c: 0a00009b beq 70c0 <_Objects_Extend_information+0x28c>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
6e50: e1d081b4 ldrh r8, [r0, #20]
6e54: e1d0a1b0 ldrh sl, [r0, #16]
6e58: e1a01008 mov r1, r8
6e5c: e1a0000a mov r0, sl
6e60: eb002658 bl 107c8 <__aeabi_uidiv>
6e64: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
6e68: e1b03823 lsrs r3, r3, #16
6e6c: 0a000099 beq 70d8 <_Objects_Extend_information+0x2a4>
if ( information->object_blocks[ block ] == NULL ) {
6e70: e5949000 ldr r9, [r4]
6e74: e3590000 cmp r9, #0
6e78: 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 );
6e7c: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
6e80: 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 ) {
6e84: 0a00000c beq 6ebc <_Objects_Extend_information+0x88>
6e88: e1a02004 mov r2, r4
6e8c: 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 );
6e90: e1a06007 mov r6, r7
index_base = minimum_index;
block = 0;
6e94: e3a04000 mov r4, #0
6e98: ea000002 b 6ea8 <_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 ) {
6e9c: e5b29004 ldr r9, [r2, #4]!
6ea0: e3590000 cmp r9, #0
6ea4: 0a000004 beq 6ebc <_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++ ) {
6ea8: e2844001 add r4, r4, #1
6eac: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
6eb0: 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++ ) {
6eb4: 8afffff8 bhi 6e9c <_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;
6eb8: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
6ebc: 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 ) {
6ec0: e35a0801 cmp sl, #65536 ; 0x10000
6ec4: 2a000063 bcs 7058 <_Objects_Extend_information+0x224>
/*
* 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 ) {
6ec8: 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;
6ecc: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
6ed0: 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;
6ed4: e0000091 mul r0, r1, r0
if ( information->auto_extend ) {
6ed8: 1a000060 bne 7060 <_Objects_Extend_information+0x22c>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
6edc: e58d3000 str r3, [sp]
6ee0: eb000852 bl 9030 <_Workspace_Allocate_or_fatal_error>
6ee4: e59d3000 ldr r3, [sp]
6ee8: e1a08000 mov r8, r0
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
6eec: e3590000 cmp r9, #0
6ef0: 0a000039 beq 6fdc <_Objects_Extend_information+0x1a8>
*/
/*
* Up the block count and maximum
*/
block_count++;
6ef4: e283b001 add fp, r3, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6ef8: e08b008b add r0, fp, fp, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
6efc: e08a0000 add r0, sl, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
6f00: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
6f04: e1a00100 lsl r0, r0, #2
6f08: e58d3000 str r3, [sp]
6f0c: eb00083d bl 9008 <_Workspace_Allocate>
if ( !object_blocks ) {
6f10: e2509000 subs r9, r0, #0
6f14: e59d3000 ldr r3, [sp]
6f18: 0a000073 beq 70ec <_Objects_Extend_information+0x2b8>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
6f1c: e1d521b0 ldrh r2, [r5, #16]
6f20: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
6f24: e089c10b add ip, r9, fp, lsl #2
6f28: e089b18b add fp, r9, fp, lsl #3
6f2c: 3a000051 bcc 7078 <_Objects_Extend_information+0x244>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6f30: e3570000 cmp r7, #0
6f34: 13a02000 movne r2, #0
6f38: 11a0100b movne r1, fp
local_table[ index ] = NULL;
6f3c: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6f40: 0a000003 beq 6f54 <_Objects_Extend_information+0x120>
6f44: e2822001 add r2, r2, #1
6f48: e1570002 cmp r7, r2
local_table[ index ] = NULL;
6f4c: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
6f50: 8afffffb bhi 6f44 <_Objects_Extend_information+0x110>
6f54: 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 );
6f58: e1d511b4 ldrh r1, [r5, #20]
6f5c: e0861001 add r1, r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6f60: e3a00000 mov r0, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
6f64: e1560001 cmp r6, r1
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
6f68: e7890003 str r0, [r9, r3]
inactive_per_block[block_count] = 0;
6f6c: e78c0003 str r0, [ip, r3]
for ( index=index_base ;
6f70: 2a000005 bcs 6f8c <_Objects_Extend_information+0x158>
6f74: e08b2106 add r2, fp, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
6f78: 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++ ) {
6f7c: 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 ;
6f80: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
6f84: 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 ;
6f88: 3afffffb bcc 6f7c <_Objects_Extend_information+0x148>
6f8c: e10f3000 mrs r3, CPSR
6f90: e3832080 orr r2, r3, #128 ; 0x80
6f94: e129f002 msr CPSR_fc, r2
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
6f98: 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(
6f9c: e1d510b4 ldrh r1, [r5, #4]
6fa0: 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;
6fa4: e1a0a80a lsl sl, sl, #16
6fa8: e3822801 orr r2, r2, #65536 ; 0x10000
6fac: e1a0a82a lsr sl, sl, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
6fb0: 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) |
6fb4: e182200a orr r2, r2, sl
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
6fb8: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
6fbc: e585c030 str ip, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
6fc0: e5859034 str r9, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
6fc4: e585b01c str fp, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
6fc8: e1c5a1b0 strh sl, [r5, #16]
information->maximum_id = _Objects_Build_id(
6fcc: e585200c str r2, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
6fd0: e129f003 msr CPSR_fc, r3
information->maximum
);
_ISR_Enable( level );
if ( old_tables )
6fd4: e3500000 cmp r0, #0
_Workspace_Free( old_tables );
6fd8: 1b000810 blne 9020 <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6fdc: e5953034 ldr r3, [r5, #52] ; 0x34
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6fe0: e28d7008 add r7, sp, #8
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6fe4: e7838104 str r8, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
6fe8: e1a01008 mov r1, r8
6fec: e1a00007 mov r0, r7
6ff0: e1d521b4 ldrh r2, [r5, #20]
6ff4: e5953018 ldr r3, [r5, #24]
6ff8: eb000fe3 bl af8c <_Chain_Initialize>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
6ffc: e1a04104 lsl r4, r4, #2
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7000: 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 ) {
7004: ea000009 b 7030 <_Objects_Extend_information+0x1fc>
7008: e5953000 ldr r3, [r5]
the_object->id = _Objects_Build_id(
700c: e1d520b4 ldrh r2, [r5, #4]
7010: e1a03c03 lsl r3, r3, #24
7014: e3833801 orr r3, r3, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
7018: 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) |
701c: e1833006 orr r3, r3, r6
7020: e5813008 str r3, [r1, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7024: e1a00008 mov r0, r8
7028: ebfffce9 bl 63d4 <_Chain_Append>
index++;
702c: 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 ) {
7030: e1a00007 mov r0, r7
7034: ebfffcf9 bl 6420 <_Chain_Get>
7038: e2501000 subs r1, r0, #0
703c: 1afffff1 bne 7008 <_Objects_Extend_information+0x1d4>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
7040: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
7044: e1d531b4 ldrh r3, [r5, #20]
7048: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
704c: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
7050: e7813004 str r3, [r1, r4]
information->inactive =
7054: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
7058: e28dd014 add sp, sp, #20
705c: 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 );
7060: e58d3000 str r3, [sp]
7064: eb0007e7 bl 9008 <_Workspace_Allocate>
if ( !new_object_block )
7068: e2508000 subs r8, r0, #0
706c: e59d3000 ldr r3, [sp]
7070: 1affff9d bne 6eec <_Objects_Extend_information+0xb8>
7074: eafffff7 b 7058 <_Objects_Extend_information+0x224>
/*
* 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,
7078: e1a03103 lsl r3, r3, #2
707c: e5951034 ldr r1, [r5, #52] ; 0x34
7080: e1a02003 mov r2, r3
7084: e88d1008 stm sp, {r3, ip}
7088: eb001a39 bl d974 <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
708c: e89d1008 ldm sp, {r3, ip}
7090: e1a0000c mov r0, ip
7094: e1a02003 mov r2, r3
7098: e5951030 ldr r1, [r5, #48] ; 0x30
709c: eb001a34 bl d974 <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
70a0: e1d521b0 ldrh r2, [r5, #16]
70a4: 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,
70a8: e1a0000b mov r0, fp
70ac: e595101c ldr r1, [r5, #28]
70b0: e1a02102 lsl r2, r2, #2
70b4: eb001a2e bl d974 <memcpy>
70b8: e89d1008 ldm sp, {r3, ip}
70bc: eaffffa5 b 6f58 <_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 )
70c0: e1d0a1b0 ldrh sl, [r0, #16]
70c4: 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 );
70c8: 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;
70cc: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
70d0: e1a03004 mov r3, r4
70d4: eaffff78 b 6ebc <_Objects_Extend_information+0x88>
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
70d8: 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 );
70dc: 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;
70e0: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
70e4: e1a04003 mov r4, r3 <== NOT EXECUTED
70e8: eaffff73 b 6ebc <_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 );
70ec: e1a00008 mov r0, r8
70f0: eb0007ca bl 9020 <_Workspace_Free>
return;
70f4: eaffffd7 b 7058 <_Objects_Extend_information+0x224>
0000743c <_Objects_Shrink_information>:
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
743c: 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 );
7440: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
7444: e1d051b4 ldrh r5, [r0, #20]
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
7448: 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) /
744c: e1d001b0 ldrh r0, [r0, #16]
7450: e1a01005 mov r1, r5
7454: e0640000 rsb r0, r4, r0
7458: eb0024da bl 107c8 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
745c: e3500000 cmp r0, #0
7460: 08bd80f0 popeq {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
7464: e5962030 ldr r2, [r6, #48] ; 0x30
7468: e5923000 ldr r3, [r2]
746c: 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++ ) {
7470: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
7474: 1a000005 bne 7490 <_Objects_Shrink_information+0x54>
7478: ea000008 b 74a0 <_Objects_Shrink_information+0x64> <== NOT EXECUTED
747c: e5b21004 ldr r1, [r2, #4]!
7480: e1550001 cmp r5, r1
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
7484: e0844005 add r4, r4, r5
7488: 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 ] ==
748c: 0a000004 beq 74a4 <_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++ ) {
7490: e2833001 add r3, r3, #1
7494: e1500003 cmp r0, r3
7498: 8afffff7 bhi 747c <_Objects_Shrink_information+0x40>
749c: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
74a0: 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 );
74a4: e5960020 ldr r0, [r6, #32]
74a8: ea000002 b 74b8 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
74ac: e3550000 cmp r5, #0
74b0: 0a00000b beq 74e4 <_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;
74b4: 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 );
74b8: 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) &&
74bc: 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;
74c0: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
74c4: 3afffff8 bcc 74ac <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
74c8: e1d621b4 ldrh r2, [r6, #20]
74cc: 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) &&
74d0: e1530002 cmp r3, r2
74d4: 2afffff4 bcs 74ac <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
74d8: ebfffbc8 bl 6400 <_Chain_Extract>
}
}
while ( the_object );
74dc: e3550000 cmp r5, #0
74e0: 1afffff3 bne 74b4 <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
74e4: e5963034 ldr r3, [r6, #52] ; 0x34
74e8: e7930007 ldr r0, [r3, r7]
74ec: eb0006cb bl 9020 <_Workspace_Free>
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
74f0: e1d602bc ldrh r0, [r6, #44] ; 0x2c
74f4: 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;
74f8: e5961034 ldr r1, [r6, #52] ; 0x34
information->inactive_per_block[ block ] = 0;
74fc: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
7500: 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;
7504: e7815007 str r5, [r1, r7]
information->inactive_per_block[ block ] = 0;
7508: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
750c: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
7510: e8bd80f0 pop {r4, r5, r6, r7, pc}
00006ab4 <_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();
6ab4: e59f30b8 ldr r3, [pc, #184] ; 6b74 <_TOD_Validate+0xc0>
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
6ab8: 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) ||
6abc: 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();
6ac0: 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;
6ac4: 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) ||
6ac8: 08bd8010 popeq {r4, pc}
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
6acc: e3a0093d mov r0, #999424 ; 0xf4000
6ad0: e2800d09 add r0, r0, #576 ; 0x240
6ad4: eb0046a6 bl 18574 <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
6ad8: e5943018 ldr r3, [r4, #24]
6adc: e1500003 cmp r0, r3
6ae0: 9a00001f bls 6b64 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
6ae4: e5943014 ldr r3, [r4, #20]
6ae8: e353003b cmp r3, #59 ; 0x3b
6aec: 8a00001c bhi 6b64 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
6af0: e5943010 ldr r3, [r4, #16]
6af4: e353003b cmp r3, #59 ; 0x3b
6af8: 8a000019 bhi 6b64 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
6afc: e594300c ldr r3, [r4, #12]
6b00: e3530017 cmp r3, #23
6b04: 8a000016 bhi 6b64 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
6b08: 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) ||
6b0c: e3500000 cmp r0, #0
6b10: 08bd8010 popeq {r4, pc}
(the_tod->month == 0) ||
6b14: e350000c cmp r0, #12
6b18: 8a000011 bhi 6b64 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
6b1c: 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) ||
6b20: e3a03d1f mov r3, #1984 ; 0x7c0
6b24: e2833003 add r3, r3, #3
6b28: e1520003 cmp r2, r3
6b2c: 9a00000c bls 6b64 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
6b30: 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) ||
6b34: e3540000 cmp r4, #0
6b38: 0a00000b beq 6b6c <_TOD_Validate+0xb8>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
6b3c: e3120003 tst r2, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
6b40: 059f3030 ldreq r3, [pc, #48] ; 6b78 <_TOD_Validate+0xc4>
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6b44: 159f302c ldrne r3, [pc, #44] ; 6b78 <_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 ];
6b48: 0280000d addeq r0, r0, #13
6b4c: 07930100 ldreq r0, [r3, r0, lsl #2]
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
6b50: 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(
6b54: e1500004 cmp r0, r4
6b58: 33a00000 movcc r0, #0
6b5c: 23a00001 movcs r0, #1
6b60: 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;
6b64: e3a00000 mov r0, #0
6b68: e8bd8010 pop {r4, pc}
6b6c: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
6b70: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00008370 <_Thread_queue_Enqueue_priority>:
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
8370: 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
)
{
8374: 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 );
8378: e281403c add r4, r1, #60 ; 0x3c
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
837c: e281c038 add ip, r1, #56 ; 0x38
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8380: 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 ) )
8384: e3130020 tst r3, #32
head->previous = NULL;
8388: e3a04000 mov r4, #0
838c: e581403c str r4, [r1, #60] ; 0x3c
tail->previous = head;
8390: 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);
8394: 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;
8398: e5905038 ldr r5, [r0, #56] ; 0x38
if ( _Thread_queue_Is_reverse_search( priority ) )
839c: 1a00001e bne 841c <_Thread_queue_Enqueue_priority+0xac>
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
83a0: e0877087 add r7, r7, r7, lsl #1
83a4: 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));
83a8: e28c7004 add r7, ip, #4
83ac: e080a00c add sl, r0, ip
83b0: e0807007 add r7, r0, r7
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
83b4: e10f8000 mrs r8, CPSR
83b8: e388c080 orr ip, r8, #128 ; 0x80
83bc: e129f00c msr CPSR_fc, ip
83c0: 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 ) ) {
83c4: e15c0007 cmp ip, r7
83c8: 1a000009 bne 83f4 <_Thread_queue_Enqueue_priority+0x84>
83cc: ea000051 b 8518 <_Thread_queue_Enqueue_priority+0x1a8>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
83d0: e10f6000 mrs r6, CPSR
83d4: e129f008 msr CPSR_fc, r8
83d8: 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);
83dc: 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) ) {
83e0: e1150006 tst r5, r6
83e4: 0a000034 beq 84bc <_Thread_queue_Enqueue_priority+0x14c>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
83e8: 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 ) ) {
83ec: e15c0007 cmp ip, r7
83f0: 0a000002 beq 8400 <_Thread_queue_Enqueue_priority+0x90>
search_priority = search_thread->current_priority;
83f4: e59c4014 ldr r4, [ip, #20]
if ( priority <= search_priority )
83f8: e1530004 cmp r3, r4
83fc: 8afffff3 bhi 83d0 <_Thread_queue_Enqueue_priority+0x60>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8400: e5905030 ldr r5, [r0, #48] ; 0x30
8404: e3550001 cmp r5, #1
8408: 0a00002d beq 84c4 <_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;
840c: e5828000 str r8, [r2]
return the_thread_queue->sync_state;
}
8410: e1a00005 mov r0, r5
8414: e8bd05f0 pop {r4, r5, r6, r7, r8, sl}
8418: e12fff1e bx lr
841c: e0877087 add r7, r7, r7, lsl #1
8420: e59fa0f8 ldr sl, [pc, #248] ; 8520 <_Thread_queue_Enqueue_priority+0x1b0>
8424: 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;
8428: e5da4000 ldrb r4, [sl]
842c: e2844001 add r4, r4, #1
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
8430: e10f8000 mrs r8, CPSR
8434: e388c080 orr ip, r8, #128 ; 0x80
8438: e129f00c msr CPSR_fc, ip
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
843c: 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 ) ) {
8440: e15c0007 cmp ip, r7
8444: 1a000009 bne 8470 <_Thread_queue_Enqueue_priority+0x100>
8448: ea00000b b 847c <_Thread_queue_Enqueue_priority+0x10c>
static inline void arm_interrupt_flash( uint32_t level )
{
uint32_t arm_switch_reg;
asm volatile (
844c: e10f6000 mrs r6, CPSR
8450: e129f008 msr CPSR_fc, r8
8454: e129f006 msr CPSR_fc, r6
8458: 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) ) {
845c: e1150006 tst r5, r6
8460: 0a000013 beq 84b4 <_Thread_queue_Enqueue_priority+0x144>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
8464: 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 ) ) {
8468: e15c0007 cmp ip, r7
846c: 0a000002 beq 847c <_Thread_queue_Enqueue_priority+0x10c>
search_priority = search_thread->current_priority;
8470: e59c4014 ldr r4, [ip, #20]
if ( priority >= search_priority )
8474: e1530004 cmp r3, r4
8478: 3afffff3 bcc 844c <_Thread_queue_Enqueue_priority+0xdc>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
847c: e5905030 ldr r5, [r0, #48] ; 0x30
8480: e3550001 cmp r5, #1
8484: 1affffe0 bne 840c <_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 )
8488: 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;
848c: e3a03000 mov r3, #0
8490: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
8494: 0a000016 beq 84f4 <_Thread_queue_Enqueue_priority+0x184>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8498: e59c3000 ldr r3, [ip]
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
849c: e8811008 stm r1, {r3, ip}
search_node->next = the_node;
next_node->previous = the_node;
84a0: 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;
84a4: e58c1000 str r1, [ip]
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
84a8: e5810044 str r0, [r1, #68] ; 0x44
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
84ac: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
84b0: eaffffd6 b 8410 <_Thread_queue_Enqueue_priority+0xa0>
84b4: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED
84b8: eaffffda b 8428 <_Thread_queue_Enqueue_priority+0xb8> <== NOT EXECUTED
84bc: e129f008 msr CPSR_fc, r8
84c0: eaffffbb b 83b4 <_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 )
84c4: 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;
84c8: e3a03000 mov r3, #0
84cc: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority )
84d0: 0a000007 beq 84f4 <_Thread_queue_Enqueue_priority+0x184>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
84d4: e59c3004 ldr r3, [ip, #4]
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
84d8: e581c000 str ip, [r1]
the_node->previous = previous_node;
84dc: e5813004 str r3, [r1, #4]
previous_node->next = the_node;
84e0: e5831000 str r1, [r3]
search_node->previous = the_node;
84e4: e58c1004 str r1, [ip, #4]
the_thread->Wait.queue = the_thread_queue;
84e8: e5810044 str r0, [r1, #68] ; 0x44
84ec: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
84f0: eaffffc6 b 8410 <_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;
84f4: 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 );
84f8: e28c203c add r2, ip, #60 ; 0x3c
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
84fc: e881000c stm r1, {r2, r3}
the_node->previous = previous_node;
previous_node->next = the_node;
8500: e5831000 str r1, [r3]
search_node->previous = the_node;
8504: e58c1040 str r1, [ip, #64] ; 0x40
the_thread->Wait.queue = the_thread_queue;
8508: e5810044 str r0, [r1, #68] ; 0x44
850c: e129f008 msr CPSR_fc, r8
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
8510: e3a05001 mov r5, #1
8514: eaffffbd b 8410 <_Thread_queue_Enqueue_priority+0xa0>
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
8518: e3e04000 mvn r4, #0
851c: eaffffb7 b 8400 <_Thread_queue_Enqueue_priority+0x90>
0000a6d4 <_Timespec_Greater_than>:
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
a6d4: e5902000 ldr r2, [r0]
a6d8: e5913000 ldr r3, [r1]
a6dc: e1520003 cmp r2, r3
return true;
a6e0: c3a00001 movgt r0, #1
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
a6e4: c12fff1e bxgt lr
return true;
if ( lhs->tv_sec < rhs->tv_sec )
a6e8: ba000005 blt a704 <_Timespec_Greater_than+0x30>
#include <rtems/system.h>
#include <rtems/score/timespec.h>
#include <rtems/score/tod.h>
bool _Timespec_Greater_than(
a6ec: e5900004 ldr r0, [r0, #4]
a6f0: e5913004 ldr r3, [r1, #4]
a6f4: e1500003 cmp r0, r3
a6f8: d3a00000 movle r0, #0
a6fc: c3a00001 movgt r0, #1
a700: e12fff1e bx lr
{
if ( lhs->tv_sec > rhs->tv_sec )
return true;
if ( lhs->tv_sec < rhs->tv_sec )
return false;
a704: e3a00000 mov r0, #0
/* ASSERT: lhs->tv_sec == rhs->tv_sec */
if ( lhs->tv_nsec > rhs->tv_nsec )
return true;
return false;
}
a708: e12fff1e bx lr
00008b90 <_User_extensions_Thread_create>:
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8b90: e92d40f0 push {r4, r5, r6, r7, lr}
return false;
}
}
return true;
}
8b94: e59f5050 ldr r5, [pc, #80] ; 8bec <_User_extensions_Thread_create+0x5c>
8b98: e4954004 ldr r4, [r5], #4
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8b9c: e1540005 cmp r4, r5
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
8ba0: e1a06000 mov r6, r0
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8ba4: 0a00000e beq 8be4 <_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)(
8ba8: e59f7040 ldr r7, [pc, #64] ; 8bf0 <_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 ) {
8bac: e5943014 ldr r3, [r4, #20]
8bb0: e3530000 cmp r3, #0
status = (*the_extension->Callouts.thread_create)(
8bb4: 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 ) {
8bb8: 0a000004 beq 8bd0 <_User_extensions_Thread_create+0x40>
status = (*the_extension->Callouts.thread_create)(
8bbc: e5970004 ldr r0, [r7, #4]
8bc0: e1a0e00f mov lr, pc
8bc4: e12fff13 bx r3
_Thread_Executing,
the_thread
);
if ( !status )
8bc8: e3500000 cmp r0, #0
8bcc: 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 ) {
8bd0: e5944000 ldr r4, [r4]
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _Chain_First( &_User_extensions_List );
8bd4: e1540005 cmp r4, r5
8bd8: 1afffff3 bne 8bac <_User_extensions_Thread_create+0x1c>
if ( !status )
return false;
}
}
return true;
8bdc: e3a00001 mov r0, #1
8be0: e8bd80f0 pop {r4, r5, r6, r7, pc}
8be4: e3a00001 mov r0, #1 <== NOT EXECUTED
}
8be8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000a9fc <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
a9fc: e92d41f0 push {r4, r5, r6, r7, r8, lr}
aa00: e1a04000 mov r4, r0
aa04: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
aa08: e10f2000 mrs r2, CPSR
aa0c: e3823080 orr r3, r2, #128 ; 0x80
aa10: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
aa14: e1a07000 mov r7, r0
aa18: 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 ) ) {
aa1c: e1530007 cmp r3, r7
aa20: 0a00001a beq aa90 <_Watchdog_Adjust+0x94>
switch ( direction ) {
aa24: e3510000 cmp r1, #0
aa28: 1a00001a bne aa98 <_Watchdog_Adjust+0x9c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
aa2c: e3550000 cmp r5, #0
aa30: 0a000016 beq aa90 <_Watchdog_Adjust+0x94>
if ( units < _Watchdog_First( header )->delta_interval ) {
aa34: e5936010 ldr r6, [r3, #16]
aa38: e1550006 cmp r5, r6
aa3c: 21a01002 movcs r1, r2
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
aa40: 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 ) {
aa44: 2a000005 bcs aa60 <_Watchdog_Adjust+0x64>
aa48: ea00001a b aab8 <_Watchdog_Adjust+0xbc> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
aa4c: e0555006 subs r5, r5, r6
aa50: 0a00000d beq aa8c <_Watchdog_Adjust+0x90>
if ( units < _Watchdog_First( header )->delta_interval ) {
aa54: e5936010 ldr r6, [r3, #16]
aa58: e1560005 cmp r6, r5
aa5c: 8a000014 bhi aab4 <_Watchdog_Adjust+0xb8>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
aa60: e5838010 str r8, [r3, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
aa64: e129f001 msr CPSR_fc, r1
_ISR_Enable( level );
_Watchdog_Tickle( header );
aa68: e1a00004 mov r0, r4
aa6c: eb0000a4 bl ad04 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
aa70: e10f1000 mrs r1, CPSR
aa74: e3813080 orr r3, r1, #128 ; 0x80
aa78: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
aa7c: e5942000 ldr r2, [r4]
_Watchdog_Tickle( header );
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
aa80: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
aa84: e1a03002 mov r3, r2
aa88: 1affffef bne aa4c <_Watchdog_Adjust+0x50>
aa8c: e1a02001 mov r2, r1
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
aa90: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
aa94: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
aa98: e3510001 cmp r1, #1
aa9c: 1afffffb bne aa90 <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
aaa0: e5931010 ldr r1, [r3, #16]
aaa4: e0815005 add r5, r1, r5
aaa8: e5835010 str r5, [r3, #16]
aaac: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
aab0: 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 (
aab4: 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;
aab8: e0655006 rsb r5, r5, r6
aabc: e5835010 str r5, [r3, #16]
break;
aac0: eafffff2 b aa90 <_Watchdog_Adjust+0x94>
00007414 <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() )
7414: e59f3150 ldr r3, [pc, #336] ; 756c <rtems_io_register_driver+0x158>
7418: 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;
741c: e59f314c ldr r3, [pc, #332] ; 7570 <rtems_io_register_driver+0x15c>
if ( rtems_interrupt_is_in_progress() )
7420: 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
)
{
7424: e92d4030 push {r4, r5, lr}
7428: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
742c: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
7430: 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() )
7434: 18bd8030 popne {r4, r5, pc}
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
7438: e3520000 cmp r2, #0
743c: 0a00003f beq 7540 <rtems_io_register_driver+0x12c>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
if ( driver_table == NULL )
7440: e3510000 cmp r1, #0
if ( registered_major == NULL )
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
7444: e5820000 str r0, [r2]
if ( driver_table == NULL )
7448: 0a00003c beq 7540 <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;
744c: e591c000 ldr ip, [r1]
7450: e35c0000 cmp ip, #0
7454: 0a000036 beq 7534 <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 )
7458: e1500004 cmp r0, r4
745c: 9a000027 bls 7500 <rtems_io_register_driver+0xec>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
7460: e59f010c ldr r0, [pc, #268] ; 7574 <rtems_io_register_driver+0x160>
7464: e590c000 ldr ip, [r0]
7468: e28cc001 add ip, ip, #1
746c: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
7470: e3540000 cmp r4, #0
7474: 1a000023 bne 7508 <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;
7478: e593c000 ldr ip, [r3]
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
747c: e35c0000 cmp ip, #0
7480: 0a000030 beq 7548 <rtems_io_register_driver+0x134>
7484: e59fe0ec ldr lr, [pc, #236] ; 7578 <rtems_io_register_driver+0x164>
7488: e59e3000 ldr r3, [lr]
748c: ea000003 b 74a0 <rtems_io_register_driver+0x8c>
7490: e2844001 add r4, r4, #1
7494: e15c0004 cmp ip, r4
7498: e2833018 add r3, r3, #24
749c: 9a000005 bls 74b8 <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;
74a0: e5930000 ldr r0, [r3]
74a4: e3500000 cmp r0, #0
74a8: 1afffff8 bne 7490 <rtems_io_register_driver+0x7c>
74ac: e5930004 ldr r0, [r3, #4]
74b0: e3500000 cmp r0, #0
74b4: 1afffff5 bne 7490 <rtems_io_register_driver+0x7c>
}
/* Assigns invalid value in case of failure */
*major = m;
if ( m != n )
74b8: e15c0004 cmp ip, r4
74bc: 1084c084 addne ip, r4, r4, lsl #1
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
74c0: e5824000 str r4, [r2]
if ( m != n )
74c4: 11a0c18c lslne ip, ip, #3
74c8: 0a00001f beq 754c <rtems_io_register_driver+0x138>
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
74cc: e59e5000 ldr r5, [lr]
74d0: e1a0e001 mov lr, r1
74d4: e8be000f ldm lr!, {r0, r1, r2, r3}
74d8: e085c00c add ip, r5, ip
74dc: e8ac000f stmia ip!, {r0, r1, r2, r3}
74e0: e89e0003 ldm lr, {r0, r1}
74e4: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
74e8: eb000737 bl 91cc <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
74ec: e3a01000 mov r1, #0
74f0: e1a00004 mov r0, r4
74f4: e1a02001 mov r2, r1
}
74f8: e8bd4030 pop {r4, r5, lr}
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
74fc: ea001ebc b eff4 <rtems_io_initialize>
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
7500: e3a0000a mov r0, #10
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
7504: 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;
7508: e59fe068 ldr lr, [pc, #104] ; 7578 <rtems_io_register_driver+0x164>
750c: e084c084 add ip, r4, r4, lsl #1
7510: e59e3000 ldr r3, [lr]
7514: 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;
7518: e793000c ldr r0, [r3, ip]
751c: e3500000 cmp r0, #0
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
7520: 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;
7524: 0a00000b beq 7558 <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();
7528: eb000727 bl 91cc <_Thread_Enable_dispatch>
return RTEMS_RESOURCE_IN_USE;
752c: e3a0000c mov r0, #12
7530: 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;
7534: e591c004 ldr ip, [r1, #4]
7538: e35c0000 cmp ip, #0
753c: 1affffc5 bne 7458 <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;
7540: e3a00009 mov r0, #9
7544: e8bd8030 pop {r4, r5, pc}
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
7548: 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();
754c: eb00071e bl 91cc <_Thread_Enable_dispatch>
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
7550: 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;
7554: 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;
7558: e5933004 ldr r3, [r3, #4]
755c: e3530000 cmp r3, #0
7560: 1afffff0 bne 7528 <rtems_io_register_driver+0x114>
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
7564: e5824000 str r4, [r2]
7568: eaffffd7 b 74cc <rtems_io_register_driver+0xb8>
0000cc40 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
cc40: 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 )
cc44: e2525000 subs r5, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
cc48: e1a04000 mov r4, r0
cc4c: 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;
cc50: 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 )
cc54: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
cc58: e59f9148 ldr r9, [pc, #328] ; cda8 <rtems_task_mode+0x168>
cc5c: 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;
cc60: e5d7a074 ldrb sl, [r7, #116] ; 0x74
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
cc64: 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 )
cc68: 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;
cc6c: 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;
cc70: 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;
cc74: 03a0ac01 moveq sl, #256 ; 0x100
cc78: 13a0a000 movne sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
cc7c: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
cc80: 138aac02 orrne sl, sl, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
cc84: e35b0000 cmp fp, #0
cc88: 03a0bb01 moveq fp, #1024 ; 0x400
cc8c: 13a0b000 movne fp, #0
old_mode |= _ISR_Get_level();
cc90: ebfff1d8 bl 93f8 <_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;
cc94: e18bb000 orr fp, fp, r0
old_mode |= _ISR_Get_level();
cc98: e18ba00a orr sl, fp, sl
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
cc9c: 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;
cca0: e585a000 str sl, [r5]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
cca4: 0a000003 beq ccb8 <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
cca8: e3140c01 tst r4, #256 ; 0x100
ccac: 13a03000 movne r3, #0
ccb0: 03a03001 moveq r3, #1
ccb4: e5c73074 strb r3, [r7, #116] ; 0x74
if ( mask & RTEMS_TIMESLICE_MASK ) {
ccb8: e3160c02 tst r6, #512 ; 0x200
ccbc: 1a000028 bne cd64 <rtems_task_mode+0x124>
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
ccc0: e3160080 tst r6, #128 ; 0x80
ccc4: 1a00002f bne cd88 <rtems_task_mode+0x148>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
ccc8: e2166b01 ands r6, r6, #1024 ; 0x400
cccc: 0a000012 beq cd1c <rtems_task_mode+0xdc>
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
ccd0: 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 ) {
ccd4: e5d82008 ldrb r2, [r8, #8]
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
ccd8: 13a03000 movne r3, #0
ccdc: 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 ) {
cce0: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cce4: 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 ) {
cce8: 0a00000b beq cd1c <rtems_task_mode+0xdc>
asr->is_enabled = is_asr_enabled;
ccec: e5c83008 strb r3, [r8, #8]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
ccf0: e10f3000 mrs r3, CPSR
ccf4: e3832080 orr r2, r3, #128 ; 0x80
ccf8: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
ccfc: e5981018 ldr r1, [r8, #24]
information->signals_pending = information->signals_posted;
cd00: e5982014 ldr r2, [r8, #20]
information->signals_posted = _signals;
cd04: 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;
cd08: e5882018 str r2, [r8, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
cd0c: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
cd10: e5986014 ldr r6, [r8, #20]
cd14: e3560000 cmp r6, #0
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
cd18: 13a06001 movne r6, #1
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cd1c: e59f3088 ldr r3, [pc, #136] ; cdac <rtems_task_mode+0x16c>
cd20: e5933000 ldr r3, [r3]
cd24: e3530003 cmp r3, #3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
cd28: 13a00000 movne r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
cd2c: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
Thread_Control *executing;
executing = _Thread_Executing;
if ( are_signals_pending ||
cd30: e3560000 cmp r6, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
cd34: e5993004 ldr r3, [r9, #4]
if ( are_signals_pending ||
cd38: 1a000015 bne cd94 <rtems_task_mode+0x154>
cd3c: e59f2064 ldr r2, [pc, #100] ; cda8 <rtems_task_mode+0x168>
cd40: e5922008 ldr r2, [r2, #8]
cd44: e1530002 cmp r3, r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
cd48: 01a00006 moveq r0, r6
cd4c: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
cd50: e5d33074 ldrb r3, [r3, #116] ; 0x74
cd54: e3530000 cmp r3, #0
cd58: 1a00000d bne cd94 <rtems_task_mode+0x154>
cd5c: e1a00006 mov r0, r6 <== NOT EXECUTED
}
cd60: 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) ) {
cd64: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
cd68: 159f3040 ldrne r3, [pc, #64] ; cdb0 <rtems_task_mode+0x170>
cd6c: 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;
cd70: 13a02001 movne r2, #1
cd74: 1587207c strne r2, [r7, #124] ; 0x7c
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
cd78: 15873078 strne r3, [r7, #120] ; 0x78
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
cd7c: 0587307c streq r3, [r7, #124] ; 0x7c
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
cd80: e3160080 tst r6, #128 ; 0x80
cd84: 0affffcf beq ccc8 <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 ) );
cd88: e2040080 and r0, r4, #128 ; 0x80
cd8c: ebfff194 bl 93e4 <_CPU_ISR_Set_level>
cd90: eaffffcc b ccc8 <rtems_task_mode+0x88>
_Thread_Dispatch_necessary = true;
cd94: e3a03001 mov r3, #1
cd98: e5c93010 strb r3, [r9, #16]
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
cd9c: ebffebd1 bl 7ce8 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
cda0: e3a00000 mov r0, #0
cda4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}