4000c3d8 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000c3d8: 9d e3 bf 98 save %sp, -104, %sp Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; 4000c3dc: a8 06 60 04 add %i1, 4, %l4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000c3e0: a0 10 00 18 mov %i0, %l0 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4000c3e4: 80 a6 40 14 cmp %i1, %l4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4000c3e8: e4 06 20 08 ld [ %i0 + 8 ], %l2 4000c3ec: 18 80 00 75 bgu 4000c5c0 <_Heap_Allocate_aligned_with_boundary+0x1e8> 4000c3f0: fa 06 20 10 ld [ %i0 + 0x10 ], %i5 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4000c3f4: 80 a6 e0 00 cmp %i3, 0 4000c3f8: 12 80 00 70 bne 4000c5b8 <_Heap_Allocate_aligned_with_boundary+0x1e0> 4000c3fc: 80 a6 40 1b cmp %i1, %i3 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000c400: 80 a4 00 12 cmp %l0, %l2 4000c404: 02 80 00 72 be 4000c5cc <_Heap_Allocate_aligned_with_boundary+0x1f4> 4000c408: a2 10 20 00 clr %l1 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c40c: 82 10 20 04 mov 4, %g1 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; 4000c410: b8 07 60 07 add %i5, 7, %i4 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c414: 82 20 40 19 sub %g1, %i1, %g1 4000c418: 10 80 00 09 b 4000c43c <_Heap_Allocate_aligned_with_boundary+0x64> 4000c41c: c2 27 bf fc st %g1, [ %fp + -4 ] boundary ); } } if ( alloc_begin != 0 ) { 4000c420: 80 a6 20 00 cmp %i0, 0 4000c424: 32 80 00 57 bne,a 4000c580 <_Heap_Allocate_aligned_with_boundary+0x1a8> 4000c428: c2 04 20 4c ld [ %l0 + 0x4c ], %g1 break; } block = block->next; 4000c42c: e4 04 a0 08 ld [ %l2 + 8 ], %l2 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000c430: 80 a4 00 12 cmp %l0, %l2 4000c434: 22 80 00 5a be,a 4000c59c <_Heap_Allocate_aligned_with_boundary+0x1c4> 4000c438: b0 10 20 00 clr %i0 /* * 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 ) { 4000c43c: e6 04 a0 04 ld [ %l2 + 4 ], %l3 4000c440: 80 a5 00 13 cmp %l4, %l3 4000c444: 1a bf ff fa bcc 4000c42c <_Heap_Allocate_aligned_with_boundary+0x54> 4000c448: a2 04 60 01 inc %l1 if ( alignment == 0 ) { 4000c44c: 80 a6 a0 00 cmp %i2, 0 4000c450: 02 bf ff f4 be 4000c420 <_Heap_Allocate_aligned_with_boundary+0x48> 4000c454: b0 04 a0 08 add %l2, 8, %i0 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c458: c2 07 bf fc ld [ %fp + -4 ], %g1 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4000c45c: ee 04 20 14 ld [ %l0 + 0x14 ], %l7 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; 4000c460: a6 0c ff fe and %l3, -2, %l3 4000c464: a6 04 80 13 add %l2, %l3, %l3 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c468: b0 00 40 13 add %g1, %l3, %i0 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; 4000c46c: 82 27 00 17 sub %i4, %l7, %g1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000c470: 90 10 00 18 mov %i0, %o0 4000c474: a6 00 40 13 add %g1, %l3, %l3 4000c478: 40 00 32 b8 call 40018f58 <.urem> 4000c47c: 92 10 00 1a mov %i2, %o1 4000c480: b0 26 00 08 sub %i0, %o0, %i0 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 ) { 4000c484: 80 a4 c0 18 cmp %l3, %i0 4000c488: 1a 80 00 06 bcc 4000c4a0 <_Heap_Allocate_aligned_with_boundary+0xc8> 4000c48c: ac 04 a0 08 add %l2, 8, %l6 4000c490: 90 10 00 13 mov %l3, %o0 4000c494: 40 00 32 b1 call 40018f58 <.urem> 4000c498: 92 10 00 1a mov %i2, %o1 4000c49c: b0 24 c0 08 sub %l3, %o0, %i0 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4000c4a0: 80 a6 e0 00 cmp %i3, 0 4000c4a4: 02 80 00 26 be 4000c53c <_Heap_Allocate_aligned_with_boundary+0x164> 4000c4a8: 80 a5 80 18 cmp %l6, %i0 /* 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; 4000c4ac: a6 06 00 19 add %i0, %i1, %l3 4000c4b0: 92 10 00 1b mov %i3, %o1 4000c4b4: 40 00 32 a9 call 40018f58 <.urem> 4000c4b8: 90 10 00 13 mov %l3, %o0 4000c4bc: 90 24 c0 08 sub %l3, %o0, %o0 /* 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 ) { 4000c4c0: 80 a4 c0 08 cmp %l3, %o0 4000c4c4: 08 80 00 1e bleu 4000c53c <_Heap_Allocate_aligned_with_boundary+0x164> 4000c4c8: 80 a5 80 18 cmp %l6, %i0 4000c4cc: 80 a6 00 08 cmp %i0, %o0 4000c4d0: 1a 80 00 1b bcc 4000c53c <_Heap_Allocate_aligned_with_boundary+0x164> 4000c4d4: 80 a5 80 18 cmp %l6, %i0 alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4000c4d8: aa 05 80 19 add %l6, %i1, %l5 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4000c4dc: 80 a5 40 08 cmp %l5, %o0 4000c4e0: 28 80 00 0a bleu,a 4000c508 <_Heap_Allocate_aligned_with_boundary+0x130> 4000c4e4: b0 22 00 19 sub %o0, %i1, %i0 if ( alloc_begin != 0 ) { break; } block = block->next; 4000c4e8: 10 bf ff d2 b 4000c430 <_Heap_Allocate_aligned_with_boundary+0x58> 4000c4ec: e4 04 a0 08 ld [ %l2 + 8 ], %l2 /* 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 ) { 4000c4f0: 1a 80 00 13 bcc 4000c53c <_Heap_Allocate_aligned_with_boundary+0x164> 4000c4f4: 80 a5 80 18 cmp %l6, %i0 if ( boundary_line < boundary_floor ) { 4000c4f8: 80 a5 40 08 cmp %l5, %o0 4000c4fc: 38 bf ff cd bgu,a 4000c430 <_Heap_Allocate_aligned_with_boundary+0x58> 4000c500: e4 04 a0 08 ld [ %l2 + 8 ], %l2 <== NOT EXECUTED return 0; } alloc_begin = boundary_line - alloc_size; 4000c504: b0 22 00 19 sub %o0, %i1, %i0 4000c508: 92 10 00 1a mov %i2, %o1 4000c50c: 40 00 32 93 call 40018f58 <.urem> 4000c510: 90 10 00 18 mov %i0, %o0 4000c514: 92 10 00 1b mov %i3, %o1 4000c518: b0 26 00 08 sub %i0, %o0, %i0 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4000c51c: a6 06 00 19 add %i0, %i1, %l3 4000c520: 40 00 32 8e call 40018f58 <.urem> 4000c524: 90 10 00 13 mov %l3, %o0 4000c528: 90 24 c0 08 sub %l3, %o0, %o0 /* 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 ) { 4000c52c: 80 a4 c0 08 cmp %l3, %o0 4000c530: 18 bf ff f0 bgu 4000c4f0 <_Heap_Allocate_aligned_with_boundary+0x118> 4000c534: 80 a6 00 08 cmp %i0, %o0 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 ) { 4000c538: 80 a5 80 18 cmp %l6, %i0 4000c53c: 18 bf ff bc bgu 4000c42c <_Heap_Allocate_aligned_with_boundary+0x54> 4000c540: 82 10 3f f8 mov -8, %g1 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; 4000c544: 90 10 00 18 mov %i0, %o0 4000c548: a6 20 40 12 sub %g1, %l2, %l3 4000c54c: 92 10 00 1d mov %i5, %o1 4000c550: 40 00 32 82 call 40018f58 <.urem> 4000c554: a6 04 c0 18 add %l3, %i0, %l3 if ( free_size >= min_block_size || free_size == 0 ) { 4000c558: 90 a4 c0 08 subcc %l3, %o0, %o0 4000c55c: 02 bf ff b2 be 4000c424 <_Heap_Allocate_aligned_with_boundary+0x4c> 4000c560: 80 a6 20 00 cmp %i0, 0 4000c564: 80 a5 c0 08 cmp %l7, %o0 4000c568: 38 bf ff b2 bgu,a 4000c430 <_Heap_Allocate_aligned_with_boundary+0x58> 4000c56c: e4 04 a0 08 ld [ %l2 + 8 ], %l2 boundary ); } } if ( alloc_begin != 0 ) { 4000c570: 80 a6 20 00 cmp %i0, 0 4000c574: 22 bf ff af be,a 4000c430 <_Heap_Allocate_aligned_with_boundary+0x58> 4000c578: e4 04 a0 08 ld [ %l2 + 8 ], %l2 <== NOT EXECUTED block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000c57c: c2 04 20 4c ld [ %l0 + 0x4c ], %g1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000c580: 92 10 00 12 mov %l2, %o1 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000c584: 82 00 40 11 add %g1, %l1, %g1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000c588: 96 10 00 19 mov %i1, %o3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000c58c: c2 24 20 4c st %g1, [ %l0 + 0x4c ] block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000c590: 90 10 00 10 mov %l0, %o0 4000c594: 7f ff e9 b1 call 40006c58 <_Heap_Block_allocate> 4000c598: 94 10 00 18 mov %i0, %o2 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4000c59c: c2 04 20 44 ld [ %l0 + 0x44 ], %g1 4000c5a0: 80 a0 40 11 cmp %g1, %l1 4000c5a4: 1a 80 00 08 bcc 4000c5c4 <_Heap_Allocate_aligned_with_boundary+0x1ec> 4000c5a8: 01 00 00 00 nop ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4000c5ac: e2 24 20 44 st %l1, [ %l0 + 0x44 ] 4000c5b0: 81 c7 e0 08 ret 4000c5b4: 81 e8 00 00 restore /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 4000c5b8: 08 80 00 07 bleu 4000c5d4 <_Heap_Allocate_aligned_with_boundary+0x1fc> 4000c5bc: 80 a6 a0 00 cmp %i2, 0 ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4000c5c0: b0 10 20 00 clr %i0 } return (void *) alloc_begin; } 4000c5c4: 81 c7 e0 08 ret 4000c5c8: 81 e8 00 00 restore if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000c5cc: 10 bf ff f4 b 4000c59c <_Heap_Allocate_aligned_with_boundary+0x1c4> 4000c5d0: b0 10 20 00 clr %i0 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4000c5d4: 22 bf ff 8b be,a 4000c400 <_Heap_Allocate_aligned_with_boundary+0x28> 4000c5d8: b4 10 00 1d mov %i5, %i2 alignment = page_size; } } while ( block != free_list_tail ) { 4000c5dc: 10 bf ff 8a b 4000c404 <_Heap_Allocate_aligned_with_boundary+0x2c> 4000c5e0: 80 a4 00 12 cmp %l0, %l2 40007bdc <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40007bdc: 9d e3 bf 88 save %sp, -120, %sp uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 40007be0: 25 10 00 20 sethi %hi(0x40008000), %l2 40007be4: 80 8e a0 ff btst 0xff, %i2 40007be8: a4 14 a1 dc or %l2, 0x1dc, %l2 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 40007bec: ea 06 20 10 ld [ %i0 + 0x10 ], %l5 uintptr_t const min_block_size = heap->min_block_size; 40007bf0: e6 06 20 14 ld [ %i0 + 0x14 ], %l3 Heap_Block *const last_block = heap->last_block; 40007bf4: e8 06 20 24 ld [ %i0 + 0x24 ], %l4 Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 40007bf8: 12 80 00 04 bne 40007c08 <_Heap_Walk+0x2c> 40007bfc: e0 06 20 20 ld [ %i0 + 0x20 ], %l0 40007c00: 25 10 00 1e sethi %hi(0x40007800), %l2 40007c04: a4 14 a3 d4 or %l2, 0x3d4, %l2 ! 40007bd4 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40007c08: 03 10 00 80 sethi %hi(0x40020000), %g1 40007c0c: c2 00 63 10 ld [ %g1 + 0x310 ], %g1 ! 40020310 <_System_state_Current> 40007c10: 80 a0 60 03 cmp %g1, 3 40007c14: 22 80 00 04 be,a 40007c24 <_Heap_Walk+0x48> 40007c18: da 06 20 18 ld [ %i0 + 0x18 ], %o5 block = next_block; } return true; } 40007c1c: 81 c7 e0 08 ret 40007c20: 91 e8 20 01 restore %g0, 1, %o0 Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 40007c24: c6 06 20 1c ld [ %i0 + 0x1c ], %g3 40007c28: c4 06 20 08 ld [ %i0 + 8 ], %g2 40007c2c: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40007c30: 90 10 00 19 mov %i1, %o0 40007c34: c6 23 a0 5c st %g3, [ %sp + 0x5c ] 40007c38: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40007c3c: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 40007c40: e0 23 a0 60 st %l0, [ %sp + 0x60 ] 40007c44: e8 23 a0 64 st %l4, [ %sp + 0x64 ] 40007c48: 92 10 20 00 clr %o1 40007c4c: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007c50: 96 10 00 15 mov %l5, %o3 40007c54: 94 12 a1 58 or %o2, 0x158, %o2 40007c58: 9f c4 80 00 call %l2 40007c5c: 98 10 00 13 mov %l3, %o4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 40007c60: 80 a5 60 00 cmp %l5, 0 40007c64: 02 80 00 36 be 40007d3c <_Heap_Walk+0x160> 40007c68: 80 8d 60 07 btst 7, %l5 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40007c6c: 12 80 00 3c bne 40007d5c <_Heap_Walk+0x180> 40007c70: 90 10 00 13 mov %l3, %o0 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40007c74: 7f ff e7 94 call 40001ac4 <.urem> 40007c78: 92 10 00 15 mov %l5, %o1 40007c7c: 80 a2 20 00 cmp %o0, 0 40007c80: 12 80 00 40 bne 40007d80 <_Heap_Walk+0x1a4> 40007c84: 90 04 20 08 add %l0, 8, %o0 ); return false; } if ( 40007c88: 7f ff e7 8f call 40001ac4 <.urem> 40007c8c: 92 10 00 15 mov %l5, %o1 40007c90: 80 a2 20 00 cmp %o0, 0 40007c94: 32 80 00 44 bne,a 40007da4 <_Heap_Walk+0x1c8> 40007c98: 90 10 00 19 mov %i1, %o0 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; 40007c9c: ec 04 20 04 ld [ %l0 + 4 ], %l6 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40007ca0: ae 8d a0 01 andcc %l6, 1, %l7 40007ca4: 22 80 00 48 be,a 40007dc4 <_Heap_Walk+0x1e8> 40007ca8: 90 10 00 19 mov %i1, %o0 ); return false; } if ( first_block->prev_size != page_size ) { 40007cac: d6 04 00 00 ld [ %l0 ], %o3 40007cb0: 80 a5 40 0b cmp %l5, %o3 40007cb4: 32 80 00 1a bne,a 40007d1c <_Heap_Walk+0x140> 40007cb8: 90 10 00 19 mov %i1, %o0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40007cbc: c2 05 20 04 ld [ %l4 + 4 ], %g1 40007cc0: 82 08 7f fe and %g1, -2, %g1 40007cc4: 82 05 00 01 add %l4, %g1, %g1 40007cc8: c2 00 60 04 ld [ %g1 + 4 ], %g1 40007ccc: 80 88 60 01 btst 1, %g1 40007cd0: 22 80 01 23 be,a 4000815c <_Heap_Walk+0x580> 40007cd4: 90 10 00 19 mov %i1, %o0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40007cd8: e2 06 20 08 ld [ %i0 + 8 ], %l1 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 40007cdc: 80 a6 00 11 cmp %i0, %l1 40007ce0: 02 80 00 6f be 40007e9c <_Heap_Walk+0x2c0> 40007ce4: f4 06 20 10 ld [ %i0 + 0x10 ], %i2 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; 40007ce8: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 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 40007cec: 80 a7 00 11 cmp %i4, %l1 40007cf0: 28 80 00 3c bleu,a 40007de0 <_Heap_Walk+0x204> 40007cf4: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 40007cf8: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 40007cfc: 96 10 00 11 mov %l1, %o3 40007d00: 92 10 20 01 mov 1, %o1 40007d04: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007d08: b0 10 20 00 clr %i0 40007d0c: 9f c4 80 00 call %l2 40007d10: 94 12 a3 00 or %o2, 0x300, %o2 40007d14: 81 c7 e0 08 ret 40007d18: 81 e8 00 00 restore return false; } if ( first_block->prev_size != page_size ) { (*printer)( 40007d1c: 98 10 00 15 mov %l5, %o4 40007d20: 92 10 20 01 mov 1, %o1 40007d24: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007d28: b0 10 20 00 clr %i0 40007d2c: 9f c4 80 00 call %l2 40007d30: 94 12 a2 b8 or %o2, 0x2b8, %o2 40007d34: 81 c7 e0 08 ret 40007d38: 81 e8 00 00 restore first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 40007d3c: 90 10 00 19 mov %i1, %o0 40007d40: 92 10 20 01 mov 1, %o1 40007d44: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007d48: b0 10 20 00 clr %i0 40007d4c: 9f c4 80 00 call %l2 40007d50: 94 12 a1 f0 or %o2, 0x1f0, %o2 40007d54: 81 c7 e0 08 ret 40007d58: 81 e8 00 00 restore return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 40007d5c: 90 10 00 19 mov %i1, %o0 40007d60: 96 10 00 15 mov %l5, %o3 40007d64: 92 10 20 01 mov 1, %o1 40007d68: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007d6c: b0 10 20 00 clr %i0 40007d70: 9f c4 80 00 call %l2 40007d74: 94 12 a2 08 or %o2, 0x208, %o2 40007d78: 81 c7 e0 08 ret 40007d7c: 81 e8 00 00 restore return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 40007d80: 90 10 00 19 mov %i1, %o0 40007d84: 96 10 00 13 mov %l3, %o3 40007d88: 92 10 20 01 mov 1, %o1 40007d8c: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007d90: b0 10 20 00 clr %i0 40007d94: 9f c4 80 00 call %l2 40007d98: 94 12 a2 28 or %o2, 0x228, %o2 40007d9c: 81 c7 e0 08 ret 40007da0: 81 e8 00 00 restore } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40007da4: 96 10 00 10 mov %l0, %o3 40007da8: 92 10 20 01 mov 1, %o1 40007dac: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007db0: b0 10 20 00 clr %i0 40007db4: 9f c4 80 00 call %l2 40007db8: 94 12 a2 50 or %o2, 0x250, %o2 40007dbc: 81 c7 e0 08 ret 40007dc0: 81 e8 00 00 restore return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 40007dc4: 92 10 20 01 mov 1, %o1 40007dc8: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007dcc: b0 10 20 00 clr %i0 40007dd0: 9f c4 80 00 call %l2 40007dd4: 94 12 a2 88 or %o2, 0x288, %o2 40007dd8: 81 c7 e0 08 ret 40007ddc: 81 e8 00 00 restore 40007de0: 80 a6 c0 11 cmp %i3, %l1 40007de4: 0a bf ff c6 bcs 40007cfc <_Heap_Walk+0x120> 40007de8: 90 10 00 19 mov %i1, %o0 ); return false; } if ( 40007dec: 90 04 60 08 add %l1, 8, %o0 40007df0: 7f ff e7 35 call 40001ac4 <.urem> 40007df4: 92 10 00 1a mov %i2, %o1 40007df8: 80 a2 20 00 cmp %o0, 0 40007dfc: 12 80 00 df bne 40008178 <_Heap_Walk+0x59c> 40007e00: 90 10 00 19 mov %i1, %o0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40007e04: c2 04 60 04 ld [ %l1 + 4 ], %g1 40007e08: 82 08 7f fe and %g1, -2, %g1 40007e0c: 82 04 40 01 add %l1, %g1, %g1 40007e10: c2 00 60 04 ld [ %g1 + 4 ], %g1 40007e14: 80 88 60 01 btst 1, %g1 40007e18: 12 80 00 ea bne 400081c0 <_Heap_Walk+0x5e4> 40007e1c: 96 10 00 11 mov %l1, %o3 ); return false; } if ( free_block->prev != prev_block ) { 40007e20: d8 04 60 0c ld [ %l1 + 0xc ], %o4 40007e24: 80 a6 00 0c cmp %i0, %o4 40007e28: 02 80 00 19 be 40007e8c <_Heap_Walk+0x2b0> 40007e2c: ba 10 00 11 mov %l1, %i5 40007e30: 30 80 00 dc b,a 400081a0 <_Heap_Walk+0x5c4> <== NOT EXECUTED 40007e34: 0a bf ff b2 bcs 40007cfc <_Heap_Walk+0x120> 40007e38: 90 10 00 19 mov %i1, %o0 40007e3c: 80 a6 c0 11 cmp %i3, %l1 40007e40: 0a bf ff b0 bcs 40007d00 <_Heap_Walk+0x124> 40007e44: 96 10 00 11 mov %l1, %o3 ); return false; } if ( 40007e48: 90 04 60 08 add %l1, 8, %o0 40007e4c: 7f ff e7 1e call 40001ac4 <.urem> 40007e50: 92 10 00 1a mov %i2, %o1 40007e54: 80 a2 20 00 cmp %o0, 0 40007e58: 32 80 00 c8 bne,a 40008178 <_Heap_Walk+0x59c> 40007e5c: 90 10 00 19 mov %i1, %o0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40007e60: c2 04 60 04 ld [ %l1 + 4 ], %g1 40007e64: 82 08 7f fe and %g1, -2, %g1 40007e68: 82 00 40 11 add %g1, %l1, %g1 40007e6c: c2 00 60 04 ld [ %g1 + 4 ], %g1 40007e70: 80 88 60 01 btst 1, %g1 40007e74: 32 80 00 d2 bne,a 400081bc <_Heap_Walk+0x5e0> 40007e78: 90 10 00 19 mov %i1, %o0 ); return false; } if ( free_block->prev != prev_block ) { 40007e7c: d8 04 60 0c ld [ %l1 + 0xc ], %o4 40007e80: 80 a3 00 1d cmp %o4, %i5 40007e84: 12 80 00 c5 bne 40008198 <_Heap_Walk+0x5bc> 40007e88: ba 10 00 11 mov %l1, %i5 return false; } prev_block = free_block; free_block = free_block->next; 40007e8c: e2 04 60 08 ld [ %l1 + 8 ], %l1 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 40007e90: 80 a6 00 11 cmp %i0, %l1 40007e94: 12 bf ff e8 bne 40007e34 <_Heap_Walk+0x258> 40007e98: 80 a4 40 1c cmp %l1, %i4 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 40007e9c: 80 a5 00 10 cmp %l4, %l0 40007ea0: 02 bf ff 5f be 40007c1c <_Heap_Walk+0x40> 40007ea4: 37 10 00 75 sethi %hi(0x4001d400), %i3 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40007ea8: 35 10 00 75 sethi %hi(0x4001d400), %i2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 40007eac: 39 10 00 76 sethi %hi(0x4001d800), %i4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40007eb0: ba 10 00 15 mov %l5, %i5 bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { (*printer)( 40007eb4: b6 16 e3 a8 or %i3, 0x3a8, %i3 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40007eb8: b4 16 a3 c0 or %i2, 0x3c0, %i2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 40007ebc: b8 17 21 58 or %i4, 0x158, %i4 40007ec0: aa 10 00 14 mov %l4, %l5 - 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; 40007ec4: ac 0d bf fe and %l6, -2, %l6 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 40007ec8: 80 a5 e0 00 cmp %l7, 0 40007ecc: 02 80 00 16 be 40007f24 <_Heap_Walk+0x348> 40007ed0: a2 05 80 10 add %l6, %l0, %l1 (*printer)( 40007ed4: 90 10 00 19 mov %i1, %o0 40007ed8: 92 10 20 00 clr %o1 40007edc: 94 10 00 1b mov %i3, %o2 40007ee0: 96 10 00 10 mov %l0, %o3 40007ee4: 9f c4 80 00 call %l2 40007ee8: 98 10 00 16 mov %l6, %o4 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 40007eec: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40007ef0: 80 a0 40 11 cmp %g1, %l1 40007ef4: 28 80 00 18 bleu,a 40007f54 <_Heap_Walk+0x378> 40007ef8: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 40007efc: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 40007f00: 96 10 00 10 mov %l0, %o3 40007f04: 98 10 00 11 mov %l1, %o4 40007f08: 92 10 20 01 mov 1, %o1 40007f0c: 15 10 00 75 sethi %hi(0x4001d400), %o2 40007f10: b0 10 20 00 clr %i0 40007f14: 9f c4 80 00 call %l2 40007f18: 94 12 a3 e8 or %o2, 0x3e8, %o2 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 40007f1c: 81 c7 e0 08 ret 40007f20: 81 e8 00 00 restore "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40007f24: da 04 00 00 ld [ %l0 ], %o5 40007f28: 90 10 00 19 mov %i1, %o0 40007f2c: 92 10 20 00 clr %o1 40007f30: 94 10 00 1a mov %i2, %o2 40007f34: 96 10 00 10 mov %l0, %o3 40007f38: 9f c4 80 00 call %l2 40007f3c: 98 10 00 16 mov %l6, %o4 40007f40: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40007f44: 80 a0 40 11 cmp %g1, %l1 40007f48: 18 bf ff ee bgu 40007f00 <_Heap_Walk+0x324> 40007f4c: 90 10 00 19 mov %i1, %o0 40007f50: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 40007f54: 80 a0 40 11 cmp %g1, %l1 40007f58: 0a bf ff ea bcs 40007f00 <_Heap_Walk+0x324> 40007f5c: 90 10 00 19 mov %i1, %o0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 40007f60: 90 10 00 16 mov %l6, %o0 40007f64: 7f ff e6 d8 call 40001ac4 <.urem> 40007f68: 92 10 00 1d mov %i5, %o1 40007f6c: 80 a2 20 00 cmp %o0, 0 40007f70: 12 80 00 5d bne 400080e4 <_Heap_Walk+0x508> 40007f74: 80 a4 c0 16 cmp %l3, %l6 ); return false; } if ( block_size < min_block_size ) { 40007f78: 18 80 00 65 bgu 4000810c <_Heap_Walk+0x530> 40007f7c: 80 a4 00 11 cmp %l0, %l1 ); return false; } if ( next_block_begin <= block_begin ) { 40007f80: 3a 80 00 6e bcc,a 40008138 <_Heap_Walk+0x55c> 40007f84: 90 10 00 19 mov %i1, %o0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 40007f88: c2 04 60 04 ld [ %l1 + 4 ], %g1 40007f8c: 80 88 60 01 btst 1, %g1 40007f90: 12 80 00 40 bne 40008090 <_Heap_Walk+0x4b4> 40007f94: 80 a5 40 11 cmp %l5, %l1 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; 40007f98: e8 04 20 04 ld [ %l0 + 4 ], %l4 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 40007f9c: d8 04 20 0c ld [ %l0 + 0xc ], %o4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40007fa0: c2 06 20 08 ld [ %i0 + 8 ], %g1 - 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; 40007fa4: ac 0d 3f fe and %l4, -2, %l6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40007fa8: 1b 10 00 76 sethi %hi(0x4001d800), %o5 40007fac: 80 a0 40 0c cmp %g1, %o4 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 40007fb0: c6 06 20 0c ld [ %i0 + 0xc ], %g3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40007fb4: ae 04 00 16 add %l0, %l6, %l7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40007fb8: 02 80 00 07 be 40007fd4 <_Heap_Walk+0x3f8> 40007fbc: 9a 13 60 b0 or %o5, 0xb0, %o5 "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 40007fc0: 1b 10 00 76 sethi %hi(0x4001d800), %o5 40007fc4: 80 a3 00 18 cmp %o4, %i0 40007fc8: 02 80 00 03 be 40007fd4 <_Heap_Walk+0x3f8> 40007fcc: 9a 13 60 c0 or %o5, 0xc0, %o5 40007fd0: 9a 10 00 1c mov %i4, %o5 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 40007fd4: c2 04 20 08 ld [ %l0 + 8 ], %g1 40007fd8: 05 10 00 76 sethi %hi(0x4001d800), %g2 40007fdc: 80 a0 c0 01 cmp %g3, %g1 40007fe0: 02 80 00 07 be 40007ffc <_Heap_Walk+0x420> 40007fe4: 84 10 a0 d0 or %g2, 0xd0, %g2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 40007fe8: 05 10 00 76 sethi %hi(0x4001d800), %g2 40007fec: 80 a0 40 18 cmp %g1, %i0 40007ff0: 02 80 00 03 be 40007ffc <_Heap_Walk+0x420> 40007ff4: 84 10 a0 e0 or %g2, 0xe0, %g2 40007ff8: 84 10 00 1c mov %i4, %g2 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 40007ffc: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40008000: c4 23 a0 60 st %g2, [ %sp + 0x60 ] 40008004: 90 10 00 19 mov %i1, %o0 40008008: 92 10 20 00 clr %o1 4000800c: 15 10 00 76 sethi %hi(0x4001d800), %o2 40008010: 96 10 00 10 mov %l0, %o3 40008014: 9f c4 80 00 call %l2 40008018: 94 12 a0 f0 or %o2, 0xf0, %o2 block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 4000801c: da 05 c0 00 ld [ %l7 ], %o5 40008020: 80 a5 80 0d cmp %l6, %o5 40008024: 02 80 00 0c be 40008054 <_Heap_Walk+0x478> 40008028: 90 10 00 19 mov %i1, %o0 (*printer)( 4000802c: ee 23 a0 5c st %l7, [ %sp + 0x5c ] 40008030: 96 10 00 10 mov %l0, %o3 40008034: 98 10 00 16 mov %l6, %o4 40008038: 92 10 20 01 mov 1, %o1 4000803c: 15 10 00 76 sethi %hi(0x4001d800), %o2 40008040: b0 10 20 00 clr %i0 40008044: 9f c4 80 00 call %l2 40008048: 94 12 a1 20 or %o2, 0x120, %o2 4000804c: 81 c7 e0 08 ret 40008050: 81 e8 00 00 restore ); return false; } if ( !prev_used ) { 40008054: 80 8d 20 01 btst 1, %l4 40008058: 02 80 00 1c be 400080c8 <_Heap_Walk+0x4ec> 4000805c: 96 10 00 10 mov %l0, %o3 40008060: c2 06 20 08 ld [ %i0 + 8 ], %g1 ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 40008064: 80 a0 40 18 cmp %g1, %i0 40008068: 12 80 00 07 bne 40008084 <_Heap_Walk+0x4a8> 4000806c: 80 a0 40 10 cmp %g1, %l0 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40008070: 10 80 00 0f b 400080ac <_Heap_Walk+0x4d0> <== NOT EXECUTED 40008074: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 40008078: 80 a0 40 18 cmp %g1, %i0 4000807c: 02 80 00 0a be 400080a4 <_Heap_Walk+0x4c8> 40008080: 80 a0 40 10 cmp %g1, %l0 if ( free_block == block ) { 40008084: 32 bf ff fd bne,a 40008078 <_Heap_Walk+0x49c> 40008088: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 4000808c: 80 a5 40 11 cmp %l5, %l1 40008090: 02 bf fe e3 be 40007c1c <_Heap_Walk+0x40> 40008094: a0 10 00 11 mov %l1, %l0 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 40008098: ec 04 60 04 ld [ %l1 + 4 ], %l6 4000809c: 10 bf ff 8a b 40007ec4 <_Heap_Walk+0x2e8> 400080a0: ae 0d a0 01 and %l6, 1, %l7 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 400080a4: 90 10 00 19 mov %i1, %o0 400080a8: 96 10 00 10 mov %l0, %o3 400080ac: 92 10 20 01 mov 1, %o1 400080b0: 15 10 00 76 sethi %hi(0x4001d800), %o2 400080b4: b0 10 20 00 clr %i0 400080b8: 9f c4 80 00 call %l2 400080bc: 94 12 a1 90 or %o2, 0x190, %o2 400080c0: 81 c7 e0 08 ret 400080c4: 81 e8 00 00 restore return false; } if ( !prev_used ) { (*printer)( 400080c8: 92 10 20 01 mov 1, %o1 400080cc: 15 10 00 76 sethi %hi(0x4001d800), %o2 400080d0: b0 10 20 00 clr %i0 400080d4: 9f c4 80 00 call %l2 400080d8: 94 12 a1 60 or %o2, 0x160, %o2 400080dc: 81 c7 e0 08 ret 400080e0: 81 e8 00 00 restore return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 400080e4: 90 10 00 19 mov %i1, %o0 400080e8: 96 10 00 10 mov %l0, %o3 400080ec: 98 10 00 16 mov %l6, %o4 400080f0: 92 10 20 01 mov 1, %o1 400080f4: 15 10 00 76 sethi %hi(0x4001d800), %o2 400080f8: b0 10 20 00 clr %i0 400080fc: 9f c4 80 00 call %l2 40008100: 94 12 a0 18 or %o2, 0x18, %o2 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 40008104: 81 c7 e0 08 ret 40008108: 81 e8 00 00 restore } if ( block_size < min_block_size ) { (*printer)( 4000810c: 90 10 00 19 mov %i1, %o0 40008110: 96 10 00 10 mov %l0, %o3 40008114: 98 10 00 16 mov %l6, %o4 40008118: 9a 10 00 13 mov %l3, %o5 4000811c: 92 10 20 01 mov 1, %o1 40008120: 15 10 00 76 sethi %hi(0x4001d800), %o2 40008124: b0 10 20 00 clr %i0 40008128: 9f c4 80 00 call %l2 4000812c: 94 12 a0 48 or %o2, 0x48, %o2 block, block_size, min_block_size ); return false; 40008130: 81 c7 e0 08 ret 40008134: 81 e8 00 00 restore } if ( next_block_begin <= block_begin ) { (*printer)( 40008138: 96 10 00 10 mov %l0, %o3 4000813c: 98 10 00 11 mov %l1, %o4 40008140: 92 10 20 01 mov 1, %o1 40008144: 15 10 00 76 sethi %hi(0x4001d800), %o2 40008148: b0 10 20 00 clr %i0 4000814c: 9f c4 80 00 call %l2 40008150: 94 12 a0 78 or %o2, 0x78, %o2 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40008154: 81 c7 e0 08 ret 40008158: 81 e8 00 00 restore return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 4000815c: 92 10 20 01 mov 1, %o1 40008160: 15 10 00 75 sethi %hi(0x4001d400), %o2 40008164: b0 10 20 00 clr %i0 40008168: 9f c4 80 00 call %l2 4000816c: 94 12 a2 e8 or %o2, 0x2e8, %o2 40008170: 81 c7 e0 08 ret 40008174: 81 e8 00 00 restore } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40008178: 96 10 00 11 mov %l1, %o3 4000817c: 92 10 20 01 mov 1, %o1 40008180: 15 10 00 75 sethi %hi(0x4001d400), %o2 40008184: b0 10 20 00 clr %i0 40008188: 9f c4 80 00 call %l2 4000818c: 94 12 a3 20 or %o2, 0x320, %o2 40008190: 81 c7 e0 08 ret 40008194: 81 e8 00 00 restore return false; } if ( free_block->prev != prev_block ) { (*printer)( 40008198: 90 10 00 19 mov %i1, %o0 4000819c: 96 10 00 11 mov %l1, %o3 400081a0: 92 10 20 01 mov 1, %o1 400081a4: 15 10 00 75 sethi %hi(0x4001d400), %o2 400081a8: b0 10 20 00 clr %i0 400081ac: 9f c4 80 00 call %l2 400081b0: 94 12 a3 70 or %o2, 0x370, %o2 400081b4: 81 c7 e0 08 ret 400081b8: 81 e8 00 00 restore return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 400081bc: 96 10 00 11 mov %l1, %o3 400081c0: 92 10 20 01 mov 1, %o1 400081c4: 15 10 00 75 sethi %hi(0x4001d400), %o2 400081c8: b0 10 20 00 clr %i0 400081cc: 9f c4 80 00 call %l2 400081d0: 94 12 a3 50 or %o2, 0x350, %o2 400081d4: 81 c7 e0 08 ret 400081d8: 81 e8 00 00 restore 40006f18 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 40006f18: 9d e3 bf 90 save %sp, -112, %sp minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 40006f1c: e8 06 20 34 ld [ %i0 + 0x34 ], %l4 40006f20: 80 a5 20 00 cmp %l4, 0 40006f24: 02 80 00 ab be 400071d0 <_Objects_Extend_information+0x2b8> 40006f28: e6 16 20 0a lduh [ %i0 + 0xa ], %l3 block_count = 0; else { block_count = information->maximum / information->allocation_size; 40006f2c: ea 16 20 10 lduh [ %i0 + 0x10 ], %l5 40006f30: e4 16 20 14 lduh [ %i0 + 0x14 ], %l2 40006f34: ab 2d 60 10 sll %l5, 0x10, %l5 40006f38: 92 10 00 12 mov %l2, %o1 40006f3c: 40 00 47 5b call 40018ca8 <.udiv> 40006f40: 91 35 60 10 srl %l5, 0x10, %o0 40006f44: 91 2a 20 10 sll %o0, 0x10, %o0 40006f48: b9 32 20 10 srl %o0, 0x10, %i4 for ( ; block < block_count; block++ ) { 40006f4c: 80 a7 20 00 cmp %i4, 0 40006f50: 02 80 00 a7 be 400071ec <_Objects_Extend_information+0x2d4> 40006f54: 90 10 00 12 mov %l2, %o0 if ( information->object_blocks[ block ] == NULL ) 40006f58: c2 05 00 00 ld [ %l4 ], %g1 40006f5c: 80 a0 60 00 cmp %g1, 0 40006f60: 02 80 00 a4 be 400071f0 <_Objects_Extend_information+0x2d8> 40006f64: a2 10 00 13 mov %l3, %l1 40006f68: 10 80 00 06 b 40006f80 <_Objects_Extend_information+0x68> 40006f6c: a0 10 20 00 clr %l0 40006f70: c2 05 00 01 ld [ %l4 + %g1 ], %g1 40006f74: 80 a0 60 00 cmp %g1, 0 40006f78: 22 80 00 08 be,a 40006f98 <_Objects_Extend_information+0x80> 40006f7c: ab 35 60 10 srl %l5, 0x10, %l5 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40006f80: a0 04 20 01 inc %l0 if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size; 40006f84: a2 04 40 12 add %l1, %l2, %l1 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40006f88: 80 a7 00 10 cmp %i4, %l0 40006f8c: 18 bf ff f9 bgu 40006f70 <_Objects_Extend_information+0x58> 40006f90: 83 2c 20 02 sll %l0, 2, %g1 else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 40006f94: ab 35 60 10 srl %l5, 0x10, %l5 /* * 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 ) { 40006f98: 03 00 00 3f sethi %hi(0xfc00), %g1 else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 40006f9c: aa 05 40 08 add %l5, %o0, %l5 /* * 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 ) { 40006fa0: 82 10 63 ff or %g1, 0x3ff, %g1 40006fa4: 80 a5 40 01 cmp %l5, %g1 40006fa8: 18 80 00 96 bgu 40007200 <_Objects_Extend_information+0x2e8> 40006fac: 01 00 00 00 nop /* * 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; 40006fb0: 40 00 47 04 call 40018bc0 <.umul> 40006fb4: d2 06 20 18 ld [ %i0 + 0x18 ], %o1 if ( information->auto_extend ) { 40006fb8: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1 40006fbc: 80 a0 60 00 cmp %g1, 0 40006fc0: 12 80 00 6d bne 40007174 <_Objects_Extend_information+0x25c> 40006fc4: 01 00 00 00 nop new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 40006fc8: 40 00 08 bd call 400092bc <_Workspace_Allocate_or_fatal_error> 40006fcc: 01 00 00 00 nop 40006fd0: a4 10 00 08 mov %o0, %l2 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 40006fd4: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40006fd8: 80 a4 40 01 cmp %l1, %g1 40006fdc: 2a 80 00 43 bcs,a 400070e8 <_Objects_Extend_information+0x1d0> 40006fe0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 */ /* * Up the block count and maximum */ block_count++; 40006fe4: a8 07 20 01 add %i4, 1, %l4 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 40006fe8: 91 2d 20 01 sll %l4, 1, %o0 40006fec: 90 02 00 14 add %o0, %l4, %o0 40006ff0: 90 05 40 08 add %l5, %o0, %o0 40006ff4: 90 02 00 13 add %o0, %l3, %o0 40006ff8: 40 00 08 c0 call 400092f8 <_Workspace_Allocate> 40006ffc: 91 2a 20 02 sll %o0, 2, %o0 if ( !object_blocks ) { 40007000: ac 92 20 00 orcc %o0, 0, %l6 40007004: 02 80 00 7d be 400071f8 <_Objects_Extend_information+0x2e0> 40007008: a9 2d 20 02 sll %l4, 2, %l4 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 4000700c: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40007010: 80 a4 c0 01 cmp %l3, %g1 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 40007014: ae 05 80 14 add %l6, %l4, %l7 40007018: 0a 80 00 5e bcs 40007190 <_Objects_Extend_information+0x278> 4000701c: a8 05 c0 14 add %l7, %l4, %l4 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40007020: 80 a4 e0 00 cmp %l3, 0 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40007024: 82 10 20 00 clr %g1 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40007028: 02 80 00 08 be 40007048 <_Objects_Extend_information+0x130> 4000702c: bb 2f 20 02 sll %i4, 2, %i5 local_table[ index ] = NULL; 40007030: 85 28 60 02 sll %g1, 2, %g2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40007034: 82 00 60 01 inc %g1 40007038: 80 a4 c0 01 cmp %l3, %g1 4000703c: 18 bf ff fd bgu 40007030 <_Objects_Extend_information+0x118> 40007040: c0 20 80 14 clr [ %g2 + %l4 ] 40007044: bb 2f 20 02 sll %i4, 2, %i5 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40007048: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 4000704c: c0 25 c0 1d clr [ %l7 + %i5 ] for ( index=index_base ; index < ( information->allocation_size + index_base ); 40007050: 86 04 40 03 add %l1, %g3, %g3 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 40007054: 80 a4 40 03 cmp %l1, %g3 40007058: 1a 80 00 0a bcc 40007080 <_Objects_Extend_information+0x168> 4000705c: c0 25 80 1d clr [ %l6 + %i5 ] 40007060: 85 2c 60 02 sll %l1, 2, %g2 40007064: 82 10 00 11 mov %l1, %g1 40007068: 84 05 00 02 add %l4, %g2, %g2 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 4000706c: c0 20 80 00 clr [ %g2 ] object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 40007070: 82 00 60 01 inc %g1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 40007074: 80 a0 40 03 cmp %g1, %g3 40007078: 0a bf ff fd bcs 4000706c <_Objects_Extend_information+0x154> 4000707c: 84 00 a0 04 add %g2, 4, %g2 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 40007080: 7f ff eb 17 call 40001cdc 40007084: 01 00 00 00 nop 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( 40007088: c6 06 00 00 ld [ %i0 ], %g3 4000708c: c4 16 20 04 lduh [ %i0 + 4 ], %g2 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; 40007090: ea 36 20 10 sth %l5, [ %i0 + 0x10 ] local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 40007094: e6 06 20 34 ld [ %i0 + 0x34 ], %l3 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 40007098: ee 26 20 30 st %l7, [ %i0 + 0x30 ] information->local_table = local_table; 4000709c: e8 26 20 1c st %l4, [ %i0 + 0x1c ] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 400070a0: 87 28 e0 18 sll %g3, 0x18, %g3 400070a4: 85 28 a0 1b sll %g2, 0x1b, %g2 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 400070a8: ec 26 20 34 st %l6, [ %i0 + 0x34 ] information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 400070ac: ab 2d 60 10 sll %l5, 0x10, %l5 400070b0: 03 00 00 40 sethi %hi(0x10000), %g1 400070b4: ab 35 60 10 srl %l5, 0x10, %l5 400070b8: 82 10 c0 01 or %g3, %g1, %g1 400070bc: 82 10 40 02 or %g1, %g2, %g1 400070c0: 82 10 40 15 or %g1, %l5, %g1 400070c4: c2 26 20 0c st %g1, [ %i0 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 400070c8: 7f ff eb 09 call 40001cec 400070cc: 01 00 00 00 nop if ( old_tables ) 400070d0: 80 a4 e0 00 cmp %l3, 0 400070d4: 22 80 00 05 be,a 400070e8 <_Objects_Extend_information+0x1d0> 400070d8: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 _Workspace_Free( old_tables ); 400070dc: 40 00 08 90 call 4000931c <_Workspace_Free> 400070e0: 90 10 00 13 mov %l3, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 400070e4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 400070e8: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2 400070ec: d6 06 20 18 ld [ %i0 + 0x18 ], %o3 400070f0: 92 10 00 12 mov %l2, %o1 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 400070f4: a1 2c 20 02 sll %l0, 2, %l0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 400070f8: a6 06 20 20 add %i0, 0x20, %l3 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 400070fc: e4 20 40 10 st %l2, [ %g1 + %l0 ] */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 40007100: 29 00 00 40 sethi %hi(0x10000), %l4 information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 40007104: a4 07 bf f4 add %fp, -12, %l2 40007108: 40 00 14 09 call 4000c12c <_Chain_Initialize> 4000710c: 90 10 00 12 mov %l2, %o0 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 40007110: 30 80 00 0c b,a 40007140 <_Objects_Extend_information+0x228> the_object->id = _Objects_Build_id( 40007114: c4 16 20 04 lduh [ %i0 + 4 ], %g2 40007118: 83 28 60 18 sll %g1, 0x18, %g1 4000711c: 85 28 a0 1b sll %g2, 0x1b, %g2 40007120: 82 10 40 14 or %g1, %l4, %g1 40007124: 82 10 40 02 or %g1, %g2, %g1 40007128: 82 10 40 11 or %g1, %l1, %g1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 4000712c: 92 10 00 08 mov %o0, %o1 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 40007130: c2 22 20 08 st %g1, [ %o0 + 8 ] index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 40007134: a2 04 60 01 inc %l1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40007138: 7f ff fc e2 call 400064c0 <_Chain_Append> 4000713c: 90 10 00 13 mov %l3, %o0 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 40007140: 40 00 13 e8 call 4000c0e0 <_Chain_Get> 40007144: 90 10 00 12 mov %l2, %o0 40007148: 80 a2 20 00 cmp %o0, 0 4000714c: 32 bf ff f2 bne,a 40007114 <_Objects_Extend_information+0x1fc> 40007150: c2 06 00 00 ld [ %i0 ], %g1 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 40007154: c2 16 20 2c lduh [ %i0 + 0x2c ], %g1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40007158: c8 16 20 14 lduh [ %i0 + 0x14 ], %g4 4000715c: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 information->inactive = 40007160: 82 01 00 01 add %g4, %g1, %g1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40007164: c8 20 80 10 st %g4, [ %g2 + %l0 ] information->inactive = 40007168: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] 4000716c: 81 c7 e0 08 ret 40007170: 81 e8 00 00 restore * 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 ); 40007174: 40 00 08 61 call 400092f8 <_Workspace_Allocate> 40007178: 01 00 00 00 nop if ( !new_object_block ) 4000717c: a4 92 20 00 orcc %o0, 0, %l2 40007180: 32 bf ff 96 bne,a 40006fd8 <_Objects_Extend_information+0xc0> 40007184: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40007188: 81 c7 e0 08 ret 4000718c: 81 e8 00 00 restore /* * 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, 40007190: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 40007194: bb 2f 20 02 sll %i4, 2, %i5 /* * 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, 40007198: 40 00 23 6e call 4000ff50 4000719c: 94 10 00 1d mov %i5, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 400071a0: d2 06 20 30 ld [ %i0 + 0x30 ], %o1 400071a4: 94 10 00 1d mov %i5, %o2 400071a8: 40 00 23 6a call 4000ff50 400071ac: 90 10 00 17 mov %l7, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 400071b0: d4 16 20 10 lduh [ %i0 + 0x10 ], %o2 400071b4: d2 06 20 1c ld [ %i0 + 0x1c ], %o1 400071b8: 94 04 c0 0a add %l3, %o2, %o2 400071bc: 90 10 00 14 mov %l4, %o0 400071c0: 40 00 23 64 call 4000ff50 400071c4: 95 2a a0 02 sll %o2, 2, %o2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 400071c8: 10 bf ff a1 b 4000704c <_Objects_Extend_information+0x134> 400071cc: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 400071d0: ea 16 20 10 lduh [ %i0 + 0x10 ], %l5 400071d4: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0 400071d8: ab 2d 60 10 sll %l5, 0x10, %l5 400071dc: a2 10 00 13 mov %l3, %l1 400071e0: a0 10 20 00 clr %l0 400071e4: 10 bf ff 6c b 40006f94 <_Objects_Extend_information+0x7c> 400071e8: b8 10 20 00 clr %i4 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) 400071ec: a2 10 00 13 mov %l3, %l1 <== NOT EXECUTED 400071f0: 10 bf ff 69 b 40006f94 <_Objects_Extend_information+0x7c> <== NOT EXECUTED 400071f4: a0 10 20 00 clr %l0 <== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 400071f8: 40 00 08 49 call 4000931c <_Workspace_Free> 400071fc: 90 10 00 12 mov %l2, %o0 return; 40007200: 81 c7 e0 08 ret 40007204: 81 e8 00 00 restore 40007620 <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { 40007620: 9d e3 bf a0 save %sp, -96, %sp /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 40007624: e0 16 20 0a lduh [ %i0 + 0xa ], %l0 block_count = (information->maximum - index_base) / 40007628: e2 16 20 14 lduh [ %i0 + 0x14 ], %l1 4000762c: d0 16 20 10 lduh [ %i0 + 0x10 ], %o0 40007630: 92 10 00 11 mov %l1, %o1 40007634: 40 00 45 9d call 40018ca8 <.udiv> 40007638: 90 22 00 10 sub %o0, %l0, %o0 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 4000763c: 80 a2 20 00 cmp %o0, 0 40007640: 02 80 00 12 be 40007688 <_Objects_Shrink_information+0x68> 40007644: a4 10 20 04 mov 4, %l2 if ( information->inactive_per_block[ block ] == 40007648: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 4000764c: c4 00 c0 00 ld [ %g3 ], %g2 40007650: 80 a4 40 02 cmp %l1, %g2 40007654: 12 80 00 09 bne 40007678 <_Objects_Shrink_information+0x58> 40007658: 82 10 20 00 clr %g1 4000765c: 10 80 00 0d b 40007690 <_Objects_Shrink_information+0x70> <== NOT EXECUTED 40007660: a4 10 20 00 clr %l2 <== NOT EXECUTED information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 40007664: a0 04 00 11 add %l0, %l1, %l0 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 ] == 40007668: 80 a4 40 02 cmp %l1, %g2 4000766c: 02 80 00 09 be 40007690 <_Objects_Shrink_information+0x70> 40007670: 84 04 a0 04 add %l2, 4, %g2 40007674: a4 10 00 02 mov %g2, %l2 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 40007678: 82 00 60 01 inc %g1 4000767c: 80 a2 00 01 cmp %o0, %g1 40007680: 38 bf ff f9 bgu,a 40007664 <_Objects_Shrink_information+0x44> 40007684: c4 00 c0 12 ld [ %g3 + %l2 ], %g2 40007688: 81 c7 e0 08 ret 4000768c: 81 e8 00 00 restore information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 40007690: 10 80 00 06 b 400076a8 <_Objects_Shrink_information+0x88> 40007694: d0 06 20 20 ld [ %i0 + 0x20 ], %o0 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 40007698: 80 a4 60 00 cmp %l1, 0 4000769c: 22 80 00 12 be,a 400076e4 <_Objects_Shrink_information+0xc4> 400076a0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 400076a4: 90 10 00 11 mov %l1, %o0 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; do { index = _Objects_Get_index( the_object->id ); 400076a8: c2 12 20 0a lduh [ %o0 + 0xa ], %g1 /* * 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) && 400076ac: 80 a0 40 10 cmp %g1, %l0 400076b0: 0a bf ff fa bcs 40007698 <_Objects_Shrink_information+0x78> 400076b4: e2 02 00 00 ld [ %o0 ], %l1 (index < (index_base + information->allocation_size))) { 400076b8: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2 400076bc: 84 04 00 02 add %l0, %g2, %g2 400076c0: 80 a0 40 02 cmp %g1, %g2 400076c4: 1a bf ff f6 bcc 4000769c <_Objects_Shrink_information+0x7c> 400076c8: 80 a4 60 00 cmp %l1, 0 _Chain_Extract( &extract_me->Node ); 400076cc: 40 00 12 7b call 4000c0b8 <_Chain_Extract> 400076d0: 01 00 00 00 nop } } while ( the_object ); 400076d4: 80 a4 60 00 cmp %l1, 0 400076d8: 12 bf ff f4 bne 400076a8 <_Objects_Shrink_information+0x88> 400076dc: 90 10 00 11 mov %l1, %o0 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 400076e0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 <== NOT EXECUTED 400076e4: 40 00 07 0e call 4000931c <_Workspace_Free> 400076e8: d0 00 40 12 ld [ %g1 + %l2 ], %o0 information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 400076ec: c6 16 20 2c lduh [ %i0 + 0x2c ], %g3 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 400076f0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 information->inactive_per_block[ block ] = 0; 400076f4: c8 06 20 30 ld [ %i0 + 0x30 ], %g4 information->inactive -= information->allocation_size; 400076f8: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2 * 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; 400076fc: c0 21 00 12 clr [ %g4 + %l2 ] information->inactive -= information->allocation_size; 40007700: 84 20 c0 02 sub %g3, %g2, %g2 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 40007704: c0 20 40 12 clr [ %g1 + %l2 ] information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 40007708: c4 36 20 2c sth %g2, [ %i0 + 0x2c ] return; 4000770c: 81 c7 e0 08 ret 40007710: 81 e8 00 00 restore 4000b8dc <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000b8dc: c4 02 21 60 ld [ %o0 + 0x160 ], %g2 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000b8e0: c6 00 a0 88 ld [ %g2 + 0x88 ], %g3 4000b8e4: 05 10 00 74 sethi %hi(0x4001d000), %g2 4000b8e8: d2 08 a0 14 ldub [ %g2 + 0x14 ], %o1 ! 4001d014 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000b8ec: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000b8f0: 92 22 40 03 sub %o1, %g3, %o1 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4000b8f4: 86 10 3f ff mov -1, %g3 new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4000b8f8: d2 22 20 18 st %o1, [ %o0 + 0x18 ] */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000b8fc: 80 a0 a0 00 cmp %g2, 0 4000b900: 12 80 00 06 bne 4000b918 <_POSIX_Threads_Sporadic_budget_callout+0x3c> 4000b904: c6 22 20 78 st %g3, [ %o0 + 0x78 ] /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4000b908: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000b90c: 80 a0 40 09 cmp %g1, %o1 4000b910: 0a 80 00 04 bcs 4000b920 <_POSIX_Threads_Sporadic_budget_callout+0x44> 4000b914: 94 10 20 01 mov 1, %o2 4000b918: 81 c3 e0 08 retl <== NOT EXECUTED 4000b91c: 01 00 00 00 nop <== NOT EXECUTED _Thread_Change_priority( the_thread, new_priority, true ); 4000b920: 82 13 c0 00 mov %o7, %g1 4000b924: 7f ff ef 95 call 40007778 <_Thread_Change_priority> 4000b928: 9e 10 40 00 mov %g1, %o7 4000b92c: 01 00 00 00 nop 40005c90 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 40005c90: 9d e3 bf a0 save %sp, -96, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40005c94: c4 06 60 68 ld [ %i1 + 0x68 ], %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40005c98: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40005c9c: 84 00 a0 01 inc %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40005ca0: 80 a0 60 00 cmp %g1, 0 40005ca4: 12 80 00 0e bne 40005cdc <_POSIX_Timer_TSR+0x4c> 40005ca8: c4 26 60 68 st %g2, [ %i1 + 0x68 ] ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 40005cac: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40005cb0: 80 a0 60 00 cmp %g1, 0 40005cb4: 32 80 00 0b bne,a 40005ce0 <_POSIX_Timer_TSR+0x50> 40005cb8: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 40005cbc: 82 10 20 04 mov 4, %g1 <== NOT EXECUTED 40005cc0: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] <== NOT EXECUTED /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 40005cc4: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40005cc8: 40 00 19 98 call 4000c328 40005ccc: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 40005cd0: c0 26 60 68 clr [ %i1 + 0x68 ] 40005cd4: 81 c7 e0 08 ret 40005cd8: 81 e8 00 00 restore ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40005cdc: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40005ce0: d4 06 60 08 ld [ %i1 + 8 ], %o2 40005ce4: 90 06 60 10 add %i1, 0x10, %o0 40005ce8: 17 10 00 17 sethi %hi(0x40005c00), %o3 40005cec: 98 10 00 19 mov %i1, %o4 40005cf0: 40 00 1a bc call 4000c7e0 <_POSIX_Timer_Insert_helper> 40005cf4: 96 12 e0 90 or %o3, 0x90, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40005cf8: 80 8a 20 ff btst 0xff, %o0 40005cfc: 02 bf ff f6 be 40005cd4 <_POSIX_Timer_TSR+0x44> 40005d00: 01 00 00 00 nop return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 40005d04: 40 00 05 da call 4000746c <_TOD_Get> 40005d08: 90 06 60 6c add %i1, 0x6c, %o0 /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40005d0c: 82 10 20 03 mov 3, %g1 /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40005d10: 10 bf ff ed b 40005cc4 <_POSIX_Timer_TSR+0x34> 40005d14: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] 4000f284 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 4000f284: 9d e3 bf a0 save %sp, -96, %sp clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4000f288: 7f ff ca 95 call 40001cdc 4000f28c: 01 00 00 00 nop if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000f290: 85 2e 20 04 sll %i0, 4, %g2 4000f294: 83 2e 20 02 sll %i0, 2, %g1 4000f298: 82 20 80 01 sub %g2, %g1, %g1 4000f29c: 05 10 00 77 sethi %hi(0x4001dc00), %g2 4000f2a0: 84 10 a3 04 or %g2, 0x304, %g2 ! 4001df04 <_POSIX_signals_Vectors> 4000f2a4: c4 00 80 01 ld [ %g2 + %g1 ], %g2 4000f2a8: 80 a0 a0 02 cmp %g2, 2 4000f2ac: 02 80 00 11 be 4000f2f0 <_POSIX_signals_Clear_process_signals+0x6c> 4000f2b0: 05 10 00 78 sethi %hi(0x4001e000), %g2 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000f2b4: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000f2b8: c6 00 a0 d0 ld [ %g2 + 0xd0 ], %g3 ! 4001e0d0 <_POSIX_signals_Pending> 4000f2bc: b0 06 3f ff add %i0, -1, %i0 4000f2c0: 82 10 20 01 mov 1, %g1 4000f2c4: 83 28 40 18 sll %g1, %i0, %g1 4000f2c8: 82 28 c0 01 andn %g3, %g1, %g1 if ( !_POSIX_signals_Pending ) 4000f2cc: 80 a0 60 00 cmp %g1, 0 4000f2d0: 12 80 00 06 bne 4000f2e8 <_POSIX_signals_Clear_process_signals+0x64> 4000f2d4: c2 20 a0 d0 st %g1, [ %g2 + 0xd0 ] _Thread_Do_post_task_switch_extension--; 4000f2d8: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000f2dc: c4 00 62 10 ld [ %g1 + 0x210 ], %g2 ! 4001da10 <_Thread_Do_post_task_switch_extension> 4000f2e0: 84 00 bf ff add %g2, -1, %g2 4000f2e4: c4 20 62 10 st %g2, [ %g1 + 0x210 ] } _ISR_Enable( level ); 4000f2e8: 7f ff ca 81 call 40001cec 4000f2ec: 91 e8 00 08 restore %g0, %o0, %o0 ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000f2f0: 84 10 a0 d4 or %g2, 0xd4, %g2 4000f2f4: c6 00 40 02 ld [ %g1 + %g2 ], %g3 4000f2f8: 82 00 40 02 add %g1, %g2, %g1 4000f2fc: 82 00 60 04 add %g1, 4, %g1 4000f300: 80 a0 c0 01 cmp %g3, %g1 4000f304: 02 bf ff ed be 4000f2b8 <_POSIX_signals_Clear_process_signals+0x34> 4000f308: 05 10 00 78 sethi %hi(0x4001e000), %g2 if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; } _ISR_Enable( level ); 4000f30c: 7f ff ca 78 call 40001cec <== NOT EXECUTED 4000f310: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED 4000f314: 01 00 00 00 nop 4000f358 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4000f358: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4000f35c: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000f360: 05 04 00 20 sethi %hi(0x10008000), %g2 4000f364: 88 06 7f ff add %i1, -1, %g4 4000f368: 9a 08 40 02 and %g1, %g2, %o5 4000f36c: 86 10 20 01 mov 1, %g3 4000f370: 80 a3 40 02 cmp %o5, %g2 4000f374: 89 28 c0 04 sll %g3, %g4, %g4 4000f378: 02 80 00 25 be 4000f40c <_POSIX_signals_Unblock_thread+0xb4> 4000f37c: c4 06 21 60 ld [ %i0 + 0x160 ], %g2 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4000f380: c4 00 a0 cc ld [ %g2 + 0xcc ], %g2 4000f384: 80 a9 00 02 andncc %g4, %g2, %g0 4000f388: 02 80 00 1f be 4000f404 <_POSIX_signals_Unblock_thread+0xac> 4000f38c: 05 04 00 00 sethi %hi(0x10000000), %g2 * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4000f390: 80 88 40 02 btst %g1, %g2 4000f394: 02 80 00 11 be 4000f3d8 <_POSIX_signals_Unblock_thread+0x80> 4000f398: c6 2e 20 74 stb %g3, [ %i0 + 0x74 ] the_thread->Wait.return_code = EINTR; 4000f39c: 84 10 20 04 mov 4, %g2 #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 4000f3a0: 80 88 60 08 btst 8, %g1 4000f3a4: 02 80 00 18 be 4000f404 <_POSIX_signals_Unblock_thread+0xac> 4000f3a8: c4 26 20 34 st %g2, [ %i0 + 0x34 ] if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4000f3ac: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000f3b0: 80 a0 60 02 cmp %g1, 2 4000f3b4: 02 80 00 36 be 4000f48c <_POSIX_signals_Unblock_thread+0x134> 4000f3b8: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4000f3bc: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 4000f3c0: 13 04 00 ff sethi %hi(0x1003fc00), %o1 4000f3c4: b0 10 20 00 clr %i0 4000f3c8: 7f ff e1 70 call 40007988 <_Thread_Clear_state> 4000f3cc: 92 12 63 f8 or %o1, 0x3f8, %o1 4000f3d0: 81 c7 e0 08 ret 4000f3d4: 81 e8 00 00 restore (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4000f3d8: 80 a0 60 00 cmp %g1, 0 4000f3dc: 12 80 00 0a bne 4000f404 <_POSIX_signals_Unblock_thread+0xac> 4000f3e0: 03 10 00 76 sethi %hi(0x4001d800), %g1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4000f3e4: c2 00 62 08 ld [ %g1 + 0x208 ], %g1 ! 4001da08 <_ISR_Nest_level> 4000f3e8: 80 a0 60 00 cmp %g1, 0 4000f3ec: 02 80 00 06 be 4000f404 <_POSIX_signals_Unblock_thread+0xac> 4000f3f0: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000f3f4: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> 4000f3f8: 80 a6 00 01 cmp %i0, %g1 4000f3fc: 02 80 00 21 be 4000f480 <_POSIX_signals_Unblock_thread+0x128> 4000f400: 03 10 00 76 sethi %hi(0x4001d800), %g1 _ISR_Signals_to_thread_executing = true; } } return false; } 4000f404: 81 c7 e0 08 ret 4000f408: 91 e8 20 00 restore %g0, 0, %o0 * 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) ) { 4000f40c: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000f410: 80 89 00 01 btst %g4, %g1 4000f414: 22 80 00 12 be,a 4000f45c <_POSIX_signals_Unblock_thread+0x104> 4000f418: c2 00 a0 cc ld [ %g2 + 0xcc ], %g1 the_thread->Wait.return_code = EINTR; 4000f41c: 82 10 20 04 mov 4, %g1 4000f420: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4000f424: 80 a6 a0 00 cmp %i2, 0 4000f428: 02 80 00 11 be 4000f46c <_POSIX_signals_Unblock_thread+0x114> 4000f42c: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 4000f430: c4 06 80 00 ld [ %i2 ], %g2 4000f434: c4 20 40 00 st %g2, [ %g1 ] 4000f438: c4 06 a0 04 ld [ %i2 + 4 ], %g2 4000f43c: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000f440: c4 06 a0 08 ld [ %i2 + 8 ], %g2 4000f444: c4 20 60 08 st %g2, [ %g1 + 8 ] } _Thread_queue_Extract_with_proxy( the_thread ); 4000f448: 90 10 00 18 mov %i0, %o0 4000f44c: 7f ff e4 43 call 40008558 <_Thread_queue_Extract_with_proxy> 4000f450: b0 10 20 01 mov 1, %i0 return true; 4000f454: 81 c7 e0 08 ret 4000f458: 81 e8 00 00 restore * 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) ) { 4000f45c: 80 a9 00 01 andncc %g4, %g1, %g0 4000f460: 12 bf ff f0 bne 4000f420 <_POSIX_signals_Unblock_thread+0xc8> 4000f464: 82 10 20 04 mov 4, %g1 4000f468: 30 bf ff e7 b,a 4000f404 <_POSIX_signals_Unblock_thread+0xac> the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 4000f46c: 84 10 20 01 mov 1, %g2 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4000f470: f2 20 40 00 st %i1, [ %g1 ] the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 4000f474: c0 20 60 08 clr [ %g1 + 8 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 4000f478: 10 bf ff f4 b 4000f448 <_POSIX_signals_Unblock_thread+0xf0> 4000f47c: c4 20 60 04 st %g2, [ %g1 + 4 ] (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 ) ) _ISR_Signals_to_thread_executing = true; 4000f480: c6 28 62 c8 stb %g3, [ %g1 + 0x2c8 ] 4000f484: 81 c7 e0 08 ret 4000f488: 91 e8 20 00 restore %g0, 0, %o0 _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 4000f48c: 7f ff e7 2c call 4000913c <_Watchdog_Remove> 4000f490: 90 06 20 48 add %i0, 0x48, %o0 4000f494: 10 bf ff cb b 4000f3c0 <_POSIX_signals_Unblock_thread+0x68> 4000f498: 90 10 00 18 mov %i0, %o0 40007778 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 40007778: 9d e3 bf a0 save %sp, -96, %sp */ /* * Save original state */ original_state = the_thread->current_state; 4000777c: e2 06 20 10 ld [ %i0 + 0x10 ], %l1 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 40007780: 40 00 04 4d call 400088b4 <_Thread_Set_transient> 40007784: 90 10 00 18 mov %i0, %o0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 40007788: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000778c: 80 a0 40 19 cmp %g1, %i1 40007790: 02 80 00 05 be 400077a4 <_Thread_Change_priority+0x2c> 40007794: a0 10 00 18 mov %i0, %l0 _Thread_Set_priority( the_thread, new_priority ); 40007798: 92 10 00 19 mov %i1, %o1 4000779c: 40 00 03 ca call 400086c4 <_Thread_Set_priority> 400077a0: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 400077a4: 7f ff e9 4e call 40001cdc 400077a8: 01 00 00 00 nop 400077ac: b0 10 00 08 mov %o0, %i0 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 400077b0: e4 04 20 10 ld [ %l0 + 0x10 ], %l2 if ( state != STATES_TRANSIENT ) { 400077b4: 80 a4 a0 04 cmp %l2, 4 400077b8: 02 80 00 18 be 40007818 <_Thread_Change_priority+0xa0> 400077bc: 80 8c 60 04 btst 4, %l1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 400077c0: 02 80 00 0b be 400077ec <_Thread_Change_priority+0x74> 400077c4: 82 0c bf fb and %l2, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 400077c8: 7f ff e9 49 call 40001cec <== NOT EXECUTED 400077cc: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 400077d0: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 400077d4: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 400077d8: 80 8c 80 01 btst %l2, %g1 <== NOT EXECUTED 400077dc: 32 80 00 0d bne,a 40007810 <_Thread_Change_priority+0x98> <== NOT EXECUTED 400077e0: f0 04 20 44 ld [ %l0 + 0x44 ], %i0 <== NOT EXECUTED 400077e4: 81 c7 e0 08 ret 400077e8: 81 e8 00 00 restore */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 400077ec: c2 24 20 10 st %g1, [ %l0 + 0x10 ] _ISR_Enable( level ); 400077f0: 7f ff e9 3f call 40001cec 400077f4: 90 10 00 18 mov %i0, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 400077f8: 03 00 00 ef sethi %hi(0x3bc00), %g1 400077fc: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40007800: 80 8c 80 01 btst %l2, %g1 40007804: 02 bf ff f8 be 400077e4 <_Thread_Change_priority+0x6c> 40007808: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000780c: f0 04 20 44 ld [ %l0 + 0x44 ], %i0 40007810: 40 00 03 7d call 40008604 <_Thread_queue_Requeue> 40007814: 93 e8 00 10 restore %g0, %l0, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 40007818: 12 80 00 14 bne 40007868 <_Thread_Change_priority+0xf0> 4000781c: 23 10 00 76 sethi %hi(0x4001d800), %l1 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 40007820: c2 04 20 90 ld [ %l0 + 0x90 ], %g1 40007824: c4 14 20 96 lduh [ %l0 + 0x96 ], %g2 40007828: c6 10 40 00 lduh [ %g1 ], %g3 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4000782c: c0 24 20 10 clr [ %l0 + 0x10 ] 40007830: 84 10 c0 02 or %g3, %g2, %g2 40007834: c4 30 40 00 sth %g2, [ %g1 ] _Priority_Major_bit_map |= the_priority_map->ready_major; 40007838: c4 14 62 20 lduh [ %l1 + 0x220 ], %g2 4000783c: c2 14 20 94 lduh [ %l0 + 0x94 ], %g1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 40007840: 80 8e a0 ff btst 0xff, %i2 40007844: 82 10 80 01 or %g2, %g1, %g1 40007848: c2 34 62 20 sth %g1, [ %l1 + 0x220 ] 4000784c: 02 80 00 48 be 4000796c <_Thread_Change_priority+0x1f4> 40007850: c2 04 20 8c ld [ %l0 + 0x8c ], %g1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40007854: c4 00 40 00 ld [ %g1 ], %g2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 40007858: c2 24 20 04 st %g1, [ %l0 + 4 ] before_node = after_node->next; after_node->next = the_node; 4000785c: e0 20 40 00 st %l0, [ %g1 ] the_node->next = before_node; before_node->previous = the_node; 40007860: e0 20 a0 04 st %l0, [ %g2 + 4 ] Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 40007864: c4 24 00 00 st %g2, [ %l0 ] _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 40007868: 7f ff e9 21 call 40001cec 4000786c: 90 10 00 18 mov %i0, %o0 40007870: 7f ff e9 1b call 40001cdc 40007874: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 40007878: c2 14 62 20 lduh [ %l1 + 0x220 ], %g1 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 4000787c: 05 10 00 76 sethi %hi(0x4001d800), %g2 40007880: 83 28 60 10 sll %g1, 0x10, %g1 40007884: da 00 a0 c4 ld [ %g2 + 0xc4 ], %o5 40007888: 85 30 60 10 srl %g1, 0x10, %g2 4000788c: 80 a0 a0 ff cmp %g2, 0xff 40007890: 08 80 00 27 bleu 4000792c <_Thread_Change_priority+0x1b4> 40007894: 07 10 00 70 sethi %hi(0x4001c000), %g3 40007898: 83 30 60 18 srl %g1, 0x18, %g1 4000789c: 86 10 e1 08 or %g3, 0x108, %g3 400078a0: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 400078a4: 09 10 00 76 sethi %hi(0x4001d800), %g4 400078a8: 85 28 a0 10 sll %g2, 0x10, %g2 400078ac: 88 11 22 a0 or %g4, 0x2a0, %g4 400078b0: 83 30 a0 0f srl %g2, 0xf, %g1 400078b4: c2 11 00 01 lduh [ %g4 + %g1 ], %g1 400078b8: 83 28 60 10 sll %g1, 0x10, %g1 400078bc: 89 30 60 10 srl %g1, 0x10, %g4 400078c0: 80 a1 20 ff cmp %g4, 0xff 400078c4: 18 80 00 28 bgu 40007964 <_Thread_Change_priority+0x1ec> 400078c8: 83 30 60 18 srl %g1, 0x18, %g1 400078cc: c2 08 c0 04 ldub [ %g3 + %g4 ], %g1 400078d0: 82 00 60 08 add %g1, 8, %g1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 400078d4: 85 30 a0 0c srl %g2, 0xc, %g2 400078d8: 83 28 60 10 sll %g1, 0x10, %g1 400078dc: 83 30 60 10 srl %g1, 0x10, %g1 400078e0: 82 00 40 02 add %g1, %g2, %g1 400078e4: 85 28 60 04 sll %g1, 4, %g2 400078e8: 83 28 60 02 sll %g1, 2, %g1 400078ec: 82 20 80 01 sub %g2, %g1, %g1 400078f0: c2 03 40 01 ld [ %o5 + %g1 ], %g1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 400078f4: 05 10 00 76 sethi %hi(0x4001d800), %g2 400078f8: c4 00 a2 2c ld [ %g2 + 0x22c ], %g2 ! 4001da2c <_Thread_Executing> * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 400078fc: 07 10 00 76 sethi %hi(0x4001d800), %g3 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 40007900: 80 a0 40 02 cmp %g1, %g2 40007904: 02 80 00 08 be 40007924 <_Thread_Change_priority+0x1ac> 40007908: c2 20 e1 fc st %g1, [ %g3 + 0x1fc ] _Thread_Executing->is_preemptible ) 4000790c: c2 08 a0 75 ldub [ %g2 + 0x75 ], %g1 40007910: 80 a0 60 00 cmp %g1, 0 40007914: 02 80 00 04 be 40007924 <_Thread_Change_priority+0x1ac> 40007918: 84 10 20 01 mov 1, %g2 _Context_Switch_necessary = true; 4000791c: 03 10 00 76 sethi %hi(0x4001d800), %g1 40007920: c4 28 62 3c stb %g2, [ %g1 + 0x23c ] ! 4001da3c <_Context_Switch_necessary> _ISR_Enable( level ); 40007924: 7f ff e8 f2 call 40001cec 40007928: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 4000792c: 86 10 e1 08 or %g3, 0x108, %g3 40007930: c4 08 c0 02 ldub [ %g3 + %g2 ], %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 40007934: 09 10 00 76 sethi %hi(0x4001d800), %g4 RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 40007938: 84 00 a0 08 add %g2, 8, %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4000793c: 88 11 22 a0 or %g4, 0x2a0, %g4 40007940: 85 28 a0 10 sll %g2, 0x10, %g2 40007944: 83 30 a0 0f srl %g2, 0xf, %g1 40007948: c2 11 00 01 lduh [ %g4 + %g1 ], %g1 4000794c: 83 28 60 10 sll %g1, 0x10, %g1 40007950: 89 30 60 10 srl %g1, 0x10, %g4 40007954: 80 a1 20 ff cmp %g4, 0xff 40007958: 28 bf ff de bleu,a 400078d0 <_Thread_Change_priority+0x158> 4000795c: c2 08 c0 04 ldub [ %g3 + %g4 ], %g1 40007960: 83 30 60 18 srl %g1, 0x18, %g1 40007964: 10 bf ff dc b 400078d4 <_Thread_Change_priority+0x15c> 40007968: c2 08 c0 01 ldub [ %g3 + %g1 ], %g1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4000796c: 84 00 60 04 add %g1, 4, %g2 40007970: c4 24 00 00 st %g2, [ %l0 ] old_last_node = the_chain->last; 40007974: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_chain->last = the_node; 40007978: e0 20 60 08 st %l0, [ %g1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 4000797c: c4 24 20 04 st %g2, [ %l0 + 4 ] Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 40007980: 10 bf ff ba b 40007868 <_Thread_Change_priority+0xf0> 40007984: e0 20 80 00 st %l0, [ %g2 ] 40008b28 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 40008b28: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 40008b2c: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008b30: e0 00 62 2c ld [ %g1 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> ready = executing->ready; _ISR_Disable( level ); 40008b34: 7f ff e4 6a call 40001cdc 40008b38: e2 04 20 8c ld [ %l0 + 0x8c ], %l1 40008b3c: b0 10 00 08 mov %o0, %i0 if ( !_Chain_Has_only_one_node( ready ) ) { 40008b40: c4 04 40 00 ld [ %l1 ], %g2 40008b44: c2 04 60 08 ld [ %l1 + 8 ], %g1 40008b48: 80 a0 80 01 cmp %g2, %g1 40008b4c: 02 80 00 19 be 40008bb0 <_Thread_Yield_processor+0x88> 40008b50: 86 04 60 04 add %l1, 4, %g3 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 40008b54: c2 04 00 00 ld [ %l0 ], %g1 previous = the_node->previous; 40008b58: c4 04 20 04 ld [ %l0 + 4 ], %g2 next->previous = previous; previous->next = next; 40008b5c: c2 20 80 00 st %g1, [ %g2 ] Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 40008b60: c6 24 00 00 st %g3, [ %l0 ] Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 40008b64: c4 20 60 04 st %g2, [ %g1 + 4 ] ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 40008b68: c2 04 60 08 ld [ %l1 + 8 ], %g1 the_chain->last = the_node; 40008b6c: e0 24 60 08 st %l0, [ %l1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 40008b70: c2 24 20 04 st %g1, [ %l0 + 4 ] Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 40008b74: e0 20 40 00 st %l0, [ %g1 ] _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 40008b78: 7f ff e4 5d call 40001cec 40008b7c: 01 00 00 00 nop 40008b80: 7f ff e4 57 call 40001cdc 40008b84: 01 00 00 00 nop if ( _Thread_Is_heir( executing ) ) 40008b88: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008b8c: c4 00 61 fc ld [ %g1 + 0x1fc ], %g2 ! 4001d9fc <_Thread_Heir> 40008b90: 80 a4 00 02 cmp %l0, %g2 40008b94: 22 80 00 0e be,a 40008bcc <_Thread_Yield_processor+0xa4> 40008b98: c4 04 40 00 ld [ %l1 ], %g2 _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 40008b9c: 84 10 20 01 mov 1, %g2 40008ba0: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008ba4: c4 28 62 3c stb %g2, [ %g1 + 0x23c ] ! 4001da3c <_Context_Switch_necessary> _ISR_Enable( level ); 40008ba8: 7f ff e4 51 call 40001cec 40008bac: 81 e8 00 00 restore if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 40008bb0: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008bb4: c2 00 61 fc ld [ %g1 + 0x1fc ], %g1 ! 4001d9fc <_Thread_Heir> 40008bb8: 80 a4 00 01 cmp %l0, %g1 40008bbc: 32 bf ff f9 bne,a 40008ba0 <_Thread_Yield_processor+0x78> 40008bc0: 84 10 20 01 mov 1, %g2 <== NOT EXECUTED _Context_Switch_necessary = true; _ISR_Enable( level ); 40008bc4: 7f ff e4 4a call 40001cec 40008bc8: 81 e8 00 00 restore _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 40008bcc: 10 bf ff f4 b 40008b9c <_Thread_Yield_processor+0x74> 40008bd0: c4 20 61 fc st %g2, [ %g1 + 0x1fc ] 40008348 <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 40008348: 9d e3 bf a0 save %sp, -96, %sp Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 4000834c: e0 06 60 14 ld [ %i1 + 0x14 ], %l0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40008350: 82 06 60 3c add %i1, 0x3c, %g1 the_chain->permanent_null = NULL; 40008354: c0 26 60 3c clr [ %i1 + 0x3c ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40008358: c2 26 60 38 st %g1, [ %i1 + 0x38 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4000835c: 82 06 60 38 add %i1, 0x38, %g1 40008360: c2 26 60 40 st %g1, [ %i1 + 0x40 ] 40008364: 2d 10 00 74 sethi %hi(0x4001d000), %l6 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008368: 83 34 20 06 srl %l0, 6, %g1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 4000836c: 80 8c 20 20 btst 0x20, %l0 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008370: ab 28 60 04 sll %g1, 4, %l5 40008374: ac 15 a0 14 or %l6, 0x14, %l6 40008378: 83 28 60 02 sll %g1, 2, %g1 block_state = the_thread_queue->state; 4000837c: e8 06 20 38 ld [ %i0 + 0x38 ], %l4 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008380: aa 25 40 01 sub %l5, %g1, %l5 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40008384: 12 80 00 24 bne 40008414 <_Thread_queue_Enqueue_priority+0xcc> 40008388: aa 06 00 15 add %i0, %l5, %l5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4000838c: ac 05 60 04 add %l5, 4, %l6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 40008390: 7f ff e6 53 call 40001cdc 40008394: 01 00 00 00 nop 40008398: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->first; 4000839c: c2 05 40 00 ld [ %l5 ], %g1 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 400083a0: 80 a0 40 16 cmp %g1, %l6 400083a4: 02 80 00 3a be 4000848c <_Thread_queue_Enqueue_priority+0x144> 400083a8: a2 10 00 01 mov %g1, %l1 search_priority = search_thread->current_priority; 400083ac: e6 00 60 14 ld [ %g1 + 0x14 ], %l3 if ( priority <= search_priority ) 400083b0: 80 a4 00 13 cmp %l0, %l3 400083b4: 18 80 00 0b bgu 400083e0 <_Thread_queue_Enqueue_priority+0x98> 400083b8: 01 00 00 00 nop } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 400083bc: 10 80 00 36 b 40008494 <_Thread_queue_Enqueue_priority+0x14c> 400083c0: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 400083c4: 80 a4 40 16 cmp %l1, %l6 400083c8: 02 80 00 32 be 40008490 <_Thread_queue_Enqueue_priority+0x148> 400083cc: 82 10 00 11 mov %l1, %g1 search_priority = search_thread->current_priority; 400083d0: e6 04 60 14 ld [ %l1 + 0x14 ], %l3 if ( priority <= search_priority ) 400083d4: 80 a4 00 13 cmp %l0, %l3 400083d8: 28 80 00 2f bleu,a 40008494 <_Thread_queue_Enqueue_priority+0x14c> 400083dc: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 400083e0: 7f ff e6 43 call 40001cec 400083e4: 90 10 00 12 mov %l2, %o0 400083e8: 7f ff e6 3d call 40001cdc 400083ec: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 400083f0: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 400083f4: 80 8d 00 01 btst %l4, %g1 400083f8: 32 bf ff f3 bne,a 400083c4 <_Thread_queue_Enqueue_priority+0x7c> 400083fc: e2 04 40 00 ld [ %l1 ], %l1 _ISR_Enable( level ); 40008400: 7f ff e6 3b call 40001cec <== NOT EXECUTED 40008404: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED goto restart_forward_search; 40008408: 30 bf ff e2 b,a 40008390 <_Thread_queue_Enqueue_priority+0x48> <== NOT EXECUTED if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 4000840c: 7f ff e6 38 call 40001cec 40008410: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 40008414: 7f ff e6 32 call 40001cdc 40008418: e6 0d 80 00 ldub [ %l6 ], %l3 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4000841c: a6 04 e0 01 inc %l3 _ISR_Disable( level ); 40008420: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->last; 40008424: c2 05 60 08 ld [ %l5 + 8 ], %g1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 40008428: 80 a0 40 15 cmp %g1, %l5 4000842c: 02 80 00 20 be 400084ac <_Thread_queue_Enqueue_priority+0x164> 40008430: a2 10 00 01 mov %g1, %l1 search_priority = search_thread->current_priority; 40008434: e6 00 60 14 ld [ %g1 + 0x14 ], %l3 if ( priority >= search_priority ) 40008438: 80 a4 00 13 cmp %l0, %l3 4000843c: 0a 80 00 0b bcs 40008468 <_Thread_queue_Enqueue_priority+0x120> 40008440: 01 00 00 00 nop } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 40008444: 10 80 00 1b b 400084b0 <_Thread_queue_Enqueue_priority+0x168> 40008448: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4000844c: 80 a4 40 15 cmp %l1, %l5 40008450: 02 80 00 17 be 400084ac <_Thread_queue_Enqueue_priority+0x164> 40008454: 82 10 00 11 mov %l1, %g1 search_priority = search_thread->current_priority; 40008458: e6 04 60 14 ld [ %l1 + 0x14 ], %l3 if ( priority >= search_priority ) 4000845c: 80 a4 00 13 cmp %l0, %l3 40008460: 3a 80 00 14 bcc,a 400084b0 <_Thread_queue_Enqueue_priority+0x168> 40008464: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 40008468: 7f ff e6 21 call 40001cec 4000846c: 90 10 00 12 mov %l2, %o0 40008470: 7f ff e6 1b call 40001cdc 40008474: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 40008478: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 4000847c: 80 8d 00 01 btst %l4, %g1 40008480: 32 bf ff f3 bne,a 4000844c <_Thread_queue_Enqueue_priority+0x104> 40008484: e2 04 60 04 ld [ %l1 + 4 ], %l1 40008488: 30 bf ff e1 b,a 4000840c <_Thread_queue_Enqueue_priority+0xc4> restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4000848c: a6 10 3f ff mov -1, %l3 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 40008490: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 40008494: 80 a0 a0 01 cmp %g2, 1 40008498: 02 80 00 17 be 400084f4 <_Thread_queue_Enqueue_priority+0x1ac> 4000849c: 80 a4 00 13 cmp %l0, %l3 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 400084a0: e4 26 80 00 st %l2, [ %i2 ] return the_thread_queue->sync_state; } 400084a4: 81 c7 e0 08 ret 400084a8: 91 e8 00 02 restore %g0, %g2, %o0 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 400084ac: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 400084b0: 80 a0 a0 01 cmp %g2, 1 400084b4: 32 bf ff fc bne,a 400084a4 <_Thread_queue_Enqueue_priority+0x15c> 400084b8: e4 26 80 00 st %l2, [ %i2 ] THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 400084bc: 80 a4 00 13 cmp %l0, %l3 400084c0: 02 80 00 1a be 40008528 <_Thread_queue_Enqueue_priority+0x1e0> 400084c4: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 400084c8: c4 00 40 00 ld [ %g1 ], %g2 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 400084cc: c2 26 60 04 st %g1, [ %i1 + 4 ] search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 400084d0: c4 26 40 00 st %g2, [ %i1 ] the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 400084d4: f0 26 60 44 st %i0, [ %i1 + 0x44 ] next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 400084d8: f2 20 40 00 st %i1, [ %g1 ] next_node->previous = the_node; 400084dc: f2 20 a0 04 st %i1, [ %g2 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 400084e0: b0 10 20 01 mov 1, %i0 400084e4: 7f ff e6 02 call 40001cec 400084e8: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 400084ec: 81 c7 e0 08 ret 400084f0: 81 e8 00 00 restore THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 400084f4: 02 80 00 0d be 40008528 <_Thread_queue_Enqueue_priority+0x1e0> 400084f8: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 400084fc: c4 00 60 04 ld [ %g1 + 4 ], %g2 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40008500: c2 26 40 00 st %g1, [ %i1 ] the_node->previous = previous_node; 40008504: c4 26 60 04 st %g2, [ %i1 + 4 ] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008508: f0 26 60 44 st %i0, [ %i1 + 0x44 ] previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 4000850c: f2 20 80 00 st %i1, [ %g2 ] search_node->previous = the_node; 40008510: f2 20 60 04 st %i1, [ %g1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008514: b0 10 20 01 mov 1, %i0 40008518: 7f ff e5 f5 call 40001cec 4000851c: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40008520: 81 c7 e0 08 ret 40008524: 81 e8 00 00 restore 40008528: a2 04 60 3c add %l1, 0x3c, %l1 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 4000852c: c2 04 60 04 ld [ %l1 + 4 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40008530: e2 26 40 00 st %l1, [ %i1 ] the_node->previous = previous_node; 40008534: c2 26 60 04 st %g1, [ %i1 + 4 ] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008538: f0 26 60 44 st %i0, [ %i1 + 0x44 ] previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 4000853c: f2 20 40 00 st %i1, [ %g1 ] search_node->previous = the_node; 40008540: f2 24 60 04 st %i1, [ %l1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008544: b0 10 20 01 mov 1, %i0 40008548: 7f ff e5 e9 call 40001cec 4000854c: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40008550: 81 c7 e0 08 ret 40008554: 81 e8 00 00 restore 40008604 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 40008604: 9d e3 bf 98 save %sp, -104, %sp /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 40008608: 80 a6 20 00 cmp %i0, 0 4000860c: 02 80 00 13 be 40008658 <_Thread_queue_Requeue+0x54> 40008610: 01 00 00 00 nop /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 40008614: e2 06 20 34 ld [ %i0 + 0x34 ], %l1 40008618: 80 a4 60 01 cmp %l1, 1 4000861c: 02 80 00 04 be 4000862c <_Thread_queue_Requeue+0x28> 40008620: 01 00 00 00 nop 40008624: 81 c7 e0 08 ret <== NOT EXECUTED 40008628: 81 e8 00 00 restore <== NOT EXECUTED Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000862c: 7f ff e5 ac call 40001cdc 40008630: 01 00 00 00 nop 40008634: a0 10 00 08 mov %o0, %l0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 40008638: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 4000863c: 03 00 00 ef sethi %hi(0x3bc00), %g1 40008640: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40008644: 80 88 80 01 btst %g2, %g1 40008648: 12 80 00 06 bne 40008660 <_Thread_queue_Requeue+0x5c> 4000864c: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 40008650: 7f ff e5 a7 call 40001cec 40008654: 90 10 00 10 mov %l0, %o0 40008658: 81 c7 e0 08 ret 4000865c: 81 e8 00 00 restore ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 40008660: 92 10 00 19 mov %i1, %o1 40008664: e2 26 20 30 st %l1, [ %i0 + 0x30 ] 40008668: 40 00 10 cc call 4000c998 <_Thread_queue_Extract_priority_helper> 4000866c: 94 10 20 01 mov 1, %o2 (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 40008670: 90 10 00 18 mov %i0, %o0 40008674: 92 10 00 19 mov %i1, %o1 40008678: 7f ff ff 34 call 40008348 <_Thread_queue_Enqueue_priority> 4000867c: 94 07 bf fc add %fp, -4, %o2 40008680: 30 bf ff f4 b,a 40008650 <_Thread_queue_Requeue+0x4c> 40015acc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40015acc: 9d e3 bf 88 save %sp, -120, %sp 40015ad0: 2d 10 00 f8 sethi %hi(0x4003e000), %l6 40015ad4: ba 07 bf f4 add %fp, -12, %i5 40015ad8: a8 07 bf f8 add %fp, -8, %l4 40015adc: a4 07 bf e8 add %fp, -24, %l2 40015ae0: ae 07 bf ec add %fp, -20, %l7 40015ae4: 2b 10 00 f8 sethi %hi(0x4003e000), %l5 40015ae8: 39 10 00 f7 sethi %hi(0x4003dc00), %i4 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 40015aec: c0 27 bf f8 clr [ %fp + -8 ] 40015af0: c0 27 bf ec clr [ %fp + -20 ] the_chain->last = _Chain_Head(the_chain); 40015af4: fa 27 bf fc st %i5, [ %fp + -4 ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40015af8: e8 27 bf f4 st %l4, [ %fp + -12 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40015afc: e4 27 bf f0 st %l2, [ %fp + -16 ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40015b00: ee 27 bf e8 st %l7, [ %fp + -24 ] 40015b04: ac 15 a0 d4 or %l6, 0xd4, %l6 40015b08: aa 15 60 10 or %l5, 0x10, %l5 40015b0c: b8 17 23 80 or %i4, 0x380, %i4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b10: a2 06 20 30 add %i0, 0x30, %l1 /* * 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 ); 40015b14: a6 06 20 68 add %i0, 0x68, %l3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40015b18: b2 06 20 08 add %i0, 8, %i1 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40015b1c: b4 06 20 40 add %i0, 0x40, %i2 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 40015b20: b6 10 20 01 mov 1, %i3 { /* * 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; 40015b24: fa 26 20 78 st %i5, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40015b28: c2 05 80 00 ld [ %l6 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40015b2c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b30: 90 10 00 11 mov %l1, %o0 40015b34: 92 20 40 09 sub %g1, %o1, %o1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 40015b38: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b3c: 40 00 12 3c call 4001a42c <_Watchdog_Adjust_to_chain> 40015b40: 94 10 00 12 mov %l2, %o2 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40015b44: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40015b48: e0 05 40 00 ld [ %l5 ], %l0 /* * 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 ) { 40015b4c: 80 a4 00 09 cmp %l0, %o1 40015b50: 38 80 00 2f bgu,a 40015c0c <_Timer_server_Body+0x140> 40015b54: 92 24 00 09 sub %l0, %o1, %o1 * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 40015b58: 80 a4 00 09 cmp %l0, %o1 40015b5c: 0a 80 00 30 bcs 40015c1c <_Timer_server_Body+0x150> 40015b60: 94 22 40 10 sub %o1, %l0, %o2 */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 40015b64: e0 26 20 74 st %l0, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 40015b68: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40015b6c: 40 00 02 b5 call 40016640 <_Chain_Get> 40015b70: 01 00 00 00 nop if ( timer == NULL ) { 40015b74: 80 a2 20 00 cmp %o0, 0 40015b78: 02 80 00 10 be 40015bb8 <_Timer_server_Body+0xec> 40015b7c: 01 00 00 00 nop static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40015b80: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40015b84: 80 a0 60 01 cmp %g1, 1 40015b88: 02 80 00 29 be 40015c2c <_Timer_server_Body+0x160> 40015b8c: 80 a0 60 03 cmp %g1, 3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40015b90: 12 bf ff f6 bne 40015b68 <_Timer_server_Body+0x9c> 40015b94: 92 02 20 10 add %o0, 0x10, %o1 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40015b98: 40 00 12 5b call 4001a504 <_Watchdog_Insert> 40015b9c: 90 10 00 13 mov %l3, %o0 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 40015ba0: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40015ba4: 40 00 02 a7 call 40016640 <_Chain_Get> 40015ba8: 01 00 00 00 nop if ( timer == NULL ) { 40015bac: 80 a2 20 00 cmp %o0, 0 40015bb0: 32 bf ff f5 bne,a 40015b84 <_Timer_server_Body+0xb8> 40015bb4: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 40015bb8: 7f ff e3 a4 call 4000ea48 40015bbc: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40015bc0: c2 07 bf f4 ld [ %fp + -12 ], %g1 40015bc4: 80 a5 00 01 cmp %l4, %g1 40015bc8: 02 80 00 1d be 40015c3c <_Timer_server_Body+0x170> 40015bcc: 01 00 00 00 nop ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40015bd0: 7f ff e3 a2 call 4000ea58 <== NOT EXECUTED 40015bd4: 01 00 00 00 nop <== NOT EXECUTED static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40015bd8: c2 05 80 00 ld [ %l6 ], %g1 <== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40015bdc: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015be0: 90 10 00 11 mov %l1, %o0 <== NOT EXECUTED 40015be4: 92 20 40 09 sub %g1, %o1, %o1 <== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 40015be8: c2 26 20 3c st %g1, [ %i0 + 0x3c ] <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015bec: 40 00 12 10 call 4001a42c <_Watchdog_Adjust_to_chain> <== NOT EXECUTED 40015bf0: 94 10 00 12 mov %l2, %o2 <== NOT EXECUTED Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40015bf4: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 <== NOT EXECUTED static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40015bf8: e0 05 40 00 ld [ %l5 ], %l0 <== NOT EXECUTED /* * 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 ) { 40015bfc: 80 a4 00 09 cmp %l0, %o1 <== NOT EXECUTED 40015c00: 08 bf ff d7 bleu 40015b5c <_Timer_server_Body+0x90> <== NOT EXECUTED 40015c04: 01 00 00 00 nop <== NOT EXECUTED /* * 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 ); 40015c08: 92 24 00 09 sub %l0, %o1, %o1 <== NOT EXECUTED 40015c0c: 90 10 00 13 mov %l3, %o0 40015c10: 40 00 12 07 call 4001a42c <_Watchdog_Adjust_to_chain> 40015c14: 94 10 00 12 mov %l2, %o2 40015c18: 30 bf ff d3 b,a 40015b64 <_Timer_server_Body+0x98> /* * 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 ); 40015c1c: 90 10 00 13 mov %l3, %o0 40015c20: 40 00 11 d3 call 4001a36c <_Watchdog_Adjust> 40015c24: 92 10 20 01 mov 1, %o1 40015c28: 30 bf ff cf b,a 40015b64 <_Timer_server_Body+0x98> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40015c2c: 92 02 20 10 add %o0, 0x10, %o1 40015c30: 40 00 12 35 call 4001a504 <_Watchdog_Insert> 40015c34: 90 10 00 11 mov %l1, %o0 40015c38: 30 bf ff cc b,a 40015b68 <_Timer_server_Body+0x9c> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 40015c3c: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40015c40: 7f ff e3 86 call 4000ea58 40015c44: 01 00 00 00 nop _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 ) ) { 40015c48: c2 07 bf e8 ld [ %fp + -24 ], %g1 40015c4c: 80 a5 c0 01 cmp %l7, %g1 40015c50: 12 80 00 0c bne 40015c80 <_Timer_server_Body+0x1b4> 40015c54: 01 00 00 00 nop 40015c58: 30 80 00 13 b,a 40015ca4 <_Timer_server_Body+0x1d8> * 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; 40015c5c: c0 24 20 08 clr [ %l0 + 8 ] Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 40015c60: c2 27 bf e8 st %g1, [ %fp + -24 ] new_first->previous = _Chain_Head(the_chain); 40015c64: e4 20 60 04 st %l2, [ %g1 + 4 ] _ISR_Enable( level ); 40015c68: 7f ff e3 7c call 4000ea58 40015c6c: 01 00 00 00 nop /* * 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 ); 40015c70: d2 04 20 24 ld [ %l0 + 0x24 ], %o1 40015c74: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 40015c78: 9f c0 40 00 call %g1 40015c7c: d0 04 20 20 ld [ %l0 + 0x20 ], %o0 /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 40015c80: 7f ff e3 72 call 4000ea48 40015c84: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 40015c88: e0 07 bf e8 ld [ %fp + -24 ], %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40015c8c: 80 a5 c0 10 cmp %l7, %l0 40015c90: 32 bf ff f3 bne,a 40015c5c <_Timer_server_Body+0x190> 40015c94: c2 04 00 00 ld [ %l0 ], %g1 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40015c98: 7f ff e3 70 call 4000ea58 40015c9c: 01 00 00 00 nop 40015ca0: 30 bf ff a1 b,a 40015b24 <_Timer_server_Body+0x58> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40015ca4: c0 2e 20 7c clrb [ %i0 + 0x7c ] 40015ca8: c2 07 00 00 ld [ %i4 ], %g1 40015cac: 82 00 60 01 inc %g1 40015cb0: c2 27 00 00 st %g1, [ %i4 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40015cb4: d0 06 00 00 ld [ %i0 ], %o0 40015cb8: 40 00 0e fa call 400198a0 <_Thread_Set_state> 40015cbc: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40015cc0: 7f ff ff 59 call 40015a24 <_Timer_server_Reset_interval_system_watchdog> 40015cc4: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40015cc8: 7f ff ff 6c call 40015a78 <_Timer_server_Reset_tod_system_watchdog> 40015ccc: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40015cd0: 40 00 0c 1f call 40018d4c <_Thread_Enable_dispatch> 40015cd4: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40015cd8: 90 10 00 19 mov %i1, %o0 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 40015cdc: f6 2e 20 7c stb %i3, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40015ce0: 40 00 12 76 call 4001a6b8 <_Watchdog_Remove> 40015ce4: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40015ce8: 40 00 12 74 call 4001a6b8 <_Watchdog_Remove> 40015cec: 90 10 00 1a mov %i2, %o0 40015cf0: 30 bf ff 8d b,a 40015b24 <_Timer_server_Body+0x58> 4000b1e4 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000b1e4: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000b1e8: 7f ff de 8a call 40002c10 4000b1ec: a0 10 00 18 mov %i0, %l0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4000b1f0: c2 06 00 00 ld [ %i0 ], %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4000b1f4: a2 06 20 04 add %i0, 4, %l1 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4000b1f8: 80 a0 40 11 cmp %g1, %l1 4000b1fc: 02 80 00 1f be 4000b278 <_Watchdog_Adjust+0x94> 4000b200: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000b204: 12 80 00 1f bne 4000b280 <_Watchdog_Adjust+0x9c> 4000b208: 80 a6 60 01 cmp %i1, 1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000b20c: 80 a6 a0 00 cmp %i2, 0 4000b210: 02 80 00 1a be 4000b278 <_Watchdog_Adjust+0x94> 4000b214: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 4000b218: f2 00 60 10 ld [ %g1 + 0x10 ], %i1 4000b21c: 80 a6 80 19 cmp %i2, %i1 4000b220: 1a 80 00 0b bcc 4000b24c <_Watchdog_Adjust+0x68> 4000b224: a4 10 20 01 mov 1, %l2 _Watchdog_First( header )->delta_interval -= units; 4000b228: 10 80 00 1d b 4000b29c <_Watchdog_Adjust+0xb8> <== NOT EXECUTED 4000b22c: b4 26 40 1a sub %i1, %i2, %i2 <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000b230: b4 a6 80 19 subcc %i2, %i1, %i2 4000b234: 02 80 00 11 be 4000b278 <_Watchdog_Adjust+0x94> 4000b238: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 4000b23c: f2 00 60 10 ld [ %g1 + 0x10 ], %i1 4000b240: 80 a6 40 1a cmp %i1, %i2 4000b244: 38 80 00 16 bgu,a 4000b29c <_Watchdog_Adjust+0xb8> 4000b248: b4 26 40 1a sub %i1, %i2, %i2 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4000b24c: e4 20 60 10 st %l2, [ %g1 + 0x10 ] _ISR_Enable( level ); 4000b250: 7f ff de 74 call 40002c20 4000b254: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000b258: 40 00 00 b6 call 4000b530 <_Watchdog_Tickle> 4000b25c: 90 10 00 10 mov %l0, %o0 _ISR_Disable( level ); 4000b260: 7f ff de 6c call 40002c10 4000b264: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4000b268: c4 04 00 00 ld [ %l0 ], %g2 if ( _Chain_Is_empty( header ) ) 4000b26c: 80 a4 40 02 cmp %l1, %g2 4000b270: 12 bf ff f0 bne 4000b230 <_Watchdog_Adjust+0x4c> 4000b274: 82 10 00 02 mov %g2, %g1 } break; } } _ISR_Enable( level ); 4000b278: 7f ff de 6a call 40002c20 4000b27c: 91 e8 00 08 restore %g0, %o0, %o0 * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4000b280: 12 bf ff fe bne 4000b278 <_Watchdog_Adjust+0x94> 4000b284: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000b288: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000b28c: b4 00 80 1a add %g2, %i2, %i2 4000b290: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } break; } } _ISR_Enable( level ); 4000b294: 7f ff de 63 call 40002c20 4000b298: 91 e8 00 08 restore %g0, %o0, %o0 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; 4000b29c: 10 bf ff f7 b 4000b278 <_Watchdog_Adjust+0x94> 4000b2a0: f4 20 60 10 st %i2, [ %g1 + 0x10 ] 4000ef4c : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4000ef4c: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4000ef50: 7f ff fb 7e call 4000dd48 4000ef54: 01 00 00 00 nop 4000ef58: 80 a2 00 18 cmp %o0, %i0 4000ef5c: 12 80 00 b6 bne 4000f234 4000ef60: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 4000ef64: 02 80 00 ba be 4000f24c 4000ef68: 82 06 7f ff add %i1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4000ef6c: 80 a0 60 1f cmp %g1, 0x1f 4000ef70: 18 80 00 b7 bgu 4000f24c 4000ef74: 23 10 00 77 sethi %hi(0x4001dc00), %l1 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 ) 4000ef78: a5 2e 60 02 sll %i1, 2, %l2 4000ef7c: a2 14 63 04 or %l1, 0x304, %l1 4000ef80: a7 2e 60 04 sll %i1, 4, %l3 4000ef84: 84 24 c0 12 sub %l3, %l2, %g2 4000ef88: 84 04 40 02 add %l1, %g2, %g2 4000ef8c: c4 00 a0 08 ld [ %g2 + 8 ], %g2 4000ef90: 80 a0 a0 01 cmp %g2, 1 4000ef94: 02 80 00 45 be 4000f0a8 4000ef98: b0 10 20 00 clr %i0 /* * 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 ) ) 4000ef9c: 80 a6 60 04 cmp %i1, 4 4000efa0: 02 80 00 44 be 4000f0b0 4000efa4: 80 a6 60 08 cmp %i1, 8 4000efa8: 02 80 00 42 be 4000f0b0 4000efac: 80 a6 60 0b cmp %i1, 0xb 4000efb0: 02 80 00 40 be 4000f0b0 4000efb4: a0 10 20 01 mov 1, %l0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4000efb8: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4000efbc: e0 27 bf f8 st %l0, [ %fp + -8 ] if ( !value ) { 4000efc0: 80 a6 a0 00 cmp %i2, 0 4000efc4: 02 80 00 41 be 4000f0c8 4000efc8: a1 2c 00 01 sll %l0, %g1, %l0 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 4000efcc: c2 06 80 00 ld [ %i2 ], %g1 4000efd0: c2 27 bf fc st %g1, [ %fp + -4 ] 4000efd4: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000efd8: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 4001d970 <_Thread_Dispatch_disable_level> 4000efdc: 84 00 a0 01 inc %g2 4000efe0: c4 20 61 70 st %g2, [ %g1 + 0x170 ] /* * 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; 4000efe4: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000efe8: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000efec: c4 00 61 60 ld [ %g1 + 0x160 ], %g2 4000eff0: c4 00 a0 cc ld [ %g2 + 0xcc ], %g2 4000eff4: 80 ac 00 02 andncc %l0, %g2, %g0 4000eff8: 12 80 00 1a bne 4000f060 4000effc: 09 10 00 78 sethi %hi(0x4001e000), %g4 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4000f000: c4 01 20 90 ld [ %g4 + 0x90 ], %g2 ! 4001e090 <_POSIX_signals_Wait_queue> 4000f004: 88 11 20 90 or %g4, 0x90, %g4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4000f008: 88 01 20 04 add %g4, 4, %g4 4000f00c: 80 a0 80 04 cmp %g2, %g4 4000f010: 02 80 00 30 be 4000f0d0 4000f014: 82 10 00 02 mov %g2, %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4000f018: c6 00 a0 30 ld [ %g2 + 0x30 ], %g3 4000f01c: 80 8c 00 03 btst %l0, %g3 4000f020: 02 80 00 0c be 4000f050 4000f024: c6 00 a1 60 ld [ %g2 + 0x160 ], %g3 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4000f028: 10 80 00 0f b 4000f064 4000f02c: 84 10 20 01 mov 1, %g2 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4000f030: 80 a0 80 04 cmp %g2, %g4 4000f034: 22 80 00 28 be,a 4000f0d4 4000f038: 03 10 00 74 sethi %hi(0x4001d000), %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4000f03c: c2 00 a0 30 ld [ %g2 + 0x30 ], %g1 <== NOT EXECUTED for ( the_node = the_chain->first ; !_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 ]; 4000f040: c6 00 a1 60 ld [ %g2 + 0x160 ], %g3 <== NOT EXECUTED #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4000f044: 80 8c 00 01 btst %l0, %g1 <== NOT EXECUTED 4000f048: 12 80 00 06 bne 4000f060 <== NOT EXECUTED 4000f04c: 82 10 00 02 mov %g2, %g1 <== NOT EXECUTED /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4000f050: c6 00 e0 cc ld [ %g3 + 0xcc ], %g3 4000f054: 80 ac 00 03 andncc %l0, %g3, %g0 4000f058: 22 bf ff f6 be,a 4000f030 4000f05c: c4 00 80 00 ld [ %g2 ], %g2 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4000f060: 84 10 20 01 mov 1, %g2 /* * 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 ) ) { 4000f064: 90 10 00 01 mov %g1, %o0 4000f068: 92 10 00 19 mov %i1, %o1 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4000f06c: c4 28 60 74 stb %g2, [ %g1 + 0x74 ] /* * 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 ) ) { 4000f070: 40 00 00 ba call 4000f358 <_POSIX_signals_Unblock_thread> 4000f074: 94 07 bf f4 add %fp, -12, %o2 4000f078: 80 8a 20 ff btst 0xff, %o0 4000f07c: 12 80 00 5a bne 4000f1e4 4000f080: 01 00 00 00 nop /* * 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 ); 4000f084: 40 00 00 a5 call 4000f318 <_POSIX_signals_Set_process_signals> 4000f088: 90 10 00 10 mov %l0, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4000f08c: a4 24 c0 12 sub %l3, %l2, %l2 4000f090: c2 04 40 12 ld [ %l1 + %l2 ], %g1 4000f094: 80 a0 60 02 cmp %g1, 2 4000f098: 02 80 00 57 be 4000f1f4 4000f09c: 11 10 00 78 sethi %hi(0x4001e000), %o0 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4000f0a0: 7f ff e3 36 call 40007d78 <_Thread_Enable_dispatch> 4000f0a4: b0 10 20 00 clr %i0 return 0; } 4000f0a8: 81 c7 e0 08 ret 4000f0ac: 81 e8 00 00 restore * 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 ); 4000f0b0: 40 00 01 38 call 4000f590 4000f0b4: 01 00 00 00 nop 4000f0b8: 40 00 00 f9 call 4000f49c 4000f0bc: 92 10 00 19 mov %i1, %o1 4000f0c0: 81 c7 e0 08 ret 4000f0c4: 91 e8 00 08 restore %g0, %o0, %o0 */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 4000f0c8: 10 bf ff c3 b 4000efd4 4000f0cc: c0 27 bf fc clr [ %fp + -4 ] * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4000f0d0: 03 10 00 74 sethi %hi(0x4001d000), %g1 4000f0d4: da 08 60 14 ldub [ %g1 + 0x14 ], %o5 ! 4001d014 4000f0d8: 13 10 00 76 sethi %hi(0x4001d800), %o1 4000f0dc: 9a 03 60 01 inc %o5 4000f0e0: 92 12 60 d8 or %o1, 0xd8, %o1 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4000f0e4: 82 10 20 00 clr %g1 4000f0e8: 90 02 60 0c add %o1, 0xc, %o0 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4000f0ec: 35 04 00 00 sethi %hi(0x10000000), %i2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4000f0f0: c4 02 40 00 ld [ %o1 ], %g2 4000f0f4: 80 a0 a0 00 cmp %g2, 0 4000f0f8: 22 80 00 2d be,a 4000f1ac 4000f0fc: 92 02 60 04 add %o1, 4, %o1 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4000f100: c4 00 a0 04 ld [ %g2 + 4 ], %g2 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4000f104: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4000f108: 80 a3 20 00 cmp %o4, 0 4000f10c: 02 80 00 27 be 4000f1a8 4000f110: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 4000f114: 84 10 20 01 mov 1, %g2 the_thread = (Thread_Control *) object_table[ index ]; 4000f118: 87 28 a0 02 sll %g2, 2, %g3 4000f11c: c6 02 c0 03 ld [ %o3 + %g3 ], %g3 if ( !the_thread ) 4000f120: 80 a0 e0 00 cmp %g3, 0 4000f124: 02 80 00 1e be 4000f19c 4000f128: 84 00 a0 01 inc %g2 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4000f12c: c8 00 e0 14 ld [ %g3 + 0x14 ], %g4 4000f130: 80 a1 00 0d cmp %g4, %o5 4000f134: 18 80 00 1b bgu 4000f1a0 4000f138: 80 a3 00 02 cmp %o4, %g2 DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000f13c: d4 00 e1 60 ld [ %g3 + 0x160 ], %o2 4000f140: d4 02 a0 cc ld [ %o2 + 0xcc ], %o2 4000f144: 80 ac 00 0a andncc %l0, %o2, %g0 4000f148: 02 80 00 16 be 4000f1a0 4000f14c: 80 a3 00 02 cmp %o4, %g2 * * 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 ) { 4000f150: 80 a1 00 0d cmp %g4, %o5 4000f154: 2a 80 00 11 bcs,a 4000f198 4000f158: 9a 10 00 04 mov %g4, %o5 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4000f15c: d4 00 60 10 ld [ %g1 + 0x10 ], %o2 4000f160: 80 a2 a0 00 cmp %o2, 0 4000f164: 02 80 00 0f be 4000f1a0 4000f168: 80 a3 00 02 cmp %o4, %g2 /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4000f16c: de 00 e0 10 ld [ %g3 + 0x10 ], %o7 4000f170: 80 a3 e0 00 cmp %o7, 0 4000f174: 22 80 00 09 be,a 4000f198 4000f178: 9a 10 00 04 mov %g4, %o5 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4000f17c: 80 8a 80 1a btst %o2, %i2 4000f180: 12 80 00 08 bne 4000f1a0 4000f184: 80 a3 00 02 cmp %o4, %g2 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4000f188: 80 8b c0 1a btst %o7, %i2 4000f18c: 02 80 00 05 be 4000f1a0 4000f190: 80 a3 00 02 cmp %o4, %g2 4000f194: 9a 10 00 04 mov %g4, %o5 4000f198: 82 10 00 03 mov %g3, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4000f19c: 80 a3 00 02 cmp %o4, %g2 4000f1a0: 1a bf ff df bcc 4000f11c 4000f1a4: 87 28 a0 02 sll %g2, 2, %g3 4000f1a8: 92 02 60 04 add %o1, 4, %o1 * + 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++) { 4000f1ac: 80 a2 40 08 cmp %o1, %o0 4000f1b0: 32 bf ff d1 bne,a 4000f0f4 4000f1b4: c4 02 40 00 ld [ %o1 ], %g2 } } } } if ( interested ) { 4000f1b8: 80 a0 60 00 cmp %g1, 0 4000f1bc: 02 bf ff b2 be 4000f084 4000f1c0: 84 10 20 01 mov 1, %g2 /* * 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 ) ) { 4000f1c4: 90 10 00 01 mov %g1, %o0 4000f1c8: 92 10 00 19 mov %i1, %o1 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4000f1cc: c4 28 60 74 stb %g2, [ %g1 + 0x74 ] /* * 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 ) ) { 4000f1d0: 40 00 00 62 call 4000f358 <_POSIX_signals_Unblock_thread> 4000f1d4: 94 07 bf f4 add %fp, -12, %o2 4000f1d8: 80 8a 20 ff btst 0xff, %o0 4000f1dc: 02 bf ff aa be 4000f084 4000f1e0: 01 00 00 00 nop _Thread_Enable_dispatch(); 4000f1e4: 7f ff e2 e5 call 40007d78 <_Thread_Enable_dispatch> 4000f1e8: b0 10 20 00 clr %i0 ! 0 return 0; 4000f1ec: 81 c7 e0 08 ret 4000f1f0: 81 e8 00 00 restore */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4000f1f4: 7f ff f3 bb call 4000c0e0 <_Chain_Get> 4000f1f8: 90 12 20 84 or %o0, 0x84, %o0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4000f1fc: 80 a2 20 00 cmp %o0, 0 4000f200: 02 80 00 19 be 4000f264 4000f204: c2 07 bf f4 ld [ %fp + -12 ], %g1 rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4000f208: 92 10 00 08 mov %o0, %o1 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4000f20c: c2 22 20 08 st %g1, [ %o0 + 8 ] 4000f210: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000f214: c2 22 20 0c st %g1, [ %o0 + 0xc ] 4000f218: c2 07 bf fc ld [ %fp + -4 ], %g1 4000f21c: c2 22 20 10 st %g1, [ %o0 + 0x10 ] _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4000f220: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000f224: 90 12 20 d4 or %o0, 0xd4, %o0 ! 4001e0d4 <_POSIX_signals_Siginfo> 4000f228: 7f ff dc a6 call 400064c0 <_Chain_Append> 4000f22c: 90 02 00 12 add %o0, %l2, %o0 4000f230: 30 bf ff 9c b,a 4000f0a0 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 4000f234: 40 00 01 0c call 4000f664 <__errno> 4000f238: b0 10 3f ff mov -1, %i0 4000f23c: 82 10 20 03 mov 3, %g1 4000f240: c2 22 00 00 st %g1, [ %o0 ] 4000f244: 81 c7 e0 08 ret 4000f248: 81 e8 00 00 restore */ if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 4000f24c: 40 00 01 06 call 4000f664 <__errno> 4000f250: b0 10 3f ff mov -1, %i0 4000f254: 82 10 20 16 mov 0x16, %g1 4000f258: c2 22 00 00 st %g1, [ %o0 ] 4000f25c: 81 c7 e0 08 ret 4000f260: 81 e8 00 00 restore 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(); 4000f264: 7f ff e2 c5 call 40007d78 <_Thread_Enable_dispatch> 4000f268: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EAGAIN ); 4000f26c: 40 00 00 fe call 4000f664 <__errno> 4000f270: 01 00 00 00 nop 4000f274: 82 10 20 0b mov 0xb, %g1 ! b 4000f278: c2 22 00 00 st %g1, [ %o0 ] 4000f27c: 81 c7 e0 08 ret 4000f280: 81 e8 00 00 restore 40006388 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 40006388: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 4000638c: 80 a6 60 00 cmp %i1, 0 40006390: 02 80 00 19 be 400063f4 40006394: a0 10 00 18 mov %i0, %l0 40006398: 80 a6 20 00 cmp %i0, 0 4000639c: 02 80 00 16 be 400063f4 400063a0: 01 00 00 00 nop return EINVAL; if ( !once_control->init_executed ) { 400063a4: c2 06 20 04 ld [ %i0 + 4 ], %g1 400063a8: 80 a0 60 00 cmp %g1, 0 400063ac: 12 80 00 10 bne 400063ec 400063b0: b0 10 20 00 clr %i0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 400063b4: a2 07 bf fc add %fp, -4, %l1 400063b8: 90 10 21 00 mov 0x100, %o0 400063bc: 92 10 21 00 mov 0x100, %o1 400063c0: 40 00 03 0b call 40006fec 400063c4: 94 10 00 11 mov %l1, %o2 if ( !once_control->init_executed ) { 400063c8: c2 04 20 04 ld [ %l0 + 4 ], %g1 400063cc: 80 a0 60 00 cmp %g1, 0 400063d0: 02 80 00 0b be 400063fc 400063d4: 82 10 20 01 mov 1, %g1 once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 400063d8: d0 07 bf fc ld [ %fp + -4 ], %o0 <== NOT EXECUTED 400063dc: 94 10 00 11 mov %l1, %o2 400063e0: 92 10 21 00 mov 0x100, %o1 400063e4: 40 00 03 02 call 40006fec 400063e8: b0 10 20 00 clr %i0 } return 0; } 400063ec: 81 c7 e0 08 ret 400063f0: 81 e8 00 00 restore int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 400063f4: 81 c7 e0 08 ret 400063f8: 91 e8 20 16 restore %g0, 0x16, %o0 if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; once_control->init_executed = true; 400063fc: c2 24 20 04 st %g1, [ %l0 + 4 ] (*init_routine)(); 40006400: 9f c6 40 00 call %i1 40006404: c2 24 00 00 st %g1, [ %l0 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 40006408: 10 bf ff f5 b 400063dc 4000640c: d0 07 bf fc ld [ %fp + -4 ], %o0 40005f84 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 40005f84: 9d e3 bf a0 save %sp, -96, %sp * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 40005f88: 03 10 00 7d sethi %hi(0x4001f400), %g1 40005f8c: c2 00 63 88 ld [ %g1 + 0x388 ], %g1 ! 4001f788 <_ISR_Nest_level> 40005f90: 80 a0 60 00 cmp %g1, 0 40005f94: 12 80 00 15 bne 40005fe8 40005f98: 03 10 00 7d sethi %hi(0x4001f400), %g1 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40005f9c: 21 10 00 7d sethi %hi(0x4001f400), %l0 40005fa0: c6 00 62 f0 ld [ %g1 + 0x2f0 ], %g3 40005fa4: c4 04 23 ac ld [ %l0 + 0x3ac ], %g2 40005fa8: 86 00 e0 01 inc %g3 40005fac: c6 20 62 f0 st %g3, [ %g1 + 0x2f0 ] 40005fb0: c2 00 a1 60 ld [ %g2 + 0x160 ], %g1 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 40005fb4: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 40005fb8: 80 a0 a0 00 cmp %g2, 0 40005fbc: 12 80 00 0d bne 40005ff0 40005fc0: 01 00 00 00 nop thread_support->cancelation_requested ) 40005fc4: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 40005fc8: 80 a0 60 00 cmp %g1, 0 40005fcc: 02 80 00 09 be 40005ff0 40005fd0: 01 00 00 00 nop cancel = true; _Thread_Enable_dispatch(); 40005fd4: 40 00 0a 38 call 400088b4 <_Thread_Enable_dispatch> 40005fd8: b2 10 3f ff mov -1, %i1 ! ffffffff if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 40005fdc: f0 04 23 ac ld [ %l0 + 0x3ac ], %i0 40005fe0: 40 00 19 8f call 4000c61c <_POSIX_Thread_Exit> 40005fe4: 81 e8 00 00 restore 40005fe8: 81 c7 e0 08 ret <== NOT EXECUTED 40005fec: 81 e8 00 00 restore <== NOT EXECUTED _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 40005ff0: 40 00 0a 31 call 400088b4 <_Thread_Enable_dispatch> 40005ff4: 81 e8 00 00 restore 40005ff8: 01 00 00 00 nop 40007fc0 : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 40007fc0: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 40007fc4: 03 10 00 8f sethi %hi(0x40023c00), %g1 40007fc8: c2 00 60 48 ld [ %g1 + 0x48 ], %g1 ! 40023c48 <_ISR_Nest_level> rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; 40007fcc: 09 10 00 91 sethi %hi(0x40024400), %g4 if ( rtems_interrupt_is_in_progress() ) 40007fd0: 80 a0 60 00 cmp %g1, 0 40007fd4: 84 10 20 12 mov 0x12, %g2 rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 40007fd8: 82 10 00 19 mov %i1, %g1 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 40007fdc: 12 80 00 49 bne 40008100 40007fe0: c6 01 21 34 ld [ %g4 + 0x134 ], %g3 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 40007fe4: 80 a6 a0 00 cmp %i2, 0 40007fe8: 02 80 00 4b be 40008114 40007fec: 80 a6 60 00 cmp %i1, 0 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) 40007ff0: 02 80 00 49 be 40008114 40007ff4: c6 26 80 00 st %g3, [ %i2 ] static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 40007ff8: c4 06 40 00 ld [ %i1 ], %g2 40007ffc: 80 a0 a0 00 cmp %g2, 0 40008000: 22 80 00 42 be,a 40008108 40008004: c4 06 60 04 ld [ %i1 + 4 ], %g2 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 40008008: 80 a0 c0 18 cmp %g3, %i0 4000800c: 08 80 00 3d bleu 40008100 40008010: 84 10 20 0a mov 0xa, %g2 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40008014: 05 10 00 8e sethi %hi(0x40023800), %g2 40008018: c6 00 a3 b0 ld [ %g2 + 0x3b0 ], %g3 ! 40023bb0 <_Thread_Dispatch_disable_level> 4000801c: 86 00 e0 01 inc %g3 40008020: c6 20 a3 b0 st %g3, [ %g2 + 0x3b0 ] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 40008024: 80 a6 20 00 cmp %i0, 0 40008028: 12 80 00 2b bne 400080d4 4000802c: 05 10 00 91 sethi %hi(0x40024400), %g2 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 40008030: da 01 21 34 ld [ %g4 + 0x134 ], %o5 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 40008034: 80 a3 60 00 cmp %o5, 0 40008038: 02 80 00 3a be 40008120 4000803c: d8 00 a1 38 ld [ %g2 + 0x138 ], %o4 40008040: 10 80 00 05 b 40008054 40008044: 86 10 00 0c mov %o4, %g3 40008048: 80 a3 40 18 cmp %o5, %i0 4000804c: 08 80 00 0b bleu 40008078 40008050: 86 00 e0 18 add %g3, 0x18, %g3 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 40008054: c8 00 c0 00 ld [ %g3 ], %g4 40008058: 80 a1 20 00 cmp %g4, 0 4000805c: 32 bf ff fb bne,a 40008048 40008060: b0 06 20 01 inc %i0 40008064: c8 00 e0 04 ld [ %g3 + 4 ], %g4 40008068: 80 a1 20 00 cmp %g4, 0 4000806c: 32 bf ff f7 bne,a 40008048 40008070: b0 06 20 01 inc %i0 } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) 40008074: 80 a3 40 18 cmp %o5, %i0 40008078: 02 80 00 2b be 40008124 4000807c: f0 26 80 00 st %i0, [ %i2 ] 40008080: 85 2e 20 03 sll %i0, 3, %g2 40008084: 87 2e 20 05 sll %i0, 5, %g3 40008088: 84 20 c0 02 sub %g3, %g2, %g2 4000808c: 84 03 00 02 add %o4, %g2, %g2 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 40008090: c6 00 40 00 ld [ %g1 ], %g3 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 40008094: b2 10 20 00 clr %i1 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 40008098: c6 20 80 00 st %g3, [ %g2 ] 4000809c: c6 00 60 04 ld [ %g1 + 4 ], %g3 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 400080a0: b4 10 20 00 clr %i2 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 400080a4: c6 20 a0 04 st %g3, [ %g2 + 4 ] 400080a8: c6 00 60 08 ld [ %g1 + 8 ], %g3 400080ac: c6 20 a0 08 st %g3, [ %g2 + 8 ] 400080b0: c6 00 60 0c ld [ %g1 + 0xc ], %g3 400080b4: c6 20 a0 0c st %g3, [ %g2 + 0xc ] 400080b8: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 400080bc: c6 20 a0 10 st %g3, [ %g2 + 0x10 ] 400080c0: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 _Thread_Enable_dispatch(); 400080c4: 40 00 07 35 call 40009d98 <_Thread_Enable_dispatch> 400080c8: c2 20 a0 14 st %g1, [ %g2 + 0x14 ] return rtems_io_initialize( major, 0, NULL ); 400080cc: 40 00 26 5f call 40011a48 400080d0: 81 e8 00 00 restore _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 400080d4: c6 00 a1 38 ld [ %g2 + 0x138 ], %g3 400080d8: 89 2e 20 05 sll %i0, 5, %g4 400080dc: 85 2e 20 03 sll %i0, 3, %g2 400080e0: 84 21 00 02 sub %g4, %g2, %g2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 400080e4: c8 00 c0 02 ld [ %g3 + %g2 ], %g4 400080e8: 80 a1 20 00 cmp %g4, 0 400080ec: 02 80 00 12 be 40008134 400080f0: 84 00 c0 02 add %g3, %g2, %g2 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 400080f4: 40 00 07 29 call 40009d98 <_Thread_Enable_dispatch> 400080f8: 01 00 00 00 nop 400080fc: 84 10 20 0c mov 0xc, %g2 ! c _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 40008100: 81 c7 e0 08 ret 40008104: 91 e8 00 02 restore %g0, %g2, %o0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 40008108: 80 a0 a0 00 cmp %g2, 0 4000810c: 12 bf ff c0 bne 4000800c 40008110: 80 a0 c0 18 cmp %g3, %i0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 40008114: 84 10 20 09 mov 9, %g2 } 40008118: 81 c7 e0 08 ret 4000811c: 91 e8 00 02 restore %g0, %g2, %o0 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 40008120: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 40008124: 40 00 07 1d call 40009d98 <_Thread_Enable_dispatch> 40008128: 01 00 00 00 nop return sc; 4000812c: 10 bf ff f5 b 40008100 40008130: 84 10 20 05 mov 5, %g2 ! 5 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 40008134: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40008138: 80 a0 e0 00 cmp %g3, 0 4000813c: 12 bf ff ee bne 400080f4 40008140: 01 00 00 00 nop if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 40008144: 10 bf ff d3 b 40008090 40008148: f0 26 80 00 st %i0, [ %i2 ] 40008ce0 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 40008ce0: 9d e3 bf 98 save %sp, -104, %sp * * 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 ); 40008ce4: 90 10 00 19 mov %i1, %o0 40008ce8: 40 00 18 62 call 4000ee70 <_POSIX_Absolute_timeout_to_ticks> 40008cec: 92 07 bf fc add %fp, -4, %o1 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40008cf0: 80 a2 20 03 cmp %o0, 3 40008cf4: 02 80 00 07 be 40008d10 40008cf8: d4 07 bf fc ld [ %fp + -4 ], %o2 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 40008cfc: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40008d00: 40 00 1b 4a call 4000fa28 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED 40008d04: 92 10 20 00 clr %o1 <== NOT EXECUTED break; } } return lock_status; } 40008d08: 81 c7 e0 08 ret <== NOT EXECUTED 40008d0c: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED */ 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 ); 40008d10: 90 10 00 18 mov %i0, %o0 40008d14: 40 00 1b 45 call 4000fa28 <_POSIX_Semaphore_Wait_support> 40008d18: 92 10 20 01 mov 1, %o1 break; } } return lock_status; } 40008d1c: 81 c7 e0 08 ret 40008d20: 91 e8 00 08 restore %g0, %o0, %o0 40008434 : #include int sigsuspend( const sigset_t *sigmask ) { 40008434: 9d e3 bf 98 save %sp, -104, %sp int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 40008438: 90 10 20 01 mov 1, %o0 4000843c: 92 10 00 18 mov %i0, %o1 40008440: a0 07 bf fc add %fp, -4, %l0 40008444: 7f ff ff f1 call 40008408 40008448: 94 10 00 10 mov %l0, %o2 (void) sigfillset( &all_signals ); 4000844c: a2 07 bf f8 add %fp, -8, %l1 40008450: 7f ff ff b7 call 4000832c 40008454: 90 10 00 11 mov %l1, %o0 status = sigtimedwait( &all_signals, NULL, NULL ); 40008458: 90 10 00 11 mov %l1, %o0 4000845c: 92 10 20 00 clr %o1 40008460: 40 00 00 2b call 4000850c 40008464: 94 10 20 00 clr %o2 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 40008468: 92 10 00 10 mov %l0, %o1 status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); (void) sigfillset( &all_signals ); status = sigtimedwait( &all_signals, NULL, NULL ); 4000846c: a2 10 00 08 mov %o0, %l1 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 40008470: 94 10 20 00 clr %o2 40008474: 7f ff ff e5 call 40008408 40008478: 90 10 20 00 clr %o0 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 4000847c: 80 a4 7f ff cmp %l1, -1 40008480: 12 80 00 05 bne 40008494 40008484: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINTR ); return status; } 40008488: b0 10 3f ff mov -1, %i0 ! ffffffff <== NOT EXECUTED 4000848c: 81 c7 e0 08 ret <== NOT EXECUTED 40008490: 81 e8 00 00 restore <== NOT EXECUTED /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) rtems_set_errno_and_return_minus_one( EINTR ); 40008494: 40 00 28 86 call 400126ac <__errno> 40008498: b0 10 3f ff mov -1, %i0 4000849c: 82 10 20 04 mov 4, %g1 400084a0: c2 22 00 00 st %g1, [ %o0 ] 400084a4: 81 c7 e0 08 ret 400084a8: 81 e8 00 00 restore