0000a394 <_CORE_mutex_Seize_interrupt_trylock>: { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing;
a394: e59f3154 ldr r3, [pc, #340] ; a4f0 <_CORE_mutex_Seize_interrupt_trylock+0x15c> a398: e5933000 ldr r3, [r3]
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
a39c: e3a02000 mov r2, #0 a3a0: e5832034 str r2, [r3, #52] ; 0x34
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
a3a4: e590c050 ldr ip, [r0, #80] ; 0x50 a3a8: e15c0002 cmp ip, r2
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) {
a3ac: e92d4070 push {r4, r5, r6, lr}
a3b0: 0a00000e beq a3f0 <_CORE_mutex_Seize_interrupt_trylock+0x5c> the_mutex->lock = CORE_MUTEX_LOCKED;
a3b4: e5802050 str r2, [r0, #80] ; 0x50
*/ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
a3b8: e590c048 ldr ip, [r0, #72] ; 0x48
executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id;
a3bc: e5935008 ldr r5, [r3, #8]
the_mutex->nest_count = 1;
a3c0: e3a04001 mov r4, #1
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
a3c4: e35c0002 cmp ip, #2
executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id;
a3c8: e5805060 str r5, [r0, #96] ; 0x60
executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing;
a3cc: e580305c str r3, [r0, #92] ; 0x5c
the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1;
a3d0: e5804054 str r4, [r0, #84] ; 0x54
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || a3d4: 0a00000a beq a404 <_CORE_mutex_Seize_interrupt_trylock+0x70>
a3d8: e35c0003 cmp ip, #3
a3dc: 0a000019 beq a448 <_CORE_mutex_Seize_interrupt_trylock+0xb4>
a3e0: e5913000 ldr r3, [r1] a3e4: e129f003 msr CPSR_fc, r3 a3e8: e3a00000 mov r0, #0 a3ec: e8bd8070 pop {r4, r5, r6, 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 ) ) {
a3f0: e590205c ldr r2, [r0, #92] ; 0x5c a3f4: e1530002 cmp r3, r2
a3f8: 0a000008 beq a420 <_CORE_mutex_Seize_interrupt_trylock+0x8c>
a3fc: e3a00001 mov r0, #1
return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); }
a400: e8bd8070 pop {r4, r5, r6, pc}
_Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++;
a404: e593201c ldr r2, [r3, #28] a408: e2822001 add r2, r2, #1 a40c: e583201c str r2, [r3, #28] a410: e5913000 ldr r3, [r1] a414: e129f003 msr CPSR_fc, r3 a418: e3a00000 mov r0, #0 a41c: e8bd8070 pop {r4, r5, r6, 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 ) {
a420: e5902040 ldr r2, [r0, #64] ; 0x40 a424: e3520000 cmp r2, #0
a428: 1a000017 bne a48c <_CORE_mutex_Seize_interrupt_trylock+0xf8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++;
a42c: e5903054 ldr r3, [r0, #84] ; 0x54 a430: e2833001 add r3, r3, #1 a434: e5803054 str r3, [r0, #84] ; 0x54 a438: e5913000 ldr r3, [r1] a43c: e129f003 msr CPSR_fc, r3 a440: e3a00000 mov r0, #0 a444: e8bd8070 pop {r4, r5, r6, pc}
_Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++;
a448: e593c01c ldr ip, [r3, #28] a44c: e08c5004 add r5, ip, r4 a450: e583501c str r5, [r3, #28]
{ Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority;
a454: e5935014 ldr r5, [r3, #20]
*/ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling;
a458: e590604c ldr r6, [r0, #76] ; 0x4c
current = executing->current_priority; if ( current == ceiling ) {
a45c: e1560005 cmp r6, r5
a460: 0a00001e beq a4e0 <_CORE_mutex_Seize_interrupt_trylock+0x14c> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { a464: 3a000010 bcc a4ac <_CORE_mutex_Seize_interrupt_trylock+0x118> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED;
a468: e3a05006 mov r5, #6 a46c: e5835034 str r5, [r3, #52] ; 0x34
the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */
a470: e5802054 str r2, [r0, #84] ; 0x54
_Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED;
a474: e5804050 str r4, [r0, #80] ; 0x50
the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */
a478: e583c01c str ip, [r3, #28] a47c: e5913000 ldr r3, [r1] a480: e129f003 msr CPSR_fc, r3 a484: e3a00000 mov r0, #0 a488: e8bd8070 pop {r4, r5, r6, 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 ) {
a48c: e3520001 cmp r2, #1
a490: 1affffd9 bne a3fc <_CORE_mutex_Seize_interrupt_trylock+0x68> 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;
a494: e3a02002 mov r2, #2 <== NOT EXECUTED a498: e5832034 str r2, [r3, #52] ; 0x34 <== NOT EXECUTED a49c: e5913000 ldr r3, [r1] <== NOT EXECUTED a4a0: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED a4a4: e3a00000 mov r0, #0 <== NOT EXECUTED a4a8: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1;
a4ac: e59f3040 ldr r3, [pc, #64] ; a4f4 <_CORE_mutex_Seize_interrupt_trylock+0x160> a4b0: e5932000 ldr r2, [r3] a4b4: e2822001 add r2, r2, #1 a4b8: e5832000 str r2, [r3] a4bc: e5913000 ldr r3, [r1] a4c0: e129f003 msr CPSR_fc, r3
} if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority(
a4c4: e3a02000 mov r2, #0 a4c8: e590104c ldr r1, [r0, #76] ; 0x4c a4cc: e590005c ldr r0, [r0, #92] ; 0x5c a4d0: ebfff17c bl 6ac8 <_Thread_Change_priority>
the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch();
a4d4: ebfff2e6 bl 7074 <_Thread_Enable_dispatch> a4d8: e3a00000 mov r0, #0 a4dc: e8bd8070 pop {r4, r5, r6, pc} a4e0: e5913000 ldr r3, [r1] a4e4: e129f003 msr CPSR_fc, r3 a4e8: e3a00000 mov r0, #0 a4ec: e8bd8070 pop {r4, r5, r6, pc} a4f0: 00019b80 .word 0x00019b80 a4f4: 00019acc .word 0x00019acc
0000a5e0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) {
a5e0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a5e4: 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;
a5e8: e5902010 ldr r2, [r0, #16]
Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) {
a5ec: e24dd01c sub sp, sp, #28 a5f0: 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 ) {
a5f4: e2911004 adds r1, r1, #4
Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) {
a5f8: 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 ) {
a5fc: e58d1000 str r1, [sp]
Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) {
a600: e1a0b003 mov fp, r3
return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next;
a604: e590a008 ldr sl, [r0, #8]
Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size;
a608: e58d200c str r2, [sp, #12]
uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { a60c: 2a000076 bcs a7ec <_Heap_Allocate_aligned_with_boundary+0x20c> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) {
a610: e3530000 cmp r3, #0
a614: 1a000072 bne a7e4 <_Heap_Allocate_aligned_with_boundary+0x204> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) {
a618: e157000a cmp r7, sl a61c: 03a06000 moveq r6, #0
a620: 0a000074 beq a7f8 <_Heap_Allocate_aligned_with_boundary+0x218> uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1;
a624: e59d300c ldr r3, [sp, #12]
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size;
a628: e2651004 rsb r1, r5, #4
uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1;
a62c: e2833007 add r3, r3, #7
if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) {
a630: e3a06000 mov r6, #0
uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1;
a634: e58d3010 str r3, [sp, #16]
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size;
a638: e58d1014 str r1, [sp, #20] a63c: ea000004 b a654 <_Heap_Allocate_aligned_with_boundary+0x74>
boundary ); } } if ( alloc_begin != 0 ) {
a640: e3540000 cmp r4, #0
a644: 1a000059 bne a7b0 <_Heap_Allocate_aligned_with_boundary+0x1d0> break; } block = block->next;
a648: e59aa008 ldr sl, [sl, #8]
if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) {
a64c: e157000a cmp r7, sl
a650: 0a000068 beq a7f8 <_Heap_Allocate_aligned_with_boundary+0x218> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) {
a654: e59a9004 ldr r9, [sl, #4] a658: e59d2000 ldr r2, [sp] a65c: e1520009 cmp r2, r9
while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count;
a660: 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 ) { a664: 2afffff7 bcs a648 <_Heap_Allocate_aligned_with_boundary+0x68> if ( alignment == 0 ) {
a668: 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;
a66c: 028a4008 addeq r4, sl, #8
a670: 0afffff2 beq a640 <_Heap_Allocate_aligned_with_boundary+0x60> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size;
a674: e59d1014 ldr r1, [sp, #20]
uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size;
a678: e3c99001 bic r9, r9, #1 a67c: e08a9009 add r9, sl, r9
uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size;
a680: e5973014 ldr r3, [r7, #20]
uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1;
a684: e59d2010 ldr r2, [sp, #16]
uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size;
a688: e0814009 add r4, r1, r9
uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size;
a68c: e58d3004 str r3, [sp, #4]
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment);
a690: e1a00004 mov r0, r4
uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1;
a694: e0633002 rsb r3, r3, r2 a698: e1a01008 mov r1, r8 a69c: e0839009 add r9, r3, r9 a6a0: eb002e53 bl 15ff4 <__umodsi3> a6a4: e0604004 rsb r4, r0, r4
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
a6a8: e28a3008 add r3, sl, #8
uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) {
a6ac: e1590004 cmp r9, r4 a6b0: e58d3008 str r3, [sp, #8]
a6b4: 2a000003 bcs a6c8 <_Heap_Allocate_aligned_with_boundary+0xe8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment);
a6b8: e1a00009 mov r0, r9 a6bc: e1a01008 mov r1, r8 a6c0: eb002e4b bl 15ff4 <__umodsi3> a6c4: e0604009 rsb r4, r0, r9
} alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) {
a6c8: e35b0000 cmp fp, #0
a6cc: 0a000025 beq a768 <_Heap_Allocate_aligned_with_boundary+0x188> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size;
a6d0: e0849005 add r9, r4, r5 a6d4: e1a00009 mov r0, r9 a6d8: e1a0100b mov r1, fp a6dc: eb002e44 bl 15ff4 <__umodsi3> a6e0: e0600009 rsb r0, r0, r9
/* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
a6e4: e1590000 cmp r9, r0 a6e8: 93a03000 movls r3, #0 a6ec: 83a03001 movhi r3, #1 a6f0: e1540000 cmp r4, r0 a6f4: 23a03000 movcs r3, #0 a6f8: e3530000 cmp r3, #0
a6fc: 0a000019 beq a768 <_Heap_Allocate_aligned_with_boundary+0x188> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
a700: e59d1008 ldr r1, [sp, #8] a704: e0819005 add r9, r1, r5
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) {
a708: e1590000 cmp r9, r0 a70c: 958d6018 strls r6, [sp, #24]
a710: 9a000002 bls a720 <_Heap_Allocate_aligned_with_boundary+0x140>
a714: eaffffcb b a648 <_Heap_Allocate_aligned_with_boundary+0x68> a718: e1590000 cmp r9, r0
a71c: 8a000037 bhi a800 <_Heap_Allocate_aligned_with_boundary+0x220> return 0; } alloc_begin = boundary_line - alloc_size;
a720: e0654000 rsb r4, r5, r0 a724: e1a01008 mov r1, r8 a728: e1a00004 mov r0, r4 a72c: eb002e30 bl 15ff4 <__umodsi3> a730: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size;
a734: e0846005 add r6, r4, r5 a738: e1a00006 mov r0, r6 a73c: e1a0100b mov r1, fp a740: eb002e2b bl 15ff4 <__umodsi3> a744: 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 ) {
a748: e1560000 cmp r6, r0 a74c: 93a03000 movls r3, #0 a750: 83a03001 movhi r3, #1 a754: e1540000 cmp r4, r0 a758: 23a03000 movcs r3, #0 a75c: e3530000 cmp r3, #0
a760: 1affffec bne a718 <_Heap_Allocate_aligned_with_boundary+0x138>
a764: 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 ) {
a768: e59d2008 ldr r2, [sp, #8] a76c: e1520004 cmp r2, r4
a770: 8affffb4 bhi a648 <_Heap_Allocate_aligned_with_boundary+0x68> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin;
a774: e59d100c ldr r1, [sp, #12] a778: e1a00004 mov r0, r4 a77c: eb002e1c bl 15ff4 <__umodsi3> a780: e26a94ff rsb r9, sl, #-16777216 ; 0xff000000 a784: e28998ff add r9, r9, #16711680 ; 0xff0000 a788: e2899cff add r9, r9, #65280 ; 0xff00 a78c: e28990f8 add r9, r9, #248 ; 0xf8 a790: e0899004 add r9, r9, r4
if ( free_size >= min_block_size || free_size == 0 ) {
a794: e59d1004 ldr r1, [sp, #4] a798: e0603009 rsb r3, r0, r9 a79c: e1590000 cmp r9, r0 a7a0: 11510003 cmpne r1, r3
a7a4: 8affffa7 bhi a648 <_Heap_Allocate_aligned_with_boundary+0x68> boundary ); } } if ( alloc_begin != 0 ) {
a7a8: e3540000 cmp r4, #0
a7ac: 0affffa5 beq a648 <_Heap_Allocate_aligned_with_boundary+0x68> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count;
a7b0: e597304c ldr r3, [r7, #76] ; 0x4c a7b4: e0833006 add r3, r3, r6 a7b8: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
a7bc: e1a0100a mov r1, sl a7c0: e1a03005 mov r3, r5 a7c4: e1a00007 mov r0, r7 a7c8: e1a02004 mov r2, r4 a7cc: ebffee37 bl 60b0 <_Heap_Block_allocate> a7d0: e1a00004 mov r0, r4
uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats;
a7d4: e5973044 ldr r3, [r7, #68] ; 0x44 a7d8: e1530006 cmp r3, r6
); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count;
a7dc: 35876044 strcc r6, [r7, #68] ; 0x44 a7e0: ea000002 b a7f0 <_Heap_Allocate_aligned_with_boundary+0x210>
/* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) {
a7e4: e1550003 cmp r5, r3
a7e8: 9a000006 bls a808 <_Heap_Allocate_aligned_with_boundary+0x228> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count;
a7ec: e3a00000 mov r0, #0
} return (void *) alloc_begin; }
a7f0: e28dd01c add sp, sp, #28 a7f4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) {
a7f8: e3a00000 mov r0, #0 a7fc: eafffff4 b a7d4 <_Heap_Allocate_aligned_with_boundary+0x1f4>
a800: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED a804: eaffff8f b a648 <_Heap_Allocate_aligned_with_boundary+0x68><== NOT EXECUTED
if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) {
a808: e3580000 cmp r8, #0 a80c: 01a08002 moveq r8, r2 a810: eaffff80 b a618 <_Heap_Allocate_aligned_with_boundary+0x38>
00006e40 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) {
6e40: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) {
6e44: e59f35d0 ldr r3, [pc, #1488] ; 741c <_Heap_Walk+0x5dc>
uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing;
6e48: e31200ff tst r2, #255 ; 0xff
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6e4c: e5933000 ldr r3, [r3]
uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing;
6e50: e59f25c8 ldr r2, [pc, #1480] ; 7420 <_Heap_Walk+0x5e0> 6e54: e59fa5c8 ldr sl, [pc, #1480] ; 7424 <_Heap_Walk+0x5e4> 6e58: 01a0a002 moveq sl, r2
if ( !_System_state_Is_up( _System_state_Get() ) ) {
6e5c: e3530003 cmp r3, #3
Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size;
6e60: e5902010 ldr r2, [r0, #16]
uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block;
6e64: e5903024 ldr r3, [r0, #36] ; 0x24
bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) {
6e68: e24dd038 sub sp, sp, #56 ; 0x38 6e6c: e1a04000 mov r4, r0 6e70: e1a08001 mov r8, r1
uintptr_t const page_size = heap->page_size;
6e74: e58d2020 str r2, [sp, #32]
uintptr_t const min_block_size = heap->min_block_size;
6e78: e590b014 ldr fp, [r0, #20]
Heap_Block *const last_block = heap->last_block;
6e7c: e58d3024 str r3, [sp, #36] ; 0x24
Heap_Block *block = heap->first_block;
6e80: e5905020 ldr r5, [r0, #32]
Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 6e84: 0a000002 beq 6e94 <_Heap_Walk+0x54> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) {
6e88: e3a00001 mov r0, #1
block = next_block; } return true; }
6e8c: e28dd038 add sp, sp, #56 ; 0x38 6e90: 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)(
6e94: e5900018 ldr r0, [r0, #24] 6e98: e594101c ldr r1, [r4, #28] 6e9c: e2842008 add r2, r4, #8 6ea0: e892000c ldm r2, {r2, r3} 6ea4: e59dc024 ldr ip, [sp, #36] ; 0x24 6ea8: e98d0003 stmib sp, {r0, r1} 6eac: e58d2014 str r2, [sp, #20] 6eb0: e58d3018 str r3, [sp, #24] 6eb4: e59f256c ldr r2, [pc, #1388] ; 7428 <_Heap_Walk+0x5e8> 6eb8: e58db000 str fp, [sp] 6ebc: e58d500c str r5, [sp, #12] 6ec0: e58dc010 str ip, [sp, #16] 6ec4: e1a00008 mov r0, r8 6ec8: e3a01000 mov r1, #0 6ecc: e59d3020 ldr r3, [sp, #32] 6ed0: e1a0e00f mov lr, pc 6ed4: e12fff1a bx sl
heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) {
6ed8: e59d2020 ldr r2, [sp, #32] 6edc: e3520000 cmp r2, #0
6ee0: 0a000032 beq 6fb0 <_Heap_Walk+0x170> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
6ee4: e59d3020 ldr r3, [sp, #32] 6ee8: e2139003 ands r9, r3, #3
6eec: 1a000036 bne 6fcc <_Heap_Walk+0x18c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
6ef0: e1a0000b mov r0, fp 6ef4: e59d1020 ldr r1, [sp, #32] 6ef8: ebffe746 bl c18 <__umodsi3> 6efc: e2506000 subs r6, r0, #0
6f00: 1a000038 bne 6fe8 <_Heap_Walk+0x1a8> ); return false; } if (
6f04: e2850008 add r0, r5, #8 6f08: e59d1020 ldr r1, [sp, #32] 6f0c: ebffe741 bl c18 <__umodsi3> 6f10: e2509000 subs r9, r0, #0
6f14: 1a00003b bne 7008 <_Heap_Walk+0x1c8> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED;
6f18: e5957004 ldr r7, [r5, #4]
); return false; } if ( !_Heap_Is_prev_used( first_block ) ) {
6f1c: e2176001 ands r6, r7, #1
6f20: 0a000040 beq 7028 <_Heap_Walk+0x1e8> ); return false; } if ( first_block->prev_size != page_size ) {
6f24: e5953000 ldr r3, [r5] 6f28: e59dc020 ldr ip, [sp, #32] 6f2c: e15c0003 cmp ip, r3
6f30: 1a000016 bne 6f90 <_Heap_Walk+0x150> ); return false; } if ( _Heap_Is_free( last_block ) ) {
6f34: e59d2024 ldr r2, [sp, #36] ; 0x24 6f38: e5923004 ldr r3, [r2, #4] 6f3c: e3c33001 bic r3, r3, #1 6f40: e0823003 add r3, r2, r3 6f44: e5939004 ldr r9, [r3, #4] 6f48: e2199001 ands r9, r9, #1
6f4c: 0a000112 beq 739c <_Heap_Walk+0x55c> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next;
6f50: e5949008 ldr r9, [r4, #8]
int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size;
6f54: e5943010 ldr r3, [r4, #16]
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) {
6f58: e1540009 cmp r4, r9
int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size;
6f5c: e58d3028 str r3, [sp, #40] ; 0x28
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 6f60: 0a00006c beq 7118 <_Heap_Walk+0x2d8> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block;
6f64: e594c020 ldr ip, [r4, #32]
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block
6f68: e15c0009 cmp ip, r9
6f6c: 9a000034 bls 7044 <_Heap_Walk+0x204> if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)(
6f70: e1a00008 mov r0, r8 6f74: e1a03009 mov r3, r9 6f78: e3a01001 mov r1, #1 6f7c: e59f24a8 ldr r2, [pc, #1192] ; 742c <_Heap_Walk+0x5ec> 6f80: e1a0e00f mov lr, pc 6f84: e12fff1a bx sl 6f88: e3a00000 mov r0, #0 6f8c: eaffffbe b 6e8c <_Heap_Walk+0x4c>
return false; } if ( first_block->prev_size != page_size ) { (*printer)(
6f90: e1a00008 mov r0, r8 6f94: e58dc000 str ip, [sp] 6f98: e3a01001 mov r1, #1 6f9c: e59f248c ldr r2, [pc, #1164] ; 7430 <_Heap_Walk+0x5f0> 6fa0: e1a0e00f mov lr, pc 6fa4: e12fff1a bx sl 6fa8: e1a00009 mov r0, r9 6fac: eaffffb6 b 6e8c <_Heap_Walk+0x4c>
first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" );
6fb0: e1a00008 mov r0, r8 6fb4: e3a01001 mov r1, #1 6fb8: e59f2474 ldr r2, [pc, #1140] ; 7434 <_Heap_Walk+0x5f4> 6fbc: e1a0e00f mov lr, pc 6fc0: e12fff1a bx sl 6fc4: e59d0020 ldr r0, [sp, #32] 6fc8: eaffffaf b 6e8c <_Heap_Walk+0x4c>
return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)(
6fcc: e1a00008 mov r0, r8 6fd0: e3a01001 mov r1, #1 6fd4: e59f245c ldr r2, [pc, #1116] ; 7438 <_Heap_Walk+0x5f8> 6fd8: e1a0e00f mov lr, pc 6fdc: e12fff1a bx sl 6fe0: e3a00000 mov r0, #0 6fe4: eaffffa8 b 6e8c <_Heap_Walk+0x4c>
return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)(
6fe8: e1a00008 mov r0, r8 6fec: e1a0300b mov r3, fp 6ff0: e3a01001 mov r1, #1 6ff4: e59f2440 ldr r2, [pc, #1088] ; 743c <_Heap_Walk+0x5fc> 6ff8: e1a0e00f mov lr, pc 6ffc: e12fff1a bx sl 7000: e1a00009 mov r0, r9 7004: eaffffa0 b 6e8c <_Heap_Walk+0x4c>
} if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)(
7008: e1a00008 mov r0, r8 700c: e1a03005 mov r3, r5 7010: e3a01001 mov r1, #1 7014: e59f2424 ldr r2, [pc, #1060] ; 7440 <_Heap_Walk+0x600> 7018: e1a0e00f mov lr, pc 701c: e12fff1a bx sl 7020: e1a00006 mov r0, r6 7024: eaffff98 b 6e8c <_Heap_Walk+0x4c>
return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)(
7028: e1a00008 mov r0, r8 702c: e3a01001 mov r1, #1 7030: e59f240c ldr r2, [pc, #1036] ; 7444 <_Heap_Walk+0x604> 7034: e1a0e00f mov lr, pc 7038: e12fff1a bx sl 703c: e1a00006 mov r0, r6 7040: eaffff91 b 6e8c <_Heap_Walk+0x4c>
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
7044: e5942024 ldr r2, [r4, #36] ; 0x24
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block
7048: e1520009 cmp r2, r9
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
704c: e58d202c str r2, [sp, #44] ; 0x2c
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 7050: 3affffc6 bcc 6f70 <_Heap_Walk+0x130> ); return false; } if (
7054: e2890008 add r0, r9, #8 7058: e1a01003 mov r1, r3 705c: e58dc01c str ip, [sp, #28] 7060: ebffe6ec bl c18 <__umodsi3> 7064: e3500000 cmp r0, #0 7068: e59dc01c ldr ip, [sp, #28]
706c: 1a0000d1 bne 73b8 <_Heap_Walk+0x578> ); return false; } if ( _Heap_Is_used( free_block ) ) {
7070: e5993004 ldr r3, [r9, #4] 7074: e3c33001 bic r3, r3, #1 7078: e0893003 add r3, r9, r3 707c: e5933004 ldr r3, [r3, #4] 7080: e3130001 tst r3, #1
7084: 1a0000dc bne 73fc <_Heap_Walk+0x5bc> ); return false; } if ( free_block->prev != prev_block ) {
7088: e599200c ldr r2, [r9, #12] 708c: e1540002 cmp r4, r2
7090: 1a0000d0 bne 73d8 <_Heap_Walk+0x598>
7094: e58d7030 str r7, [sp, #48] ; 0x30 7098: e58db034 str fp, [sp, #52] ; 0x34 709c: e59d702c ldr r7, [sp, #44] ; 0x2c 70a0: e59db028 ldr fp, [sp, #40] ; 0x28 70a4: e58d502c str r5, [sp, #44] ; 0x2c 70a8: e58d6028 str r6, [sp, #40] ; 0x28 70ac: e1a0600c mov r6, ip 70b0: ea000011 b 70fc <_Heap_Walk+0x2bc> 70b4: e1590006 cmp r9, r6
70b8: 3affffac bcc 6f70 <_Heap_Walk+0x130>
70bc: e1570009 cmp r7, r9
); return false; } if (
70c0: e2890008 add r0, r9, #8 70c4: e1a0100b mov r1, fp
70c8: 3affffa8 bcc 6f70 <_Heap_Walk+0x130>
70cc: ebffe6d1 bl c18 <__umodsi3> 70d0: e3500000 cmp r0, #0
70d4: 1a0000b7 bne 73b8 <_Heap_Walk+0x578> ); return false; } if ( _Heap_Is_used( free_block ) ) {
70d8: e5993004 ldr r3, [r9, #4] 70dc: e3c33001 bic r3, r3, #1 70e0: e0833009 add r3, r3, r9 70e4: e5933004 ldr r3, [r3, #4] 70e8: e3130001 tst r3, #1
70ec: 1a0000c2 bne 73fc <_Heap_Walk+0x5bc> ); return false; } if ( free_block->prev != prev_block ) {
70f0: e599200c ldr r2, [r9, #12] 70f4: e1520005 cmp r2, r5
70f8: 1a0000b6 bne 73d8 <_Heap_Walk+0x598> (*printer)(
70fc: e1a05009 mov r5, r9
return false; } prev_block = free_block; free_block = free_block->next;
7100: e5999008 ldr r9, [r9, #8]
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) {
7104: e1540009 cmp r4, r9
7108: 1affffe9 bne 70b4 <_Heap_Walk+0x274>
710c: e28d502c add r5, sp, #44 ; 0x2c 7110: e89508a0 ldm r5, {r5, r7, fp} 7114: e59d6028 ldr r6, [sp, #40] ; 0x28
if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) {
7118: e59d3024 ldr r3, [sp, #36] ; 0x24 711c: e1530005 cmp r3, r5
"block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""),
7120: 158db028 strne fp, [sp, #40] ; 0x28
if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 7124: 0affff57 beq 6e88 <_Heap_Walk+0x48> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
7128: e3c77001 bic r7, r7, #1
uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) {
712c: e21610ff ands r1, r6, #255 ; 0xff
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset);
7130: e0876005 add r6, r7, r5
7134: 0a000012 beq 7184 <_Heap_Walk+0x344> (*printer)(
7138: e1a03005 mov r3, r5 713c: e58d7000 str r7, [sp] 7140: e1a00008 mov r0, r8 7144: e3a01000 mov r1, #0 7148: e59f22f8 ldr r2, [pc, #760] ; 7448 <_Heap_Walk+0x608> 714c: e1a0e00f mov lr, pc 7150: e12fff1a bx sl
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block
7154: e5943020 ldr r3, [r4, #32] 7158: e1530006 cmp r3, r6
715c: 9a000013 bls 71b0 <_Heap_Walk+0x370> block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)(
7160: e1a00008 mov r0, r8 7164: e58d6000 str r6, [sp] 7168: e1a03005 mov r3, r5 716c: e3a01001 mov r1, #1 7170: e59f22d4 ldr r2, [pc, #724] ; 744c <_Heap_Walk+0x60c> 7174: e1a0e00f mov lr, pc 7178: e12fff1a bx sl 717c: e3a00000 mov r0, #0
"block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false;
7180: eaffff41 b 6e8c <_Heap_Walk+0x4c>
"block 0x%08x: size %u\n", block, block_size ); } else { (*printer)(
7184: e58d7000 str r7, [sp] 7188: e5953000 ldr r3, [r5] 718c: e1a00008 mov r0, r8 7190: e58d3004 str r3, [sp, #4] 7194: e59f22b4 ldr r2, [pc, #692] ; 7450 <_Heap_Walk+0x610> 7198: e1a03005 mov r3, r5 719c: e1a0e00f mov lr, pc 71a0: e12fff1a bx sl 71a4: e5943020 ldr r3, [r4, #32] 71a8: e1530006 cmp r3, r6
71ac: 8affffeb bhi 7160 <_Heap_Walk+0x320>
71b0: e5943024 ldr r3, [r4, #36] ; 0x24 71b4: e1530006 cmp r3, r6
71b8: 3affffe8 bcc 7160 <_Heap_Walk+0x320> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) {
71bc: e1a00007 mov r0, r7 71c0: e59d1020 ldr r1, [sp, #32] 71c4: ebffe693 bl c18 <__umodsi3> 71c8: e2509000 subs r9, r0, #0
71cc: 1a000055 bne 7328 <_Heap_Walk+0x4e8> ); return false; } if ( block_size < min_block_size ) {
71d0: e59d3028 ldr r3, [sp, #40] ; 0x28 71d4: e1530007 cmp r3, r7
71d8: 8a00005b bhi 734c <_Heap_Walk+0x50c> ); return false; } if ( next_block_begin <= block_begin ) {
71dc: e1550006 cmp r5, r6
71e0: 2a000064 bcs 7378 <_Heap_Walk+0x538> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) {
71e4: e5963004 ldr r3, [r6, #4] 71e8: e3130001 tst r3, #1
71ec: 1a000036 bne 72cc <_Heap_Walk+0x48c> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED;
71f0: e595b004 ldr fp, [r5, #4]
Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)(
71f4: e595200c ldr r2, [r5, #12]
return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next;
71f8: e5943008 ldr r3, [r4, #8]
- HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
71fc: e3cb7001 bic r7, fp, #1
return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next;
7200: e1530002 cmp r3, r2
} RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev;
7204: e594100c ldr r1, [r4, #12]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset);
7208: e0859007 add r9, r5, r7
return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next;
720c: 059f0240 ldreq r0, [pc, #576] ; 7454 <_Heap_Walk+0x614>
7210: 0a000003 beq 7224 <_Heap_Walk+0x3e4> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""),
7214: e59fc23c ldr ip, [pc, #572] ; 7458 <_Heap_Walk+0x618> 7218: e1520004 cmp r2, r4 721c: e59f0238 ldr r0, [pc, #568] ; 745c <_Heap_Walk+0x61c> 7220: 11a0000c movne r0, ip
Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)(
7224: e5953008 ldr r3, [r5, #8] 7228: e1510003 cmp r1, r3 722c: 059f122c ldreq r1, [pc, #556] ; 7460 <_Heap_Walk+0x620>
7230: 0a000003 beq 7244 <_Heap_Walk+0x404> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "")
7234: e59fc21c ldr ip, [pc, #540] ; 7458 <_Heap_Walk+0x618> 7238: e1530004 cmp r3, r4 723c: e59f1220 ldr r1, [pc, #544] ; 7464 <_Heap_Walk+0x624> 7240: 11a0100c movne r1, ip
Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)(
7244: e58d2000 str r2, [sp] 7248: e98d0009 stmib sp, {r0, r3} 724c: e58d100c str r1, [sp, #12] 7250: e1a03005 mov r3, r5 7254: e1a00008 mov r0, r8 7258: e3a01000 mov r1, #0 725c: e59f2204 ldr r2, [pc, #516] ; 7468 <_Heap_Walk+0x628> 7260: e1a0e00f mov lr, pc 7264: e12fff1a bx sl
block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) {
7268: e5993000 ldr r3, [r9] 726c: e1570003 cmp r7, r3
7270: 0a00000a beq 72a0 <_Heap_Walk+0x460> (*printer)(
7274: e58d3004 str r3, [sp, #4] 7278: e1a00008 mov r0, r8 727c: e58d7000 str r7, [sp] 7280: e58d9008 str r9, [sp, #8] 7284: e1a03005 mov r3, r5 7288: e3a01001 mov r1, #1 728c: e59f21d8 ldr r2, [pc, #472] ; 746c <_Heap_Walk+0x62c> 7290: e1a0e00f mov lr, pc 7294: e12fff1a bx sl 7298: e3a00000 mov r0, #0 729c: eafffefa b 6e8c <_Heap_Walk+0x4c>
); return false; } if ( !prev_used ) {
72a0: e21b9001 ands r9, fp, #1
72a4: 0a000017 beq 7308 <_Heap_Walk+0x4c8>
72a8: 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 ) {
72ac: e1530004 cmp r3, r4
72b0: 1a000003 bne 72c4 <_Heap_Walk+0x484>
72b4: ea00000b b 72e8 <_Heap_Walk+0x4a8> <== NOT EXECUTED
if ( free_block == block ) { return true; } free_block = free_block->next;
72b8: 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 ) {
72bc: e1530004 cmp r3, r4
72c0: 0a000008 beq 72e8 <_Heap_Walk+0x4a8> if ( free_block == block ) {
72c4: e1530005 cmp r3, r5
72c8: 1afffffa bne 72b8 <_Heap_Walk+0x478> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) {
72cc: e59d2024 ldr r2, [sp, #36] ; 0x24 72d0: e1520006 cmp r2, r6
72d4: 0afffeeb beq 6e88 <_Heap_Walk+0x48> const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) {
72d8: e5967004 ldr r7, [r6, #4] 72dc: e1a05006 mov r5, r6 72e0: e2076001 and r6, r7, #1 72e4: eaffff8f b 7128 <_Heap_Walk+0x2e8>
return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)(
72e8: e1a00008 mov r0, r8 72ec: e1a03005 mov r3, r5 72f0: e3a01001 mov r1, #1 72f4: e59f2174 ldr r2, [pc, #372] ; 7470 <_Heap_Walk+0x630> 72f8: e1a0e00f mov lr, pc 72fc: e12fff1a bx sl 7300: e3a00000 mov r0, #0 7304: eafffee0 b 6e8c <_Heap_Walk+0x4c>
return false; } if ( !prev_used ) { (*printer)(
7308: e1a00008 mov r0, r8 730c: e1a03005 mov r3, r5 7310: e3a01001 mov r1, #1 7314: e59f2158 ldr r2, [pc, #344] ; 7474 <_Heap_Walk+0x634> 7318: e1a0e00f mov lr, pc 731c: e12fff1a bx sl 7320: e1a00009 mov r0, r9 7324: eafffed8 b 6e8c <_Heap_Walk+0x4c>
return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)(
7328: e1a00008 mov r0, r8 732c: e58d7000 str r7, [sp] 7330: e1a03005 mov r3, r5 7334: e3a01001 mov r1, #1 7338: e59f2138 ldr r2, [pc, #312] ; 7478 <_Heap_Walk+0x638> 733c: e1a0e00f mov lr, pc 7340: e12fff1a bx sl 7344: e3a00000 mov r0, #0
"block 0x%08x: block size %u not page aligned\n", block, block_size ); return false;
7348: eafffecf b 6e8c <_Heap_Walk+0x4c>
} if ( block_size < min_block_size ) { (*printer)(
734c: e58d3004 str r3, [sp, #4] 7350: e1a00008 mov r0, r8 7354: e1a0b003 mov fp, r3 7358: e58d7000 str r7, [sp] 735c: e1a03005 mov r3, r5 7360: e3a01001 mov r1, #1 7364: e59f2110 ldr r2, [pc, #272] ; 747c <_Heap_Walk+0x63c> 7368: e1a0e00f mov lr, pc 736c: e12fff1a bx sl 7370: e1a00009 mov r0, r9
block, block_size, min_block_size ); return false;
7374: eafffec4 b 6e8c <_Heap_Walk+0x4c>
} if ( next_block_begin <= block_begin ) { (*printer)(
7378: e1a00008 mov r0, r8 737c: e58d6000 str r6, [sp] 7380: e1a03005 mov r3, r5 7384: e3a01001 mov r1, #1 7388: e59f20f0 ldr r2, [pc, #240] ; 7480 <_Heap_Walk+0x640> 738c: e1a0e00f mov lr, pc 7390: e12fff1a bx sl 7394: e1a00009 mov r0, r9
"block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false;
7398: eafffebb b 6e8c <_Heap_Walk+0x4c>
return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)(
739c: e1a00008 mov r0, r8 73a0: e3a01001 mov r1, #1 73a4: e59f20d8 ldr r2, [pc, #216] ; 7484 <_Heap_Walk+0x644> 73a8: e1a0e00f mov lr, pc 73ac: e12fff1a bx sl 73b0: e1a00009 mov r0, r9 73b4: eafffeb4 b 6e8c <_Heap_Walk+0x4c>
} if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)(
73b8: e1a00008 mov r0, r8 73bc: e1a03009 mov r3, r9 73c0: e3a01001 mov r1, #1 73c4: e59f20bc ldr r2, [pc, #188] ; 7488 <_Heap_Walk+0x648> 73c8: e1a0e00f mov lr, pc 73cc: e12fff1a bx sl 73d0: e3a00000 mov r0, #0 73d4: eafffeac b 6e8c <_Heap_Walk+0x4c>
return false; } if ( free_block->prev != prev_block ) { (*printer)(
73d8: e58d2000 str r2, [sp] 73dc: e1a00008 mov r0, r8 73e0: e1a03009 mov r3, r9 73e4: e3a01001 mov r1, #1 73e8: e59f209c ldr r2, [pc, #156] ; 748c <_Heap_Walk+0x64c> 73ec: e1a0e00f mov lr, pc 73f0: e12fff1a bx sl 73f4: e3a00000 mov r0, #0 73f8: eafffea3 b 6e8c <_Heap_Walk+0x4c>
return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)(
73fc: e1a00008 mov r0, r8 7400: e1a03009 mov r3, r9 7404: e3a01001 mov r1, #1 7408: e59f2080 ldr r2, [pc, #128] ; 7490 <_Heap_Walk+0x650> 740c: e1a0e00f mov lr, pc 7410: e12fff1a bx sl 7414: e3a00000 mov r0, #0 7418: eafffe9b b 6e8c <_Heap_Walk+0x4c> 741c: 0001c410 .word 0x0001c410 7420: 00006e34 .word 0x00006e34 7424: 00007494 .word 0x00007494 7428: 0001a45c .word 0x0001a45c 742c: 0001a5f0 .word 0x0001a5f0 7430: 0001a5ac .word 0x0001a5ac 7434: 0001a4f0 .word 0x0001a4f0 7438: 0001a504 .word 0x0001a504 743c: 0001a524 .word 0x0001a524 7440: 0001a548 .word 0x0001a548 7444: 0001a57c .word 0x0001a57c 7448: 0001a690 .word 0x0001a690 744c: 0001a6d0 .word 0x0001a6d0 7450: 0001a6a8 .word 0x0001a6a8 7454: 0001a790 .word 0x0001a790 7458: 0001a824 .word 0x0001a824 745c: 0001a79c .word 0x0001a79c 7460: 0001a7a8 .word 0x0001a7a8 7464: 0001a7b4 .word 0x0001a7b4 7468: 0001a7c0 .word 0x0001a7c0 746c: 0001a7ec .word 0x0001a7ec 7470: 0001a858 .word 0x0001a858 7474: 0001a828 .word 0x0001a828 7478: 0001a700 .word 0x0001a700 747c: 0001a730 .word 0x0001a730 7480: 0001a75c .word 0x0001a75c 7484: 0001a5d8 .word 0x0001a5d8 7488: 0001a610 .word 0x0001a610 748c: 0001a65c .word 0x0001a65c 7490: 0001a640 .word 0x0001a640
00006320 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) {
6320: 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 )
6324: e5908034 ldr r8, [r0, #52] ; 0x34 6328: e3580000 cmp r8, #0
*/ void _Objects_Extend_information( Objects_Information *information ) {
632c: e24dd014 sub sp, sp, #20 6330: e1a05000 mov r5, r0
/* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id );
6334: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 6338: 0a00009c beq 65b0 <_Objects_Extend_information+0x290> block_count = 0; else { block_count = information->maximum / information->allocation_size;
633c: e1d091b4 ldrh r9, [r0, #20] 6340: e1d0a1b0 ldrh sl, [r0, #16] 6344: e1a01009 mov r1, r9 6348: e1a0000a mov r0, sl 634c: eb003ee4 bl 15ee4 <__aeabi_uidiv> 6350: e1a03800 lsl r3, r0, #16
for ( ; block < block_count; block++ ) {
6354: e1b03823 lsrs r3, r3, #16 6358: 01a01009 moveq r1, r9 635c: 01a06007 moveq r6, r7 6360: 01a04003 moveq r4, r3
6364: 0a00000f beq 63a8 <_Objects_Extend_information+0x88> if ( information->object_blocks[ block ] == NULL )
6368: e5984000 ldr r4, [r8] 636c: e3540000 cmp r4, #0 6370: 11a01009 movne r1, r9 6374: 11a06007 movne r6, r7 6378: 13a04000 movne r4, #0 637c: 01a01009 moveq r1, r9 6380: 01a06007 moveq r6, r7
6384: 1a000003 bne 6398 <_Objects_Extend_information+0x78>
6388: ea000006 b 63a8 <_Objects_Extend_information+0x88> <== NOT EXECUTED
638c: e7982104 ldr r2, [r8, r4, lsl #2] 6390: e3520000 cmp r2, #0
6394: 0a000003 beq 63a8 <_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++ ) {
6398: e2844001 add r4, r4, #1 639c: e1530004 cmp r3, r4
if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size;
63a0: e0866009 add r6, r6, r9
if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 63a4: 8afffff8 bhi 638c <_Objects_Extend_information+0x6c> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size;
63a8: 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 ) {
63ac: e35a0801 cmp sl, #65536 ; 0x10000
63b0: 2a000064 bcs 6548 <_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 ) {
63b4: e5d50012 ldrb r0, [r5, #18]
/* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size;
63b8: e5952018 ldr r2, [r5, #24]
if ( information->auto_extend ) {
63bc: e3500000 cmp r0, #0
/* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size;
63c0: e0000192 mul r0, r2, r1
if ( information->auto_extend ) { 63c4: 1a000061 bne 6550 <_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 );
63c8: e58d3000 str r3, [sp] 63cc: eb00080b bl 8400 <_Workspace_Allocate_or_fatal_error> 63d0: e59d3000 ldr r3, [sp] 63d4: e1a09000 mov r9, r0
} /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) {
63d8: e1d521b0 ldrh r2, [r5, #16] 63dc: e1560002 cmp r6, r2
63e0: 3a000038 bcc 64c8 <_Objects_Extend_information+0x1a8> */ /* * Up the block count and maximum */ block_count++;
63e4: e283c001 add ip, r3, #1
* Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size );
63e8: e08c008c add r0, ip, ip, lsl #1 63ec: e08a0000 add r0, sl, r0 63f0: e0800007 add r0, r0, r7 63f4: e1a00100 lsl r0, r0, #2 63f8: e88d1008 stm sp, {r3, ip} 63fc: eb00080b bl 8430 <_Workspace_Allocate>
if ( !object_blocks ) {
6400: e250b000 subs fp, r0, #0 6404: e89d1008 ldm sp, {r3, ip}
6408: 0a00006e beq 65c8 <_Objects_Extend_information+0x2a8> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) {
640c: e1d521b0 ldrh r2, [r5, #16] 6410: e1570002 cmp r7, r2
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset);
6414: e08b818c add r8, fp, ip, lsl #3 6418: e08bc10c add ip, fp, ip, lsl #2
641c: 3a000051 bcc 6568 <_Objects_Extend_information+0x248> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) {
6420: e3570000 cmp r7, #0
information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table,
6424: 13a02000 movne r2, #0
/* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL;
6428: 11a01002 movne r1, r2
} else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 642c: 0a000003 beq 6440 <_Objects_Extend_information+0x120> local_table[ index ] = NULL;
6430: e7881102 str r1, [r8, r2, lsl #2]
} else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) {
6434: e2822001 add r2, r2, #1 6438: e1570002 cmp r7, r2
643c: 8afffffb bhi 6430 <_Objects_Extend_information+0x110>
6440: 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 );
6444: e1d511b4 ldrh r1, [r5, #20] 6448: e0861001 add r1, r6, r1
} /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL;
644c: e3a00000 mov r0, #0
inactive_per_block[block_count] = 0; for ( index=index_base ;
6450: e1560001 cmp r6, r1
/* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0;
6454: e78c0003 str r0, [ip, r3]
} /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL;
6458: e78b0003 str r0, [fp, r3]
inactive_per_block[block_count] = 0; for ( index=index_base ; 645c: 2a000005 bcs 6478 <_Objects_Extend_information+0x158>
6460: e0882106 add r2, r8, r6, lsl #2 6464: e1a03006 mov r3, r6
index < ( information->allocation_size + index_base ); index++ ) {
6468: 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 ;
646c: e1530001 cmp r3, r1
index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL;
6470: 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 ; 6474: 3afffffb bcc 6468 <_Objects_Extend_information+0x148>
6478: e10f3000 mrs r3, CPSR 647c: e3832080 orr r2, r3, #128 ; 0x80 6480: e129f002 msr CPSR_fc, r2
information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id(
6484: e5952000 ldr r2, [r5] 6488: e1d510b4 ldrh r1, [r5, #4] 648c: e1a02c02 lsl r2, r2, #24
old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum;
6490: e1a0a80a lsl sl, sl, #16
information->maximum_id = _Objects_Build_id(
6494: e3822801 orr r2, r2, #65536 ; 0x10000
old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum;
6498: e1a0a82a lsr sl, sl, #16
information->maximum_id = _Objects_Build_id(
649c: e1822d81 orr r2, r2, r1, lsl #27 64a0: e182200a orr r2, r2, sl
local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks;
64a4: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block;
64a8: e585c030 str ip, [r5, #48] ; 0x30
information->local_table = local_table;
64ac: e585801c str r8, [r5, #28]
information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id(
64b0: e585200c str r2, [r5, #12]
old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum;
64b4: e1c5a1b0 strh sl, [r5, #16]
_ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks;
64b8: e585b034 str fp, [r5, #52] ; 0x34
static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
64bc: e129f003 msr CPSR_fc, r3
information->maximum ); _ISR_Enable( level ); if ( old_tables )
64c0: e3500000 cmp r0, #0
_Workspace_Free( old_tables );
64c4: 1b0007df blne 8448 <_Workspace_Free>
} /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block;
64c8: e5953034 ldr r3, [r5, #52] ; 0x34
/* * Initialize objects .. add to a local chain first. */ _Chain_Initialize(
64cc: e28d7008 add r7, sp, #8
} /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block;
64d0: e7839104 str r9, [r3, r4, lsl #2]
/* * Initialize objects .. add to a local chain first. */ _Chain_Initialize(
64d4: e1a01009 mov r1, r9 64d8: e1a00007 mov r0, r7 64dc: e1d521b4 ldrh r2, [r5, #20] 64e0: e5953018 ldr r3, [r5, #24] 64e4: eb000f9b bl a358 <_Chain_Initialize>
} /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block;
64e8: e1a04104 lsl r4, r4, #2
information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node );
64ec: 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 ) {
64f0: ea000008 b 6518 <_Objects_Extend_information+0x1f8>
the_object->id = _Objects_Build_id(
64f4: e5952000 ldr r2, [r5] 64f8: e1d5c0b4 ldrh ip, [r5, #4] 64fc: e1a02c02 lsl r2, r2, #24 6500: e3822801 orr r2, r2, #65536 ; 0x10000 6504: e1822d8c orr r2, r2, ip, lsl #27 6508: e1822006 orr r2, r2, r6 650c: e5832008 str r2, [r3, #8]
information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node );
6510: ebfffd18 bl 5978 <_Chain_Append>
index++;
6514: 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 ) {
6518: e1a00007 mov r0, r7 651c: ebfffd20 bl 59a4 <_Chain_Get> 6520: e2503000 subs r3, r0, #0
information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node );
6524: e1a01003 mov r1, r3 6528: e1a00008 mov r0, r8
/* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 652c: 1afffff0 bne 64f4 <_Objects_Extend_information+0x1d4> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size;
6530: e1d531b4 ldrh r3, [r5, #20]
information->inactive =
6534: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size;
6538: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
653c: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size;
6540: e7813004 str r3, [r1, r4]
information->inactive =
6544: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size); }
6548: e28dd014 add sp, sp, #20 654c: 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 );
6550: e58d3000 str r3, [sp] 6554: eb0007b5 bl 8430 <_Workspace_Allocate>
if ( !new_object_block )
6558: e2509000 subs r9, r0, #0 655c: e59d3000 ldr r3, [sp]
6560: 1affff9c bne 63d8 <_Objects_Extend_information+0xb8>
6564: eafffff7 b 6548 <_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,
6568: e1a03103 lsl r3, r3, #2 656c: e1a02003 mov r2, r3 6570: e5951034 ldr r1, [r5, #52] ; 0x34 6574: e88d1008 stm sp, {r3, ip} 6578: eb001af4 bl d150 <memcpy>
information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block,
657c: e89d1008 ldm sp, {r3, ip} 6580: e1a0000c mov r0, ip 6584: e1a02003 mov r2, r3 6588: e5951030 ldr r1, [r5, #48] ; 0x30 658c: eb001aef bl d150 <memcpy>
information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table,
6590: e1d521b0 ldrh r2, [r5, #16] 6594: e0872002 add r2, r7, r2 6598: e1a02102 lsl r2, r2, #2 659c: e1a00008 mov r0, r8 65a0: e595101c ldr r1, [r5, #28] 65a4: eb001ae9 bl d150 <memcpy> 65a8: e89d1008 ldm sp, {r3, ip} 65ac: eaffffa4 b 6444 <_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 )
65b0: e1a04008 mov r4, r8 65b4: e1d0a1b0 ldrh sl, [r0, #16] 65b8: e1d011b4 ldrh r1, [r0, #20] 65bc: e1a06007 mov r6, r7 65c0: e1a03008 mov r3, r8 65c4: eaffff77 b 63a8 <_Objects_Extend_information+0x88>
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block );
65c8: e1a00009 mov r0, r9 65cc: eb00079d bl 8448 <_Workspace_Free>
return;
65d0: eaffffdc b 6548 <_Objects_Extend_information+0x228>
000075f8 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority;
75f8: e5913014 ldr r3, [r1, #20]
Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) {
75fc: e92d05f0 push {r4, r5, r6, r7, r8, sl}
_Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ];
7600: e1a0c323 lsr ip, r3, #6
*/ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain);
7604: e281503c add r5, r1, #60 ; 0x3c 7608: e08cc08c add ip, ip, ip, lsl #1
block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) )
760c: e3130020 tst r3, #32
the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain);
7610: e2814038 add r4, r1, #56 ; 0x38
*/ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain);
7614: e5815038 str r5, [r1, #56] ; 0x38
the_chain->permanent_null = NULL;
7618: e3a05000 mov r5, #0 761c: e581503c str r5, [r1, #60] ; 0x3c
the_chain->last = _Chain_Head(the_chain);
7620: e5814040 str r4, [r1, #64] ; 0x40
_Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ];
7624: e080c10c add ip, r0, ip, lsl #2
block_state = the_thread_queue->state;
7628: e5906038 ldr r6, [r0, #56] ; 0x38 762c: 159fa178 ldrne sl, [pc, #376] ; 77ac <_Thread_queue_Enqueue_priority+0x1b4>
if ( _Thread_queue_Is_reverse_search( priority ) ) 7630: 1a00001c bne 76a8 <_Thread_queue_Enqueue_priority+0xb0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null;
7634: e28ca004 add sl, ip, #4
static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile (
7638: e10f8000 mrs r8, CPSR 763c: e3884080 orr r4, r8, #128 ; 0x80 7640: e129f004 msr CPSR_fc, r4
goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first;
7644: e59c4000 ldr r4, [ip]
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7648: e154000a cmp r4, sl
764c: 1a000009 bne 7678 <_Thread_queue_Enqueue_priority+0x80>
7650: ea000052 b 77a0 <_Thread_queue_Enqueue_priority+0x1a8>
static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile (
7654: e10f7000 mrs r7, CPSR 7658: e129f008 msr CPSR_fc, r8 765c: e129f007 msr CPSR_fc, r7
search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) {
7660: e5947010 ldr r7, [r4, #16] 7664: e1160007 tst r6, r7
7668: 0a000033 beq 773c <_Thread_queue_Enqueue_priority+0x144> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next;
766c: e5944000 ldr r4, [r4]
restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7670: e154000a cmp r4, sl
7674: 0a000002 beq 7684 <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority;
7678: e5945014 ldr r5, [r4, #20]
if ( priority <= search_priority )
767c: e1530005 cmp r3, r5
7680: 8afffff3 bhi 7654 <_Thread_queue_Enqueue_priority+0x5c> restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
7684: e1a06008 mov r6, r8
} search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state !=
7688: e590c030 ldr ip, [r0, #48] ; 0x30 768c: e35c0001 cmp ip, #1
7690: 0a00002b beq 7744 <_Thread_queue_Enqueue_priority+0x14c> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level;
7694: e5826000 str r6, [r2]
return the_thread_queue->sync_state;
7698: e1a0000c mov r0, ip
}
769c: e8bd05f0 pop {r4, r5, r6, r7, r8, sl} 76a0: e12fff1e bx lr
static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
76a4: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED
the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1;
76a8: e5da5000 ldrb r5, [sl] 76ac: e2855001 add r5, r5, #1
static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile (
76b0: e10f8000 mrs r8, CPSR 76b4: e3884080 orr r4, r8, #128 ; 0x80 76b8: e129f004 msr CPSR_fc, r4
_ISR_Disable( level ); search_thread = (Thread_Control *) header->last;
76bc: e59c4008 ldr r4, [ip, #8]
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
76c0: e154000c cmp r4, ip
76c4: 1a000009 bne 76f0 <_Thread_queue_Enqueue_priority+0xf8>
76c8: ea00000b b 76fc <_Thread_queue_Enqueue_priority+0x104>
static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile (
76cc: e10f7000 mrs r7, CPSR 76d0: e129f008 msr CPSR_fc, r8 76d4: e129f007 msr CPSR_fc, r7
search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) {
76d8: e5947010 ldr r7, [r4, #16] 76dc: e1160007 tst r6, r7
76e0: 0affffef beq 76a4 <_Thread_queue_Enqueue_priority+0xac> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *)
76e4: e5944004 ldr r4, [r4, #4]
restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
76e8: e154000c cmp r4, ip
76ec: 0a000002 beq 76fc <_Thread_queue_Enqueue_priority+0x104> search_priority = search_thread->current_priority;
76f0: e5945014 ldr r5, [r4, #20]
if ( priority >= search_priority )
76f4: e1530005 cmp r3, r5
76f8: 3afffff3 bcc 76cc <_Thread_queue_Enqueue_priority+0xd4> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state !=
76fc: e590c030 ldr ip, [r0, #48] ; 0x30 7700: e35c0001 cmp ip, #1
restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
7704: e1a06008 mov r6, r8
} search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 7708: 1affffe1 bne 7694 <_Thread_queue_Enqueue_priority+0x9c> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority )
770c: e1530005 cmp r3, r5
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7710: e3a03000 mov r3, #0 7714: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority ) 7718: 0a000016 beq 7778 <_Thread_queue_Enqueue_priority+0x180> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next;
771c: e5943000 ldr r3, [r4]
the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node;
7720: e8810018 stm r1, {r3, r4}
search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue;
7724: e5810044 str r0, [r1, #68] ; 0x44
next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node;
7728: e5841000 str r1, [r4]
next_node->previous = the_node;
772c: e5831004 str r1, [r3, #4]
static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
7730: e129f008 msr CPSR_fc, r8 7734: e3a00001 mov r0, #1
the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7738: eaffffd7 b 769c <_Thread_queue_Enqueue_priority+0xa4>
773c: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED 7740: eaffffbc b 7638 <_Thread_queue_Enqueue_priority+0x40> <== NOT EXECUTED
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority )
7744: e1530005 cmp r3, r5
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
7748: e3a03000 mov r3, #0 774c: e5803030 str r3, [r0, #48] ; 0x30
if ( priority == search_priority ) 7750: 0a000008 beq 7778 <_Thread_queue_Enqueue_priority+0x180> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous;
7754: e5943004 ldr r3, [r4, #4]
the_node = (Chain_Node *) the_thread; the_node->next = search_node;
7758: e5814000 str r4, [r1]
the_node->previous = previous_node;
775c: e5813004 str r3, [r1, #4]
previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue;
7760: e5810044 str r0, [r1, #68] ; 0x44
previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node;
7764: e5831000 str r1, [r3]
search_node->previous = the_node;
7768: e5841004 str r1, [r4, #4] 776c: e129f008 msr CPSR_fc, r8 7770: e3a00001 mov r0, #1
the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
7774: eaffffc8 b 769c <_Thread_queue_Enqueue_priority+0xa4> 7778: e284403c add r4, r4, #60 ; 0x3c
_ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous;
777c: e5943004 ldr r3, [r4, #4]
the_node = (Chain_Node *) the_thread; the_node->next = search_node;
7780: e5814000 str r4, [r1]
the_node->previous = previous_node;
7784: e5813004 str r3, [r1, #4]
previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue;
7788: e5810044 str r0, [r1, #68] ; 0x44
previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node;
778c: e5831000 str r1, [r3]
search_node->previous = the_node;
7790: e5841004 str r1, [r4, #4] 7794: e129f006 msr CPSR_fc, r6 7798: e3a00001 mov r0, #1
the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
779c: eaffffbe b 769c <_Thread_queue_Enqueue_priority+0xa4>
restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
77a0: e1a06008 mov r6, r8 77a4: e3e05000 mvn r5, #0 77a8: eaffffb6 b 7688 <_Thread_queue_Enqueue_priority+0x90> 77ac: 00018280 .word 0x00018280
000162d0 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) {
162d0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 162d4: e24dd024 sub sp, sp, #36 ; 0x24 162d8: e28d700c add r7, sp, #12 162dc: e28d2018 add r2, sp, #24 162e0: e1a04000 mov r4, r0
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL;
162e4: e3a03000 mov r3, #0
*/ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null;
162e8: e282a004 add sl, r2, #4 162ec: e2872004 add r2, r7, #4 162f0: e58d2000 str r2, [sp]
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL;
162f4: e58d301c str r3, [sp, #28]
the_chain->last = _Chain_Head(the_chain);
162f8: e28d0018 add r0, sp, #24
*/ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain);
162fc: e58d200c str r2, [sp, #12]
the_chain->permanent_null = NULL;
16300: e58d3010 str r3, [sp, #16]
static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16304: e2842008 add r2, r4, #8
static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16308: e2843040 add r3, r4, #64 ; 0x40
*/ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain);
1630c: e58da018 str sl, [sp, #24]
the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain);
16310: e58d0020 str r0, [sp, #32] 16314: e58d7014 str r7, [sp, #20] 16318: e59f91a0 ldr r9, [pc, #416] ; 164c0 <_Timer_server_Body+0x1f0> 1631c: e59fb1a0 ldr fp, [pc, #416] ; 164c4 <_Timer_server_Body+0x1f4>
static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16320: e58d2008 str r2, [sp, #8]
static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16324: e58d3004 str r3, [sp, #4]
*/ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16328: e2846030 add r6, r4, #48 ; 0x30
/* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
1632c: e2848068 add r8, r4, #104 ; 0x68
{ /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain;
16330: e28d0018 add r0, sp, #24 16334: e5840078 str r0, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
16338: e5993000 ldr r3, [r9]
/* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
1633c: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16340: e1a00006 mov r0, r6 16344: e0611003 rsb r1, r1, r3
/* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot;
16348: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
1634c: e1a02007 mov r2, r7 16350: eb0010a8 bl 1a5f8 <_Watchdog_Adjust_to_chain>
static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
16354: e59b5000 ldr r5, [fp]
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
16358: e5941074 ldr r1, [r4, #116] ; 0x74
/* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) {
1635c: e1550001 cmp r5, r1
16360: 8a000022 bhi 163f0 <_Timer_server_Body+0x120> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 16364: 3a000018 bcc 163cc <_Timer_server_Body+0xfc> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot;
16368: e5845074 str r5, [r4, #116] ; 0x74
} static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
1636c: e5940078 ldr r0, [r4, #120] ; 0x78 16370: eb000249 bl 16c9c <_Chain_Get>
if ( timer == NULL ) {
16374: e3500000 cmp r0, #0
16378: 0a00000b beq 163ac <_Timer_server_Body+0xdc> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
1637c: e5903038 ldr r3, [r0, #56] ; 0x38 16380: e3530001 cmp r3, #1
16384: 0a000015 beq 163e0 <_Timer_server_Body+0x110> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
16388: e3530003 cmp r3, #3
1638c: 1afffff6 bne 1636c <_Timer_server_Body+0x9c> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
16390: e2801010 add r1, r0, #16 16394: e1a00008 mov r0, r8 16398: eb0010c5 bl 1a6b4 <_Watchdog_Insert>
} static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
1639c: e5940078 ldr r0, [r4, #120] ; 0x78 163a0: eb00023d bl 16c9c <_Chain_Get>
if ( timer == NULL ) {
163a4: e3500000 cmp r0, #0
163a8: 1afffff3 bne 1637c <_Timer_server_Body+0xac> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile (
163ac: e10f2000 mrs r2, CPSR 163b0: e3823080 orr r3, r2, #128 ; 0x80 163b4: e129f003 msr CPSR_fc, r3
* body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) {
163b8: e59d3018 ldr r3, [sp, #24] 163bc: e15a0003 cmp sl, r3
163c0: 0a00000f beq 16404 <_Timer_server_Body+0x134> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
163c4: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED 163c8: eaffffda b 16338 <_Timer_server_Body+0x68> <== NOT EXECUTED
/* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
163cc: e0652001 rsb r2, r5, r1 163d0: e1a00008 mov r0, r8 163d4: e3a01001 mov r1, #1 163d8: eb001057 bl 1a53c <_Watchdog_Adjust> 163dc: eaffffe1 b 16368 <_Timer_server_Body+0x98>
Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
163e0: e2801010 add r1, r0, #16 163e4: e1a00006 mov r0, r6 163e8: eb0010b1 bl 1a6b4 <_Watchdog_Insert> 163ec: eaffffde b 1636c <_Timer_server_Body+0x9c>
/* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
163f0: e0611005 rsb r1, r1, r5 163f4: e1a00008 mov r0, r8 163f8: e1a02007 mov r2, r7 163fc: eb00107d bl 1a5f8 <_Watchdog_Adjust_to_chain> 16400: eaffffd8 b 16368 <_Timer_server_Body+0x98>
*/ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL;
16404: e5840078 str r0, [r4, #120] ; 0x78 16408: e129f002 msr CPSR_fc, r2
_Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) {
1640c: e59d300c ldr r3, [sp, #12] 16410: e59d2000 ldr r2, [sp] 16414: e1520003 cmp r2, r3 16418: 159d5000 ldrne r5, [sp]
1641c: 1a00000a bne 1644c <_Timer_server_Body+0x17c>
16420: ea000011 b 1646c <_Timer_server_Body+0x19c>
{ Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next;
16424: e5932000 ldr r2, [r3]
* service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE;
16428: e3a00000 mov r0, #0
the_chain->first = new_first;
1642c: e58d200c str r2, [sp, #12] 16430: e5830008 str r0, [r3, #8]
new_first->previous = _Chain_Head(the_chain);
16434: e5827004 str r7, [r2, #4] 16438: e129f001 msr CPSR_fc, r1
/* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data );
1643c: e2830020 add r0, r3, #32 16440: e8900003 ldm r0, {r0, r1} 16444: e1a0e00f mov lr, pc 16448: e593f01c ldr pc, [r3, #28]
static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile (
1644c: e10f1000 mrs r1, CPSR 16450: e3813080 orr r3, r1, #128 ; 0x80 16454: e129f003 msr CPSR_fc, r3
*/ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain));
16458: e59d300c ldr r3, [sp, #12]
*/ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain))
1645c: e1550003 cmp r5, r3
16460: 1affffef bne 16424 <_Timer_server_Body+0x154> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
16464: e129f001 msr CPSR_fc, r1 16468: eaffffb0 b 16330 <_Timer_server_Body+0x60>
} } else { ts->active = false;
1646c: e3a02000 mov r2, #0 16470: e5c4207c strb r2, [r4, #124] ; 0x7c 16474: e59f004c ldr r0, [pc, #76] ; 164c8 <_Timer_server_Body+0x1f8> 16478: e5903000 ldr r3, [r0] 1647c: e2833001 add r3, r3, #1 16480: e5803000 str r3, [r0]
/* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING );
16484: e3a01008 mov r1, #8 16488: e5940000 ldr r0, [r4] 1648c: eb000dbe bl 19b8c <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
16490: e1a00004 mov r0, r4 16494: ebffff61 bl 16220 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
16498: e1a00004 mov r0, r4 1649c: ebffff75 bl 16278 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
164a0: eb000b0b bl 190d4 <_Thread_Enable_dispatch>
ts->active = true;
164a4: e3a02001 mov r2, #1 164a8: e5c4207c strb r2, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
164ac: e59d0008 ldr r0, [sp, #8] 164b0: eb0010e2 bl 1a840 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
164b4: e59d0004 ldr r0, [sp, #4] 164b8: eb0010e0 bl 1a840 <_Watchdog_Remove> 164bc: eaffff9b b 16330 <_Timer_server_Body+0x60> 164c0: 0003ad24 .word 0x0003ad24 164c4: 0003ac54 .word 0x0003ac54 164c8: 0003abcc .word 0x0003abcc
0000a0b0 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) {
a0b0: e92d41f0 push {r4, r5, r6, r7, r8, lr} a0b4: e1a04000 mov r4, r0 a0b8: e1a05002 mov r5, r2
static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile (
a0bc: e10f3000 mrs r3, CPSR a0c0: e3832080 orr r2, r3, #128 ; 0x80 a0c4: e129f002 msr CPSR_fc, r2
*/ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain));
a0c8: e1a07000 mov r7, r0 a0cc: 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 ) ) {
a0d0: e1520007 cmp r2, r7
a0d4: 0a000018 beq a13c <_Watchdog_Adjust+0x8c> switch ( direction ) {
a0d8: e3510000 cmp r1, #0
a0dc: 1a000018 bne a144 <_Watchdog_Adjust+0x94> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) {
a0e0: e3550000 cmp r5, #0
a0e4: 0a000014 beq a13c <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) {
a0e8: e5926010 ldr r6, [r2, #16] a0ec: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1;
a0f0: 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 ) { a0f4: 2a000005 bcs a110 <_Watchdog_Adjust+0x60>
a0f8: ea000018 b a160 <_Watchdog_Adjust+0xb0> <== NOT EXECUTED
switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) {
a0fc: e0555006 subs r5, r5, r6
a100: 0a00000d beq a13c <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) {
a104: e5926010 ldr r6, [r2, #16] a108: e1560005 cmp r6, r5
a10c: 8a000013 bhi a160 <_Watchdog_Adjust+0xb0> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1;
a110: e5828010 str r8, [r2, #16]
static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
a114: e129f003 msr CPSR_fc, r3
_ISR_Enable( level ); _Watchdog_Tickle( header );
a118: e1a00004 mov r0, r4 a11c: eb0000a0 bl a3a4 <_Watchdog_Tickle>
static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile (
a120: e10f3000 mrs r3, CPSR a124: e3832080 orr r2, r3, #128 ; 0x80 a128: e129f002 msr CPSR_fc, r2 a12c: e5941000 ldr r1, [r4]
_ISR_Disable( level ); if ( _Chain_Is_empty( header ) )
a130: e1570001 cmp r7, r1
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first );
a134: e1a02001 mov r2, r1
a138: 1affffef bne a0fc <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile (
a13c: e129f003 msr CPSR_fc, r3
} } _ISR_Enable( level ); }
a140: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) {
a144: e3510001 cmp r1, #1
a148: 1afffffb bne a13c <_Watchdog_Adjust+0x8c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units;
a14c: e5921010 ldr r1, [r2, #16] a150: e0815005 add r5, r1, r5 a154: e5825010 str r5, [r2, #16] a158: e129f003 msr CPSR_fc, r3
} } _ISR_Enable( level ); }
a15c: 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;
a160: e0655006 rsb r5, r5, r6 a164: e5825010 str r5, [r2, #16]
break;
a168: eafffff3 b a13c <_Watchdog_Adjust+0x8c>
000070e8 <rtems_io_register_driver>: rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() )
70e8: e59f3144 ldr r3, [pc, #324] ; 7234 <rtems_io_register_driver+0x14c> 70ec: e593c000 ldr ip, [r3]
rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers;
70f0: e59f3140 ldr r3, [pc, #320] ; 7238 <rtems_io_register_driver+0x150>
if ( rtems_interrupt_is_in_progress() )
70f4: e35c0000 cmp ip, #0
rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) {
70f8: e92d4010 push {r4, lr} 70fc: e1a04000 mov r4, r0
rtems_device_major_number major_limit = _IO_Number_of_drivers;
7100: e5930000 ldr r0, [r3]
if ( rtems_interrupt_is_in_progress() )
7104: 13a00012 movne r0, #18 7108: 18bd8010 popne {r4, pc}
return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL )
710c: e3520000 cmp r2, #0
7110: 0a00003c beq 7208 <rtems_io_register_driver+0x120> return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL )
7114: e3510000 cmp r1, #0
if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit;
7118: e5820000 str r0, [r2]
if ( driver_table == NULL ) 711c: 0a000039 beq 7208 <rtems_io_register_driver+0x120> static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL;
7120: e591c000 ldr ip, [r1] 7124: e35c0000 cmp ip, #0
7128: 0a000033 beq 71fc <rtems_io_register_driver+0x114> return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit )
712c: e1500004 cmp r0, r4 7130: 93a0000a movls r0, #10 7134: 98bd8010 popls {r4, pc}
rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1;
7138: e59f00fc ldr r0, [pc, #252] ; 723c <rtems_io_register_driver+0x154> 713c: e590c000 ldr ip, [r0] 7140: e28cc001 add ip, ip, #1 7144: e580c000 str ip, [r0]
return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) {
7148: e3540000 cmp r4, #0
714c: 1a000020 bne 71d4 <rtems_io_register_driver+0xec> static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers;
7150: e593e000 ldr lr, [r3]
rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) {
7154: e35e0000 cmp lr, #0
7158: 0a00002c beq 7210 <rtems_io_register_driver+0x128>
715c: e59f30dc ldr r3, [pc, #220] ; 7240 <rtems_io_register_driver+0x158> 7160: e593c000 ldr ip, [r3] 7164: e1a0300c mov r3, ip 7168: ea000003 b 717c <rtems_io_register_driver+0x94> 716c: e2844001 add r4, r4, #1 7170: e15e0004 cmp lr, r4 7174: e2833018 add r3, r3, #24
7178: 9a000005 bls 7194 <rtems_io_register_driver+0xac> static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL;
717c: e5930000 ldr r0, [r3] 7180: e3500000 cmp r0, #0
7184: 1afffff8 bne 716c <rtems_io_register_driver+0x84>
7188: e5930004 ldr r0, [r3, #4] 718c: e3500000 cmp r0, #0
7190: 1afffff5 bne 716c <rtems_io_register_driver+0x84> } /* Assigns invalid value in case of failure */ *major = m; if ( m != n )
7194: e15e0004 cmp lr, r4 7198: 10843084 addne r3, r4, r4, lsl #1
if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m;
719c: e5824000 str r4, [r2]
if ( m != n )
71a0: 108cc183 addne ip, ip, r3, lsl #3
71a4: 0a00001a beq 7214 <rtems_io_register_driver+0x12c> } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table;
71a8: e1a0e001 mov lr, r1 71ac: e8be000f ldm lr!, {r0, r1, r2, r3} 71b0: e8ac000f stmia ip!, {r0, r1, r2, r3} 71b4: e89e0003 ldm lr, {r0, r1} 71b8: e88c0003 stm ip, {r0, r1}
_Thread_Enable_dispatch();
71bc: eb00067f bl 8bc0 <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
71c0: e3a01000 mov r1, #0 71c4: e1a00004 mov r0, r4 71c8: e1a02001 mov r2, r1
}
71cc: e8bd4010 pop {r4, lr}
_IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL );
71d0: ea00213a b f6c0 <rtems_io_initialize>
_Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major;
71d4: e59f3064 ldr r3, [pc, #100] ; 7240 <rtems_io_register_driver+0x158> 71d8: e5933000 ldr r3, [r3] 71dc: e084c084 add ip, r4, r4, lsl #1
static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL;
71e0: e793018c ldr r0, [r3, ip, lsl #3] 71e4: e3500000 cmp r0, #0
_Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major;
71e8: e083c18c add ip, r3, ip, lsl #3
static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 71ec: 0a00000b beq 7220 <rtems_io_register_driver+0x138> major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch();
71f0: eb000672 bl 8bc0 <_Thread_Enable_dispatch> 71f4: e3a0000c mov r0, #12
return RTEMS_RESOURCE_IN_USE;
71f8: e8bd8010 pop {r4, pc}
static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL;
71fc: e591c004 ldr ip, [r1, #4] 7200: e35c0000 cmp ip, #0
7204: 1affffc8 bne 712c <rtems_io_register_driver+0x44> _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL );
7208: e3a00009 mov r0, #9
}
720c: e8bd8010 pop {r4, pc}
if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m;
7210: 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();
7214: eb000669 bl 8bc0 <_Thread_Enable_dispatch> 7218: e3a00005 mov r0, #5
return sc;
721c: e8bd8010 pop {r4, pc}
static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL;
7220: e59c3004 ldr r3, [ip, #4] 7224: e3530000 cmp r3, #0
7228: 1afffff0 bne 71f0 <rtems_io_register_driver+0x108> if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major;
722c: e5824000 str r4, [r2] 7230: eaffffdc b 71a8 <rtems_io_register_driver+0xc0> 7234: 0001f9dc .word 0x0001f9dc 7238: 0001fbc4 .word 0x0001fbc4 723c: 0001f94c .word 0x0001f94c 7240: 0001fbc8 .word 0x0001fbc8