4000d5dc <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000d5dc: 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; 4000d5e0: a8 06 60 04 add %i1, 4, %l4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000d5e4: 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 ) { 4000d5e8: 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; 4000d5ec: e4 06 20 08 ld [ %i0 + 8 ], %l2 4000d5f0: 18 80 00 75 bgu 4000d7c4 <_Heap_Allocate_aligned_with_boundary+0x1e8> 4000d5f4: fa 06 20 10 ld [ %i0 + 0x10 ], %i5 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4000d5f8: 80 a6 e0 00 cmp %i3, 0 4000d5fc: 12 80 00 70 bne 4000d7bc <_Heap_Allocate_aligned_with_boundary+0x1e0> 4000d600: 80 a6 40 1b cmp %i1, %i3 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000d604: 80 a4 00 12 cmp %l0, %l2 4000d608: 02 80 00 72 be 4000d7d0 <_Heap_Allocate_aligned_with_boundary+0x1f4> 4000d60c: 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; 4000d610: 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; 4000d614: 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; 4000d618: 82 20 40 19 sub %g1, %i1, %g1 4000d61c: 10 80 00 09 b 4000d640 <_Heap_Allocate_aligned_with_boundary+0x64> 4000d620: c2 27 bf fc st %g1, [ %fp + -4 ] boundary ); } } if ( alloc_begin != 0 ) { 4000d624: 80 a6 20 00 cmp %i0, 0 4000d628: 32 80 00 57 bne,a 4000d784 <_Heap_Allocate_aligned_with_boundary+0x1a8> 4000d62c: c2 04 20 4c ld [ %l0 + 0x4c ], %g1 break; } block = block->next; 4000d630: e4 04 a0 08 ld [ %l2 + 8 ], %l2 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000d634: 80 a4 00 12 cmp %l0, %l2 4000d638: 22 80 00 5a be,a 4000d7a0 <_Heap_Allocate_aligned_with_boundary+0x1c4> 4000d63c: 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 ) { 4000d640: e6 04 a0 04 ld [ %l2 + 4 ], %l3 4000d644: 80 a5 00 13 cmp %l4, %l3 4000d648: 1a bf ff fa bcc 4000d630 <_Heap_Allocate_aligned_with_boundary+0x54> 4000d64c: a2 04 60 01 inc %l1 if ( alignment == 0 ) { 4000d650: 80 a6 a0 00 cmp %i2, 0 4000d654: 02 bf ff f4 be 4000d624 <_Heap_Allocate_aligned_with_boundary+0x48> 4000d658: 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; 4000d65c: 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; 4000d660: 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; 4000d664: a6 0c ff fe and %l3, -2, %l3 4000d668: 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; 4000d66c: 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; 4000d670: 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); 4000d674: 90 10 00 18 mov %i0, %o0 4000d678: a6 00 40 13 add %g1, %l3, %l3 4000d67c: 40 00 32 b8 call 4001a15c <.urem> 4000d680: 92 10 00 1a mov %i2, %o1 4000d684: 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 ) { 4000d688: 80 a4 c0 18 cmp %l3, %i0 4000d68c: 1a 80 00 06 bcc 4000d6a4 <_Heap_Allocate_aligned_with_boundary+0xc8> 4000d690: ac 04 a0 08 add %l2, 8, %l6 4000d694: 90 10 00 13 mov %l3, %o0 4000d698: 40 00 32 b1 call 4001a15c <.urem> 4000d69c: 92 10 00 1a mov %i2, %o1 4000d6a0: b0 24 c0 08 sub %l3, %o0, %i0 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4000d6a4: 80 a6 e0 00 cmp %i3, 0 4000d6a8: 02 80 00 26 be 4000d740 <_Heap_Allocate_aligned_with_boundary+0x164> 4000d6ac: 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; 4000d6b0: a6 06 00 19 add %i0, %i1, %l3 4000d6b4: 92 10 00 1b mov %i3, %o1 4000d6b8: 40 00 32 a9 call 4001a15c <.urem> 4000d6bc: 90 10 00 13 mov %l3, %o0 4000d6c0: 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 ) { 4000d6c4: 80 a4 c0 08 cmp %l3, %o0 4000d6c8: 08 80 00 1e bleu 4000d740 <_Heap_Allocate_aligned_with_boundary+0x164> 4000d6cc: 80 a5 80 18 cmp %l6, %i0 4000d6d0: 80 a6 00 08 cmp %i0, %o0 4000d6d4: 1a 80 00 1b bcc 4000d740 <_Heap_Allocate_aligned_with_boundary+0x164> 4000d6d8: 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; 4000d6dc: 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 ) { 4000d6e0: 80 a5 40 08 cmp %l5, %o0 4000d6e4: 28 80 00 0a bleu,a 4000d70c <_Heap_Allocate_aligned_with_boundary+0x130> 4000d6e8: b0 22 00 19 sub %o0, %i1, %i0 if ( alloc_begin != 0 ) { break; } block = block->next; 4000d6ec: 10 bf ff d2 b 4000d634 <_Heap_Allocate_aligned_with_boundary+0x58> 4000d6f0: 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 ) { 4000d6f4: 1a 80 00 13 bcc 4000d740 <_Heap_Allocate_aligned_with_boundary+0x164> 4000d6f8: 80 a5 80 18 cmp %l6, %i0 if ( boundary_line < boundary_floor ) { 4000d6fc: 80 a5 40 08 cmp %l5, %o0 4000d700: 38 bf ff cd bgu,a 4000d634 <_Heap_Allocate_aligned_with_boundary+0x58> 4000d704: e4 04 a0 08 ld [ %l2 + 8 ], %l2 <== NOT EXECUTED return 0; } alloc_begin = boundary_line - alloc_size; 4000d708: b0 22 00 19 sub %o0, %i1, %i0 4000d70c: 92 10 00 1a mov %i2, %o1 4000d710: 40 00 32 93 call 4001a15c <.urem> 4000d714: 90 10 00 18 mov %i0, %o0 4000d718: 92 10 00 1b mov %i3, %o1 4000d71c: b0 26 00 08 sub %i0, %o0, %i0 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4000d720: a6 06 00 19 add %i0, %i1, %l3 4000d724: 40 00 32 8e call 4001a15c <.urem> 4000d728: 90 10 00 13 mov %l3, %o0 4000d72c: 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 ) { 4000d730: 80 a4 c0 08 cmp %l3, %o0 4000d734: 18 bf ff f0 bgu 4000d6f4 <_Heap_Allocate_aligned_with_boundary+0x118> 4000d738: 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 ) { 4000d73c: 80 a5 80 18 cmp %l6, %i0 4000d740: 18 bf ff bc bgu 4000d630 <_Heap_Allocate_aligned_with_boundary+0x54> 4000d744: 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; 4000d748: 90 10 00 18 mov %i0, %o0 4000d74c: a6 20 40 12 sub %g1, %l2, %l3 4000d750: 92 10 00 1d mov %i5, %o1 4000d754: 40 00 32 82 call 4001a15c <.urem> 4000d758: a6 04 c0 18 add %l3, %i0, %l3 if ( free_size >= min_block_size || free_size == 0 ) { 4000d75c: 90 a4 c0 08 subcc %l3, %o0, %o0 4000d760: 02 bf ff b2 be 4000d628 <_Heap_Allocate_aligned_with_boundary+0x4c> 4000d764: 80 a6 20 00 cmp %i0, 0 4000d768: 80 a5 c0 08 cmp %l7, %o0 4000d76c: 38 bf ff b2 bgu,a 4000d634 <_Heap_Allocate_aligned_with_boundary+0x58> 4000d770: e4 04 a0 08 ld [ %l2 + 8 ], %l2 boundary ); } } if ( alloc_begin != 0 ) { 4000d774: 80 a6 20 00 cmp %i0, 0 4000d778: 22 bf ff af be,a 4000d634 <_Heap_Allocate_aligned_with_boundary+0x58> 4000d77c: e4 04 a0 08 ld [ %l2 + 8 ], %l2 <== NOT EXECUTED block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000d780: c2 04 20 4c ld [ %l0 + 0x4c ], %g1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000d784: 92 10 00 12 mov %l2, %o1 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000d788: 82 00 40 11 add %g1, %l1, %g1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000d78c: 96 10 00 19 mov %i1, %o3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000d790: c2 24 20 4c st %g1, [ %l0 + 0x4c ] block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000d794: 90 10 00 10 mov %l0, %o0 4000d798: 7f ff e9 b1 call 40007e5c <_Heap_Block_allocate> 4000d79c: 94 10 00 18 mov %i0, %o2 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4000d7a0: c2 04 20 44 ld [ %l0 + 0x44 ], %g1 4000d7a4: 80 a0 40 11 cmp %g1, %l1 4000d7a8: 1a 80 00 08 bcc 4000d7c8 <_Heap_Allocate_aligned_with_boundary+0x1ec> 4000d7ac: 01 00 00 00 nop ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4000d7b0: e2 24 20 44 st %l1, [ %l0 + 0x44 ] 4000d7b4: 81 c7 e0 08 ret 4000d7b8: 81 e8 00 00 restore /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 4000d7bc: 08 80 00 07 bleu 4000d7d8 <_Heap_Allocate_aligned_with_boundary+0x1fc> 4000d7c0: 80 a6 a0 00 cmp %i2, 0 ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4000d7c4: b0 10 20 00 clr %i0 } return (void *) alloc_begin; } 4000d7c8: 81 c7 e0 08 ret 4000d7cc: 81 e8 00 00 restore if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000d7d0: 10 bf ff f4 b 4000d7a0 <_Heap_Allocate_aligned_with_boundary+0x1c4> 4000d7d4: b0 10 20 00 clr %i0 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4000d7d8: 22 bf ff 8b be,a 4000d604 <_Heap_Allocate_aligned_with_boundary+0x28> 4000d7dc: b4 10 00 1d mov %i5, %i2 alignment = page_size; } } while ( block != free_list_tail ) { 4000d7e0: 10 bf ff 8a b 4000d608 <_Heap_Allocate_aligned_with_boundary+0x2c> 4000d7e4: 80 a4 00 12 cmp %l0, %l2 40008de0 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40008de0: 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; 40008de4: 25 10 00 24 sethi %hi(0x40009000), %l2 40008de8: 80 8e a0 ff btst 0xff, %i2 40008dec: a4 14 a3 e0 or %l2, 0x3e0, %l2 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 40008df0: ea 06 20 10 ld [ %i0 + 0x10 ], %l5 uintptr_t const min_block_size = heap->min_block_size; 40008df4: e6 06 20 14 ld [ %i0 + 0x14 ], %l3 Heap_Block *const last_block = heap->last_block; 40008df8: 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; 40008dfc: 12 80 00 04 bne 40008e0c <_Heap_Walk+0x2c> 40008e00: e0 06 20 20 ld [ %i0 + 0x20 ], %l0 40008e04: 25 10 00 23 sethi %hi(0x40008c00), %l2 40008e08: a4 14 a1 d8 or %l2, 0x1d8, %l2 ! 40008dd8 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40008e0c: 03 10 00 85 sethi %hi(0x40021400), %g1 40008e10: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 40021610 <_System_state_Current> 40008e14: 80 a0 60 03 cmp %g1, 3 40008e18: 22 80 00 04 be,a 40008e28 <_Heap_Walk+0x48> 40008e1c: da 06 20 18 ld [ %i0 + 0x18 ], %o5 block = next_block; } return true; } 40008e20: 81 c7 e0 08 ret 40008e24: 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)( 40008e28: c6 06 20 1c ld [ %i0 + 0x1c ], %g3 40008e2c: c4 06 20 08 ld [ %i0 + 8 ], %g2 40008e30: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40008e34: 90 10 00 19 mov %i1, %o0 40008e38: c6 23 a0 5c st %g3, [ %sp + 0x5c ] 40008e3c: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40008e40: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 40008e44: e0 23 a0 60 st %l0, [ %sp + 0x60 ] 40008e48: e8 23 a0 64 st %l4, [ %sp + 0x64 ] 40008e4c: 92 10 20 00 clr %o1 40008e50: 15 10 00 79 sethi %hi(0x4001e400), %o2 40008e54: 96 10 00 15 mov %l5, %o3 40008e58: 94 12 a3 08 or %o2, 0x308, %o2 40008e5c: 9f c4 80 00 call %l2 40008e60: 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 ) { 40008e64: 80 a5 60 00 cmp %l5, 0 40008e68: 02 80 00 36 be 40008f40 <_Heap_Walk+0x160> 40008e6c: 80 8d 60 07 btst 7, %l5 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40008e70: 12 80 00 3c bne 40008f60 <_Heap_Walk+0x180> 40008e74: 90 10 00 13 mov %l3, %o0 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40008e78: 7f ff e3 13 call 40001ac4 <.urem> 40008e7c: 92 10 00 15 mov %l5, %o1 40008e80: 80 a2 20 00 cmp %o0, 0 40008e84: 12 80 00 40 bne 40008f84 <_Heap_Walk+0x1a4> 40008e88: 90 04 20 08 add %l0, 8, %o0 ); return false; } if ( 40008e8c: 7f ff e3 0e call 40001ac4 <.urem> 40008e90: 92 10 00 15 mov %l5, %o1 40008e94: 80 a2 20 00 cmp %o0, 0 40008e98: 32 80 00 44 bne,a 40008fa8 <_Heap_Walk+0x1c8> 40008e9c: 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; 40008ea0: ec 04 20 04 ld [ %l0 + 4 ], %l6 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40008ea4: ae 8d a0 01 andcc %l6, 1, %l7 40008ea8: 22 80 00 48 be,a 40008fc8 <_Heap_Walk+0x1e8> 40008eac: 90 10 00 19 mov %i1, %o0 ); return false; } if ( first_block->prev_size != page_size ) { 40008eb0: d6 04 00 00 ld [ %l0 ], %o3 40008eb4: 80 a5 40 0b cmp %l5, %o3 40008eb8: 32 80 00 1a bne,a 40008f20 <_Heap_Walk+0x140> 40008ebc: 90 10 00 19 mov %i1, %o0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40008ec0: c2 05 20 04 ld [ %l4 + 4 ], %g1 40008ec4: 82 08 7f fe and %g1, -2, %g1 40008ec8: 82 05 00 01 add %l4, %g1, %g1 40008ecc: c2 00 60 04 ld [ %g1 + 4 ], %g1 40008ed0: 80 88 60 01 btst 1, %g1 40008ed4: 22 80 01 23 be,a 40009360 <_Heap_Walk+0x580> 40008ed8: 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; 40008edc: 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 ) { 40008ee0: 80 a6 00 11 cmp %i0, %l1 40008ee4: 02 80 00 6f be 400090a0 <_Heap_Walk+0x2c0> 40008ee8: 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; 40008eec: 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 40008ef0: 80 a7 00 11 cmp %i4, %l1 40008ef4: 28 80 00 3c bleu,a 40008fe4 <_Heap_Walk+0x204> 40008ef8: f6 06 20 24 ld [ %i0 + 0x24 ], %i3 if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 40008efc: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 40008f00: 96 10 00 11 mov %l1, %o3 40008f04: 92 10 20 01 mov 1, %o1 40008f08: 15 10 00 7a sethi %hi(0x4001e800), %o2 40008f0c: b0 10 20 00 clr %i0 40008f10: 9f c4 80 00 call %l2 40008f14: 94 12 a0 b0 or %o2, 0xb0, %o2 40008f18: 81 c7 e0 08 ret 40008f1c: 81 e8 00 00 restore return false; } if ( first_block->prev_size != page_size ) { (*printer)( 40008f20: 98 10 00 15 mov %l5, %o4 40008f24: 92 10 20 01 mov 1, %o1 40008f28: 15 10 00 7a sethi %hi(0x4001e800), %o2 40008f2c: b0 10 20 00 clr %i0 40008f30: 9f c4 80 00 call %l2 40008f34: 94 12 a0 68 or %o2, 0x68, %o2 40008f38: 81 c7 e0 08 ret 40008f3c: 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" ); 40008f40: 90 10 00 19 mov %i1, %o0 40008f44: 92 10 20 01 mov 1, %o1 40008f48: 15 10 00 79 sethi %hi(0x4001e400), %o2 40008f4c: b0 10 20 00 clr %i0 40008f50: 9f c4 80 00 call %l2 40008f54: 94 12 a3 a0 or %o2, 0x3a0, %o2 40008f58: 81 c7 e0 08 ret 40008f5c: 81 e8 00 00 restore return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 40008f60: 90 10 00 19 mov %i1, %o0 40008f64: 96 10 00 15 mov %l5, %o3 40008f68: 92 10 20 01 mov 1, %o1 40008f6c: 15 10 00 79 sethi %hi(0x4001e400), %o2 40008f70: b0 10 20 00 clr %i0 40008f74: 9f c4 80 00 call %l2 40008f78: 94 12 a3 b8 or %o2, 0x3b8, %o2 40008f7c: 81 c7 e0 08 ret 40008f80: 81 e8 00 00 restore return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 40008f84: 90 10 00 19 mov %i1, %o0 40008f88: 96 10 00 13 mov %l3, %o3 40008f8c: 92 10 20 01 mov 1, %o1 40008f90: 15 10 00 79 sethi %hi(0x4001e400), %o2 40008f94: b0 10 20 00 clr %i0 40008f98: 9f c4 80 00 call %l2 40008f9c: 94 12 a3 d8 or %o2, 0x3d8, %o2 40008fa0: 81 c7 e0 08 ret 40008fa4: 81 e8 00 00 restore } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40008fa8: 96 10 00 10 mov %l0, %o3 40008fac: 92 10 20 01 mov 1, %o1 40008fb0: 15 10 00 7a sethi %hi(0x4001e800), %o2 40008fb4: b0 10 20 00 clr %i0 40008fb8: 9f c4 80 00 call %l2 40008fbc: 94 12 a0 00 mov %o2, %o2 40008fc0: 81 c7 e0 08 ret 40008fc4: 81 e8 00 00 restore return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 40008fc8: 92 10 20 01 mov 1, %o1 40008fcc: 15 10 00 7a sethi %hi(0x4001e800), %o2 40008fd0: b0 10 20 00 clr %i0 40008fd4: 9f c4 80 00 call %l2 40008fd8: 94 12 a0 38 or %o2, 0x38, %o2 40008fdc: 81 c7 e0 08 ret 40008fe0: 81 e8 00 00 restore 40008fe4: 80 a6 c0 11 cmp %i3, %l1 40008fe8: 0a bf ff c6 bcs 40008f00 <_Heap_Walk+0x120> 40008fec: 90 10 00 19 mov %i1, %o0 ); return false; } if ( 40008ff0: 90 04 60 08 add %l1, 8, %o0 40008ff4: 7f ff e2 b4 call 40001ac4 <.urem> 40008ff8: 92 10 00 1a mov %i2, %o1 40008ffc: 80 a2 20 00 cmp %o0, 0 40009000: 12 80 00 df bne 4000937c <_Heap_Walk+0x59c> 40009004: 90 10 00 19 mov %i1, %o0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009008: c2 04 60 04 ld [ %l1 + 4 ], %g1 4000900c: 82 08 7f fe and %g1, -2, %g1 40009010: 82 04 40 01 add %l1, %g1, %g1 40009014: c2 00 60 04 ld [ %g1 + 4 ], %g1 40009018: 80 88 60 01 btst 1, %g1 4000901c: 12 80 00 ea bne 400093c4 <_Heap_Walk+0x5e4> 40009020: 96 10 00 11 mov %l1, %o3 ); return false; } if ( free_block->prev != prev_block ) { 40009024: d8 04 60 0c ld [ %l1 + 0xc ], %o4 40009028: 80 a6 00 0c cmp %i0, %o4 4000902c: 02 80 00 19 be 40009090 <_Heap_Walk+0x2b0> 40009030: ba 10 00 11 mov %l1, %i5 40009034: 30 80 00 dc b,a 400093a4 <_Heap_Walk+0x5c4> <== NOT EXECUTED 40009038: 0a bf ff b2 bcs 40008f00 <_Heap_Walk+0x120> 4000903c: 90 10 00 19 mov %i1, %o0 40009040: 80 a6 c0 11 cmp %i3, %l1 40009044: 0a bf ff b0 bcs 40008f04 <_Heap_Walk+0x124> 40009048: 96 10 00 11 mov %l1, %o3 ); return false; } if ( 4000904c: 90 04 60 08 add %l1, 8, %o0 40009050: 7f ff e2 9d call 40001ac4 <.urem> 40009054: 92 10 00 1a mov %i2, %o1 40009058: 80 a2 20 00 cmp %o0, 0 4000905c: 32 80 00 c8 bne,a 4000937c <_Heap_Walk+0x59c> 40009060: 90 10 00 19 mov %i1, %o0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009064: c2 04 60 04 ld [ %l1 + 4 ], %g1 40009068: 82 08 7f fe and %g1, -2, %g1 4000906c: 82 00 40 11 add %g1, %l1, %g1 40009070: c2 00 60 04 ld [ %g1 + 4 ], %g1 40009074: 80 88 60 01 btst 1, %g1 40009078: 32 80 00 d2 bne,a 400093c0 <_Heap_Walk+0x5e0> 4000907c: 90 10 00 19 mov %i1, %o0 ); return false; } if ( free_block->prev != prev_block ) { 40009080: d8 04 60 0c ld [ %l1 + 0xc ], %o4 40009084: 80 a3 00 1d cmp %o4, %i5 40009088: 12 80 00 c5 bne 4000939c <_Heap_Walk+0x5bc> 4000908c: ba 10 00 11 mov %l1, %i5 return false; } prev_block = free_block; free_block = free_block->next; 40009090: 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 ) { 40009094: 80 a6 00 11 cmp %i0, %l1 40009098: 12 bf ff e8 bne 40009038 <_Heap_Walk+0x258> 4000909c: 80 a4 40 1c cmp %l1, %i4 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 400090a0: 80 a5 00 10 cmp %l4, %l0 400090a4: 02 bf ff 5f be 40008e20 <_Heap_Walk+0x40> 400090a8: 37 10 00 7a sethi %hi(0x4001e800), %i3 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 400090ac: 35 10 00 7a sethi %hi(0x4001e800), %i2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 400090b0: 39 10 00 7a sethi %hi(0x4001e800), %i4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 400090b4: 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)( 400090b8: b6 16 e1 58 or %i3, 0x158, %i3 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 400090bc: b4 16 a1 70 or %i2, 0x170, %i2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 400090c0: b8 17 23 08 or %i4, 0x308, %i4 400090c4: 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; 400090c8: 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 ) { 400090cc: 80 a5 e0 00 cmp %l7, 0 400090d0: 02 80 00 16 be 40009128 <_Heap_Walk+0x348> 400090d4: a2 05 80 10 add %l6, %l0, %l1 (*printer)( 400090d8: 90 10 00 19 mov %i1, %o0 400090dc: 92 10 20 00 clr %o1 400090e0: 94 10 00 1b mov %i3, %o2 400090e4: 96 10 00 10 mov %l0, %o3 400090e8: 9f c4 80 00 call %l2 400090ec: 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 400090f0: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 400090f4: 80 a0 40 11 cmp %g1, %l1 400090f8: 28 80 00 18 bleu,a 40009158 <_Heap_Walk+0x378> 400090fc: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 40009100: 90 10 00 19 mov %i1, %o0 <== NOT EXECUTED 40009104: 96 10 00 10 mov %l0, %o3 40009108: 98 10 00 11 mov %l1, %o4 4000910c: 92 10 20 01 mov 1, %o1 40009110: 15 10 00 7a sethi %hi(0x4001e800), %o2 40009114: b0 10 20 00 clr %i0 40009118: 9f c4 80 00 call %l2 4000911c: 94 12 a1 98 or %o2, 0x198, %o2 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 40009120: 81 c7 e0 08 ret 40009124: 81 e8 00 00 restore "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40009128: da 04 00 00 ld [ %l0 ], %o5 4000912c: 90 10 00 19 mov %i1, %o0 40009130: 92 10 20 00 clr %o1 40009134: 94 10 00 1a mov %i2, %o2 40009138: 96 10 00 10 mov %l0, %o3 4000913c: 9f c4 80 00 call %l2 40009140: 98 10 00 16 mov %l6, %o4 40009144: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 40009148: 80 a0 40 11 cmp %g1, %l1 4000914c: 18 bf ff ee bgu 40009104 <_Heap_Walk+0x324> 40009150: 90 10 00 19 mov %i1, %o0 40009154: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 40009158: 80 a0 40 11 cmp %g1, %l1 4000915c: 0a bf ff ea bcs 40009104 <_Heap_Walk+0x324> 40009160: 90 10 00 19 mov %i1, %o0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 40009164: 90 10 00 16 mov %l6, %o0 40009168: 7f ff e2 57 call 40001ac4 <.urem> 4000916c: 92 10 00 1d mov %i5, %o1 40009170: 80 a2 20 00 cmp %o0, 0 40009174: 12 80 00 5d bne 400092e8 <_Heap_Walk+0x508> 40009178: 80 a4 c0 16 cmp %l3, %l6 ); return false; } if ( block_size < min_block_size ) { 4000917c: 18 80 00 65 bgu 40009310 <_Heap_Walk+0x530> 40009180: 80 a4 00 11 cmp %l0, %l1 ); return false; } if ( next_block_begin <= block_begin ) { 40009184: 3a 80 00 6e bcc,a 4000933c <_Heap_Walk+0x55c> 40009188: 90 10 00 19 mov %i1, %o0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4000918c: c2 04 60 04 ld [ %l1 + 4 ], %g1 40009190: 80 88 60 01 btst 1, %g1 40009194: 12 80 00 40 bne 40009294 <_Heap_Walk+0x4b4> 40009198: 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; 4000919c: 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)( 400091a0: 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; 400091a4: 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; 400091a8: 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; 400091ac: 1b 10 00 7a sethi %hi(0x4001e800), %o5 400091b0: 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; 400091b4: 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); 400091b8: 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; 400091bc: 02 80 00 07 be 400091d8 <_Heap_Walk+0x3f8> 400091c0: 9a 13 62 60 or %o5, 0x260, %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)" : ""), 400091c4: 1b 10 00 7a sethi %hi(0x4001e800), %o5 400091c8: 80 a3 00 18 cmp %o4, %i0 400091cc: 02 80 00 03 be 400091d8 <_Heap_Walk+0x3f8> 400091d0: 9a 13 62 70 or %o5, 0x270, %o5 400091d4: 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)( 400091d8: c2 04 20 08 ld [ %l0 + 8 ], %g1 400091dc: 05 10 00 7a sethi %hi(0x4001e800), %g2 400091e0: 80 a0 c0 01 cmp %g3, %g1 400091e4: 02 80 00 07 be 40009200 <_Heap_Walk+0x420> 400091e8: 84 10 a2 80 or %g2, 0x280, %g2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 400091ec: 05 10 00 7a sethi %hi(0x4001e800), %g2 400091f0: 80 a0 40 18 cmp %g1, %i0 400091f4: 02 80 00 03 be 40009200 <_Heap_Walk+0x420> 400091f8: 84 10 a2 90 or %g2, 0x290, %g2 400091fc: 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)( 40009200: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40009204: c4 23 a0 60 st %g2, [ %sp + 0x60 ] 40009208: 90 10 00 19 mov %i1, %o0 4000920c: 92 10 20 00 clr %o1 40009210: 15 10 00 7a sethi %hi(0x4001e800), %o2 40009214: 96 10 00 10 mov %l0, %o3 40009218: 9f c4 80 00 call %l2 4000921c: 94 12 a2 a0 or %o2, 0x2a0, %o2 block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 40009220: da 05 c0 00 ld [ %l7 ], %o5 40009224: 80 a5 80 0d cmp %l6, %o5 40009228: 02 80 00 0c be 40009258 <_Heap_Walk+0x478> 4000922c: 90 10 00 19 mov %i1, %o0 (*printer)( 40009230: ee 23 a0 5c st %l7, [ %sp + 0x5c ] 40009234: 96 10 00 10 mov %l0, %o3 40009238: 98 10 00 16 mov %l6, %o4 4000923c: 92 10 20 01 mov 1, %o1 40009240: 15 10 00 7a sethi %hi(0x4001e800), %o2 40009244: b0 10 20 00 clr %i0 40009248: 9f c4 80 00 call %l2 4000924c: 94 12 a2 d0 or %o2, 0x2d0, %o2 40009250: 81 c7 e0 08 ret 40009254: 81 e8 00 00 restore ); return false; } if ( !prev_used ) { 40009258: 80 8d 20 01 btst 1, %l4 4000925c: 02 80 00 1c be 400092cc <_Heap_Walk+0x4ec> 40009260: 96 10 00 10 mov %l0, %o3 40009264: 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 ) { 40009268: 80 a0 40 18 cmp %g1, %i0 4000926c: 12 80 00 07 bne 40009288 <_Heap_Walk+0x4a8> 40009270: 80 a0 40 10 cmp %g1, %l0 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40009274: 10 80 00 0f b 400092b0 <_Heap_Walk+0x4d0> <== NOT EXECUTED 40009278: 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 ) { 4000927c: 80 a0 40 18 cmp %g1, %i0 40009280: 02 80 00 0a be 400092a8 <_Heap_Walk+0x4c8> 40009284: 80 a0 40 10 cmp %g1, %l0 if ( free_block == block ) { 40009288: 32 bf ff fd bne,a 4000927c <_Heap_Walk+0x49c> 4000928c: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 40009290: 80 a5 40 11 cmp %l5, %l1 40009294: 02 bf fe e3 be 40008e20 <_Heap_Walk+0x40> 40009298: 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 ) { 4000929c: ec 04 60 04 ld [ %l1 + 4 ], %l6 400092a0: 10 bf ff 8a b 400090c8 <_Heap_Walk+0x2e8> 400092a4: ae 0d a0 01 and %l6, 1, %l7 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 400092a8: 90 10 00 19 mov %i1, %o0 400092ac: 96 10 00 10 mov %l0, %o3 400092b0: 92 10 20 01 mov 1, %o1 400092b4: 15 10 00 7a sethi %hi(0x4001e800), %o2 400092b8: b0 10 20 00 clr %i0 400092bc: 9f c4 80 00 call %l2 400092c0: 94 12 a3 40 or %o2, 0x340, %o2 400092c4: 81 c7 e0 08 ret 400092c8: 81 e8 00 00 restore return false; } if ( !prev_used ) { (*printer)( 400092cc: 92 10 20 01 mov 1, %o1 400092d0: 15 10 00 7a sethi %hi(0x4001e800), %o2 400092d4: b0 10 20 00 clr %i0 400092d8: 9f c4 80 00 call %l2 400092dc: 94 12 a3 10 or %o2, 0x310, %o2 400092e0: 81 c7 e0 08 ret 400092e4: 81 e8 00 00 restore return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 400092e8: 90 10 00 19 mov %i1, %o0 400092ec: 96 10 00 10 mov %l0, %o3 400092f0: 98 10 00 16 mov %l6, %o4 400092f4: 92 10 20 01 mov 1, %o1 400092f8: 15 10 00 7a sethi %hi(0x4001e800), %o2 400092fc: b0 10 20 00 clr %i0 40009300: 9f c4 80 00 call %l2 40009304: 94 12 a1 c8 or %o2, 0x1c8, %o2 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 40009308: 81 c7 e0 08 ret 4000930c: 81 e8 00 00 restore } if ( block_size < min_block_size ) { (*printer)( 40009310: 90 10 00 19 mov %i1, %o0 40009314: 96 10 00 10 mov %l0, %o3 40009318: 98 10 00 16 mov %l6, %o4 4000931c: 9a 10 00 13 mov %l3, %o5 40009320: 92 10 20 01 mov 1, %o1 40009324: 15 10 00 7a sethi %hi(0x4001e800), %o2 40009328: b0 10 20 00 clr %i0 4000932c: 9f c4 80 00 call %l2 40009330: 94 12 a1 f8 or %o2, 0x1f8, %o2 block, block_size, min_block_size ); return false; 40009334: 81 c7 e0 08 ret 40009338: 81 e8 00 00 restore } if ( next_block_begin <= block_begin ) { (*printer)( 4000933c: 96 10 00 10 mov %l0, %o3 40009340: 98 10 00 11 mov %l1, %o4 40009344: 92 10 20 01 mov 1, %o1 40009348: 15 10 00 7a sethi %hi(0x4001e800), %o2 4000934c: b0 10 20 00 clr %i0 40009350: 9f c4 80 00 call %l2 40009354: 94 12 a2 28 or %o2, 0x228, %o2 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 40009358: 81 c7 e0 08 ret 4000935c: 81 e8 00 00 restore return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 40009360: 92 10 20 01 mov 1, %o1 40009364: 15 10 00 7a sethi %hi(0x4001e800), %o2 40009368: b0 10 20 00 clr %i0 4000936c: 9f c4 80 00 call %l2 40009370: 94 12 a0 98 or %o2, 0x98, %o2 40009374: 81 c7 e0 08 ret 40009378: 81 e8 00 00 restore } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 4000937c: 96 10 00 11 mov %l1, %o3 40009380: 92 10 20 01 mov 1, %o1 40009384: 15 10 00 7a sethi %hi(0x4001e800), %o2 40009388: b0 10 20 00 clr %i0 4000938c: 9f c4 80 00 call %l2 40009390: 94 12 a0 d0 or %o2, 0xd0, %o2 40009394: 81 c7 e0 08 ret 40009398: 81 e8 00 00 restore return false; } if ( free_block->prev != prev_block ) { (*printer)( 4000939c: 90 10 00 19 mov %i1, %o0 400093a0: 96 10 00 11 mov %l1, %o3 400093a4: 92 10 20 01 mov 1, %o1 400093a8: 15 10 00 7a sethi %hi(0x4001e800), %o2 400093ac: b0 10 20 00 clr %i0 400093b0: 9f c4 80 00 call %l2 400093b4: 94 12 a1 20 or %o2, 0x120, %o2 400093b8: 81 c7 e0 08 ret 400093bc: 81 e8 00 00 restore return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 400093c0: 96 10 00 11 mov %l1, %o3 400093c4: 92 10 20 01 mov 1, %o1 400093c8: 15 10 00 7a sethi %hi(0x4001e800), %o2 400093cc: b0 10 20 00 clr %i0 400093d0: 9f c4 80 00 call %l2 400093d4: 94 12 a1 00 or %o2, 0x100, %o2 400093d8: 81 c7 e0 08 ret 400093dc: 81 e8 00 00 restore 4000811c <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 4000811c: 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 ) 40008120: e8 06 20 34 ld [ %i0 + 0x34 ], %l4 40008124: 80 a5 20 00 cmp %l4, 0 40008128: 02 80 00 ab be 400083d4 <_Objects_Extend_information+0x2b8> 4000812c: e6 16 20 0a lduh [ %i0 + 0xa ], %l3 block_count = 0; else { block_count = information->maximum / information->allocation_size; 40008130: ea 16 20 10 lduh [ %i0 + 0x10 ], %l5 40008134: e4 16 20 14 lduh [ %i0 + 0x14 ], %l2 40008138: ab 2d 60 10 sll %l5, 0x10, %l5 4000813c: 92 10 00 12 mov %l2, %o1 40008140: 40 00 47 5b call 40019eac <.udiv> 40008144: 91 35 60 10 srl %l5, 0x10, %o0 40008148: 91 2a 20 10 sll %o0, 0x10, %o0 4000814c: b9 32 20 10 srl %o0, 0x10, %i4 for ( ; block < block_count; block++ ) { 40008150: 80 a7 20 00 cmp %i4, 0 40008154: 02 80 00 a7 be 400083f0 <_Objects_Extend_information+0x2d4> 40008158: 90 10 00 12 mov %l2, %o0 if ( information->object_blocks[ block ] == NULL ) 4000815c: c2 05 00 00 ld [ %l4 ], %g1 40008160: 80 a0 60 00 cmp %g1, 0 40008164: 02 80 00 a4 be 400083f4 <_Objects_Extend_information+0x2d8> 40008168: a2 10 00 13 mov %l3, %l1 4000816c: 10 80 00 06 b 40008184 <_Objects_Extend_information+0x68> 40008170: a0 10 20 00 clr %l0 40008174: c2 05 00 01 ld [ %l4 + %g1 ], %g1 40008178: 80 a0 60 00 cmp %g1, 0 4000817c: 22 80 00 08 be,a 4000819c <_Objects_Extend_information+0x80> 40008180: 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++ ) { 40008184: a0 04 20 01 inc %l0 if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size; 40008188: 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++ ) { 4000818c: 80 a7 00 10 cmp %i4, %l0 40008190: 18 bf ff f9 bgu 40008174 <_Objects_Extend_information+0x58> 40008194: 83 2c 20 02 sll %l0, 2, %g1 else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 40008198: 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 ) { 4000819c: 03 00 00 3f sethi %hi(0xfc00), %g1 else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 400081a0: 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 ) { 400081a4: 82 10 63 ff or %g1, 0x3ff, %g1 400081a8: 80 a5 40 01 cmp %l5, %g1 400081ac: 18 80 00 96 bgu 40008404 <_Objects_Extend_information+0x2e8> 400081b0: 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; 400081b4: 40 00 47 04 call 40019dc4 <.umul> 400081b8: d2 06 20 18 ld [ %i0 + 0x18 ], %o1 if ( information->auto_extend ) { 400081bc: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1 400081c0: 80 a0 60 00 cmp %g1, 0 400081c4: 12 80 00 6d bne 40008378 <_Objects_Extend_information+0x25c> 400081c8: 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 ); 400081cc: 40 00 08 bd call 4000a4c0 <_Workspace_Allocate_or_fatal_error> 400081d0: 01 00 00 00 nop 400081d4: 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 ) { 400081d8: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 400081dc: 80 a4 40 01 cmp %l1, %g1 400081e0: 2a 80 00 43 bcs,a 400082ec <_Objects_Extend_information+0x1d0> 400081e4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 */ /* * Up the block count and maximum */ block_count++; 400081e8: 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 ); 400081ec: 91 2d 20 01 sll %l4, 1, %o0 400081f0: 90 02 00 14 add %o0, %l4, %o0 400081f4: 90 05 40 08 add %l5, %o0, %o0 400081f8: 90 02 00 13 add %o0, %l3, %o0 400081fc: 40 00 08 c0 call 4000a4fc <_Workspace_Allocate> 40008200: 91 2a 20 02 sll %o0, 2, %o0 if ( !object_blocks ) { 40008204: ac 92 20 00 orcc %o0, 0, %l6 40008208: 02 80 00 7d be 400083fc <_Objects_Extend_information+0x2e0> 4000820c: 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 ) { 40008210: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40008214: 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); 40008218: ae 05 80 14 add %l6, %l4, %l7 4000821c: 0a 80 00 5e bcs 40008394 <_Objects_Extend_information+0x278> 40008220: 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++ ) { 40008224: 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, 40008228: 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++ ) { 4000822c: 02 80 00 08 be 4000824c <_Objects_Extend_information+0x130> 40008230: bb 2f 20 02 sll %i4, 2, %i5 local_table[ index ] = NULL; 40008234: 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++ ) { 40008238: 82 00 60 01 inc %g1 4000823c: 80 a4 c0 01 cmp %l3, %g1 40008240: 18 bf ff fd bgu 40008234 <_Objects_Extend_information+0x118> 40008244: c0 20 80 14 clr [ %g2 + %l4 ] 40008248: 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 ); 4000824c: 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; 40008250: c0 25 c0 1d clr [ %l7 + %i5 ] for ( index=index_base ; index < ( information->allocation_size + index_base ); 40008254: 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 ; 40008258: 80 a4 40 03 cmp %l1, %g3 4000825c: 1a 80 00 0a bcc 40008284 <_Objects_Extend_information+0x168> 40008260: c0 25 80 1d clr [ %l6 + %i5 ] 40008264: 85 2c 60 02 sll %l1, 2, %g2 40008268: 82 10 00 11 mov %l1, %g1 4000826c: 84 05 00 02 add %l4, %g2, %g2 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 40008270: 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++ ) { 40008274: 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 ; 40008278: 80 a0 40 03 cmp %g1, %g3 4000827c: 0a bf ff fd bcs 40008270 <_Objects_Extend_information+0x154> 40008280: 84 00 a0 04 add %g2, 4, %g2 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 40008284: 7f ff e6 e4 call 40001e14 40008288: 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( 4000828c: c6 06 00 00 ld [ %i0 ], %g3 40008290: 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; 40008294: ea 36 20 10 sth %l5, [ %i0 + 0x10 ] local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 40008298: e6 06 20 34 ld [ %i0 + 0x34 ], %l3 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 4000829c: ee 26 20 30 st %l7, [ %i0 + 0x30 ] information->local_table = local_table; 400082a0: e8 26 20 1c st %l4, [ %i0 + 0x1c ] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 400082a4: 87 28 e0 18 sll %g3, 0x18, %g3 400082a8: 85 28 a0 1b sll %g2, 0x1b, %g2 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 400082ac: 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( 400082b0: ab 2d 60 10 sll %l5, 0x10, %l5 400082b4: 03 00 00 40 sethi %hi(0x10000), %g1 400082b8: ab 35 60 10 srl %l5, 0x10, %l5 400082bc: 82 10 c0 01 or %g3, %g1, %g1 400082c0: 82 10 40 02 or %g1, %g2, %g1 400082c4: 82 10 40 15 or %g1, %l5, %g1 400082c8: c2 26 20 0c st %g1, [ %i0 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 400082cc: 7f ff e6 d6 call 40001e24 400082d0: 01 00 00 00 nop if ( old_tables ) 400082d4: 80 a4 e0 00 cmp %l3, 0 400082d8: 22 80 00 05 be,a 400082ec <_Objects_Extend_information+0x1d0> 400082dc: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 _Workspace_Free( old_tables ); 400082e0: 40 00 08 90 call 4000a520 <_Workspace_Free> 400082e4: 90 10 00 13 mov %l3, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 400082e8: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 400082ec: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2 400082f0: d6 06 20 18 ld [ %i0 + 0x18 ], %o3 400082f4: 92 10 00 12 mov %l2, %o1 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 400082f8: a1 2c 20 02 sll %l0, 2, %l0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 400082fc: 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; 40008300: 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( 40008304: 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( 40008308: a4 07 bf f4 add %fp, -12, %l2 4000830c: 40 00 14 09 call 4000d330 <_Chain_Initialize> 40008310: 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 ) { 40008314: 30 80 00 0c b,a 40008344 <_Objects_Extend_information+0x228> the_object->id = _Objects_Build_id( 40008318: c4 16 20 04 lduh [ %i0 + 4 ], %g2 4000831c: 83 28 60 18 sll %g1, 0x18, %g1 40008320: 85 28 a0 1b sll %g2, 0x1b, %g2 40008324: 82 10 40 14 or %g1, %l4, %g1 40008328: 82 10 40 02 or %g1, %g2, %g1 4000832c: 82 10 40 11 or %g1, %l1, %g1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40008330: 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( 40008334: c2 22 20 08 st %g1, [ %o0 + 8 ] index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 40008338: a2 04 60 01 inc %l1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 4000833c: 7f ff fc e2 call 400076c4 <_Chain_Append> 40008340: 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 ) { 40008344: 40 00 13 e8 call 4000d2e4 <_Chain_Get> 40008348: 90 10 00 12 mov %l2, %o0 4000834c: 80 a2 20 00 cmp %o0, 0 40008350: 32 bf ff f2 bne,a 40008318 <_Objects_Extend_information+0x1fc> 40008354: c2 06 00 00 ld [ %i0 ], %g1 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 40008358: c2 16 20 2c lduh [ %i0 + 0x2c ], %g1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4000835c: c8 16 20 14 lduh [ %i0 + 0x14 ], %g4 40008360: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 information->inactive = 40008364: 82 01 00 01 add %g4, %g1, %g1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40008368: c8 20 80 10 st %g4, [ %g2 + %l0 ] information->inactive = 4000836c: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] 40008370: 81 c7 e0 08 ret 40008374: 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 ); 40008378: 40 00 08 61 call 4000a4fc <_Workspace_Allocate> 4000837c: 01 00 00 00 nop if ( !new_object_block ) 40008380: a4 92 20 00 orcc %o0, 0, %l2 40008384: 32 bf ff 96 bne,a 400081dc <_Objects_Extend_information+0xc0> 40008388: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 4000838c: 81 c7 e0 08 ret 40008390: 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, 40008394: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 40008398: 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, 4000839c: 40 00 23 6e call 40011154 400083a0: 94 10 00 1d mov %i5, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 400083a4: d2 06 20 30 ld [ %i0 + 0x30 ], %o1 400083a8: 94 10 00 1d mov %i5, %o2 400083ac: 40 00 23 6a call 40011154 400083b0: 90 10 00 17 mov %l7, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 400083b4: d4 16 20 10 lduh [ %i0 + 0x10 ], %o2 400083b8: d2 06 20 1c ld [ %i0 + 0x1c ], %o1 400083bc: 94 04 c0 0a add %l3, %o2, %o2 400083c0: 90 10 00 14 mov %l4, %o0 400083c4: 40 00 23 64 call 40011154 400083c8: 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 ); 400083cc: 10 bf ff a1 b 40008250 <_Objects_Extend_information+0x134> 400083d0: 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 ) 400083d4: ea 16 20 10 lduh [ %i0 + 0x10 ], %l5 400083d8: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0 400083dc: ab 2d 60 10 sll %l5, 0x10, %l5 400083e0: a2 10 00 13 mov %l3, %l1 400083e4: a0 10 20 00 clr %l0 400083e8: 10 bf ff 6c b 40008198 <_Objects_Extend_information+0x7c> 400083ec: 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 ) 400083f0: a2 10 00 13 mov %l3, %l1 <== NOT EXECUTED 400083f4: 10 bf ff 69 b 40008198 <_Objects_Extend_information+0x7c> <== NOT EXECUTED 400083f8: 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 ); 400083fc: 40 00 08 49 call 4000a520 <_Workspace_Free> 40008400: 90 10 00 12 mov %l2, %o0 return; 40008404: 81 c7 e0 08 ret 40008408: 81 e8 00 00 restore 40008824 <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { 40008824: 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 ); 40008828: e0 16 20 0a lduh [ %i0 + 0xa ], %l0 block_count = (information->maximum - index_base) / 4000882c: e2 16 20 14 lduh [ %i0 + 0x14 ], %l1 40008830: d0 16 20 10 lduh [ %i0 + 0x10 ], %o0 40008834: 92 10 00 11 mov %l1, %o1 40008838: 40 00 45 9d call 40019eac <.udiv> 4000883c: 90 22 00 10 sub %o0, %l0, %o0 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 40008840: 80 a2 20 00 cmp %o0, 0 40008844: 02 80 00 12 be 4000888c <_Objects_Shrink_information+0x68> 40008848: a4 10 20 04 mov 4, %l2 if ( information->inactive_per_block[ block ] == 4000884c: c6 06 20 30 ld [ %i0 + 0x30 ], %g3 40008850: c4 00 c0 00 ld [ %g3 ], %g2 40008854: 80 a4 40 02 cmp %l1, %g2 40008858: 12 80 00 09 bne 4000887c <_Objects_Shrink_information+0x58> 4000885c: 82 10 20 00 clr %g1 40008860: 10 80 00 0d b 40008894 <_Objects_Shrink_information+0x70> <== NOT EXECUTED 40008864: a4 10 20 00 clr %l2 <== NOT EXECUTED information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 40008868: 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 ] == 4000886c: 80 a4 40 02 cmp %l1, %g2 40008870: 02 80 00 09 be 40008894 <_Objects_Shrink_information+0x70> 40008874: 84 04 a0 04 add %l2, 4, %g2 40008878: 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++ ) { 4000887c: 82 00 60 01 inc %g1 40008880: 80 a2 00 01 cmp %o0, %g1 40008884: 38 bf ff f9 bgu,a 40008868 <_Objects_Shrink_information+0x44> 40008888: c4 00 c0 12 ld [ %g3 + %l2 ], %g2 4000888c: 81 c7 e0 08 ret 40008890: 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; 40008894: 10 80 00 06 b 400088ac <_Objects_Shrink_information+0x88> 40008898: 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 ); 4000889c: 80 a4 60 00 cmp %l1, 0 400088a0: 22 80 00 12 be,a 400088e8 <_Objects_Shrink_information+0xc4> 400088a4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 400088a8: 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 ); 400088ac: 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) && 400088b0: 80 a0 40 10 cmp %g1, %l0 400088b4: 0a bf ff fa bcs 4000889c <_Objects_Shrink_information+0x78> 400088b8: e2 02 00 00 ld [ %o0 ], %l1 (index < (index_base + information->allocation_size))) { 400088bc: c4 16 20 14 lduh [ %i0 + 0x14 ], %g2 400088c0: 84 04 00 02 add %l0, %g2, %g2 400088c4: 80 a0 40 02 cmp %g1, %g2 400088c8: 1a bf ff f6 bcc 400088a0 <_Objects_Shrink_information+0x7c> 400088cc: 80 a4 60 00 cmp %l1, 0 _Chain_Extract( &extract_me->Node ); 400088d0: 40 00 12 7b call 4000d2bc <_Chain_Extract> 400088d4: 01 00 00 00 nop } } while ( the_object ); 400088d8: 80 a4 60 00 cmp %l1, 0 400088dc: 12 bf ff f4 bne 400088ac <_Objects_Shrink_information+0x88> 400088e0: 90 10 00 11 mov %l1, %o0 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 400088e4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 <== NOT EXECUTED 400088e8: 40 00 07 0e call 4000a520 <_Workspace_Free> 400088ec: d0 00 40 12 ld [ %g1 + %l2 ], %o0 information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 400088f0: 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; 400088f4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 information->inactive_per_block[ block ] = 0; 400088f8: c8 06 20 30 ld [ %i0 + 0x30 ], %g4 information->inactive -= information->allocation_size; 400088fc: 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; 40008900: c0 21 00 12 clr [ %g4 + %l2 ] information->inactive -= information->allocation_size; 40008904: 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; 40008908: c0 20 40 12 clr [ %g1 + %l2 ] information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 4000890c: c4 36 20 2c sth %g2, [ %i0 + 0x2c ] return; 40008910: 81 c7 e0 08 ret 40008914: 81 e8 00 00 restore 4000cae0 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000cae0: 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); 4000cae4: c6 00 a0 88 ld [ %g2 + 0x88 ], %g3 4000cae8: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000caec: d2 08 a1 d4 ldub [ %g2 + 0x1d4 ], %o1 ! 4001e1d4 */ #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 ) { 4000caf0: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000caf4: 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 */ 4000caf8: 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; 4000cafc: 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 ) { 4000cb00: 80 a0 a0 00 cmp %g2, 0 4000cb04: 12 80 00 06 bne 4000cb1c <_POSIX_Threads_Sporadic_budget_callout+0x3c> 4000cb08: 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 ) { 4000cb0c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000cb10: 80 a0 40 09 cmp %g1, %o1 4000cb14: 0a 80 00 04 bcs 4000cb24 <_POSIX_Threads_Sporadic_budget_callout+0x44> 4000cb18: 94 10 20 01 mov 1, %o2 4000cb1c: 81 c3 e0 08 retl <== NOT EXECUTED 4000cb20: 01 00 00 00 nop <== NOT EXECUTED _Thread_Change_priority( the_thread, new_priority, true ); 4000cb24: 82 13 c0 00 mov %o7, %g1 4000cb28: 7f ff ef 95 call 4000897c <_Thread_Change_priority> 4000cb2c: 9e 10 40 00 mov %g1, %o7 4000cb30: 01 00 00 00 nop 40006e94 <_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) { 40006e94: 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; 40006e98: c4 06 60 68 ld [ %i1 + 0x68 ], %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40006e9c: 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; 40006ea0: 84 00 a0 01 inc %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40006ea4: 80 a0 60 00 cmp %g1, 0 40006ea8: 12 80 00 0e bne 40006ee0 <_POSIX_Timer_TSR+0x4c> 40006eac: c4 26 60 68 st %g2, [ %i1 + 0x68 ] ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 40006eb0: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40006eb4: 80 a0 60 00 cmp %g1, 0 40006eb8: 32 80 00 0b bne,a 40006ee4 <_POSIX_Timer_TSR+0x50> 40006ebc: 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; 40006ec0: 82 10 20 04 mov 4, %g1 <== NOT EXECUTED 40006ec4: 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 ) ) { 40006ec8: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40006ecc: 40 00 19 98 call 4000d52c 40006ed0: 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; 40006ed4: c0 26 60 68 clr [ %i1 + 0x68 ] 40006ed8: 81 c7 e0 08 ret 40006edc: 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( 40006ee0: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40006ee4: d4 06 60 08 ld [ %i1 + 8 ], %o2 40006ee8: 90 06 60 10 add %i1, 0x10, %o0 40006eec: 17 10 00 1b sethi %hi(0x40006c00), %o3 40006ef0: 98 10 00 19 mov %i1, %o4 40006ef4: 40 00 1a bc call 4000d9e4 <_POSIX_Timer_Insert_helper> 40006ef8: 96 12 e2 94 or %o3, 0x294, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40006efc: 80 8a 20 ff btst 0xff, %o0 40006f00: 02 bf ff f6 be 40006ed8 <_POSIX_Timer_TSR+0x44> 40006f04: 01 00 00 00 nop return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 40006f08: 40 00 05 da call 40008670 <_TOD_Get> 40006f0c: 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; 40006f10: 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 ) || 40006f14: 10 bf ff ed b 40006ec8 <_POSIX_Timer_TSR+0x34> 40006f18: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] 40010488 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 40010488: 9d e3 bf a0 save %sp, -96, %sp clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4001048c: 7f ff c6 62 call 40001e14 40010490: 01 00 00 00 nop if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 40010494: 85 2e 20 04 sll %i0, 4, %g2 40010498: 83 2e 20 02 sll %i0, 2, %g1 4001049c: 82 20 80 01 sub %g2, %g1, %g1 400104a0: 05 10 00 7c sethi %hi(0x4001f000), %g2 400104a4: 84 10 a2 24 or %g2, 0x224, %g2 ! 4001f224 <_POSIX_signals_Vectors> 400104a8: c4 00 80 01 ld [ %g2 + %g1 ], %g2 400104ac: 80 a0 a0 02 cmp %g2, 2 400104b0: 02 80 00 11 be 400104f4 <_POSIX_signals_Clear_process_signals+0x6c> 400104b4: 05 10 00 7c sethi %hi(0x4001f000), %g2 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 400104b8: 05 10 00 7c sethi %hi(0x4001f000), %g2 400104bc: c6 00 a3 f0 ld [ %g2 + 0x3f0 ], %g3 ! 4001f3f0 <_POSIX_signals_Pending> 400104c0: b0 06 3f ff add %i0, -1, %i0 400104c4: 82 10 20 01 mov 1, %g1 400104c8: 83 28 40 18 sll %g1, %i0, %g1 400104cc: 82 28 c0 01 andn %g3, %g1, %g1 if ( !_POSIX_signals_Pending ) 400104d0: 80 a0 60 00 cmp %g1, 0 400104d4: 12 80 00 06 bne 400104ec <_POSIX_signals_Clear_process_signals+0x64> 400104d8: c2 20 a3 f0 st %g1, [ %g2 + 0x3f0 ] _Thread_Do_post_task_switch_extension--; 400104dc: 03 10 00 7b sethi %hi(0x4001ec00), %g1 400104e0: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4001ed30 <_Thread_Do_post_task_switch_extension> 400104e4: 84 00 bf ff add %g2, -1, %g2 400104e8: c4 20 61 30 st %g2, [ %g1 + 0x130 ] } _ISR_Enable( level ); 400104ec: 7f ff c6 4e call 40001e24 400104f0: 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 ] ) ) 400104f4: 84 10 a3 f4 or %g2, 0x3f4, %g2 400104f8: c6 00 40 02 ld [ %g1 + %g2 ], %g3 400104fc: 82 00 40 02 add %g1, %g2, %g1 40010500: 82 00 60 04 add %g1, 4, %g1 40010504: 80 a0 c0 01 cmp %g3, %g1 40010508: 02 bf ff ed be 400104bc <_POSIX_signals_Clear_process_signals+0x34> 4001050c: 05 10 00 7c sethi %hi(0x4001f000), %g2 if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; } _ISR_Enable( level ); 40010510: 7f ff c6 45 call 40001e24 <== NOT EXECUTED 40010514: 91 e8 00 08 restore %g0, %o0, %o0 <== NOT EXECUTED 40010518: 01 00 00 00 nop 4001055c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4001055c: 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 ) ) { 40010560: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40010564: 05 04 00 20 sethi %hi(0x10008000), %g2 40010568: 88 06 7f ff add %i1, -1, %g4 4001056c: 9a 08 40 02 and %g1, %g2, %o5 40010570: 86 10 20 01 mov 1, %g3 40010574: 80 a3 40 02 cmp %o5, %g2 40010578: 89 28 c0 04 sll %g3, %g4, %g4 4001057c: 02 80 00 25 be 40010610 <_POSIX_signals_Unblock_thread+0xb4> 40010580: c4 06 21 60 ld [ %i0 + 0x160 ], %g2 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 40010584: c4 00 a0 cc ld [ %g2 + 0xcc ], %g2 40010588: 80 a9 00 02 andncc %g4, %g2, %g0 4001058c: 02 80 00 1f be 40010608 <_POSIX_signals_Unblock_thread+0xac> 40010590: 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 ) { 40010594: 80 88 40 02 btst %g1, %g2 40010598: 02 80 00 11 be 400105dc <_POSIX_signals_Unblock_thread+0x80> 4001059c: c6 2e 20 74 stb %g3, [ %i0 + 0x74 ] the_thread->Wait.return_code = EINTR; 400105a0: 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) ){ 400105a4: 80 88 60 08 btst 8, %g1 400105a8: 02 80 00 18 be 40010608 <_POSIX_signals_Unblock_thread+0xac> 400105ac: c4 26 20 34 st %g2, [ %i0 + 0x34 ] if ( _Watchdog_Is_active( &the_thread->Timer ) ) 400105b0: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 400105b4: 80 a0 60 02 cmp %g1, 2 400105b8: 02 80 00 36 be 40010690 <_POSIX_signals_Unblock_thread+0x134> 400105bc: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 400105c0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 400105c4: 13 04 00 ff sethi %hi(0x1003fc00), %o1 400105c8: b0 10 20 00 clr %i0 400105cc: 7f ff e1 70 call 40008b8c <_Thread_Clear_state> 400105d0: 92 12 63 f8 or %o1, 0x3f8, %o1 400105d4: 81 c7 e0 08 ret 400105d8: 81 e8 00 00 restore (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 400105dc: 80 a0 60 00 cmp %g1, 0 400105e0: 12 80 00 0a bne 40010608 <_POSIX_signals_Unblock_thread+0xac> 400105e4: 03 10 00 7b sethi %hi(0x4001ec00), %g1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 400105e8: c2 00 61 28 ld [ %g1 + 0x128 ], %g1 ! 4001ed28 <_ISR_Nest_level> 400105ec: 80 a0 60 00 cmp %g1, 0 400105f0: 02 80 00 06 be 40010608 <_POSIX_signals_Unblock_thread+0xac> 400105f4: 03 10 00 7b sethi %hi(0x4001ec00), %g1 400105f8: c2 00 61 4c ld [ %g1 + 0x14c ], %g1 ! 4001ed4c <_Thread_Executing> 400105fc: 80 a6 00 01 cmp %i0, %g1 40010600: 02 80 00 21 be 40010684 <_POSIX_signals_Unblock_thread+0x128> 40010604: 03 10 00 7b sethi %hi(0x4001ec00), %g1 _ISR_Signals_to_thread_executing = true; } } return false; } 40010608: 81 c7 e0 08 ret 4001060c: 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) ) { 40010610: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 40010614: 80 89 00 01 btst %g4, %g1 40010618: 22 80 00 12 be,a 40010660 <_POSIX_signals_Unblock_thread+0x104> 4001061c: c2 00 a0 cc ld [ %g2 + 0xcc ], %g1 the_thread->Wait.return_code = EINTR; 40010620: 82 10 20 04 mov 4, %g1 40010624: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 40010628: 80 a6 a0 00 cmp %i2, 0 4001062c: 02 80 00 11 be 40010670 <_POSIX_signals_Unblock_thread+0x114> 40010630: 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; 40010634: c4 06 80 00 ld [ %i2 ], %g2 40010638: c4 20 40 00 st %g2, [ %g1 ] 4001063c: c4 06 a0 04 ld [ %i2 + 4 ], %g2 40010640: c4 20 60 04 st %g2, [ %g1 + 4 ] 40010644: c4 06 a0 08 ld [ %i2 + 8 ], %g2 40010648: c4 20 60 08 st %g2, [ %g1 + 8 ] } _Thread_queue_Extract_with_proxy( the_thread ); 4001064c: 90 10 00 18 mov %i0, %o0 40010650: 7f ff e4 43 call 4000975c <_Thread_queue_Extract_with_proxy> 40010654: b0 10 20 01 mov 1, %i0 return true; 40010658: 81 c7 e0 08 ret 4001065c: 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) ) { 40010660: 80 a9 00 01 andncc %g4, %g1, %g0 40010664: 12 bf ff f0 bne 40010624 <_POSIX_signals_Unblock_thread+0xc8> 40010668: 82 10 20 04 mov 4, %g1 4001066c: 30 bf ff e7 b,a 40010608 <_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; 40010670: 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; 40010674: f2 20 40 00 st %i1, [ %g1 ] the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 40010678: 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; 4001067c: 10 bf ff f4 b 4001064c <_POSIX_signals_Unblock_thread+0xf0> 40010680: 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; 40010684: c6 28 61 e8 stb %g3, [ %g1 + 0x1e8 ] 40010688: 81 c7 e0 08 ret 4001068c: 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 ); 40010690: 7f ff e7 2c call 4000a340 <_Watchdog_Remove> 40010694: 90 06 20 48 add %i0, 0x48, %o0 40010698: 10 bf ff cb b 400105c4 <_POSIX_signals_Unblock_thread+0x68> 4001069c: 90 10 00 18 mov %i0, %o0 4000897c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000897c: 9d e3 bf a0 save %sp, -96, %sp */ /* * Save original state */ original_state = the_thread->current_state; 40008980: 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 ); 40008984: 40 00 04 4d call 40009ab8 <_Thread_Set_transient> 40008988: 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 ) 4000898c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40008990: 80 a0 40 19 cmp %g1, %i1 40008994: 02 80 00 05 be 400089a8 <_Thread_Change_priority+0x2c> 40008998: a0 10 00 18 mov %i0, %l0 _Thread_Set_priority( the_thread, new_priority ); 4000899c: 92 10 00 19 mov %i1, %o1 400089a0: 40 00 03 ca call 400098c8 <_Thread_Set_priority> 400089a4: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 400089a8: 7f ff e5 1b call 40001e14 400089ac: 01 00 00 00 nop 400089b0: 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; 400089b4: e4 04 20 10 ld [ %l0 + 0x10 ], %l2 if ( state != STATES_TRANSIENT ) { 400089b8: 80 a4 a0 04 cmp %l2, 4 400089bc: 02 80 00 18 be 40008a1c <_Thread_Change_priority+0xa0> 400089c0: 80 8c 60 04 btst 4, %l1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 400089c4: 02 80 00 0b be 400089f0 <_Thread_Change_priority+0x74> 400089c8: 82 0c bf fb and %l2, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 400089cc: 7f ff e5 16 call 40001e24 <== NOT EXECUTED 400089d0: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 400089d4: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 400089d8: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 400089dc: 80 8c 80 01 btst %l2, %g1 <== NOT EXECUTED 400089e0: 32 80 00 0d bne,a 40008a14 <_Thread_Change_priority+0x98> <== NOT EXECUTED 400089e4: f0 04 20 44 ld [ %l0 + 0x44 ], %i0 <== NOT EXECUTED 400089e8: 81 c7 e0 08 ret 400089ec: 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 ); 400089f0: c2 24 20 10 st %g1, [ %l0 + 0x10 ] _ISR_Enable( level ); 400089f4: 7f ff e5 0c call 40001e24 400089f8: 90 10 00 18 mov %i0, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 400089fc: 03 00 00 ef sethi %hi(0x3bc00), %g1 40008a00: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40008a04: 80 8c 80 01 btst %l2, %g1 40008a08: 02 bf ff f8 be 400089e8 <_Thread_Change_priority+0x6c> 40008a0c: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 40008a10: f0 04 20 44 ld [ %l0 + 0x44 ], %i0 40008a14: 40 00 03 7d call 40009808 <_Thread_queue_Requeue> 40008a18: 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 ) ) { 40008a1c: 12 80 00 14 bne 40008a6c <_Thread_Change_priority+0xf0> 40008a20: 23 10 00 7b sethi %hi(0x4001ec00), %l1 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 40008a24: c2 04 20 90 ld [ %l0 + 0x90 ], %g1 40008a28: c4 14 20 96 lduh [ %l0 + 0x96 ], %g2 40008a2c: 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 ); 40008a30: c0 24 20 10 clr [ %l0 + 0x10 ] 40008a34: 84 10 c0 02 or %g3, %g2, %g2 40008a38: c4 30 40 00 sth %g2, [ %g1 ] _Priority_Major_bit_map |= the_priority_map->ready_major; 40008a3c: c4 14 61 40 lduh [ %l1 + 0x140 ], %g2 40008a40: c2 14 20 94 lduh [ %l0 + 0x94 ], %g1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 40008a44: 80 8e a0 ff btst 0xff, %i2 40008a48: 82 10 80 01 or %g2, %g1, %g1 40008a4c: c2 34 61 40 sth %g1, [ %l1 + 0x140 ] 40008a50: 02 80 00 48 be 40008b70 <_Thread_Change_priority+0x1f4> 40008a54: c2 04 20 8c ld [ %l0 + 0x8c ], %g1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40008a58: c4 00 40 00 ld [ %g1 ], %g2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 40008a5c: c2 24 20 04 st %g1, [ %l0 + 4 ] before_node = after_node->next; after_node->next = the_node; 40008a60: e0 20 40 00 st %l0, [ %g1 ] the_node->next = before_node; before_node->previous = the_node; 40008a64: 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; 40008a68: 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 ); 40008a6c: 7f ff e4 ee call 40001e24 40008a70: 90 10 00 18 mov %i0, %o0 40008a74: 7f ff e4 e8 call 40001e14 40008a78: 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 ); 40008a7c: c2 14 61 40 lduh [ %l1 + 0x140 ], %g1 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 40008a80: 05 10 00 7a sethi %hi(0x4001e800), %g2 40008a84: 83 28 60 10 sll %g1, 0x10, %g1 40008a88: da 00 a3 e4 ld [ %g2 + 0x3e4 ], %o5 40008a8c: 85 30 60 10 srl %g1, 0x10, %g2 40008a90: 80 a0 a0 ff cmp %g2, 0xff 40008a94: 08 80 00 27 bleu 40008b30 <_Thread_Change_priority+0x1b4> 40008a98: 07 10 00 74 sethi %hi(0x4001d000), %g3 40008a9c: 83 30 60 18 srl %g1, 0x18, %g1 40008aa0: 86 10 e2 c8 or %g3, 0x2c8, %g3 40008aa4: c4 08 c0 01 ldub [ %g3 + %g1 ], %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 40008aa8: 09 10 00 7b sethi %hi(0x4001ec00), %g4 40008aac: 85 28 a0 10 sll %g2, 0x10, %g2 40008ab0: 88 11 21 c0 or %g4, 0x1c0, %g4 40008ab4: 83 30 a0 0f srl %g2, 0xf, %g1 40008ab8: c2 11 00 01 lduh [ %g4 + %g1 ], %g1 40008abc: 83 28 60 10 sll %g1, 0x10, %g1 40008ac0: 89 30 60 10 srl %g1, 0x10, %g4 40008ac4: 80 a1 20 ff cmp %g4, 0xff 40008ac8: 18 80 00 28 bgu 40008b68 <_Thread_Change_priority+0x1ec> 40008acc: 83 30 60 18 srl %g1, 0x18, %g1 40008ad0: c2 08 c0 04 ldub [ %g3 + %g4 ], %g1 40008ad4: 82 00 60 08 add %g1, 8, %g1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 40008ad8: 85 30 a0 0c srl %g2, 0xc, %g2 40008adc: 83 28 60 10 sll %g1, 0x10, %g1 40008ae0: 83 30 60 10 srl %g1, 0x10, %g1 40008ae4: 82 00 40 02 add %g1, %g2, %g1 40008ae8: 85 28 60 04 sll %g1, 4, %g2 40008aec: 83 28 60 02 sll %g1, 2, %g1 40008af0: 82 20 80 01 sub %g2, %g1, %g1 40008af4: 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 ); 40008af8: 05 10 00 7b sethi %hi(0x4001ec00), %g2 40008afc: c4 00 a1 4c ld [ %g2 + 0x14c ], %g2 ! 4001ed4c <_Thread_Executing> * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 40008b00: 07 10 00 7b sethi %hi(0x4001ec00), %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() && 40008b04: 80 a0 40 02 cmp %g1, %g2 40008b08: 02 80 00 08 be 40008b28 <_Thread_Change_priority+0x1ac> 40008b0c: c2 20 e1 1c st %g1, [ %g3 + 0x11c ] _Thread_Executing->is_preemptible ) 40008b10: c2 08 a0 75 ldub [ %g2 + 0x75 ], %g1 40008b14: 80 a0 60 00 cmp %g1, 0 40008b18: 02 80 00 04 be 40008b28 <_Thread_Change_priority+0x1ac> 40008b1c: 84 10 20 01 mov 1, %g2 _Context_Switch_necessary = true; 40008b20: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40008b24: c4 28 61 5c stb %g2, [ %g1 + 0x15c ] ! 4001ed5c <_Context_Switch_necessary> _ISR_Enable( level ); 40008b28: 7f ff e4 bf call 40001e24 40008b2c: 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 ); 40008b30: 86 10 e2 c8 or %g3, 0x2c8, %g3 40008b34: c4 08 c0 02 ldub [ %g3 + %g2 ], %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 40008b38: 09 10 00 7b sethi %hi(0x4001ec00), %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 ); 40008b3c: 84 00 a0 08 add %g2, 8, %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 40008b40: 88 11 21 c0 or %g4, 0x1c0, %g4 40008b44: 85 28 a0 10 sll %g2, 0x10, %g2 40008b48: 83 30 a0 0f srl %g2, 0xf, %g1 40008b4c: c2 11 00 01 lduh [ %g4 + %g1 ], %g1 40008b50: 83 28 60 10 sll %g1, 0x10, %g1 40008b54: 89 30 60 10 srl %g1, 0x10, %g4 40008b58: 80 a1 20 ff cmp %g4, 0xff 40008b5c: 28 bf ff de bleu,a 40008ad4 <_Thread_Change_priority+0x158> 40008b60: c2 08 c0 04 ldub [ %g3 + %g4 ], %g1 40008b64: 83 30 60 18 srl %g1, 0x18, %g1 40008b68: 10 bf ff dc b 40008ad8 <_Thread_Change_priority+0x15c> 40008b6c: c2 08 c0 01 ldub [ %g3 + %g1 ], %g1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 40008b70: 84 00 60 04 add %g1, 4, %g2 40008b74: c4 24 00 00 st %g2, [ %l0 ] old_last_node = the_chain->last; 40008b78: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_chain->last = the_node; 40008b7c: e0 20 60 08 st %l0, [ %g1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 40008b80: 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; 40008b84: 10 bf ff ba b 40008a6c <_Thread_Change_priority+0xf0> 40008b88: e0 20 80 00 st %l0, [ %g2 ] 40009d2c <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 40009d2c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 40009d30: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40009d34: e0 00 61 4c ld [ %g1 + 0x14c ], %l0 ! 4001ed4c <_Thread_Executing> ready = executing->ready; _ISR_Disable( level ); 40009d38: 7f ff e0 37 call 40001e14 40009d3c: e2 04 20 8c ld [ %l0 + 0x8c ], %l1 40009d40: b0 10 00 08 mov %o0, %i0 if ( !_Chain_Has_only_one_node( ready ) ) { 40009d44: c4 04 40 00 ld [ %l1 ], %g2 40009d48: c2 04 60 08 ld [ %l1 + 8 ], %g1 40009d4c: 80 a0 80 01 cmp %g2, %g1 40009d50: 02 80 00 19 be 40009db4 <_Thread_Yield_processor+0x88> 40009d54: 86 04 60 04 add %l1, 4, %g3 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 40009d58: c2 04 00 00 ld [ %l0 ], %g1 previous = the_node->previous; 40009d5c: c4 04 20 04 ld [ %l0 + 4 ], %g2 next->previous = previous; previous->next = next; 40009d60: c2 20 80 00 st %g1, [ %g2 ] Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 40009d64: c6 24 00 00 st %g3, [ %l0 ] Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 40009d68: 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; 40009d6c: c2 04 60 08 ld [ %l1 + 8 ], %g1 the_chain->last = the_node; 40009d70: e0 24 60 08 st %l0, [ %l1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 40009d74: 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; 40009d78: e0 20 40 00 st %l0, [ %g1 ] _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 40009d7c: 7f ff e0 2a call 40001e24 40009d80: 01 00 00 00 nop 40009d84: 7f ff e0 24 call 40001e14 40009d88: 01 00 00 00 nop if ( _Thread_Is_heir( executing ) ) 40009d8c: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40009d90: c4 00 61 1c ld [ %g1 + 0x11c ], %g2 ! 4001ed1c <_Thread_Heir> 40009d94: 80 a4 00 02 cmp %l0, %g2 40009d98: 22 80 00 0e be,a 40009dd0 <_Thread_Yield_processor+0xa4> 40009d9c: 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; 40009da0: 84 10 20 01 mov 1, %g2 40009da4: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40009da8: c4 28 61 5c stb %g2, [ %g1 + 0x15c ] ! 4001ed5c <_Context_Switch_necessary> _ISR_Enable( level ); 40009dac: 7f ff e0 1e call 40001e24 40009db0: 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 ) ) 40009db4: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40009db8: c2 00 61 1c ld [ %g1 + 0x11c ], %g1 ! 4001ed1c <_Thread_Heir> 40009dbc: 80 a4 00 01 cmp %l0, %g1 40009dc0: 32 bf ff f9 bne,a 40009da4 <_Thread_Yield_processor+0x78> 40009dc4: 84 10 20 01 mov 1, %g2 <== NOT EXECUTED _Context_Switch_necessary = true; _ISR_Enable( level ); 40009dc8: 7f ff e0 17 call 40001e24 40009dcc: 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; 40009dd0: 10 bf ff f4 b 40009da0 <_Thread_Yield_processor+0x74> 40009dd4: c4 20 61 1c st %g2, [ %g1 + 0x11c ] 4000954c <_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 ) { 4000954c: 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; 40009550: 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); 40009554: 82 06 60 3c add %i1, 0x3c, %g1 the_chain->permanent_null = NULL; 40009558: 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); 4000955c: c2 26 60 38 st %g1, [ %i1 + 0x38 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40009560: 82 06 60 38 add %i1, 0x38, %g1 40009564: c2 26 60 40 st %g1, [ %i1 + 0x40 ] 40009568: 2d 10 00 78 sethi %hi(0x4001e000), %l6 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 4000956c: 83 34 20 06 srl %l0, 6, %g1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40009570: 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 ]; 40009574: ab 28 60 04 sll %g1, 4, %l5 40009578: ac 15 a1 d4 or %l6, 0x1d4, %l6 4000957c: 83 28 60 02 sll %g1, 2, %g1 block_state = the_thread_queue->state; 40009580: 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 ]; 40009584: aa 25 40 01 sub %l5, %g1, %l5 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40009588: 12 80 00 24 bne 40009618 <_Thread_queue_Enqueue_priority+0xcc> 4000958c: 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; 40009590: ac 05 60 04 add %l5, 4, %l6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 40009594: 7f ff e2 20 call 40001e14 40009598: 01 00 00 00 nop 4000959c: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->first; 400095a0: c2 05 40 00 ld [ %l5 ], %g1 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 400095a4: 80 a0 40 16 cmp %g1, %l6 400095a8: 02 80 00 3a be 40009690 <_Thread_queue_Enqueue_priority+0x144> 400095ac: a2 10 00 01 mov %g1, %l1 search_priority = search_thread->current_priority; 400095b0: e6 00 60 14 ld [ %g1 + 0x14 ], %l3 if ( priority <= search_priority ) 400095b4: 80 a4 00 13 cmp %l0, %l3 400095b8: 18 80 00 0b bgu 400095e4 <_Thread_queue_Enqueue_priority+0x98> 400095bc: 01 00 00 00 nop } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 400095c0: 10 80 00 36 b 40009698 <_Thread_queue_Enqueue_priority+0x14c> 400095c4: 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 ) ) { 400095c8: 80 a4 40 16 cmp %l1, %l6 400095cc: 02 80 00 32 be 40009694 <_Thread_queue_Enqueue_priority+0x148> 400095d0: 82 10 00 11 mov %l1, %g1 search_priority = search_thread->current_priority; 400095d4: e6 04 60 14 ld [ %l1 + 0x14 ], %l3 if ( priority <= search_priority ) 400095d8: 80 a4 00 13 cmp %l0, %l3 400095dc: 28 80 00 2f bleu,a 40009698 <_Thread_queue_Enqueue_priority+0x14c> 400095e0: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 400095e4: 7f ff e2 10 call 40001e24 400095e8: 90 10 00 12 mov %l2, %o0 400095ec: 7f ff e2 0a call 40001e14 400095f0: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 400095f4: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 400095f8: 80 8d 00 01 btst %l4, %g1 400095fc: 32 bf ff f3 bne,a 400095c8 <_Thread_queue_Enqueue_priority+0x7c> 40009600: e2 04 40 00 ld [ %l1 ], %l1 _ISR_Enable( level ); 40009604: 7f ff e2 08 call 40001e24 <== NOT EXECUTED 40009608: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED goto restart_forward_search; 4000960c: 30 bf ff e2 b,a 40009594 <_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 ); 40009610: 7f ff e2 05 call 40001e24 40009614: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 40009618: 7f ff e1 ff call 40001e14 4000961c: 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; 40009620: a6 04 e0 01 inc %l3 _ISR_Disable( level ); 40009624: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->last; 40009628: c2 05 60 08 ld [ %l5 + 8 ], %g1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4000962c: 80 a0 40 15 cmp %g1, %l5 40009630: 02 80 00 20 be 400096b0 <_Thread_queue_Enqueue_priority+0x164> 40009634: a2 10 00 01 mov %g1, %l1 search_priority = search_thread->current_priority; 40009638: e6 00 60 14 ld [ %g1 + 0x14 ], %l3 if ( priority >= search_priority ) 4000963c: 80 a4 00 13 cmp %l0, %l3 40009640: 0a 80 00 0b bcs 4000966c <_Thread_queue_Enqueue_priority+0x120> 40009644: 01 00 00 00 nop } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 40009648: 10 80 00 1b b 400096b4 <_Thread_queue_Enqueue_priority+0x168> 4000964c: 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 ) ) { 40009650: 80 a4 40 15 cmp %l1, %l5 40009654: 02 80 00 17 be 400096b0 <_Thread_queue_Enqueue_priority+0x164> 40009658: 82 10 00 11 mov %l1, %g1 search_priority = search_thread->current_priority; 4000965c: e6 04 60 14 ld [ %l1 + 0x14 ], %l3 if ( priority >= search_priority ) 40009660: 80 a4 00 13 cmp %l0, %l3 40009664: 3a 80 00 14 bcc,a 400096b4 <_Thread_queue_Enqueue_priority+0x168> 40009668: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 4000966c: 7f ff e1 ee call 40001e24 40009670: 90 10 00 12 mov %l2, %o0 40009674: 7f ff e1 e8 call 40001e14 40009678: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4000967c: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 40009680: 80 8d 00 01 btst %l4, %g1 40009684: 32 bf ff f3 bne,a 40009650 <_Thread_queue_Enqueue_priority+0x104> 40009688: e2 04 60 04 ld [ %l1 + 4 ], %l1 4000968c: 30 bf ff e1 b,a 40009610 <_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 ) ) { 40009690: a6 10 3f ff mov -1, %l3 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 40009694: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 40009698: 80 a0 a0 01 cmp %g2, 1 4000969c: 02 80 00 17 be 400096f8 <_Thread_queue_Enqueue_priority+0x1ac> 400096a0: 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; 400096a4: e4 26 80 00 st %l2, [ %i2 ] return the_thread_queue->sync_state; } 400096a8: 81 c7 e0 08 ret 400096ac: 91 e8 00 02 restore %g0, %g2, %o0 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 400096b0: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 400096b4: 80 a0 a0 01 cmp %g2, 1 400096b8: 32 bf ff fc bne,a 400096a8 <_Thread_queue_Enqueue_priority+0x15c> 400096bc: 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 ) 400096c0: 80 a4 00 13 cmp %l0, %l3 400096c4: 02 80 00 1a be 4000972c <_Thread_queue_Enqueue_priority+0x1e0> 400096c8: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 400096cc: c4 00 40 00 ld [ %g1 ], %g2 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 400096d0: 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; 400096d4: 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; 400096d8: 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; 400096dc: f2 20 40 00 st %i1, [ %g1 ] next_node->previous = the_node; 400096e0: f2 20 a0 04 st %i1, [ %g2 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 400096e4: b0 10 20 01 mov 1, %i0 400096e8: 7f ff e1 cf call 40001e24 400096ec: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 400096f0: 81 c7 e0 08 ret 400096f4: 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 ) 400096f8: 02 80 00 0d be 4000972c <_Thread_queue_Enqueue_priority+0x1e0> 400096fc: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 40009700: c4 00 60 04 ld [ %g1 + 4 ], %g2 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40009704: c2 26 40 00 st %g1, [ %i1 ] the_node->previous = previous_node; 40009708: 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; 4000970c: 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; 40009710: f2 20 80 00 st %i1, [ %g2 ] search_node->previous = the_node; 40009714: f2 20 60 04 st %i1, [ %g1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40009718: b0 10 20 01 mov 1, %i0 4000971c: 7f ff e1 c2 call 40001e24 40009720: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40009724: 81 c7 e0 08 ret 40009728: 81 e8 00 00 restore 4000972c: 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; 40009730: c2 04 60 04 ld [ %l1 + 4 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40009734: e2 26 40 00 st %l1, [ %i1 ] the_node->previous = previous_node; 40009738: 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; 4000973c: 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; 40009740: f2 20 40 00 st %i1, [ %g1 ] search_node->previous = the_node; 40009744: f2 24 60 04 st %i1, [ %l1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40009748: b0 10 20 01 mov 1, %i0 4000974c: 7f ff e1 b6 call 40001e24 40009750: 90 10 00 12 mov %l2, %o0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40009754: 81 c7 e0 08 ret 40009758: 81 e8 00 00 restore 40009808 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 40009808: 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 ) 4000980c: 80 a6 20 00 cmp %i0, 0 40009810: 02 80 00 13 be 4000985c <_Thread_queue_Requeue+0x54> 40009814: 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 ) { 40009818: e2 06 20 34 ld [ %i0 + 0x34 ], %l1 4000981c: 80 a4 60 01 cmp %l1, 1 40009820: 02 80 00 04 be 40009830 <_Thread_queue_Requeue+0x28> 40009824: 01 00 00 00 nop 40009828: 81 c7 e0 08 ret <== NOT EXECUTED 4000982c: 81 e8 00 00 restore <== NOT EXECUTED Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 40009830: 7f ff e1 79 call 40001e14 40009834: 01 00 00 00 nop 40009838: a0 10 00 08 mov %o0, %l0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000983c: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 40009840: 03 00 00 ef sethi %hi(0x3bc00), %g1 40009844: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40009848: 80 88 80 01 btst %g2, %g1 4000984c: 12 80 00 06 bne 40009864 <_Thread_queue_Requeue+0x5c> 40009850: 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 ); 40009854: 7f ff e1 74 call 40001e24 40009858: 90 10 00 10 mov %l0, %o0 4000985c: 81 c7 e0 08 ret 40009860: 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 ); 40009864: 92 10 00 19 mov %i1, %o1 40009868: e2 26 20 30 st %l1, [ %i0 + 0x30 ] 4000986c: 40 00 10 cc call 4000db9c <_Thread_queue_Extract_priority_helper> 40009870: 94 10 20 01 mov 1, %o2 (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 40009874: 90 10 00 18 mov %i0, %o0 40009878: 92 10 00 19 mov %i1, %o1 4000987c: 7f ff ff 34 call 4000954c <_Thread_queue_Enqueue_priority> 40009880: 94 07 bf fc add %fp, -4, %o2 40009884: 30 bf ff f4 b,a 40009854 <_Thread_queue_Requeue+0x4c> 40016cd0 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40016cd0: 9d e3 bf 88 save %sp, -120, %sp 40016cd4: 2d 10 00 fc sethi %hi(0x4003f000), %l6 40016cd8: ba 07 bf f4 add %fp, -12, %i5 40016cdc: a8 07 bf f8 add %fp, -8, %l4 40016ce0: a4 07 bf e8 add %fp, -24, %l2 40016ce4: ae 07 bf ec add %fp, -20, %l7 40016ce8: 2b 10 00 fc sethi %hi(0x4003f000), %l5 40016cec: 39 10 00 fc sethi %hi(0x4003f000), %i4 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 40016cf0: c0 27 bf f8 clr [ %fp + -8 ] 40016cf4: c0 27 bf ec clr [ %fp + -20 ] the_chain->last = _Chain_Head(the_chain); 40016cf8: 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); 40016cfc: e8 27 bf f4 st %l4, [ %fp + -12 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40016d00: 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); 40016d04: ee 27 bf e8 st %l7, [ %fp + -24 ] 40016d08: ac 15 a3 c4 or %l6, 0x3c4, %l6 40016d0c: aa 15 63 00 or %l5, 0x300, %l5 40016d10: b8 17 22 70 or %i4, 0x270, %i4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016d14: 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 ); 40016d18: 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 ); 40016d1c: 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 ); 40016d20: 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; 40016d24: 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; 40016d28: 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; 40016d2c: c2 05 80 00 ld [ %l6 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40016d30: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016d34: 90 10 00 11 mov %l1, %o0 40016d38: 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; 40016d3c: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016d40: 40 00 12 3c call 4001b630 <_Watchdog_Adjust_to_chain> 40016d44: 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; 40016d48: 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(); 40016d4c: 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 ) { 40016d50: 80 a4 00 09 cmp %l0, %o1 40016d54: 38 80 00 2f bgu,a 40016e10 <_Timer_server_Body+0x140> 40016d58: 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 ) { 40016d5c: 80 a4 00 09 cmp %l0, %o1 40016d60: 0a 80 00 30 bcs 40016e20 <_Timer_server_Body+0x150> 40016d64: 94 22 40 10 sub %o1, %l0, %o2 */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 40016d68: 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 ); 40016d6c: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40016d70: 40 00 02 b5 call 40017844 <_Chain_Get> 40016d74: 01 00 00 00 nop if ( timer == NULL ) { 40016d78: 80 a2 20 00 cmp %o0, 0 40016d7c: 02 80 00 10 be 40016dbc <_Timer_server_Body+0xec> 40016d80: 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 ) { 40016d84: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40016d88: 80 a0 60 01 cmp %g1, 1 40016d8c: 02 80 00 29 be 40016e30 <_Timer_server_Body+0x160> 40016d90: 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 ) { 40016d94: 12 bf ff f6 bne 40016d6c <_Timer_server_Body+0x9c> 40016d98: 92 02 20 10 add %o0, 0x10, %o1 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40016d9c: 40 00 12 5b call 4001b708 <_Watchdog_Insert> 40016da0: 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 ); 40016da4: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40016da8: 40 00 02 a7 call 40017844 <_Chain_Get> 40016dac: 01 00 00 00 nop if ( timer == NULL ) { 40016db0: 80 a2 20 00 cmp %o0, 0 40016db4: 32 bf ff f5 bne,a 40016d88 <_Timer_server_Body+0xb8> 40016db8: 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 ); 40016dbc: 7f ff df 71 call 4000eb80 40016dc0: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40016dc4: c2 07 bf f4 ld [ %fp + -12 ], %g1 40016dc8: 80 a5 00 01 cmp %l4, %g1 40016dcc: 02 80 00 1d be 40016e40 <_Timer_server_Body+0x170> 40016dd0: 01 00 00 00 nop ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40016dd4: 7f ff df 6f call 4000eb90 <== NOT EXECUTED 40016dd8: 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; 40016ddc: c2 05 80 00 ld [ %l6 ], %g1 <== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40016de0: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016de4: 90 10 00 11 mov %l1, %o0 <== NOT EXECUTED 40016de8: 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; 40016dec: c2 26 20 3c st %g1, [ %i0 + 0x3c ] <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016df0: 40 00 12 10 call 4001b630 <_Watchdog_Adjust_to_chain> <== NOT EXECUTED 40016df4: 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; 40016df8: 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(); 40016dfc: 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 ) { 40016e00: 80 a4 00 09 cmp %l0, %o1 <== NOT EXECUTED 40016e04: 08 bf ff d7 bleu 40016d60 <_Timer_server_Body+0x90> <== NOT EXECUTED 40016e08: 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 ); 40016e0c: 92 24 00 09 sub %l0, %o1, %o1 <== NOT EXECUTED 40016e10: 90 10 00 13 mov %l3, %o0 40016e14: 40 00 12 07 call 4001b630 <_Watchdog_Adjust_to_chain> 40016e18: 94 10 00 12 mov %l2, %o2 40016e1c: 30 bf ff d3 b,a 40016d68 <_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 ); 40016e20: 90 10 00 13 mov %l3, %o0 40016e24: 40 00 11 d3 call 4001b570 <_Watchdog_Adjust> 40016e28: 92 10 20 01 mov 1, %o1 40016e2c: 30 bf ff cf b,a 40016d68 <_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 ); 40016e30: 92 02 20 10 add %o0, 0x10, %o1 40016e34: 40 00 12 35 call 4001b708 <_Watchdog_Insert> 40016e38: 90 10 00 11 mov %l1, %o0 40016e3c: 30 bf ff cc b,a 40016d6c <_Timer_server_Body+0x9c> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 40016e40: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40016e44: 7f ff df 53 call 4000eb90 40016e48: 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 ) ) { 40016e4c: c2 07 bf e8 ld [ %fp + -24 ], %g1 40016e50: 80 a5 c0 01 cmp %l7, %g1 40016e54: 12 80 00 0c bne 40016e84 <_Timer_server_Body+0x1b4> 40016e58: 01 00 00 00 nop 40016e5c: 30 80 00 13 b,a 40016ea8 <_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; 40016e60: 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; 40016e64: c2 27 bf e8 st %g1, [ %fp + -24 ] new_first->previous = _Chain_Head(the_chain); 40016e68: e4 20 60 04 st %l2, [ %g1 + 4 ] _ISR_Enable( level ); 40016e6c: 7f ff df 49 call 4000eb90 40016e70: 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 ); 40016e74: d2 04 20 24 ld [ %l0 + 0x24 ], %o1 40016e78: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 40016e7c: 9f c0 40 00 call %g1 40016e80: 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 ); 40016e84: 7f ff df 3f call 4000eb80 40016e88: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 40016e8c: 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)) 40016e90: 80 a5 c0 10 cmp %l7, %l0 40016e94: 32 bf ff f3 bne,a 40016e60 <_Timer_server_Body+0x190> 40016e98: 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 ); 40016e9c: 7f ff df 3d call 4000eb90 40016ea0: 01 00 00 00 nop 40016ea4: 30 bf ff a1 b,a 40016d28 <_Timer_server_Body+0x58> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40016ea8: c0 2e 20 7c clrb [ %i0 + 0x7c ] 40016eac: c2 07 00 00 ld [ %i4 ], %g1 40016eb0: 82 00 60 01 inc %g1 40016eb4: c2 27 00 00 st %g1, [ %i4 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40016eb8: d0 06 00 00 ld [ %i0 ], %o0 40016ebc: 40 00 0e fa call 4001aaa4 <_Thread_Set_state> 40016ec0: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40016ec4: 7f ff ff 59 call 40016c28 <_Timer_server_Reset_interval_system_watchdog> 40016ec8: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40016ecc: 7f ff ff 6c call 40016c7c <_Timer_server_Reset_tod_system_watchdog> 40016ed0: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40016ed4: 40 00 0c 1f call 40019f50 <_Thread_Enable_dispatch> 40016ed8: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40016edc: 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; 40016ee0: 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 ); 40016ee4: 40 00 12 76 call 4001b8bc <_Watchdog_Remove> 40016ee8: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40016eec: 40 00 12 74 call 4001b8bc <_Watchdog_Remove> 40016ef0: 90 10 00 1a mov %i2, %o0 40016ef4: 30 bf ff 8d b,a 40016d28 <_Timer_server_Body+0x58> 4000c3e8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000c3e8: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000c3ec: 7f ff da 57 call 40002d48 4000c3f0: 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)); 4000c3f4: 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; 4000c3f8: 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 ) ) { 4000c3fc: 80 a0 40 11 cmp %g1, %l1 4000c400: 02 80 00 1f be 4000c47c <_Watchdog_Adjust+0x94> 4000c404: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000c408: 12 80 00 1f bne 4000c484 <_Watchdog_Adjust+0x9c> 4000c40c: 80 a6 60 01 cmp %i1, 1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000c410: 80 a6 a0 00 cmp %i2, 0 4000c414: 02 80 00 1a be 4000c47c <_Watchdog_Adjust+0x94> 4000c418: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 4000c41c: f2 00 60 10 ld [ %g1 + 0x10 ], %i1 4000c420: 80 a6 80 19 cmp %i2, %i1 4000c424: 1a 80 00 0b bcc 4000c450 <_Watchdog_Adjust+0x68> 4000c428: a4 10 20 01 mov 1, %l2 _Watchdog_First( header )->delta_interval -= units; 4000c42c: 10 80 00 1d b 4000c4a0 <_Watchdog_Adjust+0xb8> <== NOT EXECUTED 4000c430: 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 ) { 4000c434: b4 a6 80 19 subcc %i2, %i1, %i2 4000c438: 02 80 00 11 be 4000c47c <_Watchdog_Adjust+0x94> 4000c43c: 01 00 00 00 nop if ( units < _Watchdog_First( header )->delta_interval ) { 4000c440: f2 00 60 10 ld [ %g1 + 0x10 ], %i1 4000c444: 80 a6 40 1a cmp %i1, %i2 4000c448: 38 80 00 16 bgu,a 4000c4a0 <_Watchdog_Adjust+0xb8> 4000c44c: 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; 4000c450: e4 20 60 10 st %l2, [ %g1 + 0x10 ] _ISR_Enable( level ); 4000c454: 7f ff da 41 call 40002d58 4000c458: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000c45c: 40 00 00 b6 call 4000c734 <_Watchdog_Tickle> 4000c460: 90 10 00 10 mov %l0, %o0 _ISR_Disable( level ); 4000c464: 7f ff da 39 call 40002d48 4000c468: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4000c46c: c4 04 00 00 ld [ %l0 ], %g2 if ( _Chain_Is_empty( header ) ) 4000c470: 80 a4 40 02 cmp %l1, %g2 4000c474: 12 bf ff f0 bne 4000c434 <_Watchdog_Adjust+0x4c> 4000c478: 82 10 00 02 mov %g2, %g1 } break; } } _ISR_Enable( level ); 4000c47c: 7f ff da 37 call 40002d58 4000c480: 91 e8 00 08 restore %g0, %o0, %o0 * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4000c484: 12 bf ff fe bne 4000c47c <_Watchdog_Adjust+0x94> 4000c488: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000c48c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000c490: b4 00 80 1a add %g2, %i2, %i2 4000c494: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } break; } } _ISR_Enable( level ); 4000c498: 7f ff da 30 call 40002d58 4000c49c: 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; 4000c4a0: 10 bf ff f7 b 4000c47c <_Watchdog_Adjust+0x94> 4000c4a4: f4 20 60 10 st %i2, [ %g1 + 0x10 ] 40010150 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 40010150: 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() ) 40010154: 7f ff fb 7e call 4000ef4c 40010158: 01 00 00 00 nop 4001015c: 80 a2 00 18 cmp %o0, %i0 40010160: 12 80 00 b6 bne 40010438 40010164: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 40010168: 02 80 00 ba be 40010450 4001016c: 82 06 7f ff add %i1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 40010170: 80 a0 60 1f cmp %g1, 0x1f 40010174: 18 80 00 b7 bgu 40010450 40010178: 23 10 00 7c sethi %hi(0x4001f000), %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 ) 4001017c: a5 2e 60 02 sll %i1, 2, %l2 40010180: a2 14 62 24 or %l1, 0x224, %l1 40010184: a7 2e 60 04 sll %i1, 4, %l3 40010188: 84 24 c0 12 sub %l3, %l2, %g2 4001018c: 84 04 40 02 add %l1, %g2, %g2 40010190: c4 00 a0 08 ld [ %g2 + 8 ], %g2 40010194: 80 a0 a0 01 cmp %g2, 1 40010198: 02 80 00 45 be 400102ac 4001019c: 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 ) ) 400101a0: 80 a6 60 04 cmp %i1, 4 400101a4: 02 80 00 44 be 400102b4 400101a8: 80 a6 60 08 cmp %i1, 8 400101ac: 02 80 00 42 be 400102b4 400101b0: 80 a6 60 0b cmp %i1, 0xb 400101b4: 02 80 00 40 be 400102b4 400101b8: a0 10 20 01 mov 1, %l0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 400101bc: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 400101c0: e0 27 bf f8 st %l0, [ %fp + -8 ] if ( !value ) { 400101c4: 80 a6 a0 00 cmp %i2, 0 400101c8: 02 80 00 41 be 400102cc 400101cc: a1 2c 00 01 sll %l0, %g1, %l0 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 400101d0: c2 06 80 00 ld [ %i2 ], %g1 400101d4: c2 27 bf fc st %g1, [ %fp + -4 ] 400101d8: 03 10 00 7b sethi %hi(0x4001ec00), %g1 400101dc: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 4001ec90 <_Thread_Dispatch_disable_level> 400101e0: 84 00 a0 01 inc %g2 400101e4: c4 20 60 90 st %g2, [ %g1 + 0x90 ] /* * 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; 400101e8: 03 10 00 7b sethi %hi(0x4001ec00), %g1 400101ec: c2 00 61 4c ld [ %g1 + 0x14c ], %g1 ! 4001ed4c <_Thread_Executing> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 400101f0: c4 00 61 60 ld [ %g1 + 0x160 ], %g2 400101f4: c4 00 a0 cc ld [ %g2 + 0xcc ], %g2 400101f8: 80 ac 00 02 andncc %l0, %g2, %g0 400101fc: 12 80 00 1a bne 40010264 40010200: 09 10 00 7c sethi %hi(0x4001f000), %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 ; 40010204: c4 01 23 b0 ld [ %g4 + 0x3b0 ], %g2 ! 4001f3b0 <_POSIX_signals_Wait_queue> 40010208: 88 11 23 b0 or %g4, 0x3b0, %g4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4001020c: 88 01 20 04 add %g4, 4, %g4 40010210: 80 a0 80 04 cmp %g2, %g4 40010214: 02 80 00 30 be 400102d4 40010218: 82 10 00 02 mov %g2, %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4001021c: c6 00 a0 30 ld [ %g2 + 0x30 ], %g3 40010220: 80 8c 00 03 btst %l0, %g3 40010224: 02 80 00 0c be 40010254 40010228: 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; 4001022c: 10 80 00 0f b 40010268 40010230: 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 ; 40010234: 80 a0 80 04 cmp %g2, %g4 40010238: 22 80 00 28 be,a 400102d8 4001023c: 03 10 00 78 sethi %hi(0x4001e000), %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 40010240: 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 ]; 40010244: 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) 40010248: 80 8c 00 01 btst %l0, %g1 <== NOT EXECUTED 4001024c: 12 80 00 06 bne 40010264 <== NOT EXECUTED 40010250: 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) 40010254: c6 00 e0 cc ld [ %g3 + 0xcc ], %g3 40010258: 80 ac 00 03 andncc %l0, %g3, %g0 4001025c: 22 bf ff f6 be,a 40010234 40010260: 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; 40010264: 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 ) ) { 40010268: 90 10 00 01 mov %g1, %o0 4001026c: 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; 40010270: 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 ) ) { 40010274: 40 00 00 ba call 4001055c <_POSIX_signals_Unblock_thread> 40010278: 94 07 bf f4 add %fp, -12, %o2 4001027c: 80 8a 20 ff btst 0xff, %o0 40010280: 12 80 00 5a bne 400103e8 40010284: 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 ); 40010288: 40 00 00 a5 call 4001051c <_POSIX_signals_Set_process_signals> 4001028c: 90 10 00 10 mov %l0, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 40010290: a4 24 c0 12 sub %l3, %l2, %l2 40010294: c2 04 40 12 ld [ %l1 + %l2 ], %g1 40010298: 80 a0 60 02 cmp %g1, 2 4001029c: 02 80 00 57 be 400103f8 400102a0: 11 10 00 7c sethi %hi(0x4001f000), %o0 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 400102a4: 7f ff e3 36 call 40008f7c <_Thread_Enable_dispatch> 400102a8: b0 10 20 00 clr %i0 return 0; } 400102ac: 81 c7 e0 08 ret 400102b0: 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 ); 400102b4: 40 00 01 38 call 40010794 400102b8: 01 00 00 00 nop 400102bc: 40 00 00 f9 call 400106a0 400102c0: 92 10 00 19 mov %i1, %o1 400102c4: 81 c7 e0 08 ret 400102c8: 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; 400102cc: 10 bf ff c3 b 400101d8 400102d0: c0 27 bf fc clr [ %fp + -4 ] * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 400102d4: 03 10 00 78 sethi %hi(0x4001e000), %g1 400102d8: da 08 61 d4 ldub [ %g1 + 0x1d4 ], %o5 ! 4001e1d4 400102dc: 13 10 00 7a sethi %hi(0x4001e800), %o1 400102e0: 9a 03 60 01 inc %o5 400102e4: 92 12 63 f8 or %o1, 0x3f8, %o1 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 400102e8: 82 10 20 00 clr %g1 400102ec: 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) ) { 400102f0: 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 ] ) 400102f4: c4 02 40 00 ld [ %o1 ], %g2 400102f8: 80 a0 a0 00 cmp %g2, 0 400102fc: 22 80 00 2d be,a 400103b0 40010300: 92 02 60 04 add %o1, 4, %o1 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 40010304: c4 00 a0 04 ld [ %g2 + 4 ], %g2 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 40010308: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001030c: 80 a3 20 00 cmp %o4, 0 40010310: 02 80 00 27 be 400103ac 40010314: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 40010318: 84 10 20 01 mov 1, %g2 the_thread = (Thread_Control *) object_table[ index ]; 4001031c: 87 28 a0 02 sll %g2, 2, %g3 40010320: c6 02 c0 03 ld [ %o3 + %g3 ], %g3 if ( !the_thread ) 40010324: 80 a0 e0 00 cmp %g3, 0 40010328: 02 80 00 1e be 400103a0 4001032c: 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 ) 40010330: c8 00 e0 14 ld [ %g3 + 0x14 ], %g4 40010334: 80 a1 00 0d cmp %g4, %o5 40010338: 18 80 00 1b bgu 400103a4 4001033c: 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 ]; 40010340: d4 00 e1 60 ld [ %g3 + 0x160 ], %o2 40010344: d4 02 a0 cc ld [ %o2 + 0xcc ], %o2 40010348: 80 ac 00 0a andncc %l0, %o2, %g0 4001034c: 02 80 00 16 be 400103a4 40010350: 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 ) { 40010354: 80 a1 00 0d cmp %g4, %o5 40010358: 2a 80 00 11 bcs,a 4001039c 4001035c: 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 ) ) { 40010360: d4 00 60 10 ld [ %g1 + 0x10 ], %o2 40010364: 80 a2 a0 00 cmp %o2, 0 40010368: 02 80 00 0f be 400103a4 4001036c: 80 a3 00 02 cmp %o4, %g2 /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 40010370: de 00 e0 10 ld [ %g3 + 0x10 ], %o7 40010374: 80 a3 e0 00 cmp %o7, 0 40010378: 22 80 00 09 be,a 4001039c 4001037c: 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) ) { 40010380: 80 8a 80 1a btst %o2, %i2 40010384: 12 80 00 08 bne 400103a4 40010388: 80 a3 00 02 cmp %o4, %g2 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4001038c: 80 8b c0 1a btst %o7, %i2 40010390: 02 80 00 05 be 400103a4 40010394: 80 a3 00 02 cmp %o4, %g2 40010398: 9a 10 00 04 mov %g4, %o5 4001039c: 82 10 00 03 mov %g3, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 400103a0: 80 a3 00 02 cmp %o4, %g2 400103a4: 1a bf ff df bcc 40010320 400103a8: 87 28 a0 02 sll %g2, 2, %g3 400103ac: 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++) { 400103b0: 80 a2 40 08 cmp %o1, %o0 400103b4: 32 bf ff d1 bne,a 400102f8 400103b8: c4 02 40 00 ld [ %o1 ], %g2 } } } } if ( interested ) { 400103bc: 80 a0 60 00 cmp %g1, 0 400103c0: 02 bf ff b2 be 40010288 400103c4: 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 ) ) { 400103c8: 90 10 00 01 mov %g1, %o0 400103cc: 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; 400103d0: 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 ) ) { 400103d4: 40 00 00 62 call 4001055c <_POSIX_signals_Unblock_thread> 400103d8: 94 07 bf f4 add %fp, -12, %o2 400103dc: 80 8a 20 ff btst 0xff, %o0 400103e0: 02 bf ff aa be 40010288 400103e4: 01 00 00 00 nop _Thread_Enable_dispatch(); 400103e8: 7f ff e2 e5 call 40008f7c <_Thread_Enable_dispatch> 400103ec: b0 10 20 00 clr %i0 ! 0 return 0; 400103f0: 81 c7 e0 08 ret 400103f4: 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 *) 400103f8: 7f ff f3 bb call 4000d2e4 <_Chain_Get> 400103fc: 90 12 23 a4 or %o0, 0x3a4, %o0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 40010400: 80 a2 20 00 cmp %o0, 0 40010404: 02 80 00 19 be 40010468 40010408: 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 ); 4001040c: 92 10 00 08 mov %o0, %o1 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 40010410: c2 22 20 08 st %g1, [ %o0 + 8 ] 40010414: c2 07 bf f8 ld [ %fp + -8 ], %g1 40010418: c2 22 20 0c st %g1, [ %o0 + 0xc ] 4001041c: c2 07 bf fc ld [ %fp + -4 ], %g1 40010420: c2 22 20 10 st %g1, [ %o0 + 0x10 ] _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 40010424: 11 10 00 7c sethi %hi(0x4001f000), %o0 40010428: 90 12 23 f4 or %o0, 0x3f4, %o0 ! 4001f3f4 <_POSIX_signals_Siginfo> 4001042c: 7f ff dc a6 call 400076c4 <_Chain_Append> 40010430: 90 02 00 12 add %o0, %l2, %o0 40010434: 30 bf ff 9c b,a 400102a4 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 40010438: 40 00 01 0c call 40010868 <__errno> 4001043c: b0 10 3f ff mov -1, %i0 40010440: 82 10 20 03 mov 3, %g1 40010444: c2 22 00 00 st %g1, [ %o0 ] 40010448: 81 c7 e0 08 ret 4001044c: 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 ); 40010450: 40 00 01 06 call 40010868 <__errno> 40010454: b0 10 3f ff mov -1, %i0 40010458: 82 10 20 16 mov 0x16, %g1 4001045c: c2 22 00 00 st %g1, [ %o0 ] 40010460: 81 c7 e0 08 ret 40010464: 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(); 40010468: 7f ff e2 c5 call 40008f7c <_Thread_Enable_dispatch> 4001046c: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one( EAGAIN ); 40010470: 40 00 00 fe call 40010868 <__errno> 40010474: 01 00 00 00 nop 40010478: 82 10 20 0b mov 0xb, %g1 ! b 4001047c: c2 22 00 00 st %g1, [ %o0 ] 40010480: 81 c7 e0 08 ret 40010484: 81 e8 00 00 restore 4000758c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 4000758c: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 40007590: 80 a6 60 00 cmp %i1, 0 40007594: 02 80 00 19 be 400075f8 40007598: a0 10 00 18 mov %i0, %l0 4000759c: 80 a6 20 00 cmp %i0, 0 400075a0: 02 80 00 16 be 400075f8 400075a4: 01 00 00 00 nop return EINVAL; if ( !once_control->init_executed ) { 400075a8: c2 06 20 04 ld [ %i0 + 4 ], %g1 400075ac: 80 a0 60 00 cmp %g1, 0 400075b0: 12 80 00 10 bne 400075f0 400075b4: b0 10 20 00 clr %i0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 400075b8: a2 07 bf fc add %fp, -4, %l1 400075bc: 90 10 21 00 mov 0x100, %o0 400075c0: 92 10 21 00 mov 0x100, %o1 400075c4: 40 00 03 0b call 400081f0 400075c8: 94 10 00 11 mov %l1, %o2 if ( !once_control->init_executed ) { 400075cc: c2 04 20 04 ld [ %l0 + 4 ], %g1 400075d0: 80 a0 60 00 cmp %g1, 0 400075d4: 02 80 00 0b be 40007600 400075d8: 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); 400075dc: d0 07 bf fc ld [ %fp + -4 ], %o0 <== NOT EXECUTED 400075e0: 94 10 00 11 mov %l1, %o2 400075e4: 92 10 21 00 mov 0x100, %o1 400075e8: 40 00 03 02 call 400081f0 400075ec: b0 10 20 00 clr %i0 } return 0; } 400075f0: 81 c7 e0 08 ret 400075f4: 81 e8 00 00 restore int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 400075f8: 81 c7 e0 08 ret 400075fc: 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; 40007600: c2 24 20 04 st %g1, [ %l0 + 4 ] (*init_routine)(); 40007604: 9f c6 40 00 call %i1 40007608: c2 24 00 00 st %g1, [ %l0 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 4000760c: 10 bf ff f5 b 400075e0 40007610: d0 07 bf fc ld [ %fp + -4 ], %o0 40007188 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 40007188: 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() ) 4000718c: 03 10 00 82 sethi %hi(0x40020800), %g1 40007190: c2 00 62 88 ld [ %g1 + 0x288 ], %g1 ! 40020a88 <_ISR_Nest_level> 40007194: 80 a0 60 00 cmp %g1, 0 40007198: 12 80 00 15 bne 400071ec 4000719c: 03 10 00 82 sethi %hi(0x40020800), %g1 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 400071a0: 21 10 00 82 sethi %hi(0x40020800), %l0 400071a4: c6 00 61 f0 ld [ %g1 + 0x1f0 ], %g3 400071a8: c4 04 22 ac ld [ %l0 + 0x2ac ], %g2 400071ac: 86 00 e0 01 inc %g3 400071b0: c6 20 61 f0 st %g3, [ %g1 + 0x1f0 ] 400071b4: c2 00 a1 60 ld [ %g2 + 0x160 ], %g1 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 400071b8: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 400071bc: 80 a0 a0 00 cmp %g2, 0 400071c0: 12 80 00 0d bne 400071f4 400071c4: 01 00 00 00 nop thread_support->cancelation_requested ) 400071c8: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 400071cc: 80 a0 60 00 cmp %g1, 0 400071d0: 02 80 00 09 be 400071f4 400071d4: 01 00 00 00 nop cancel = true; _Thread_Enable_dispatch(); 400071d8: 40 00 0a 38 call 40009ab8 <_Thread_Enable_dispatch> 400071dc: b2 10 3f ff mov -1, %i1 ! ffffffff if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 400071e0: f0 04 22 ac ld [ %l0 + 0x2ac ], %i0 400071e4: 40 00 19 8f call 4000d820 <_POSIX_Thread_Exit> 400071e8: 81 e8 00 00 restore 400071ec: 81 c7 e0 08 ret <== NOT EXECUTED 400071f0: 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(); 400071f4: 40 00 0a 31 call 40009ab8 <_Thread_Enable_dispatch> 400071f8: 81 e8 00 00 restore 400071fc: 01 00 00 00 nop 40009320 : 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 ) { 40009320: 9d e3 bf a0 save %sp, -96, %sp rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 40009324: 03 10 00 95 sethi %hi(0x40025400), %g1 40009328: c2 00 60 68 ld [ %g1 + 0x68 ], %g1 ! 40025468 <_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; 4000932c: 09 10 00 97 sethi %hi(0x40025c00), %g4 if ( rtems_interrupt_is_in_progress() ) 40009330: 80 a0 60 00 cmp %g1, 0 40009334: 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 ) { 40009338: 82 10 00 19 mov %i1, %g1 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 4000933c: 12 80 00 49 bne 40009460 40009340: c6 01 21 54 ld [ %g4 + 0x154 ], %g3 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 40009344: 80 a6 a0 00 cmp %i2, 0 40009348: 02 80 00 4b be 40009474 4000934c: 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 ) 40009350: 02 80 00 49 be 40009474 40009354: 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; 40009358: c4 06 40 00 ld [ %i1 ], %g2 4000935c: 80 a0 a0 00 cmp %g2, 0 40009360: 22 80 00 42 be,a 40009468 40009364: 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 ) 40009368: 80 a0 c0 18 cmp %g3, %i0 4000936c: 08 80 00 3d bleu 40009460 40009370: 84 10 20 0a mov 0xa, %g2 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40009374: 05 10 00 94 sethi %hi(0x40025000), %g2 40009378: c6 00 a3 d0 ld [ %g2 + 0x3d0 ], %g3 ! 400253d0 <_Thread_Dispatch_disable_level> 4000937c: 86 00 e0 01 inc %g3 40009380: c6 20 a3 d0 st %g3, [ %g2 + 0x3d0 ] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 40009384: 80 a6 20 00 cmp %i0, 0 40009388: 12 80 00 2b bne 40009434 4000938c: 05 10 00 97 sethi %hi(0x40025c00), %g2 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 40009390: da 01 21 54 ld [ %g4 + 0x154 ], %o5 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 40009394: 80 a3 60 00 cmp %o5, 0 40009398: 02 80 00 3a be 40009480 4000939c: d8 00 a1 58 ld [ %g2 + 0x158 ], %o4 400093a0: 10 80 00 05 b 400093b4 400093a4: 86 10 00 0c mov %o4, %g3 400093a8: 80 a3 40 18 cmp %o5, %i0 400093ac: 08 80 00 0b bleu 400093d8 400093b0: 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; 400093b4: c8 00 c0 00 ld [ %g3 ], %g4 400093b8: 80 a1 20 00 cmp %g4, 0 400093bc: 32 bf ff fb bne,a 400093a8 400093c0: b0 06 20 01 inc %i0 400093c4: c8 00 e0 04 ld [ %g3 + 4 ], %g4 400093c8: 80 a1 20 00 cmp %g4, 0 400093cc: 32 bf ff f7 bne,a 400093a8 400093d0: b0 06 20 01 inc %i0 } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) 400093d4: 80 a3 40 18 cmp %o5, %i0 400093d8: 02 80 00 2b be 40009484 400093dc: f0 26 80 00 st %i0, [ %i2 ] 400093e0: 85 2e 20 03 sll %i0, 3, %g2 400093e4: 87 2e 20 05 sll %i0, 5, %g3 400093e8: 84 20 c0 02 sub %g3, %g2, %g2 400093ec: 84 03 00 02 add %o4, %g2, %g2 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 400093f0: c6 00 40 00 ld [ %g1 ], %g3 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 400093f4: b2 10 20 00 clr %i1 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 400093f8: c6 20 80 00 st %g3, [ %g2 ] 400093fc: c6 00 60 04 ld [ %g1 + 4 ], %g3 _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 40009400: b4 10 20 00 clr %i2 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 40009404: c6 20 a0 04 st %g3, [ %g2 + 4 ] 40009408: c6 00 60 08 ld [ %g1 + 8 ], %g3 4000940c: c6 20 a0 08 st %g3, [ %g2 + 8 ] 40009410: c6 00 60 0c ld [ %g1 + 0xc ], %g3 40009414: c6 20 a0 0c st %g3, [ %g2 + 0xc ] 40009418: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000941c: c6 20 a0 10 st %g3, [ %g2 + 0x10 ] 40009420: c2 00 60 14 ld [ %g1 + 0x14 ], %g1 _Thread_Enable_dispatch(); 40009424: 40 00 07 57 call 4000b180 <_Thread_Enable_dispatch> 40009428: c2 20 a0 14 st %g1, [ %g2 + 0x14 ] return rtems_io_initialize( major, 0, NULL ); 4000942c: 40 00 26 d6 call 40012f84 40009430: 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; 40009434: c6 00 a1 58 ld [ %g2 + 0x158 ], %g3 40009438: 89 2e 20 05 sll %i0, 5, %g4 4000943c: 85 2e 20 03 sll %i0, 3, %g2 40009440: 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; 40009444: c8 00 c0 02 ld [ %g3 + %g2 ], %g4 40009448: 80 a1 20 00 cmp %g4, 0 4000944c: 02 80 00 12 be 40009494 40009450: 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(); 40009454: 40 00 07 4b call 4000b180 <_Thread_Enable_dispatch> 40009458: 01 00 00 00 nop 4000945c: 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 ); } 40009460: 81 c7 e0 08 ret 40009464: 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; 40009468: 80 a0 a0 00 cmp %g2, 0 4000946c: 12 bf ff c0 bne 4000936c 40009470: 80 a0 c0 18 cmp %g3, %i0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 40009474: 84 10 20 09 mov 9, %g2 } 40009478: 81 c7 e0 08 ret 4000947c: 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; 40009480: 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(); 40009484: 40 00 07 3f call 4000b180 <_Thread_Enable_dispatch> 40009488: 01 00 00 00 nop return sc; 4000948c: 10 bf ff f5 b 40009460 40009490: 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; 40009494: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40009498: 80 a0 e0 00 cmp %g3, 0 4000949c: 12 bf ff ee bne 40009454 400094a0: 01 00 00 00 nop if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 400094a4: 10 bf ff d3 b 400093f0 400094a8: f0 26 80 00 st %i0, [ %i2 ] 40009ee4 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 40009ee4: 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 ); 40009ee8: 90 10 00 19 mov %i1, %o0 40009eec: 40 00 18 62 call 40010074 <_POSIX_Absolute_timeout_to_ticks> 40009ef0: 92 07 bf fc add %fp, -4, %o1 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40009ef4: 80 a2 20 03 cmp %o0, 3 40009ef8: 02 80 00 07 be 40009f14 40009efc: d4 07 bf fc ld [ %fp + -4 ], %o2 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 40009f00: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED 40009f04: 40 00 1b 4a call 40010c2c <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED 40009f08: 92 10 20 00 clr %o1 <== NOT EXECUTED break; } } return lock_status; } 40009f0c: 81 c7 e0 08 ret <== NOT EXECUTED 40009f10: 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 ); 40009f14: 90 10 00 18 mov %i0, %o0 40009f18: 40 00 1b 45 call 40010c2c <_POSIX_Semaphore_Wait_support> 40009f1c: 92 10 20 01 mov 1, %o1 break; } } return lock_status; } 40009f20: 81 c7 e0 08 ret 40009f24: 91 e8 00 08 restore %g0, %o0, %o0 40009638 : #include int sigsuspend( const sigset_t *sigmask ) { 40009638: 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 ); 4000963c: 90 10 20 01 mov 1, %o0 40009640: 92 10 00 18 mov %i0, %o1 40009644: a0 07 bf fc add %fp, -4, %l0 40009648: 7f ff ff f1 call 4000960c 4000964c: 94 10 00 10 mov %l0, %o2 (void) sigfillset( &all_signals ); 40009650: a2 07 bf f8 add %fp, -8, %l1 40009654: 7f ff ff b7 call 40009530 40009658: 90 10 00 11 mov %l1, %o0 status = sigtimedwait( &all_signals, NULL, NULL ); 4000965c: 90 10 00 11 mov %l1, %o0 40009660: 92 10 20 00 clr %o1 40009664: 40 00 00 2b call 40009710 40009668: 94 10 20 00 clr %o2 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 4000966c: 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 ); 40009670: a2 10 00 08 mov %o0, %l1 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 40009674: 94 10 20 00 clr %o2 40009678: 7f ff ff e5 call 4000960c 4000967c: 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 ) 40009680: 80 a4 7f ff cmp %l1, -1 40009684: 12 80 00 05 bne 40009698 40009688: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINTR ); return status; } 4000968c: b0 10 3f ff mov -1, %i0 ! ffffffff <== NOT EXECUTED 40009690: 81 c7 e0 08 ret <== NOT EXECUTED 40009694: 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 ); 40009698: 40 00 28 86 call 400138b0 <__errno> 4000969c: b0 10 3f ff mov -1, %i0 400096a0: 82 10 20 04 mov 4, %g1 400096a4: c2 22 00 00 st %g1, [ %o0 ] 400096a8: 81 c7 e0 08 ret 400096ac: 81 e8 00 00 restore