RTEMS 4.11Annotated Report
Thu Dec 20 20:39:19 2012
0000c3cc <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3cc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
c3d0: e1a08002 mov r8, r2
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
c3d4: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3d8: e24dd01c sub sp, sp, #28
c3dc: e1a06001 mov r6, r1
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
c3e0: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3e4: e1a07000 mov r7, r0
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
c3e8: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3ec: e1a0b003 mov fp, r3
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
c3f0: e58d200c str r2, [sp, #12]
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
c3f4: 2a000086 bcs c614 <_Heap_Allocate_aligned_with_boundary+0x248>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
c3f8: e3530000 cmp r3, #0
c3fc: 1a000078 bne c5e4 <_Heap_Allocate_aligned_with_boundary+0x218>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
c400: e597a008 ldr sl, [r7, #8]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
c404: e157000a cmp r7, sl
c408: e3a05000 mov r5, #0
c40c: 0a00007b beq c600 <_Heap_Allocate_aligned_with_boundary+0x234>
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
c410: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
c414: e2662004 rsb r2, r6, #4
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
c418: e2833007 add r3, r3, #7
c41c: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
c420: e58d2014 str r2, [sp, #20]
c424: ea000005 b c440 <_Heap_Allocate_aligned_with_boundary+0x74>
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
c428: e3540000 cmp r4, #0
);
}
}
/* Statistics */
++search_count;
c42c: e2855001 add r5, r5, #1
if ( alloc_begin != 0 ) {
c430: 1a00005a bne c5a0 <_Heap_Allocate_aligned_with_boundary+0x1d4>
break;
}
block = block->next;
c434: e59aa008 ldr sl, [sl, #8]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
c438: e157000a cmp r7, sl
c43c: 0a00006f beq c600 <_Heap_Allocate_aligned_with_boundary+0x234>
/*
* 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 ) {
c440: e59a9004 ldr r9, [sl, #4]
c444: e59d3000 ldr r3, [sp]
c448: e1530009 cmp r3, r9
);
}
}
/* Statistics */
++search_count;
c44c: 22855001 addcs r5, r5, #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 ) {
c450: 2afffff7 bcs c434 <_Heap_Allocate_aligned_with_boundary+0x68>
if ( alignment == 0 ) {
c454: 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;
c458: 028a4008 addeq r4, sl, #8
c45c: 0afffff1 beq c428 <_Heap_Allocate_aligned_with_boundary+0x5c>
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
c460: e59d3014 ldr r3, [sp, #20]
- 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;
c464: e3c99001 bic r9, r9, #1
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
c468: e5972014 ldr r2, [r7, #20]
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;
c46c: e08a9009 add r9, sl, r9
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;
c470: e59d1010 ldr r1, [sp, #16]
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
c474: e0834009 add r4, r3, r9
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c478: 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;
c47c: e0623001 rsb r3, r2, r1
c480: e1a01008 mov r1, r8
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
c484: e58d2004 str r2, [sp, #4]
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
c488: e0839009 add r9, r3, r9
c48c: eb002c8d bl 176c8 <__umodsi3>
c490: 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;
c494: e28a2008 add r2, 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 ) {
c498: e1590004 cmp r9, r4
c49c: e58d2008 str r2, [sp, #8]
c4a0: 2a000003 bcs c4b4 <_Heap_Allocate_aligned_with_boundary+0xe8>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c4a4: e1a00009 mov r0, r9
c4a8: e1a01008 mov r1, r8
c4ac: eb002c85 bl 176c8 <__umodsi3>
c4b0: e0604009 rsb r4, r0, r9
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
c4b4: e35b0000 cmp fp, #0
c4b8: 0a000025 beq c554 <_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;
c4bc: e0849006 add r9, r4, r6
c4c0: e1a00009 mov r0, r9
c4c4: e1a0100b mov r1, fp
c4c8: eb002c7e bl 176c8 <__umodsi3>
c4cc: 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 ) {
c4d0: e1540000 cmp r4, r0
c4d4: 23a03000 movcs r3, #0
c4d8: 33a03001 movcc r3, #1
c4dc: e1590000 cmp r9, r0
c4e0: 93a03000 movls r3, #0
c4e4: e3530000 cmp r3, #0
c4e8: 0a000019 beq c554 <_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;
c4ec: e59d3008 ldr r3, [sp, #8]
c4f0: e0839006 add r9, r3, r6
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
c4f4: e1590000 cmp r9, r0
c4f8: 958da018 strls sl, [sp, #24]
c4fc: 9a000002 bls c50c <_Heap_Allocate_aligned_with_boundary+0x140>
c500: ea00003c b c5f8 <_Heap_Allocate_aligned_with_boundary+0x22c>
c504: e1590000 cmp r9, r0
c508: 8a00003e bhi c608 <_Heap_Allocate_aligned_with_boundary+0x23c>
return 0;
}
alloc_begin = boundary_line - alloc_size;
c50c: e0664000 rsb r4, r6, r0
c510: e1a01008 mov r1, r8
c514: e1a00004 mov r0, r4
c518: eb002c6a bl 176c8 <__umodsi3>
c51c: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
c520: e084a006 add sl, r4, r6
c524: e1a0000a mov r0, sl
c528: e1a0100b mov r1, fp
c52c: eb002c65 bl 176c8 <__umodsi3>
c530: e060000a rsb r0, r0, sl
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
c534: e15a0000 cmp sl, r0
c538: 93a0a000 movls sl, #0
c53c: 83a0a001 movhi sl, #1
c540: e1540000 cmp r4, r0
c544: 23a0a000 movcs sl, #0
c548: e35a0000 cmp sl, #0
c54c: 1affffec bne c504 <_Heap_Allocate_aligned_with_boundary+0x138>
c550: e59da018 ldr sl, [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 ) {
c554: e59d2008 ldr r2, [sp, #8]
c558: e1520004 cmp r2, r4
c55c: 8a000025 bhi c5f8 <_Heap_Allocate_aligned_with_boundary+0x22c>
c560: e1a00004 mov r0, r4
c564: e59d100c ldr r1, [sp, #12]
c568: eb002c56 bl 176c8 <__umodsi3>
c56c: e3e09007 mvn r9, #7
c570: e06a9009 rsb r9, sl, r9
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
c574: e0899004 add r9, r9, r4
if ( free_size >= min_block_size || free_size == 0 ) {
return alloc_begin;
}
}
return 0;
c578: e59d2004 ldr r2, [sp, #4]
if ( alloc_begin >= alloc_begin_floor ) {
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
if ( free_size >= min_block_size || free_size == 0 ) {
c57c: e0603009 rsb r3, r0, r9
return alloc_begin;
}
}
return 0;
c580: e1590000 cmp r9, r0
c584: 11520003 cmpne r2, r3
c588: 83a03000 movhi r3, #0
c58c: 93a03001 movls r3, #1
c590: 81a04003 movhi r4, r3
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
c594: e3540000 cmp r4, #0
);
}
}
/* Statistics */
++search_count;
c598: e2855001 add r5, r5, #1
if ( alloc_begin != 0 ) {
c59c: 0affffa4 beq c434 <_Heap_Allocate_aligned_with_boundary+0x68>
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
stats->searches += search_count;
c5a0: e2872048 add r2, r7, #72 ; 0x48
c5a4: e892000c ldm r2, {r2, r3}
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
c5a8: e2822001 add r2, r2, #1
stats->searches += search_count;
c5ac: e0833005 add r3, r3, r5
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
c5b0: e5872048 str r2, [r7, #72] ; 0x48
stats->searches += search_count;
c5b4: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
c5b8: e1a00007 mov r0, r7
c5bc: e1a0100a mov r1, sl
c5c0: e1a02004 mov r2, r4
c5c4: e1a03006 mov r3, r6
c5c8: ebffecd0 bl 7910 <_Heap_Block_allocate>
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
c5cc: e5973044 ldr r3, [r7, #68] ; 0x44
c5d0: e1530005 cmp r3, r5
stats->max_search = search_count;
c5d4: 35875044 strcc r5, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
c5d8: e1a00004 mov r0, r4
}
c5dc: e28dd01c add sp, sp, #28
c5e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
c5e4: e1560003 cmp r6, r3
c5e8: 8a000009 bhi c614 <_Heap_Allocate_aligned_with_boundary+0x248>
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
c5ec: e3580000 cmp r8, #0
c5f0: 01a08002 moveq r8, r2
c5f4: eaffff81 b c400 <_Heap_Allocate_aligned_with_boundary+0x34>
if ( free_size >= min_block_size || free_size == 0 ) {
return alloc_begin;
}
}
return 0;
c5f8: e3a04000 mov r4, #0
c5fc: eaffff89 b c428 <_Heap_Allocate_aligned_with_boundary+0x5c>
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
c600: e3a04000 mov r4, #0
c604: eafffff0 b c5cc <_Heap_Allocate_aligned_with_boundary+0x200>
c608: e59da018 ldr sl, [sp, #24] <== NOT EXECUTED
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 ) {
if ( boundary_line < boundary_floor ) {
return 0;
c60c: e3a04000 mov r4, #0 <== NOT EXECUTED
c610: eaffff84 b c428 <_Heap_Allocate_aligned_with_boundary+0x5c><== NOT EXECUTED
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
return NULL;
c614: e3a00000 mov r0, #0
c618: eaffffef b c5dc <_Heap_Allocate_aligned_with_boundary+0x210>
0000c61c <_Heap_Free>:
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
c61c: e2513000 subs r3, r1, #0
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
c620: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
c624: e1a04000 mov r4, r0
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
c628: 03a00001 moveq r0, #1
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
c62c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c630: e1a00003 mov r0, r3
c634: e5941010 ldr r1, [r4, #16]
c638: e2435008 sub r5, r3, #8
c63c: eb002c21 bl 176c8 <__umodsi3>
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
c640: e5942020 ldr r2, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
c644: e0605005 rsb r5, r0, r5
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c648: e1550002 cmp r5, r2
c64c: 3a00002f bcc c710 <_Heap_Free+0xf4>
c650: e5941024 ldr r1, [r4, #36] ; 0x24
c654: e1550001 cmp r5, r1
c658: 8a00002c bhi c710 <_Heap_Free+0xf4>
- 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;
c65c: e595c004 ldr ip, [r5, #4]
c660: e3cc6001 bic r6, ip, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
c664: e0853006 add r3, r5, r6
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c668: e1520003 cmp r2, r3
c66c: 8a000027 bhi c710 <_Heap_Free+0xf4>
c670: e1510003 cmp r1, r3
c674: 3a000027 bcc c718 <_Heap_Free+0xfc>
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;
c678: e5937004 ldr r7, [r3, #4]
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
c67c: e2170001 ands r0, r7, #1
c680: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
c684: e1510003 cmp r1, r3
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
c688: e3c77001 bic r7, r7, #1
c68c: 03a08000 moveq r8, #0
c690: 0a000004 beq c6a8 <_Heap_Free+0x8c>
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;
c694: e0830007 add r0, r3, r7
c698: e5900004 ldr r0, [r0, #4]
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
c69c: e3100001 tst r0, #1
c6a0: 13a08000 movne r8, #0
c6a4: 03a08001 moveq r8, #1
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
c6a8: e21c0001 ands r0, ip, #1
c6ac: 1a00001b bne c720 <_Heap_Free+0x104>
uintptr_t const prev_size = block->prev_size;
c6b0: e595c000 ldr ip, [r5]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
c6b4: e06ca005 rsb sl, ip, r5
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c6b8: e152000a cmp r2, sl
c6bc: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
c6c0: e151000a cmp r1, sl
c6c4: 38bd85f0 popcc {r4, r5, r6, r7, r8, sl, pc}
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
c6c8: e59a0004 ldr r0, [sl, #4]
return( false );
}
/* As we always coalesce free blocks, the block that preceedes prev_block
must have been used. */
if ( !_Heap_Is_prev_used ( prev_block) ) {
c6cc: e2100001 ands r0, r0, #1
c6d0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
c6d4: e3580000 cmp r8, #0
c6d8: 0a000039 beq c7c4 <_Heap_Free+0x1a8>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
c6dc: e5940038 ldr r0, [r4, #56] ; 0x38
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
c6e0: e0867007 add r7, r6, r7
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
c6e4: e2832008 add r2, r3, #8
c6e8: e892000c ldm r2, {r2, r3}
c6ec: e087c00c add ip, r7, ip
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
c6f0: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c6f4: e38c1001 orr r1, ip, #1
prev->next = next;
c6f8: e5832008 str r2, [r3, #8]
next->prev = prev;
c6fc: e582300c str r3, [r2, #12]
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
c700: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c704: e58a1004 str r1, [sl, #4]
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
c708: e78ac00c str ip, [sl, ip]
c70c: ea00000f b c750 <_Heap_Free+0x134>
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
return false;
c710: e3a00000 mov r0, #0
c714: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
c718: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
c71c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
c720: e3580000 cmp r8, #0
c724: 0a000014 beq c77c <_Heap_Free+0x160>
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
c728: e2832008 add r2, r3, #8
c72c: e892000c ldm r2, {r2, r3}
uintptr_t const size = block_size + next_block_size;
c730: e0877006 add r7, r7, r6
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c734: e3871001 orr r1, r7, #1
new_block->next = next;
c738: e5852008 str r2, [r5, #8]
new_block->prev = prev;
c73c: e585300c str r3, [r5, #12]
next->prev = new_block;
prev->next = new_block;
c740: e5835008 str r5, [r3, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
c744: e582500c str r5, [r2, #12]
c748: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
c74c: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
c750: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
c754: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
c758: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
c75c: e2422001 sub r2, r2, #1
++stats->frees;
c760: e2833001 add r3, r3, #1
stats->free_size += block_size;
c764: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
c768: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
c76c: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
c770: e5846030 str r6, [r4, #48] ; 0x30
return( true );
c774: e3a00001 mov r0, #1
c778: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
c77c: e3862001 orr r2, r6, #1
c780: e5852004 str r2, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
c784: e5942038 ldr r2, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
c788: e594c03c ldr ip, [r4, #60] ; 0x3c
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c78c: e5930004 ldr r0, [r3, #4]
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
c790: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
c794: e2822001 add r2, r2, #1
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c798: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
c79c: e152000c cmp r2, ip
new_block->next = next;
c7a0: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
c7a4: e585400c str r4, [r5, #12]
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c7a8: e5830004 str r0, [r3, #4]
block_before->next = new_block;
next->prev = new_block;
c7ac: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
c7b0: e7856006 str r6, [r5, r6]
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
c7b4: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
c7b8: e5842038 str r2, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
c7bc: 8584203c strhi r2, [r4, #60] ; 0x3c
c7c0: eaffffe2 b c750 <_Heap_Free+0x134>
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
c7c4: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c7c8: e38c2001 orr r2, ip, #1
c7cc: e58a2004 str r2, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c7d0: e5932004 ldr r2, [r3, #4]
c7d4: e3c22001 bic r2, r2, #1
c7d8: e5832004 str r2, [r3, #4]
next_block->prev_size = size;
c7dc: e785c006 str ip, [r5, r6]
c7e0: eaffffda b c750 <_Heap_Free+0x134>
00009668 <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
9668: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
966c: e2528000 subs r8, r2, #0
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
9670: e1a04000 mov r4, r0
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *allocated_blocks = NULL;
9674: 01a05008 moveq r5, r8
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
9678: 0a000012 beq 96c8 <_Heap_Greedy_allocate+0x60>
967c: e3a06000 mov r6, #0
9680: e1a07001 mov r7, r1
const uintptr_t *block_sizes,
size_t block_count
)
{
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *allocated_blocks = NULL;
9684: e1a05006 mov r5, r6
* @brief See _Heap_Allocate_aligned_with_boundary() with alignment and
* boundary equals zero.
*/
RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
{
return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
9688: e3a02000 mov r2, #0
968c: e4971004 ldr r1, [r7], #4
9690: e1a03002 mov r3, r2
9694: e1a00004 mov r0, r4
9698: eb001e16 bl 10ef8 <_Heap_Allocate_aligned_with_boundary>
size_t i;
for (i = 0; i < block_count; ++i) {
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
969c: e250a000 subs sl, r0, #0
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
96a0: e2866001 add r6, r6, #1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
96a4: e24aa008 sub sl, sl, #8
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
96a8: 0a000004 beq 96c0 <_Heap_Greedy_allocate+0x58>
96ac: e5941010 ldr r1, [r4, #16]
96b0: eb004ac3 bl 1c1c4 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
96b4: e060000a rsb r0, r0, sl
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
96b8: e5805008 str r5, [r0, #8]
96bc: e1a05000 mov r5, r0
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
96c0: e1560008 cmp r6, r8
96c4: 1affffef bne 9688 <_Heap_Greedy_allocate+0x20>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
96c8: e5946008 ldr r6, [r4, #8]
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
96cc: e1540006 cmp r4, r6
96d0: 13a07000 movne r7, #0
96d4: 1a000002 bne 96e4 <_Heap_Greedy_allocate+0x7c>
96d8: ea000018 b 9740 <_Heap_Greedy_allocate+0xd8> <== NOT EXECUTED
96dc: e1a07006 mov r7, r6
96e0: e1a06003 mov r6, r3
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
96e4: e5963004 ldr r3, [r6, #4]
96e8: e3c33001 bic r3, r3, #1
_Heap_Block_allocate(
96ec: e2433008 sub r3, r3, #8
96f0: e1a01006 mov r1, r6
96f4: e2862008 add r2, r6, #8
96f8: e1a00004 mov r0, r4
96fc: eb0000d0 bl 9a44 <_Heap_Block_allocate>
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
9700: e5867008 str r7, [r6, #8]
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
9704: e5943008 ldr r3, [r4, #8]
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
9708: e1540003 cmp r4, r3
970c: 1afffff2 bne 96dc <_Heap_Greedy_allocate+0x74>
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
9710: e3550000 cmp r5, #0
9714: 1a000001 bne 9720 <_Heap_Greedy_allocate+0xb8>
9718: ea000006 b 9738 <_Heap_Greedy_allocate+0xd0>
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
971c: e1a05007 mov r5, r7
9720: e1a01005 mov r1, r5
9724: e5b17008 ldr r7, [r1, #8]!
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
9728: e1a00004 mov r0, r4
972c: eb001e85 bl 11148 <_Heap_Free>
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
9730: e3570000 cmp r7, #0
9734: 1afffff8 bne 971c <_Heap_Greedy_allocate+0xb4>
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
9738: e1a00006 mov r0, r6
973c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
9740: e3a06000 mov r6, #0 <== NOT EXECUTED
9744: eafffff1 b 9710 <_Heap_Greedy_allocate+0xa8> <== NOT EXECUTED
00011c8c <_Heap_Iterate>:
Heap_Block_visitor visitor,
void *visitor_arg
)
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
11c8c: e2800020 add r0, r0, #32
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
11c90: e92d40f0 push {r4, r5, r6, r7, lr}
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
11c94: e8900021 ldm r0, {r0, r5}
bool stop = false;
while ( !stop && current != end ) {
11c98: e1500005 cmp r0, r5
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
11c9c: e1a07001 mov r7, r1
11ca0: e1a06002 mov r6, r2
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
11ca4: 1a000001 bne 11cb0 <_Heap_Iterate+0x24>
11ca8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
11cac: e1a00004 mov r0, r4
11cb0: e5901004 ldr r1, [r0, #4]
11cb4: e3c11001 bic r1, r1, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
11cb8: e0804001 add r4, r0, r1
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;
11cbc: e5942004 ldr r2, [r4, #4]
uintptr_t size = _Heap_Block_size( current );
Heap_Block *next = _Heap_Block_at( current, size );
bool used = _Heap_Is_prev_used( next );
stop = (*visitor)( current, size, used, visitor_arg );
11cc0: e1a03006 mov r3, r6
11cc4: e2022001 and r2, r2, #1
11cc8: e1a0e00f mov lr, pc
11ccc: e12fff17 bx r7
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
11cd0: e3500000 cmp r0, #0
11cd4: 18bd80f0 popne {r4, r5, r6, r7, pc}
11cd8: e1550004 cmp r5, r4
11cdc: 1afffff2 bne 11cac <_Heap_Iterate+0x20>
11ce0: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000c918 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
c918: e92d4070 push {r4, r5, r6, lr}
c91c: e1a04000 mov r4, r0
c920: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c924: e1a00001 mov r0, r1
c928: e5941010 ldr r1, [r4, #16]
c92c: e1a06002 mov r6, r2
c930: eb002b64 bl 176c8 <__umodsi3>
c934: e2452008 sub r2, r5, #8
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
c938: e5943020 ldr r3, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
c93c: e0602002 rsb r2, r0, r2
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;
c940: e1520003 cmp r2, r3
c944: 3a000010 bcc c98c <_Heap_Size_of_alloc_area+0x74>
c948: e5941024 ldr r1, [r4, #36] ; 0x24
c94c: e1520001 cmp r2, r1
c950: 8a00000d bhi c98c <_Heap_Size_of_alloc_area+0x74>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
c954: e5920004 ldr r0, [r2, #4]
c958: e3c00001 bic r0, r0, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
c95c: e0822000 add r2, r2, r0
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;
c960: e1530002 cmp r3, r2
c964: 8a000008 bhi c98c <_Heap_Size_of_alloc_area+0x74>
c968: e1510002 cmp r1, r2
c96c: 3a000008 bcc c994 <_Heap_Size_of_alloc_area+0x7c>
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
c970: e5920004 ldr r0, [r2, #4]
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
c974: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
c978: 12655004 rsbne r5, r5, #4
c97c: 10852002 addne r2, r5, r2
c980: 15862000 strne r2, [r6]
return true;
c984: 13a00001 movne r0, #1
c988: e8bd8070 pop {r4, r5, r6, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
c98c: e3a00000 mov r0, #0
c990: e8bd8070 pop {r4, r5, r6, pc}
c994: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
c998: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00007a50 <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
7a50: e52de004 push {lr} ; (str lr, [sp, #-4]!)
7a54: e24dd00c sub sp, sp, #12
7a58: e1a04000 mov r4, r0
7a5c: e20160ff and r6, r1, #255 ; 0xff
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
7a60: e1a0000d mov r0, sp
7a64: e59f1040 ldr r1, [pc, #64] ; 7aac <_Internal_error_Occurred+0x5c>
7a68: e1a05002 mov r5, r2
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
7a6c: e58d2008 str r2, [sp, #8]
7a70: e58d4000 str r4, [sp]
7a74: e5cd6004 strb r6, [sp, #4]
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
7a78: eb0007d9 bl 99e4 <_User_extensions_Iterate>
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
7a7c: e59f302c ldr r3, [pc, #44] ; 7ab0 <_Internal_error_Occurred+0x60><== NOT EXECUTED
7a80: e5834000 str r4, [r3] <== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
7a84: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
7a88: e5835008 str r5, [r3, #8] <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _System_state_Set (
System_state_Codes state
)
{
_System_state_Current = state;
7a8c: e59f3020 ldr r3, [pc, #32] ; 7ab4 <_Internal_error_Occurred+0x64><== NOT EXECUTED
7a90: e3a02005 mov r2, #5 <== NOT EXECUTED
7a94: e5832000 str r2, [r3] <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
7a98: e10f2000 mrs r2, CPSR <== NOT EXECUTED
7a9c: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED
7aa0: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
7aa4: e1a00005 mov r0, r5 <== NOT EXECUTED
7aa8: eafffffe b 7aa8 <_Internal_error_Occurred+0x58> <== NOT EXECUTED
00007b6c <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
7b6c: 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 )
7b70: e5904034 ldr r4, [r0, #52] ; 0x34
7b74: e3540000 cmp r4, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
7b78: e24dd014 sub sp, sp, #20
7b7c: e1a05000 mov r5, r0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7b80: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
7b84: e1d081b0 ldrh r8, [r0, #16]
7b88: 0a0000a0 beq 7e10 <_Objects_Extend_information+0x2a4>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
7b8c: e1d0a1b4 ldrh sl, [r0, #20]
7b90: e1a00008 mov r0, r8
7b94: e1a0100a mov r1, sl
7b98: eb003e84 bl 175b0 <__aeabi_uidiv>
7b9c: e1a0b800 lsl fp, r0, #16
for ( ; block < block_count; block++ ) {
7ba0: e1b0b82b lsrs fp, fp, #16
7ba4: 0a0000a1 beq 7e30 <_Objects_Extend_information+0x2c4>
if ( information->object_blocks[ block ] == NULL ) {
7ba8: e5949000 ldr r9, [r4]
7bac: e3590000 cmp r9, #0
7bb0: 11a03004 movne r3, r4
7bb4: e1a0200a mov r2, sl
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7bb8: 11a06007 movne r6, r7
index_base = minimum_index;
block = 0;
7bbc: 13a04000 movne r4, #0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7bc0: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
7bc4: 01a04009 moveq r4, r9
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
7bc8: 1a000003 bne 7bdc <_Objects_Extend_information+0x70>
7bcc: ea000007 b 7bf0 <_Objects_Extend_information+0x84> <== NOT EXECUTED
7bd0: e5b39004 ldr r9, [r3, #4]!
7bd4: e3590000 cmp r9, #0
7bd8: 0a000004 beq 7bf0 <_Objects_Extend_information+0x84>
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7bdc: e2844001 add r4, r4, #1
7be0: e15b0004 cmp fp, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
7be4: e086600a add r6, r6, sl
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7be8: 8afffff8 bhi 7bd0 <_Objects_Extend_information+0x64>
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7bec: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
7bf0: e0888002 add r8, r8, r2
/*
* 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 ) {
7bf4: e3580801 cmp r8, #65536 ; 0x10000
7bf8: 2a000063 bcs 7d8c <_Objects_Extend_information+0x220>
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
7bfc: e5d53012 ldrb r3, [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;
7c00: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
7c04: e3530000 cmp r3, #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;
7c08: e0000092 mul r0, r2, r0
if ( information->auto_extend ) {
7c0c: 1a000060 bne 7d94 <_Objects_Extend_information+0x228>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
7c10: eb0008ce bl 9f50 <_Workspace_Allocate_or_fatal_error>
7c14: e58d0004 str r0, [sp, #4]
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
7c18: e3590000 cmp r9, #0
7c1c: 0a000039 beq 7d08 <_Objects_Extend_information+0x19c>
*/
/*
* Up the block count and maximum
*/
block_count++;
7c20: e28b9001 add r9, fp, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
7c24: e0890089 add r0, r9, r9, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
7c28: e5d53012 ldrb r3, [r5, #18]
/*
* 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 *));
7c2c: e0880000 add r0, r8, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
7c30: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
7c34: e3530000 cmp r3, #0
block_count++;
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
7c38: e1a00100 lsl r0, r0, #2
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
7c3c: 0a000059 beq 7da8 <_Objects_Extend_information+0x23c>
object_blocks = _Workspace_Allocate( block_size );
7c40: eb0008b8 bl 9f28 <_Workspace_Allocate>
if ( !object_blocks ) {
7c44: e250a000 subs sl, r0, #0
7c48: 0a000075 beq 7e24 <_Objects_Extend_information+0x2b8>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
7c4c: e1d531b0 ldrh r3, [r5, #16]
7c50: e1570003 cmp r7, r3
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
7c54: e08a3109 add r3, sl, r9, lsl #2
7c58: e08a9189 add r9, sl, r9, lsl #3
7c5c: 3a000058 bcc 7dc4 <_Objects_Extend_information+0x258>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
7c60: e3570000 cmp r7, #0
7c64: 13a02000 movne r2, #0
7c68: 11a01009 movne r1, r9
local_table[ index ] = NULL;
7c6c: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
7c70: 0a000003 beq 7c84 <_Objects_Extend_information+0x118>
7c74: e2822001 add r2, r2, #1
7c78: e1570002 cmp r7, r2
local_table[ index ] = NULL;
7c7c: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
7c80: 8afffffb bhi 7c74 <_Objects_Extend_information+0x108>
7c84: e1a0b10b lsl fp, fp, #2
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
7c88: e1d501b4 ldrh r0, [r5, #20]
7c8c: e0860000 add r0, r6, r0
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
7c90: e3a0c000 mov ip, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
7c94: e1560000 cmp r6, r0
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
7c98: e78ac00b str ip, [sl, fp]
inactive_per_block[block_count] = 0;
7c9c: e783c00b str ip, [r3, fp]
for ( index=index_base ;
7ca0: 2a000005 bcs 7cbc <_Objects_Extend_information+0x150>
7ca4: e0891106 add r1, r9, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
7ca8: e1a02006 mov r2, r6
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
index++ ) {
7cac: e2822001 add r2, r2, #1
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
7cb0: e1500002 cmp r0, r2
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
7cb4: e481c004 str ip, [r1], #4
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
7cb8: 8afffffb bhi 7cac <_Objects_Extend_information+0x140>
7cbc: e10f2000 mrs r2, CPSR
7cc0: e3821080 orr r1, r2, #128 ; 0x80
7cc4: e129f001 msr CPSR_fc, r1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
7cc8: e5951000 ldr r1, [r5]
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
7ccc: e1d500b4 ldrh r0, [r5, #4]
7cd0: e1a01c01 lsl r1, r1, #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;
7cd4: e1a08808 lsl r8, r8, #16
7cd8: e3811801 orr r1, r1, #65536 ; 0x10000
7cdc: e1a08828 lsr r8, r8, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
7ce0: e1811d80 orr r1, r1, r0, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
7ce4: e1811008 orr r1, r1, r8
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
7ce8: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
7cec: e5853030 str r3, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
7cf0: e585a034 str sl, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
7cf4: e585901c str r9, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
7cf8: e1c581b0 strh r8, [r5, #16]
information->maximum_id = _Objects_Build_id(
7cfc: e585100c str r1, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
7d00: e129f002 msr CPSR_fc, r2
information->maximum
);
_ISR_Enable( level );
_Workspace_Free( old_tables );
7d04: eb00088d bl 9f40 <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
7d08: e5953034 ldr r3, [r5, #52] ; 0x34
7d0c: e59d2004 ldr r2, [sp, #4]
7d10: e7832104 str r2, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
7d14: e5953034 ldr r3, [r5, #52] ; 0x34
7d18: e28d0008 add r0, sp, #8
7d1c: e7931104 ldr r1, [r3, r4, lsl #2]
7d20: e1d521b4 ldrh r2, [r5, #20]
7d24: e5953018 ldr r3, [r5, #24]
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
7d28: e1a04104 lsl r4, r4, #2
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
7d2c: ebfffcf2 bl 70fc <_Chain_Initialize>
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7d30: e2857020 add r7, 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 ) {
7d34: ea000008 b 7d5c <_Objects_Extend_information+0x1f0>
7d38: e5952000 ldr r2, [r5]
the_object->id = _Objects_Build_id(
7d3c: e1d5c0b4 ldrh ip, [r5, #4]
7d40: e1a02c02 lsl r2, r2, #24
7d44: e3822801 orr r2, r2, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
7d48: e1822d8c orr r2, r2, ip, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
7d4c: e1822006 orr r2, r2, r6
7d50: e5832008 str r2, [r3, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7d54: ebfffcd0 bl 709c <_Chain_Append>
index++;
7d58: 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 ) {
7d5c: e28d0008 add r0, sp, #8
7d60: ebfffcd8 bl 70c8 <_Chain_Get>
7d64: e2503000 subs r3, r0, #0
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7d68: e1a01003 mov r1, r3
7d6c: e1a00007 mov r0, r7
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
7d70: 1afffff0 bne 7d38 <_Objects_Extend_information+0x1cc>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
7d74: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
7d78: e1d531b4 ldrh r3, [r5, #20]
7d7c: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
7d80: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
7d84: e7813004 str r3, [r1, r4]
information->inactive =
7d88: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
7d8c: e28dd014 add sp, sp, #20
7d90: 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 );
7d94: eb000863 bl 9f28 <_Workspace_Allocate>
if ( !new_object_block )
7d98: e3500000 cmp r0, #0
7d9c: e58d0004 str r0, [sp, #4]
7da0: 1affff9c bne 7c18 <_Objects_Extend_information+0xac>
7da4: eafffff8 b 7d8c <_Objects_Extend_information+0x220>
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
return;
}
} else {
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
7da8: eb000868 bl 9f50 <_Workspace_Allocate_or_fatal_error>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
7dac: e1d531b0 ldrh r3, [r5, #16]
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
return;
}
} else {
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
7db0: e1a0a000 mov sl, r0
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
7db4: e1570003 cmp r7, r3
7db8: e08a3109 add r3, sl, r9, lsl #2
7dbc: e08a9189 add r9, sl, r9, lsl #3
7dc0: 2affffa6 bcs 7c60 <_Objects_Extend_information+0xf4>
/*
* 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,
7dc4: e1a0b10b lsl fp, fp, #2
7dc8: e5951034 ldr r1, [r5, #52] ; 0x34
7dcc: e1a0200b mov r2, fp
7dd0: e1a0000a mov r0, sl
7dd4: e58d3000 str r3, [sp]
7dd8: eb001c3d bl eed4 <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
7ddc: e59d3000 ldr r3, [sp]
7de0: e5951030 ldr r1, [r5, #48] ; 0x30
7de4: e1a00003 mov r0, r3
7de8: e1a0200b mov r2, fp
7dec: eb001c38 bl eed4 <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
7df0: e1d521b0 ldrh r2, [r5, #16]
7df4: e0872002 add r2, r7, r2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
7df8: e1a00009 mov r0, r9
7dfc: e595101c ldr r1, [r5, #28]
7e00: e1a02102 lsl r2, r2, #2
7e04: eb001c32 bl eed4 <memcpy>
7e08: e59d3000 ldr r3, [sp]
7e0c: eaffff9d b 7c88 <_Objects_Extend_information+0x11c>
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
7e10: e1d021b4 ldrh r2, [r0, #20]
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7e14: e1a06007 mov r6, r7
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7e18: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
7e1c: e1a0b004 mov fp, r4
7e20: eaffff72 b 7bf0 <_Objects_Extend_information+0x84>
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
object_blocks = _Workspace_Allocate( block_size );
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
7e24: e59d0004 ldr r0, [sp, #4]
7e28: eb000844 bl 9f40 <_Workspace_Free>
return;
7e2c: eaffffd6 b 7d8c <_Objects_Extend_information+0x220>
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7e30: e1a0200a mov r2, sl <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7e34: e1a06007 mov r6, r7 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7e38: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
7e3c: e1a0400b mov r4, fp <== NOT EXECUTED
7e40: eaffff6a b 7bf0 <_Objects_Extend_information+0x84> <== NOT EXECUTED
00008198 <_Objects_Shrink_information>:
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
Objects_Information *information
)
{
8198: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
819c: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
81a0: e1d051b4 ldrh r5, [r0, #20]
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
Objects_Information *information
)
{
81a4: e1a06000 mov r6, r0
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
81a8: e1d001b0 ldrh r0, [r0, #16]
81ac: e1a01005 mov r1, r5
81b0: e0640000 rsb r0, r4, r0
81b4: eb003cfd bl 175b0 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
81b8: e3500000 cmp r0, #0
81bc: 08bd80f0 popeq {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
81c0: e5962030 ldr r2, [r6, #48] ; 0x30
81c4: e5923000 ldr r3, [r2]
81c8: e1550003 cmp r5, r3
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
81cc: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
81d0: 1a000005 bne 81ec <_Objects_Shrink_information+0x54>
81d4: ea000008 b 81fc <_Objects_Shrink_information+0x64> <== NOT EXECUTED
81d8: e5b21004 ldr r1, [r2, #4]!
81dc: e1550001 cmp r5, r1
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
81e0: e0844005 add r4, r4, r5
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] ==
81e4: e1a07103 lsl r7, r3, #2
81e8: 0a000004 beq 8200 <_Objects_Shrink_information+0x68>
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
81ec: e2833001 add r3, r3, #1
81f0: e1530000 cmp r3, r0
81f4: 1afffff7 bne 81d8 <_Objects_Shrink_information+0x40>
81f8: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
81fc: e3a07000 mov r7, #0 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
8200: e5960020 ldr r0, [r6, #32]
8204: ea000002 b 8214 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
8208: e3550000 cmp r5, #0
820c: 0a00000b beq 8240 <_Objects_Shrink_information+0xa8>
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
8210: e1a00005 mov r0, r5
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) _Chain_First( &information->Inactive );
do {
index = _Objects_Get_index( the_object->id );
8214: e1d030b8 ldrh r3, [r0, #8]
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
8218: e1530004 cmp r3, r4
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
821c: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
8220: 3afffff8 bcc 8208 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
8224: e1d621b4 ldrh r2, [r6, #20]
8228: e0842002 add r2, r4, r2
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
822c: e1530002 cmp r3, r2
8230: 2afffff4 bcs 8208 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
8234: eb001008 bl c25c <_Chain_Extract>
}
}
while ( the_object );
8238: e3550000 cmp r5, #0
823c: 1afffff3 bne 8210 <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
8240: e5963034 ldr r3, [r6, #52] ; 0x34
8244: e7930007 ldr r0, [r3, r7]
8248: eb00073c bl 9f40 <_Workspace_Free>
information->object_blocks[ block ] = NULL;
824c: e5963034 ldr r3, [r6, #52] ; 0x34
8250: e7835007 str r5, [r3, r7]
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
8254: e1d612bc ldrh r1, [r6, #44] ; 0x2c
8258: e1d631b4 ldrh r3, [r6, #20]
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
825c: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
8260: e0633001 rsb r3, r3, r1
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
8264: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
8268: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
826c: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000de80 <_POSIX_Keys_Run_destructors>:
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
de80: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
de84: e5907008 ldr r7, [r0, #8]
de88: e59f5084 ldr r5, [pc, #132] ; df14 <_POSIX_Keys_Run_destructors+0x94>
de8c: e1a08c27 lsr r8, r7, #24
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
de90: e1a07807 lsl r7, r7, #16
de94: e2088007 and r8, r8, #7
de98: e1a07727 lsr r7, r7, #14
if ( value != NULL ) {
key->Values [ thread_api ][ thread_index ] = NULL;
de9c: e3a0a000 mov sl, #0
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
dea0: e1d541b0 ldrh r4, [r5, #16]
done = true;
for ( index = 1 ; index <= max ; ++index ) {
dea4: e3540000 cmp r4, #0
dea8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
deac: e3a06001 mov r6, #1
deb0: e1a02006 mov r2, r6
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
deb4: e595301c ldr r3, [r5, #28]
deb8: e7933106 ldr r3, [r3, r6, lsl #2]
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
debc: e3530000 cmp r3, #0
void *value = key->Values [ thread_api ][ thread_index ];
dec0: e2881005 add r1, r8, #5
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
dec4: 0a00000a beq def4 <_POSIX_Keys_Run_destructors+0x74>
dec8: e5930010 ldr r0, [r3, #16]
decc: e3500000 cmp r0, #0
ded0: 0a000007 beq def4 <_POSIX_Keys_Run_destructors+0x74>
void *value = key->Values [ thread_api ][ thread_index ];
ded4: e7931101 ldr r1, [r3, r1, lsl #2]
ded8: e7910007 ldr r0, [r1, r7]
if ( value != NULL ) {
dedc: e3500000 cmp r0, #0
dee0: 0a000003 beq def4 <_POSIX_Keys_Run_destructors+0x74>
key->Values [ thread_api ][ thread_index ] = NULL;
dee4: e781a007 str sl, [r1, r7] <== NOT EXECUTED
(*key->destructor)( value );
dee8: e1a0e00f mov lr, pc <== NOT EXECUTED
deec: e593f010 ldr pc, [r3, #16] <== NOT EXECUTED
done = false;
def0: e3a02000 mov r2, #0 <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
def4: e2866001 add r6, r6, #1
def8: e1a06806 lsl r6, r6, #16
defc: e1a06826 lsr r6, r6, #16
df00: e1540006 cmp r4, r6
df04: 2affffea bcs deb4 <_POSIX_Keys_Run_destructors+0x34>
* number of iterations. An infinite loop may happen if destructors set
* thread specific data. This can be considered dubious.
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
df08: e3520000 cmp r2, #0
df0c: 0affffe3 beq dea0 <_POSIX_Keys_Run_destructors+0x20>
df10: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000dbb4 <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
dbb4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
dbb8: e2527000 subs r7, r2, #0
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
dbbc: e1a05000 mov r5, r0
dbc0: e1a0a001 mov sl, r1
dbc4: e1a08003 mov r8, r3
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
dbc8: 1a00002a bne dc78 <_POSIX_Semaphore_Create_support+0xc4>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
dbcc: e59f30f4 ldr r3, [pc, #244] ; dcc8 <_POSIX_Semaphore_Create_support+0x114>
dbd0: e5932000 ldr r2, [r3]
++level;
dbd4: e2822001 add r2, r2, #1
_Thread_Dispatch_disable_level = level;
dbd8: e5832000 str r2, [r3]
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
dbdc: e59f60e8 ldr r6, [pc, #232] ; dccc <_POSIX_Semaphore_Create_support+0x118>
dbe0: e1a00006 mov r0, r6
dbe4: ebffeed7 bl 9748 <_Objects_Allocate>
rtems_set_errno_and_return_minus_one( ENOSYS );
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
dbe8: e2504000 subs r4, r0, #0
dbec: 0a000026 beq dc8c <_POSIX_Semaphore_Create_support+0xd8>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
dbf0: e3550000 cmp r5, #0
dbf4: 0a00001a beq dc64 <_POSIX_Semaphore_Create_support+0xb0>
name = _Workspace_String_duplicate( name_arg, name_len );
dbf8: e1a00005 mov r0, r5
dbfc: e1a0100a mov r1, sl
dc00: eb000481 bl ee0c <_Workspace_String_duplicate>
if ( !name ) {
dc04: e2505000 subs r5, r0, #0
dc08: 0a000025 beq dca4 <_POSIX_Semaphore_Create_support+0xf0>
}
the_semaphore->process_shared = pshared;
if ( name ) {
the_semaphore->named = true;
dc0c: e3a03001 mov r3, #1
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
dc10: e5847010 str r7, [r4, #16]
if ( name ) {
the_semaphore->named = true;
dc14: e5c43014 strb r3, [r4, #20]
the_semaphore->open_count = 1;
dc18: e5843018 str r3, [r4, #24]
the_semaphore->linked = true;
dc1c: e5c43015 strb r3, [r4, #21]
* blocking tasks on this semaphore should be. It could somehow
* be derived from the current scheduling policy. One
* thing is certain, no matter what we decide, it won't be
* the same as all other POSIX implementations. :)
*/
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
dc20: e3a07000 mov r7, #0
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
dc24: e3e03000 mvn r3, #0
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
dc28: e284001c add r0, r4, #28
dc2c: e284105c add r1, r4, #92 ; 0x5c
dc30: e1a02008 mov r2, r8
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
dc34: e584305c str r3, [r4, #92] ; 0x5c
* blocking tasks on this semaphore should be. It could somehow
* be derived from the current scheduling policy. One
* thing is certain, no matter what we decide, it won't be
* the same as all other POSIX implementations. :)
*/
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
dc38: e5847060 str r7, [r4, #96] ; 0x60
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
dc3c: ebffed31 bl 9108 <_CORE_semaphore_Initialize>
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
dc40: e596301c ldr r3, [r6, #28]
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
dc44: e1d420b8 ldrh r2, [r4, #8]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
dc48: e7834102 str r4, [r3, r2, lsl #2]
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
dc4c: e59d301c ldr r3, [sp, #28]
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
dc50: e584500c str r5, [r4, #12]
dc54: e5834000 str r4, [r3]
_Thread_Enable_dispatch();
dc58: ebfff3ca bl ab88 <_Thread_Enable_dispatch>
return 0;
dc5c: e1a00007 mov r0, r7
}
dc60: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
dc64: e5845010 str r5, [r4, #16]
if ( name ) {
the_semaphore->named = true;
the_semaphore->open_count = 1;
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
dc68: e5c45014 strb r5, [r4, #20]
the_semaphore->open_count = 0;
dc6c: e5845018 str r5, [r4, #24]
the_semaphore->linked = false;
dc70: e5c45015 strb r5, [r4, #21]
dc74: eaffffe9 b dc20 <_POSIX_Semaphore_Create_support+0x6c>
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
rtems_set_errno_and_return_minus_one( ENOSYS );
dc78: eb000a26 bl 10518 <__errno>
dc7c: e3a03058 mov r3, #88 ; 0x58
dc80: e5803000 str r3, [r0]
dc84: e3e00000 mvn r0, #0
dc88: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
dc8c: ebfff3bd bl ab88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
dc90: eb000a20 bl 10518 <__errno>
dc94: e3a0301c mov r3, #28
dc98: e5803000 str r3, [r0]
dc9c: e3e00000 mvn r0, #0
dca0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
dca4: e1a00006 mov r0, r6 <== NOT EXECUTED
dca8: e1a01004 mov r1, r4 <== NOT EXECUTED
dcac: ebffef83 bl 9ac0 <_Objects_Free> <== NOT EXECUTED
*/
if ( name_arg != NULL ) {
name = _Workspace_String_duplicate( name_arg, name_len );
if ( !name ) {
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
dcb0: ebfff3b4 bl ab88 <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
dcb4: eb000a17 bl 10518 <__errno> <== NOT EXECUTED
dcb8: e3a0300c mov r3, #12 <== NOT EXECUTED
dcbc: e5803000 str r3, [r0] <== NOT EXECUTED
dcc0: e3e00000 mvn r0, #0 <== NOT EXECUTED
dcc4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000b9f0 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
b9f0: e92d40f0 push {r4, r5, r6, r7, lr}
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
b9f4: e1a00001 mov r0, r1
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
b9f8: e1a06001 mov r6, r1
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
b9fc: e59170f4 ldr r7, [r1, #244] ; 0xf4
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
ba00: eb000905 bl de1c <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
ba04: e1a00006 mov r0, r6
ba08: eb00091c bl de80 <_POSIX_Keys_Run_destructors>
ba0c: e2874044 add r4, r7, #68 ; 0x44
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
ba10: e5965028 ldr r5, [r6, #40] ; 0x28
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
ba14: ea000001 b ba20 <_POSIX_Threads_Delete_extension+0x30>
*(void **)the_thread->Wait.return_argument = value_ptr;
ba18: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED
ba1c: e5835000 str r5, [r3] <== NOT EXECUTED
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
ba20: e1a00004 mov r0, r4
ba24: ebfff5fe bl 9224 <_Thread_queue_Dequeue>
ba28: e3500000 cmp r0, #0
ba2c: 1afffff9 bne ba18 <_POSIX_Threads_Delete_extension+0x28>
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
ba30: e5973084 ldr r3, [r7, #132] ; 0x84
ba34: e3530004 cmp r3, #4
ba38: 0a000004 beq ba50 <_POSIX_Threads_Delete_extension+0x60>
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
ba3c: e3a03000 mov r3, #0
_Workspace_Free( api );
ba40: e1a00007 mov r0, r7
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
ba44: e58630f4 str r3, [r6, #244] ; 0xf4
_Workspace_Free( api );
}
ba48: e8bd40f0 pop {r4, r5, r6, r7, lr}
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
_Workspace_Free( api );
ba4c: eafff93b b 9f40 <_Workspace_Free>
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
ba50: e28700a8 add r0, r7, #168 ; 0xa8
ba54: ebfff895 bl 9cb0 <_Watchdog_Remove>
ba58: eafffff7 b ba3c <_POSIX_Threads_Delete_extension+0x4c>
0000b868 <_POSIX_signals_Abnormal_termination_handler>:
sigset_t _POSIX_signals_Pending;
void _POSIX_signals_Abnormal_termination_handler(
int signo __attribute__((unused)) )
{
b868: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
exit( 1 );
b86c: e3a00001 mov r0, #1 <== NOT EXECUTED
b870: eb000b61 bl e5fc <exit> <== NOT EXECUTED
0000e554 <_POSIX_signals_Clear_process_signals>:
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
e554: e10f2000 mrs r2, CPSR
e558: e3823080 orr r3, r2, #128 ; 0x80
e55c: e129f003 msr CPSR_fc, r3
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
e560: e59f1050 ldr r1, [pc, #80] ; e5b8 <_POSIX_signals_Clear_process_signals+0x64>
e564: e0803080 add r3, r0, r0, lsl #1
e568: e1a03103 lsl r3, r3, #2
e56c: e7911003 ldr r1, [r1, r3]
e570: e3510002 cmp r1, #2
e574: 0a000007 beq e598 <_POSIX_signals_Clear_process_signals+0x44>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
e578: e59f303c ldr r3, [pc, #60] ; e5bc <_POSIX_signals_Clear_process_signals+0x68>
e57c: e5931000 ldr r1, [r3]
e580: e3a0c001 mov ip, #1
e584: e2400001 sub r0, r0, #1
e588: e1c1001c bic r0, r1, ip, lsl r0
e58c: e5830000 str r0, [r3]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
e590: e129f002 msr CPSR_fc, r2
}
_ISR_Enable( level );
}
e594: e12fff1e bx lr
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
e598: e59f1020 ldr r1, [pc, #32] ; e5c0 <_POSIX_signals_Clear_process_signals+0x6c>
e59c: e083c001 add ip, r3, r1
e5a0: e7931001 ldr r1, [r3, r1]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
e5a4: e28c3004 add r3, ip, #4
e5a8: e1510003 cmp r1, r3
e5ac: 0afffff1 beq e578 <_POSIX_signals_Clear_process_signals+0x24>
e5b0: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
}
e5b4: e12fff1e bx lr <== NOT EXECUTED
00019e54 <_POSIX_signals_Unblock_thread>:
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
19e54: e590c010 ldr ip, [r0, #16]
19e58: e59f310c ldr r3, [pc, #268] ; 19f6c <_POSIX_signals_Unblock_thread+0x118>
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
19e5c: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
19e60: e59f7104 ldr r7, [pc, #260] ; 19f6c <_POSIX_signals_Unblock_thread+0x118>
19e64: e00c3003 and r3, ip, r3
19e68: e2416001 sub r6, r1, #1
19e6c: e3a05001 mov r5, #1
19e70: e1530007 cmp r3, r7
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
19e74: e1a04000 mov r4, r0
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
19e78: e59030f4 ldr r3, [r0, #244] ; 0xf4
19e7c: e1a06615 lsl r6, r5, r6
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
19e80: 0a000017 beq 19ee4 <_POSIX_signals_Unblock_thread+0x90>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
19e84: e59330d0 ldr r3, [r3, #208] ; 0xd0
19e88: e1d66003 bics r6, r6, r3
19e8c: 0a000012 beq 19edc <_POSIX_signals_Unblock_thread+0x88>
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
19e90: e21c6201 ands r6, ip, #268435456 ; 0x10000000
19e94: 0a00000e beq 19ed4 <_POSIX_signals_Unblock_thread+0x80>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
19e98: e59f50d0 ldr r5, [pc, #208] ; 19f70 <_POSIX_signals_Unblock_thread+0x11c>
19e9c: e00c5005 and r5, ip, r5
the_thread->Wait.return_code = EINTR;
19ea0: e3a03004 mov r3, #4
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
19ea4: e3550000 cmp r5, #0
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
the_thread->Wait.return_code = EINTR;
19ea8: e5803034 str r3, [r0, #52] ; 0x34
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
19eac: 1a00002b bne 19f60 <_POSIX_signals_Unblock_thread+0x10c>
_Thread_queue_Extract_with_proxy( the_thread );
else if ( _States_Is_delaying(the_thread->current_state) ) {
19eb0: e21c0008 ands r0, ip, #8
19eb4: 08bd80f0 popeq {r4, r5, r6, r7, pc}
(void) _Watchdog_Remove( &the_thread->Timer );
19eb8: e2840048 add r0, r4, #72 ; 0x48
19ebc: ebffbf7b bl 9cb0 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
19ec0: e1a00004 mov r0, r4
19ec4: e59f10a8 ldr r1, [pc, #168] ; 19f74 <_POSIX_signals_Unblock_thread+0x120>
19ec8: ebffbb05 bl 8ae4 <_Thread_Clear_state>
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
19ecc: e1a00005 mov r0, r5
19ed0: e8bd80f0 pop {r4, r5, r6, r7, pc}
else if ( _States_Is_delaying(the_thread->current_state) ) {
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
19ed4: e35c0000 cmp ip, #0
19ed8: 0a000015 beq 19f34 <_POSIX_signals_Unblock_thread+0xe0>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
19edc: e1a00006 mov r0, r6
19ee0: e8bd80f0 pop {r4, r5, r6, r7, pc}
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
19ee4: e5900030 ldr r0, [r0, #48] ; 0x30
19ee8: e1160000 tst r6, r0
19eec: 0a00000c beq 19f24 <_POSIX_signals_Unblock_thread+0xd0>
the_thread->Wait.return_code = EINTR;
19ef0: e3a03004 mov r3, #4
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
19ef4: e3520000 cmp r2, #0
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
the_thread->Wait.return_code = EINTR;
19ef8: e5843034 str r3, [r4, #52] ; 0x34
the_info = (siginfo_t *) the_thread->Wait.return_argument;
19efc: e5943028 ldr r3, [r4, #40] ; 0x28
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
19f00: 18920007 ldmne r2, {r0, r1, r2}
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
19f04: 05831000 streq r1, [r3]
the_info->si_code = SI_USER;
19f08: 03a01001 moveq r1, #1
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
19f0c: 18830007 stmne r3, {r0, r1, r2}
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
19f10: 09830006 stmibeq r3, {r1, r2}
} else {
*the_info = *info;
}
_Thread_queue_Extract_with_proxy( the_thread );
19f14: e1a00004 mov r0, r4
19f18: ebffbdb1 bl 95e4 <_Thread_queue_Extract_with_proxy>
return true;
19f1c: e3a00001 mov r0, #1
19f20: e8bd80f0 pop {r4, r5, r6, r7, pc}
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
19f24: e59300d0 ldr r0, [r3, #208] ; 0xd0
19f28: e1d60000 bics r0, r6, r0
19f2c: 1affffef bne 19ef0 <_POSIX_signals_Unblock_thread+0x9c>
19f30: e8bd80f0 pop {r4, r5, r6, r7, pc}
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
19f34: e59f203c ldr r2, [pc, #60] ; 19f78 <_POSIX_signals_Unblock_thread+0x124>
19f38: e5920000 ldr r0, [r2]
19f3c: e3500000 cmp r0, #0
19f40: 08bd80f0 popeq {r4, r5, r6, r7, pc}
19f44: e5923008 ldr r3, [r2, #8]
19f48: e1540003 cmp r4, r3
_Thread_Dispatch_necessary = true;
19f4c: 05c25004 strbeq r5, [r2, #4]
}
}
return false;
19f50: 01a0000c moveq r0, ip
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
19f54: 08bd80f0 popeq {r4, r5, r6, r7, pc}
_Thread_Dispatch_necessary = true;
}
}
return false;
19f58: e1a0000c mov r0, ip <== NOT EXECUTED
}
19f5c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
_Thread_queue_Extract_with_proxy( the_thread );
19f60: ebffbd9f bl 95e4 <_Thread_queue_Extract_with_proxy>
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
19f64: e3a00000 mov r0, #0
19f68: e8bd80f0 pop {r4, r5, r6, r7, pc}
00008f64 <_RBTree_Extract_validate_unprotected>:
)
{
RBTree_Node *parent, *sibling;
RBTree_Direction dir;
parent = the_node->parent;
8f64: e5903000 ldr r3, [r0]
if(!parent->parent) return;
8f68: e5932000 ldr r2, [r3]
8f6c: e3520000 cmp r2, #0
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
RBTree_Node *the_node
)
{
8f70: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl}
RBTree_Node *parent, *sibling;
RBTree_Direction dir;
parent = the_node->parent;
if(!parent->parent) return;
8f74: 0a00002f beq 9038 <_RBTree_Extract_validate_unprotected+0xd4>
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(the_node == the_node->parent->child[RBT_LEFT])
8f78: e5932004 ldr r2, [r3, #4]
8f7c: e1500002 cmp r0, r2
return the_node->parent->child[RBT_RIGHT];
8f80: 05932008 ldreq r2, [r3, #8]
* Now the_node has a black sibling and red parent. After rotation,
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
sibling->color = RBT_BLACK;
8f84: e3a06000 mov r6, #0
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
8f88: e3a05001 mov r5, #1
8f8c: ea000022 b 901c <_RBTree_Extract_validate_unprotected+0xb8>
if(!parent->parent) return;
sibling = _RBTree_Sibling(the_node);
/* continue to correct tree as long as the_node is black and not the root */
while (!_RBTree_Is_red(the_node) && parent->parent) {
8f90: e5931000 ldr r1, [r3]
8f94: e3510000 cmp r1, #0
8f98: 0a000022 beq 9028 <_RBTree_Extract_validate_unprotected+0xc4>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
8f9c: e3520000 cmp r2, #0
8fa0: 0a000002 beq 8fb0 <_RBTree_Extract_validate_unprotected+0x4c>
8fa4: e592c00c ldr ip, [r2, #12]
8fa8: e35c0001 cmp ip, #1
8fac: 0a000023 beq 9040 <_RBTree_Extract_validate_unprotected+0xdc>
_RBTree_Rotate(parent, dir);
sibling = parent->child[_RBTree_Opposite_direction(dir)];
}
/* sibling is black, see if both of its children are also black. */
if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) &&
8fb0: e5921008 ldr r1, [r2, #8]
8fb4: e3510000 cmp r1, #0
8fb8: 0a000002 beq 8fc8 <_RBTree_Extract_validate_unprotected+0x64>
8fbc: e591c00c ldr ip, [r1, #12]
8fc0: e35c0001 cmp ip, #1
8fc4: 0a000042 beq 90d4 <_RBTree_Extract_validate_unprotected+0x170>
!_RBTree_Is_red(sibling->child[RBT_LEFT])) {
8fc8: e592c004 ldr ip, [r2, #4]
8fcc: e35c0000 cmp ip, #0
8fd0: 0a000002 beq 8fe0 <_RBTree_Extract_validate_unprotected+0x7c>
8fd4: e59cc00c ldr ip, [ip, #12]
8fd8: e35c0001 cmp ip, #1
8fdc: 0a00003c beq 90d4 <_RBTree_Extract_validate_unprotected+0x170>
sibling->color = RBT_RED;
8fe0: e582500c str r5, [r2, #12]
8fe4: e593200c ldr r2, [r3, #12]
8fe8: e3520001 cmp r2, #1
8fec: 0a000033 beq 90c0 <_RBTree_Extract_validate_unprotected+0x15c>
if (_RBTree_Is_red(parent)) {
parent->color = RBT_BLACK;
break;
}
the_node = parent; /* done if parent is red */
parent = the_node->parent;
8ff0: e5931000 ldr r1, [r3]
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
8ff4: e3510000 cmp r1, #0
8ff8: 0a000033 beq 90cc <_RBTree_Extract_validate_unprotected+0x168>
if(!(the_node->parent->parent)) return NULL;
8ffc: e5912000 ldr r2, [r1]
9000: e3520000 cmp r2, #0
9004: 0a000002 beq 9014 <_RBTree_Extract_validate_unprotected+0xb0>
if(the_node == the_node->parent->child[RBT_LEFT])
9008: e5912004 ldr r2, [r1, #4]
900c: e1530002 cmp r3, r2
return the_node->parent->child[RBT_RIGHT];
9010: 05912008 ldreq r2, [r1, #8]
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
c->parent = the_node->parent;
the_node->parent = c;
9014: e1a00003 mov r0, r3
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
9018: e1a03001 mov r3, r1
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
901c: e590100c ldr r1, [r0, #12]
9020: e3510001 cmp r1, #1
9024: 1affffd9 bne 8f90 <_RBTree_Extract_validate_unprotected+0x2c>
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
_RBTree_Rotate(parent, dir);
break; /* done */
}
} /* while */
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
9028: e5903000 ldr r3, [r0]
902c: e5933000 ldr r3, [r3]
9030: e3530000 cmp r3, #0
9034: 0580300c streq r3, [r0, #12]
}
9038: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl}
903c: e12fff1e bx lr
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
sibling->color = RBT_BLACK;
dir = the_node != parent->child[0];
9040: e5934004 ldr r4, [r3, #4]
9044: e054a000 subs sl, r4, r0
9048: 13a0a001 movne sl, #1
* This function maintains the properties of the red-black tree.
*
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
904c: e22a7001 eor r7, sl, #1
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
9050: e2878001 add r8, r7, #1
9054: e7939108 ldr r9, [r3, r8, lsl #2]
9058: e3590000 cmp r9, #0
* then rotate parent left, making the sibling be the_node's grandparent.
* Now the_node has a black sibling and red parent. After rotation,
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
905c: e583c00c str ip, [r3, #12]
sibling->color = RBT_BLACK;
9060: e582600c str r6, [r2, #12]
9064: 01a02009 moveq r2, r9
9068: 0affffd0 beq 8fb0 <_RBTree_Extract_validate_unprotected+0x4c>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
906c: e3570000 cmp r7, #0
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
9070: 15934008 ldrne r4, [r3, #8]
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
9074: e28a2001 add r2, sl, #1
9078: e794a102 ldr sl, [r4, r2, lsl #2]
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
907c: 01a0c007 moveq ip, r7
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
9080: e28cc001 add ip, ip, #1
9084: e783a10c str sl, [r3, ip, lsl #2]
if (c->child[dir])
9088: e794c102 ldr ip, [r4, r2, lsl #2]
908c: e35c0000 cmp ip, #0
c->child[dir]->parent = the_node;
9090: 158c3000 strne r3, [ip]
c->child[dir] = the_node;
9094: e7843102 str r3, [r4, r2, lsl #2]
9098: 15931000 ldrne r1, [r3]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
909c: e5912004 ldr r2, [r1, #4]
90a0: e1530002 cmp r3, r2
90a4: 13a02008 movne r2, #8
90a8: 03a02004 moveq r2, #4
90ac: e7824001 str r4, [r2, r1]
c->parent = the_node->parent;
90b0: e5841000 str r1, [r4]
the_node->parent = c;
90b4: e7932108 ldr r2, [r3, r8, lsl #2]
90b8: e5834000 str r4, [r3]
90bc: eaffffbb b 8fb0 <_RBTree_Extract_validate_unprotected+0x4c>
/* sibling is black, see if both of its children are also black. */
if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) &&
!_RBTree_Is_red(sibling->child[RBT_LEFT])) {
sibling->color = RBT_RED;
if (_RBTree_Is_red(parent)) {
parent->color = RBT_BLACK;
90c0: e3a02000 mov r2, #0
90c4: e583200c str r2, [r3, #12]
break;
90c8: eaffffd6 b 9028 <_RBTree_Extract_validate_unprotected+0xc4>
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
90cc: e1a02001 mov r2, r1 <== NOT EXECUTED
90d0: eaffffcf b 9014 <_RBTree_Extract_validate_unprotected+0xb0><== NOT EXECUTED
* cases, either the_node is to the left or the right of the parent.
* In both cases, first check if one of sibling's children is black,
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
90d4: e5936004 ldr r6, [r3, #4]
90d8: e0566000 subs r6, r6, r0
90dc: 13a06001 movne r6, #1
* This function maintains the properties of the red-black tree.
*
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
90e0: e2265001 eor r5, r6, #1
* In both cases, first check if one of sibling's children is black,
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
90e4: e285c001 add ip, r5, #1
90e8: e792410c ldr r4, [r2, ip, lsl #2]
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
90ec: e3540000 cmp r4, #0
90f0: 0a000003 beq 9104 <_RBTree_Extract_validate_unprotected+0x1a0>
90f4: e594700c ldr r7, [r4, #12]
90f8: e3570001 cmp r7, #1
90fc: 0793710c ldreq r7, [r3, ip, lsl #2]
9100: 0a00001f beq 9184 <_RBTree_Extract_validate_unprotected+0x220>
* This function maintains the properties of the red-black tree.
*
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
9104: e2254001 eor r4, r5, #1
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
9108: e2848001 add r8, r4, #1
910c: e792a108 ldr sl, [r2, r8, lsl #2]
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
sibling->child[dir]->color = RBT_BLACK;
9110: e2867001 add r7, r6, #1
9114: e7928107 ldr r8, [r2, r7, lsl #2]
9118: e35a0000 cmp sl, #0
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
911c: e3a07001 mov r7, #1
sibling->child[dir]->color = RBT_BLACK;
9120: e3a0a000 mov sl, #0
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
9124: e582700c str r7, [r2, #12]
sibling->child[dir]->color = RBT_BLACK;
9128: e588a00c str sl, [r8, #12]
912c: 0a000011 beq 9178 <_RBTree_Extract_validate_unprotected+0x214>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
9130: e3540000 cmp r4, #0
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
9134: 05921004 ldreq r1, [r2, #4]
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
9138: 11a04007 movne r4, r7
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
913c: e791810c ldr r8, [r1, ip, lsl #2]
9140: e2844001 add r4, r4, #1
9144: e7828104 str r8, [r2, r4, lsl #2]
if (c->child[dir])
9148: e791410c ldr r4, [r1, ip, lsl #2]
914c: e3540000 cmp r4, #0
c->child[dir]->parent = the_node;
9150: 15842000 strne r2, [r4]
c->child[dir] = the_node;
9154: e781210c str r2, [r1, ip, lsl #2]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
9158: e5924000 ldr r4, [r2]
915c: e5947004 ldr r7, [r4, #4]
9160: e1520007 cmp r2, r7
9164: 13a07008 movne r7, #8
9168: 03a07004 moveq r7, #4
c->parent = the_node->parent;
916c: e5814000 str r4, [r1]
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
9170: e7871004 str r1, [r7, r4]
c->parent = the_node->parent;
the_node->parent = c;
9174: e5821000 str r1, [r2]
_RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir));
sibling = parent->child[_RBTree_Opposite_direction(dir)];
9178: e793210c ldr r2, [r3, ip, lsl #2]
917c: e792410c ldr r4, [r2, ip, lsl #2]
9180: e1a07002 mov r7, r2
}
sibling->color = parent->color;
9184: e593c00c ldr ip, [r3, #12]
parent->color = RBT_BLACK;
9188: e3a01000 mov r1, #0
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
918c: e1570001 cmp r7, r1
sibling->color = RBT_RED;
sibling->child[dir]->color = RBT_BLACK;
_RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir));
sibling = parent->child[_RBTree_Opposite_direction(dir)];
}
sibling->color = parent->color;
9190: e582c00c str ip, [r2, #12]
parent->color = RBT_BLACK;
9194: e583100c str r1, [r3, #12]
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
9198: e584100c str r1, [r4, #12]
919c: 0affffa1 beq 9028 <_RBTree_Extract_validate_unprotected+0xc4>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
91a0: e1550001 cmp r5, r1
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
91a4: 05932004 ldreq r2, [r3, #4]
91a8: 15932008 ldrne r2, [r3, #8]
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
91ac: e2866001 add r6, r6, #1
91b0: e7921106 ldr r1, [r2, r6, lsl #2]
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
91b4: 13a05001 movne r5, #1
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
91b8: e2855001 add r5, r5, #1
91bc: e7831105 str r1, [r3, r5, lsl #2]
if (c->child[dir])
91c0: e7921106 ldr r1, [r2, r6, lsl #2]
91c4: e3510000 cmp r1, #0
c->child[dir]->parent = the_node;
91c8: 15813000 strne r3, [r1]
c->child[dir] = the_node;
91cc: e7823106 str r3, [r2, r6, lsl #2]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
91d0: e5931000 ldr r1, [r3]
91d4: e591c004 ldr ip, [r1, #4]
91d8: e153000c cmp r3, ip
91dc: 13a0c008 movne ip, #8
91e0: 03a0c004 moveq ip, #4
c->parent = the_node->parent;
91e4: e5821000 str r1, [r2]
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
91e8: e78c2001 str r2, [ip, r1]
c->parent = the_node->parent;
the_node->parent = c;
91ec: e5832000 str r2, [r3]
91f0: eaffff8c b 9028 <_RBTree_Extract_validate_unprotected+0xc4>
00009c44 <_Scheduler_CBS_Cleanup>:
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulercbs.h>
int _Scheduler_CBS_Cleanup (void)
{
9c44: e92d4070 push {r4, r5, r6, lr}
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9c48: e59f5054 ldr r5, [pc, #84] ; 9ca4 <_Scheduler_CBS_Cleanup+0x60>
9c4c: e5953000 ldr r3, [r5]
9c50: e3530000 cmp r3, #0
9c54: 0a00000f beq 9c98 <_Scheduler_CBS_Cleanup+0x54>
9c58: e59f6048 ldr r6, [pc, #72] ; 9ca8 <_Scheduler_CBS_Cleanup+0x64>
9c5c: e5960000 ldr r0, [r6]
9c60: e3a04000 mov r4, #0
if ( _Scheduler_CBS_Server_list[ i ] )
9c64: e7903104 ldr r3, [r0, r4, lsl #2]
9c68: e3530000 cmp r3, #0
9c6c: 0a000002 beq 9c7c <_Scheduler_CBS_Cleanup+0x38>
_Scheduler_CBS_Destroy_server( i );
9c70: e1a00004 mov r0, r4
9c74: eb000043 bl 9d88 <_Scheduler_CBS_Destroy_server>
9c78: e5960000 ldr r0, [r6]
int _Scheduler_CBS_Cleanup (void)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9c7c: e5953000 ldr r3, [r5]
9c80: e2844001 add r4, r4, #1
9c84: e1530004 cmp r3, r4
9c88: 8afffff5 bhi 9c64 <_Scheduler_CBS_Cleanup+0x20>
if ( _Scheduler_CBS_Server_list[ i ] )
_Scheduler_CBS_Destroy_server( i );
}
_Workspace_Free( _Scheduler_CBS_Server_list );
9c8c: eb0007df bl bc10 <_Workspace_Free>
return SCHEDULER_CBS_OK;
}
9c90: e3a00000 mov r0, #0
9c94: e8bd8070 pop {r4, r5, r6, pc}
int _Scheduler_CBS_Cleanup (void)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9c98: e59f3008 ldr r3, [pc, #8] ; 9ca8 <_Scheduler_CBS_Cleanup+0x64><== NOT EXECUTED
9c9c: e5930000 ldr r0, [r3] <== NOT EXECUTED
9ca0: eafffff9 b 9c8c <_Scheduler_CBS_Cleanup+0x48> <== NOT EXECUTED
00009cac <_Scheduler_CBS_Create_server>:
)
{
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
9cac: e5903004 ldr r3, [r0, #4]
9cb0: e3530000 cmp r3, #0
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
9cb4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
9cb8: e1a04000 mov r4, r0
9cbc: e1a05001 mov r5, r1
9cc0: e1a07002 mov r7, r2
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
9cc4: da000029 ble 9d70 <_Scheduler_CBS_Create_server+0xc4>
9cc8: e5903000 ldr r3, [r0]
9ccc: e3530000 cmp r3, #0
9cd0: da000026 ble 9d70 <_Scheduler_CBS_Create_server+0xc4>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9cd4: e59f30a4 ldr r3, [pc, #164] ; 9d80 <_Scheduler_CBS_Create_server+0xd4>
9cd8: e5930000 ldr r0, [r3]
9cdc: e3500000 cmp r0, #0
9ce0: 0a00000d beq 9d1c <_Scheduler_CBS_Create_server+0x70>
if ( !_Scheduler_CBS_Server_list[i] )
9ce4: e59f8098 ldr r8, [pc, #152] ; 9d84 <_Scheduler_CBS_Create_server+0xd8>
9ce8: e5986000 ldr r6, [r8]
9cec: e596a000 ldr sl, [r6]
9cf0: e35a0000 cmp sl, #0
9cf4: 11a02006 movne r2, r6
9cf8: 13a03000 movne r3, #0
9cfc: 1a000003 bne 9d10 <_Scheduler_CBS_Create_server+0x64>
9d00: ea000018 b 9d68 <_Scheduler_CBS_Create_server+0xbc>
9d04: e5b21004 ldr r1, [r2, #4]!
9d08: e3510000 cmp r1, #0
9d0c: 0a000004 beq 9d24 <_Scheduler_CBS_Create_server+0x78>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9d10: e2833001 add r3, r3, #1
9d14: e1530000 cmp r3, r0
9d18: 1afffff9 bne 9d04 <_Scheduler_CBS_Create_server+0x58>
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
9d1c: e3e00019 mvn r0, #25
9d20: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9d24: e1a0a103 lsl sl, r3, #2
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
9d28: e5873000 str r3, [r7]
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
9d2c: e3a00010 mov r0, #16
9d30: eb0007b0 bl bbf8 <_Workspace_Allocate>
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
9d34: e786000a str r0, [r6, sl]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
9d38: e5972000 ldr r2, [r7]
9d3c: e5983000 ldr r3, [r8]
9d40: e7933102 ldr r3, [r3, r2, lsl #2]
if ( !the_server )
9d44: e3530000 cmp r3, #0
9d48: 0a00000a beq 9d78 <_Scheduler_CBS_Create_server+0xcc>
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
9d4c: e8940003 ldm r4, {r0, r1}
the_server->task_id = -1;
9d50: e3e02000 mvn r2, #0
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
9d54: e9830003 stmib r3, {r0, r1}
the_server->task_id = -1;
9d58: e5832000 str r2, [r3]
the_server->cbs_budget_overrun = budget_overrun_callback;
9d5c: e583500c str r5, [r3, #12]
return SCHEDULER_CBS_OK;
9d60: e3a00000 mov r0, #0
9d64: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( !_Scheduler_CBS_Server_list[i] )
9d68: e1a0300a mov r3, sl
9d6c: eaffffed b 9d28 <_Scheduler_CBS_Create_server+0x7c>
if ( params->budget <= 0 ||
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
9d70: e3e00011 mvn r0, #17
9d74: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
9d78: e3e00010 mvn r0, #16 <== NOT EXECUTED
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
9d7c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000726c <_TOD_Validate>:
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
726c: e92d4010 push {r4, lr}
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
7270: e2504000 subs r4, r0, #0
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
7274: 01a00004 moveq r0, r4
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
7278: 08bd8010 popeq {r4, pc}
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
727c: e59f3098 ldr r3, [pc, #152] ; 731c <_TOD_Validate+0xb0>
7280: e59f0098 ldr r0, [pc, #152] ; 7320 <_TOD_Validate+0xb4>
7284: e593100c ldr r1, [r3, #12]
7288: eb0048d3 bl 195dc <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
728c: e5943018 ldr r3, [r4, #24]
7290: e1500003 cmp r0, r3
7294: 9a00001c bls 730c <_TOD_Validate+0xa0>
(the_tod->ticks >= ticks_per_second) ||
7298: e5943014 ldr r3, [r4, #20]
729c: e353003b cmp r3, #59 ; 0x3b
72a0: 8a000019 bhi 730c <_TOD_Validate+0xa0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
72a4: e5943010 ldr r3, [r4, #16]
72a8: e353003b cmp r3, #59 ; 0x3b
72ac: 8a000016 bhi 730c <_TOD_Validate+0xa0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
72b0: e594300c ldr r3, [r4, #12]
72b4: e3530017 cmp r3, #23
72b8: 8a000013 bhi 730c <_TOD_Validate+0xa0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
72bc: e5940004 ldr r0, [r4, #4]
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
72c0: e3500000 cmp r0, #0
72c4: 08bd8010 popeq {r4, pc}
(the_tod->month == 0) ||
72c8: e350000c cmp r0, #12
72cc: 8a00000e bhi 730c <_TOD_Validate+0xa0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
72d0: e5943000 ldr r3, [r4]
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
72d4: e59f2048 ldr r2, [pc, #72] ; 7324 <_TOD_Validate+0xb8>
72d8: e1530002 cmp r3, r2
72dc: 9a00000a bls 730c <_TOD_Validate+0xa0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
72e0: e5944008 ldr r4, [r4, #8]
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
72e4: e3540000 cmp r4, #0
72e8: 0a000009 beq 7314 <_TOD_Validate+0xa8>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
72ec: e3130003 tst r3, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
72f0: e59f3030 ldr r3, [pc, #48] ; 7328 <_TOD_Validate+0xbc>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
72f4: 0280000d addeq r0, r0, #13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
72f8: e7930100 ldr r0, [r3, r0, lsl #2]
const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = {
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
bool _TOD_Validate(
72fc: e1500004 cmp r0, r4
7300: 33a00000 movcc r0, #0
7304: 23a00001 movcs r0, #1
7308: e8bd8010 pop {r4, pc}
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
730c: e3a00000 mov r0, #0
7310: e8bd8010 pop {r4, pc}
7314: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
7318: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00016d24 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
16d24: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
16d28: e24dd024 sub sp, sp, #36 ; 0x24
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
16d2c: e28d6018 add r6, sp, #24
16d30: e28d1010 add r1, sp, #16
16d34: e2862004 add r2, r6, #4
16d38: e58d100c str r1, [sp, #12]
16d3c: e58d2018 str r2, [sp, #24]
head->previous = NULL;
tail->previous = head;
16d40: e28d100c add r1, sp, #12
16d44: e28d201c add r2, sp, #28
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
16d48: e3a03000 mov r3, #0
tail->previous = head;
16d4c: e58d1014 str r1, [sp, #20]
16d50: e58d2000 str r2, [sp]
16d54: e2801008 add r1, r0, #8
16d58: e2802040 add r2, r0, #64 ; 0x40
16d5c: e2807068 add r7, r0, #104 ; 0x68
16d60: e2805030 add r5, r0, #48 ; 0x30
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
16d64: e58d3010 str r3, [sp, #16]
16d68: e58d301c str r3, [sp, #28]
tail->previous = head;
16d6c: e58d6020 str r6, [sp, #32]
16d70: e59f81b8 ldr r8, [pc, #440] ; 16f30 <_Timer_server_Body+0x20c>
16d74: e59f91b8 ldr r9, [pc, #440] ; 16f34 <_Timer_server_Body+0x210>
16d78: e58d1004 str r1, [sp, #4]
16d7c: e58d2008 str r2, [sp, #8]
* 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;
16d80: e1a0a007 mov sl, r7
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
16d84: e1a04000 mov r4, r0
16d88: e28db010 add fp, sp, #16
* 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;
16d8c: e1a07005 mov r7, r5
{
/*
* 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;
16d90: e28d300c add r3, sp, #12
16d94: e5843078 str r3, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
16d98: e5983000 ldr r3, [r8]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
16d9c: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16da0: e1a00007 mov r0, r7
16da4: e0611003 rsb r1, r1, r3
16da8: e1a02006 mov r2, r6
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
16dac: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16db0: eb00119e bl 1b430 <_Watchdog_Adjust_to_chain>
16db4: e59f217c ldr r2, [pc, #380] ; 16f38 <_Timer_server_Body+0x214>
16db8: e8990003 ldm r9, {r0, r1}
16dbc: e3a03000 mov r3, #0
16dc0: eb00511b bl 2b234 <__divdi3>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
16dc4: e5942074 ldr r2, [r4, #116] ; 0x74
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
16dc8: e1500002 cmp r0, r2
16dcc: e1a05000 mov r5, r0
16dd0: 8a000022 bhi 16e60 <_Timer_server_Body+0x13c>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
16dd4: 3a000018 bcc 16e3c <_Timer_server_Body+0x118>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
16dd8: 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 );
16ddc: e5940078 ldr r0, [r4, #120] ; 0x78
16de0: eb0002e3 bl 17974 <_Chain_Get>
if ( timer == NULL ) {
16de4: e2501000 subs r1, r0, #0
16de8: 0a00000b beq 16e1c <_Timer_server_Body+0xf8>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
16dec: e5913038 ldr r3, [r1, #56] ; 0x38
16df0: e3530001 cmp r3, #1
16df4: 0a000015 beq 16e50 <_Timer_server_Body+0x12c>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
16df8: e3530003 cmp r3, #3
16dfc: 1afffff6 bne 16ddc <_Timer_server_Body+0xb8>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
16e00: e2811010 add r1, r1, #16
16e04: e1a0000a mov r0, sl
16e08: eb0011b1 bl 1b4d4 <_Watchdog_Insert>
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
16e0c: e5940078 ldr r0, [r4, #120] ; 0x78
16e10: eb0002d7 bl 17974 <_Chain_Get>
if ( timer == NULL ) {
16e14: e2501000 subs r1, r0, #0
16e18: 1afffff3 bne 16dec <_Timer_server_Body+0xc8>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
16e1c: e10f2000 mrs r2, CPSR
16e20: e3823080 orr r3, r2, #128 ; 0x80
16e24: e129f003 msr CPSR_fc, r3
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
16e28: e59d300c ldr r3, [sp, #12]
16e2c: e153000b cmp r3, fp
16e30: 0a00000f beq 16e74 <_Timer_server_Body+0x150>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
16e34: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
16e38: eaffffd6 b 16d98 <_Timer_server_Body+0x74> <== 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 );
16e3c: e1a0000a mov r0, sl
16e40: e3a01001 mov r1, #1
16e44: e0652002 rsb r2, r5, r2
16e48: eb00114a bl 1b378 <_Watchdog_Adjust>
16e4c: eaffffe1 b 16dd8 <_Timer_server_Body+0xb4>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
16e50: e1a00007 mov r0, r7
16e54: e2811010 add r1, r1, #16
16e58: eb00119d bl 1b4d4 <_Watchdog_Insert>
16e5c: eaffffde b 16ddc <_Timer_server_Body+0xb8>
/*
* 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 );
16e60: e0621005 rsb r1, r2, r5
16e64: e1a0000a mov r0, sl
16e68: e1a02006 mov r2, r6
16e6c: eb00116f bl 1b430 <_Watchdog_Adjust_to_chain>
16e70: eaffffd8 b 16dd8 <_Timer_server_Body+0xb4>
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
16e74: e5841078 str r1, [r4, #120] ; 0x78
16e78: 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 ) ) {
16e7c: e59d3018 ldr r3, [sp, #24]
16e80: e59d1000 ldr r1, [sp]
16e84: e1530001 cmp r3, r1
16e88: 1a00000a bne 16eb8 <_Timer_server_Body+0x194>
16e8c: ea000012 b 16edc <_Timer_server_Body+0x1b8>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
16e90: e5932000 ldr r2, [r3]
head->next = new_first;
new_first->previous = head;
16e94: e5826004 str r6, [r2, #4]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
16e98: e58d2018 str r2, [sp, #24]
* 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;
16e9c: e3a02000 mov r2, #0
16ea0: e5832008 str r2, [r3, #8]
16ea4: 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 );
16ea8: e2830020 add r0, r3, #32
16eac: e8900003 ldm r0, {r0, r1}
16eb0: e1a0e00f mov lr, pc
16eb4: e593f01c ldr pc, [r3, #28]
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
16eb8: e10f1000 mrs r1, CPSR
16ebc: e3813080 orr r3, r1, #128 ; 0x80
16ec0: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
16ec4: e59d3018 ldr r3, [sp, #24]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
16ec8: e59d2000 ldr r2, [sp]
16ecc: e1530002 cmp r3, r2
16ed0: 1affffee bne 16e90 <_Timer_server_Body+0x16c>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
16ed4: e129f001 msr CPSR_fc, r1
16ed8: eaffffac b 16d90 <_Timer_server_Body+0x6c>
}
} else {
ts->active = false;
16edc: e3a03000 mov r3, #0
16ee0: e5c4307c strb r3, [r4, #124] ; 0x7c
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
16ee4: e59f1050 ldr r1, [pc, #80] ; 16f3c <_Timer_server_Body+0x218>
16ee8: e5913000 ldr r3, [r1]
++level;
16eec: e2833001 add r3, r3, #1
_Thread_Dispatch_disable_level = level;
16ef0: e5813000 str r3, [r1]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
16ef4: e3a01008 mov r1, #8
16ef8: e5940000 ldr r0, [r4]
16efc: eb001038 bl 1afe4 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
16f00: e1a00004 mov r0, r4
16f04: ebffff5a bl 16c74 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
16f08: e1a00004 mov r0, r4
16f0c: ebffff6e bl 16ccc <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
16f10: eb000de9 bl 1a6bc <_Thread_Enable_dispatch>
ts->active = true;
16f14: e3a03001 mov r3, #1
16f18: e5c4307c strb r3, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16f1c: e59d0004 ldr r0, [sp, #4]
16f20: eb0011d8 bl 1b688 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16f24: e59d0008 ldr r0, [sp, #8]
16f28: eb0011d6 bl 1b688 <_Watchdog_Remove>
16f2c: eaffff97 b 16d90 <_Timer_server_Body+0x6c>
0000b31c <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
b31c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
b320: e1a04000 mov r4, r0
b324: e1a05002 mov r5, r2
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
b328: e10f2000 mrs r2, CPSR
b32c: e3823080 orr r3, r2, #128 ; 0x80
b330: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
b334: e1a07000 mov r7, r0
b338: e4973004 ldr r3, [r7], #4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
b33c: e1530007 cmp r3, r7
b340: 0a000017 beq b3a4 <_Watchdog_Adjust+0x88>
switch ( direction ) {
b344: e3510000 cmp r1, #0
b348: 1a000017 bne b3ac <_Watchdog_Adjust+0x90>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
b34c: e3550000 cmp r5, #0
b350: 0a000013 beq b3a4 <_Watchdog_Adjust+0x88>
if ( units < _Watchdog_First( header )->delta_interval ) {
b354: e5936010 ldr r6, [r3, #16]
b358: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
b35c: 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 ) {
b360: 2a000005 bcs b37c <_Watchdog_Adjust+0x60>
b364: ea000017 b b3c8 <_Watchdog_Adjust+0xac> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
b368: e0555006 subs r5, r5, r6
b36c: 0a00000c beq b3a4 <_Watchdog_Adjust+0x88>
if ( units < _Watchdog_First( header )->delta_interval ) {
b370: e5936010 ldr r6, [r3, #16]
b374: e1560005 cmp r6, r5
b378: 8a000012 bhi b3c8 <_Watchdog_Adjust+0xac>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
b37c: e5838010 str r8, [r3, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
b380: e129f002 msr CPSR_fc, r2
_ISR_Enable( level );
_Watchdog_Tickle( header );
b384: e1a00004 mov r0, r4
b388: eb0000a9 bl b634 <_Watchdog_Tickle>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
b38c: e10f2000 mrs r2, CPSR
b390: e3823080 orr r3, r2, #128 ; 0x80
b394: e129f003 msr CPSR_fc, r3
b398: e5943000 ldr r3, [r4]
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
b39c: e1570003 cmp r7, r3
b3a0: 1afffff0 bne b368 <_Watchdog_Adjust+0x4c>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
b3a4: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
b3a8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
b3ac: e3510001 cmp r1, #1
b3b0: 1afffffb bne b3a4 <_Watchdog_Adjust+0x88>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
b3b4: e5931010 ldr r1, [r3, #16]
b3b8: e0815005 add r5, r1, r5
b3bc: e5835010 str r5, [r3, #16]
b3c0: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
b3c4: 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;
b3c8: e0655006 rsb r5, r5, r6
b3cc: e5835010 str r5, [r3, #16]
break;
b3d0: eafffff3 b b3a4 <_Watchdog_Adjust+0x88>
00009df0 <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9df0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9df4: e59f3120 ldr r3, [pc, #288] ; 9f1c <_Workspace_Handler_initialization+0x12c>
9df8: e5d3c032 ldrb ip, [r3, #50] ; 0x32
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9dfc: e24dd004 sub sp, sp, #4
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9e00: e35c0000 cmp ip, #0
9e04: 05937004 ldreq r7, [r3, #4]
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9e08: e58d2000 str r2, [sp]
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9e0c: e5932000 ldr r2, [r3]
9e10: 13a07000 movne r7, #0
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9e14: e3510000 cmp r1, #0
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9e18: e1a08001 mov r8, r1
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9e1c: e0877002 add r7, r7, r2
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
9e20: e5d3a030 ldrb sl, [r3, #48] ; 0x30
bool unified = rtems_configuration_get_unified_work_area();
9e24: e5d3b031 ldrb fp, [r3, #49] ; 0x31
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9e28: 0a000033 beq 9efc <_Workspace_Handler_initialization+0x10c>
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
9e2c: e59f90ec ldr r9, [pc, #236] ; 9f20 <_Workspace_Handler_initialization+0x130>
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9e30: e1a04000 mov r4, r0
9e34: e3a06000 mov r6, #0
9e38: ea00001d b 9eb4 <_Workspace_Handler_initialization+0xc4>
if ( do_zero ) {
memset( area->begin, 0, area->size );
}
if ( area->size > overhead ) {
9e3c: e5945004 ldr r5, [r4, #4]
9e40: e3550016 cmp r5, #22
9e44: 9a000016 bls 9ea4 <_Workspace_Handler_initialization+0xb4>
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
9e48: e35b0000 cmp fp, #0
9e4c: 1a000004 bne 9e64 <_Workspace_Handler_initialization+0x74>
size = area->size;
} else {
if ( remaining > 0 ) {
9e50: e3570000 cmp r7, #0
9e54: 0a00001d beq 9ed0 <_Workspace_Handler_initialization+0xe0>
size = remaining < area->size - overhead ?
9e58: e2453016 sub r3, r5, #22
remaining + overhead : area->size;
9e5c: e1530007 cmp r3, r7
9e60: 82875016 addhi r5, r7, #22
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
9e64: e1a02005 mov r2, r5
9e68: e3a03008 mov r3, #8
9e6c: e59f00b0 ldr r0, [pc, #176] ; 9f24 <_Workspace_Handler_initialization+0x134>
9e70: e5941000 ldr r1, [r4]
9e74: e1a0e00f mov lr, pc
9e78: e12fff19 bx r9
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
9e7c: e5943000 ldr r3, [r4]
area->size -= size;
9e80: e5942004 ldr r2, [r4, #4]
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
9e84: e0833005 add r3, r3, r5
area->size -= size;
9e88: e0655002 rsb r5, r5, r2
if ( space_available < remaining ) {
9e8c: e1500007 cmp r0, r7
size,
page_size
);
area->begin = (char *) area->begin + size;
area->size -= size;
9e90: e8840028 stm r4, {r3, r5}
remaining -= space_available;
} else {
remaining = 0;
}
init_or_extend = extend;
9e94: 359d9000 ldrcc r9, [sp]
9e98: 259d9000 ldrcs r9, [sp]
area->begin = (char *) area->begin + size;
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
9e9c: 30607007 rsbcc r7, r0, r7
} else {
remaining = 0;
9ea0: 23a07000 movcs r7, #0
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9ea4: e2866001 add r6, r6, #1
9ea8: e1560008 cmp r6, r8
9eac: e2844008 add r4, r4, #8
9eb0: 0a000011 beq 9efc <_Workspace_Handler_initialization+0x10c>
Heap_Area *area = &areas [i];
if ( do_zero ) {
9eb4: e35a0000 cmp sl, #0
9eb8: 0affffdf beq 9e3c <_Workspace_Handler_initialization+0x4c>
memset( area->begin, 0, area->size );
9ebc: e5940000 ldr r0, [r4]
9ec0: e3a01000 mov r1, #0
9ec4: e5942004 ldr r2, [r4, #4]
9ec8: eb001437 bl efac <memset>
9ecc: eaffffda b 9e3c <_Workspace_Handler_initialization+0x4c>
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
9ed0: e5941000 ldr r1, [r4] <== NOT EXECUTED
9ed4: e59f0048 ldr r0, [pc, #72] ; 9f24 <_Workspace_Handler_initialization+0x134><== NOT EXECUTED
9ed8: e1a02007 mov r2, r7 <== NOT EXECUTED
9edc: e3a03008 mov r3, #8 <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9ee0: e2866001 add r6, r6, #1 <== NOT EXECUTED
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
9ee4: e1a0e00f mov lr, pc <== NOT EXECUTED
9ee8: e12fff19 bx r9 <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9eec: e1560008 cmp r6, r8 <== NOT EXECUTED
remaining -= space_available;
} else {
remaining = 0;
}
init_or_extend = extend;
9ef0: e59d9000 ldr r9, [sp] <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9ef4: e2844008 add r4, r4, #8 <== NOT EXECUTED
9ef8: 1affffed bne 9eb4 <_Workspace_Handler_initialization+0xc4> <== NOT EXECUTED
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
9efc: e3570000 cmp r7, #0
9f00: 1a000001 bne 9f0c <_Workspace_Handler_initialization+0x11c>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
);
}
}
9f04: e28dd004 add sp, sp, #4
9f08: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
_Internal_error_Occurred(
9f0c: e3a00000 mov r0, #0
9f10: e3a01001 mov r1, #1
9f14: e3a02002 mov r2, #2
9f18: ebfff6cc bl 7a50 <_Internal_error_Occurred>
00006a3c <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
6a3c: e3500a02 cmp r0, #8192 ; 0x2000
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
6a40: e92d4030 push {r4, r5, lr}
6a44: e1a04001 mov r4, r1
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6a48: 13a05016 movne r5, #22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
6a4c: 1a000011 bne 6a98 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6a50: e5910000 ldr r0, [r1]
6a54: e3a01003 mov r1, #3
6a58: eb001a46 bl d378 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6a5c: e2000003 and r0, r0, #3
6a60: e2400001 sub r0, r0, #1
6a64: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
6a68: 83a05009 movhi r5, #9
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6a6c: 8a000009 bhi 6a98 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
6a70: e3a00018 mov r0, #24
6a74: ebfff176 bl 3054 <malloc>
if (req == NULL)
6a78: e2503000 subs r3, r0, #0
6a7c: 0a000004 beq 6a94 <aio_fsync+0x58>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
6a80: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_SYNC;
6a84: e3a03003 mov r3, #3
6a88: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6a8c: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
6a90: ea000163 b 7024 <rtems_aio_enqueue>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6a94: e3a0500b mov r5, #11 <== NOT EXECUTED
6a98: e3e03000 mvn r3, #0
6a9c: e5845030 str r5, [r4, #48] ; 0x30
6aa0: e5843034 str r3, [r4, #52] ; 0x34
6aa4: eb0027f1 bl 10a70 <__errno>
6aa8: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
6aac: e3e00000 mvn r0, #0
6ab0: e8bd8030 pop {r4, r5, pc}
00007200 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
7200: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
7204: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
7208: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
720c: e5900000 ldr r0, [r0]
7210: eb001858 bl d378 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
7214: e2000003 and r0, r0, #3
7218: e3500002 cmp r0, #2
721c: 13500000 cmpne r0, #0
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
7220: 13a05009 movne r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
7224: 1a000010 bne 726c <aio_read+0x6c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
7228: e5943014 ldr r3, [r4, #20]
722c: e3530000 cmp r3, #0
7230: 1a000014 bne 7288 <aio_read+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
7234: e994000c ldmib r4, {r2, r3}
7238: e3520000 cmp r2, #0
723c: e2d31000 sbcs r1, r3, #0
7240: ba000010 blt 7288 <aio_read+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
7244: e3a00018 mov r0, #24
7248: ebffef81 bl 3054 <malloc>
if (req == NULL)
724c: e2503000 subs r3, r0, #0
7250: 0a000004 beq 7268 <aio_read+0x68>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
7254: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_READ;
7258: e3a03001 mov r3, #1
725c: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
7260: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
7264: eaffff6e b 7024 <rtems_aio_enqueue>
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
7268: e3a0500b mov r5, #11 <== NOT EXECUTED
726c: e3e03000 mvn r3, #0
7270: e5845030 str r5, [r4, #48] ; 0x30
7274: e5843034 str r3, [r4, #52] ; 0x34
7278: eb0025fc bl 10a70 <__errno>
727c: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
7280: e3e00000 mvn r0, #0
7284: e8bd8030 pop {r4, r5, pc}
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
7288: e3a05016 mov r5, #22
728c: eafffff6 b 726c <aio_read+0x6c>
00007298 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
7298: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
729c: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
72a0: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
72a4: e5900000 ldr r0, [r0]
72a8: eb001832 bl d378 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
72ac: e2000003 and r0, r0, #3
72b0: e2400001 sub r0, r0, #1
72b4: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
72b8: 83a05009 movhi r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
72bc: 8a000010 bhi 7304 <aio_write+0x6c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
72c0: e5943014 ldr r3, [r4, #20]
72c4: e3530000 cmp r3, #0
72c8: 1a000014 bne 7320 <aio_write+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
72cc: e994000c ldmib r4, {r2, r3}
72d0: e3520000 cmp r2, #0
72d4: e2d31000 sbcs r1, r3, #0
72d8: ba000010 blt 7320 <aio_write+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
72dc: e3a00018 mov r0, #24
72e0: ebffef5b bl 3054 <malloc>
if (req == NULL)
72e4: e2503000 subs r3, r0, #0
72e8: 0a000004 beq 7300 <aio_write+0x68>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
72ec: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_WRITE;
72f0: e3a03002 mov r3, #2
72f4: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
72f8: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
72fc: eaffff48 b 7024 <rtems_aio_enqueue>
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
7300: e3a0500b mov r5, #11 <== NOT EXECUTED
7304: e3e03000 mvn r3, #0
7308: e5845030 str r5, [r4, #48] ; 0x30
730c: e5843034 str r3, [r4, #52] ; 0x34
7310: eb0025d6 bl 10a70 <__errno>
7314: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
7318: e3e00000 mvn r0, #0
731c: e8bd8030 pop {r4, r5, pc}
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
7320: e3a05016 mov r5, #22
7324: eafffff6 b 7304 <aio_write+0x6c>
00019b5c <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
19b5c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
19b60: e24dd00c sub sp, sp, #12
19b64: e1a04000 mov r4, r0
19b68: e1a05001 mov r5, r1
19b6c: e1a08002 mov r8, r2
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
19b70: ebffff7d bl 1996c <getpid>
19b74: e1500004 cmp r0, r4
19b78: 1a000091 bne 19dc4 <killinfo+0x268>
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed.
*/
if ( !sig )
19b7c: e3550000 cmp r5, #0
19b80: 0a000094 beq 19dd8 <killinfo+0x27c>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
19b84: e2454001 sub r4, r5, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
19b88: e354001f cmp r4, #31
19b8c: 8a000091 bhi 19dd8 <killinfo+0x27c>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
19b90: e59f626c ldr r6, [pc, #620] ; 19e04 <killinfo+0x2a8>
19b94: e1a07085 lsl r7, r5, #1
19b98: e0873005 add r3, r7, r5
19b9c: e0863103 add r3, r6, r3, lsl #2
19ba0: e5933008 ldr r3, [r3, #8]
19ba4: e3530001 cmp r3, #1
return 0;
19ba8: 03a00000 moveq r0, #0
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
19bac: 0a000035 beq 19c88 <killinfo+0x12c>
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
19bb0: e3550008 cmp r5, #8
19bb4: 13550004 cmpne r5, #4
19bb8: 0a000034 beq 19c90 <killinfo+0x134>
19bbc: e355000b cmp r5, #11
19bc0: 0a000032 beq 19c90 <killinfo+0x134>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
19bc4: e3a03001 mov r3, #1
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
if ( !value ) {
19bc8: e3580000 cmp r8, #0
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
19bcc: e58d3004 str r3, [sp, #4]
19bd0: e1a04413 lsl r4, r3, r4
if ( !value ) {
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
19bd4: 15983000 ldrne r3, [r8]
19bd8: 158d3008 strne r3, [sp, #8]
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
19bdc: e59f3224 ldr r3, [pc, #548] ; 19e08 <killinfo+0x2ac>
19be0: e5932000 ldr r2, [r3]
++level;
19be4: e2822001 add r2, r2, #1
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
19be8: e58d5000 str r5, [sp]
siginfo->si_code = SI_USER;
if ( !value ) {
siginfo->si_value.sival_int = 0;
19bec: 058d8008 streq r8, [sp, #8]
_Thread_Dispatch_disable_level = level;
19bf0: e5832000 str r2, [r3]
*/
void _POSIX_signals_Manager_Initialization(void);
static inline void _POSIX_signals_Add_post_switch_extension(void)
{
_API_extensions_Add_post_switch( &_POSIX_signals_Post_switch );
19bf4: e59f0210 ldr r0, [pc, #528] ; 19e0c <killinfo+0x2b0>
19bf8: ebffb4ca bl 6f28 <_API_extensions_Add_post_switch>
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
19bfc: e59f320c ldr r3, [pc, #524] ; 19e10 <killinfo+0x2b4>
19c00: e5930008 ldr r0, [r3, #8]
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
19c04: e59030f4 ldr r3, [r0, #244] ; 0xf4
19c08: e59330d0 ldr r3, [r3, #208] ; 0xd0
19c0c: e1d43003 bics r3, r4, r3
19c10: 1a00000e bne 19c50 <killinfo+0xf4>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
19c14: e59f21f8 ldr r2, [pc, #504] ; 19e14 <killinfo+0x2b8>
19c18: e4920004 ldr r0, [r2], #4
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
19c1c: e1500002 cmp r0, r2
19c20: 1a000006 bne 19c40 <killinfo+0xe4>
19c24: ea00002a b 19cd4 <killinfo+0x178>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
19c28: e59330d0 ldr r3, [r3, #208] ; 0xd0
19c2c: e1d43003 bics r3, r4, r3
19c30: 1a000006 bne 19c50 <killinfo+0xf4>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
19c34: e5900000 ldr r0, [r0]
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
19c38: e1500002 cmp r0, r2
19c3c: 0a000024 beq 19cd4 <killinfo+0x178>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
19c40: e5903030 ldr r3, [r0, #48] ; 0x30
19c44: e1140003 tst r4, r3
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
19c48: e59030f4 ldr r3, [r0, #244] ; 0xf4
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
19c4c: 0afffff5 beq 19c28 <killinfo+0xcc>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
19c50: e1a01005 mov r1, r5
19c54: e1a0200d mov r2, sp
19c58: eb00007d bl 19e54 <_POSIX_signals_Unblock_thread>
19c5c: e3500000 cmp r0, #0
19c60: 1a000006 bne 19c80 <killinfo+0x124>
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
19c64: e0875005 add r5, r7, r5
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
19c68: e1a00004 mov r0, r4
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
19c6c: e1a05105 lsl r5, r5, #2
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
19c70: eb00006d bl 19e2c <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
19c74: e7963005 ldr r3, [r6, r5]
19c78: e3530002 cmp r3, #2
19c7c: 0a000007 beq 19ca0 <killinfo+0x144>
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
19c80: ebffbc8c bl 8eb8 <_Thread_Enable_dispatch>
return 0;
19c84: e3a00000 mov r0, #0
}
19c88: e28dd00c add sp, sp, #12
19c8c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
return pthread_kill( pthread_self(), sig );
19c90: eb0000f2 bl 1a060 <pthread_self>
19c94: e1a01005 mov r1, r5
19c98: eb0000b7 bl 19f7c <pthread_kill>
19c9c: eafffff9 b 19c88 <killinfo+0x12c>
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
19ca0: e59f0170 ldr r0, [pc, #368] ; 19e18 <killinfo+0x2bc>
19ca4: ebffb507 bl 70c8 <_Chain_Get>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
19ca8: e250c000 subs ip, r0, #0
19cac: 0a00004e beq 19dec <killinfo+0x290>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
19cb0: e28d300c add r3, sp, #12
19cb4: e9130007 ldmdb r3, {r0, r1, r2}
19cb8: e28c3008 add r3, ip, #8
19cbc: e8830007 stm r3, {r0, r1, r2}
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
19cc0: e59f0154 ldr r0, [pc, #340] ; 19e1c <killinfo+0x2c0>
19cc4: e1a0100c mov r1, ip
19cc8: e0800005 add r0, r0, r5
19ccc: ebffb4f2 bl 709c <_Chain_Append>
19cd0: eaffffea b 19c80 <killinfo+0x124>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
19cd4: e59f3144 ldr r3, [pc, #324] ; 19e20 <killinfo+0x2c4>
19cd8: e5d3e000 ldrb lr, [r3]
19cdc: e59fa140 ldr sl, [pc, #320] ; 19e24 <killinfo+0x2c8>
19ce0: e28ee001 add lr, lr, #1
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
19ce4: e3a00000 mov r0, #0
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and an API is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
19ce8: e5ba3004 ldr r3, [sl, #4]!
19cec: e3530000 cmp r3, #0
19cf0: 0a000022 beq 19d80 <killinfo+0x224>
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
19cf4: e5933004 ldr r3, [r3, #4]
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
19cf8: e1d381b0 ldrh r8, [r3, #16]
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19cfc: e3580000 cmp r8, #0
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
19d00: e593101c ldr r1, [r3, #28]
for ( index = 1 ; index <= maximum ; index++ ) {
19d04: 0a00001d beq 19d80 <killinfo+0x224>
19d08: e3a02001 mov r2, #1
the_thread = (Thread_Control *) object_table[ index ];
19d0c: e5b13004 ldr r3, [r1, #4]!
if ( !the_thread )
19d10: e3530000 cmp r3, #0
19d14: 0a000016 beq 19d74 <killinfo+0x218>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
19d18: e593c014 ldr ip, [r3, #20]
19d1c: e15c000e cmp ip, lr
19d20: 8a000013 bhi 19d74 <killinfo+0x218>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
19d24: e59390f4 ldr r9, [r3, #244] ; 0xf4
19d28: e59990d0 ldr r9, [r9, #208] ; 0xd0
19d2c: e1d49009 bics r9, r4, r9
19d30: 0a00000f beq 19d74 <killinfo+0x218>
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( the_thread->current_priority < interested_priority ) {
19d34: e15c000e cmp ip, lr
19d38: 3a00001b bcc 19dac <killinfo+0x250>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
19d3c: e3500000 cmp r0, #0
19d40: 0a00000b beq 19d74 <killinfo+0x218>
19d44: e5909010 ldr r9, [r0, #16]
19d48: e3590000 cmp r9, #0
19d4c: 0a000008 beq 19d74 <killinfo+0x218>
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
19d50: e593b010 ldr fp, [r3, #16]
19d54: e35b0000 cmp fp, #0
19d58: 0a000013 beq 19dac <killinfo+0x250>
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
19d5c: e3190201 tst r9, #268435456 ; 0x10000000
19d60: 1a000003 bne 19d74 <killinfo+0x218>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
19d64: e20bb201 and fp, fp, #268435456 ; 0x10000000
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
19d68: e35b0000 cmp fp, #0
19d6c: 11a0e00c movne lr, ip
19d70: 11a00003 movne r0, r3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19d74: e2822001 add r2, r2, #1
19d78: e1580002 cmp r8, r2
19d7c: 2affffe2 bcs 19d0c <killinfo+0x1b0>
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
19d80: e59f30a0 ldr r3, [pc, #160] ; 19e28 <killinfo+0x2cc>
19d84: e15a0003 cmp sl, r3
19d88: 1affffd6 bne 19ce8 <killinfo+0x18c>
}
}
}
}
if ( interested ) {
19d8c: e3500000 cmp r0, #0
19d90: 0affffb3 beq 19c64 <killinfo+0x108>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
19d94: e1a01005 mov r1, r5
19d98: e1a0200d mov r2, sp
19d9c: eb00002c bl 19e54 <_POSIX_signals_Unblock_thread>
19da0: e3500000 cmp r0, #0
19da4: 0affffae beq 19c64 <killinfo+0x108>
19da8: eaffffb4 b 19c80 <killinfo+0x124> <== NOT EXECUTED
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19dac: e2822001 add r2, r2, #1
19db0: e1580002 cmp r8, r2
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
19db4: e1a0e00c mov lr, ip
19db8: e1a00003 mov r0, r3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19dbc: 2affffd2 bcs 19d0c <killinfo+0x1b0>
19dc0: eaffffee b 19d80 <killinfo+0x224>
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
19dc4: ebffd208 bl e5ec <__errno>
19dc8: e3a03003 mov r3, #3
19dcc: e5803000 str r3, [r0]
19dd0: e3e00000 mvn r0, #0
19dd4: eaffffab b 19c88 <killinfo+0x12c>
*/
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
19dd8: ebffd203 bl e5ec <__errno>
19ddc: e3a03016 mov r3, #22
19de0: e5803000 str r3, [r0]
19de4: e3e00000 mvn r0, #0
19de8: eaffffa6 b 19c88 <killinfo+0x12c>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_Thread_Enable_dispatch();
19dec: ebffbc31 bl 8eb8 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
19df0: ebffd1fd bl e5ec <__errno>
19df4: e3a0300b mov r3, #11
19df8: e5803000 str r3, [r0]
19dfc: e3e00000 mvn r0, #0
19e00: eaffffa0 b 19c88 <killinfo+0x12c>
0000ac14 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
ac14: e3500000 cmp r0, #0
ac18: 0a000002 beq ac28 <pthread_attr_setschedpolicy+0x14>
ac1c: e5903000 ldr r3, [r0]
ac20: e3530000 cmp r3, #0
ac24: 1a000001 bne ac30 <pthread_attr_setschedpolicy+0x1c>
return EINVAL;
ac28: e3a00016 mov r0, #22
ac2c: e12fff1e bx lr
switch ( policy ) {
ac30: e3510004 cmp r1, #4
ac34: 9a000001 bls ac40 <pthread_attr_setschedpolicy+0x2c>
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
ac38: e3a00086 mov r0, #134 ; 0x86
}
}
ac3c: e12fff1e bx lr
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
ac40: e3a03001 mov r3, #1
ac44: e1a03113 lsl r3, r3, r1
ac48: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
ac4c: 15801014 strne r1, [r0, #20]
return 0;
ac50: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
ac54: 112fff1e bxne lr
ac58: eafffff6 b ac38 <pthread_attr_setschedpolicy+0x24> <== NOT EXECUTED
00019f7c <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
19f7c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
19f80: e2516000 subs r6, r1, #0
int pthread_kill(
pthread_t thread,
int sig
)
{
19f84: e24dd004 sub sp, sp, #4
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
19f88: 0a000027 beq 1a02c <pthread_kill+0xb0>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
19f8c: e2467001 sub r7, r6, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
19f90: e357001f cmp r7, #31
19f94: 8a000024 bhi 1a02c <pthread_kill+0xb0>
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
19f98: e1a0100d mov r1, sp
19f9c: ebffbbcd bl 8ed8 <_Thread_Get>
switch ( location ) {
19fa0: e59d8000 ldr r8, [sp]
19fa4: e3580000 cmp r8, #0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
19fa8: e1a04000 mov r4, r0
switch ( location ) {
19fac: 1a000023 bne 1a040 <pthread_kill+0xc4>
19fb0: e59f009c ldr r0, [pc, #156] ; 1a054 <pthread_kill+0xd8>
19fb4: ebffb3db bl 6f28 <_API_extensions_Add_post_switch>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
19fb8: e59f3098 ldr r3, [pc, #152] ; 1a058 <pthread_kill+0xdc>
19fbc: e0862086 add r2, r6, r6, lsl #1
19fc0: e0833102 add r3, r3, r2, lsl #2
19fc4: e5933008 ldr r3, [r3, #8]
19fc8: e3530001 cmp r3, #1
* If sig == 0 then just validate arguments
*/
_POSIX_signals_Add_post_switch_extension();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
19fcc: e59430f4 ldr r3, [r4, #244] ; 0xf4
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
19fd0: 0a000012 beq 1a020 <pthread_kill+0xa4>
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
19fd4: e59320d4 ldr r2, [r3, #212] ; 0xd4
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
19fd8: e3a05001 mov r5, #1
19fdc: e1827715 orr r7, r2, r5, lsl r7
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
19fe0: e1a00004 mov r0, r4
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
19fe4: e58370d4 str r7, [r3, #212] ; 0xd4
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
19fe8: e1a02008 mov r2, r8
19fec: e1a01006 mov r1, r6
19ff0: ebffff97 bl 19e54 <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
19ff4: e59f3060 ldr r3, [pc, #96] ; 1a05c <pthread_kill+0xe0>
19ff8: e5932000 ldr r2, [r3]
19ffc: e3520000 cmp r2, #0
1a000: 0a000002 beq 1a010 <pthread_kill+0x94>
1a004: e5932008 ldr r2, [r3, #8]
1a008: e1540002 cmp r4, r2
_Thread_Dispatch_necessary = true;
1a00c: 05c35004 strbeq r5, [r3, #4]
}
_Thread_Enable_dispatch();
1a010: ebffbba8 bl 8eb8 <_Thread_Enable_dispatch>
return 0;
1a014: e3a00000 mov r0, #0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
}
1a018: e28dd004 add sp, sp, #4
1a01c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
_Thread_Enable_dispatch();
1a020: ebffbba4 bl 8eb8 <_Thread_Enable_dispatch>
return 0;
1a024: e1a00008 mov r0, r8
1a028: eafffffa b 1a018 <pthread_kill+0x9c>
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
1a02c: ebffd16e bl e5ec <__errno>
1a030: e3a03016 mov r3, #22
1a034: e5803000 str r3, [r0]
1a038: e3e00000 mvn r0, #0
1a03c: eafffff5 b 1a018 <pthread_kill+0x9c>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
1a040: ebffd169 bl e5ec <__errno> <== NOT EXECUTED
1a044: e3a03003 mov r3, #3 <== NOT EXECUTED
1a048: e5803000 str r3, [r0] <== NOT EXECUTED
1a04c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a050: eafffff0 b 1a018 <pthread_kill+0x9c> <== NOT EXECUTED
00005e3c <pthread_mutexattr_gettype>:
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
5e3c: e3500000 cmp r0, #0
5e40: 0a000002 beq 5e50 <pthread_mutexattr_gettype+0x14>
return EINVAL;
if ( !attr->is_initialized )
5e44: e5903000 ldr r3, [r0]
5e48: e3530000 cmp r3, #0
5e4c: 1a000001 bne 5e58 <pthread_mutexattr_gettype+0x1c>
return EINVAL;
5e50: e3a00016 mov r0, #22
5e54: e12fff1e bx lr
if ( !type )
5e58: e3510000 cmp r1, #0
5e5c: 0a000003 beq 5e70 <pthread_mutexattr_gettype+0x34>
return EINVAL;
*type = attr->type;
5e60: e5903010 ldr r3, [r0, #16]
return 0;
5e64: e3a00000 mov r0, #0
return EINVAL;
if ( !type )
return EINVAL;
*type = attr->type;
5e68: e5813000 str r3, [r1]
return 0;
5e6c: e12fff1e bx lr
if ( !attr->is_initialized )
return EINVAL;
if ( !type )
return EINVAL;
5e70: e3a00016 mov r0, #22 <== NOT EXECUTED
*type = attr->type;
return 0;
}
5e74: e12fff1e bx lr <== NOT EXECUTED
0000869c <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
869c: e3500000 cmp r0, #0
86a0: 0a000002 beq 86b0 <pthread_mutexattr_setpshared+0x14>
86a4: e5903000 ldr r3, [r0]
86a8: e3530000 cmp r3, #0
86ac: 1a000001 bne 86b8 <pthread_mutexattr_setpshared+0x1c>
return EINVAL;
86b0: e3a00016 mov r0, #22
86b4: e12fff1e bx lr
switch ( pshared ) {
86b8: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
86bc: 95801004 strls r1, [r0, #4]
return 0;
86c0: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
86c4: 912fff1e bxls lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
86c8: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
86cc: e12fff1e bx lr <== NOT EXECUTED
00007a1c <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7a1c: e92d4030 push {r4, r5, lr}
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7a20: e2505000 subs r5, r0, #0
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7a24: e24dd00c sub sp, sp, #12
7a28: e1a00001 mov r0, r1
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7a2c: 0a00001c beq 7aa4 <pthread_rwlock_timedrdlock+0x88>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
7a30: e28d1008 add r1, sp, #8
7a34: eb0019ad bl e0f0 <_POSIX_Absolute_timeout_to_ticks>
7a38: e5951000 ldr r1, [r5]
7a3c: e1a04000 mov r4, r0
7a40: e28d2004 add r2, sp, #4
7a44: e59f0084 ldr r0, [pc, #132] ; 7ad0 <pthread_rwlock_timedrdlock+0xb4>
7a48: eb000b08 bl a670 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
7a4c: e59dc004 ldr ip, [sp, #4]
7a50: e35c0000 cmp ip, #0
7a54: 1a000012 bne 7aa4 <pthread_rwlock_timedrdlock+0x88>
int _EXFUN(pthread_rwlock_init,
(pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr));
int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedrdlock,
7a58: e2443003 sub r3, r4, #3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
7a5c: e5951000 ldr r1, [r5]
7a60: e2735000 rsbs r5, r3, #0
7a64: e0a55003 adc r5, r5, r3
7a68: e2800010 add r0, r0, #16
7a6c: e59d3008 ldr r3, [sp, #8]
7a70: e1a02005 mov r2, r5
7a74: e58dc000 str ip, [sp]
7a78: eb000784 bl 9890 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
7a7c: eb000ea0 bl b504 <_Thread_Enable_dispatch>
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
7a80: e59f304c ldr r3, [pc, #76] ; 7ad4 <pthread_rwlock_timedrdlock+0xb8>
7a84: e5933008 ldr r3, [r3, #8]
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
7a88: e3550000 cmp r5, #0
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
7a8c: e5930034 ldr r0, [r3, #52] ; 0x34
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
7a90: 1a000001 bne 7a9c <pthread_rwlock_timedrdlock+0x80>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
7a94: e3500002 cmp r0, #2
7a98: 0a000004 beq 7ab0 <pthread_rwlock_timedrdlock+0x94>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7a9c: eb00003c bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code>
7aa0: ea000000 b 7aa8 <pthread_rwlock_timedrdlock+0x8c>
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
7aa4: e3a00016 mov r0, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
7aa8: e28dd00c add sp, sp, #12
7aac: e8bd8030 pop {r4, r5, pc}
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
7ab0: e3540000 cmp r4, #0
7ab4: 0afffffa beq 7aa4 <pthread_rwlock_timedrdlock+0x88>
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7ab8: e2444001 sub r4, r4, #1
7abc: e3540001 cmp r4, #1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
7ac0: 93a00074 movls r0, #116 ; 0x74
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7ac4: 9afffff7 bls 7aa8 <pthread_rwlock_timedrdlock+0x8c>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7ac8: eb000031 bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code><== NOT EXECUTED
7acc: eafffff5 b 7aa8 <pthread_rwlock_timedrdlock+0x8c> <== NOT EXECUTED
00007ad8 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7ad8: e92d4030 push {r4, r5, lr}
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7adc: e2505000 subs r5, r0, #0
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7ae0: e24dd00c sub sp, sp, #12
7ae4: e1a00001 mov r0, r1
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7ae8: 0a00001c beq 7b60 <pthread_rwlock_timedwrlock+0x88>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
7aec: e28d1008 add r1, sp, #8
7af0: eb00197e bl e0f0 <_POSIX_Absolute_timeout_to_ticks>
7af4: e5951000 ldr r1, [r5]
7af8: e1a04000 mov r4, r0
7afc: e28d2004 add r2, sp, #4
7b00: e59f0084 ldr r0, [pc, #132] ; 7b8c <pthread_rwlock_timedwrlock+0xb4>
7b04: eb000ad9 bl a670 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
7b08: e59dc004 ldr ip, [sp, #4]
7b0c: e35c0000 cmp ip, #0
7b10: 1a000012 bne 7b60 <pthread_rwlock_timedwrlock+0x88>
(pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedwrlock,
7b14: e2443003 sub r3, r4, #3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
7b18: e5951000 ldr r1, [r5]
7b1c: e2735000 rsbs r5, r3, #0
7b20: e0a55003 adc r5, r5, r3
7b24: e2800010 add r0, r0, #16
7b28: e59d3008 ldr r3, [sp, #8]
7b2c: e1a02005 mov r2, r5
7b30: e58dc000 str ip, [sp]
7b34: eb000788 bl 995c <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
7b38: eb000e71 bl b504 <_Thread_Enable_dispatch>
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
7b3c: e59f304c ldr r3, [pc, #76] ; 7b90 <pthread_rwlock_timedwrlock+0xb8>
7b40: e5933008 ldr r3, [r3, #8]
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
7b44: e3550000 cmp r5, #0
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
7b48: e5930034 ldr r0, [r3, #52] ; 0x34
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
7b4c: 1a000001 bne 7b58 <pthread_rwlock_timedwrlock+0x80>
7b50: e3500002 cmp r0, #2
7b54: 0a000004 beq 7b6c <pthread_rwlock_timedwrlock+0x94>
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7b58: eb00000d bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code>
7b5c: ea000000 b 7b64 <pthread_rwlock_timedwrlock+0x8c>
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
7b60: e3a00016 mov r0, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
7b64: e28dd00c add sp, sp, #12
7b68: e8bd8030 pop {r4, r5, pc}
);
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
7b6c: e3540000 cmp r4, #0
7b70: 0afffffa beq 7b60 <pthread_rwlock_timedwrlock+0x88>
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7b74: e2444001 sub r4, r4, #1
7b78: e3540001 cmp r4, #1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
7b7c: 93a00074 movls r0, #116 ; 0x74
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7b80: 9afffff7 bls 7b64 <pthread_rwlock_timedwrlock+0x8c>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7b84: eb000002 bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code><== NOT EXECUTED
7b88: eafffff5 b 7b64 <pthread_rwlock_timedwrlock+0x8c> <== NOT EXECUTED
00008354 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
8354: e3500000 cmp r0, #0
8358: 0a000002 beq 8368 <pthread_rwlockattr_setpshared+0x14>
return EINVAL;
if ( !attr->is_initialized )
835c: e5903000 ldr r3, [r0]
8360: e3530000 cmp r3, #0
8364: 1a000001 bne 8370 <pthread_rwlockattr_setpshared+0x1c>
return EINVAL;
8368: e3a00016 mov r0, #22
836c: e12fff1e bx lr
switch ( pshared ) {
8370: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8374: 95801004 strls r1, [r0, #4]
return 0;
8378: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
837c: 912fff1e bxls lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
8380: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
8384: e12fff1e bx lr <== NOT EXECUTED
00007024 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
7024: e92d41f0 push {r4, r5, r6, r7, r8, lr}
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
7028: e59f41bc ldr r4, [pc, #444] ; 71ec <rtems_aio_enqueue+0x1c8>
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
702c: e24dd024 sub sp, sp, #36 ; 0x24
7030: e1a06000 mov r6, r0
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
7034: e1a00004 mov r0, r4
7038: eb000265 bl 79d4 <pthread_mutex_lock>
if (result != 0) {
703c: e2505000 subs r5, r0, #0
7040: 1a00002a bne 70f0 <rtems_aio_enqueue+0xcc>
return result;
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
7044: eb000490 bl 828c <pthread_self>
7048: e28d1020 add r1, sp, #32
704c: e1a0200d mov r2, sp
7050: eb00038f bl 7e94 <pthread_getschedparam>
req->caller_thread = pthread_self ();
7054: eb00048c bl 828c <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
7058: e5963014 ldr r3, [r6, #20]
705c: e59dc000 ldr ip, [sp]
7060: e5932014 ldr r2, [r3, #20]
7064: e062200c rsb r2, r2, ip
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
7068: e5941068 ldr r1, [r4, #104] ; 0x68
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
706c: e586200c str r2, [r6, #12]
req->policy = policy;
7070: e59d2020 ldr r2, [sp, #32]
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
7074: e3510000 cmp r1, #0
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
7078: e5862008 str r2, [r6, #8]
req->aiocbp->error_code = EINPROGRESS;
707c: e3a02077 mov r2, #119 ; 0x77
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
7080: e5860010 str r0, [r6, #16]
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
7084: e5832030 str r2, [r3, #48] ; 0x30
req->aiocbp->return_value = 0;
7088: e5835034 str r5, [r3, #52] ; 0x34
if ((aio_request_queue.idle_threads == 0) &&
708c: 1a000002 bne 709c <rtems_aio_enqueue+0x78>
7090: e5942064 ldr r2, [r4, #100] ; 0x64
7094: e3520004 cmp r2, #4
7098: da000017 ble 70fc <rtems_aio_enqueue+0xd8>
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
709c: e59f014c ldr r0, [pc, #332] ; 71f0 <rtems_aio_enqueue+0x1cc>
70a0: e5931000 ldr r1, [r3]
70a4: e3a02000 mov r2, #0
70a8: ebffff7d bl 6ea4 <rtems_aio_search_fd>
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
70ac: e2507000 subs r7, r0, #0
70b0: 0a00002e beq 7170 <rtems_aio_enqueue+0x14c>
{
pthread_mutex_lock (&r_chain->mutex);
70b4: e287401c add r4, r7, #28
70b8: e1a00004 mov r0, r4
70bc: eb000244 bl 79d4 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
70c0: e2870008 add r0, r7, #8
70c4: e1a01006 mov r1, r6
70c8: ebffff1e bl 6d48 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
70cc: e2870020 add r0, r7, #32
70d0: eb000128 bl 7578 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
70d4: e1a00004 mov r0, r4
70d8: eb00025e bl 7a58 <pthread_mutex_unlock>
if (aio_request_queue.idle_threads > 0)
pthread_cond_signal (&aio_request_queue.new_req);
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
70dc: e59f0108 ldr r0, [pc, #264] ; 71ec <rtems_aio_enqueue+0x1c8>
70e0: eb00025c bl 7a58 <pthread_mutex_unlock>
return 0;
}
70e4: e1a00005 mov r0, r5
70e8: e28dd024 add sp, sp, #36 ; 0x24
70ec: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
if (result != 0) {
free (req);
70f0: e1a00006 mov r0, r6 <== NOT EXECUTED
70f4: ebffeebb bl 2be8 <free> <== NOT EXECUTED
return result;
70f8: eafffff9 b 70e4 <rtems_aio_enqueue+0xc0> <== NOT EXECUTED
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
70fc: e5931000 ldr r1, [r3]
7100: e2840048 add r0, r4, #72 ; 0x48
7104: e3a02001 mov r2, #1
7108: ebffff65 bl 6ea4 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
710c: e5903018 ldr r3, [r0, #24]
7110: e3530001 cmp r3, #1
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
7114: e1a07000 mov r7, r0
if (r_chain->new_fd == 1) {
7118: 1affffe5 bne 70b4 <rtems_aio_enqueue+0x90>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
711c: e1a01006 mov r1, r6
7120: e2800008 add r0, r0, #8
7124: eb0008d8 bl 948c <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
7128: e1a01005 mov r1, r5
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
if (r_chain->new_fd == 1) {
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
712c: e5875018 str r5, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
7130: e287001c add r0, r7, #28
7134: eb0001d4 bl 788c <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
7138: e1a01005 mov r1, r5
713c: e2870020 add r0, r7, #32
7140: eb0000db bl 74b4 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
7144: e28d001c add r0, sp, #28
7148: e2841008 add r1, r4, #8
714c: e59f20a0 ldr r2, [pc, #160] ; 71f4 <rtems_aio_enqueue+0x1d0>
7150: e1a03007 mov r3, r7
7154: eb0002b1 bl 7c20 <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
7158: e2506000 subs r6, r0, #0
715c: 1a00001e bne 71dc <rtems_aio_enqueue+0x1b8>
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
7160: e5943064 ldr r3, [r4, #100] ; 0x64
7164: e2833001 add r3, r3, #1
7168: e5843064 str r3, [r4, #100] ; 0x64
716c: eaffffda b 70dc <rtems_aio_enqueue+0xb8>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
7170: e5963014 ldr r3, [r6, #20]
7174: e59f007c ldr r0, [pc, #124] ; 71f8 <rtems_aio_enqueue+0x1d4>
7178: e5931000 ldr r1, [r3]
717c: e3a02001 mov r2, #1
7180: ebffff47 bl 6ea4 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
7184: e5903018 ldr r3, [r0, #24]
7188: e3530001 cmp r3, #1
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
718c: e1a08000 mov r8, r0
7190: e1a01006 mov r1, r6
7194: e2800008 add r0, r0, #8
if (r_chain->new_fd == 1) {
7198: 0a000006 beq 71b8 <rtems_aio_enqueue+0x194>
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
pthread_cond_init (&r_chain->cond, NULL);
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
719c: ebfffee9 bl 6d48 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
71a0: e5943068 ldr r3, [r4, #104] ; 0x68
71a4: e3530000 cmp r3, #0
71a8: daffffcb ble 70dc <rtems_aio_enqueue+0xb8>
pthread_cond_signal (&aio_request_queue.new_req);
71ac: e59f0048 ldr r0, [pc, #72] ; 71fc <rtems_aio_enqueue+0x1d8><== NOT EXECUTED
71b0: eb0000f0 bl 7578 <pthread_cond_signal> <== NOT EXECUTED
71b4: eaffffc8 b 70dc <rtems_aio_enqueue+0xb8> <== NOT EXECUTED
71b8: eb0008b3 bl 948c <_Chain_Insert>
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
71bc: e1a01007 mov r1, r7
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
71c0: e5887018 str r7, [r8, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
71c4: e288001c add r0, r8, #28
71c8: eb0001af bl 788c <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
71cc: e2880020 add r0, r8, #32
71d0: e1a01007 mov r1, r7
71d4: eb0000b6 bl 74b4 <pthread_cond_init>
71d8: eafffff0 b 71a0 <rtems_aio_enqueue+0x17c>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
pthread_mutex_unlock (&aio_request_queue.mutex);
71dc: e1a00004 mov r0, r4 <== NOT EXECUTED
71e0: eb00021c bl 7a58 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
71e4: e1a05006 mov r5, r6 <== NOT EXECUTED
71e8: eaffffbd b 70e4 <rtems_aio_enqueue+0xc0> <== NOT EXECUTED
00006ab4 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
6ab4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
6ab8: e59f7280 ldr r7, [pc, #640] ; 6d40 <rtems_aio_handle+0x28c>
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
6abc: e24dd02c sub sp, sp, #44 ; 0x2c
6ac0: e1a05000 mov r5, r0
6ac4: e280601c add r6, r0, #28
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
6ac8: e1a09007 mov r9, r7
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
6acc: e287b058 add fp, r7, #88 ; 0x58
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
6ad0: e1a00006 mov r0, r6
6ad4: eb0003be bl 79d4 <pthread_mutex_lock>
if (result != 0)
6ad8: e2508000 subs r8, r0, #0
6adc: 1a000022 bne 6b6c <rtems_aio_handle+0xb8>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6ae0: e5954008 ldr r4, [r5, #8]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
6ae4: e285300c add r3, r5, #12
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
6ae8: e1540003 cmp r4, r3
6aec: 0a000038 beq 6bd4 <rtems_aio_handle+0x120>
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
6af0: eb0005e5 bl 828c <pthread_self>
6af4: e28d1028 add r1, sp, #40 ; 0x28
6af8: e28d2004 add r2, sp, #4
6afc: eb0004e4 bl 7e94 <pthread_getschedparam>
param.sched_priority = req->priority;
6b00: e594300c ldr r3, [r4, #12]
6b04: e58d3004 str r3, [sp, #4]
pthread_setschedparam (pthread_self(), req->policy, ¶m);
6b08: eb0005df bl 828c <pthread_self>
6b0c: e5941008 ldr r1, [r4, #8]
6b10: e28d2004 add r2, sp, #4
6b14: eb0005e1 bl 82a0 <pthread_setschedparam>
6b18: e1a00004 mov r0, r4
6b1c: eb000a45 bl 9438 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
6b20: e1a00006 mov r0, r6
6b24: eb0003cb bl 7a58 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
6b28: e5948014 ldr r8, [r4, #20]
6b2c: e598302c ldr r3, [r8, #44] ; 0x2c
6b30: e3530002 cmp r3, #2
6b34: 0a00001f beq 6bb8 <rtems_aio_handle+0x104>
6b38: e3530003 cmp r3, #3
6b3c: 0a00001a beq 6bac <rtems_aio_handle+0xf8>
6b40: e3530001 cmp r3, #1
6b44: 0a00000b beq 6b78 <rtems_aio_handle+0xc4>
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
6b48: e3e03000 mvn r3, #0 <== NOT EXECUTED
6b4c: e5883034 str r3, [r8, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = errno;
6b50: eb0027c6 bl 10a70 <__errno> <== NOT EXECUTED
6b54: e5903000 ldr r3, [r0] <== NOT EXECUTED
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
6b58: e1a00006 mov r0, r6 <== NOT EXECUTED
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
6b5c: e5883030 str r3, [r8, #48] ; 0x30 <== NOT EXECUTED
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
6b60: eb00039b bl 79d4 <pthread_mutex_lock> <== NOT EXECUTED
if (result != 0)
6b64: e2508000 subs r8, r0, #0 <== NOT EXECUTED
6b68: 0affffdc beq 6ae0 <rtems_aio_handle+0x2c> <== NOT EXECUTED
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6b6c: e3a00000 mov r0, #0
6b70: e28dd02c add sp, sp, #44 ; 0x2c
6b74: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
6b78: e288100c add r1, r8, #12
6b7c: e9981008 ldmib r8, {r3, ip}
6b80: e5980000 ldr r0, [r8]
6b84: e8910006 ldm r1, {r1, r2}
6b88: e58dc000 str ip, [sp]
6b8c: eb002a91 bl 115d8 <pread>
break;
default:
result = -1;
}
if (result == -1) {
6b90: e3700001 cmn r0, #1
6b94: 0a000061 beq 6d20 <rtems_aio_handle+0x26c>
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
6b98: e5943014 ldr r3, [r4, #20]
req->aiocbp->error_code = 0;
6b9c: e3a02000 mov r2, #0
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
6ba0: e5830034 str r0, [r3, #52] ; 0x34
req->aiocbp->error_code = 0;
6ba4: e5832030 str r2, [r3, #48] ; 0x30
6ba8: eaffffc8 b 6ad0 <rtems_aio_handle+0x1c>
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
6bac: e5980000 ldr r0, [r8] <== NOT EXECUTED
6bb0: eb001a8c bl d5e8 <fsync> <== NOT EXECUTED
break;
6bb4: eafffff5 b 6b90 <rtems_aio_handle+0xdc> <== NOT EXECUTED
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
6bb8: e288100c add r1, r8, #12
6bbc: e9981008 ldmib r8, {r3, ip}
6bc0: e5980000 ldr r0, [r8]
6bc4: e8910006 ldm r1, {r1, r2}
6bc8: e58dc000 str ip, [sp]
6bcc: eb002ac4 bl 116e4 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6bd0: eaffffee b 6b90 <rtems_aio_handle+0xdc>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
6bd4: e59fa164 ldr sl, [pc, #356] ; 6d40 <rtems_aio_handle+0x28c>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
6bd8: e1a00006 mov r0, r6
6bdc: eb00039d bl 7a58 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
6be0: e1a0000a mov r0, sl
6be4: eb00037a bl 79d4 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
6be8: e5953008 ldr r3, [r5, #8]
6bec: e1540003 cmp r4, r3
6bf0: 0a000002 beq 6c00 <rtems_aio_handle+0x14c>
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
6bf4: e59f0144 ldr r0, [pc, #324] ; 6d40 <rtems_aio_handle+0x28c>
6bf8: eb000396 bl 7a58 <pthread_mutex_unlock>
6bfc: eaffffb3 b 6ad0 <rtems_aio_handle+0x1c>
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
6c00: e28d1020 add r1, sp, #32
6c04: e3a00001 mov r0, #1
6c08: eb0001c6 bl 7328 <clock_gettime>
timeout.tv_sec += 3;
6c0c: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
6c10: e2854020 add r4, r5, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6c14: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
6c18: e1a00004 mov r0, r4
6c1c: e1a0100a mov r1, sl
6c20: e28d2020 add r2, sp, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6c24: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6c28: e58d8024 str r8, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&r_chain->cond,
6c2c: eb00026b bl 75e0 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
6c30: e3500074 cmp r0, #116 ; 0x74
6c34: 1affffee bne 6bf4 <rtems_aio_handle+0x140>
6c38: e1a00005 mov r0, r5
6c3c: eb0009fd bl 9438 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
6c40: e1a00006 mov r0, r6
6c44: eb0002c0 bl 774c <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
6c48: e1a00004 mov r0, r4
6c4c: eb0001e5 bl 73e8 <pthread_cond_destroy>
free (r_chain);
6c50: e1a00005 mov r0, r5
6c54: ebffefe3 bl 2be8 <free>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6c58: e5995054 ldr r5, [r9, #84] ; 0x54
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
6c5c: e155000b cmp r5, fp
6c60: 0a000019 beq 6ccc <rtems_aio_handle+0x218>
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6c64: e5972068 ldr r2, [r7, #104] ; 0x68
++aio_request_queue.active_threads;
6c68: e5973064 ldr r3, [r7, #100] ; 0x64
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6c6c: e2422001 sub r2, r2, #1
++aio_request_queue.active_threads;
6c70: e2833001 add r3, r3, #1
6c74: e1a00005 mov r0, r5
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6c78: e5872068 str r2, [r7, #104] ; 0x68
++aio_request_queue.active_threads;
6c7c: e5873064 str r3, [r7, #100] ; 0x64
6c80: eb0009ec bl 9438 <_Chain_Extract>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
6c84: e5973048 ldr r3, [r7, #72] ; 0x48
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
6c88: e5951014 ldr r1, [r5, #20]
6c8c: e5932014 ldr r2, [r3, #20]
6c90: e1520001 cmp r2, r1
6c94: aa000007 bge 6cb8 <rtems_aio_handle+0x204>
6c98: e59f00a4 ldr r0, [pc, #164] ; 6d44 <rtems_aio_handle+0x290>
6c9c: ea000003 b 6cb0 <rtems_aio_handle+0x1fc>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6ca0: e5933000 ldr r3, [r3]
6ca4: e5932014 ldr r2, [r3, #20]
6ca8: e1510002 cmp r1, r2
6cac: da000001 ble 6cb8 <rtems_aio_handle+0x204>
6cb0: e1530000 cmp r3, r0
6cb4: 1afffff9 bne 6ca0 <rtems_aio_handle+0x1ec>
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
6cb8: e5930004 ldr r0, [r3, #4]
6cbc: e1a01005 mov r1, r5
6cc0: eb0009f1 bl 948c <_Chain_Insert>
6cc4: e285601c add r6, r5, #28
6cc8: eaffffc9 b 6bf4 <rtems_aio_handle+0x140>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
6ccc: e5992068 ldr r2, [r9, #104] ; 0x68
--aio_request_queue.active_threads;
6cd0: e5993064 ldr r3, [r9, #100] ; 0x64
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
6cd4: e2822001 add r2, r2, #1
--aio_request_queue.active_threads;
6cd8: e2433001 sub r3, r3, #1
clock_gettime (CLOCK_REALTIME, &timeout);
6cdc: e28d1020 add r1, sp, #32
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
6ce0: e5892068 str r2, [r9, #104] ; 0x68
--aio_request_queue.active_threads;
6ce4: e5893064 str r3, [r9, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
6ce8: e3a00001 mov r0, #1
6cec: eb00018d bl 7328 <clock_gettime>
timeout.tv_sec += 3;
6cf0: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6cf4: e28a0004 add r0, sl, #4
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6cf8: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6cfc: e1a0100a mov r1, sl
6d00: e28d2020 add r2, sp, #32
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6d04: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6d08: e58d8024 str r8, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6d0c: eb000233 bl 75e0 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
6d10: e3500074 cmp r0, #116 ; 0x74
6d14: 0a000003 beq 6d28 <rtems_aio_handle+0x274>
6d18: e5995054 ldr r5, [r9, #84] ; 0x54 <== NOT EXECUTED
6d1c: eaffffd0 b 6c64 <rtems_aio_handle+0x1b0> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
6d20: e5948014 ldr r8, [r4, #20] <== NOT EXECUTED
6d24: eaffff87 b 6b48 <rtems_aio_handle+0x94> <== NOT EXECUTED
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6d28: e59a3068 ldr r3, [sl, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6d2c: e1a0000a mov r0, sl
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6d30: e2433001 sub r3, r3, #1
6d34: e58a3068 str r3, [sl, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6d38: eb000346 bl 7a58 <pthread_mutex_unlock>
return NULL;
6d3c: eaffff8a b 6b6c <rtems_aio_handle+0xb8>
00006da0 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
6da0: e92d4030 push {r4, r5, lr}
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
6da4: e59f00e4 ldr r0, [pc, #228] ; 6e90 <rtems_aio_init+0xf0>
6da8: eb00037d bl 7ba4 <pthread_attr_init>
if (result != 0)
6dac: e2505000 subs r5, r0, #0
6db0: 0a000001 beq 6dbc <rtems_aio_init+0x1c>
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
return result;
}
6db4: e1a00005 mov r0, r5 <== NOT EXECUTED
6db8: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
result = pthread_attr_init (&aio_request_queue.attr);
if (result != 0)
return result;
result =
6dbc: e59f00cc ldr r0, [pc, #204] ; 6e90 <rtems_aio_init+0xf0>
6dc0: e1a01005 mov r1, r5
6dc4: eb000388 bl 7bec <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
6dc8: e3500000 cmp r0, #0
6dcc: 1a00001b bne 6e40 <rtems_aio_init+0xa0>
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6dd0: e59f40bc ldr r4, [pc, #188] ; 6e94 <rtems_aio_init+0xf4>
6dd4: e3a01000 mov r1, #0
6dd8: e1a00004 mov r0, r4
6ddc: eb0002aa bl 788c <pthread_mutex_init>
if (result != 0)
6de0: e3500000 cmp r0, #0
6de4: 1a00001d bne 6e60 <rtems_aio_init+0xc0>
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
6de8: e59f00a8 ldr r0, [pc, #168] ; 6e98 <rtems_aio_init+0xf8>
6dec: e3a01000 mov r1, #0
6df0: eb0001af bl 74b4 <pthread_cond_init>
if (result != 0) {
6df4: e2505000 subs r5, r0, #0
6df8: 1a00001f bne 6e7c <rtems_aio_init+0xdc>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6dfc: e59f2098 ldr r2, [pc, #152] ; 6e9c <rtems_aio_init+0xfc>
head->previous = NULL;
6e00: e3a03000 mov r3, #0
6e04: e584304c str r3, [r4, #76] ; 0x4c
6e08: e5843058 str r3, [r4, #88] ; 0x58
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
6e0c: e5843064 str r3, [r4, #100] ; 0x64
aio_request_queue.idle_threads = 0;
6e10: e5843068 str r3, [r4, #104] ; 0x68
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
6e14: e59f3084 ldr r3, [pc, #132] ; 6ea0 <rtems_aio_init+0x100>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6e18: e282000c add r0, r2, #12
head->previous = NULL;
tail->previous = head;
6e1c: e242c004 sub ip, r2, #4
6e20: e2821008 add r1, r2, #8
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6e24: e5840054 str r0, [r4, #84] ; 0x54
6e28: e5842048 str r2, [r4, #72] ; 0x48
head->previous = NULL;
tail->previous = head;
6e2c: e584c050 str ip, [r4, #80] ; 0x50
6e30: e584105c str r1, [r4, #92] ; 0x5c
6e34: e5843060 str r3, [r4, #96] ; 0x60
return result;
}
6e38: e1a00005 mov r0, r5
6e3c: e8bd8030 pop {r4, r5, pc}
PTHREAD_CREATE_DETACHED);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6e40: e59f404c ldr r4, [pc, #76] ; 6e94 <rtems_aio_init+0xf4> <== NOT EXECUTED
result =
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
6e44: e59f0044 ldr r0, [pc, #68] ; 6e90 <rtems_aio_init+0xf0> <== NOT EXECUTED
6e48: eb00034c bl 7b80 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6e4c: e3a01000 mov r1, #0 <== NOT EXECUTED
6e50: e1a00004 mov r0, r4 <== NOT EXECUTED
6e54: eb00028c bl 788c <pthread_mutex_init> <== NOT EXECUTED
if (result != 0)
6e58: e3500000 cmp r0, #0 <== NOT EXECUTED
6e5c: 0affffe1 beq 6de8 <rtems_aio_init+0x48> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
6e60: e2840008 add r0, r4, #8 <== NOT EXECUTED
6e64: eb000345 bl 7b80 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
6e68: e59f0028 ldr r0, [pc, #40] ; 6e98 <rtems_aio_init+0xf8> <== NOT EXECUTED
6e6c: e3a01000 mov r1, #0 <== NOT EXECUTED
6e70: eb00018f bl 74b4 <pthread_cond_init> <== NOT EXECUTED
if (result != 0) {
6e74: e2505000 subs r5, r0, #0 <== NOT EXECUTED
6e78: 0affffdf beq 6dfc <rtems_aio_init+0x5c> <== NOT EXECUTED
pthread_mutex_destroy (&aio_request_queue.mutex);
6e7c: e59f0010 ldr r0, [pc, #16] ; 6e94 <rtems_aio_init+0xf4> <== NOT EXECUTED
6e80: eb000231 bl 774c <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
6e84: e59f0004 ldr r0, [pc, #4] ; 6e90 <rtems_aio_init+0xf0> <== NOT EXECUTED
6e88: eb00033c bl 7b80 <pthread_attr_destroy> <== NOT EXECUTED
6e8c: eaffffda b 6dfc <rtems_aio_init+0x5c> <== NOT EXECUTED
00006d48 <rtems_aio_insert_prio>:
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
6d48: e1a02000 mov r2, r0
6d4c: e4923004 ldr r3, [r2], #4
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
6d50: e1530002 cmp r3, r2
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
6d54: e1a0c001 mov ip, r1
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
6d58: 0a00000f beq 6d9c <rtems_aio_insert_prio+0x54>
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
6d5c: e5910014 ldr r0, [r1, #20]
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
6d60: e5931014 ldr r1, [r3, #20]
while (req->aiocbp->aio_reqprio > prio &&
6d64: e5900014 ldr r0, [r0, #20]
6d68: e5911014 ldr r1, [r1, #20]
6d6c: e1510000 cmp r1, r0
6d70: ba000002 blt 6d80 <rtems_aio_insert_prio+0x38>
6d74: ea000006 b 6d94 <rtems_aio_insert_prio+0x4c>
6d78: e1520003 cmp r2, r3 <== NOT EXECUTED
6d7c: 0a000004 beq 6d94 <rtems_aio_insert_prio+0x4c> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6d80: e5933000 ldr r3, [r3] <== NOT EXECUTED
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
6d84: e5931014 ldr r1, [r3, #20] <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
6d88: e5911014 ldr r1, [r1, #20] <== NOT EXECUTED
6d8c: e1510000 cmp r1, r0 <== NOT EXECUTED
6d90: bafffff8 blt 6d78 <rtems_aio_insert_prio+0x30> <== NOT EXECUTED
6d94: e5930004 ldr r0, [r3, #4]
6d98: e1a0100c mov r1, ip
6d9c: ea0009ba b 948c <_Chain_Insert>
00006fc0 <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
6fc0: e92d4010 push {r4, lr}
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6fc4: e4904004 ldr r4, [r0], #4
if (rtems_chain_is_empty (chain))
6fc8: e1540000 cmp r4, r0
return AIO_ALLDONE;
6fcc: 03a00002 moveq r0, #2
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
6fd0: 1a000003 bne 6fe4 <rtems_aio_remove_req+0x24>
6fd4: e8bd8010 pop {r4, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6fd8: e5944000 ldr r4, [r4] <== NOT EXECUTED
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
6fdc: e1500004 cmp r0, r4 <== NOT EXECUTED
6fe0: 0a00000d beq 701c <rtems_aio_remove_req+0x5c> <== NOT EXECUTED
6fe4: e5943014 ldr r3, [r4, #20]
6fe8: e1530001 cmp r3, r1
6fec: 1afffff9 bne 6fd8 <rtems_aio_remove_req+0x18>
6ff0: e1a00004 mov r0, r4
6ff4: eb00090f bl 9438 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
6ff8: e5943014 ldr r3, [r4, #20]
6ffc: e3a0208c mov r2, #140 ; 0x8c
7000: e5832030 str r2, [r3, #48] ; 0x30
current->aiocbp->return_value = -1;
7004: e3e02000 mvn r2, #0
free (current);
7008: e1a00004 mov r0, r4
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
700c: e5832034 str r2, [r3, #52] ; 0x34
free (current);
7010: ebffeef4 bl 2be8 <free>
}
return AIO_CANCELED;
7014: e3a00000 mov r0, #0
7018: e8bd8010 pop {r4, pc}
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
701c: e3a00001 mov r0, #1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
7020: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00010240 <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
10240: e92d4070 push {r4, r5, r6, lr}
rtems_status_code sc;
if ( event_out != NULL ) {
10244: e2535000 subs r5, r3, #0
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
10248: e1a0c000 mov ip, r0
1024c: e24dd010 sub sp, sp, #16
} else {
*event_out = event->pending_events;
sc = RTEMS_SUCCESSFUL;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
10250: 03a00009 moveq r0, #9
rtems_event_set *event_out
)
{
rtems_status_code sc;
if ( event_out != NULL ) {
10254: 0a000007 beq 10278 <rtems_event_system_receive+0x38>
Thread_Control *executing = _Thread_Executing;
10258: e59f4058 ldr r4, [pc, #88] ; 102b8 <rtems_event_system_receive+0x78>
1025c: e5944008 ldr r4, [r4, #8]
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
10260: e35c0000 cmp ip, #0
{
rtems_status_code sc;
if ( event_out != NULL ) {
Thread_Control *executing = _Thread_Executing;
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
10264: e59460f0 ldr r6, [r4, #240] ; 0xf0
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
10268: 1a000004 bne 10280 <rtems_event_system_receive+0x40>
);
_Thread_Enable_dispatch();
sc = executing->Wait.return_code;
} else {
*event_out = event->pending_events;
1026c: e5963004 ldr r3, [r6, #4] <== NOT EXECUTED
10270: e5853000 str r3, [r5] <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
10274: e1a0000c mov r0, ip <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
10278: e28dd010 add sp, sp, #16
1027c: e8bd8070 pop {r4, r5, r6, pc}
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
10280: e59fc034 ldr ip, [pc, #52] ; 102bc <rtems_event_system_receive+0x7c>
10284: e59ce000 ldr lr, [ip]
++level;
10288: e28ee001 add lr, lr, #1
_Thread_Dispatch_disable_level = level;
1028c: e58ce000 str lr, [ip]
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
_Thread_Disable_dispatch();
_Event_Seize(
10290: e59fc028 ldr ip, [pc, #40] ; 102c0 <rtems_event_system_receive+0x80>
rtems_status_code sc;
if ( event_out != NULL ) {
Thread_Control *executing = _Thread_Executing;
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
10294: e2866004 add r6, r6, #4
if ( !_Event_sets_Is_empty( event_in ) ) {
_Thread_Disable_dispatch();
_Event_Seize(
10298: e58dc008 str ip, [sp, #8]
1029c: e3a0c701 mov ip, #262144 ; 0x40000
102a0: e58dc00c str ip, [sp, #12]
102a4: e88d0050 stm sp, {r4, r6}
102a8: ebffdcaf bl 756c <_Event_Seize>
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
102ac: ebffe7e9 bl a258 <_Thread_Enable_dispatch>
sc = executing->Wait.return_code;
102b0: e5940034 ldr r0, [r4, #52] ; 0x34
102b4: eaffffef b 10278 <rtems_event_system_receive+0x38>
000063e8 <rtems_object_get_api_class_name>:
)
{
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
63e8: e3500001 cmp r0, #1
const char *rtems_object_get_api_class_name(
int the_api,
int the_class
)
{
63ec: e52de004 push {lr} ; (str lr, [sp, #-4]!)
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
63f0: 0a00000d beq 642c <rtems_object_get_api_class_name+0x44>
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
63f4: e3500002 cmp r0, #2
63f8: 0a000004 beq 6410 <rtems_object_get_api_class_name+0x28>
api_assoc = rtems_object_api_classic_assoc;
#ifdef RTEMS_POSIX_API
else if ( the_api == OBJECTS_POSIX_API )
63fc: e3500003 cmp r0, #3
api_assoc = rtems_object_api_posix_assoc;
6400: 059f003c ldreq r0, [pc, #60] ; 6444 <rtems_object_get_api_class_name+0x5c>
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
api_assoc = rtems_object_api_classic_assoc;
#ifdef RTEMS_POSIX_API
else if ( the_api == OBJECTS_POSIX_API )
6404: 0a000002 beq 6414 <rtems_object_get_api_class_name+0x2c>
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
6408: e59f0038 ldr r0, [pc, #56] ; 6448 <rtems_object_get_api_class_name+0x60>
640c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
api_assoc = rtems_object_api_classic_assoc;
6410: e59f0034 ldr r0, [pc, #52] ; 644c <rtems_object_get_api_class_name+0x64>
else if ( the_api == OBJECTS_POSIX_API )
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
6414: eb00128d bl ae50 <rtems_assoc_ptr_by_local>
if ( class_assoc )
6418: e3500000 cmp r0, #0
return class_assoc->name;
641c: 15900000 ldrne r0, [r0]
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
if ( class_assoc )
6420: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
return class_assoc->name;
return "BAD CLASS";
6424: e59f0024 ldr r0, [pc, #36] ; 6450 <rtems_object_get_api_class_name+0x68>
}
6428: e49df004 pop {pc} ; (ldr pc, [sp], #4)
{
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
642c: e59f0020 ldr r0, [pc, #32] ; 6454 <rtems_object_get_api_class_name+0x6c>
else if ( the_api == OBJECTS_POSIX_API )
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
6430: eb001286 bl ae50 <rtems_assoc_ptr_by_local>
if ( class_assoc )
6434: e3500000 cmp r0, #0
return class_assoc->name;
6438: 15900000 ldrne r0, [r0]
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
if ( class_assoc )
643c: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
6440: eafffff7 b 6424 <rtems_object_get_api_class_name+0x3c> <== NOT EXECUTED
000077f0 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
77f0: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
void *ptr = NULL;
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
77f4: e5906030 ldr r6, [r0, #48] ; 0x30
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
77f8: e1a05001 mov r5, r1
77fc: e1a04000 mov r4, r0
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
7800: e1a00001 mov r0, r1
7804: e1a01006 mov r1, r6
7808: eb00448d bl 18a44 <__umodsi3>
if (excess > 0) {
780c: e3500000 cmp r0, #0
7810: 01a06005 moveq r6, r5
7814: 03a03001 moveq r3, #1
7818: 0a000004 beq 7830 <rtems_rbheap_allocate+0x40>
value += alignment - excess;
781c: e0856006 add r6, r5, r6 <== NOT EXECUTED
7820: e0606006 rsb r6, r0, r6 <== NOT EXECUTED
7824: e1550006 cmp r5, r6 <== NOT EXECUTED
7828: 83a03000 movhi r3, #0 <== NOT EXECUTED
782c: 93a03001 movls r3, #1 <== NOT EXECUTED
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
7830: e3550000 cmp r5, #0
7834: 03a05000 moveq r5, #0
7838: 12035001 andne r5, r3, #1
783c: e3550000 cmp r5, #0
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
7840: 01a00005 moveq r0, r5
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
7844: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
7848: e1a02004 mov r2, r4
784c: e4927004 ldr r7, [r2], #4
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
7850: e1570002 cmp r7, r2
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
7854: 03a00000 moveq r0, #0
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
7858: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
785c: e597801c ldr r8, [r7, #28]
7860: e1560008 cmp r6, r8
7864: 8a00001a bhi 78d4 <rtems_rbheap_allocate+0xe4>
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
7868: e3570000 cmp r7, #0
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
786c: 01a00007 moveq r0, r7
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
7870: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
7874: e1580006 cmp r8, r6
7878: 9a00001c bls 78f0 <rtems_rbheap_allocate+0x100>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
787c: e1a0a004 mov sl, r4
7880: e5ba500c ldr r5, [sl, #12]!
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
7884: e2843010 add r3, r4, #16
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
7888: e1550003 cmp r5, r3
788c: 0a00001f beq 7910 <rtems_rbheap_allocate+0x120>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
7890: e5953000 ldr r3, [r5]
head->next = new_first;
7894: e584300c str r3, [r4, #12]
new_first->previous = head;
7898: e583a004 str sl, [r3, #4]
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
789c: e5972018 ldr r2, [r7, #24]
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
78a0: e0668008 rsb r8, r6, r8
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
78a4: e3a03000 mov r3, #0
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
78a8: e0882002 add r2, r8, r2
78ac: e1a01005 mov r1, r5
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
78b0: e587801c str r8, [r7, #28]
new_chunk->begin = free_chunk->begin + new_free_size;
78b4: e5852018 str r2, [r5, #24]
new_chunk->size = aligned_size;
78b8: e585601c str r6, [r5, #28]
78bc: e5853004 str r3, [r5, #4]
78c0: e4813008 str r3, [r1], #8
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
78c4: e2840018 add r0, r4, #24
78c8: eb0006af bl 938c <_RBTree_Insert_unprotected>
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
new_chunk->size = aligned_size;
rtems_chain_set_off_chain(&new_chunk->chain_node);
insert_into_tree(chunk_tree, new_chunk);
ptr = (void *) new_chunk->begin;
78cc: e5950018 ldr r0, [r5, #24]
78d0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
78d4: e5977000 ldr r7, [r7]
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
78d8: e0523007 subs r3, r2, r7
78dc: 13a03001 movne r3, #1
78e0: e3530000 cmp r3, #0
78e4: 1affffdc bne 785c <rtems_rbheap_allocate+0x6c>
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
78e8: e1a00003 mov r0, r3
78ec: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
78f0: e8970006 ldm r7, {r1, r2}
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
78f4: e3a03000 mov r3, #0
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
78f8: e5812004 str r2, [r1, #4]
previous->next = next;
78fc: e5821000 str r1, [r2]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
7900: e5873004 str r3, [r7, #4]
7904: e5873000 str r3, [r7]
ptr = (void *) new_chunk->begin;
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
7908: e5970018 ldr r0, [r7, #24]
790c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
7910: e1a00004 mov r0, r4 <== NOT EXECUTED
7914: e1a0e00f mov lr, pc <== NOT EXECUTED
7918: e594f034 ldr pc, [r4, #52] ; 0x34 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
791c: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
7920: e1550003 cmp r5, r3 <== NOT EXECUTED
7924: 0a000004 beq 793c <rtems_rbheap_allocate+0x14c> <== NOT EXECUTED
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
7928: e5932000 ldr r2, [r3] <== NOT EXECUTED
head->next = new_first;
new_first->previous = head;
792c: e1a05003 mov r5, r3 <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
7930: e584200c str r2, [r4, #12] <== NOT EXECUTED
new_first->previous = head;
7934: e582a004 str sl, [r2, #4] <== NOT EXECUTED
7938: eaffffd7 b 789c <rtems_rbheap_allocate+0xac> <== NOT EXECUTED
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
793c: e3a00000 mov r0, #0 <== NOT EXECUTED
}
}
}
return ptr;
}
7940: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00007ab8 <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
7ab8: e92d4010 push {r4, lr} <== NOT EXECUTED
7abc: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
7ac0: e3a00020 mov r0, #32 <== NOT EXECUTED
7ac4: ebffed5d bl 3040 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
7ac8: e3500000 cmp r0, #0 <== NOT EXECUTED
7acc: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
7ad0: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
7ad4: e284200c add r2, r4, #12 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
7ad8: e5802004 str r2, [r0, #4] <== NOT EXECUTED
before_node = after_node->next;
after_node->next = the_node;
7adc: e584000c str r0, [r4, #12] <== NOT EXECUTED
the_node->next = before_node;
before_node->previous = the_node;
7ae0: e5830004 str r0, [r3, #4] <== NOT EXECUTED
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
7ae4: e5803000 str r3, [r0] <== NOT EXECUTED
7ae8: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000102c4 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
102c4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
102c8: e2525000 subs r5, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
102cc: e1a04000 mov r4, r0
102d0: e1a06001 mov r6, r1
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
102d4: 03a00009 moveq r0, #9
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
102d8: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
102dc: e59f9148 ldr r9, [pc, #328] ; 1042c <rtems_task_mode+0x168>
102e0: e5997008 ldr r7, [r9, #8]
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
102e4: e5d7a070 ldrb sl, [r7, #112] ; 0x70
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
102e8: e59780f0 ldr r8, [r7, #240] ; 0xf0
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
102ec: e5973078 ldr r3, [r7, #120] ; 0x78
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
102f0: e35a0000 cmp sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
102f4: e5d8b008 ldrb fp, [r8, #8]
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
102f8: 03a0ac01 moveq sl, #256 ; 0x100
102fc: 13a0a000 movne sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
10300: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
10304: 138aac02 orrne sl, sl, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
10308: e35b0000 cmp fp, #0
1030c: 03a0bb01 moveq fp, #1024 ; 0x400
10310: 13a0b000 movne fp, #0
old_mode |= _ISR_Get_level();
10314: ebffecc2 bl b624 <_CPU_ISR_Get_level>
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
10318: e18bb000 orr fp, fp, r0
old_mode |= _ISR_Get_level();
1031c: e18ba00a orr sl, fp, sl
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
10320: e3160c01 tst r6, #256 ; 0x100
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
old_mode |= _ISR_Get_level();
*previous_mode_set = old_mode;
10324: e585a000 str sl, [r5]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
10328: 0a000003 beq 1033c <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
1032c: e3140c01 tst r4, #256 ; 0x100
10330: 13a03000 movne r3, #0
10334: 03a03001 moveq r3, #1
10338: e5c73070 strb r3, [r7, #112] ; 0x70
if ( mask & RTEMS_TIMESLICE_MASK ) {
1033c: e3160c02 tst r6, #512 ; 0x200
10340: 1a000028 bne 103e8 <rtems_task_mode+0x124>
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
10344: e3160080 tst r6, #128 ; 0x80
10348: 1a00002f bne 1040c <rtems_task_mode+0x148>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
1034c: e2166b01 ands r6, r6, #1024 ; 0x400
10350: 0a000012 beq 103a0 <rtems_task_mode+0xdc>
#include <rtems/score/tod.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/apiext.h>
#include <rtems/score/sysstate.h>
rtems_status_code rtems_task_mode(
10354: e3140b01 tst r4, #1024 ; 0x400
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
10358: e5d82008 ldrb r2, [r8, #8]
#include <rtems/score/tod.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/apiext.h>
#include <rtems/score/sysstate.h>
rtems_status_code rtems_task_mode(
1035c: 13a03000 movne r3, #0
10360: 03a03001 moveq r3, #1
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
10364: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
10368: 03a06000 moveq r6, #0
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
1036c: 0a00000b beq 103a0 <rtems_task_mode+0xdc>
asr->is_enabled = is_asr_enabled;
10370: e5c83008 strb r3, [r8, #8]
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
10374: e10f3000 mrs r3, CPSR
10378: e3832080 orr r2, r3, #128 ; 0x80
1037c: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
10380: e5981018 ldr r1, [r8, #24]
information->signals_pending = information->signals_posted;
10384: e5982014 ldr r2, [r8, #20]
information->signals_posted = _signals;
10388: e5881014 str r1, [r8, #20]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
1038c: e5882018 str r2, [r8, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
10390: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
10394: e5986014 ldr r6, [r8, #20]
10398: e3560000 cmp r6, #0
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
1039c: 13a06001 movne r6, #1
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
103a0: e59f3088 ldr r3, [pc, #136] ; 10430 <rtems_task_mode+0x16c>
103a4: e5933000 ldr r3, [r3]
103a8: e3530003 cmp r3, #3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
103ac: 13a00000 movne r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
103b0: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
Thread_Control *executing;
executing = _Thread_Executing;
if ( are_signals_pending ||
103b4: e3560000 cmp r6, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
103b8: e5993008 ldr r3, [r9, #8]
if ( are_signals_pending ||
103bc: 1a000015 bne 10418 <rtems_task_mode+0x154>
103c0: e59f2064 ldr r2, [pc, #100] ; 1042c <rtems_task_mode+0x168>
103c4: e592200c ldr r2, [r2, #12]
103c8: e1530002 cmp r3, r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
103cc: 01a00006 moveq r0, r6
103d0: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
103d4: e5d33070 ldrb r3, [r3, #112] ; 0x70
103d8: e3530000 cmp r3, #0
103dc: 1a00000d bne 10418 <rtems_task_mode+0x154>
103e0: e1a00006 mov r0, r6 <== NOT EXECUTED
}
103e4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
*/
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
103e8: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
103ec: 159f3040 ldrne r3, [pc, #64] ; 10434 <rtems_task_mode+0x170>
103f0: 15933000 ldrne r3, [r3]
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
103f4: 13a02001 movne r2, #1
103f8: 15872078 strne r2, [r7, #120] ; 0x78
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
103fc: 15873074 strne r3, [r7, #116] ; 0x74
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
10400: 05873078 streq r3, [r7, #120] ; 0x78
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
10404: e3160080 tst r6, #128 ; 0x80
10408: 0affffcf beq 1034c <rtems_task_mode+0x88>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
1040c: e2040080 and r0, r4, #128 ; 0x80
10410: ebffec7e bl b610 <_CPU_ISR_Set_level>
10414: eaffffcc b 1034c <rtems_task_mode+0x88>
_Thread_Dispatch_necessary = true;
10418: e3a03001 mov r3, #1
1041c: e5c93004 strb r3, [r9, #4]
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
10420: eb00028f bl 10e64 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
10424: e3a00000 mov r0, #0
10428: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00007420 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
7420: e92d000e push {r1, r2, r3}
7424: e92d41f0 push {r4, r5, r6, r7, r8, lr}
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
7428: e59f3104 ldr r3, [pc, #260] ; 7534 <sem_open+0x114>
742c: e5932000 ldr r2, [r3]
7430: e24dd018 sub sp, sp, #24
++level;
7434: e2822001 add r2, r2, #1
7438: e59d4030 ldr r4, [sp, #48] ; 0x30
_Thread_Dispatch_disable_level = level;
743c: e5832000 str r2, [r3]
7440: e1a05000 mov r5, r0
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
7444: e2146c02 ands r6, r4, #512 ; 0x200
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
7448: 128d303c addne r3, sp, #60 ; 0x3c
744c: 158d3004 strne r3, [sp, #4]
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
7450: e59f00e0 ldr r0, [pc, #224] ; 7538 <sem_open+0x118>
7454: e1a01005 mov r1, r5
7458: e28d2008 add r2, sp, #8
745c: e28d3014 add r3, sp, #20
7460: 159d7038 ldrne r7, [sp, #56] ; 0x38
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
7464: 01a07006 moveq r7, r6
7468: ebfffe64 bl 6e00 <_POSIX_Name_to_id>
* and we can just return a pointer to the id. Otherwise we may
* need to check to see if this is a "semaphore does not exist"
* or some other miscellaneous error on the name.
*/
if ( status ) {
746c: e2508000 subs r8, r0, #0
7470: 0a000008 beq 7498 <sem_open+0x78>
/*
* Unless provided a valid name that did not already exist
* and we are willing to create then it is an error.
*/
if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
7474: e3580002 cmp r8, #2
7478: 1a000001 bne 7484 <sem_open+0x64>
747c: e3560000 cmp r6, #0
7480: 1a000018 bne 74e8 <sem_open+0xc8>
_Thread_Enable_dispatch();
7484: eb000dbf bl ab88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
7488: eb002422 bl 10518 <__errno>
748c: e3e03000 mvn r3, #0
7490: e5808000 str r8, [r0]
7494: ea00000e b 74d4 <sem_open+0xb4>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
7498: e2044c0a and r4, r4, #2560 ; 0xa00
749c: e3540c0a cmp r4, #2560 ; 0xa00
74a0: 0a00001d beq 751c <sem_open+0xfc>
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
74a4: e59d1008 ldr r1, [sp, #8]
74a8: e28d2010 add r2, sp, #16
74ac: e59f0084 ldr r0, [pc, #132] ; 7538 <sem_open+0x118>
74b0: eb0009d9 bl 9c1c <_Objects_Get>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
74b4: e5903018 ldr r3, [r0, #24]
74b8: e2833001 add r3, r3, #1
74bc: e5803018 str r3, [r0, #24]
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
74c0: e58d000c str r0, [sp, #12]
the_semaphore->open_count += 1;
_Thread_Enable_dispatch();
74c4: eb000daf bl ab88 <_Thread_Enable_dispatch>
_Thread_Enable_dispatch();
74c8: eb000dae bl ab88 <_Thread_Enable_dispatch>
return_id:
#if defined(RTEMS_USE_16_BIT_OBJECT)
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
74cc: e59d300c ldr r3, [sp, #12]
74d0: e2833008 add r3, r3, #8
#endif
}
74d4: e1a00003 mov r0, r3
74d8: e28dd018 add sp, sp, #24
74dc: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
74e0: e28dd00c add sp, sp, #12
74e4: e12fff1e bx lr
/*
* At this point, the semaphore does not exist and everything has been
* checked. We should go ahead and create a semaphore.
*/
status =_POSIX_Semaphore_Create_support(
74e8: e1a03007 mov r3, r7
74ec: e28dc00c add ip, sp, #12
74f0: e3a02000 mov r2, #0
74f4: e59d1014 ldr r1, [sp, #20]
74f8: e1a00005 mov r0, r5
74fc: e58dc000 str ip, [sp]
7500: eb0019ab bl dbb4 <_POSIX_Semaphore_Create_support>
7504: e1a04000 mov r4, r0
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
7508: eb000d9e bl ab88 <_Thread_Enable_dispatch>
if ( status == -1 )
750c: e3740001 cmn r4, #1
return SEM_FAILED;
7510: 01a03004 moveq r3, r4
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
if ( status == -1 )
7514: 1affffec bne 74cc <sem_open+0xac>
7518: eaffffed b 74d4 <sem_open+0xb4> <== NOT EXECUTED
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
751c: eb000d99 bl ab88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
7520: eb0023fc bl 10518 <__errno>
7524: e3a03011 mov r3, #17
7528: e5803000 str r3, [r0]
752c: e3e03000 mvn r3, #0
7530: eaffffe7 b 74d4 <sem_open+0xb4>
0000944c <sem_timedwait>:
int sem_timedwait(
sem_t *sem,
const struct timespec *abstime
)
{
944c: e92d4010 push {r4, lr}
9450: e24dd004 sub sp, sp, #4
9454: e1a04000 mov r4, r0
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
9458: e1a00001 mov r0, r1
945c: e1a0100d mov r1, sp
9460: eb0015d7 bl ebc4 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
9464: e3500003 cmp r0, #3
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
9468: e1a00004 mov r0, r4
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
946c: 0a000004 beq 9484 <sem_timedwait+0x38>
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
9470: e3a01000 mov r1, #0 <== NOT EXECUTED
9474: e59d2000 ldr r2, [sp] <== NOT EXECUTED
9478: eb0018b8 bl f760 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED
lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}
return lock_status;
}
947c: e28dd004 add sp, sp, #4
9480: e8bd8010 pop {r4, pc}
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
9484: e3a01001 mov r1, #1
9488: e59d2000 ldr r2, [sp]
948c: eb0018b3 bl f760 <_POSIX_Semaphore_Wait_support>
9490: eafffff9 b 947c <sem_timedwait+0x30>
00006cd4 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
6cd4: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
6cd8: 159f20c4 ldrne r2, [pc, #196] ; 6da4 <sigaction+0xd0>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
6cdc: e92d4070 push {r4, r5, r6, lr}
6ce0: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
6ce4: 10801080 addne r1, r0, r0, lsl #1
6ce8: 10822101 addne r2, r2, r1, lsl #2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
6cec: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
6cf0: 18920007 ldmne r2, {r0, r1, r2}
6cf4: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
6cf8: e3540000 cmp r4, #0
6cfc: 0a000023 beq 6d90 <sigaction+0xbc>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
6d00: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
6d04: e353001f cmp r3, #31
6d08: 8a000020 bhi 6d90 <sigaction+0xbc>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
6d0c: e3540009 cmp r4, #9
6d10: 0a00001e beq 6d90 <sigaction+0xbc>
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
6d14: e3550000 cmp r5, #0
6d18: 0a00001a beq 6d88 <sigaction+0xb4>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
6d1c: e10f6000 mrs r6, CPSR
6d20: e3863080 orr r3, r6, #128 ; 0x80
6d24: e129f003 msr CPSR_fc, r3
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
6d28: e5953008 ldr r3, [r5, #8]
6d2c: e3530000 cmp r3, #0
6d30: 0a000009 beq 6d5c <sigaction+0x88>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
6d34: e1a00004 mov r0, r4
6d38: eb0016fb bl c92c <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
6d3c: e59f3060 ldr r3, [pc, #96] ; 6da4 <sigaction+0xd0>
6d40: e8950007 ldm r5, {r0, r1, r2}
6d44: e0844084 add r4, r4, r4, lsl #1
6d48: e0834104 add r4, r3, r4, lsl #2
6d4c: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
6d50: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
6d54: e3a00000 mov r0, #0
6d58: e8bd8070 pop {r4, r5, r6, pc}
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
6d5c: e0844084 add r4, r4, r4, lsl #1
6d60: e59f3040 ldr r3, [pc, #64] ; 6da8 <sigaction+0xd4>
6d64: e1a04104 lsl r4, r4, #2
6d68: e0833004 add r3, r3, r4
6d6c: e8930007 ldm r3, {r0, r1, r2}
6d70: e59f302c ldr r3, [pc, #44] ; 6da4 <sigaction+0xd0>
6d74: e0834004 add r4, r3, r4
6d78: e8840007 stm r4, {r0, r1, r2}
6d7c: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
6d80: e3a00000 mov r0, #0
6d84: e8bd8070 pop {r4, r5, r6, pc}
6d88: e1a00005 mov r0, r5 <== NOT EXECUTED
}
6d8c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
rtems_set_errno_and_return_minus_one( EINVAL );
6d90: eb002249 bl f6bc <__errno>
6d94: e3a03016 mov r3, #22
6d98: e5803000 str r3, [r0]
6d9c: e3e00000 mvn r0, #0
6da0: e8bd8070 pop {r4, r5, r6, pc}
000093ac <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
93ac: e92d4010 push {r4, lr}
93b0: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
93b4: e3a01000 mov r1, #0
93b8: e1a02001 mov r2, r1
93bc: ebffff64 bl 9154 <sigtimedwait>
if ( status != -1 ) {
93c0: e3700001 cmn r0, #1
93c4: 0a000005 beq 93e0 <sigwait+0x34>
if ( sig )
93c8: e3540000 cmp r4, #0
*sig = status;
93cc: 15840000 strne r0, [r4]
return 0;
93d0: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
93d4: 18bd8010 popne {r4, pc}
*sig = status;
return 0;
93d8: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
93dc: e8bd8010 pop {r4, pc} <== NOT EXECUTED
if ( sig )
*sig = status;
return 0;
}
return errno;
93e0: eb0021bc bl 11ad8 <__errno>
93e4: e5900000 ldr r0, [r0]
93e8: e8bd8010 pop {r4, pc}
00005f38 <sysconf>:
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
5f38: e3500002 cmp r0, #2
*/
long sysconf(
int name
)
{
5f3c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
if ( name == _SC_CLK_TCK )
5f40: 0a00000b beq 5f74 <sysconf+0x3c>
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
5f44: e3500004 cmp r0, #4
5f48: 0a00000e beq 5f88 <sysconf+0x50>
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
5f4c: e3500033 cmp r0, #51 ; 0x33
return 1024;
5f50: 03a00b01 moveq r0, #1024 ; 0x400
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
5f54: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return 1024;
if ( name == _SC_PAGESIZE )
5f58: e3500008 cmp r0, #8
return PAGE_SIZE;
5f5c: 03a00a01 moveq r0, #4096 ; 0x1000
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
5f60: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
5f64: e350004f cmp r0, #79 ; 0x4f
5f68: 1a000009 bne 5f94 <sysconf+0x5c>
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
5f6c: e3a00020 mov r0, #32 <== NOT EXECUTED
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
5f70: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
5f74: e59f302c ldr r3, [pc, #44] ; 5fa8 <sysconf+0x70>
5f78: e59f002c ldr r0, [pc, #44] ; 5fac <sysconf+0x74>
5f7c: e593100c ldr r1, [r3, #12]
5f80: eb004655 bl 178dc <__aeabi_uidiv>
5f84: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
5f88: e59f3020 ldr r3, [pc, #32] ; 5fb0 <sysconf+0x78>
5f8c: e5930000 ldr r0, [r3]
5f90: e49df004 pop {pc} ; (ldr pc, [sp], #4)
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
5f94: eb00225f bl e918 <__errno>
5f98: e3a03016 mov r3, #22
5f9c: e5803000 str r3, [r0]
5fa0: e3e00000 mvn r0, #0
5fa4: e49df004 pop {pc} ; (ldr pc, [sp], #4)