RTEMS 4.11Annotated Report
Sat Jul 17 03:12:01 2010
a0016a98 <_CORE_message_queue_Broadcast>:
{
Thread_Control *the_thread;
uint32_t number_broadcasted;
Thread_Wait_information *waitp;
if ( size > the_message_queue->maximum_message_size ) {
a0016a98: 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
)
{
a0016a9c: 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 ) {
a0016aa0: 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
)
{
a0016aa4: e1a07000 mov r7, r0
a0016aa8: e1a05002 mov r5, r2
a0016aac: e1a08001 mov r8, r1
a0016ab0: 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 ) {
a0016ab4: 3a000013 bcc a0016b08 <_CORE_message_queue_Broadcast+0x70>
* 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 ) {
a0016ab8: e5906048 ldr r6, [r0, #72] ; 0x48
a0016abc: e3560000 cmp r6, #0
a0016ac0: 0a000009 beq a0016aec <_CORE_message_queue_Broadcast+0x54>
*count = 0;
a0016ac4: e3a00000 mov r0, #0
a0016ac8: e58a0000 str r0, [sl]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
a0016acc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
a0016ad0: e594002c ldr r0, [r4, #44] ; 0x2c
a0016ad4: e1a01008 mov r1, r8
a0016ad8: e1a02005 mov r2, r5
a0016adc: eb0020b1 bl a001eda8 <memcpy>
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
a0016ae0: e5943028 ldr r3, [r4, #40] ; 0x28
*/
number_broadcasted = 0;
while ((the_thread =
_Thread_queue_Dequeue(&the_message_queue->Wait_queue))) {
waitp = &the_thread->Wait;
number_broadcasted += 1;
a0016ae4: e2866001 add r6, r6, #1
buffer,
waitp->return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
a0016ae8: 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 =
a0016aec: e1a00007 mov r0, r7
a0016af0: eb000a19 bl a001935c <_Thread_queue_Dequeue>
a0016af4: e2504000 subs r4, r0, #0
a0016af8: 1afffff4 bne a0016ad0 <_CORE_message_queue_Broadcast+0x38>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
}
*count = number_broadcasted;
a0016afc: e58a6000 str r6, [sl]
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
a0016b00: e1a00004 mov r0, r4
a0016b04: 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;
a0016b08: e3a00001 mov r0, #1 <== NOT EXECUTED
#endif
}
*count = number_broadcasted;
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
}
a0016b0c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
a000aaf4 <_CORE_mutex_Seize_interrupt_trylock>:
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
a000aaf4: e59f2160 ldr r2, [pc, #352] ; a000ac5c <_CORE_mutex_Seize_interrupt_trylock+0x168>
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
a000aaf8: 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
)
{
a000aafc: e1a03000 mov r3, r0
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
a000ab00: e5922004 ldr r2, [r2, #4]
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
a000ab04: e3a00000 mov r0, #0
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
a000ab08: e15c0000 cmp ip, r0
a000ab0c: 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;
a000ab10: e5820034 str r0, [r2, #52] ; 0x34
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
a000ab14: 0a00000e beq a000ab54 <_CORE_mutex_Seize_interrupt_trylock+0x60>
return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p );
}
a000ab18: e593c048 ldr ip, [r3, #72] ; 0x48
the_mutex->lock = CORE_MUTEX_LOCKED;
the_mutex->holder = executing;
the_mutex->holder_id = executing->Object.id;
a000ab1c: e5925008 ldr r5, [r2, #8]
the_mutex->nest_count = 1;
a000ab20: e3a04001 mov r4, #1
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
a000ab24: 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;
a000ab28: e5830050 str r0, [r3, #80] ; 0x50
the_mutex->holder = executing;
a000ab2c: e583205c str r2, [r3, #92] ; 0x5c
the_mutex->holder_id = executing->Object.id;
a000ab30: e5835060 str r5, [r3, #96] ; 0x60
the_mutex->nest_count = 1;
a000ab34: e5834054 str r4, [r3, #84] ; 0x54
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
a000ab38: 0a00000a beq a000ab68 <_CORE_mutex_Seize_interrupt_trylock+0x74>
a000ab3c: e35c0003 cmp ip, #3
a000ab40: 0a000019 beq a000abac <_CORE_mutex_Seize_interrupt_trylock+0xb8>
a000ab44: e5913000 ldr r3, [r1]
a000ab48: e129f003 msr CPSR_fc, r3
executing->resource_count++;
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
_ISR_Enable( *level_p );
return 0;
a000ab4c: e3a00000 mov r0, #0
a000ab50: 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 ) ) {
a000ab54: e593005c ldr r0, [r3, #92] ; 0x5c
a000ab58: e1520000 cmp r2, r0
a000ab5c: 0a000008 beq a000ab84 <_CORE_mutex_Seize_interrupt_trylock+0x90>
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
a000ab60: e3a00001 mov r0, #1
a000ab64: 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++;
a000ab68: e592301c ldr r3, [r2, #28]
a000ab6c: e2833001 add r3, r3, #1
a000ab70: e582301c str r3, [r2, #28]
a000ab74: e5913000 ldr r3, [r1]
a000ab78: e129f003 msr CPSR_fc, r3
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
_ISR_Enable( *level_p );
return 0;
a000ab7c: e3a00000 mov r0, #0
a000ab80: 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 ) {
a000ab84: e5930040 ldr r0, [r3, #64] ; 0x40
a000ab88: e3500000 cmp r0, #0
a000ab8c: 1a000017 bne a000abf0 <_CORE_mutex_Seize_interrupt_trylock+0xfc>
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
a000ab90: e5932054 ldr r2, [r3, #84] ; 0x54
a000ab94: e2822001 add r2, r2, #1
a000ab98: e5832054 str r2, [r3, #84] ; 0x54
a000ab9c: e5913000 ldr r3, [r1]
a000aba0: e129f003 msr CPSR_fc, r3
_ISR_Enable( *level_p );
return 0;
a000aba4: e3a00000 mov r0, #0
a000aba8: 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++;
a000abac: e592c01c ldr ip, [r2, #28]
*/
{
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
a000abb0: e593604c ldr r6, [r3, #76] ; 0x4c
current = executing->current_priority;
a000abb4: e5925014 ldr r5, [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++;
a000abb8: e08c7004 add r7, ip, r4
a000abbc: e582701c str r7, [r2, #28]
Priority_Control ceiling;
Priority_Control current;
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
a000abc0: e1560005 cmp r6, r5
a000abc4: 0a000020 beq a000ac4c <_CORE_mutex_Seize_interrupt_trylock+0x158>
_ISR_Enable( *level_p );
return 0;
}
if ( current > ceiling ) {
a000abc8: 3a000012 bcc a000ac18 <_CORE_mutex_Seize_interrupt_trylock+0x124>
);
_Thread_Enable_dispatch();
return 0;
}
/* if ( current < ceiling ) */ {
executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
a000abcc: e3a05006 mov r5, #6
a000abd0: e5825034 str r5, [r2, #52] ; 0x34
the_mutex->lock = CORE_MUTEX_UNLOCKED;
a000abd4: e5834050 str r4, [r3, #80] ; 0x50
the_mutex->nest_count = 0; /* undo locking above */
a000abd8: e5830054 str r0, [r3, #84] ; 0x54
executing->resource_count--; /* undo locking above */
a000abdc: e582c01c str ip, [r2, #28]
a000abe0: e5913000 ldr r3, [r1]
a000abe4: e129f003 msr CPSR_fc, r3
_ISR_Enable( *level_p );
return 0;
a000abe8: e3a00000 mov r0, #0
a000abec: 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 ) {
a000abf0: e3500001 cmp r0, #1
a000abf4: 0a000001 beq a000ac00 <_CORE_mutex_Seize_interrupt_trylock+0x10c>
/*
* The mutex is not available and the caller must deal with the possibility
* of blocking.
*/
return 1;
a000abf8: e3a00001 mov r0, #1
a000abfc: 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;
a000ac00: e3a03002 mov r3, #2 <== NOT EXECUTED
a000ac04: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED
a000ac08: e5913000 ldr r3, [r1] <== NOT EXECUTED
a000ac0c: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
_ISR_Enable( *level_p );
return 0;
a000ac10: e3a00000 mov r0, #0 <== NOT EXECUTED
a000ac14: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
a000ac18: e59f2040 ldr r2, [pc, #64] ; a000ac60 <_CORE_mutex_Seize_interrupt_trylock+0x16c>
a000ac1c: e5920000 ldr r0, [r2]
a000ac20: e2800001 add r0, r0, #1
a000ac24: e5820000 str r0, [r2]
a000ac28: e5912000 ldr r2, [r1]
a000ac2c: e129f002 msr CPSR_fc, r2
}
if ( current > ceiling ) {
_Thread_Disable_dispatch();
_ISR_Enable( *level_p );
_Thread_Change_priority(
a000ac30: e3a02000 mov r2, #0
a000ac34: e593005c ldr r0, [r3, #92] ; 0x5c
a000ac38: e593104c ldr r1, [r3, #76] ; 0x4c
a000ac3c: ebfff13c bl a0007134 <_Thread_Change_priority>
the_mutex->holder,
the_mutex->Attributes.priority_ceiling,
false
);
_Thread_Enable_dispatch();
a000ac40: ebfff29a bl a00076b0 <_Thread_Enable_dispatch>
return 0;
a000ac44: e3a00000 mov r0, #0
a000ac48: e8bd80f0 pop {r4, r5, r6, r7, pc}
a000ac4c: e5913000 ldr r3, [r1]
a000ac50: e129f003 msr CPSR_fc, r3
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
_ISR_Enable( *level_p );
return 0;
a000ac54: e3a00000 mov r0, #0
a000ac58: e8bd80f0 pop {r4, r5, r6, r7, pc}
a000aa98 <_Chain_Initialize>:
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
a000aa98: e3520000 cmp r2, #0
Chain_Node *current;
Chain_Node *next;
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
a000aa9c: e3a0c000 mov ip, #0
Chain_Control *the_chain,
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
a000aaa0: e92d0070 push {r4, r5, r6}
Chain_Node *current;
Chain_Node *next;
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
a000aaa4: e580c004 str ip, [r0, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head(
Chain_Control *the_chain
)
{
return (Chain_Node *) the_chain;
a000aaa8: e1a04000 mov r4, r0
next = starting_address;
a000aaac: 11a05002 movne r5, r2
a000aab0: 11a0c001 movne ip, r1
while ( count-- ) {
a000aab4: 1a000002 bne a000aac4 <_Chain_Initialize+0x2c>
a000aab8: ea000008 b a000aae0 <_Chain_Initialize+0x48> <== NOT EXECUTED
a000aabc: e1a0400c mov r4, ip
current->next = next;
next->previous = current;
current = next;
next = (Chain_Node *)
a000aac0: e1a0c006 mov ip, r6
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
a000aac4: e2555001 subs r5, r5, #1
current->next = next;
a000aac8: e584c000 str ip, [r4]
next->previous = current;
a000aacc: e58c4004 str r4, [ip, #4]
* node_size - size of node in bytes
*
* Output parameters: NONE
*/
void _Chain_Initialize(
a000aad0: e08c6003 add r6, ip, r3
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
a000aad4: 1afffff8 bne a000aabc <_Chain_Initialize+0x24>
* node_size - size of node in bytes
*
* Output parameters: NONE
*/
void _Chain_Initialize(
a000aad8: e2422001 sub r2, r2, #1
count = number_nodes;
current = _Chain_Head( the_chain );
the_chain->permanent_null = NULL;
next = starting_address;
while ( count-- ) {
a000aadc: e0241293 mla r4, r3, r2, r1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
a000aae0: e2803004 add r3, r0, #4
next->previous = current;
current = next;
next = (Chain_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
current->next = _Chain_Tail( the_chain );
a000aae4: e5843000 str r3, [r4]
the_chain->last = current;
a000aae8: e5804008 str r4, [r0, #8]
}
a000aaec: e8bd0070 pop {r4, r5, r6}
a000aaf0: e12fff1e bx lr
a000acd4 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
a000acd4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
a000acd8: e1a08002 mov r8, r2
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
a000acdc: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
a000ace0: e24dd01c sub sp, sp, #28
a000ace4: e1a05001 mov r5, r1
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
a000ace8: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
a000acec: e1a07000 mov r7, r0
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
a000acf0: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
a000acf4: e1a0b003 mov fp, r3
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
a000acf8: e5909008 ldr r9, [r0, #8]
Heap_Statistics *const stats = &heap->stats;
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *block = _Heap_Free_list_first( heap );
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_BLOCK_SIZE_OFFSET;
uintptr_t const page_size = heap->page_size;
a000acfc: e58d200c str r2, [sp, #12]
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
if ( block_size_floor < alloc_size ) {
a000ad00: 2a000073 bcs a000aed4 <_Heap_Allocate_aligned_with_boundary+0x200>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
a000ad04: e3530000 cmp r3, #0
a000ad08: 1a00006f bne a000aecc <_Heap_Allocate_aligned_with_boundary+0x1f8>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
a000ad0c: e1570009 cmp r7, r9
a000ad10: 0a00006f beq a000aed4 <_Heap_Allocate_aligned_with_boundary+0x200>
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
a000ad14: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
a000ad18: e2651004 rsb r1, r5, #4
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
a000ad1c: e3a06000 mov r6, #0
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
a000ad20: e2833007 add r3, r3, #7
a000ad24: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET;
a000ad28: e58d1014 str r1, [sp, #20]
/*
* 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 ) {
a000ad2c: e599a004 ldr sl, [r9, #4]
a000ad30: e59d2000 ldr r2, [sp]
while ( block != free_list_tail ) {
_HAssert( _Heap_Is_prev_used( block ) );
/* Statistics */
++search_count;
a000ad34: e2866001 add r6, r6, #1
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
a000ad38: e152000a cmp r2, sl
a000ad3c: 2a00004f bcs a000ae80 <_Heap_Allocate_aligned_with_boundary+0x1ac>
if ( alignment == 0 ) {
a000ad40: 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;
a000ad44: 02894008 addeq r4, r9, #8
a000ad48: 0a00004a beq a000ae78 <_Heap_Allocate_aligned_with_boundary+0x1a4>
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
a000ad4c: 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_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
a000ad50: 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;
a000ad54: 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;
a000ad58: 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;
a000ad5c: 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_BLOCK_SIZE_OFFSET;
uintptr_t alloc_begin = alloc_end - alloc_size;
a000ad60: e081400a add r4, r1, sl
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
a000ad64: 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;
a000ad68: e0633002 rsb r3, r3, r2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
a000ad6c: 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
a000ad70: e083a00a add sl, r3, sl
a000ad74: 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;
a000ad78: e2893008 add r3, r9, #8
a000ad7c: e58d3008 str r3, [sp, #8]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
a000ad80: eb001590 bl a00103c8 <__umodsi3>
a000ad84: 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 ) {
a000ad88: e15a0004 cmp sl, r4
a000ad8c: 2a000003 bcs a000ada0 <_Heap_Allocate_aligned_with_boundary+0xcc>
a000ad90: e1a0000a mov r0, sl
a000ad94: e1a01008 mov r1, r8
a000ad98: eb00158a bl a00103c8 <__umodsi3>
a000ad9c: e060400a rsb r4, r0, sl
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
a000ada0: e35b0000 cmp fp, #0
a000ada4: 0a000025 beq a000ae40 <_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;
a000ada8: e084a005 add sl, r4, r5
a000adac: e1a0000a mov r0, sl
a000adb0: e1a0100b mov r1, fp
a000adb4: eb001583 bl a00103c8 <__umodsi3>
a000adb8: 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 ) {
a000adbc: e1540000 cmp r4, r0
a000adc0: 23a03000 movcs r3, #0
a000adc4: 33a03001 movcc r3, #1
a000adc8: e15a0000 cmp sl, r0
a000adcc: 93a03000 movls r3, #0
a000add0: e3530000 cmp r3, #0
a000add4: 0a000019 beq a000ae40 <_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;
a000add8: e59d1008 ldr r1, [sp, #8]
a000addc: e081a005 add sl, 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 ) {
a000ade0: e15a0000 cmp sl, r0
a000ade4: 958d6018 strls r6, [sp, #24]
a000ade8: 9a000002 bls a000adf8 <_Heap_Allocate_aligned_with_boundary+0x124>
a000adec: ea000023 b a000ae80 <_Heap_Allocate_aligned_with_boundary+0x1ac>
a000adf0: e15a0000 cmp sl, r0
a000adf4: 8a000038 bhi a000aedc <_Heap_Allocate_aligned_with_boundary+0x208>
return 0;
}
alloc_begin = boundary_line - alloc_size;
a000adf8: e0654000 rsb r4, r5, r0
a000adfc: e1a01008 mov r1, r8
a000ae00: e1a00004 mov r0, r4
a000ae04: eb00156f bl a00103c8 <__umodsi3>
a000ae08: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
a000ae0c: e0846005 add r6, r4, r5
a000ae10: e1a00006 mov r0, r6
a000ae14: e1a0100b mov r1, fp
a000ae18: eb00156a bl a00103c8 <__umodsi3>
a000ae1c: e0600006 rsb r0, r0, r6
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
a000ae20: e1560000 cmp r6, r0
a000ae24: 93a06000 movls r6, #0
a000ae28: 83a06001 movhi r6, #1
a000ae2c: e1540000 cmp r4, r0
a000ae30: 23a06000 movcs r6, #0
a000ae34: e3560000 cmp r6, #0
a000ae38: 1affffec bne a000adf0 <_Heap_Allocate_aligned_with_boundary+0x11c>
a000ae3c: e59d6018 ldr r6, [sp, #24]
boundary_line = _Heap_Align_down( alloc_end, boundary );
}
}
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
a000ae40: e59d2008 ldr r2, [sp, #8]
a000ae44: e1520004 cmp r2, r4
a000ae48: 8a00000c bhi a000ae80 <_Heap_Allocate_aligned_with_boundary+0x1ac>
a000ae4c: e59d100c ldr r1, [sp, #12]
a000ae50: e1a00004 mov r0, r4
a000ae54: eb00155b bl a00103c8 <__umodsi3>
a000ae58: e3e0a007 mvn sl, #7
a000ae5c: e069a00a rsb sl, r9, sl
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 ) {
a000ae60: e59d1004 ldr r1, [sp, #4]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
a000ae64: e08aa004 add sl, sl, r4
a000ae68: e060300a rsb r3, r0, sl
a000ae6c: e15a0000 cmp sl, r0
a000ae70: 11510003 cmpne r1, r3
a000ae74: 8a000001 bhi a000ae80 <_Heap_Allocate_aligned_with_boundary+0x1ac>
boundary
);
}
}
if ( alloc_begin != 0 ) {
a000ae78: e3540000 cmp r4, #0
a000ae7c: 1a000004 bne a000ae94 <_Heap_Allocate_aligned_with_boundary+0x1c0>
break;
}
block = block->next;
a000ae80: e5999008 ldr r9, [r9, #8]
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
a000ae84: e1570009 cmp r7, r9
a000ae88: 1affffa7 bne a000ad2c <_Heap_Allocate_aligned_with_boundary+0x58>
a000ae8c: e3a00000 mov r0, #0
a000ae90: ea000008 b a000aeb8 <_Heap_Allocate_aligned_with_boundary+0x1e4>
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
a000ae94: e597304c ldr r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
a000ae98: e1a00007 mov r0, r7
a000ae9c: e1a01009 mov r1, r9
block = block->next;
}
if ( alloc_begin != 0 ) {
/* Statistics */
stats->searches += search_count;
a000aea0: e0833006 add r3, r3, r6
a000aea4: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
a000aea8: e1a02004 mov r2, r4
a000aeac: e1a03005 mov r3, r5
a000aeb0: ebffee19 bl a000671c <_Heap_Block_allocate>
a000aeb4: e1a00004 mov r0, r4
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
a000aeb8: e5973044 ldr r3, [r7, #68] ; 0x44
a000aebc: e1530006 cmp r3, r6
stats->max_search = search_count;
a000aec0: 35876044 strcc r6, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
}
a000aec4: e28dd01c add sp, sp, #28
a000aec8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
a000aecc: e1550003 cmp r5, r3
a000aed0: 9a000006 bls a000aef0 <_Heap_Allocate_aligned_with_boundary+0x21c>
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
a000aed4: e3a00000 mov r0, #0
a000aed8: eafffff9 b a000aec4 <_Heap_Allocate_aligned_with_boundary+0x1f0>
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
a000aedc: e5999008 ldr r9, [r9, #8] <== NOT EXECUTED
a000aee0: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED
if ( alignment == 0 ) {
alignment = page_size;
}
}
while ( block != free_list_tail ) {
a000aee4: e1570009 cmp r7, r9 <== NOT EXECUTED
a000aee8: 1affff8f bne a000ad2c <_Heap_Allocate_aligned_with_boundary+0x58><== NOT EXECUTED
a000aeec: eaffffe6 b a000ae8c <_Heap_Allocate_aligned_with_boundary+0x1b8><== NOT EXECUTED
if ( boundary < alloc_size ) {
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
a000aef0: e3580000 cmp r8, #0
a000aef4: 01a08002 moveq r8, r2
a000aef8: eaffff83 b a000ad0c <_Heap_Allocate_aligned_with_boundary+0x38>
a000aefc <_Heap_Free>:
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
a000aefc: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
a000af00: e1a04000 mov r4, r0
a000af04: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
a000af08: e1a00001 mov r0, r1
a000af0c: e5941010 ldr r1, [r4, #16]
a000af10: eb00152c bl a00103c8 <__umodsi3>
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
a000af14: e5943020 ldr r3, [r4, #32]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
a000af18: e2455008 sub r5, r5, #8
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
a000af1c: 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;
a000af20: e1550003 cmp r5, r3
a000af24: 3a000030 bcc a000afec <_Heap_Free+0xf0>
a000af28: e5941024 ldr r1, [r4, #36] ; 0x24
a000af2c: e1550001 cmp r5, r1
a000af30: 8a00002d bhi a000afec <_Heap_Free+0xf0>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000af34: 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;
a000af38: 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);
a000af3c: 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;
a000af40: e1530002 cmp r3, r2
a000af44: 8a000028 bhi a000afec <_Heap_Free+0xf0>
a000af48: e1510002 cmp r1, r2
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
a000af4c: 33a00000 movcc r0, #0
a000af50: 3a000027 bcc a000aff4 <_Heap_Free+0xf8>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000af54: 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 ) ) {
a000af58: e2170001 ands r0, r7, #1
a000af5c: 0a000024 beq a000aff4 <_Heap_Free+0xf8>
return false;
}
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 ));
a000af60: 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;
a000af64: e3c77001 bic r7, r7, #1
a000af68: 03a08000 moveq r8, #0
a000af6c: 0a000004 beq a000af84 <_Heap_Free+0x88>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000af70: 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;
a000af74: e5900004 ldr r0, [r0, #4]
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
a000af78: e3100001 tst r0, #1
a000af7c: 13a08000 movne r8, #0
a000af80: 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 ) ) {
a000af84: e21c0001 ands r0, ip, #1
a000af88: 1a00001a bne a000aff8 <_Heap_Free+0xfc>
uintptr_t const prev_size = block->prev_size;
a000af8c: 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);
a000af90: 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;
a000af94: e153000a cmp r3, sl
a000af98: 8a000015 bhi a000aff4 <_Heap_Free+0xf8>
a000af9c: e151000a cmp r1, sl
a000afa0: 3a000013 bcc a000aff4 <_Heap_Free+0xf8>
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;
a000afa4: 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) ) {
a000afa8: e2100001 ands r0, r0, #1
a000afac: 0a000010 beq a000aff4 <_Heap_Free+0xf8>
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
a000afb0: e3580000 cmp r8, #0
a000afb4: 0a000038 beq a000b09c <_Heap_Free+0x1a0>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
a000afb8: e5940038 ldr r0, [r4, #56] ; 0x38
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000afbc: 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;
a000afc0: e0867007 add r7, r6, r7
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000afc4: e592200c ldr r2, [r2, #12]
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
a000afc8: e087c00c add ip, r7, ip
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
a000afcc: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
a000afd0: 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;
a000afd4: e5823008 str r3, [r2, #8]
next->prev = prev;
a000afd8: 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;
a000afdc: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
a000afe0: 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;
a000afe4: e78ac00c str ip, [sl, ip]
a000afe8: ea00000e b a000b028 <_Heap_Free+0x12c>
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
_HAssert( false );
return false;
a000afec: e3a00000 mov r0, #0
a000aff0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000aff4: 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 */
a000aff8: e3580000 cmp r8, #0
a000affc: 0a000014 beq a000b054 <_Heap_Free+0x158>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
a000b000: e5923008 ldr r3, [r2, #8]
a000b004: e592200c ldr r2, [r2, #12]
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;
a000b008: e0877006 add r7, r7, r6
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
a000b00c: e3871001 orr r1, r7, #1
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
a000b010: e5853008 str r3, [r5, #8]
new_block->prev = prev;
a000b014: e585200c str r2, [r5, #12]
next->prev = new_block;
prev->next = new_block;
a000b018: e5825008 str r5, [r2, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
a000b01c: e583500c str r5, [r3, #12]
a000b020: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
a000b024: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
a000b028: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
a000b02c: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
a000b030: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
a000b034: e2422001 sub r2, r2, #1
++stats->frees;
a000b038: e2833001 add r3, r3, #1
stats->free_size += block_size;
a000b03c: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
a000b040: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
a000b044: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
a000b048: e5846030 str r6, [r4, #48] ; 0x30
return( true );
a000b04c: e3a00001 mov r0, #1
a000b050: 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;
a000b054: e3863001 orr r3, r6, #1
a000b058: e5853004 str r3, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
a000b05c: e5943038 ldr r3, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
a000b060: e594c03c ldr ip, [r4, #60] ; 0x3c
} 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;
a000b064: 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;
a000b068: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
a000b06c: 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;
a000b070: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
a000b074: e153000c cmp r3, ip
new_block->next = next;
a000b078: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
a000b07c: 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;
a000b080: e5820004 str r0, [r2, #4]
block_before->next = new_block;
next->prev = new_block;
a000b084: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
a000b088: 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;
a000b08c: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
a000b090: e5843038 str r3, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
a000b094: 8584303c strhi r3, [r4, #60] ; 0x3c
a000b098: eaffffe2 b a000b028 <_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;
a000b09c: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
a000b0a0: e38c3001 orr r3, ip, #1
a000b0a4: e58a3004 str r3, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
a000b0a8: e5923004 ldr r3, [r2, #4]
next_block->prev_size = size;
a000b0ac: e785c006 str ip, [r5, r6]
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
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;
a000b0b0: e3c33001 bic r3, r3, #1
a000b0b4: e5823004 str r3, [r2, #4]
a000b0b8: eaffffda b a000b028 <_Heap_Free+0x12c>
a00120d8 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
a00120d8: e92d40f0 push {r4, r5, r6, r7, lr}
a00120dc: e1a04000 mov r4, r0
a00120e0: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
a00120e4: e1a00001 mov r0, r1
a00120e8: e5941010 ldr r1, [r4, #16]
a00120ec: e1a07002 mov r7, r2
a00120f0: ebfff8b4 bl a00103c8 <__umodsi3>
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
a00120f4: e5943020 ldr r3, [r4, #32]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
a00120f8: e2456008 sub r6, r5, #8
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
a00120fc: 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;
a0012100: e1500003 cmp r0, r3
a0012104: 3a000012 bcc a0012154 <_Heap_Size_of_alloc_area+0x7c>
a0012108: e5942024 ldr r2, [r4, #36] ; 0x24
a001210c: e1500002 cmp r0, r2
a0012110: 8a00000f bhi a0012154 <_Heap_Size_of_alloc_area+0x7c>
- 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;
a0012114: e5906004 ldr r6, [r0, #4]
a0012118: 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);
a001211c: 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;
a0012120: e1530006 cmp r3, r6
a0012124: 8a00000a bhi a0012154 <_Heap_Size_of_alloc_area+0x7c>
a0012128: e1520006 cmp r2, r6
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
a001212c: 33a00000 movcc r0, #0
a0012130: 3a000009 bcc a001215c <_Heap_Size_of_alloc_area+0x84>
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;
a0012134: 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 )
a0012138: e2100001 ands r0, r0, #1
a001213c: 0a000006 beq a001215c <_Heap_Size_of_alloc_area+0x84>
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
a0012140: e2655004 rsb r5, r5, #4
a0012144: e0856006 add r6, r5, r6
a0012148: e5876000 str r6, [r7]
return true;
a001214c: e3a00001 mov r0, #1
a0012150: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
a0012154: e3a00000 mov r0, #0
a0012158: e8bd80f0 pop {r4, r5, r6, r7, pc}
}
*alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin;
return true;
}
a001215c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
a0007468 <_Heap_Walk>:
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() ) ) {
a0007468: e59f3578 ldr r3, [pc, #1400] ; a00079e8 <_Heap_Walk+0x580>
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
a000746c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
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;
a0007470: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
a0007474: 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;
a0007478: e59f256c ldr r2, [pc, #1388] ; a00079ec <_Heap_Walk+0x584>
a000747c: e59f956c ldr r9, [pc, #1388] ; a00079f0 <_Heap_Walk+0x588>
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
a0007480: e1a0a001 mov sl, r1
uintptr_t const page_size = heap->page_size;
a0007484: e5901010 ldr r1, [r0, #16]
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;
a0007488: 11a09002 movne r9, r2
if ( !_System_state_Is_up( _System_state_Get() ) ) {
a000748c: 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;
a0007490: e5902014 ldr r2, [r0, #20]
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
a0007494: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
a0007498: e24dd038 sub sp, sp, #56 ; 0x38
a000749c: e1a04000 mov r4, r0
uintptr_t const page_size = heap->page_size;
a00074a0: e58d1024 str r1, [sp, #36] ; 0x24
uintptr_t const min_block_size = heap->min_block_size;
a00074a4: e58d2028 str r2, [sp, #40] ; 0x28
Heap_Block *const first_block = heap->first_block;
a00074a8: e5908020 ldr r8, [r0, #32]
Heap_Block *const last_block = heap->last_block;
a00074ac: 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() ) ) {
a00074b0: 0a000002 beq a00074c0 <_Heap_Walk+0x58>
}
block = next_block;
} while ( block != first_block );
return true;
a00074b4: e3a00001 mov r0, #1
}
a00074b8: e28dd038 add sp, sp, #56 ; 0x38
a00074bc: 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)(
a00074c0: e594101c ldr r1, [r4, #28]
a00074c4: e5900018 ldr r0, [r0, #24]
a00074c8: e5942008 ldr r2, [r4, #8]
a00074cc: e594300c ldr r3, [r4, #12]
a00074d0: e59dc028 ldr ip, [sp, #40] ; 0x28
a00074d4: e58d1008 str r1, [sp, #8]
a00074d8: e59d102c ldr r1, [sp, #44] ; 0x2c
a00074dc: e58d0004 str r0, [sp, #4]
a00074e0: e58d2014 str r2, [sp, #20]
a00074e4: e58d1010 str r1, [sp, #16]
a00074e8: e58d3018 str r3, [sp, #24]
a00074ec: e59f2500 ldr r2, [pc, #1280] ; a00079f4 <_Heap_Walk+0x58c>
a00074f0: e58dc000 str ip, [sp]
a00074f4: e58d800c str r8, [sp, #12]
a00074f8: e1a0000a mov r0, sl
a00074fc: e3a01000 mov r1, #0
a0007500: e59d3024 ldr r3, [sp, #36] ; 0x24
a0007504: e12fff39 blx r9
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
a0007508: e59d2024 ldr r2, [sp, #36] ; 0x24
a000750c: e3520000 cmp r2, #0
a0007510: 0a000024 beq a00075a8 <_Heap_Walk+0x140>
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
a0007514: e59d3024 ldr r3, [sp, #36] ; 0x24
a0007518: e2135003 ands r5, r3, #3
a000751c: 1a000027 bne a00075c0 <_Heap_Walk+0x158>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
a0007520: e59d0028 ldr r0, [sp, #40] ; 0x28
a0007524: e59d1024 ldr r1, [sp, #36] ; 0x24
a0007528: ebffe54f bl a0000a6c <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
a000752c: e250b000 subs fp, r0, #0
a0007530: 1a000028 bne a00075d8 <_Heap_Walk+0x170>
a0007534: e2880008 add r0, r8, #8
a0007538: e59d1024 ldr r1, [sp, #36] ; 0x24
a000753c: ebffe54a bl a0000a6c <__umodsi3>
);
return false;
}
if (
a0007540: e2506000 subs r6, r0, #0
a0007544: 1a00002a bne a00075f4 <_Heap_Walk+0x18c>
block = next_block;
} while ( block != first_block );
return true;
}
a0007548: e598b004 ldr fp, [r8, #4]
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
a000754c: e21b5001 ands r5, fp, #1
a0007550: 0a0000bf beq a0007854 <_Heap_Walk+0x3ec>
- 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;
a0007554: e59dc02c ldr ip, [sp, #44] ; 0x2c
a0007558: e59c3004 ldr r3, [ip, #4]
a000755c: 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);
a0007560: 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;
a0007564: e5935004 ldr r5, [r3, #4]
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
a0007568: e2155001 ands r5, r5, #1
a000756c: 0a000007 beq a0007590 <_Heap_Walk+0x128>
);
return false;
}
if (
a0007570: e1580003 cmp r8, r3
a0007574: 0a000025 beq a0007610 <_Heap_Walk+0x1a8>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
a0007578: e1a0000a mov r0, sl <== NOT EXECUTED
a000757c: e3a01001 mov r1, #1 <== NOT EXECUTED
a0007580: e59f2470 ldr r2, [pc, #1136] ; a00079f8 <_Heap_Walk+0x590> <== NOT EXECUTED
a0007584: e12fff39 blx r9 <== NOT EXECUTED
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a0007588: e1a00006 mov r0, r6 <== NOT EXECUTED
a000758c: eaffffc9 b a00074b8 <_Heap_Walk+0x50> <== NOT EXECUTED
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
a0007590: e1a0000a mov r0, sl
a0007594: e3a01001 mov r1, #1
a0007598: e59f245c ldr r2, [pc, #1116] ; a00079fc <_Heap_Walk+0x594>
a000759c: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a00075a0: e1a00005 mov r0, r5
a00075a4: eaffffc3 b a00074b8 <_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" );
a00075a8: e1a0000a mov r0, sl
a00075ac: e3a01001 mov r1, #1
a00075b0: e59f2448 ldr r2, [pc, #1096] ; a0007a00 <_Heap_Walk+0x598>
a00075b4: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a00075b8: e59d0024 ldr r0, [sp, #36] ; 0x24
a00075bc: eaffffbd b a00074b8 <_Heap_Walk+0x50>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
a00075c0: e1a0000a mov r0, sl
a00075c4: e3a01001 mov r1, #1
a00075c8: e59f2434 ldr r2, [pc, #1076] ; a0007a04 <_Heap_Walk+0x59c>
a00075cc: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a00075d0: e3a00000 mov r0, #0
a00075d4: eaffffb7 b a00074b8 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
a00075d8: e1a0000a mov r0, sl
a00075dc: e3a01001 mov r1, #1
a00075e0: e59f2420 ldr r2, [pc, #1056] ; a0007a08 <_Heap_Walk+0x5a0>
a00075e4: e59d3028 ldr r3, [sp, #40] ; 0x28
a00075e8: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a00075ec: e1a00005 mov r0, r5
a00075f0: eaffffb0 b a00074b8 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
a00075f4: e1a0000a mov r0, sl
a00075f8: e3a01001 mov r1, #1
a00075fc: e59f2408 ldr r2, [pc, #1032] ; a0007a0c <_Heap_Walk+0x5a4>
a0007600: e1a03008 mov r3, r8
a0007604: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a0007608: e1a0000b mov r0, fp
a000760c: eaffffa9 b a00074b8 <_Heap_Walk+0x50>
block = next_block;
} while ( block != first_block );
return true;
}
a0007610: e5945008 ldr r5, [r4, #8]
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
a0007614: 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 ) {
a0007618: e1540005 cmp r4, r5
a000761c: 05943020 ldreq r3, [r4, #32]
a0007620: 0a00000c beq a0007658 <_Heap_Walk+0x1f0>
block = next_block;
} while ( block != first_block );
return true;
}
a0007624: 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;
a0007628: e1530005 cmp r3, r5
a000762c: 9a00008e bls a000786c <_Heap_Walk+0x404>
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
(*printer)(
a0007630: e1a0000a mov r0, sl
a0007634: e3a01001 mov r1, #1
a0007638: e59f23d0 ldr r2, [pc, #976] ; a0007a10 <_Heap_Walk+0x5a8>
a000763c: e1a03005 mov r3, r5
a0007640: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a0007644: e3a00000 mov r0, #0
a0007648: eaffff9a b a00074b8 <_Heap_Walk+0x50>
a000764c: e1a03008 mov r3, r8
a0007650: e59db034 ldr fp, [sp, #52] ; 0x34
a0007654: e59d8030 ldr r8, [sp, #48] ; 0x30
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
a0007658: 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;
a000765c: 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);
a0007660: 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;
a0007664: e1530005 cmp r3, r5
a0007668: 9a000007 bls a000768c <_Heap_Walk+0x224>
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)(
a000766c: e1a0000a mov r0, sl
a0007670: e58d5000 str r5, [sp]
a0007674: e3a01001 mov r1, #1
a0007678: e59f2394 ldr r2, [pc, #916] ; a0007a14 <_Heap_Walk+0x5ac>
a000767c: e1a03006 mov r3, r6
a0007680: e12fff39 blx r9
"block 0x%08x: next block 0x%08x not in heap\n",
block,
next_block
);
return false;
a0007684: e3a00000 mov r0, #0
a0007688: eaffff8a b a00074b8 <_Heap_Walk+0x50>
a000768c: e5943024 ldr r3, [r4, #36] ; 0x24
a0007690: e1530005 cmp r3, r5
a0007694: 3afffff4 bcc a000766c <_Heap_Walk+0x204>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
a0007698: e59d1024 ldr r1, [sp, #36] ; 0x24
a000769c: e1a00007 mov r0, r7
a00076a0: ebffe4f1 bl a0000a6c <__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;
a00076a4: e59d102c ldr r1, [sp, #44] ; 0x2c
a00076a8: e0563001 subs r3, r6, r1
a00076ac: 13a03001 movne r3, #1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
a00076b0: e3500000 cmp r0, #0
a00076b4: 0a000001 beq a00076c0 <_Heap_Walk+0x258>
a00076b8: e3530000 cmp r3, #0
a00076bc: 1a0000a2 bne a000794c <_Heap_Walk+0x4e4>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
a00076c0: e59d2028 ldr r2, [sp, #40] ; 0x28
a00076c4: e1520007 cmp r2, r7
a00076c8: 9a000001 bls a00076d4 <_Heap_Walk+0x26c>
a00076cc: e3530000 cmp r3, #0
a00076d0: 1a0000a5 bne a000796c <_Heap_Walk+0x504>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
a00076d4: e1560005 cmp r6, r5
a00076d8: 3a000001 bcc a00076e4 <_Heap_Walk+0x27c>
a00076dc: e3530000 cmp r3, #0
a00076e0: 1a0000aa bne a0007990 <_Heap_Walk+0x528>
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;
a00076e4: e5953004 ldr r3, [r5, #4]
a00076e8: e20bb001 and fp, fp, #1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
a00076ec: e3130001 tst r3, #1
a00076f0: 0a000016 beq a0007750 <_Heap_Walk+0x2e8>
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
a00076f4: e35b0000 cmp fp, #0
a00076f8: 0a00000b beq a000772c <_Heap_Walk+0x2c4>
(*printer)(
a00076fc: e58d7000 str r7, [sp]
a0007700: e1a0000a mov r0, sl
a0007704: e3a01000 mov r1, #0
a0007708: e59f2308 ldr r2, [pc, #776] ; a0007a18 <_Heap_Walk+0x5b0>
a000770c: e1a03006 mov r3, r6
a0007710: e12fff39 blx r9
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
a0007714: e1580005 cmp r8, r5
a0007718: 0affff65 beq a00074b4 <_Heap_Walk+0x4c>
a000771c: e595b004 ldr fp, [r5, #4]
a0007720: e5943020 ldr r3, [r4, #32]
a0007724: e1a06005 mov r6, r5
a0007728: eaffffcb b a000765c <_Heap_Walk+0x1f4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
a000772c: e58d7000 str r7, [sp]
a0007730: e5963000 ldr r3, [r6]
a0007734: e1a0000a mov r0, sl
a0007738: e1a0100b mov r1, fp
a000773c: e58d3004 str r3, [sp, #4]
a0007740: e59f22d4 ldr r2, [pc, #724] ; a0007a1c <_Heap_Walk+0x5b4>
a0007744: e1a03006 mov r3, r6
a0007748: e12fff39 blx r9
a000774c: eafffff0 b a0007714 <_Heap_Walk+0x2ac>
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 ?
a0007750: 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)(
a0007754: e5943008 ldr r3, [r4, #8]
block = next_block;
} while ( block != first_block );
return true;
}
a0007758: 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)(
a000775c: e1530002 cmp r3, r2
a0007760: 059f02b8 ldreq r0, [pc, #696] ; a0007a20 <_Heap_Walk+0x5b8>
a0007764: 0a000003 beq a0007778 <_Heap_Walk+0x310>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
a0007768: e59f32b4 ldr r3, [pc, #692] ; a0007a24 <_Heap_Walk+0x5bc>
a000776c: e1540002 cmp r4, r2
a0007770: e59f02b0 ldr r0, [pc, #688] ; a0007a28 <_Heap_Walk+0x5c0>
a0007774: 01a00003 moveq r0, r3
block->next,
block->next == last_free_block ?
a0007778: 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)(
a000777c: e1510003 cmp r1, r3
a0007780: 059f12a4 ldreq r1, [pc, #676] ; a0007a2c <_Heap_Walk+0x5c4>
a0007784: 0a000003 beq a0007798 <_Heap_Walk+0x330>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
a0007788: e59fc2a0 ldr ip, [pc, #672] ; a0007a30 <_Heap_Walk+0x5c8>
a000778c: e1540003 cmp r4, r3
a0007790: e59f1290 ldr r1, [pc, #656] ; a0007a28 <_Heap_Walk+0x5c0>
a0007794: 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)(
a0007798: e58d2004 str r2, [sp, #4]
a000779c: e58d0008 str r0, [sp, #8]
a00077a0: e58d300c str r3, [sp, #12]
a00077a4: e58d1010 str r1, [sp, #16]
a00077a8: e1a03006 mov r3, r6
a00077ac: e58d7000 str r7, [sp]
a00077b0: e1a0000a mov r0, sl
a00077b4: e3a01000 mov r1, #0
a00077b8: e59f2274 ldr r2, [pc, #628] ; a0007a34 <_Heap_Walk+0x5cc>
a00077bc: e12fff39 blx r9
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
a00077c0: e5953000 ldr r3, [r5]
a00077c4: e1570003 cmp r7, r3
a00077c8: 1a000010 bne a0007810 <_Heap_Walk+0x3a8>
);
return false;
}
if ( !prev_used ) {
a00077cc: e35b0000 cmp fp, #0
a00077d0: 0a000018 beq a0007838 <_Heap_Walk+0x3d0>
block = next_block;
} while ( block != first_block );
return true;
}
a00077d4: 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 ) {
a00077d8: e1540003 cmp r4, r3
a00077dc: 0a000004 beq a00077f4 <_Heap_Walk+0x38c>
if ( free_block == block ) {
a00077e0: e1560003 cmp r6, r3
a00077e4: 0affffca beq a0007714 <_Heap_Walk+0x2ac>
return true;
}
free_block = free_block->next;
a00077e8: 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 ) {
a00077ec: e1540003 cmp r4, r3
a00077f0: 1afffffa bne a00077e0 <_Heap_Walk+0x378>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
a00077f4: e1a0000a mov r0, sl
a00077f8: e3a01001 mov r1, #1
a00077fc: e59f2234 ldr r2, [pc, #564] ; a0007a38 <_Heap_Walk+0x5d0>
a0007800: e1a03006 mov r3, r6
a0007804: e12fff39 blx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
a0007808: e3a00000 mov r0, #0
a000780c: eaffff29 b a00074b8 <_Heap_Walk+0x50>
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
(*printer)(
a0007810: e58d3004 str r3, [sp, #4]
a0007814: e1a0000a mov r0, sl
a0007818: e58d7000 str r7, [sp]
a000781c: e58d5008 str r5, [sp, #8]
a0007820: e3a01001 mov r1, #1
a0007824: e59f2210 ldr r2, [pc, #528] ; a0007a3c <_Heap_Walk+0x5d4>
a0007828: e1a03006 mov r3, r6
a000782c: e12fff39 blx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
a0007830: e3a00000 mov r0, #0
a0007834: eaffff1f b a00074b8 <_Heap_Walk+0x50>
return false;
}
if ( !prev_used ) {
(*printer)(
a0007838: e1a0000a mov r0, sl
a000783c: e3a01001 mov r1, #1
a0007840: e59f21f8 ldr r2, [pc, #504] ; a0007a40 <_Heap_Walk+0x5d8>
a0007844: e1a03006 mov r3, r6
a0007848: e12fff39 blx r9
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
a000784c: e1a0000b mov r0, fp
a0007850: eaffff18 b a00074b8 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
a0007854: e1a0000a mov r0, sl
a0007858: e3a01001 mov r1, #1
a000785c: e59f21e0 ldr r2, [pc, #480] ; a0007a44 <_Heap_Walk+0x5dc>
a0007860: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a0007864: e1a00005 mov r0, r5
a0007868: eaffff12 b a00074b8 <_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;
a000786c: e594c024 ldr ip, [r4, #36] ; 0x24
a0007870: e15c0005 cmp ip, r5
a0007874: 3affff6d bcc a0007630 <_Heap_Walk+0x1c8>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
a0007878: e2850008 add r0, r5, #8
a000787c: e1a01007 mov r1, r7
a0007880: e58d301c str r3, [sp, #28]
a0007884: e58dc020 str ip, [sp, #32]
a0007888: ebffe477 bl a0000a6c <__umodsi3>
);
return false;
}
if (
a000788c: e3500000 cmp r0, #0
a0007890: e59d301c ldr r3, [sp, #28]
a0007894: e59dc020 ldr ip, [sp, #32]
a0007898: 1a000044 bne a00079b0 <_Heap_Walk+0x548>
- 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;
a000789c: e5952004 ldr r2, [r5, #4]
a00078a0: e3c22001 bic r2, r2, #1
block = next_block;
} while ( block != first_block );
return true;
}
a00078a4: e0852002 add r2, r5, 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;
a00078a8: e5922004 ldr r2, [r2, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
a00078ac: e3120001 tst r2, #1
a00078b0: 1a000045 bne a00079cc <_Heap_Walk+0x564>
a00078b4: e58d8030 str r8, [sp, #48] ; 0x30
a00078b8: e58db034 str fp, [sp, #52] ; 0x34
a00078bc: e1a01004 mov r1, r4
a00078c0: e1a06005 mov r6, r5
a00078c4: e1a0b00c mov fp, ip
a00078c8: e1a08003 mov r8, r3
a00078cc: ea000013 b a0007920 <_Heap_Walk+0x4b8>
return false;
}
prev_block = free_block;
free_block = free_block->next;
a00078d0: e5955008 ldr r5, [r5, #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 ) {
a00078d4: e1540005 cmp r4, r5
a00078d8: 0affff5b beq a000764c <_Heap_Walk+0x1e4>
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;
a00078dc: e1580005 cmp r8, r5
a00078e0: 8affff52 bhi a0007630 <_Heap_Walk+0x1c8>
a00078e4: e155000b cmp r5, fp
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
a00078e8: e2850008 add r0, r5, #8
a00078ec: 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;
a00078f0: 8affff4e bhi a0007630 <_Heap_Walk+0x1c8>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
a00078f4: ebffe45c bl a0000a6c <__umodsi3>
);
return false;
}
if (
a00078f8: e3500000 cmp r0, #0
a00078fc: 1a00002b bne a00079b0 <_Heap_Walk+0x548>
- 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;
a0007900: e5953004 ldr r3, [r5, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
a0007904: e1a01006 mov r1, r6
a0007908: e1a06005 mov r6, r5
a000790c: e3c33001 bic r3, r3, #1
block = next_block;
} while ( block != first_block );
return true;
}
a0007910: 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;
a0007914: e5933004 ldr r3, [r3, #4]
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
a0007918: e3130001 tst r3, #1
a000791c: 1a00002a bne a00079cc <_Heap_Walk+0x564>
);
return false;
}
if ( free_block->prev != prev_block ) {
a0007920: e595200c ldr r2, [r5, #12]
a0007924: e1520001 cmp r2, r1
a0007928: 0affffe8 beq a00078d0 <_Heap_Walk+0x468>
(*printer)(
a000792c: e58d2000 str r2, [sp]
a0007930: e1a0000a mov r0, sl
a0007934: e3a01001 mov r1, #1
a0007938: e59f2108 ldr r2, [pc, #264] ; a0007a48 <_Heap_Walk+0x5e0>
a000793c: e1a03005 mov r3, r5
a0007940: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a0007944: e3a00000 mov r0, #0
a0007948: eafffeda b a00074b8 <_Heap_Walk+0x50>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
a000794c: e1a0000a mov r0, sl
a0007950: e58d7000 str r7, [sp]
a0007954: e3a01001 mov r1, #1
a0007958: e59f20ec ldr r2, [pc, #236] ; a0007a4c <_Heap_Walk+0x5e4>
a000795c: e1a03006 mov r3, r6
a0007960: e12fff39 blx r9
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
a0007964: e3a00000 mov r0, #0
a0007968: eafffed2 b a00074b8 <_Heap_Walk+0x50>
}
if ( block_size < min_block_size && is_not_last_block ) {
(*printer)(
a000796c: e58d2004 str r2, [sp, #4]
a0007970: e1a0000a mov r0, sl
a0007974: e58d7000 str r7, [sp]
a0007978: e3a01001 mov r1, #1
a000797c: e59f20cc ldr r2, [pc, #204] ; a0007a50 <_Heap_Walk+0x5e8>
a0007980: e1a03006 mov r3, r6
a0007984: e12fff39 blx r9
block,
block_size,
min_block_size
);
return false;
a0007988: e3a00000 mov r0, #0
a000798c: eafffec9 b a00074b8 <_Heap_Walk+0x50>
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
(*printer)(
a0007990: e1a0000a mov r0, sl
a0007994: e58d5000 str r5, [sp]
a0007998: e3a01001 mov r1, #1
a000799c: e59f20b0 ldr r2, [pc, #176] ; a0007a54 <_Heap_Walk+0x5ec>
a00079a0: e1a03006 mov r3, r6
a00079a4: e12fff39 blx r9
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
a00079a8: e3a00000 mov r0, #0
a00079ac: eafffec1 b a00074b8 <_Heap_Walk+0x50>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
a00079b0: e1a0000a mov r0, sl
a00079b4: e3a01001 mov r1, #1
a00079b8: e59f2098 ldr r2, [pc, #152] ; a0007a58 <_Heap_Walk+0x5f0>
a00079bc: e1a03005 mov r3, r5
a00079c0: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a00079c4: e3a00000 mov r0, #0
a00079c8: eafffeba b a00074b8 <_Heap_Walk+0x50>
return false;
}
if ( _Heap_Is_used( free_block ) ) {
(*printer)(
a00079cc: e1a0000a mov r0, sl
a00079d0: e3a01001 mov r1, #1
a00079d4: e59f2080 ldr r2, [pc, #128] ; a0007a5c <_Heap_Walk+0x5f4>
a00079d8: e1a03005 mov r3, r5
a00079dc: e12fff39 blx r9
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
a00079e0: e3a00000 mov r0, #0
a00079e4: eafffeb3 b a00074b8 <_Heap_Walk+0x50>
a0006968 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
a0006968: 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 )
a000696c: e5904034 ldr r4, [r0, #52] ; 0x34
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
a0006970: e24dd014 sub sp, sp, #20
a0006974: e1a05000 mov r5, r0
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
a0006978: e3540000 cmp r4, #0
/*
* 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 );
a000697c: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
a0006980: 0a00009c beq a0006bf8 <_Objects_Extend_information+0x290>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
a0006984: e1d081b4 ldrh r8, [r0, #20]
a0006988: e1d0a1b0 ldrh sl, [r0, #16]
a000698c: e1a01008 mov r1, r8
a0006990: e1a0000a mov r0, sl
a0006994: eb002645 bl a00102b0 <__aeabi_uidiv>
a0006998: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
a000699c: e1b03823 lsrs r3, r3, #16
a00069a0: 0a00009a beq a0006c10 <_Objects_Extend_information+0x2a8>
if ( information->object_blocks[ block ] == NULL ) {
a00069a4: e5949000 ldr r9, [r4]
a00069a8: e3590000 cmp r9, #0
a00069ac: 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 );
a00069b0: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
a00069b4: 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 ) {
a00069b8: 0a00000c beq a00069f0 <_Objects_Extend_information+0x88>
a00069bc: e1a02004 mov r2, r4
a00069c0: 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 );
a00069c4: e1a06007 mov r6, r7
index_base = minimum_index;
block = 0;
a00069c8: e3a04000 mov r4, #0
a00069cc: ea000002 b a00069dc <_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 ) {
a00069d0: e5b29004 ldr r9, [r2, #4]!
a00069d4: e3590000 cmp r9, #0
a00069d8: 0a000004 beq a00069f0 <_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++ ) {
a00069dc: e2844001 add r4, r4, #1
a00069e0: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
a00069e4: 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++ ) {
a00069e8: 8afffff8 bhi a00069d0 <_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;
a00069ec: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
a00069f0: 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 ) {
a00069f4: e35a0801 cmp sl, #65536 ; 0x10000
a00069f8: 2a000064 bcs a0006b90 <_Objects_Extend_information+0x228>
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
a00069fc: 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;
a0006a00: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
a0006a04: 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;
a0006a08: e0000091 mul r0, r1, r0
if ( information->auto_extend ) {
a0006a0c: 1a000061 bne a0006b98 <_Objects_Extend_information+0x230>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
a0006a10: e58d3000 str r3, [sp]
a0006a14: eb000820 bl a0008a9c <_Workspace_Allocate_or_fatal_error>
a0006a18: e59d3000 ldr r3, [sp]
a0006a1c: e1a08000 mov r8, r0
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
a0006a20: e3590000 cmp r9, #0
a0006a24: 0a00003a beq a0006b14 <_Objects_Extend_information+0x1ac>
*/
/*
* Up the block count and maximum
*/
block_count++;
a0006a28: e283b001 add fp, r3, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
a0006a2c: e08b008b add r0, fp, fp, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
a0006a30: e08a0000 add r0, sl, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
a0006a34: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
object_blocks = (void**) _Workspace_Allocate( block_size );
a0006a38: e1a00100 lsl r0, r0, #2
a0006a3c: e58d3000 str r3, [sp]
a0006a40: eb00080b bl a0008a74 <_Workspace_Allocate>
if ( !object_blocks ) {
a0006a44: e2509000 subs r9, r0, #0
a0006a48: e59d3000 ldr r3, [sp]
a0006a4c: 0a000074 beq a0006c24 <_Objects_Extend_information+0x2bc>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
a0006a50: e1d521b0 ldrh r2, [r5, #16]
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
a0006a54: e089c10b add ip, r9, fp, lsl #2
a0006a58: e089b18b add fp, r9, fp, lsl #3
a0006a5c: e1570002 cmp r7, r2
a0006a60: 3a000052 bcc a0006bb0 <_Objects_Extend_information+0x248>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
a0006a64: e3570000 cmp r7, #0
a0006a68: 13a02000 movne r2, #0
a0006a6c: 11a0100b movne r1, fp
local_table[ index ] = NULL;
a0006a70: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
a0006a74: 0a000003 beq a0006a88 <_Objects_Extend_information+0x120>
a0006a78: e2822001 add r2, r2, #1
a0006a7c: e1570002 cmp r7, r2
local_table[ index ] = NULL;
a0006a80: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
a0006a84: 8afffffb bhi a0006a78 <_Objects_Extend_information+0x110>
a0006a88: 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 );
a0006a8c: e1d511b4 ldrh r1, [r5, #20]
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
a0006a90: e3a00000 mov r0, #0
a0006a94: e7890003 str r0, [r9, r3]
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
a0006a98: e0861001 add r1, r6, r1
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
a0006a9c: e1560001 cmp r6, r1
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
a0006aa0: e78c0003 str r0, [ip, r3]
for ( index=index_base ;
a0006aa4: 2a000005 bcs a0006ac0 <_Objects_Extend_information+0x158>
a0006aa8: e08b2106 add r2, fp, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
a0006aac: 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++ ) {
a0006ab0: 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 ;
a0006ab4: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
a0006ab8: 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 ;
a0006abc: 3afffffb bcc a0006ab0 <_Objects_Extend_information+0x148>
a0006ac0: e10f3000 mrs r3, CPSR
a0006ac4: e3832080 orr r2, r3, #128 ; 0x80
a0006ac8: e129f002 msr CPSR_fc, r2
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
a0006acc: 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(
a0006ad0: e1d510b4 ldrh r1, [r5, #4]
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;
a0006ad4: e1a0a80a lsl sl, sl, #16
a0006ad8: e1a02c02 lsl r2, r2, #24
a0006adc: e3822801 orr r2, r2, #65536 ; 0x10000
a0006ae0: e1a0a82a lsr sl, sl, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
a0006ae4: 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) |
a0006ae8: e182200a orr r2, r2, sl
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
a0006aec: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
a0006af0: e585c030 str ip, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
a0006af4: e5859034 str r9, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
a0006af8: e585b01c str fp, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
a0006afc: e1c5a1b0 strh sl, [r5, #16]
information->maximum_id = _Objects_Build_id(
a0006b00: e585200c str r2, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a0006b04: e129f003 msr CPSR_fc, r3
information->maximum
);
_ISR_Enable( level );
if ( old_tables )
a0006b08: e3500000 cmp r0, #0
a0006b0c: 0a000000 beq a0006b14 <_Objects_Extend_information+0x1ac>
_Workspace_Free( old_tables );
a0006b10: eb0007dd bl a0008a8c <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
a0006b14: e5953034 ldr r3, [r5, #52] ; 0x34
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
a0006b18: e28d7008 add r7, sp, #8
a0006b1c: e1a01008 mov r1, r8
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
a0006b20: e7838104 str r8, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
a0006b24: e1a00007 mov r0, r7
a0006b28: e1d521b4 ldrh r2, [r5, #20]
a0006b2c: e5953018 ldr r3, [r5, #24]
a0006b30: eb000fd8 bl a000aa98 <_Chain_Initialize>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
a0006b34: e1a04104 lsl r4, r4, #2
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
a0006b38: 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 ) {
a0006b3c: ea000009 b a0006b68 <_Objects_Extend_information+0x200>
a0006b40: e5953000 ldr r3, [r5]
the_object->id = _Objects_Build_id(
a0006b44: e1d520b4 ldrh r2, [r5, #4]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
a0006b48: e1a00008 mov r0, r8
a0006b4c: e1a03c03 lsl r3, r3, #24
a0006b50: e3833801 orr r3, r3, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
a0006b54: 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) |
a0006b58: e1833006 orr r3, r3, r6
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
the_object->id = _Objects_Build_id(
a0006b5c: e5813008 str r3, [r1, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
a0006b60: ebfffcdd bl a0005edc <_Chain_Append>
index++;
a0006b64: 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 ) {
a0006b68: e1a00007 mov r0, r7
a0006b6c: ebfffced bl a0005f28 <_Chain_Get>
a0006b70: e2501000 subs r1, r0, #0
a0006b74: 1afffff1 bne a0006b40 <_Objects_Extend_information+0x1d8>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
a0006b78: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
a0006b7c: e1d531b4 ldrh r3, [r5, #20]
a0006b80: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
a0006b84: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
a0006b88: e7813004 str r3, [r1, r4]
information->inactive =
a0006b8c: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
a0006b90: e28dd014 add sp, sp, #20
a0006b94: 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 );
a0006b98: e58d3000 str r3, [sp]
a0006b9c: eb0007b4 bl a0008a74 <_Workspace_Allocate>
if ( !new_object_block )
a0006ba0: e2508000 subs r8, r0, #0
a0006ba4: e59d3000 ldr r3, [sp]
a0006ba8: 1affff9c bne a0006a20 <_Objects_Extend_information+0xb8>
a0006bac: eafffff7 b a0006b90 <_Objects_Extend_information+0x228>
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
a0006bb0: e1a03103 lsl r3, r3, #2
a0006bb4: e5951034 ldr r1, [r5, #52] ; 0x34
a0006bb8: e1a02003 mov r2, r3
a0006bbc: e88d1008 stm sp, {r3, ip}
a0006bc0: eb001a39 bl a000d4ac <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
a0006bc4: e89d1008 ldm sp, {r3, ip}
a0006bc8: e5951030 ldr r1, [r5, #48] ; 0x30
a0006bcc: e1a0000c mov r0, ip
a0006bd0: e1a02003 mov r2, r3
a0006bd4: eb001a34 bl a000d4ac <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
a0006bd8: e1d521b0 ldrh r2, [r5, #16]
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
a0006bdc: e1a0000b mov r0, fp
a0006be0: e595101c ldr r1, [r5, #28]
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
a0006be4: 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,
a0006be8: e1a02102 lsl r2, r2, #2
a0006bec: eb001a2e bl a000d4ac <memcpy>
a0006bf0: e89d1008 ldm sp, {r3, ip}
a0006bf4: eaffffa4 b a0006a8c <_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 )
a0006bf8: e1d0a1b0 ldrh sl, [r0, #16]
a0006bfc: 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 );
a0006c00: 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;
a0006c04: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
a0006c08: e1a03004 mov r3, r4
a0006c0c: eaffff77 b a00069f0 <_Objects_Extend_information+0x88>
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
a0006c10: 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 );
a0006c14: 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;
a0006c18: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
a0006c1c: e1a04003 mov r4, r3 <== NOT EXECUTED
a0006c20: eaffff72 b a00069f0 <_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 );
a0006c24: e1a00008 mov r0, r8
a0006c28: eb000797 bl a0008a8c <_Workspace_Free>
return;
a0006c2c: eaffffd7 b a0006b90 <_Objects_Extend_information+0x228>
a0006f74 <_Objects_Shrink_information>:
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
a0006f74: 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 );
a0006f78: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
a0006f7c: e1d051b4 ldrh r5, [r0, #20]
*/
void _Objects_Shrink_information(
Objects_Information *information
)
{
a0006f80: 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) /
a0006f84: e1d001b0 ldrh r0, [r0, #16]
a0006f88: e1a01005 mov r1, r5
a0006f8c: e0640000 rsb r0, r4, r0
a0006f90: eb0024c6 bl a00102b0 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
a0006f94: e3500000 cmp r0, #0
a0006f98: 0a00000d beq a0006fd4 <_Objects_Shrink_information+0x60>
if ( information->inactive_per_block[ block ] ==
a0006f9c: e5962030 ldr r2, [r6, #48] ; 0x30
a0006fa0: e5923000 ldr r3, [r2]
a0006fa4: 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++ ) {
a0006fa8: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
a0006fac: 1a000005 bne a0006fc8 <_Objects_Shrink_information+0x54>
a0006fb0: ea000008 b a0006fd8 <_Objects_Shrink_information+0x64> <== NOT EXECUTED
a0006fb4: e5b21004 ldr r1, [r2, #4]!
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
a0006fb8: e0844005 add r4, r4, r5
a0006fbc: 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 ] ==
a0006fc0: e1550001 cmp r5, r1
a0006fc4: 0a000004 beq a0006fdc <_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++ ) {
a0006fc8: e2833001 add r3, r3, #1
a0006fcc: e1500003 cmp r0, r3
a0006fd0: 8afffff7 bhi a0006fb4 <_Objects_Shrink_information+0x40>
a0006fd4: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
a0006fd8: e3a07000 mov r7, #0 <== NOT EXECUTED
information->allocation_size ) {
/*
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) information->Inactive.first;
a0006fdc: e5960020 ldr r0, [r6, #32]
a0006fe0: ea000002 b a0006ff0 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
a0006fe4: e3550000 cmp r5, #0
a0006fe8: 0a00000b beq a000701c <_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;
a0006fec: e1a00005 mov r0, r5
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) information->Inactive.first;
do {
index = _Objects_Get_index( the_object->id );
a0006ff0: 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;
a0006ff4: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
a0006ff8: e1530004 cmp r3, r4
a0006ffc: 3afffff8 bcc a0006fe4 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
a0007000: e1d621b4 ldrh r2, [r6, #20]
a0007004: 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) &&
a0007008: e1530002 cmp r3, r2
a000700c: 2afffff4 bcs a0006fe4 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
a0007010: ebfffbbc bl a0005f08 <_Chain_Extract>
}
}
while ( the_object );
a0007014: e3550000 cmp r5, #0
a0007018: 1afffff3 bne a0006fec <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
a000701c: e5963034 ldr r3, [r6, #52] ; 0x34
a0007020: e7930007 ldr r0, [r3, r7]
a0007024: eb000698 bl a0008a8c <_Workspace_Free>
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
a0007028: e1d602bc ldrh r0, [r6, #44] ; 0x2c
a000702c: 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;
a0007030: e5961034 ldr r1, [r6, #52] ; 0x34
information->inactive_per_block[ block ] = 0;
a0007034: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
a0007038: 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;
a000703c: e7815007 str r5, [r1, r7]
information->inactive_per_block[ block ] = 0;
a0007040: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
a0007044: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
a0007048: e8bd80f0 pop {r4, r5, r6, r7, pc}
a00065bc <_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();
a00065bc: e59f30bc ldr r3, [pc, #188] ; a0006680 <_TOD_Validate+0xc4>
*/
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
a00065c0: 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) ||
a00065c4: 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();
a00065c8: e593100c ldr r1, [r3, #12]
if ((!the_tod) ||
a00065cc: 0a000029 beq a0006678 <_TOD_Validate+0xbc>
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
a00065d0: e3a0093d mov r0, #999424 ; 0xf4000
a00065d4: e2800d09 add r0, r0, #576 ; 0x240
a00065d8: eb004571 bl a0017ba4 <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
a00065dc: e5943018 ldr r3, [r4, #24]
a00065e0: e1500003 cmp r0, r3
a00065e4: 9a00001f bls a0006668 <_TOD_Validate+0xac>
(the_tod->ticks >= ticks_per_second) ||
a00065e8: e5943014 ldr r3, [r4, #20]
a00065ec: e353003b cmp r3, #59 ; 0x3b
a00065f0: 8a00001c bhi a0006668 <_TOD_Validate+0xac>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
a00065f4: e5943010 ldr r3, [r4, #16]
a00065f8: e353003b cmp r3, #59 ; 0x3b
a00065fc: 8a000019 bhi a0006668 <_TOD_Validate+0xac>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
a0006600: e594300c ldr r3, [r4, #12]
a0006604: e3530017 cmp r3, #23
a0006608: 8a000016 bhi a0006668 <_TOD_Validate+0xac>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
a000660c: 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) ||
a0006610: e3500000 cmp r0, #0
a0006614: 0a000016 beq a0006674 <_TOD_Validate+0xb8>
(the_tod->month == 0) ||
a0006618: e350000c cmp r0, #12
a000661c: 8a000011 bhi a0006668 <_TOD_Validate+0xac>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
a0006620: 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) ||
a0006624: e3a03d1f mov r3, #1984 ; 0x7c0
a0006628: e2833003 add r3, r3, #3
a000662c: e1520003 cmp r2, r3
a0006630: 9a00000c bls a0006668 <_TOD_Validate+0xac>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
a0006634: 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) ||
a0006638: e3540000 cmp r4, #0
a000663c: 0a00000b beq a0006670 <_TOD_Validate+0xb4>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
a0006640: e3120003 tst r2, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
a0006644: 059f3038 ldreq r3, [pc, #56] ; a0006684 <_TOD_Validate+0xc8>
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
a0006648: 159f3034 ldrne r3, [pc, #52] ; a0006684 <_TOD_Validate+0xc8>
(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 ];
a000664c: 0280000d addeq r0, r0, #13
a0006650: 07930100 ldreq r0, [r3, r0, lsl #2]
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
a0006654: 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(
a0006658: e1500004 cmp r0, r4
a000665c: 33a00000 movcc r0, #0
a0006660: 23a00001 movcs r0, #1
a0006664: 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;
a0006668: e3a00000 mov r0, #0
a000666c: e8bd8010 pop {r4, pc}
a0006670: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
a0006674: e8bd8010 pop {r4, pc} <== NOT EXECUTED
(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;
a0006678: e1a00004 mov r0, r4 <== NOT EXECUTED
a000667c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
a0007768 <_Thread_Initialize>:
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
a0007768: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
/*
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
a000776c: e3a05000 mov r5, #0
a0007770: e5815100 str r5, [r1, #256] ; 0x100
a0007774: e5815104 str r5, [r1, #260] ; 0x104
extensions_area = NULL;
the_thread->libc_reent = NULL;
a0007778: e58150fc str r5, [r1, #252] ; 0xfc
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
a000777c: e1a04001 mov r4, r1
a0007780: e1a0a000 mov sl, r0
/*
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
a0007784: e1a00001 mov r0, r1
a0007788: e1a01003 mov r1, r3
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
a000778c: e1a06003 mov r6, r3
a0007790: e59d8024 ldr r8, [sp, #36] ; 0x24
a0007794: e5dd9028 ldrb r9, [sp, #40] ; 0x28
/*
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
a0007798: eb00027b bl a000818c <_Thread_Stack_Allocate>
if ( !actual_stack_size || actual_stack_size < stack_size )
a000779c: e1500005 cmp r0, r5
a00077a0: 13a07000 movne r7, #0
a00077a4: 03a07001 moveq r7, #1
a00077a8: e1500006 cmp r0, r6
a00077ac: 33877001 orrcc r7, r7, #1
a00077b0: e1570005 cmp r7, r5
a00077b4: 1a00003d bne a00078b0 <_Thread_Initialize+0x148>
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
a00077b8: e59f5134 ldr r5, [pc, #308] ; a00078f4 <_Thread_Initialize+0x18c>
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
a00077bc: e59430c8 ldr r3, [r4, #200] ; 0xc8
the_stack->size = size;
a00077c0: e58400c0 str r0, [r4, #192] ; 0xc0
a00077c4: e5956000 ldr r6, [r5]
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
a00077c8: e58430c4 str r3, [r4, #196] ; 0xc4
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
a00077cc: e5847050 str r7, [r4, #80] ; 0x50
a00077d0: e3560000 cmp r6, #0
the_watchdog->routine = routine;
a00077d4: e5847064 str r7, [r4, #100] ; 0x64
the_watchdog->id = id;
a00077d8: e5847068 str r7, [r4, #104] ; 0x68
the_watchdog->user_data = user_data;
a00077dc: e584706c str r7, [r4, #108] ; 0x6c
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
goto failed;
}
the_thread->extensions = (void **) extensions_area;
a00077e0: 05846108 streq r6, [r4, #264] ; 0x108
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
a00077e4: 1a000033 bne a00078b8 <_Thread_Initialize+0x150>
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
a00077e8: e59d302c ldr r3, [sp, #44] ; 0x2c
}
the_thread->Start.isr_level = isr_level;
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
a00077ec: e3a07000 mov r7, #0
#endif
}
the_thread->Start.isr_level = isr_level;
the_thread->current_state = STATES_DORMANT;
a00077f0: e3a05001 mov r5, #1
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
a00077f4: e58430b0 str r3, [r4, #176] ; 0xb0
the_thread->Start.budget_callout = budget_callout;
a00077f8: e59d3030 ldr r3, [sp, #48] ; 0x30
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
the_thread->resource_count = 0;
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
_Thread_Set_priority( the_thread, priority );
a00077fc: e1a00004 mov r0, r4
a0007800: e1a01008 mov r1, r8
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
a0007804: e58430b4 str r3, [r4, #180] ; 0xb4
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
a0007808: e59d3034 ldr r3, [sp, #52] ; 0x34
the_thread->current_state = STATES_DORMANT;
a000780c: e5845010 str r5, [r4, #16]
the_thread->Wait.queue = NULL;
a0007810: e5847044 str r7, [r4, #68] ; 0x44
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
a0007814: e58430b8 str r3, [r4, #184] ; 0xb8
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
the_thread->resource_count = 0;
a0007818: e584701c str r7, [r4, #28]
the_thread->real_priority = priority;
a000781c: e5848018 str r8, [r4, #24]
the_thread->Start.initial_priority = priority;
a0007820: e58480bc str r8, [r4, #188] ; 0xbc
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
a0007824: e5c490ac strb r9, [r4, #172] ; 0xac
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
the_thread->resource_count = 0;
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
_Thread_Set_priority( the_thread, priority );
a0007828: eb0001c3 bl a0007f3c <_Thread_Set_priority>
_Thread_Stack_Free( the_thread );
return false;
}
a000782c: e59a301c ldr r3, [sl, #28]
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
a0007830: e1d420b8 ldrh r2, [r4, #8]
/*
* Initialize the CPU usage statistics
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &the_thread->cpu_time_used );
a0007834: e5847084 str r7, [r4, #132] ; 0x84
a0007838: e5847088 str r7, [r4, #136] ; 0x88
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
a000783c: e7834102 str r4, [r3, r2, lsl #2]
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
a0007840: e59d3038 ldr r3, [sp, #56] ; 0x38
* enabled when we get here. We want to be able to run the
* user extensions with dispatching enabled. The Allocator
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
a0007844: e1a00004 mov r0, r4
a0007848: e584300c str r3, [r4, #12]
a000784c: eb000363 bl a00085e0 <_User_extensions_Thread_create>
if ( extension_status )
a0007850: e1500007 cmp r0, r7
a0007854: 1a000013 bne a00078a8 <_Thread_Initialize+0x140>
return true;
failed:
if ( the_thread->libc_reent )
a0007858: e59400fc ldr r0, [r4, #252] ; 0xfc
a000785c: e3500000 cmp r0, #0
a0007860: 0a000000 beq a0007868 <_Thread_Initialize+0x100>
_Workspace_Free( the_thread->libc_reent );
a0007864: eb000488 bl a0008a8c <_Workspace_Free>
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
a0007868: e5940100 ldr r0, [r4, #256] ; 0x100
a000786c: e3500000 cmp r0, #0
a0007870: 0a000000 beq a0007878 <_Thread_Initialize+0x110>
_Workspace_Free( the_thread->API_Extensions[i] );
a0007874: eb000484 bl a0008a8c <_Workspace_Free>
failed:
if ( the_thread->libc_reent )
_Workspace_Free( the_thread->libc_reent );
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
if ( the_thread->API_Extensions[i] )
a0007878: e5940104 ldr r0, [r4, #260] ; 0x104
a000787c: e3500000 cmp r0, #0
a0007880: 0a000000 beq a0007888 <_Thread_Initialize+0x120>
_Workspace_Free( the_thread->API_Extensions[i] );
a0007884: eb000480 bl a0008a8c <_Workspace_Free> <== NOT EXECUTED
if ( extensions_area )
a0007888: e3560000 cmp r6, #0
a000788c: 0a000001 beq a0007898 <_Thread_Initialize+0x130>
(void) _Workspace_Free( extensions_area );
a0007890: e1a00006 mov r0, r6
a0007894: eb00047c bl a0008a8c <_Workspace_Free>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( fp_area )
(void) _Workspace_Free( fp_area );
#endif
_Thread_Stack_Free( the_thread );
a0007898: e1a00004 mov r0, r4
a000789c: eb000255 bl a00081f8 <_Thread_Stack_Free>
return false;
a00078a0: e3a00000 mov r0, #0
a00078a4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
a00078a8: e1a00005 mov r0, r5
_Thread_Stack_Free( the_thread );
return false;
}
a00078ac: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
* Allocate and Initialize the stack for this thread.
*/
#if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
a00078b0: e1a00005 mov r0, r5
a00078b4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
extensions_area = _Workspace_Allocate(
a00078b8: e2866001 add r6, r6, #1
a00078bc: e1a00106 lsl r0, r6, #2
a00078c0: eb00046b bl a0008a74 <_Workspace_Allocate>
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
a00078c4: e2506000 subs r6, r0, #0
a00078c8: 0affffe2 beq a0007858 <_Thread_Initialize+0xf0>
goto failed;
}
the_thread->extensions = (void **) extensions_area;
a00078cc: e5951000 ldr r1, [r5]
a00078d0: e5846108 str r6, [r4, #264] ; 0x108
a00078d4: e1a03007 mov r3, r7
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
the_thread->extensions[i] = NULL;
a00078d8: e1a02007 mov r2, r7
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
a00078dc: e2833001 add r3, r3, #1
a00078e0: e1530001 cmp r3, r1
the_thread->extensions[i] = NULL;
a00078e4: e7862107 str r2, [r6, r7, lsl #2]
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
a00078e8: e1a07003 mov r7, r3
a00078ec: 9afffffa bls a00078dc <_Thread_Initialize+0x174>
a00078f0: eaffffbc b a00077e8 <_Thread_Initialize+0x80>
a000b22c <_Thread_queue_Extract_priority_helper>:
void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread,
bool requeuing
)
{
a000b22c: e92d4070 push {r4, r5, r6, lr}
a000b230: e20220ff and r2, r2, #255 ; 0xff
a000b234: e24dd004 sub sp, sp, #4
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a000b238: e10fc000 mrs ip, CPSR
a000b23c: e38c3080 orr r3, ip, #128 ; 0x80
a000b240: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
a000b244: e5910010 ldr r0, [r1, #16]
a000b248: e3a03bef mov r3, #244736 ; 0x3bc00
a000b24c: e2833e2e add r3, r3, #736 ; 0x2e0
a000b250: e0003003 and r3, r0, r3
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
a000b254: e3530000 cmp r3, #0
a000b258: 0a000021 beq a000b2e4 <_Thread_queue_Extract_priority_helper+0xb8>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
a000b25c: e5913038 ldr r3, [r1, #56] ; 0x38
/*
* The thread was actually waiting on a thread queue so let's remove it.
*/
next_node = the_node->next;
a000b260: e8910030 ldm r1, {r4, r5}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
Chain_Control *the_chain
)
{
return (Chain_Node *) &the_chain->permanent_null;
a000b264: e281003c add r0, r1, #60 ; 0x3c
previous_node = the_node->previous;
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
a000b268: e1530000 cmp r3, r0
new_first_thread->Wait.Block2n.last = last_node;
last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
}
} else {
previous_node->next = next_node;
a000b26c: 05854000 streq r4, [r5]
next_node->previous = previous_node;
a000b270: 05845004 streq r5, [r4, #4]
*/
next_node = the_node->next;
previous_node = the_node->previous;
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
a000b274: 0a00000c beq a000b2ac <_Thread_queue_Extract_priority_helper+0x80>
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
a000b278: e5910040 ldr r0, [r1, #64] ; 0x40
new_second_node = new_first_node->next;
a000b27c: e5936000 ldr r6, [r3]
previous_node->next = new_first_node;
next_node->previous = new_first_node;
a000b280: e5843004 str r3, [r4, #4]
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
a000b284: e1500003 cmp r0, r3
new_first_node = the_thread->Wait.Block2n.first;
new_first_thread = (Thread_Control *) new_first_node;
last_node = the_thread->Wait.Block2n.last;
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
a000b288: e5853000 str r3, [r5]
next_node->previous = new_first_node;
new_first_node->next = next_node;
new_first_node->previous = previous_node;
a000b28c: e8830030 stm r3, {r4, r5}
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
a000b290: 0a000005 beq a000b2ac <_Thread_queue_Extract_priority_helper+0x80>
/* > two threads on 2-n */
new_second_node->previous =
_Chain_Head( &new_first_thread->Wait.Block2n );
a000b294: e2835038 add r5, r3, #56 ; 0x38
a000b298: e283403c add r4, r3, #60 ; 0x3c
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
new_second_node->previous =
a000b29c: e5865004 str r5, [r6, #4]
_Chain_Head( &new_first_thread->Wait.Block2n );
new_first_thread->Wait.Block2n.first = new_second_node;
a000b2a0: e5836038 str r6, [r3, #56] ; 0x38
new_first_thread->Wait.Block2n.last = last_node;
a000b2a4: e5830040 str r0, [r3, #64] ; 0x40
last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n );
a000b2a8: e5804000 str r4, [r0]
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
a000b2ac: e3520000 cmp r2, #0
a000b2b0: 1a000008 bne a000b2d8 <_Thread_queue_Extract_priority_helper+0xac>
_ISR_Enable( level );
return;
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
a000b2b4: e5913050 ldr r3, [r1, #80] ; 0x50
a000b2b8: e3530002 cmp r3, #2
a000b2bc: 0a00000a beq a000b2ec <_Thread_queue_Extract_priority_helper+0xc0>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a000b2c0: e129f00c msr CPSR_fc, ip
a000b2c4: e1a00001 mov r0, r1
a000b2c8: e59f103c ldr r1, [pc, #60] ; a000b30c <_Thread_queue_Extract_priority_helper+0xe0>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
a000b2cc: e28dd004 add sp, sp, #4
a000b2d0: e8bd4070 pop {r4, r5, r6, lr}
a000b2d4: eaffeffd b a00072d0 <_Thread_Clear_state>
a000b2d8: e129f00c msr CPSR_fc, ip
a000b2dc: e28dd004 add sp, sp, #4
a000b2e0: e8bd8070 pop {r4, r5, r6, pc}
a000b2e4: e129f00c msr CPSR_fc, ip
a000b2e8: eafffffb b a000b2dc <_Thread_queue_Extract_priority_helper+0xb0>
a000b2ec: e3a03003 mov r3, #3 <== NOT EXECUTED
a000b2f0: e5813050 str r3, [r1, #80] ; 0x50 <== NOT EXECUTED
a000b2f4: e129f00c msr CPSR_fc, ip <== NOT EXECUTED
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
(void) _Watchdog_Remove( &the_thread->Timer );
a000b2f8: e2810048 add r0, r1, #72 ; 0x48 <== NOT EXECUTED
a000b2fc: e58d1000 str r1, [sp] <== NOT EXECUTED
a000b300: ebfff571 bl a00088cc <_Watchdog_Remove> <== NOT EXECUTED
a000b304: e59d1000 ldr r1, [sp] <== NOT EXECUTED
a000b308: eaffffed b a000b2c4 <_Thread_queue_Extract_priority_helper+0x98><== NOT EXECUTED
a0015e6c <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
a0015e6c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
a0015e70: e24dd024 sub sp, sp, #36 ; 0x24
a0015e74: e28d700c add r7, sp, #12
a0015e78: e28d2018 add r2, sp, #24
a0015e7c: e282a004 add sl, r2, #4
a0015e80: e2872004 add r2, r7, #4
a0015e84: e58d2000 str r2, [sp]
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
the_chain->permanent_null = NULL;
the_chain->last = _Chain_Head(the_chain);
a0015e88: e28d2018 add r2, sp, #24
a0015e8c: e58d2020 str r2, [sp, #32]
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
a0015e90: e59d2000 ldr r2, [sp]
a0015e94: e59f91cc ldr r9, [pc, #460] ; a0016068 <_Timer_server_Body+0x1fc>
a0015e98: e59fb1cc ldr fp, [pc, #460] ; a001606c <_Timer_server_Body+0x200>
a0015e9c: e58d200c str r2, [sp, #12]
a0015ea0: e2802008 add r2, r0, #8
the_chain->permanent_null = NULL;
a0015ea4: e3a03000 mov r3, #0
a0015ea8: e58d2004 str r2, [sp, #4]
a0015eac: e2802040 add r2, r0, #64 ; 0x40
a0015eb0: e1a04000 mov r4, r0
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
the_chain->first = _Chain_Tail(the_chain);
a0015eb4: e58da018 str sl, [sp, #24]
the_chain->permanent_null = NULL;
a0015eb8: e58d301c str r3, [sp, #28]
a0015ebc: e58d3010 str r3, [sp, #16]
the_chain->last = _Chain_Head(the_chain);
a0015ec0: e58d7014 str r7, [sp, #20]
a0015ec4: e2806030 add r6, r0, #48 ; 0x30
a0015ec8: e2808068 add r8, r0, #104 ; 0x68
a0015ecc: e58d2008 str r2, [sp, #8]
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
a0015ed0: e28d3018 add r3, sp, #24
a0015ed4: e5843078 str r3, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
a0015ed8: e5993000 ldr r3, [r9]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
a0015edc: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
a0015ee0: e1a02007 mov r2, r7
a0015ee4: e1a00006 mov r0, r6
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
a0015ee8: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
a0015eec: e0611003 rsb r1, r1, r3
a0015ef0: eb001166 bl a001a490 <_Watchdog_Adjust_to_chain>
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
a0015ef4: e59b5000 ldr r5, [fp]
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
a0015ef8: e5942074 ldr r2, [r4, #116] ; 0x74
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
a0015efc: e1550002 cmp r5, r2
a0015f00: 8a000022 bhi a0015f90 <_Timer_server_Body+0x124>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
a0015f04: 3a000018 bcc a0015f6c <_Timer_server_Body+0x100>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
a0015f08: e5845074 str r5, [r4, #116] ; 0x74
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
a0015f0c: e5940078 ldr r0, [r4, #120] ; 0x78
a0015f10: eb0002bc bl a0016a08 <_Chain_Get>
if ( timer == NULL ) {
a0015f14: e2501000 subs r1, r0, #0
a0015f18: 0a00000b beq a0015f4c <_Timer_server_Body+0xe0>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
a0015f1c: e5913038 ldr r3, [r1, #56] ; 0x38
a0015f20: e3530001 cmp r3, #1
a0015f24: 0a000015 beq a0015f80 <_Timer_server_Body+0x114>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
a0015f28: e3530003 cmp r3, #3
a0015f2c: 1afffff6 bne a0015f0c <_Timer_server_Body+0xa0>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
a0015f30: e2811010 add r1, r1, #16
a0015f34: e1a00008 mov r0, r8
a0015f38: eb00117e bl a001a538 <_Watchdog_Insert>
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
a0015f3c: e5940078 ldr r0, [r4, #120] ; 0x78
a0015f40: eb0002b0 bl a0016a08 <_Chain_Get>
if ( timer == NULL ) {
a0015f44: e2501000 subs r1, r0, #0
a0015f48: 1afffff3 bne a0015f1c <_Timer_server_Body+0xb0>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a0015f4c: e10f2000 mrs r2, CPSR
a0015f50: e3823080 orr r3, r2, #128 ; 0x80
a0015f54: e129f003 msr CPSR_fc, r3
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
a0015f58: e59d3018 ldr r3, [sp, #24]
a0015f5c: e15a0003 cmp sl, r3
a0015f60: 0a00000f beq a0015fa4 <_Timer_server_Body+0x138>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a0015f64: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
a0015f68: eaffffda b a0015ed8 <_Timer_server_Body+0x6c> <== NOT EXECUTED
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
a0015f6c: e1a00008 mov r0, r8
a0015f70: e3a01001 mov r1, #1
a0015f74: e0652002 rsb r2, r5, r2
a0015f78: eb001115 bl a001a3d4 <_Watchdog_Adjust>
a0015f7c: eaffffe1 b a0015f08 <_Timer_server_Body+0x9c>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
a0015f80: e1a00006 mov r0, r6
a0015f84: e2811010 add r1, r1, #16
a0015f88: eb00116a bl a001a538 <_Watchdog_Insert>
a0015f8c: eaffffde b a0015f0c <_Timer_server_Body+0xa0>
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
a0015f90: e0621005 rsb r1, r2, r5
a0015f94: e1a00008 mov r0, r8
a0015f98: e1a02007 mov r2, r7
a0015f9c: eb00113b bl a001a490 <_Watchdog_Adjust_to_chain>
a0015fa0: eaffffd8 b a0015f08 <_Timer_server_Body+0x9c>
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
a0015fa4: e5841078 str r1, [r4, #120] ; 0x78
a0015fa8: e129f002 msr CPSR_fc, r2
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
a0015fac: e59d300c ldr r3, [sp, #12]
a0015fb0: e59d2000 ldr r2, [sp]
a0015fb4: e1520003 cmp r2, r3
a0015fb8: 0a000015 beq a0016014 <_Timer_server_Body+0x1a8>
a0015fbc: e1a05004 mov r5, r4
a0015fc0: e59d4000 ldr r4, [sp]
a0015fc4: ea000009 b a0015ff0 <_Timer_server_Body+0x184>
{
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
a0015fc8: e5923000 ldr r3, [r2]
the_chain->first = new_first;
new_first->previous = _Chain_Head(the_chain);
a0015fcc: e5837004 str r7, [r3, #4]
Chain_Node *return_node;
Chain_Node *new_first;
return_node = the_chain->first;
new_first = return_node->next;
the_chain->first = new_first;
a0015fd0: e58d300c str r3, [sp, #12]
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
a0015fd4: e3a03000 mov r3, #0
a0015fd8: e5823008 str r3, [r2, #8]
a0015fdc: e129f001 msr CPSR_fc, r1
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
a0015fe0: e592301c ldr r3, [r2, #28]
a0015fe4: e5920020 ldr r0, [r2, #32]
a0015fe8: e5921024 ldr r1, [r2, #36] ; 0x24
a0015fec: e12fff33 blx r3
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a0015ff0: e10f1000 mrs r1, CPSR
a0015ff4: e3813080 orr r3, r1, #128 ; 0x80
a0015ff8: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
a0015ffc: e59d200c ldr r2, [sp, #12]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
a0016000: e1540002 cmp r4, r2
a0016004: 1affffef bne a0015fc8 <_Timer_server_Body+0x15c>
a0016008: e1a04005 mov r4, r5
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a001600c: e129f001 msr CPSR_fc, r1
a0016010: eaffffae b a0015ed0 <_Timer_server_Body+0x64>
}
} else {
ts->active = false;
a0016014: e3a02000 mov r2, #0
a0016018: e5c4207c strb r2, [r4, #124] ; 0x7c
a001601c: e59f204c ldr r2, [pc, #76] ; a0016070 <_Timer_server_Body+0x204>
a0016020: e5923000 ldr r3, [r2]
a0016024: e2833001 add r3, r3, #1
a0016028: e5823000 str r3, [r2]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
a001602c: e3a01008 mov r1, #8
a0016030: e5940000 ldr r0, [r4]
a0016034: eb000e8c bl a0019a6c <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
a0016038: e1a00004 mov r0, r4
a001603c: ebffff5e bl a0015dbc <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
a0016040: e1a00004 mov r0, r4
a0016044: ebffff72 bl a0015e14 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
a0016048: eb000bf5 bl a0019024 <_Thread_Enable_dispatch>
ts->active = true;
a001604c: e3a03001 mov r3, #1
a0016050: e5c4307c strb r3, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
a0016054: e59d0004 ldr r0, [sp, #4]
a0016058: eb0011a3 bl a001a6ec <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
a001605c: e59d0008 ldr r0, [sp, #8]
a0016060: eb0011a1 bl a001a6ec <_Watchdog_Remove>
a0016064: eaffff99 b a0015ed0 <_Timer_server_Body+0x64>
a000a1f8 <_Timespec_Greater_than>:
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
a000a1f8: e5902000 ldr r2, [r0]
a000a1fc: e5913000 ldr r3, [r1]
a000a200: e1520003 cmp r2, r3
return true;
a000a204: c3a00001 movgt r0, #1
bool _Timespec_Greater_than(
const struct timespec *lhs,
const struct timespec *rhs
)
{
if ( lhs->tv_sec > rhs->tv_sec )
a000a208: c12fff1e bxgt lr
return true;
if ( lhs->tv_sec < rhs->tv_sec )
a000a20c: ba000005 blt a000a228 <_Timespec_Greater_than+0x30>
#include <rtems/system.h>
#include <rtems/score/timespec.h>
#include <rtems/score/tod.h>
bool _Timespec_Greater_than(
a000a210: e5900004 ldr r0, [r0, #4]
a000a214: e5913004 ldr r3, [r1, #4]
a000a218: e1500003 cmp r0, r3
a000a21c: d3a00000 movle r0, #0
a000a220: c3a00001 movgt r0, #1
a000a224: e12fff1e bx lr
{
if ( lhs->tv_sec > rhs->tv_sec )
return true;
if ( lhs->tv_sec < rhs->tv_sec )
return false;
a000a228: e3a00000 mov r0, #0 <== NOT EXECUTED
/* ASSERT: lhs->tv_sec == rhs->tv_sec */
if ( lhs->tv_nsec > rhs->tv_nsec )
return true;
return false;
}
a000a22c: e12fff1e bx lr <== NOT EXECUTED
a00085e0 <_User_extensions_Thread_create>:
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
a00085e0: e92d40f0 push {r4, r5, r6, r7, lr}
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
a00085e4: e59f504c ldr r5, [pc, #76] ; a0008638 <_User_extensions_Thread_create+0x58>
#include <rtems/score/userext.h>
bool _User_extensions_Thread_create (
Thread_Control *the_thread
)
{
a00085e8: e1a06000 mov r6, r0
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
a00085ec: e4954004 ldr r4, [r5], #4
a00085f0: e1540005 cmp r4, r5
a00085f4: 0a00000d beq a0008630 <_User_extensions_Thread_create+0x50>
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)(
a00085f8: e59f703c ldr r7, [pc, #60] ; a000863c <_User_extensions_Thread_create+0x5c>
!_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 ) {
a00085fc: e5943014 ldr r3, [r4, #20]
status = (*the_extension->Callouts.thread_create)(
a0008600: 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 ) {
a0008604: e3530000 cmp r3, #0
a0008608: 0a000003 beq a000861c <_User_extensions_Thread_create+0x3c>
status = (*the_extension->Callouts.thread_create)(
a000860c: e5970004 ldr r0, [r7, #4]
a0008610: e12fff33 blx r3
_Thread_Executing,
the_thread
);
if ( !status )
a0008614: e3500000 cmp r0, #0
a0008618: 0a000005 beq a0008634 <_User_extensions_Thread_create+0x54>
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
the_node = the_node->next ) {
a000861c: e5944000 ldr r4, [r4]
{
Chain_Node *the_node;
User_extensions_Control *the_extension;
bool status;
for ( the_node = _User_extensions_List.first ;
a0008620: e1540005 cmp r4, r5
a0008624: 1afffff4 bne a00085fc <_User_extensions_Thread_create+0x1c>
if ( !status )
return false;
}
}
return true;
a0008628: e3a00001 mov r0, #1
a000862c: e8bd80f0 pop {r4, r5, r6, r7, pc}
a0008630: e3a00001 mov r0, #1 <== NOT EXECUTED
}
a0008634: e8bd80f0 pop {r4, r5, r6, r7, pc}
a000a5a4 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
a000a5a4: e92d41f0 push {r4, r5, r6, r7, r8, lr}
a000a5a8: e1a04000 mov r4, r0
a000a5ac: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a000a5b0: e10f3000 mrs r3, CPSR
a000a5b4: e3832080 orr r2, r3, #128 ; 0x80
a000a5b8: e129f002 msr CPSR_fc, r2
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
Chain_Control *the_chain
)
{
return (the_chain->first == _Chain_Tail(the_chain));
a000a5bc: e1a07000 mov r7, r0
a000a5c0: e4972004 ldr r2, [r7], #4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
a000a5c4: e1520007 cmp r2, r7
a000a5c8: 0a000018 beq a000a630 <_Watchdog_Adjust+0x8c>
switch ( direction ) {
a000a5cc: e3510000 cmp r1, #0
a000a5d0: 1a000018 bne a000a638 <_Watchdog_Adjust+0x94>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a000a5d4: e3550000 cmp r5, #0
a000a5d8: 0a000014 beq a000a630 <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a000a5dc: e5926010 ldr r6, [r2, #16]
a000a5e0: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a000a5e4: 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 ) {
a000a5e8: 2a000005 bcs a000a604 <_Watchdog_Adjust+0x60>
a000a5ec: ea000018 b a000a654 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
a000a5f0: e0555006 subs r5, r5, r6
a000a5f4: 0a00000d beq a000a630 <_Watchdog_Adjust+0x8c>
if ( units < _Watchdog_First( header )->delta_interval ) {
a000a5f8: e5926010 ldr r6, [r2, #16]
a000a5fc: e1560005 cmp r6, r5
a000a600: 8a000013 bhi a000a654 <_Watchdog_Adjust+0xb0>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
a000a604: e5828010 str r8, [r2, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a000a608: e129f003 msr CPSR_fc, r3
_ISR_Enable( level );
_Watchdog_Tickle( header );
a000a60c: e1a00004 mov r0, r4
a000a610: eb0000aa bl a000a8c0 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a000a614: e10f3000 mrs r3, CPSR
a000a618: e3832080 orr r2, r3, #128 ; 0x80
a000a61c: e129f002 msr CPSR_fc, r2
a000a620: e5941000 ldr r1, [r4]
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
a000a624: e1570001 cmp r7, r1
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) header->first );
a000a628: e1a02001 mov r2, r1
a000a62c: 1affffef bne a000a5f0 <_Watchdog_Adjust+0x4c>
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a000a630: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a000a634: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
a000a638: e3510001 cmp r1, #1
a000a63c: 1afffffb bne a000a630 <_Watchdog_Adjust+0x8c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
a000a640: e5921010 ldr r1, [r2, #16]
a000a644: e0815005 add r5, r1, r5
a000a648: e5825010 str r5, [r2, #16]
a000a64c: e129f003 msr CPSR_fc, r3
}
}
_ISR_Enable( level );
}
a000a650: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
a000a654: e0655006 rsb r5, r5, r6
a000a658: e5825010 str r5, [r2, #16]
break;
a000a65c: eafffff3 b a000a630 <_Watchdog_Adjust+0x8c>
a0006e54 <rtems_io_register_driver>:
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
)
{
a0006e54: e92d4030 push {r4, r5, lr}
a0006e58: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
a0006e5c: e59f014c ldr r0, [pc, #332] ; a0006fb0 <rtems_io_register_driver+0x15c>
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;
a0006e60: e59f314c ldr r3, [pc, #332] ; a0006fb4 <rtems_io_register_driver+0x160>
if ( rtems_interrupt_is_in_progress() )
a0006e64: e5900000 ldr r0, [r0]
a0006e68: e3500000 cmp r0, #0
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;
a0006e6c: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
a0006e70: 1a000033 bne a0006f44 <rtems_io_register_driver+0xf0>
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
a0006e74: e3520000 cmp r2, #0
a0006e78: 0a000041 beq a0006f84 <rtems_io_register_driver+0x130>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
if ( driver_table == NULL )
a0006e7c: e3510000 cmp r1, #0
if ( registered_major == NULL )
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
a0006e80: e5820000 str r0, [r2]
if ( driver_table == NULL )
a0006e84: 0a00003e beq a0006f84 <rtems_io_register_driver+0x130>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
a0006e88: e591c000 ldr ip, [r1]
a0006e8c: e35c0000 cmp ip, #0
a0006e90: 0a000038 beq a0006f78 <rtems_io_register_driver+0x124>
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
a0006e94: e1500004 cmp r0, r4
a0006e98: 9a000027 bls a0006f3c <rtems_io_register_driver+0xe8>
rtems_fatal_error_occurred( 99 );
}
}
#endif
_Thread_Dispatch_disable_level += 1;
a0006e9c: e59f0114 ldr r0, [pc, #276] ; a0006fb8 <rtems_io_register_driver+0x164>
a0006ea0: e590c000 ldr ip, [r0]
a0006ea4: e28cc001 add ip, ip, #1
a0006ea8: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
a0006eac: e3540000 cmp r4, #0
a0006eb0: 1a000025 bne a0006f4c <rtems_io_register_driver+0xf8>
static rtems_status_code rtems_io_obtain_major_number(
rtems_device_major_number *major
)
{
rtems_device_major_number n = _IO_Number_of_drivers;
a0006eb4: e593c000 ldr ip, [r3]
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
a0006eb8: e35c0000 cmp ip, #0
a0006ebc: 0a000032 beq a0006f8c <rtems_io_register_driver+0x138>
a0006ec0: e59fe0f4 ldr lr, [pc, #244] ; a0006fbc <rtems_io_register_driver+0x168>
a0006ec4: e59e3000 ldr r3, [lr]
a0006ec8: ea000003 b a0006edc <rtems_io_register_driver+0x88>
a0006ecc: e2844001 add r4, r4, #1
a0006ed0: e15c0004 cmp ip, r4
a0006ed4: e2833018 add r3, r3, #24
a0006ed8: 9a000005 bls a0006ef4 <rtems_io_register_driver+0xa0>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
a0006edc: e5930000 ldr r0, [r3]
a0006ee0: e3500000 cmp r0, #0
a0006ee4: 1afffff8 bne a0006ecc <rtems_io_register_driver+0x78>
a0006ee8: e5930004 ldr r0, [r3, #4]
a0006eec: e3500000 cmp r0, #0
a0006ef0: 1afffff5 bne a0006ecc <rtems_io_register_driver+0x78>
}
/* Assigns invalid value in case of failure */
*major = m;
if ( m != n )
a0006ef4: e15c0004 cmp ip, r4
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
a0006ef8: e5824000 str r4, [r2]
if ( m != n )
a0006efc: 0a000023 beq a0006f90 <rtems_io_register_driver+0x13c>
a0006f00: e3a0c018 mov ip, #24
a0006f04: e00c0c94 mul ip, r4, ip
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
a0006f08: e59e5000 ldr r5, [lr]
a0006f0c: e1a0e001 mov lr, r1
a0006f10: e8be000f ldm lr!, {r0, r1, r2, r3}
a0006f14: e085c00c add ip, r5, ip
a0006f18: e8ac000f stmia ip!, {r0, r1, r2, r3}
a0006f1c: e89e0003 ldm lr, {r0, r1}
a0006f20: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
a0006f24: eb000699 bl a0008990 <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
a0006f28: e3a01000 mov r1, #0
a0006f2c: e1a00004 mov r0, r4
a0006f30: e1a02001 mov r2, r1
}
a0006f34: e8bd4030 pop {r4, r5, lr}
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
a0006f38: ea001ed2 b a000ea88 <rtems_io_initialize>
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
a0006f3c: e3a0000a mov r0, #10
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
a0006f40: e8bd8030 pop {r4, r5, pc}
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
a0006f44: e3a00012 mov r0, #18
a0006f48: 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;
a0006f4c: e59fe068 ldr lr, [pc, #104] ; a0006fbc <rtems_io_register_driver+0x168>
a0006f50: e3a0c018 mov ip, #24
a0006f54: e00c0c94 mul ip, r4, ip
a0006f58: e59e3000 ldr r3, [lr]
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
a0006f5c: e793000c ldr r0, [r3, ip]
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
a0006f60: 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;
a0006f64: e3500000 cmp r0, #0
a0006f68: 0a00000b beq a0006f9c <rtems_io_register_driver+0x148>
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();
a0006f6c: eb000687 bl a0008990 <_Thread_Enable_dispatch>
return RTEMS_RESOURCE_IN_USE;
a0006f70: e3a0000c mov r0, #12
a0006f74: 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;
a0006f78: e591c004 ldr ip, [r1, #4]
a0006f7c: e35c0000 cmp ip, #0
a0006f80: 1affffc3 bne a0006e94 <rtems_io_register_driver+0x40>
if ( driver_table == NULL )
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
a0006f84: e3a00009 mov r0, #9
a0006f88: e8bd8030 pop {r4, r5, pc}
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
a0006f8c: 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();
a0006f90: eb00067e bl a0008990 <_Thread_Enable_dispatch>
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
a0006f94: 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;
a0006f98: 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;
a0006f9c: e5933004 ldr r3, [r3, #4]
a0006fa0: e3530000 cmp r3, #0
a0006fa4: 1afffff0 bne a0006f6c <rtems_io_register_driver+0x118>
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
a0006fa8: e5824000 str r4, [r2]
a0006fac: eaffffd5 b a0006f08 <rtems_io_register_driver+0xb4>
a000c764 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
a000c764: 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 )
a000c768: e2525000 subs r5, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
a000c76c: e1a04000 mov r4, r0
a000c770: e1a06001 mov r6, r1
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
a000c774: 0a000056 beq a000c8d4 <rtems_task_mode+0x170>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
a000c778: e59f915c ldr r9, [pc, #348] ; a000c8dc <rtems_task_mode+0x178>
a000c77c: e5997004 ldr r7, [r9, #4]
api = executing->API_Extensions[ THREAD_API_RTEMS ];
a000c780: e5978100 ldr r8, [r7, #256] ; 0x100
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
a000c784: e5d7a074 ldrb sl, [r7, #116] ; 0x74
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
a000c788: e597307c ldr r3, [r7, #124] ; 0x7c
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
a000c78c: 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;
a000c790: e35a0000 cmp sl, #0
a000c794: 03a0ac01 moveq sl, #256 ; 0x100
a000c798: 13a0a000 movne sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
a000c79c: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
a000c7a0: 138aac02 orrne sl, sl, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
a000c7a4: e35b0000 cmp fp, #0
a000c7a8: 03a0bb01 moveq fp, #1024 ; 0x400
a000c7ac: 13a0b000 movne fp, #0
old_mode |= _ISR_Get_level();
a000c7b0: ebfff1ab bl a0008e64 <_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;
a000c7b4: e18bb000 orr fp, fp, r0
old_mode |= _ISR_Get_level();
a000c7b8: e18ba00a orr sl, fp, sl
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
a000c7bc: 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;
a000c7c0: e585a000 str sl, [r5]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
a000c7c4: 0a000003 beq a000c7d8 <rtems_task_mode+0x74>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
a000c7c8: e3140c01 tst r4, #256 ; 0x100
a000c7cc: 13a03000 movne r3, #0
a000c7d0: 03a03001 moveq r3, #1
a000c7d4: e5c73074 strb r3, [r7, #116] ; 0x74
if ( mask & RTEMS_TIMESLICE_MASK ) {
a000c7d8: e3160c02 tst r6, #512 ; 0x200
a000c7dc: 1a00001c bne a000c854 <rtems_task_mode+0xf0>
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
a000c7e0: e3160080 tst r6, #128 ; 0x80
a000c7e4: 1a000023 bne a000c878 <rtems_task_mode+0x114>
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
a000c7e8: e2166b01 ands r6, r6, #1024 ; 0x400
a000c7ec: 0a000012 beq a000c83c <rtems_task_mode+0xd8>
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
a000c7f0: e5d82008 ldrb r2, [r8, #8]
* Output:
* *previous_mode_set - previous mode set
* always return RTEMS_SUCCESSFUL;
*/
rtems_status_code rtems_task_mode(
a000c7f4: e3140b01 tst r4, #1024 ; 0x400
a000c7f8: 13a03000 movne r3, #0
a000c7fc: 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 ) {
a000c800: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
a000c804: 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 ) {
a000c808: 0a00000b beq a000c83c <rtems_task_mode+0xd8>
asr->is_enabled = is_asr_enabled;
a000c80c: e5c83008 strb r3, [r8, #8]
static inline uint32_t arm_interrupt_disable( void )
{
uint32_t arm_switch_reg;
uint32_t level;
asm volatile (
a000c810: e10f3000 mrs r3, CPSR
a000c814: e3832080 orr r2, r3, #128 ; 0x80
a000c818: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
a000c81c: e5981018 ldr r1, [r8, #24]
information->signals_pending = information->signals_posted;
a000c820: e5982014 ldr r2, [r8, #20]
information->signals_posted = _signals;
a000c824: 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;
a000c828: e5882018 str r2, [r8, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
ARM_SWITCH_REGISTERS;
asm volatile (
a000c82c: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
a000c830: e5986014 ldr r6, [r8, #20]
a000c834: e3560000 cmp r6, #0
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
a000c838: 13a06001 movne r6, #1
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
a000c83c: e59f309c ldr r3, [pc, #156] ; a000c8e0 <rtems_task_mode+0x17c>
a000c840: e5933000 ldr r3, [r3]
a000c844: e3530003 cmp r3, #3
a000c848: 0a00000d beq a000c884 <rtems_task_mode+0x120>
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
_Thread_Dispatch();
return RTEMS_SUCCESSFUL;
a000c84c: e3a00000 mov r0, #0 <== NOT EXECUTED
a000c850: 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) ) {
a000c854: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
a000c858: 13a03001 movne r3, #1
a000c85c: 1587307c strne r3, [r7, #124] ; 0x7c
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
a000c860: 159f307c ldrne r3, [pc, #124] ; a000c8e4 <rtems_task_mode+0x180>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
a000c864: 0587307c streq r3, [r7, #124] ; 0x7c
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;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
a000c868: 15933000 ldrne r3, [r3]
a000c86c: 15873078 strne r3, [r7, #120] ; 0x78
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
a000c870: e3160080 tst r6, #128 ; 0x80
a000c874: 0affffdb beq a000c7e8 <rtems_task_mode+0x84>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
a000c878: e2040080 and r0, r4, #128 ; 0x80
a000c87c: ebfff173 bl a0008e50 <_CPU_ISR_Set_level>
a000c880: eaffffd8 b a000c7e8 <rtems_task_mode+0x84>
*/
RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void )
{
Thread_Control *executing;
executing = _Thread_Executing;
a000c884: e5993004 ldr r3, [r9, #4]
if ( !_States_Is_ready( executing->current_state ) ||
a000c888: e5932010 ldr r2, [r3, #16]
a000c88c: e3520000 cmp r2, #0
a000c890: 1a00000a bne a000c8c0 <rtems_task_mode+0x15c>
a000c894: e59f2040 ldr r2, [pc, #64] ; a000c8dc <rtems_task_mode+0x178>
a000c898: e5922008 ldr r2, [r2, #8]
a000c89c: e1530002 cmp r3, r2
a000c8a0: 0a000002 beq a000c8b0 <rtems_task_mode+0x14c>
( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
a000c8a4: e5d33074 ldrb r3, [r3, #116] ; 0x74
a000c8a8: e3530000 cmp r3, #0
a000c8ac: 1a000003 bne a000c8c0 <rtems_task_mode+0x15c>
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
a000c8b0: e3560000 cmp r6, #0
a000c8b4: 1a000003 bne a000c8c8 <rtems_task_mode+0x164>
_Thread_Dispatch();
return RTEMS_SUCCESSFUL;
a000c8b8: e1a00006 mov r0, r6
}
a000c8bc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
_Context_Switch_necessary = true;
a000c8c0: e3a03001 mov r3, #1
a000c8c4: e5c93010 strb r3, [r9, #16]
}
}
if ( _System_state_Is_up( _System_state_Get() ) )
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
_Thread_Dispatch();
a000c8c8: ebffeb26 bl a0007568 <_Thread_Dispatch>
return RTEMS_SUCCESSFUL;
a000c8cc: e3a00000 mov r0, #0
a000c8d0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
a000c8d4: e3a00009 mov r0, #9
a000c8d8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}