RTEMS 4.11Annotated Report
Sat Dec 22 21:29:42 2012
0004b674 <TOD_MICROSECONDS_TO_TICKS>:
* We should ensure the ticks not be truncated by integer division. We
* need to have it be greater than or equal to the requested time. It
* should not be shorter.
*/
microseconds_per_tick = rtems_configuration_get_microseconds_per_tick();
ticks = microseconds / microseconds_per_tick;
4b674: 41f9 0006 0484 lea 60484 <Configuration+0xc>,%a0
#include <rtems/score/tod.h>
uint32_t TOD_MICROSECONDS_TO_TICKS(
uint32_t microseconds
)
{
4b67a: 4e56 0000 linkw %fp,#0
* We should ensure the ticks not be truncated by integer division. We
* need to have it be greater than or equal to the requested time. It
* should not be shorter.
*/
microseconds_per_tick = rtems_configuration_get_microseconds_per_tick();
ticks = microseconds / microseconds_per_tick;
4b67e: 202e 0008 movel %fp@(8),%d0
4b682: 4c50 0001 remul %a0@,%d1,%d0
4b686: 4c50 0000 remul %a0@,%d0,%d0
if ( (microseconds % microseconds_per_tick) != 0 )
4b68a: 4a81 tstl %d1
4b68c: 6702 beqs 4b690 <TOD_MICROSECONDS_TO_TICKS+0x1c> <== ALWAYS TAKEN
ticks += 1;
4b68e: 5280 addql #1,%d0 <== NOT EXECUTED
return ticks;
}
4b690: 4e5e unlk %fp <== NOT EXECUTED
000477b4 <TOD_MILLISECONDS_TO_TICKS>:
#include <rtems/score/tod.h>
uint32_t TOD_MILLISECONDS_TO_TICKS(
uint32_t milliseconds
)
{
477b4: 4e56 0000 linkw %fp,#0
/**
* We should ensure the ticks not be truncated by integer division. We
* need to have it be greater than or equal to the requested time. It
* should not be shorter.
*/
milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick();
477b8: 2039 0005 c6f4 movel 5c6f4 <Configuration+0xc>,%d0
#include <rtems/score/tod.h>
uint32_t TOD_MILLISECONDS_TO_TICKS(
uint32_t milliseconds
)
{
477be: 2f02 movel %d2,%sp@-
/**
* We should ensure the ticks not be truncated by integer division. We
* need to have it be greater than or equal to the requested time. It
* should not be shorter.
*/
milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick();
477c0: 243c 0000 03e8 movel #1000,%d2
477c6: 4c42 0000 remul %d2,%d0,%d0
ticks = milliseconds / milliseconds_per_tick;
477ca: 242e 0008 movel %fp@(8),%d2
477ce: 4c40 2001 remul %d0,%d1,%d2
477d2: 4c40 2002 remul %d0,%d2,%d2
477d6: 2002 movel %d2,%d0
if ( (milliseconds % milliseconds_per_tick) != 0 )
477d8: 4a81 tstl %d1
477da: 6702 beqs 477de <TOD_MILLISECONDS_TO_TICKS+0x2a> <== ALWAYS TAKEN
ticks += 1;
477dc: 5280 addql #1,%d0 <== NOT EXECUTED
return ticks;
}
477de: 241f movel %sp@+,%d2
477e0: 4e5e unlk %fp <== NOT EXECUTED
00046cf0 <_API_Mutex_Unlock>:
#include <rtems/score/apimutex.h>
void _API_Mutex_Unlock(
API_Mutex_Control *the_mutex
)
{
46cf0: 4e56 0000 linkw %fp,#0
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46cf4: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0
++level;
46cfa: 5280 addql #1,%d0
46cfc: 206e 0008 moveal %fp@(8),%a0
_Thread_Dispatch_disable_level = level;
46d00: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level>
/* Dispatch is already disabled in SMP while lock is held. */
#if !defined(RTEMS_SMP)
_Thread_Disable_dispatch();
#endif
_CORE_mutex_Surrender(
46d06: 42a7 clrl %sp@-
46d08: 2f28 0008 movel %a0@(8),%sp@-
46d0c: 4868 0010 pea %a0@(16)
46d10: 4eb9 0004 6fa4 jsr 46fa4 <_CORE_mutex_Surrender>
&the_mutex->Mutex,
the_mutex->Object.id,
NULL
);
_Thread_Enable_dispatch();
46d16: 4fef 000c lea %sp@(12),%sp
}
46d1a: 4e5e unlk %fp
_CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
NULL
);
_Thread_Enable_dispatch();
46d1c: 4ef9 0004 86fc jmp 486fc <_Thread_Enable_dispatch>
...
00048e64 <_CORE_RWLock_Release>:
* Otherwise, we have to block.
* If locked for reading and no waiters, then OK to read.
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
48e64: 223c 0000 0700 movel #1792,%d1
#include <rtems/score/watchdog.h>
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
48e6a: 4e56 fff0 linkw %fp,#-16
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
48e6e: 2079 0006 1de2 moveal 61de2 <_Per_CPU_Information+0xe>,%a0
#include <rtems/score/watchdog.h>
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
48e74: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
48e78: 246e 0008 moveal %fp@(8),%a2
* Otherwise, we have to block.
* If locked for reading and no waiters, then OK to read.
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
48e7c: 40c0 movew %sr,%d0
48e7e: 8280 orl %d0,%d1
48e80: 46c1 movew %d1,%sr
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
48e82: 222a 0044 movel %a2@(68),%d1
48e86: 660a bnes 48e92 <_CORE_RWLock_Release+0x2e>
_ISR_Enable( level );
48e88: 46c0 movew %d0,%sr
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
48e8a: 7002 moveq #2,%d0
48e8c: 2140 0034 movel %d0,%a0@(52)
return CORE_RWLOCK_SUCCESSFUL;
48e90: 6078 bras 48f0a <_CORE_RWLock_Release+0xa6>
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
48e92: 7401 moveq #1,%d2
48e94: b481 cmpl %d1,%d2
48e96: 6610 bnes 48ea8 <_CORE_RWLock_Release+0x44>
the_rwlock->number_of_readers -= 1;
48e98: 222a 0048 movel %a2@(72),%d1
48e9c: 5381 subql #1,%d1
48e9e: 2541 0048 movel %d1,%a2@(72)
if ( the_rwlock->number_of_readers != 0 ) {
48ea2: 6704 beqs 48ea8 <_CORE_RWLock_Release+0x44>
/* must be unlocked again */
_ISR_Enable( level );
48ea4: 46c0 movew %d0,%sr
return CORE_RWLOCK_SUCCESSFUL;
48ea6: 6062 bras 48f0a <_CORE_RWLock_Release+0xa6>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
48ea8: 42a8 0034 clrl %a0@(52)
/*
* Implicitly transition to "unlocked" and find another thread interested
* in obtaining this rwlock.
*/
the_rwlock->current_state = CORE_RWLOCK_UNLOCKED;
48eac: 42aa 0044 clrl %a2@(68)
_ISR_Enable( level );
48eb0: 46c0 movew %d0,%sr
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
48eb2: 2f0a movel %a2,%sp@-
48eb4: 4eb9 0004 a8c0 jsr 4a8c0 <_Thread_queue_Dequeue>
if ( next ) {
48eba: 588f addql #4,%sp
48ebc: 4a80 tstl %d0
48ebe: 674a beqs 48f0a <_CORE_RWLock_Release+0xa6>
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
48ec0: 7201 moveq #1,%d1
48ec2: 2040 moveal %d0,%a0
48ec4: b2a8 0030 cmpl %a0@(48),%d1
48ec8: 6608 bnes 48ed2 <_CORE_RWLock_Release+0x6e>
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
48eca: 7002 moveq #2,%d0
48ecc: 2540 0044 movel %d0,%a2@(68)
return CORE_RWLOCK_SUCCESSFUL;
48ed0: 6038 bras 48f0a <_CORE_RWLock_Release+0xa6>
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
48ed2: 7201 moveq #1,%d1
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
48ed4: 52aa 0048 addql #1,%a2@(72)
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
48ed8: 49f9 0004 acf8 lea 4acf8 <_Thread_queue_First>,%a4
if ( !next ||
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
48ede: 47f9 0004 abc8 lea 4abc8 <_Thread_queue_Extract>,%a3
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
48ee4: 2541 0044 movel %d1,%a2@(68)
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
48ee8: 2f0a movel %a2,%sp@-
48eea: 4e94 jsr %a4@
if ( !next ||
48eec: 588f addql #4,%sp
48eee: 4a80 tstl %d0
48ef0: 6718 beqs 48f0a <_CORE_RWLock_Release+0xa6>
48ef2: 7401 moveq #1,%d2
48ef4: 2040 moveal %d0,%a0
48ef6: b4a8 0030 cmpl %a0@(48),%d2
48efa: 670e beqs 48f0a <_CORE_RWLock_Release+0xa6> <== NEVER TAKEN
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
48efc: 52aa 0048 addql #1,%a2@(72)
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
48f00: 2f00 movel %d0,%sp@-
48f02: 2f0a movel %a2,%sp@-
48f04: 4e93 jsr %a3@
}
48f06: 508f addql #8,%sp
48f08: 60de bras 48ee8 <_CORE_RWLock_Release+0x84>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
48f0a: 4280 clrl %d0
48f0c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
48f12: 4e5e unlk %fp
...
00048f18 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
48f18: 4e56 fffc linkw %fp,#-4
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
48f1c: 486e fffc pea %fp@(-4)
48f20: 2f2e 0008 movel %fp@(8),%sp@-
48f24: 4eb9 0004 a5d0 jsr 4a5d0 <_Thread_Get>
switch ( location ) {
48f2a: 508f addql #8,%sp
48f2c: 4aae fffc tstl %fp@(-4)
48f30: 6618 bnes 48f4a <_CORE_RWLock_Timeout+0x32> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
48f32: 2f00 movel %d0,%sp@-
48f34: 4eb9 0004 addc jsr 4addc <_Thread_queue_Process_timeout>
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
--level;
_Thread_Dispatch_disable_level = level;
48f3a: 588f addql #4,%sp
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
48f3c: 2039 0006 199a movel 6199a <_Thread_Dispatch_disable_level>,%d0
--level;
48f42: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
48f44: 23c0 0006 199a movel %d0,6199a <_Thread_Dispatch_disable_level>
_Thread_Unnest_dispatch();
break;
}
}
48f4a: 4e5e unlk %fp
...
00047ba8 <_CORE_barrier_Wait>:
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
_ISR_Disable( level );
47ba8: 203c 0000 0700 movel #1792,%d0
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
47bae: 4e56 fff4 linkw %fp,#-12
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
47bb2: 2279 0006 0692 moveal 60692 <_Per_CPU_Information+0xe>,%a1
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
47bb8: 48d7 001c moveml %d2-%d4,%sp@
47bbc: 206e 0008 moveal %fp@(8),%a0
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
47bc0: 42a9 0034 clrl %a1@(52)
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
47bc4: 242e 000c movel %fp@(12),%d2
47bc8: 262e 0014 movel %fp@(20),%d3
47bcc: 282e 0018 movel %fp@(24),%d4
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
_ISR_Disable( level );
47bd0: 40c1 movew %sr,%d1
47bd2: 8081 orl %d1,%d0
47bd4: 46c0 movew %d0,%sr
the_barrier->number_of_waiting_threads++;
47bd6: 2028 0048 movel %a0@(72),%d0
47bda: 5280 addql #1,%d0
47bdc: 2140 0048 movel %d0,%a0@(72)
if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) {
47be0: 4aa8 0040 tstl %a0@(64)
47be4: 6626 bnes 47c0c <_CORE_barrier_Wait+0x64>
if ( the_barrier->number_of_waiting_threads ==
47be6: b0a8 0044 cmpl %a0@(68),%d0
47bea: 6620 bnes 47c0c <_CORE_barrier_Wait+0x64>
the_barrier->Attributes.maximum_count) {
executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
47bec: 7001 moveq #1,%d0
47bee: 2340 0034 movel %d0,%a1@(52)
_ISR_Enable( level );
47bf2: 46c1 movew %d1,%sr
_CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
47bf4: 2d44 0010 movel %d4,%fp@(16)
47bf8: 2d42 000c movel %d2,%fp@(12)
executing->Wait.queue = &the_barrier->Wait_queue;
executing->Wait.id = id;
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
}
47bfc: 4cd7 001c moveml %sp@,%d2-%d4
if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) {
if ( the_barrier->number_of_waiting_threads ==
the_barrier->Attributes.maximum_count) {
executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
_ISR_Enable( level );
_CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
47c00: 2d48 0008 movel %a0,%fp@(8)
executing->Wait.queue = &the_barrier->Wait_queue;
executing->Wait.id = id;
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
}
47c04: 4e5e unlk %fp
if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) {
if ( the_barrier->number_of_waiting_threads ==
the_barrier->Attributes.maximum_count) {
executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
_ISR_Enable( level );
_CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
47c06: 4ef9 0004 c1a4 jmp 4c1a4 <_CORE_barrier_Release>
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
47c0c: 7001 moveq #1,%d0
47c0e: 2140 0030 movel %d0,%a0@(48)
return;
}
}
_Thread_queue_Enter_critical_section( &the_barrier->Wait_queue );
executing->Wait.queue = &the_barrier->Wait_queue;
47c12: 2348 0044 movel %a0,%a1@(68)
executing->Wait.id = id;
47c16: 2342 0020 movel %d2,%a1@(32)
_ISR_Enable( level );
47c1a: 46c1 movew %d1,%sr
_Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
47c1c: 2d43 000c movel %d3,%fp@(12)
47c20: 203c 0004 9c28 movel #302120,%d0
47c26: 2d48 0008 movel %a0,%fp@(8)
}
47c2a: 4cd7 001c moveml %sp@,%d2-%d4
_Thread_queue_Enter_critical_section( &the_barrier->Wait_queue );
executing->Wait.queue = &the_barrier->Wait_queue;
executing->Wait.id = id;
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
47c2e: 2d40 0010 movel %d0,%fp@(16)
}
47c32: 4e5e unlk %fp
_Thread_queue_Enter_critical_section( &the_barrier->Wait_queue );
executing->Wait.queue = &the_barrier->Wait_queue;
executing->Wait.id = id;
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
47c34: 4ef9 0004 9938 jmp 49938 <_Thread_queue_Enqueue_with_handler>
...
0004e754 <_CORE_message_queue_Initialize>:
/*
* Check if allocated_message_size is aligned to uintptr-size boundary.
* If not, it will increase allocated_message_size to multiplicity of pointer
* size.
*/
if (allocated_message_size & (sizeof(uintptr_t) - 1)) {
4e754: 7003 moveq #3,%d0
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Attributes *the_message_queue_attributes,
uint32_t maximum_pending_messages,
size_t maximum_message_size
)
{
4e756: 4e56 ffe4 linkw %fp,#-28
4e75a: 222e 0014 movel %fp@(20),%d1
4e75e: 48d7 04fc moveml %d2-%d7/%a2,%sp@
4e762: 246e 0008 moveal %fp@(8),%a2
4e766: 282e 0010 movel %fp@(16),%d4
/*
* Check if allocated_message_size is aligned to uintptr-size boundary.
* If not, it will increase allocated_message_size to multiplicity of pointer
* size.
*/
if (allocated_message_size & (sizeof(uintptr_t) - 1)) {
4e76a: c081 andl %d1,%d0
)
{
size_t message_buffering_required = 0;
size_t allocated_message_size;
the_message_queue->maximum_pending_messages = maximum_pending_messages;
4e76c: 2544 0044 movel %d4,%a2@(68)
the_message_queue->number_of_pending_messages = 0;
4e770: 42aa 0048 clrl %a2@(72)
the_message_queue->maximum_message_size = maximum_message_size;
4e774: 2541 004c movel %d1,%a2@(76)
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Notify_Handler the_handler,
void *the_argument
)
{
the_message_queue->notify_handler = the_handler;
4e778: 42aa 0060 clrl %a2@(96)
the_message_queue->notify_argument = the_argument;
4e77c: 42aa 0064 clrl %a2@(100)
/*
* Check if allocated_message_size is aligned to uintptr-size boundary.
* If not, it will increase allocated_message_size to multiplicity of pointer
* size.
*/
if (allocated_message_size & (sizeof(uintptr_t) - 1)) {
4e780: 4a80 tstl %d0
4e782: 6712 beqs 4e796 <_CORE_message_queue_Initialize+0x42>
allocated_message_size += sizeof(uintptr_t);
4e784: 2001 movel %d1,%d0
4e786: 5880 addql #4,%d0
allocated_message_size &= ~(sizeof(uintptr_t) - 1);
4e788: 74fc moveq #-4,%d2
4e78a: c082 andl %d2,%d0
/*
* Check for an overflow. It can occur while increasing allocated_message_size
* to multiplicity of uintptr_t above.
*/
if (allocated_message_size < maximum_message_size)
4e78c: b280 cmpl %d0,%d1
4e78e: 6308 blss 4e798 <_CORE_message_queue_Initialize+0x44>
return false;
4e790: 4200 clrb %d0
4e792: 6000 0086 braw 4e81a <_CORE_message_queue_Initialize+0xc6>
/*
* Check if allocated_message_size is aligned to uintptr-size boundary.
* If not, it will increase allocated_message_size to multiplicity of pointer
* size.
*/
if (allocated_message_size & (sizeof(uintptr_t) - 1)) {
4e796: 2001 movel %d1,%d0
/*
* Calculate how much total memory is required for message buffering and
* check for overflow on the multiplication.
*/
if ( !size_t_mult32_with_overflow(
4e798: 2a00 movel %d0,%d5
4e79a: 0685 0000 0014 addil #20,%d5
size_t a,
size_t b,
size_t *c
)
{
long long x = (long long)a*b;
4e7a0: 2f05 movel %d5,%sp@-
if ( x > SIZE_MAX )
4e7a2: 4286 clrl %d6
4e7a4: 7eff moveq #-1,%d7
size_t a,
size_t b,
size_t *c
)
{
long long x = (long long)a*b;
4e7a6: 42a7 clrl %sp@-
4e7a8: 2f04 movel %d4,%sp@-
4e7aa: 42a7 clrl %sp@-
4e7ac: 4eb9 0006 1704 jsr 61704 <__muldi3>
4e7b2: 4fef 0010 lea %sp@(16),%sp
4e7b6: 2400 movel %d0,%d2
4e7b8: 2601 movel %d1,%d3
if ( x > SIZE_MAX )
4e7ba: 9e83 subl %d3,%d7
4e7bc: 9d82 subxl %d2,%d6
4e7be: 6dd0 blts 4e790 <_CORE_message_queue_Initialize+0x3c><== NEVER TAKEN
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
_Workspace_Allocate( message_buffering_required );
4e7c0: 2f01 movel %d1,%sp@-
4e7c2: 4eb9 0005 11cc jsr 511cc <_Workspace_Allocate>
if (the_message_queue->message_buffers == 0)
4e7c8: 588f addql #4,%sp
return false;
/*
* Attempt to allocate the message memory
*/
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
4e7ca: 2540 005c movel %d0,%a2@(92)
_Workspace_Allocate( message_buffering_required );
if (the_message_queue->message_buffers == 0)
4e7ce: 67c0 beqs 4e790 <_CORE_message_queue_Initialize+0x3c>
/*
* Initialize the pool of inactive messages, pending messages,
* and set of waiting threads.
*/
_Chain_Initialize (
4e7d0: 2f05 movel %d5,%sp@-
4e7d2: 2f04 movel %d4,%sp@-
4e7d4: 2f00 movel %d0,%sp@-
4e7d6: 486a 0068 pea %a2@(104)
4e7da: 4eb9 0004 e710 jsr 4e710 <_Chain_Initialize>
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
4e7e0: 41ea 0054 lea %a2@(84),%a0
*/
RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority(
CORE_message_queue_Attributes *the_attribute
)
{
return
4e7e4: 7001 moveq #1,%d0
4e7e6: 2548 0050 movel %a0,%a2@(80)
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
4e7ea: 41ea 0050 lea %a2@(80),%a0
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
4e7ee: 42aa 0054 clrl %a2@(84)
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
4e7f2: 2548 0058 movel %a0,%a2@(88)
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
);
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
_Thread_queue_Initialize(
4e7f6: 4878 0006 pea 6 <EXTENDSFDF>
4e7fa: 206e 000c moveal %fp@(12),%a0
4e7fe: 4878 0080 pea 80 <DBL_MANT_DIG+0x4b>
4e802: b090 cmpl %a0@,%d0
4e804: 57c0 seq %d0
4e806: 49c0 extbl %d0
4e808: 4480 negl %d0
4e80a: 2f00 movel %d0,%sp@-
4e80c: 2f0a movel %a2,%sp@-
4e80e: 4eb9 0005 0a80 jsr 50a80 <_Thread_queue_Initialize>
4e814: 4fef 0020 lea %sp@(32),%sp
THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
STATES_WAITING_FOR_MESSAGE,
CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
);
return true;
4e818: 7001 moveq #1,%d0
}
4e81a: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2
4e820: 4e5e unlk %fp <== NOT EXECUTED
0004e824 <_CORE_message_queue_Seize>:
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
_ISR_Disable( level );
4e824: 223c 0000 0700 movel #1792,%d1
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
4e82a: 4e56 ffe4 linkw %fp,#-28
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
4e82e: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
4e834: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@
4e838: 246e 0008 moveal %fp@(8),%a2
4e83c: 262e 000c movel %fp@(12),%d3
4e840: 286e 0010 moveal %fp@(16),%a4
4e844: 226e 0014 moveal %fp@(20),%a1
4e848: 242e 001c movel %fp@(28),%d2
4e84c: 182e 001b moveb %fp@(27),%d4
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
4e850: 42a8 0034 clrl %a0@(52)
_ISR_Disable( level );
4e854: 40c0 movew %sr,%d0
4e856: 8280 orl %d0,%d1
4e858: 46c1 movew %d1,%sr
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4e85a: 220a movel %a2,%d1
4e85c: 2a0a movel %a2,%d5
4e85e: 0681 0000 0050 addil #80,%d1
4e864: 0685 0000 0054 addil #84,%d5
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4e86a: 266a 0050 moveal %a2@(80),%a3
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
4e86e: ba8b cmpl %a3,%d5
4e870: 6700 009c beqw 4e90e <_CORE_message_queue_Seize+0xea>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
4e874: 2053 moveal %a3@,%a0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
4e876: 2141 0004 movel %d1,%a0@(4)
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
4e87a: 53aa 0048 subql #1,%a2@(72)
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
4e87e: 2548 0050 movel %a0,%a2@(80)
_ISR_Enable( level );
4e882: 46c0 movew %d0,%sr
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
4e884: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0
_CORE_message_queue_Get_message_priority( the_message );
_CORE_message_queue_Copy_buffer(
the_message->Contents.buffer,
4e88a: 240b movel %a3,%d2
4e88c: 0682 0000 0010 addil #16,%d2
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
_ISR_Enable( level );
*size_p = the_message->Contents.size;
4e892: 22ab 000c movel %a3@(12),%a1@
_Thread_Executing->Wait.count =
4e896: 216b 0008 0024 movel %a3@(8),%a0@(36)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
4e89c: 2f11 movel %a1@,%sp@-
4e89e: 2f02 movel %d2,%sp@-
4e8a0: 2f0c movel %a4,%sp@-
4e8a2: 49f9 0005 581c lea 5581c <memcpy>,%a4
4e8a8: 4e94 jsr %a4@
* is not, then we can go ahead and free the buffer.
*
* NOTE: If we note that the queue was not full before this receive,
* then we can avoid this dequeue.
*/
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
4e8aa: 2f0a movel %a2,%sp@-
4e8ac: 4eb9 0005 0720 jsr 50720 <_Thread_queue_Dequeue>
if ( !the_thread ) {
4e8b2: 4fef 0010 lea %sp@(16),%sp
* is not, then we can go ahead and free the buffer.
*
* NOTE: If we note that the queue was not full before this receive,
* then we can avoid this dequeue.
*/
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
4e8b6: 2040 moveal %d0,%a0
if ( !the_thread ) {
4e8b8: 4a80 tstl %d0
4e8ba: 661a bnes 4e8d6 <_CORE_message_queue_Seize+0xb2> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Buffer_control *the_message
)
{
_Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
4e8bc: 45ea 0068 lea %a2@(104),%a2
4e8c0: 2d4b 000c movel %a3,%fp@(12)
4e8c4: 2d4a 0008 movel %a2,%fp@(8)
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
}
4e8c8: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
4e8ce: 4e5e unlk %fp
4e8d0: 4ef9 0004 e6a4 jmp 4e6a4 <_Chain_Append>
*/
_CORE_message_queue_Set_message_priority(
the_message,
the_thread->Wait.count
);
the_message->Contents.size = (size_t) the_thread->Wait.option;
4e8d6: 2028 0030 movel %a0@(48),%d0
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
4e8da: 2768 0024 0008 movel %a0@(36),%a3@(8)
4e8e0: 2740 000c movel %d0,%a3@(12)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
4e8e4: 2f00 movel %d0,%sp@-
4e8e6: 2f28 002c movel %a0@(44),%sp@-
4e8ea: 2f02 movel %d2,%sp@-
4e8ec: 4e94 jsr %a4@
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
4e8ee: 2d6b 0008 0010 movel %a3@(8),%fp@(16)
4e8f4: 4fef 000c lea %sp@(12),%sp
4e8f8: 2d4b 000c movel %a3,%fp@(12)
4e8fc: 2d4a 0008 movel %a2,%fp@(8)
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
}
4e900: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
4e906: 4e5e unlk %fp
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
4e908: 4ef9 0005 315c jmp 5315c <_CORE_message_queue_Insert_message>
return;
}
#endif
}
if ( !wait ) {
4e90e: 4a04 tstb %d4
4e910: 660a bnes 4e91c <_CORE_message_queue_Seize+0xf8>
_ISR_Enable( level );
4e912: 46c0 movew %d0,%sr
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
4e914: 7004 moveq #4,%d0
4e916: 2140 0034 movel %d0,%a0@(52)
return;
4e91a: 6038 bras 4e954 <_CORE_message_queue_Seize+0x130>
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
4e91c: 7201 moveq #1,%d1
4e91e: 2541 0030 movel %d1,%a2@(48)
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
executing->Wait.id = id;
executing->Wait.return_argument_second.mutable_object = buffer;
4e922: 214c 002c movel %a4,%a0@(44)
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
return;
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
4e926: 214a 0044 movel %a2,%a0@(68)
executing->Wait.id = id;
4e92a: 2143 0020 movel %d3,%a0@(32)
executing->Wait.return_argument_second.mutable_object = buffer;
executing->Wait.return_argument = size_p;
4e92e: 2149 0028 movel %a1,%a0@(40)
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
4e932: 46c0 movew %d0,%sr
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
4e934: 2d42 000c movel %d2,%fp@(12)
4e938: 203c 0005 0b48 movel #330568,%d0
4e93e: 2d4a 0008 movel %a2,%fp@(8)
}
4e942: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
executing->Wait.return_argument_second.mutable_object = buffer;
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
4e948: 2d40 0010 movel %d0,%fp@(16)
}
4e94c: 4e5e unlk %fp
executing->Wait.return_argument_second.mutable_object = buffer;
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
4e94e: 4ef9 0005 0858 jmp 50858 <_Thread_queue_Enqueue_with_handler>
}
4e954: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
4e95a: 4e5e unlk %fp
...
0004e960 <_CORE_message_queue_Submit>:
#endif
CORE_message_queue_Submit_types submit_type,
bool wait,
Watchdog_Interval timeout
)
{
4e960: 4e56 ffe8 linkw %fp,#-24
4e964: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@
4e968: 246e 0008 moveal %fp@(8),%a2
4e96c: 282e 000c movel %fp@(12),%d4
4e970: 242e 0010 movel %fp@(16),%d2
4e974: 262e 001c movel %fp@(28),%d3
4e978: 1a2e 0023 moveb %fp@(35),%d5
CORE_message_queue_Buffer_control *the_message;
Thread_Control *the_thread;
if ( size > the_message_queue->maximum_message_size ) {
4e97c: b4aa 004c cmpl %a2@(76),%d2
4e980: 6200 00c8 bhiw 4ea4a <_CORE_message_queue_Submit+0xea>
}
/*
* Is there a thread currently waiting on this message queue?
*/
if ( the_message_queue->number_of_pending_messages == 0 ) {
4e984: 4aaa 0048 tstl %a2@(72)
4e988: 662e bnes 4e9b8 <_CORE_message_queue_Submit+0x58>
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
4e98a: 2f0a movel %a2,%sp@-
4e98c: 4eb9 0005 0720 jsr 50720 <_Thread_queue_Dequeue>
if ( the_thread ) {
4e992: 588f addql #4,%sp
/*
* Is there a thread currently waiting on this message queue?
*/
if ( the_message_queue->number_of_pending_messages == 0 ) {
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
4e994: 2640 moveal %d0,%a3
if ( the_thread ) {
4e996: 4a80 tstl %d0
4e998: 671e beqs 4e9b8 <_CORE_message_queue_Submit+0x58>
4e99a: 2f02 movel %d2,%sp@-
4e99c: 2f04 movel %d4,%sp@-
4e99e: 2f2b 002c movel %a3@(44),%sp@-
4e9a2: 4eb9 0005 581c jsr 5581c <memcpy>
_CORE_message_queue_Copy_buffer(
buffer,
the_thread->Wait.return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
4e9a8: 206b 0028 moveal %a3@(40),%a0
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_message_queue_mp_support) ( the_thread, id );
#endif
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
4e9ac: 4fef 000c lea %sp@(12),%sp
_CORE_message_queue_Copy_buffer(
buffer,
the_thread->Wait.return_argument_second.mutable_object,
size
);
*(size_t *) the_thread->Wait.return_argument = size;
4e9b0: 2082 movel %d2,%a0@
the_thread->Wait.count = (uint32_t) submit_type;
4e9b2: 2743 0024 movel %d3,%a3@(36)
4e9b6: 6038 bras 4e9f0 <_CORE_message_queue_Submit+0x90>
RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control *
_CORE_message_queue_Allocate_message_buffer (
CORE_message_queue_Control *the_message_queue
)
{
return (CORE_message_queue_Buffer_control *)
4e9b8: 486a 0068 pea %a2@(104)
4e9bc: 4eb9 0004 e6dc jsr 4e6dc <_Chain_Get>
* No one waiting on the message queue at this time, so attempt to
* queue the message up for a future receive.
*/
the_message =
_CORE_message_queue_Allocate_message_buffer( the_message_queue );
if ( the_message ) {
4e9c2: 588f addql #4,%sp
4e9c4: 2640 moveal %d0,%a3
4e9c6: 4a80 tstl %d0
4e9c8: 672a beqs 4e9f4 <_CORE_message_queue_Submit+0x94>
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
4e9ca: 2f02 movel %d2,%sp@-
4e9cc: 2f04 movel %d4,%sp@-
4e9ce: 486b 0010 pea %a3@(16)
4e9d2: 4eb9 0005 581c jsr 5581c <memcpy>
_CORE_message_queue_Copy_buffer(
buffer,
the_message->Contents.buffer,
size
);
the_message->Contents.size = size;
4e9d8: 2742 000c movel %d2,%a3@(12)
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
4e9dc: 2743 0008 movel %d3,%a3@(8)
_CORE_message_queue_Set_message_priority( the_message, submit_type );
_CORE_message_queue_Insert_message(
4e9e0: 2f03 movel %d3,%sp@-
4e9e2: 2f0b movel %a3,%sp@-
4e9e4: 2f0a movel %a2,%sp@-
4e9e6: 4eb9 0005 315c jsr 5315c <_CORE_message_queue_Insert_message>
the_message_queue,
the_message,
submit_type
);
return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
4e9ec: 4fef 0018 lea %sp@(24),%sp
4e9f0: 4280 clrl %d0
4e9f2: 6060 bras 4ea54 <_CORE_message_queue_Submit+0xf4>
/*
* No message buffers were available so we may need to return an
* overflow error or block the sender until the message is placed
* on the queue.
*/
if ( !wait ) {
4e9f4: 4a05 tstb %d5
4e9f6: 6756 beqs 4ea4e <_CORE_message_queue_Submit+0xee>
/*
* Do NOT block on a send if the caller is in an ISR. It is
* deadly to block in an ISR.
*/
if ( _ISR_Is_in_progress() ) {
4e9f8: 4ab9 0006 7c80 tstl 67c80 <_Per_CPU_Information+0x8>
4e9fe: 6652 bnes 4ea52 <_CORE_message_queue_Submit+0xf2><== NEVER TAKEN
* Thus the unusual choice to open a new scope and declare
* it as a variable. Doing this emphasizes how dangerous it
* would be to use this variable prior to here.
*/
{
Thread_Control *executing = _Thread_Executing;
4ea00: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0
ISR_Level level;
_ISR_Disable( level );
4ea06: 203c 0000 0700 movel #1792,%d0
4ea0c: 40c1 movew %sr,%d1
4ea0e: 8081 orl %d1,%d0
4ea10: 46c0 movew %d0,%sr
4ea12: 7001 moveq #1,%d0
4ea14: 2540 0030 movel %d0,%a2@(48)
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
executing->Wait.id = id;
4ea18: 216e 0014 0020 movel %fp@(20),%a0@(32)
Thread_Control *executing = _Thread_Executing;
ISR_Level level;
_ISR_Disable( level );
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
4ea1e: 214a 0044 movel %a2,%a0@(68)
executing->Wait.id = id;
executing->Wait.return_argument_second.immutable_object = buffer;
4ea22: 2144 002c movel %d4,%a0@(44)
executing->Wait.option = (uint32_t) size;
4ea26: 2142 0030 movel %d2,%a0@(48)
executing->Wait.count = submit_type;
4ea2a: 2143 0024 movel %d3,%a0@(36)
_ISR_Enable( level );
4ea2e: 46c1 movew %d1,%sr
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
4ea30: 4879 0005 0b48 pea 50b48 <_Thread_queue_Timeout>
4ea36: 2f2e 0024 movel %fp@(36),%sp@-
4ea3a: 2f0a movel %a2,%sp@-
4ea3c: 4eb9 0005 0858 jsr 50858 <_Thread_queue_Enqueue_with_handler>
}
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT;
4ea42: 4fef 000c lea %sp@(12),%sp
4ea46: 7007 moveq #7,%d0
4ea48: 600a bras 4ea54 <_CORE_message_queue_Submit+0xf4>
{
CORE_message_queue_Buffer_control *the_message;
Thread_Control *the_thread;
if ( size > the_message_queue->maximum_message_size ) {
return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE;
4ea4a: 7001 moveq #1,%d0
4ea4c: 6006 bras 4ea54 <_CORE_message_queue_Submit+0xf4>
* No message buffers were available so we may need to return an
* overflow error or block the sender until the message is placed
* on the queue.
*/
if ( !wait ) {
return CORE_MESSAGE_QUEUE_STATUS_TOO_MANY;
4ea4e: 7002 moveq #2,%d0
4ea50: 6002 bras 4ea54 <_CORE_message_queue_Submit+0xf4>
/*
* Do NOT block on a send if the caller is in an ISR. It is
* deadly to block in an ISR.
*/
if ( _ISR_Is_in_progress() ) {
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED;
4ea52: 7003 moveq #3,%d0
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
}
return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT;
#endif
}
4ea54: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3
4ea5a: 4e5e unlk %fp
...
000470dc <_CORE_semaphore_Surrender>:
CORE_semaphore_Status _CORE_semaphore_Surrender(
CORE_semaphore_Control *the_semaphore,
Objects_Id id,
CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
)
{
470dc: 4e56 0000 linkw %fp,#0
470e0: 2f0a movel %a2,%sp@-
470e2: 246e 0008 moveal %fp@(8),%a2
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
470e6: 2f0a movel %a2,%sp@-
470e8: 4eb9 0004 8a0c jsr 48a0c <_Thread_queue_Dequeue>
470ee: 588f addql #4,%sp
470f0: 4a80 tstl %d0
470f2: 6624 bnes 47118 <_CORE_semaphore_Surrender+0x3c>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
470f4: 303c 0700 movew #1792,%d0
470f8: 40c1 movew %sr,%d1
470fa: 8081 orl %d1,%d0
470fc: 46c0 movew %d0,%sr
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
470fe: 202a 0048 movel %a2@(72),%d0
47102: b0aa 0040 cmpl %a2@(64),%d0
47106: 640a bccs 47112 <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN
the_semaphore->count += 1;
47108: 5280 addql #1,%d0
4710a: 2540 0048 movel %d0,%a2@(72)
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
4710e: 4280 clrl %d0
47110: 6002 bras 47114 <_CORE_semaphore_Surrender+0x38>
} else {
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
47112: 7004 moveq #4,%d0 <== NOT EXECUTED
_ISR_Enable( level );
47114: 46c1 movew %d1,%sr
47116: 6002 bras 4711a <_CORE_semaphore_Surrender+0x3e>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
47118: 4280 clrl %d0
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
}
return status;
}
4711a: 246e fffc moveal %fp@(-4),%a2
4711e: 4e5e unlk %fp
...
00045ed8 <_Event_Surrender>:
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
_ISR_Disable( level );
45ed8: 203c 0000 0700 movel #1792,%d0
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
45ede: 4e56 ffe4 linkw %fp,#-28
45ee2: 206e 0010 moveal %fp@(16),%a0
45ee6: 48d7 04fc moveml %d2-%d7/%a2,%sp@
45eea: 246e 0008 moveal %fp@(8),%a2
45eee: 242e 000c movel %fp@(12),%d2
rtems_event_set pending_events;
rtems_event_set event_condition;
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
45ef2: 282a 0030 movel %a2@(48),%d4
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
45ef6: 226e 0014 moveal %fp@(20),%a1
45efa: 2a2e 0018 movel %fp@(24),%d5
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
_ISR_Disable( level );
45efe: 40c1 movew %sr,%d1
45f00: 8081 orl %d1,%d0
45f02: 46c0 movew %d0,%sr
RTEMS_INLINE_ROUTINE void _Event_sets_Post(
rtems_event_set the_new_events,
rtems_event_set *the_event_set
)
{
*the_event_set |= the_new_events;
45f04: 8490 orl %a0@,%d2
45f06: 2082 movel %d2,%a0@
_Event_sets_Post( event_in, &event->pending_events );
pending_events = event->pending_events;
event_condition = the_thread->Wait.count;
45f08: 262a 0024 movel %a2@(36),%d3
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
rtems_event_set the_event_set,
rtems_event_set the_event_condition
)
{
return ( the_event_set & the_event_condition );
45f0c: 2002 movel %d2,%d0
45f0e: c083 andl %d3,%d0
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
45f10: 6604 bnes 45f16 <_Event_Surrender+0x3e>
45f12: 6000 00aa braw 45fbe <_Event_Surrender+0xe6>
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
45f16: 4ab9 0005 f318 tstl 5f318 <_Per_CPU_Information+0x8>
45f1c: 6736 beqs 45f54 <_Event_Surrender+0x7c>
45f1e: b5f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a2
45f24: 662e bnes 45f54 <_Event_Surrender+0x7c>
_Thread_Is_executing( the_thread ) &&
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
45f26: 2c11 movel %a1@,%d6
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
45f28: 7e01 moveq #1,%d7
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
45f2a: 5386 subql #1,%d6
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
45f2c: be86 cmpl %d6,%d7
45f2e: 6524 bcss 45f54 <_Event_Surrender+0x7c> <== NEVER TAKEN
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
45f30: b680 cmpl %d0,%d3
45f32: 6708 beqs 45f3c <_Event_Surrender+0x64> <== NEVER TAKEN
45f34: 0804 0001 btst #1,%d4
45f38: 6700 0084 beqw 45fbe <_Event_Surrender+0xe6>
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)
{
return ( the_event_set & ~(the_mask) );
45f3c: 2600 movel %d0,%d3
45f3e: 4683 notl %d3
45f40: c682 andl %d2,%d3
45f42: 2083 movel %d3,%a0@
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
45f44: 206a 0028 moveal %a2@(40),%a0
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
45f48: 42aa 0024 clrl %a2@(36)
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
45f4c: 2080 movel %d0,%a0@
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
45f4e: 7003 moveq #3,%d0
45f50: 2280 movel %d0,%a1@
45f52: 606a bras 45fbe <_Event_Surrender+0xe6>
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
45f54: caaa 0010 andl %a2@(16),%d5
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
45f58: 6764 beqs 45fbe <_Event_Surrender+0xe6>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
45f5a: b680 cmpl %d0,%d3
45f5c: 6706 beqs 45f64 <_Event_Surrender+0x8c>
45f5e: 0804 0001 btst #1,%d4
45f62: 675a beqs 45fbe <_Event_Surrender+0xe6> <== NEVER TAKEN
45f64: 2600 movel %d0,%d3
45f66: 4683 notl %d3
45f68: c682 andl %d2,%d3
45f6a: 2083 movel %d3,%a0@
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
45f6c: 206a 0028 moveal %a2@(40),%a0
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
45f70: 42aa 0024 clrl %a2@(36)
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
45f74: 2080 movel %d0,%a0@
_ISR_Flash( level );
45f76: 203c 0000 0700 movel #1792,%d0
45f7c: 46c1 movew %d1,%sr
45f7e: 8081 orl %d1,%d0
45f80: 46c0 movew %d0,%sr
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
45f82: 7002 moveq #2,%d0
45f84: b0aa 0050 cmpl %a2@(80),%d0
45f88: 6704 beqs 45f8e <_Event_Surrender+0xb6>
_ISR_Enable( level );
45f8a: 46c1 movew %d1,%sr
45f8c: 6014 bras 45fa2 <_Event_Surrender+0xca>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
45f8e: 7003 moveq #3,%d0
45f90: 2540 0050 movel %d0,%a2@(80)
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
45f94: 46c1 movew %d1,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
45f96: 486a 0048 pea %a2@(72)
45f9a: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
45fa0: 588f addql #4,%sp
45fa2: 2d4a 0008 movel %a2,%fp@(8)
45fa6: 2e3c 1007 fff8 movel #268959736,%d7
45fac: 2d47 000c movel %d7,%fp@(12)
}
return;
}
}
_ISR_Enable( level );
}
45fb0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2
45fb6: 4e5e unlk %fp
45fb8: 4ef9 0004 8388 jmp 48388 <_Thread_Clear_state>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
45fbe: 46c1 movew %d1,%sr
}
45fc0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2
45fc6: 4e5e unlk %fp
...
00045fcc <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *arg
)
{
45fcc: 4e56 fffc linkw %fp,#-4
45fd0: 2f0a movel %a2,%sp@-
45fd2: 246e 000c moveal %fp@(12),%a2
45fd6: 2f02 movel %d2,%sp@-
ISR_Level level;
Thread_blocking_operation_States *sync_state;
sync_state = arg;
the_thread = _Thread_Get( id, &location );
45fd8: 486e fffc pea %fp@(-4)
45fdc: 2f2e 0008 movel %fp@(8),%sp@-
45fe0: 4eb9 0004 871c jsr 4871c <_Thread_Get>
switch ( location ) {
45fe6: 508f addql #8,%sp
45fe8: 4aae fffc tstl %fp@(-4)
45fec: 664c bnes 4603a <_Event_Timeout+0x6e> <== NEVER TAKEN
*
* If it is not satisfied, then it is "nothing happened" and
* this is the "timeout" transition. After a request is satisfied,
* a timeout is not allowed to occur.
*/
_ISR_Disable( level );
45fee: 223c 0000 0700 movel #1792,%d1
45ff4: 40c2 movew %sr,%d2
45ff6: 8282 orl %d2,%d1
45ff8: 46c1 movew %d1,%sr
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
45ffa: 2040 moveal %d0,%a0
45ffc: 42a8 0024 clrl %a0@(36)
if ( _Thread_Is_executing( the_thread ) ) {
46000: b0b9 0005 f31e cmpl 5f31e <_Per_CPU_Information+0xe>,%d0
46006: 660a bnes 46012 <_Event_Timeout+0x46>
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
46008: 7201 moveq #1,%d1
4600a: b292 cmpl %a2@,%d1
4600c: 6604 bnes 46012 <_Event_Timeout+0x46>
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
4600e: 7202 moveq #2,%d1
46010: 2481 movel %d1,%a2@
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
46012: 7206 moveq #6,%d1
46014: 2040 moveal %d0,%a0
46016: 2141 0034 movel %d1,%a0@(52)
_ISR_Enable( level );
4601a: 46c2 movew %d2,%sr
4601c: 2f3c 1007 fff8 movel #268959736,%sp@-
46022: 2f00 movel %d0,%sp@-
46024: 4eb9 0004 8388 jsr 48388 <_Thread_Clear_state>
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
--level;
_Thread_Dispatch_disable_level = level;
4602a: 508f addql #8,%sp
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4602c: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0
--level;
46032: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
46034: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level>
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
4603a: 242e fff4 movel %fp@(-12),%d2
4603e: 246e fff8 moveal %fp@(-8),%a2
46042: 4e5e unlk %fp
...
0004745a <_Heap_Block_allocate>:
- 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;
4745a: 70fe moveq #-2,%d0
Heap_Control *heap,
Heap_Block *block,
uintptr_t alloc_begin,
uintptr_t alloc_size
)
{
4745c: 4e56 ffe4 linkw %fp,#-28
47460: 222e 0010 movel %fp@(16),%d1
47464: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@
47468: 246e 000c moveal %fp@(12),%a2
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;
4746c: 7401 moveq #1,%d2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
4746e: 2841 moveal %d1,%a4
47470: 518c subql #8,%a4
Heap_Statistics *const stats = &heap->stats;
uintptr_t const alloc_area_begin = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_area_offset = alloc_begin - alloc_area_begin;
47472: 2a4c moveal %a4,%a5
47474: 9bca subal %a2,%a5
- 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;
47476: c0aa 0004 andl %a2@(4),%d0
Heap_Control *heap,
Heap_Block *block,
uintptr_t alloc_begin,
uintptr_t alloc_size
)
{
4747a: 266e 0008 moveal %fp@(8),%a3
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;
4747e: c4b2 0804 andl %a2@(00000004,%d0:l),%d2
47482: 282e 0014 movel %fp@(20),%d4
Heap_Block *free_list_anchor = NULL;
_HAssert( alloc_area_begin <= alloc_begin );
if ( _Heap_Is_free( block ) ) {
47486: 4a82 tstl %d2
47488: 6626 bnes 474b0 <_Heap_Block_allocate+0x56>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
4748a: 202a 0008 movel %a2@(8),%d0
Heap_Block *prev = block->prev;
prev->next = next;
next->prev = prev;
4748e: 2240 moveal %d0,%a1
free_list_anchor = block->prev;
47490: 206a 000c moveal %a2@(12),%a0
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
prev->next = next;
47494: 2140 0008 movel %d0,%a0@(8)
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
47498: 70fe moveq #-2,%d0
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
prev->next = next;
next->prev = prev;
4749a: 2348 000c movel %a0,%a1@(12)
_Heap_Free_list_remove( block );
/* Statistics */
--stats->free_blocks;
4749e: 53ab 0038 subql #1,%a3@(56)
++stats->used_blocks;
474a2: 52ab 0040 addql #1,%a3@(64)
- 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;
474a6: c0aa 0004 andl %a2@(4),%d0
stats->free_size -= _Heap_Block_size( block );
474aa: 91ab 0030 subl %d0,%a3@(48)
474ae: 6002 bras 474b2 <_Heap_Block_allocate+0x58>
} else {
free_list_anchor = _Heap_Free_list_head( heap );
474b0: 204b moveal %a3,%a0
}
if ( alloc_area_offset < heap->page_size ) {
474b2: 202b 0010 movel %a3@(16),%d0
474b6: b08d cmpl %a5,%d0
474b8: 6314 blss 474ce <_Heap_Block_allocate+0x74>
Heap_Block *block,
Heap_Block *free_list_anchor,
uintptr_t alloc_size
)
{
_Heap_Block_split( heap, block, free_list_anchor, alloc_size );
474ba: 4875 4800 pea %a5@(00000000,%d4:l)
474be: 2f08 movel %a0,%sp@-
474c0: 2f0a movel %a2,%sp@-
474c2: 2f0b movel %a3,%sp@-
474c4: 4eba fd62 jsr %pc@(47228 <_Heap_Block_split>)
474c8: 4fef 0010 lea %sp@(16),%sp
474cc: 6066 bras 47534 <_Heap_Block_allocate+0xda>
}
_Heap_Protection_block_initialize( heap, block );
return block;
}
474ce: 242a 0004 movel %a2@(4),%d2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
474d2: 4c40 1003 remul %d0,%d3,%d1
- 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;
474d6: 72fe moveq #-2,%d1
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
474d8: 99c3 subal %d3,%a4
_Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
uintptr_t const new_block_begin = (uintptr_t) new_block;
uintptr_t const new_block_size = block_end - new_block_begin;
block_end = new_block_begin;
block_size = block_end - block_begin;
474da: 200c movel %a4,%d0
474dc: 908a subl %a2,%d0
_HAssert( block_size >= heap->min_block_size );
_HAssert( new_block_size >= heap->min_block_size );
/* Statistics */
stats->free_size += block_size;
474de: d1ab 0030 addl %d0,%a3@(48)
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
474e2: c282 andl %d2,%d1
{
Heap_Statistics *const stats = &heap->stats;
uintptr_t block_begin = (uintptr_t) block;
uintptr_t block_size = _Heap_Block_size( block );
uintptr_t block_end = block_begin + block_size;
474e4: d28a addl %a2,%d1
Heap_Block *const new_block =
_Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
uintptr_t const new_block_begin = (uintptr_t) new_block;
uintptr_t const new_block_size = block_end - new_block_begin;
474e6: 928c subl %a4,%d1
_HAssert( new_block_size >= heap->min_block_size );
/* Statistics */
stats->free_size += block_size;
if ( _Heap_Is_prev_used( block ) ) {
474e8: 0802 0000 btst #0,%d2
474ec: 671c beqs 4750a <_Heap_Block_allocate+0xb0> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
474ee: 2a68 0008 moveal %a0@(8),%a5
new_block->next = next;
new_block->prev = block_before;
474f2: 2548 000c movel %a0,%a2@(12)
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
474f6: 254d 0008 movel %a5,%a2@(8)
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
474fa: 2b4a 000c movel %a2,%a5@(12)
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
474fe: 214a 0008 movel %a2,%a0@(8)
_Heap_Free_list_insert_after( free_list_anchor, block );
free_list_anchor = block;
/* Statistics */
++stats->free_blocks;
47502: 52ab 0038 addql #1,%a3@(56)
47506: 204a moveal %a2,%a0
47508: 600a bras 47514 <_Heap_Block_allocate+0xba>
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block(
const Heap_Block *block
)
{
return (Heap_Block *) ((uintptr_t) block - block->prev_size);
4750a: 95d2 subal %a2@,%a2
- 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;
4750c: 74fe moveq #-2,%d2
4750e: c4aa 0004 andl %a2@(4),%d2
} else {
Heap_Block *const prev_block = _Heap_Prev_block( block );
uintptr_t const prev_block_size = _Heap_Block_size( prev_block );
block = prev_block;
block_size += prev_block_size;
47512: d082 addl %d2,%d0
}
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
47514: 7401 moveq #1,%d2
47516: 8480 orl %d0,%d2
new_block->prev_size = block_size;
47518: 2880 movel %d0,%a4@
block = prev_block;
block_size += prev_block_size;
}
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
4751a: 2542 0004 movel %d2,%a2@(4)
new_block->prev_size = block_size;
new_block->size_and_flag = new_block_size;
_Heap_Block_split( heap, new_block, free_list_anchor, alloc_size );
4751e: 244c moveal %a4,%a2
}
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
new_block->prev_size = block_size;
new_block->size_and_flag = new_block_size;
47520: 2941 0004 movel %d1,%a4@(4)
_Heap_Block_split( heap, new_block, free_list_anchor, alloc_size );
47524: 2f04 movel %d4,%sp@-
47526: 2f08 movel %a0,%sp@-
47528: 2f0c movel %a4,%sp@-
4752a: 2f0b movel %a3,%sp@-
4752c: 4eba fcfa jsr %pc@(47228 <_Heap_Block_split>)
47530: 4fef 0010 lea %sp@(16),%sp
alloc_size
);
}
/* Statistics */
if ( stats->min_free_size > stats->free_size ) {
47534: 202b 0030 movel %a3@(48),%d0
47538: b0ab 0034 cmpl %a3@(52),%d0
4753c: 6404 bccs 47542 <_Heap_Block_allocate+0xe8>
stats->min_free_size = stats->free_size;
4753e: 2740 0034 movel %d0,%a3@(52)
}
_Heap_Protection_block_initialize( heap, block );
return block;
}
47542: 200a movel %a2,%d0
47544: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
4754a: 4e5e unlk %fp
...
0004b55c <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
4b55c: 4e56 ffe8 linkw %fp,#-24
4b560: 206e 0008 moveal %fp@(8),%a0
4b564: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@
4b568: 202e 000c movel %fp@(12),%d0
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
4b56c: 6700 0154 beqw 4b6c2 <_Heap_Free+0x166>
4b570: 2240 moveal %d0,%a1
4b572: 5189 subql #8,%a1
4b574: 4c68 0001 0010 remul %a0@(16),%d1,%d0
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
4b57a: 2828 0020 movel %a0@(32),%d4
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
4b57e: 93c1 subal %d1,%a1
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;
4b580: b889 cmpl %a1,%d4
4b582: 620c bhis 4b590 <_Heap_Free+0x34>
4b584: b3e8 0024 cmpal %a0@(36),%a1
4b588: 53c0 sls %d0
4b58a: 49c0 extbl %d0
4b58c: 4480 negl %d0
4b58e: 6002 bras 4b592 <_Heap_Free+0x36>
4b590: 4280 clrl %d0
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
4b592: 0800 0000 btst #0,%d0
4b596: 6700 012e beqw 4b6c6 <_Heap_Free+0x16a>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4b59a: 2629 0004 movel %a1@(4),%d3
- 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;
4b59e: 70fe moveq #-2,%d0
4b5a0: c083 andl %d3,%d0
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4b5a2: 45f1 0800 lea %a1@(00000000,%d0:l),%a2
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;
4b5a6: b88a cmpl %a2,%d4
4b5a8: 620c bhis 4b5b6 <_Heap_Free+0x5a> <== NEVER TAKEN
4b5aa: b5e8 0024 cmpal %a0@(36),%a2
4b5ae: 53c1 sls %d1
4b5b0: 49c1 extbl %d1
4b5b2: 4481 negl %d1
4b5b4: 6002 bras 4b5b8 <_Heap_Free+0x5c>
4b5b6: 4281 clrl %d1 <== NOT EXECUTED
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
4b5b8: 0801 0000 btst #0,%d1
4b5bc: 6700 0108 beqw 4b6c6 <_Heap_Free+0x16a>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4b5c0: 242a 0004 movel %a2@(4),%d2
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
4b5c4: 0802 0000 btst #0,%d2
4b5c8: 6700 00fc beqw 4b6c6 <_Heap_Free+0x16a>
- 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;
4b5cc: 72fe moveq #-2,%d1
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
4b5ce: 2668 0024 moveal %a0@(36),%a3
4b5d2: c481 andl %d1,%d2
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
4b5d4: b7ca cmpal %a2,%a3
4b5d6: 670c beqs 4b5e4 <_Heap_Free+0x88>
4b5d8: 2232 2804 movel %a2@(00000004,%d2:l),%d1
4b5dc: 7a01 moveq #1,%d5
4b5de: bb81 eorl %d5,%d1
4b5e0: c285 andl %d5,%d1
4b5e2: 6002 bras 4b5e6 <_Heap_Free+0x8a>
4b5e4: 4281 clrl %d1
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
4b5e6: 1a01 moveb %d1,%d5
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
4b5e8: 0803 0000 btst #0,%d3
4b5ec: 6662 bnes 4b650 <_Heap_Free+0xf4>
uintptr_t const prev_size = block->prev_size;
4b5ee: 2611 movel %a1@,%d3
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4b5f0: 93c3 subal %d3,%a1
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;
4b5f2: b889 cmpl %a1,%d4
4b5f4: 620a bhis 4b600 <_Heap_Free+0xa4> <== NEVER TAKEN
4b5f6: b3cb cmpal %a3,%a1
4b5f8: 53c1 sls %d1
4b5fa: 49c1 extbl %d1
4b5fc: 4481 negl %d1
4b5fe: 6002 bras 4b602 <_Heap_Free+0xa6>
4b600: 4281 clrl %d1 <== NOT EXECUTED
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
4b602: 0801 0000 btst #0,%d1
4b606: 6700 00be beqw 4b6c6 <_Heap_Free+0x16a>
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;
4b60a: 7201 moveq #1,%d1
4b60c: c2a9 0004 andl %a1@(4),%d1
return( false );
}
/* As we always coalesce free blocks, the block that preceedes prev_block
must have been used. */
if ( !_Heap_Is_prev_used ( prev_block) ) {
4b610: 6700 00b4 beqw 4b6c6 <_Heap_Free+0x16a>
4b614: d680 addl %d0,%d3
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
4b616: 4a05 tstb %d5
4b618: 6724 beqs 4b63e <_Heap_Free+0xe2>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
4b61a: 266a 0008 moveal %a2@(8),%a3
uintptr_t const size = block_size + prev_size + next_block_size;
4b61e: d483 addl %d3,%d2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b620: 7201 moveq #1,%d1
Heap_Block *prev = block->prev;
4b622: 246a 000c moveal %a2@(12),%a2
prev->next = next;
4b626: 254b 0008 movel %a3,%a2@(8)
4b62a: 8282 orl %d2,%d1
next->prev = prev;
4b62c: 274a 000c movel %a2,%a3@(12)
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
4b630: 53a8 0038 subql #1,%a0@(56)
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
4b634: 2382 2800 movel %d2,%a1@(00000000,%d2:l)
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b638: 2341 0004 movel %d1,%a1@(4)
4b63c: 6078 bras 4b6b6 <_Heap_Free+0x15a>
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b63e: 7401 moveq #1,%d2
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4b640: 7afe moveq #-2,%d5
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b642: 8483 orl %d3,%d2
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
4b644: 2483 movel %d3,%a2@
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b646: 2342 0004 movel %d2,%a1@(4)
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4b64a: cbaa 0004 andl %d5,%a2@(4)
4b64e: 6066 bras 4b6b6 <_Heap_Free+0x15a>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
4b650: 4a01 tstb %d1
4b652: 672a beqs 4b67e <_Heap_Free+0x122>
RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
4b654: 266a 0008 moveal %a2@(8),%a3
uintptr_t const size = block_size + next_block_size;
4b658: 2202 movel %d2,%d1
4b65a: d280 addl %d0,%d1
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b65c: 7401 moveq #1,%d2
Heap_Block *prev = old_block->prev;
4b65e: 246a 000c moveal %a2@(12),%a2
new_block->next = next;
4b662: 234b 0008 movel %a3,%a1@(8)
4b666: 8481 orl %d1,%d2
new_block->prev = prev;
4b668: 234a 000c movel %a2,%a1@(12)
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
4b66c: 2381 1800 movel %d1,%a1@(00000000,%d1:l)
next->prev = new_block;
4b670: 2749 000c movel %a1,%a3@(12)
prev->next = new_block;
4b674: 2549 0008 movel %a1,%a2@(8)
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4b678: 2342 0004 movel %d2,%a1@(4)
4b67c: 6038 bras 4b6b6 <_Heap_Free+0x15a>
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
4b67e: 7a01 moveq #1,%d5
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4b680: 72fe moveq #-2,%d1
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
4b682: 8a80 orl %d0,%d5
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
4b684: 2668 0008 moveal %a0@(8),%a3
new_block->next = next;
new_block->prev = block_before;
4b688: 2348 000c movel %a0,%a1@(12)
4b68c: 2345 0004 movel %d5,%a1@(4)
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4b690: c3aa 0004 andl %d1,%a2@(4)
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
4b694: 2228 0038 movel %a0@(56),%d1
4b698: 5281 addql #1,%d1
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
4b69a: 234b 0008 movel %a3,%a1@(8)
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
4b69e: 2749 000c movel %a1,%a3@(12)
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
4b6a2: 2480 movel %d0,%a2@
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
4b6a4: 2149 0008 movel %a1,%a0@(8)
/* Statistics */
++stats->free_blocks;
4b6a8: 2141 0038 movel %d1,%a0@(56)
if ( stats->max_free_blocks < stats->free_blocks ) {
4b6ac: b2a8 003c cmpl %a0@(60),%d1
4b6b0: 6304 blss 4b6b6 <_Heap_Free+0x15a>
stats->max_free_blocks = stats->free_blocks;
4b6b2: 2141 003c movel %d1,%a0@(60)
}
}
/* Statistics */
--stats->used_blocks;
4b6b6: 53a8 0040 subql #1,%a0@(64)
++stats->frees;
4b6ba: 52a8 0050 addql #1,%a0@(80)
stats->free_size += block_size;
4b6be: d1a8 0030 addl %d0,%a0@(48)
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
4b6c2: 7001 moveq #1,%d0
4b6c4: 6002 bras 4b6c8 <_Heap_Free+0x16c>
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
return false;
4b6c6: 4200 clrb %d0
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4b6c8: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3
4b6cc: 4e5e unlk %fp <== NOT EXECUTED
00048f78 <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
48f78: 4e56 ffe8 linkw %fp,#-24
48f7c: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
48f80: 246e 0008 moveal %fp@(8),%a2
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
48f84: 4282 clrl %d2
const uintptr_t *block_sizes,
size_t block_count
)
{
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *allocated_blocks = NULL;
48f86: 97cb subal %a3,%a3
* @brief See _Heap_Allocate_aligned_with_boundary() with alignment and
* boundary equals zero.
*/
RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
{
return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
48f88: 4bf9 0004 f5c8 lea 4f5c8 <_Heap_Allocate_aligned_with_boundary>,%a5
48f8e: 286e 000c moveal %fp@(12),%a4
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
48f92: 6026 bras 48fba <_Heap_Greedy_allocate+0x42>
48f94: 42a7 clrl %sp@-
48f96: 42a7 clrl %sp@-
48f98: 2f1c movel %a4@+,%sp@-
48f9a: 2f0a movel %a2,%sp@-
48f9c: 4e95 jsr %a5@
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
48f9e: 4fef 0010 lea %sp@(16),%sp
48fa2: 4a80 tstl %d0
48fa4: 6712 beqs 48fb8 <_Heap_Greedy_allocate+0x40> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
48fa6: 2040 moveal %d0,%a0
48fa8: 5188 subql #8,%a0
48faa: 4c6a 0001 0010 remul %a2@(16),%d1,%d0
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
48fb0: 91c1 subal %d1,%a0
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
48fb2: 214b 0008 movel %a3,%a0@(8)
48fb6: 2648 moveal %a0,%a3
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
48fb8: 5282 addql #1,%d2
48fba: b4ae 0010 cmpl %fp@(16),%d2
48fbe: 66d4 bnes 48f94 <_Heap_Greedy_allocate+0x1c>
48fc0: 4282 clrl %d2
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
_Heap_Block_allocate(
48fc2: 4bf9 0004 9286 lea 49286 <_Heap_Block_allocate>,%a5
48fc8: 6020 bras 48fea <_Heap_Greedy_allocate+0x72>
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
48fca: 70fe moveq #-2,%d0
48fcc: c0ac 0004 andl %a4@(4),%d0
48fd0: 2040 moveal %d0,%a0
48fd2: 4868 fff8 pea %a0@(-8)
48fd6: 486c 0008 pea %a4@(8)
48fda: 2f0c movel %a4,%sp@-
48fdc: 2f0a movel %a2,%sp@-
48fde: 4e95 jsr %a5@
48fe0: 4fef 0010 lea %sp@(16),%sp
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
48fe4: 2942 0008 movel %d2,%a4@(8)
48fe8: 240c movel %a4,%d2
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
48fea: 286a 0008 moveal %a2@(8),%a4
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
48fee: b5cc cmpal %a4,%a2
48ff0: 66d8 bnes 48fca <_Heap_Greedy_allocate+0x52>
48ff2: 6012 bras 49006 <_Heap_Greedy_allocate+0x8e>
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
48ff4: 262b 0008 movel %a3@(8),%d3
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
48ff8: 486b 0008 pea %a3@(8)
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
48ffc: 2643 moveal %d3,%a3
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
48ffe: 2f0a movel %a2,%sp@-
49000: 4e94 jsr %a4@
49002: 508f addql #8,%sp
49004: 6006 bras 4900c <_Heap_Greedy_allocate+0x94>
49006: 49f9 0004 f728 lea 4f728 <_Heap_Free>,%a4
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
4900c: 4a8b tstl %a3
4900e: 66e4 bnes 48ff4 <_Heap_Greedy_allocate+0x7c>
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
49010: 2002 movel %d2,%d0
49012: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
49018: 4e5e unlk %fp <== NOT EXECUTED
0004fcac <_Heap_Iterate>:
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
4fcac: 4e56 0000 linkw %fp,#0
4fcb0: 226e 0008 moveal %fp@(8),%a1
4fcb4: 2f0a movel %a2,%sp@-
Heap_Block *current = heap->first_block;
4fcb6: 2069 0020 moveal %a1@(32),%a0
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
4fcba: 2f02 movel %d2,%sp@-
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
4fcbc: 2429 0024 movel %a1@(36),%d2
4fcc0: 602a bras 4fcec <_Heap_Iterate+0x40>
4fcc2: 70fe moveq #-2,%d0
while ( !stop && current != end ) {
uintptr_t size = _Heap_Block_size( current );
Heap_Block *next = _Heap_Block_at( current, size );
bool used = _Heap_Is_prev_used( next );
stop = (*visitor)( current, size, used, visitor_arg );
4fcc4: 7201 moveq #1,%d1
4fcc6: c0a8 0004 andl %a0@(4),%d0
4fcca: 2f2e 0010 movel %fp@(16),%sp@-
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4fcce: 45f0 0800 lea %a0@(00000000,%d0:l),%a2
4fcd2: c2aa 0004 andl %a2@(4),%d1
4fcd6: 2f01 movel %d1,%sp@-
4fcd8: 2f00 movel %d0,%sp@-
4fcda: 2f08 movel %a0,%sp@-
4fcdc: 206e 000c moveal %fp@(12),%a0
4fce0: 4e90 jsr %a0@
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
4fce2: 4fef 0010 lea %sp@(16),%sp
4fce6: 204a moveal %a2,%a0
4fce8: 4a00 tstb %d0
4fcea: 6604 bnes 4fcf0 <_Heap_Iterate+0x44> <== NEVER TAKEN
4fcec: b488 cmpl %a0,%d2
4fcee: 66d2 bnes 4fcc2 <_Heap_Iterate+0x16>
stop = (*visitor)( current, size, used, visitor_arg );
current = next;
}
}
4fcf0: 242e fff8 movel %fp@(-8),%d2
4fcf4: 246e fffc moveal %fp@(-4),%a2
4fcf8: 4e5e unlk %fp <== NOT EXECUTED
0005b510 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
5b510: 4e56 0000 linkw %fp,#0
5b514: 202e 000c movel %fp@(12),%d0
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
5b518: 2040 moveal %d0,%a0
5b51a: 5188 subql #8,%a0
5b51c: 226e 0008 moveal %fp@(8),%a1
5b520: 2f02 movel %d2,%sp@-
5b522: 2400 movel %d0,%d2
5b524: 4c69 2001 0010 remul %a1@(16),%d1,%d2
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
5b52a: 2429 0020 movel %a1@(32),%d2
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
5b52e: 91c1 subal %d1,%a0
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;
5b530: b488 cmpl %a0,%d2
5b532: 620c bhis 5b540 <_Heap_Size_of_alloc_area+0x30>
5b534: b1e9 0024 cmpal %a1@(36),%a0
5b538: 53c1 sls %d1
5b53a: 49c1 extbl %d1
5b53c: 4481 negl %d1
5b53e: 6002 bras 5b542 <_Heap_Size_of_alloc_area+0x32>
5b540: 4281 clrl %d1
uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr;
Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size );
Heap_Block *next_block = NULL;
uintptr_t block_size = 0;
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
5b542: 0801 0000 btst #0,%d1
5b546: 673c beqs 5b584 <_Heap_Size_of_alloc_area+0x74>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
5b548: 72fe moveq #-2,%d1
5b54a: c2a8 0004 andl %a0@(4),%d1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
5b54e: 41f0 1800 lea %a0@(00000000,%d1:l),%a0
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;
5b552: b488 cmpl %a0,%d2
5b554: 620c bhis 5b562 <_Heap_Size_of_alloc_area+0x52> <== NEVER TAKEN
5b556: b1e9 0024 cmpal %a1@(36),%a0
5b55a: 53c1 sls %d1
5b55c: 49c1 extbl %d1
5b55e: 4481 negl %d1
5b560: 6002 bras 5b564 <_Heap_Size_of_alloc_area+0x54>
5b562: 4281 clrl %d1 <== NOT EXECUTED
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
5b564: 0801 0000 btst #0,%d1
5b568: 671a beqs 5b584 <_Heap_Size_of_alloc_area+0x74> <== NEVER TAKEN
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;
5b56a: 7201 moveq #1,%d1
5b56c: c2a8 0004 andl %a0@(4),%d1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
5b570: 6712 beqs 5b584 <_Heap_Size_of_alloc_area+0x74> <== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
5b572: 7204 moveq #4,%d1
5b574: 9280 subl %d0,%d1
5b576: 2001 movel %d1,%d0
5b578: d088 addl %a0,%d0
5b57a: 226e 0010 moveal %fp@(16),%a1
5b57e: 2280 movel %d0,%a1@
return true;
5b580: 7001 moveq #1,%d0
5b582: 6002 bras 5b586 <_Heap_Size_of_alloc_area+0x76>
Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size );
Heap_Block *next_block = NULL;
uintptr_t block_size = 0;
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
return false;
5b584: 4200 clrb %d0
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
5b586: 241f movel %sp@+,%d2
5b588: 4e5e unlk %fp <== NOT EXECUTED
00047d72 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
47d72: 4e56 ffd0 linkw %fp,#-48
47d76: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
47d7a: 266e 0008 moveal %fp@(8),%a3
47d7e: 242e 000c movel %fp@(12),%d2
uintptr_t const page_size = heap->page_size;
47d82: 282b 0010 movel %a3@(16),%d4
uintptr_t const min_block_size = heap->min_block_size;
47d86: 2a2b 0014 movel %a3@(20),%d5
Heap_Block *const first_block = heap->first_block;
47d8a: 286b 0020 moveal %a3@(32),%a4
Heap_Block *const last_block = heap->last_block;
47d8e: 2c2b 0024 movel %a3@(36),%d6
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
47d92: 4a2e 0013 tstb %fp@(19)
47d96: 6706 beqs 47d9e <_Heap_Walk+0x2c>
47d98: 45fa ff9a lea %pc@(47d34 <_Heap_Walk_print>),%a2
47d9c: 6004 bras 47da2 <_Heap_Walk+0x30>
47d9e: 45fa ff8c lea %pc@(47d2c <_Heap_Walk_print_nothing>),%a2
if ( !_System_state_Is_up( _System_state_Get() ) ) {
47da2: 7003 moveq #3,%d0
47da4: b0b9 0006 1442 cmpl 61442 <_System_state_Current>,%d0
47daa: 6706 beqs 47db2 <_Heap_Walk+0x40>
return true;
47dac: 7001 moveq #1,%d0
47dae: 6000 02fc braw 480ac <_Heap_Walk+0x33a>
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)(
47db2: 2f2b 000c movel %a3@(12),%sp@-
47db6: 2f2b 0008 movel %a3@(8),%sp@-
47dba: 2f06 movel %d6,%sp@-
47dbc: 2f0c movel %a4,%sp@-
47dbe: 2f2b 001c movel %a3@(28),%sp@-
47dc2: 2f2b 0018 movel %a3@(24),%sp@-
47dc6: 2f05 movel %d5,%sp@-
47dc8: 2f04 movel %d4,%sp@-
47dca: 4879 0005 d476 pea 5d476 <_Copyright_Notice+0x94>
47dd0: 42a7 clrl %sp@-
47dd2: 2f02 movel %d2,%sp@-
47dd4: 4e92 jsr %a2@
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
47dd6: 4fef 002c lea %sp@(44),%sp
47dda: 4a84 tstl %d4
47ddc: 6608 bnes 47de6 <_Heap_Walk+0x74>
(*printer)( source, true, "page size is zero\n" );
47dde: 4879 0005 d507 pea 5d507 <_Copyright_Notice+0x125>
47de4: 6076 bras 47e5c <_Heap_Walk+0xea>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
47de6: 7003 moveq #3,%d0
47de8: c084 andl %d4,%d0
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
47dea: 670c beqs 47df8 <_Heap_Walk+0x86>
(*printer)(
47dec: 2f04 movel %d4,%sp@-
47dee: 4879 0005 d51a pea 5d51a <_Copyright_Notice+0x138>
47df4: 6000 02a8 braw 4809e <_Heap_Walk+0x32c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
47df8: 2205 movel %d5,%d1
47dfa: 4c44 1000 remul %d4,%d0,%d1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
47dfe: 4a80 tstl %d0
47e00: 670c beqs 47e0e <_Heap_Walk+0x9c>
(*printer)(
47e02: 2f05 movel %d5,%sp@-
47e04: 4879 0005 d538 pea 5d538 <_Copyright_Notice+0x156>
47e0a: 6000 0292 braw 4809e <_Heap_Walk+0x32c>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
47e0e: 200c movel %a4,%d0
47e10: 5080 addql #8,%d0
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
47e12: 4c44 0001 remul %d4,%d1,%d0
);
return false;
}
if (
47e16: 4a81 tstl %d1
47e18: 670c beqs 47e26 <_Heap_Walk+0xb4>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
47e1a: 2f0c movel %a4,%sp@-
47e1c: 4879 0005 d55c pea 5d55c <_Copyright_Notice+0x17a>
47e22: 6000 027a braw 4809e <_Heap_Walk+0x32c>
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;
47e26: 7001 moveq #1,%d0
47e28: c0ac 0004 andl %a4@(4),%d0
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
47e2c: 6608 bnes 47e36 <_Heap_Walk+0xc4>
(*printer)(
47e2e: 4879 0005 d58d pea 5d58d <_Copyright_Notice+0x1ab>
47e34: 6026 bras 47e5c <_Heap_Walk+0xea>
- 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;
47e36: 70fe moveq #-2,%d0
47e38: 2046 moveal %d6,%a0
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
47e3a: 2a46 moveal %d6,%a5
- 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;
47e3c: c0a8 0004 andl %a0@(4),%d0
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
47e40: dbc0 addal %d0,%a5
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;
47e42: 7001 moveq #1,%d0
47e44: c0ad 0004 andl %a5@(4),%d0
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
47e48: 6608 bnes 47e52 <_Heap_Walk+0xe0>
(*printer)(
47e4a: 4879 0005 d5bb pea 5d5bb <_Copyright_Notice+0x1d9>
47e50: 600a bras 47e5c <_Heap_Walk+0xea>
);
return false;
}
if (
47e52: b9cd cmpal %a5,%a4
47e54: 6716 beqs 47e6c <_Heap_Walk+0xfa>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
47e56: 4879 0005 d5d0 pea 5d5d0 <_Copyright_Notice+0x1ee>
47e5c: 4878 0001 pea 1 <ADD>
47e60: 2f02 movel %d2,%sp@-
47e62: 4e92 jsr %a2@
47e64: 4fef 000c lea %sp@(12),%sp
47e68: 6000 0228 braw 48092 <_Heap_Walk+0x320>
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
47e6c: 222b 0010 movel %a3@(16),%d1
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
47e70: 224b moveal %a3,%a1
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
47e72: 206b 0008 moveal %a3@(8),%a0
47e76: 6074 bras 47eec <_Heap_Walk+0x17a>
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;
47e78: b1eb 0020 cmpal %a3@(32),%a0
47e7c: 650c bcss 47e8a <_Heap_Walk+0x118>
47e7e: b1eb 0024 cmpal %a3@(36),%a0
47e82: 53c0 sls %d0
47e84: 49c0 extbl %d0
47e86: 4480 negl %d0
47e88: 6002 bras 47e8c <_Heap_Walk+0x11a>
47e8a: 4280 clrl %d0
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 ) {
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
47e8c: 0800 0000 btst #0,%d0
47e90: 660c bnes 47e9e <_Heap_Walk+0x12c>
(*printer)(
47e92: 2f08 movel %a0,%sp@-
47e94: 4879 0005 d5ff pea 5d5ff <_Copyright_Notice+0x21d>
47e9a: 6000 0202 braw 4809e <_Heap_Walk+0x32c>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
47e9e: 2008 movel %a0,%d0
47ea0: 5080 addql #8,%d0
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
47ea2: 4c41 0003 remul %d1,%d3,%d0
);
return false;
}
if (
47ea6: 4a83 tstl %d3
47ea8: 670c beqs 47eb6 <_Heap_Walk+0x144>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
47eaa: 2f08 movel %a0,%sp@-
47eac: 4879 0005 d61f pea 5d61f <_Copyright_Notice+0x23d>
47eb2: 6000 01ea braw 4809e <_Heap_Walk+0x32c>
- 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;
47eb6: 70fe moveq #-2,%d0
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;
47eb8: 7601 moveq #1,%d3
- 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;
47eba: c0a8 0004 andl %a0@(4),%d0
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;
47ebe: c6b0 0804 andl %a0@(00000004,%d0:l),%d3
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
47ec2: 670c beqs 47ed0 <_Heap_Walk+0x15e>
(*printer)(
47ec4: 2f08 movel %a0,%sp@-
47ec6: 4879 0005 d64f pea 5d64f <_Copyright_Notice+0x26d>
47ecc: 6000 01d0 braw 4809e <_Heap_Walk+0x32c>
);
return false;
}
if ( free_block->prev != prev_block ) {
47ed0: 2028 000c movel %a0@(12),%d0
47ed4: b3c0 cmpal %d0,%a1
47ed6: 670e beqs 47ee6 <_Heap_Walk+0x174>
(*printer)(
47ed8: 2f00 movel %d0,%sp@-
47eda: 2f08 movel %a0,%sp@-
47edc: 4879 0005 d66b pea 5d66b <_Copyright_Notice+0x289>
47ee2: 6000 00aa braw 47f8e <_Heap_Walk+0x21c>
return false;
}
prev_block = free_block;
free_block = free_block->next;
47ee6: 2248 moveal %a0,%a1
47ee8: 2068 0008 moveal %a0@(8),%a0
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 ) {
47eec: b7c8 cmpal %a0,%a3
47eee: 6688 bnes 47e78 <_Heap_Walk+0x106>
47ef0: 284d moveal %a5,%a4
block = next_block;
} while ( block != first_block );
return true;
}
47ef2: 202c 0004 movel %a4@(4),%d0
47ef6: 7201 moveq #1,%d1
- 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;
47ef8: 76fe moveq #-2,%d3
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;
47efa: c280 andl %d0,%d1
- 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;
47efc: c680 andl %d0,%d3
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;
47efe: 2d41 fffc movel %d1,%fp@(-4)
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
47f02: bc8c cmpl %a4,%d6
47f04: 56c1 sne %d1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
47f06: 2e03 movel %d3,%d7
47f08: de8c addl %a4,%d7
47f0a: 2001 movel %d1,%d0
47f0c: 4480 negl %d0
47f0e: 1d40 fffb moveb %d0,%fp@(-5)
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;
47f12: beab 0020 cmpl %a3@(32),%d7
47f16: 650c bcss 47f24 <_Heap_Walk+0x1b2> <== NEVER TAKEN
47f18: beab 0024 cmpl %a3@(36),%d7
47f1c: 53c0 sls %d0
47f1e: 49c0 extbl %d0
47f20: 4480 negl %d0
47f22: 6002 bras 47f26 <_Heap_Walk+0x1b4>
47f24: 4280 clrl %d0 <== NOT EXECUTED
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
47f26: 0800 0000 btst #0,%d0
47f2a: 660c bnes 47f38 <_Heap_Walk+0x1c6>
(*printer)(
47f2c: 2f07 movel %d7,%sp@-
47f2e: 2f0c movel %a4,%sp@-
47f30: 4879 0005 d69d pea 5d69d <_Copyright_Notice+0x2bb>
47f36: 6056 bras 47f8e <_Heap_Walk+0x21c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
47f38: 2203 movel %d3,%d1
47f3a: 4c44 1000 remul %d4,%d0,%d1
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
47f3e: 4a80 tstl %d0
47f40: 6712 beqs 47f54 <_Heap_Walk+0x1e2>
47f42: 4a2e fffb tstb %fp@(-5)
47f46: 6756 beqs 47f9e <_Heap_Walk+0x22c>
(*printer)(
47f48: 2f03 movel %d3,%sp@-
47f4a: 2f0c movel %a4,%sp@-
47f4c: 4879 0005 d6ca pea 5d6ca <_Copyright_Notice+0x2e8>
47f52: 603a bras 47f8e <_Heap_Walk+0x21c>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
47f54: ba83 cmpl %d3,%d5
47f56: 6322 blss 47f7a <_Heap_Walk+0x208>
47f58: 4a2e fffb tstb %fp@(-5)
47f5c: 6740 beqs 47f9e <_Heap_Walk+0x22c> <== NEVER TAKEN
(*printer)(
47f5e: 2f05 movel %d5,%sp@-
47f60: 2f03 movel %d3,%sp@-
47f62: 2f0c movel %a4,%sp@-
47f64: 4879 0005 d6f8 pea 5d6f8 <_Copyright_Notice+0x316>
47f6a: 4878 0001 pea 1 <ADD>
47f6e: 2f02 movel %d2,%sp@-
47f70: 4e92 jsr %a2@
block,
block_size,
min_block_size
);
return false;
47f72: 4fef 0018 lea %sp@(24),%sp
47f76: 6000 011a braw 48092 <_Heap_Walk+0x320>
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
47f7a: b9c7 cmpal %d7,%a4
47f7c: 6520 bcss 47f9e <_Heap_Walk+0x22c>
47f7e: 4a2e fffb tstb %fp@(-5)
47f82: 671a beqs 47f9e <_Heap_Walk+0x22c>
(*printer)(
47f84: 2f07 movel %d7,%sp@-
47f86: 2f0c movel %a4,%sp@-
47f88: 4879 0005 d723 pea 5d723 <_Copyright_Notice+0x341>
47f8e: 4878 0001 pea 1 <ADD>
47f92: 2f02 movel %d2,%sp@-
47f94: 4e92 jsr %a2@
"block 0x%08x: next block 0x%08x is not a successor\n",
block,
next_block
);
return false;
47f96: 4fef 0014 lea %sp@(20),%sp
47f9a: 6000 00f6 braw 48092 <_Heap_Walk+0x320>
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;
47f9e: 7001 moveq #1,%d0
47fa0: 2047 moveal %d7,%a0
47fa2: c0a8 0004 andl %a0@(4),%d0
}
if ( !_Heap_Is_prev_used( next_block ) ) {
47fa6: 6600 00ac bnew 48054 <_Heap_Walk+0x2e2>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
47faa: 222b 0008 movel %a3@(8),%d1
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
47fae: 206c 0008 moveal %a4@(8),%a0
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)(
47fb2: b1eb 000c cmpal %a3@(12),%a0
47fb6: 6712 beqs 47fca <_Heap_Walk+0x258>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
47fb8: 43f9 0005 d31e lea 5d31e <rtems_termios_baud_table+0x10a>,%a1
47fbe: b7c8 cmpal %a0,%a3
47fc0: 660e bnes 47fd0 <_Heap_Walk+0x25e>
47fc2: 43f9 0005 d452 lea 5d452 <_Copyright_Notice+0x70>,%a1
47fc8: 6006 bras 47fd0 <_Heap_Walk+0x25e>
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)(
47fca: 43f9 0005 d443 lea 5d443 <_Copyright_Notice+0x61>,%a1
false,
"block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n",
block,
block_size,
block->prev,
block->prev == first_free_block ?
47fd0: 202c 000c movel %a4@(12),%d0
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)(
47fd4: b280 cmpl %d0,%d1
47fd6: 6712 beqs 47fea <_Heap_Walk+0x278>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
47fd8: 223c 0005 d31e movel #381726,%d1
47fde: b7c0 cmpal %d0,%a3
47fe0: 660e bnes 47ff0 <_Heap_Walk+0x27e>
47fe2: 223c 0005 d46c movel #382060,%d1
47fe8: 6006 bras 47ff0 <_Heap_Walk+0x27e>
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)(
47fea: 223c 0005 d45c movel #382044,%d1
47ff0: 2f09 movel %a1,%sp@-
47ff2: 2f08 movel %a0,%sp@-
47ff4: 2f01 movel %d1,%sp@-
47ff6: 2f00 movel %d0,%sp@-
47ff8: 2f03 movel %d3,%sp@-
47ffa: 2f0c movel %a4,%sp@-
47ffc: 4879 0005 d757 pea 5d757 <_Copyright_Notice+0x375>
48002: 42a7 clrl %sp@-
48004: 2f02 movel %d2,%sp@-
48006: 4e92 jsr %a2@
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
48008: 4fef 0024 lea %sp@(36),%sp
4800c: 2047 moveal %d7,%a0
4800e: 2010 movel %a0@,%d0
48010: b083 cmpl %d3,%d0
48012: 671c beqs 48030 <_Heap_Walk+0x2be>
(*printer)(
48014: 2f07 movel %d7,%sp@-
48016: 2f00 movel %d0,%sp@-
48018: 2f03 movel %d3,%sp@-
4801a: 2f0c movel %a4,%sp@-
4801c: 4879 0005 d78c pea 5d78c <_Copyright_Notice+0x3aa>
48022: 4878 0001 pea 1 <ADD>
48026: 2f02 movel %d2,%sp@-
48028: 4e92 jsr %a2@
4802a: 4fef 001c lea %sp@(28),%sp
4802e: 6062 bras 48092 <_Heap_Walk+0x320>
);
return false;
}
if ( !prev_used ) {
48030: 4aae fffc tstl %fp@(-4)
48034: 660a bnes 48040 <_Heap_Walk+0x2ce>
(*printer)(
48036: 2f0c movel %a4,%sp@-
48038: 4879 0005 d7c5 pea 5d7c5 <_Copyright_Notice+0x3e3>
4803e: 605e bras 4809e <_Heap_Walk+0x32c>
48040: 206b 0008 moveal %a3@(8),%a0
48044: 6008 bras 4804e <_Heap_Walk+0x2dc>
{
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 ) {
if ( free_block == block ) {
48046: b9c8 cmpal %a0,%a4
48048: 673c beqs 48086 <_Heap_Walk+0x314>
return true;
}
free_block = free_block->next;
4804a: 2068 0008 moveal %a0@(8),%a0
)
{
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 ) {
4804e: b7c8 cmpal %a0,%a3
48050: 66f4 bnes 48046 <_Heap_Walk+0x2d4>
48052: 6042 bras 48096 <_Heap_Walk+0x324>
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
48054: 4aae fffc tstl %fp@(-4)
48058: 6716 beqs 48070 <_Heap_Walk+0x2fe>
(*printer)(
4805a: 2f03 movel %d3,%sp@-
4805c: 2f0c movel %a4,%sp@-
4805e: 4879 0005 d7f4 pea 5d7f4 <_Copyright_Notice+0x412>
48064: 42a7 clrl %sp@-
48066: 2f02 movel %d2,%sp@-
48068: 4e92 jsr %a2@
4806a: 4fef 0014 lea %sp@(20),%sp
4806e: 6016 bras 48086 <_Heap_Walk+0x314>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
48070: 2f14 movel %a4@,%sp@-
48072: 2f03 movel %d3,%sp@-
48074: 2f0c movel %a4,%sp@-
48076: 4879 0005 d80b pea 5d80b <_Copyright_Notice+0x429>
4807c: 42a7 clrl %sp@-
4807e: 2f02 movel %d2,%sp@-
48080: 4e92 jsr %a2@
48082: 4fef 0018 lea %sp@(24),%sp
48086: 2847 moveal %d7,%a4
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
48088: bbc7 cmpal %d7,%a5
4808a: 6600 fe66 bnew 47ef2 <_Heap_Walk+0x180>
4808e: 6000 fd1c braw 47dac <_Heap_Walk+0x3a>
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
48092: 4200 clrb %d0
48094: 6016 bras 480ac <_Heap_Walk+0x33a>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
48096: 2f0c movel %a4,%sp@-
48098: 4879 0005 d830 pea 5d830 <_Copyright_Notice+0x44e>
4809e: 4878 0001 pea 1 <ADD>
480a2: 2f02 movel %d2,%sp@-
480a4: 4e92 jsr %a2@
480a6: 4fef 0010 lea %sp@(16),%sp
480aa: 60e6 bras 48092 <_Heap_Walk+0x320>
block = next_block;
} while ( block != first_block );
return true;
}
480ac: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5
480b2: 4e5e unlk %fp
...
00047550 <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
47550: 4e56 ffe8 linkw %fp,#-24
47554: 48d7 001c moveml %d2-%d4,%sp@
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
47558: 4879 0004 90c6 pea 490c6 <_User_extensions_Fatal_visitor>
4755e: 262e 0008 movel %fp@(8),%d3
47562: 486e fff6 pea %fp@(-10)
47566: 242e 0010 movel %fp@(16),%d2
4756a: 282e 000c movel %fp@(12),%d4
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
4756e: 2d43 fff6 movel %d3,%fp@(-10)
47572: 1d44 fffa moveb %d4,%fp@(-6)
47576: 2d42 fffc movel %d2,%fp@(-4)
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
4757a: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate>
RTEMS_INLINE_ROUTINE void _System_state_Set (
System_state_Codes state
)
{
_System_state_Current = state;
47580: 7005 moveq #5,%d0 <== NOT EXECUTED
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
47582: 23c3 0005 f300 movel %d3,5f300 <_Internal_errors_What_happened><== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
_Internal_errors_What_happened.the_error = the_error;
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
47588: 263c 0000 0700 movel #1792,%d3 <== NOT EXECUTED
)
{
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
_Internal_errors_What_happened.is_internal = is_internal;
4758e: 13c4 0005 f304 moveb %d4,5f304 <_Internal_errors_What_happened+0x4><== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
47594: 23c2 0005 f306 movel %d2,5f306 <_Internal_errors_What_happened+0x6><== NOT EXECUTED
4759a: 23c0 0005 f30a movel %d0,5f30a <_System_state_Current> <== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
475a0: 40c0 movew %sr,%d0 <== NOT EXECUTED
475a2: 8083 orl %d3,%d0 <== NOT EXECUTED
475a4: 46c0 movew %d0,%sr <== NOT EXECUTED
475a6: 2002 movel %d2,%d0 <== NOT EXECUTED
475a8: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED
475ae: 4ac8 halt <== NOT EXECUTED
475b0: 508f addql #8,%sp <== NOT EXECUTED
475b2: 60fe bras 475b2 <_Internal_error_Occurred+0x62> <== NOT EXECUTED
00047614 <_Objects_Allocate>:
#endif
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
47614: 4e56 fff0 linkw %fp,#-16
47618: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
4761c: 246e 0008 moveal %fp@(8),%a2
* If the application is using the optional manager stubs and
* still attempts to create the object, the information block
* should be all zeroed out because it is in the BSS. So let's
* check that code for this manager is even present.
*/
if ( information->size == 0 )
47620: 4aaa 0014 tstl %a2@(20)
47624: 6604 bnes 4762a <_Objects_Allocate+0x16> <== ALWAYS TAKEN
return NULL;
47626: 4280 clrl %d0
47628: 6066 bras 47690 <_Objects_Allocate+0x7c>
/*
* OK. The manager should be initialized and configured to have objects.
* With any luck, it is safe to attempt to allocate an object.
*/
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
4762a: 240a movel %a2,%d2
4762c: 0682 0000 001c addil #28,%d2
47632: 47f9 0004 6d5c lea 46d5c <_Chain_Get>,%a3
47638: 2f02 movel %d2,%sp@-
4763a: 4e93 jsr %a3@
if ( information->auto_extend ) {
4763c: 588f addql #4,%sp
4763e: 4a2a 0010 tstb %a2@(16)
47642: 674c beqs 47690 <_Objects_Allocate+0x7c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
47644: 4a80 tstl %d0
47646: 6612 bnes 4765a <_Objects_Allocate+0x46>
_Objects_Extend_information( information );
47648: 2f0a movel %a2,%sp@-
4764a: 4eb9 0004 76c8 jsr 476c8 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
47650: 2f02 movel %d2,%sp@-
47652: 4e93 jsr %a3@
}
if ( the_object ) {
47654: 508f addql #8,%sp
47656: 4a80 tstl %d0
47658: 67cc beqs 47626 <_Objects_Allocate+0x12>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
4765a: 2040 moveal %d0,%a0
4765c: 242a 0006 movel %a2@(6),%d2
47660: 2228 0008 movel %a0@(8),%d1
47664: 0282 0000 ffff andil #65535,%d2
4766a: 0281 0000 ffff andil #65535,%d1
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
47670: 206a 002a moveal %a2@(42),%a0
}
if ( the_object ) {
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
47674: 9282 subl %d2,%d1
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
47676: 4282 clrl %d2
47678: 342a 0012 movew %a2@(18),%d2
4767c: 4c42 1001 remul %d2,%d1,%d1
information->inactive_per_block[ block ]--;
47680: e589 lsll #2,%d1
47682: d1c1 addal %d1,%a0
47684: 5390 subql #1,%a0@
information->inactive--;
47686: 322a 0028 movew %a2@(40),%d1
4768a: 5381 subql #1,%d1
4768c: 3541 0028 movew %d1,%a2@(40)
);
}
#endif
return the_object;
}
47690: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
47696: 4e5e unlk %fp
...
0004769c <_Objects_Close>:
void _Objects_Close(
Objects_Information *information,
Objects_Control *the_object
)
{
4769c: 4e56 0000 linkw %fp,#0
476a0: 226e 000c moveal %fp@(12),%a1
476a4: 206e 0008 moveal %fp@(8),%a0
RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
Objects_Information *information,
Objects_Control *the_object
)
{
_Objects_Set_local_object(
476a8: 2029 0008 movel %a1@(8),%d0
476ac: 2f0a movel %a2,%sp@-
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
476ae: 2468 0018 moveal %a0@(24),%a2
RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
Objects_Information *information,
Objects_Control *the_object
)
{
_Objects_Set_local_object(
476b2: 0280 0000 ffff andil #65535,%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
476b8: 42b2 0c00 clrl %a2@(00000000,%d0:l:4)
_Objects_Invalidate_Id( information, the_object );
_Objects_Namespace_remove( information, the_object );
}
476bc: 245f moveal %sp@+,%a2
476be: 4e5e unlk %fp
Objects_Control *the_object
)
{
_Objects_Invalidate_Id( information, the_object );
_Objects_Namespace_remove( information, the_object );
476c0: 4ef9 0004 7bd4 jmp 47bd4 <_Objects_Namespace_remove>
...
000479dc <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
479dc: 4e56 0000 linkw %fp,#0
479e0: 2f03 movel %d3,%sp@-
479e2: 362e 000e movew %fp@(14),%d3
479e6: 2f02 movel %d2,%sp@-
479e8: 242e 0008 movel %fp@(8),%d2
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
479ec: 4a43 tstw %d3
479ee: 6604 bnes 479f4 <_Objects_Get_information+0x18>
return NULL;
479f0: 4280 clrl %d0
479f2: 6034 bras 47a28 <_Objects_Get_information+0x4c>
/*
* This call implicitly validates the_api so we do not call
* _Objects_Is_api_valid above here.
*/
the_class_api_maximum = _Objects_API_maximum_class( the_api );
479f4: 2f02 movel %d2,%sp@-
479f6: 4eb9 0004 b6d0 jsr 4b6d0 <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
479fc: 588f addql #4,%sp
479fe: 4a80 tstl %d0
47a00: 67ee beqs 479f0 <_Objects_Get_information+0x14>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
47a02: 0283 0000 ffff andil #65535,%d3
47a08: b083 cmpl %d3,%d0
47a0a: 65e4 bcss 479f0 <_Objects_Get_information+0x14>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
47a0c: 41f9 0005 ee92 lea 5ee92 <_Objects_Information_table>,%a0
47a12: 2070 2c00 moveal %a0@(00000000,%d2:l:4),%a0
47a16: 4a88 tstl %a0
47a18: 67d6 beqs 479f0 <_Objects_Get_information+0x14> <== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
47a1a: 2030 3c00 movel %a0@(00000000,%d3:l:4),%d0
if ( !info )
47a1e: 67d0 beqs 479f0 <_Objects_Get_information+0x14> <== NEVER TAKEN
* In a multprocessing configuration, we may access remote objects.
* Thus we may have 0 local instances and still have a valid object
* pointer.
*/
#if !defined(RTEMS_MULTIPROCESSING)
if ( info->maximum == 0 )
47a20: 2040 moveal %d0,%a0
47a22: 4a68 000e tstw %a0@(14)
47a26: 67c8 beqs 479f0 <_Objects_Get_information+0x14>
return NULL;
#endif
return info;
}
47a28: 242e fff8 movel %fp@(-8),%d2
47a2c: 262e fffc movel %fp@(-4),%d3
47a30: 4e5e unlk %fp <== NOT EXECUTED
000516c8 <_Objects_Get_name_as_string>:
char *_Objects_Get_name_as_string(
Objects_Id id,
size_t length,
char *name
)
{
516c8: 4e56 ffe4 linkw %fp,#-28
516cc: 48d7 041c moveml %d2-%d4/%a2,%sp@
516d0: 262e 0008 movel %fp@(8),%d3
516d4: 282e 000c movel %fp@(12),%d4
516d8: 242e 0010 movel %fp@(16),%d2
char lname[5];
Objects_Control *the_object;
Objects_Locations location;
Objects_Id tmpId;
if ( length == 0 )
516dc: 4a84 tstl %d4
516de: 6604 bnes 516e4 <_Objects_Get_name_as_string+0x1c>
516e0: 6000 00ba braw 5179c <_Objects_Get_name_as_string+0xd4>
return NULL;
if ( name == NULL )
516e4: 4a82 tstl %d2
516e6: 6700 00b4 beqw 5179c <_Objects_Get_name_as_string+0xd4>
return NULL;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
516ea: 4a83 tstl %d3
516ec: 660a bnes 516f8 <_Objects_Get_name_as_string+0x30>
516ee: 2079 0006 a5d2 moveal 6a5d2 <_Per_CPU_Information+0xe>,%a0
516f4: 2628 0008 movel %a0@(8),%d3
information = _Objects_Get_information_id( tmpId );
516f8: 2f03 movel %d3,%sp@-
516fa: 4eb9 0004 aee8 jsr 4aee8 <_Objects_Get_information_id>
if ( !information )
51700: 588f addql #4,%sp
if ( name == NULL )
return NULL;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
information = _Objects_Get_information_id( tmpId );
51702: 2440 moveal %d0,%a2
if ( !information )
51704: 4a80 tstl %d0
51706: 6700 0094 beqw 5179c <_Objects_Get_name_as_string+0xd4>
return NULL;
the_object = _Objects_Get( information, tmpId, &location );
5170a: 486e fff6 pea %fp@(-10)
5170e: 2f03 movel %d3,%sp@-
51710: 2f00 movel %d0,%sp@-
51712: 4eb9 0004 afc4 jsr 4afc4 <_Objects_Get>
switch ( location ) {
51718: 4fef 000c lea %sp@(12),%sp
5171c: 4aae fff6 tstl %fp@(-10)
51720: 667a bnes 5179c <_Objects_Get_name_as_string+0xd4>
case OBJECTS_LOCAL:
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
s = the_object->name.name_p;
51722: 2040 moveal %d0,%a0
return NULL;
case OBJECTS_LOCAL:
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
51724: 4a2a 0032 tstb %a2@(50)
51728: 670a beqs 51734 <_Objects_Get_name_as_string+0x6c>
s = the_object->name.name_p;
5172a: 2028 000c movel %a0@(12),%d0
lname[ 4 ] = '\0';
s = lname;
}
d = name;
if ( s ) {
5172e: 6632 bnes 51762 <_Objects_Get_name_as_string+0x9a><== NEVER TAKEN
51730: 2042 moveal %d2,%a0
51732: 605e bras 51792 <_Objects_Get_name_as_string+0xca>
if ( information->is_string ) {
s = the_object->name.name_p;
} else
#endif
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
51734: 2028 000c movel %a0@(12),%d0
lname[ 0 ] = (u32_name >> 24) & 0xff;
51738: 7618 moveq #24,%d3
5173a: 2200 movel %d0,%d1
5173c: e6a9 lsrl %d3,%d1
5173e: 1d41 fffb moveb %d1,%fp@(-5)
lname[ 1 ] = (u32_name >> 16) & 0xff;
51742: 2200 movel %d0,%d1
51744: 4241 clrw %d1
51746: 4841 swap %d1
lname[ 2 ] = (u32_name >> 8) & 0xff;
lname[ 3 ] = (u32_name >> 0) & 0xff;
51748: 1d40 fffe moveb %d0,%fp@(-2)
#endif
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
lname[ 0 ] = (u32_name >> 24) & 0xff;
lname[ 1 ] = (u32_name >> 16) & 0xff;
5174c: 1d41 fffc moveb %d1,%fp@(-4)
lname[ 2 ] = (u32_name >> 8) & 0xff;
51750: 2200 movel %d0,%d1
51752: e089 lsrl #8,%d1
lname[ 3 ] = (u32_name >> 0) & 0xff;
lname[ 4 ] = '\0';
51754: 4200 clrb %d0
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
lname[ 0 ] = (u32_name >> 24) & 0xff;
lname[ 1 ] = (u32_name >> 16) & 0xff;
lname[ 2 ] = (u32_name >> 8) & 0xff;
51756: 1d41 fffd moveb %d1,%fp@(-3)
lname[ 3 ] = (u32_name >> 0) & 0xff;
lname[ 4 ] = '\0';
5175a: 1d40 ffff moveb %d0,%fp@(-1)
s = lname;
5175e: 200e movel %fp,%d0
51760: 5b80 subql #5,%d0
51762: 2240 moveal %d0,%a1
}
d = name;
if ( s ) {
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
*d = (isprint((unsigned char)*s)) ? *s : '*';
51764: 2042 moveal %d2,%a0
s = lname;
}
d = name;
if ( s ) {
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
51766: 5384 subql #1,%d4
51768: 601c bras 51786 <_Objects_Get_name_as_string+0xbe>
*d = (isprint((unsigned char)*s)) ? *s : '*';
5176a: 4281 clrl %d1
5176c: 1200 moveb %d0,%d1
5176e: 2479 0006 83e0 moveal 683e0 <__ctype_ptr__>,%a2
51774: 1232 1801 moveb %a2@(00000001,%d1:l),%d1
51778: 49c1 extbl %d1
5177a: 0281 0000 0097 andil #151,%d1
51780: 6602 bnes 51784 <_Objects_Get_name_as_string+0xbc>
51782: 702a moveq #42,%d0
51784: 10c0 moveb %d0,%a0@+
s = lname;
}
d = name;
if ( s ) {
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
51786: 2008 movel %a0,%d0
51788: 9082 subl %d2,%d0
5178a: b880 cmpl %d0,%d4
5178c: 6304 blss 51792 <_Objects_Get_name_as_string+0xca>
5178e: 1019 moveb %a1@+,%d0
51790: 66d8 bnes 5176a <_Objects_Get_name_as_string+0xa2>
*d = (isprint((unsigned char)*s)) ? *s : '*';
}
}
*d = '\0';
51792: 4210 clrb %a0@
_Thread_Enable_dispatch();
51794: 4eb9 0004 bcc0 jsr 4bcc0 <_Thread_Enable_dispatch>
5179a: 6002 bras 5179e <_Objects_Get_name_as_string+0xd6>
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE:
/* not supported */
#endif
case OBJECTS_ERROR:
return NULL;
5179c: 4282 clrl %d2
_Thread_Enable_dispatch();
return name;
}
return NULL; /* unreachable path */
}
5179e: 2002 movel %d2,%d0
517a0: 4cee 041c ffe4 moveml %fp@(-28),%d2-%d4/%a2
517a6: 4e5e unlk %fp
...
00054c10 <_Objects_Get_no_protection>:
/*
* You can't just extract the index portion or you can get tricked
* by a value between 1 and maximum.
*/
index = id - information->minimum_id + 1;
54c10: 7001 moveq #1,%d0
if ( information->maximum >= index ) {
54c12: 4281 clrl %d1
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
54c14: 4e56 0000 linkw %fp,#0
54c18: 206e 0008 moveal %fp@(8),%a0
/*
* You can't just extract the index portion or you can get tricked
* by a value between 1 and maximum.
*/
index = id - information->minimum_id + 1;
54c1c: 90a8 0006 subl %a0@(6),%d0
54c20: d0ae 000c addl %fp@(12),%d0
if ( information->maximum >= index ) {
54c24: 3228 000e movew %a0@(14),%d1
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
54c28: 226e 0010 moveal %fp@(16),%a1
* You can't just extract the index portion or you can get tricked
* by a value between 1 and maximum.
*/
index = id - information->minimum_id + 1;
if ( information->maximum >= index ) {
54c2c: b081 cmpl %d1,%d0
54c2e: 620e bhis 54c3e <_Objects_Get_no_protection+0x2e>
if ( (the_object = information->local_table[ index ]) != NULL ) {
54c30: 2068 0018 moveal %a0@(24),%a0
54c34: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0
54c38: 6704 beqs 54c3e <_Objects_Get_no_protection+0x2e><== NEVER TAKEN
*location = OBJECTS_LOCAL;
54c3a: 4291 clrl %a1@
return the_object;
54c3c: 6006 bras 54c44 <_Objects_Get_no_protection+0x34>
/*
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
54c3e: 7001 moveq #1,%d0
54c40: 2280 movel %d0,%a1@
return NULL;
54c42: 4280 clrl %d0
}
54c44: 4e5e unlk %fp <== NOT EXECUTED
0004b024 <_Objects_Id_to_name>:
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
4b024: 4e56 fffc linkw %fp,#-4
4b028: 222e 0008 movel %fp@(8),%d1
4b02c: 2f02 movel %d2,%sp@-
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
4b02e: 4a81 tstl %d1
4b030: 660a bnes 4b03c <_Objects_Id_to_name+0x18>
4b032: 2079 0006 a5d2 moveal 6a5d2 <_Per_CPU_Information+0xe>,%a0
4b038: 2228 0008 movel %a0@(8),%d1
4b03c: 7418 moveq #24,%d2
4b03e: 2001 movel %d1,%d0
4b040: e4a8 lsrl %d2,%d0
4b042: 143c 0007 moveb #7,%d2
4b046: c082 andl %d2,%d0
*/
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
uint32_t the_api
)
{
if ( !the_api || the_api > OBJECTS_APIS_LAST )
4b048: 143c 0002 moveb #2,%d2
4b04c: 2040 moveal %d0,%a0
4b04e: 5388 subql #1,%a0
4b050: b488 cmpl %a0,%d2
4b052: 6442 bccs 4b096 <_Objects_Id_to_name+0x72>
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
4b054: 7003 moveq #3,%d0
4b056: 604e bras 4b0a6 <_Objects_Id_to_name+0x82>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
4b058: 2001 movel %d1,%d0
4b05a: 741b moveq #27,%d2
4b05c: e4a8 lsrl %d2,%d0
if ( !_Objects_Information_table[ the_api ] )
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );
information = _Objects_Information_table[ the_api ][ the_class ];
4b05e: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0
if ( !information )
4b062: 4a88 tstl %a0
4b064: 67ee beqs 4b054 <_Objects_Id_to_name+0x30> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
4b066: 4a28 0032 tstb %a0@(50)
4b06a: 66e8 bnes 4b054 <_Objects_Id_to_name+0x30> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
4b06c: 486e fffc pea %fp@(-4)
4b070: 2f01 movel %d1,%sp@-
4b072: 2f08 movel %a0,%sp@-
4b074: 4eb9 0004 afc4 jsr 4afc4 <_Objects_Get>
if ( !the_object )
4b07a: 4fef 000c lea %sp@(12),%sp
4b07e: 4a80 tstl %d0
4b080: 67d2 beqs 4b054 <_Objects_Id_to_name+0x30>
return OBJECTS_INVALID_ID;
*name = the_object->name;
4b082: 206e 000c moveal %fp@(12),%a0
4b086: 2240 moveal %d0,%a1
4b088: 20a9 000c movel %a1@(12),%a0@
_Thread_Enable_dispatch();
4b08c: 4eb9 0004 bcc0 jsr 4bcc0 <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
4b092: 4280 clrl %d0
4b094: 6010 bras 4b0a6 <_Objects_Id_to_name+0x82>
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
if ( !_Objects_Information_table[ the_api ] )
4b096: 41f9 0006 a10e lea 6a10e <_Objects_Information_table>,%a0
4b09c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0
4b0a0: 4a88 tstl %a0
4b0a2: 66b4 bnes 4b058 <_Objects_Id_to_name+0x34>
4b0a4: 60ae bras 4b054 <_Objects_Id_to_name+0x30>
return OBJECTS_INVALID_ID;
*name = the_object->name;
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
4b0a6: 242e fff8 movel %fp@(-8),%d2
4b0aa: 4e5e unlk %fp
...
000461e4 <_POSIX_Keys_Free_memory>:
#include <rtems/posix/key.h>
void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
461e4: 4e56 0000 linkw %fp,#0
461e8: 2f0b movel %a3,%sp@-
uint32_t the_api;
for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
_Workspace_Free( the_key->Values[ the_api ] );
461ea: 47f9 0004 a20c lea 4a20c <_Workspace_Free>,%a3
#include <rtems/posix/key.h>
void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
461f0: 2f0a movel %a2,%sp@-
461f2: 246e 0008 moveal %fp@(8),%a2
uint32_t the_api;
for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
_Workspace_Free( the_key->Values[ the_api ] );
461f6: 2f2a 0018 movel %a2@(24),%sp@-
461fa: 4e93 jsr %a3@
461fc: 2f2a 001c movel %a2@(28),%sp@-
46200: 4e93 jsr %a3@
46202: 2d6a 0020 0008 movel %a2@(32),%fp@(8)
46208: 508f addql #8,%sp
}
4620a: 246e fff8 moveal %fp@(-8),%a2
4620e: 266e fffc moveal %fp@(-4),%a3
46212: 4e5e unlk %fp
)
{
uint32_t the_api;
for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
_Workspace_Free( the_key->Values[ the_api ] );
46214: 4ef9 0004 a20c jmp 4a20c <_Workspace_Free>
...
0004c8f8 <_POSIX_Keys_Run_destructors>:
4c8f8: 7218 moveq #24,%d1
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
4c8fa: 4e56 ffe8 linkw %fp,#-24
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
4c8fe: 206e 0008 moveal %fp@(8),%a0
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
4c902: 48d7 047c moveml %d2-%d6/%a2,%sp@
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
4c906: 2428 0008 movel %a0@(8),%d2
4c90a: 2002 movel %d2,%d0
4c90c: e2a8 lsrl %d1,%d0
4c90e: 123c 0007 moveb #7,%d1
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
4c912: 0282 0000 ffff andil #65535,%d2
4c918: c081 andl %d1,%d0
4c91a: e58a lsll #2,%d2
4c91c: 2a00 movel %d0,%d5
4c91e: 5a85 addql #5,%d5
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4c920: 4286 clrl %d6
4c922: 7601 moveq #1,%d3
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
4c924: 7201 moveq #1,%d1
for ( index = 1 ; index <= max ; ++index ) {
4c926: 3c39 0005 f200 movew 5f200 <_POSIX_Keys_Information+0xe>,%d6
4c92c: 6030 bras 4c95e <_POSIX_Keys_Run_destructors+0x66>
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
4c92e: 2079 0005 f20a moveal 5f20a <_POSIX_Keys_Information+0x18>,%a0
4c934: 2070 4c00 moveal %a0@(00000000,%d4:l:4),%a0
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
4c938: 4a88 tstl %a0
4c93a: 6720 beqs 4c95c <_POSIX_Keys_Run_destructors+0x64>
4c93c: 4aa8 0010 tstl %a0@(16)
4c940: 671a beqs 4c95c <_POSIX_Keys_Run_destructors+0x64>
void *value = key->Values [ thread_api ][ thread_index ];
4c942: 2470 5c00 moveal %a0@(00000000,%d5:l:4),%a2
4c946: d5c2 addal %d2,%a2
4c948: 2252 moveal %a2@,%a1
if ( value != NULL ) {
4c94a: 4a89 tstl %a1
4c94c: 670e beqs 4c95c <_POSIX_Keys_Run_destructors+0x64><== ALWAYS TAKEN
key->Values [ thread_api ][ thread_index ] = NULL;
4c94e: 4292 clrl %a2@ <== NOT EXECUTED
(*key->destructor)( value );
4c950: 2f09 movel %a1,%sp@- <== NOT EXECUTED
4c952: 2068 0010 moveal %a0@(16),%a0 <== NOT EXECUTED
4c956: 4e90 jsr %a0@ <== NOT EXECUTED
4c958: 588f addql #4,%sp <== NOT EXECUTED
done = false;
4c95a: 4201 clrb %d1 <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4c95c: 5283 addql #1,%d3
4c95e: 4284 clrl %d4
4c960: 3803 movew %d3,%d4
4c962: bc84 cmpl %d4,%d6
4c964: 64c8 bccs 4c92e <_POSIX_Keys_Run_destructors+0x36>
* number of iterations. An infinite loop may happen if destructors set
* thread specific data. This can be considered dubious.
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
4c966: 4a01 tstb %d1
4c968: 67b6 beqs 4c920 <_POSIX_Keys_Run_destructors+0x28><== NEVER TAKEN
done = false;
}
}
}
}
}
4c96a: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2
4c970: 4e5e unlk %fp <== NOT EXECUTED
0004a750 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
4a750: 4e56 ffe4 linkw %fp,#-28
4a754: 48d7 043c moveml %d2-%d5/%a2,%sp@
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
mqd_t id,
Objects_Locations *location
)
{
return (POSIX_Message_queue_Control_fd *) _Objects_Get(
4a758: 486e fff8 pea %fp@(-8)
4a75c: 242e 0008 movel %fp@(8),%d2
4a760: 2f02 movel %d2,%sp@-
4a762: 4879 0006 70ca pea 670ca <_POSIX_Message_queue_Information_fds>
4a768: 246e 0014 moveal %fp@(20),%a2
4a76c: 162e 001b moveb %fp@(27),%d3
4a770: 4eb9 0004 d6b0 jsr 4d6b0 <_Objects_Get>
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
4a776: 4fef 000c lea %sp@(12),%sp
4a77a: 4aae fff8 tstl %fp@(-8)
4a77e: 6600 00c0 bnew 4a840 <_POSIX_Message_queue_Receive_support+0xf0>
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
4a782: 2040 moveal %d0,%a0
4a784: 7803 moveq #3,%d4
4a786: 7a01 moveq #1,%d5
4a788: 2228 0014 movel %a0@(20),%d1
4a78c: c881 andl %d1,%d4
4a78e: ba84 cmpl %d4,%d5
4a790: 660a bnes 4a79c <_POSIX_Message_queue_Receive_support+0x4c>
_Thread_Enable_dispatch();
4a792: 4eb9 0004 e324 jsr 4e324 <_Thread_Enable_dispatch>
4a798: 6000 00a6 braw 4a840 <_POSIX_Message_queue_Receive_support+0xf0>
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
4a79c: 2068 0010 moveal %a0@(16),%a0
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
4a7a0: 2028 0066 movel %a0@(102),%d0
4a7a4: b0ae 0010 cmpl %fp@(16),%d0
4a7a8: 6316 blss 4a7c0 <_POSIX_Message_queue_Receive_support+0x70>
_Thread_Enable_dispatch();
4a7aa: 4eb9 0004 e324 jsr 4e324 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EMSGSIZE );
4a7b0: 4eb9 0005 31a0 jsr 531a0 <__errno>
4a7b6: 727a moveq #122,%d1
4a7b8: 2040 moveal %d0,%a0
4a7ba: 2081 movel %d1,%a0@
4a7bc: 6000 008e braw 4a84c <_POSIX_Message_queue_Receive_support+0xfc>
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
4a7c0: 70ff moveq #-1,%d0
4a7c2: 2d40 fffc movel %d0,%fp@(-4)
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4a7c6: 4a03 tstb %d3
4a7c8: 670e beqs 4a7d8 <_POSIX_Message_queue_Receive_support+0x88>
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
4a7ca: 2001 movel %d1,%d0
4a7cc: 760e moveq #14,%d3
4a7ce: 7a01 moveq #1,%d5
4a7d0: e6a8 lsrl %d3,%d0
4a7d2: bb80 eorl %d5,%d0
4a7d4: c085 andl %d5,%d0
4a7d6: 6002 bras 4a7da <_POSIX_Message_queue_Receive_support+0x8a>
length_out = -1;
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4a7d8: 4200 clrb %d0
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
4a7da: 2f2e 001c movel %fp@(28),%sp@-
4a7de: 7201 moveq #1,%d1
4a7e0: c280 andl %d0,%d1
4a7e2: 2f01 movel %d1,%sp@-
4a7e4: 486e fffc pea %fp@(-4)
4a7e8: 2f2e 000c movel %fp@(12),%sp@-
4a7ec: 2f02 movel %d2,%sp@-
4a7ee: 4868 001a pea %a0@(26)
4a7f2: 4eb9 0004 c75c jsr 4c75c <_CORE_message_queue_Seize>
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
4a7f8: 4eb9 0004 e324 jsr 4e324 <_Thread_Enable_dispatch>
4a7fe: 2079 0006 714e moveal 6714e <_Per_CPU_Information+0xe>,%a0
if (msg_prio) {
4a804: 4fef 0018 lea %sp@(24),%sp
4a808: 4a8a tstl %a2
4a80a: 670a beqs 4a816 <_POSIX_Message_queue_Receive_support+0xc6><== NEVER TAKEN
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
CORE_message_queue_Submit_types priority
)
{
/* absolute value without a library dependency */
return (unsigned int) ((priority >= 0) ? priority : -priority);
4a80c: 2028 0024 movel %a0@(36),%d0
4a810: 6c02 bges 4a814 <_POSIX_Message_queue_Receive_support+0xc4>
4a812: 4480 negl %d0
*msg_prio = _POSIX_Message_queue_Priority_from_core(
4a814: 2480 movel %d0,%a2@
_Thread_Executing->Wait.count
);
}
if ( !_Thread_Executing->Wait.return_code )
4a816: 4aa8 0034 tstl %a0@(52)
4a81a: 6606 bnes 4a822 <_POSIX_Message_queue_Receive_support+0xd2>
return length_out;
4a81c: 202e fffc movel %fp@(-4),%d0
4a820: 602c bras 4a84e <_POSIX_Message_queue_Receive_support+0xfe>
rtems_set_errno_and_return_minus_one(
4a822: 4eb9 0005 31a0 jsr 531a0 <__errno>
4a828: 2079 0006 714e moveal 6714e <_Per_CPU_Information+0xe>,%a0
4a82e: 2440 moveal %d0,%a2
4a830: 2f28 0034 movel %a0@(52),%sp@-
4a834: 4eb9 0004 aa68 jsr 4aa68 <_POSIX_Message_queue_Translate_core_message_queue_return_code>
4a83a: 588f addql #4,%sp
4a83c: 2480 movel %d0,%a2@
4a83e: 600c bras 4a84c <_POSIX_Message_queue_Receive_support+0xfc>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4a840: 4eb9 0005 31a0 jsr 531a0 <__errno>
4a846: 2040 moveal %d0,%a0
4a848: 7009 moveq #9,%d0
4a84a: 2080 movel %d0,%a0@
4a84c: 70ff moveq #-1,%d0
}
4a84e: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2
4a854: 4e5e unlk %fp <== NOT EXECUTED
0004c93c <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
4c93c: 4e56 0000 linkw %fp,#0
4c940: 2f0a movel %a2,%sp@-
4c942: 2f02 movel %d2,%sp@-
4c944: 242e 0008 movel %fp@(8),%d2
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
4c948: 4aae 0010 tstl %fp@(16)
4c94c: 670e beqs 4c95c <_POSIX_Semaphore_Create_support+0x20>
rtems_set_errno_and_return_minus_one( ENOSYS );
4c94e: 4eb9 0004 ea90 jsr 4ea90 <__errno>
4c954: 7458 moveq #88,%d2
4c956: 2040 moveal %d0,%a0
4c958: 2082 movel %d2,%a0@
4c95a: 6034 bras 4c990 <_POSIX_Semaphore_Create_support+0x54>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4c95c: 2039 0006 3440 movel 63440 <_Thread_Dispatch_disable_level>,%d0
++level;
4c962: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
4c964: 23c0 0006 3440 movel %d0,63440 <_Thread_Dispatch_disable_level>
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
4c96a: 4879 0006 365c pea 6365c <_POSIX_Semaphore_Information>
4c970: 4eb9 0004 8ea0 jsr 48ea0 <_Objects_Allocate>
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
4c976: 588f addql #4,%sp
4c978: 2440 moveal %d0,%a2
4c97a: 4a80 tstl %d0
4c97c: 6618 bnes 4c996 <_POSIX_Semaphore_Create_support+0x5a>
_Thread_Enable_dispatch();
4c97e: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
4c984: 4eb9 0004 ea90 jsr 4ea90 <__errno>
4c98a: 721c moveq #28,%d1
4c98c: 2040 moveal %d0,%a0
4c98e: 2081 movel %d1,%a0@
4c990: 70ff moveq #-1,%d0
4c992: 6000 00a8 braw 4ca3c <_POSIX_Semaphore_Create_support+0x100>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
4c996: 4a82 tstl %d2
4c998: 6736 beqs 4c9d0 <_POSIX_Semaphore_Create_support+0x94>
name = _Workspace_String_duplicate( name_arg, name_len );
4c99a: 2f2e 000c movel %fp@(12),%sp@-
4c99e: 2f02 movel %d2,%sp@-
4c9a0: 4eb9 0004 d6f8 jsr 4d6f8 <_Workspace_String_duplicate>
if ( !name ) {
4c9a6: 508f addql #8,%sp
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
name = _Workspace_String_duplicate( name_arg, name_len );
4c9a8: 2400 movel %d0,%d2
if ( !name ) {
4c9aa: 6626 bnes 4c9d2 <_POSIX_Semaphore_Create_support+0x96><== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
4c9ac: 2f0a movel %a2,%sp@- <== NOT EXECUTED
4c9ae: 4879 0006 365c pea 6365c <_POSIX_Semaphore_Information> <== NOT EXECUTED
4c9b4: 4eb9 0004 91b0 jsr 491b0 <_Objects_Free> <== NOT EXECUTED
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
4c9ba: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4c9c0: 4eb9 0004 ea90 jsr 4ea90 <__errno> <== NOT EXECUTED
4c9c6: 508f addql #8,%sp <== NOT EXECUTED
4c9c8: 2040 moveal %d0,%a0 <== NOT EXECUTED
4c9ca: 700c moveq #12,%d0 <== NOT EXECUTED
4c9cc: 2080 movel %d0,%a0@ <== NOT EXECUTED
4c9ce: 60c0 bras 4c990 <_POSIX_Semaphore_Create_support+0x54><== NOT EXECUTED
}
} else {
name = NULL;
4c9d0: 4282 clrl %d2
}
the_semaphore->process_shared = pshared;
4c9d2: 42aa 0010 clrl %a2@(16)
if ( name ) {
4c9d6: 4a82 tstl %d2
4c9d8: 670e beqs 4c9e8 <_POSIX_Semaphore_Create_support+0xac>
the_semaphore->named = true;
4c9da: 7001 moveq #1,%d0
4c9dc: 1540 0014 moveb %d0,%a2@(20)
the_semaphore->open_count = 1;
4c9e0: 7001 moveq #1,%d0
4c9e2: 2540 0016 movel %d0,%a2@(22)
4c9e6: 600a bras 4c9f2 <_POSIX_Semaphore_Create_support+0xb6>
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
the_semaphore->open_count = 0;
4c9e8: 42aa 0016 clrl %a2@(22)
if ( name ) {
the_semaphore->named = true;
the_semaphore->open_count = 1;
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
4c9ec: 4200 clrb %d0
4c9ee: 1540 0014 moveb %d0,%a2@(20)
* blocking tasks on this semaphore should be. It could somehow
* be derived from the current scheduling policy. One
* thing is certain, no matter what we decide, it won't be
* the same as all other POSIX implementations. :)
*/
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
4c9f2: 42aa 005e clrl %a2@(94)
the_semaphore->open_count = 1;
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
the_semaphore->open_count = 0;
the_semaphore->linked = false;
4c9f6: 1540 0015 moveb %d0,%a2@(21)
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
4c9fa: 70ff moveq #-1,%d0
4c9fc: 2540 005a movel %d0,%a2@(90)
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
4ca00: 2f2e 0014 movel %fp@(20),%sp@-
4ca04: 486a 005a pea %a2@(90)
4ca08: 486a 001a pea %a2@(26)
4ca0c: 4eb9 0004 8900 jsr 48900 <_CORE_semaphore_Initialize>
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4ca12: 202a 0008 movel %a2@(8),%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4ca16: 2079 0006 3674 moveal 63674 <_POSIX_Semaphore_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4ca1c: 0280 0000 ffff andil #65535,%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4ca22: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4)
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
4ca26: 206e 0018 moveal %fp@(24),%a0
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
4ca2a: 2542 000c movel %d2,%a2@(12)
4ca2e: 208a movel %a2,%a0@
_Thread_Enable_dispatch();
4ca30: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
return 0;
4ca36: 4fef 000c lea %sp@(12),%sp
4ca3a: 4280 clrl %d0
}
4ca3c: 242e fff8 movel %fp@(-8),%d2
4ca40: 246e fffc moveal %fp@(-4),%a2
4ca44: 4e5e unlk %fp <== NOT EXECUTED
0004a9a0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
#include <rtems/posix/pthread.h>
void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
Thread_Control *the_thread
)
{
4a9a0: 4e56 0000 linkw %fp,#0
4a9a4: 226e 0008 moveal %fp@(8),%a1
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
4a9a8: 2069 00fe moveal %a1@(254),%a0
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
4a9ac: 4aa8 00d8 tstl %a0@(216)
4a9b0: 662c bnes 4a9de <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x3e><== NEVER TAKEN
4a9b2: 7001 moveq #1,%d0
4a9b4: b0a8 00dc cmpl %a0@(220),%d0
4a9b8: 6624 bnes 4a9de <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x3e>
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
4a9ba: 4aa8 00e0 tstl %a0@(224)
4a9be: 671e beqs 4a9de <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x3e>
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
4a9c0: 4878 ffff pea ffffffff <LESS>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4a9c4: 2039 0005 f31a movel 5f31a <_Thread_Dispatch_disable_level>,%d0
--level;
4a9ca: 5380 subql #1,%d0
4a9cc: 2f09 movel %a1,%sp@-
_Thread_Dispatch_disable_level = level;
4a9ce: 23c0 0005 f31a movel %d0,5f31a <_Thread_Dispatch_disable_level>
4a9d4: 4eb9 0004 b000 jsr 4b000 <_POSIX_Thread_Exit>
4a9da: 508f addql #8,%sp
4a9dc: 6008 bras 4a9e6 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x46>
} else
_Thread_Enable_dispatch();
}
4a9de: 4e5e unlk %fp
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
} else
_Thread_Enable_dispatch();
4a9e0: 4ef9 0004 8860 jmp 48860 <_Thread_Enable_dispatch>
}
4a9e6: 4e5e unlk %fp
...
0004bab8 <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
4bab8: 4e56 ffec linkw %fp,#-20
4babc: 48d7 3c04 moveml %d2/%a2-%a5,%sp@
4bac0: 246e 000c moveal %fp@(12),%a2
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
4bac4: 2f12 movel %a2@,%sp@-
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
4bac6: 242e 0008 movel %fp@(8),%d2
4baca: 266e 0010 moveal %fp@(16),%a3
4bace: 286e 0014 moveal %fp@(20),%a4
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
4bad2: 4eb9 0004 ba90 jsr 4ba90 <_POSIX_Priority_Is_valid>
4bad8: 588f addql #4,%sp
4bada: 4a00 tstb %d0
4badc: 6604 bnes 4bae2 <_POSIX_Thread_Translate_sched_param+0x2a><== ALWAYS TAKEN
return EINVAL;
4bade: 7016 moveq #22,%d0
4bae0: 6078 bras 4bb5a <_POSIX_Thread_Translate_sched_param+0xa2>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
4bae2: 4293 clrl %a3@
*budget_callout = NULL;
4bae4: 4294 clrl %a4@
if ( policy == SCHED_OTHER ) {
4bae6: 4a82 tstl %d2
4bae8: 6606 bnes 4baf0 <_POSIX_Thread_Translate_sched_param+0x38>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4baea: 7401 moveq #1,%d2
4baec: 2682 movel %d2,%a3@
4baee: 6068 bras 4bb58 <_POSIX_Thread_Translate_sched_param+0xa0>
return 0;
}
if ( policy == SCHED_FIFO ) {
4baf0: 7001 moveq #1,%d0
4baf2: b082 cmpl %d2,%d0
4baf4: 6762 beqs 4bb58 <_POSIX_Thread_Translate_sched_param+0xa0>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
4baf6: 103c 0002 moveb #2,%d0
4bafa: b082 cmpl %d2,%d0
4bafc: 6608 bnes 4bb06 <_POSIX_Thread_Translate_sched_param+0x4e>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
4bafe: 7202 moveq #2,%d1
return 0;
4bb00: 4200 clrb %d0
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
4bb02: 2681 movel %d1,%a3@
return 0;
4bb04: 6054 bras 4bb5a <_POSIX_Thread_Translate_sched_param+0xa2>
}
if ( policy == SCHED_SPORADIC ) {
4bb06: 7004 moveq #4,%d0
4bb08: b082 cmpl %d2,%d0
4bb0a: 66d2 bnes 4bade <_POSIX_Thread_Translate_sched_param+0x26>
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
4bb0c: 4aaa 0008 tstl %a2@(8)
4bb10: 6606 bnes 4bb18 <_POSIX_Thread_Translate_sched_param+0x60>
4bb12: 4aaa 000c tstl %a2@(12)
4bb16: 67c6 beqs 4bade <_POSIX_Thread_Translate_sched_param+0x26>
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
4bb18: 4aaa 0010 tstl %a2@(16)
4bb1c: 6606 bnes 4bb24 <_POSIX_Thread_Translate_sched_param+0x6c>
4bb1e: 4aaa 0014 tstl %a2@(20)
4bb22: 67ba beqs 4bade <_POSIX_Thread_Translate_sched_param+0x26>
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
4bb24: 486a 0008 pea %a2@(8)
4bb28: 4bf9 0004 9d80 lea 49d80 <_Timespec_To_ticks>,%a5
4bb2e: 4e95 jsr %a5@
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
4bb30: 486a 0010 pea %a2@(16)
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
4bb34: 2400 movel %d0,%d2
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
4bb36: 4e95 jsr %a5@
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
4bb38: 508f addql #8,%sp
4bb3a: b082 cmpl %d2,%d0
4bb3c: 62a0 bhis 4bade <_POSIX_Thread_Translate_sched_param+0x26>
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
4bb3e: 2f2a 0004 movel %a2@(4),%sp@-
4bb42: 4eb9 0004 ba90 jsr 4ba90 <_POSIX_Priority_Is_valid>
4bb48: 588f addql #4,%sp
4bb4a: 4a00 tstb %d0
4bb4c: 6790 beqs 4bade <_POSIX_Thread_Translate_sched_param+0x26>
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
4bb4e: 7003 moveq #3,%d0
4bb50: 2680 movel %d0,%a3@
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
4bb52: 28bc 0004 67e8 movel #288744,%a4@
return 0;
}
if ( policy == SCHED_FIFO ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
4bb58: 4280 clrl %d0
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
}
4bb5a: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
4bb60: 4e5e unlk %fp <== NOT EXECUTED
0004abf2 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
4abf2: 4e56 ffec linkw %fp,#-20
4abf6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
4abfa: 246e 000c moveal %fp@(12),%a2
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
4abfe: 49f9 0004 8a0c lea 48a0c <_Thread_queue_Dequeue>,%a4
{
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
4ac04: 266a 00fe moveal %a2@(254),%a3
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
4ac08: 240b movel %a3,%d2
4ac0a: 0682 0000 0044 addil #68,%d2
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
4ac10: 2f0a movel %a2,%sp@-
4ac12: 4eb9 0004 c890 jsr 4c890 <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
4ac18: 2f0a movel %a2,%sp@-
4ac1a: 4eb9 0004 c8f8 jsr 4c8f8 <_POSIX_Keys_Run_destructors>
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
4ac20: 262a 0028 movel %a2@(40),%d3
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
4ac24: 508f addql #8,%sp
4ac26: 6008 bras 4ac30 <_POSIX_Threads_Delete_extension+0x3e>
*(void **)the_thread->Wait.return_argument = value_ptr;
4ac28: 2240 moveal %d0,%a1 <== NOT EXECUTED
4ac2a: 2069 0028 moveal %a1@(40),%a0 <== NOT EXECUTED
4ac2e: 2083 movel %d3,%a0@ <== NOT EXECUTED
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
4ac30: 2f02 movel %d2,%sp@-
4ac32: 4e94 jsr %a4@
4ac34: 588f addql #4,%sp
4ac36: 4a80 tstl %d0
4ac38: 66ee bnes 4ac28 <_POSIX_Threads_Delete_extension+0x36><== NEVER TAKEN
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
4ac3a: 103c 0004 moveb #4,%d0
4ac3e: b0ab 0084 cmpl %a3@(132),%d0
4ac42: 660c bnes 4ac50 <_POSIX_Threads_Delete_extension+0x5e>
(void) _Watchdog_Remove( &api->Sporadic_timer );
4ac44: 486b 00a8 pea %a3@(168)
4ac48: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove>
4ac4e: 588f addql #4,%sp
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
4ac50: 42aa 00fe clrl %a2@(254)
_Workspace_Free( api );
4ac54: 2d4b 0008 movel %a3,%fp@(8)
}
4ac58: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4ac5e: 4e5e unlk %fp
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
_Workspace_Free( api );
4ac60: 4ef9 0004 94d4 jmp 494d4 <_Workspace_Free>
00046528 <_POSIX_Threads_Initialize_user_threads_body>:
#include <rtems/posix/config.h>
#include <rtems/posix/key.h>
#include <rtems/posix/time.h>
void _POSIX_Threads_Initialize_user_threads_body(void)
{
46528: 4e56 ff98 linkw %fp,#-104
4652c: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@
uint32_t maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
46530: 2479 0005 e526 moveal 5e526 <Configuration_POSIX_API+0x34>,%a2
maximum = Configuration_POSIX_API.number_of_initialization_threads;
46536: 2839 0005 e522 movel 5e522 <Configuration_POSIX_API+0x30>,%d4
if ( !user_threads || maximum == 0 )
4653c: 4a8a tstl %a2
4653e: 676e beqs 465ae <_POSIX_Threads_Initialize_user_threads_body+0x86><== NEVER TAKEN
46540: 4a84 tstl %d4
46542: 676a beqs 465ae <_POSIX_Threads_Initialize_user_threads_body+0x86><== NEVER TAKEN
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
46544: 240e movel %fp,%d2
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
status = pthread_create(
46546: 2a0e movel %fp,%d5
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
46548: 4283 clrl %d3
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
4654a: 0682 ffff ffc0 addil #-64,%d2
46550: 47f9 0004 bb64 lea 4bb64 <pthread_attr_init>,%a3
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
46556: 49f9 0004 bb90 lea 4bb90 <pthread_attr_setinheritsched>,%a4
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
4655c: 4bf9 0004 bbc8 lea 4bbc8 <pthread_attr_setstacksize>,%a5
status = pthread_create(
46562: 0685 ffff ffbc addil #-68,%d5
46568: 2c3c 0004 6208 movel #287240,%d6
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
4656e: 2f02 movel %d2,%sp@-
46570: 4e93 jsr %a3@
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
46572: 4878 0002 pea 2 <DOUBLE_FLOAT>
46576: 2f02 movel %d2,%sp@-
46578: 4e94 jsr %a4@
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
4657a: 2f2a 0004 movel %a2@(4),%sp@-
4657e: 2f02 movel %d2,%sp@-
46580: 4e95 jsr %a5@
status = pthread_create(
46582: 2046 moveal %d6,%a0
46584: 42a7 clrl %sp@-
46586: 2f12 movel %a2@,%sp@-
46588: 508a addql #8,%a2
4658a: 2f02 movel %d2,%sp@-
4658c: 2f05 movel %d5,%sp@-
4658e: 4e90 jsr %a0@
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
46590: 4fef 0024 lea %sp@(36),%sp
46594: 4a80 tstl %d0
46596: 6710 beqs 465a8 <_POSIX_Threads_Initialize_user_threads_body+0x80>
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
46598: 2f00 movel %d0,%sp@-
4659a: 4878 0001 pea 1 <ADD>
4659e: 4878 0002 pea 2 <DOUBLE_FLOAT>
465a2: 4eb9 0004 82f8 jsr 482f8 <_Internal_error_Occurred>
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
465a8: 5283 addql #1,%d3
465aa: b883 cmpl %d3,%d4
465ac: 66c0 bnes 4656e <_POSIX_Threads_Initialize_user_threads_body+0x46><== NEVER TAKEN
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
465ae: 4cee 3c7c ff98 moveml %fp@(-104),%d2-%d6/%a2-%a5
465b4: 4e5e unlk %fp <== NOT EXECUTED
0004ad60 <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
4ad60: 4e56 0000 linkw %fp,#0
4ad64: 2f0b movel %a3,%sp@-
4ad66: 2f0a movel %a2,%sp@-
4ad68: 246e 000c moveal %fp@(12),%a2
Thread_Control *the_thread;
POSIX_API_Control *api;
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4ad6c: 266a 00fe moveal %a2@(254),%a3
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
4ad70: 486b 0098 pea %a3@(152)
4ad74: 4eb9 0004 b9bc jsr 4b9bc <_Timespec_To_ticks>
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4ad7a: 588f addql #4,%sp
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
the_thread->cpu_time_budget = ticks;
4ad7c: 2540 0072 movel %d0,%a2@(114)
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
4ad80: 4280 clrl %d0
4ad82: 1039 0005 d5dc moveb 5d5dc <rtems_maximum_priority>,%d0
4ad88: 90ab 0088 subl %a3@(136),%d0
new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority );
the_thread->real_priority = new_priority;
4ad8c: 2540 0018 movel %d0,%a2@(24)
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
4ad90: 4aaa 001c tstl %a2@(28)
4ad94: 6618 bnes 4adae <_POSIX_Threads_Sporadic_budget_TSR+0x4e><== NEVER TAKEN
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
4ad96: b0aa 0014 cmpl %a2@(20),%d0
4ad9a: 6412 bccs 4adae <_POSIX_Threads_Sporadic_budget_TSR+0x4e>
_Thread_Change_priority( the_thread, new_priority, true );
4ad9c: 4878 0001 pea 1 <ADD>
4ada0: 2f00 movel %d0,%sp@-
4ada2: 2f0a movel %a2,%sp@-
4ada4: 4eb9 0004 82ac jsr 482ac <_Thread_Change_priority>
4adaa: 4fef 000c lea %sp@(12),%sp
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
4adae: 486b 0090 pea %a3@(144)
4adb2: 4eb9 0004 b9bc jsr 4b9bc <_Timespec_To_ticks>
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
}
4adb8: 246e fff8 moveal %fp@(-8),%a2
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4adbc: 588f addql #4,%sp
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4adbe: 2740 00b4 movel %d0,%a3@(180)
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
4adc2: 47eb 00a8 lea %a3@(168),%a3
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4adc6: 203c 0005 ef72 movel #388978,%d0
4adcc: 2d4b 000c movel %a3,%fp@(12)
}
4add0: 266e fffc moveal %fp@(-4),%a3
4add4: 2d40 0008 movel %d0,%fp@(8)
4add8: 4e5e unlk %fp
4adda: 4ef9 0004 91d4 jmp 491d4 <_Watchdog_Insert>
0004ade0 <_POSIX_Threads_Sporadic_budget_callout>:
/*
* 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 */
4ade0: 70ff moveq #-1,%d0
* _POSIX_Threads_Sporadic_budget_callout
*/
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
4ade2: 4e56 0000 linkw %fp,#0
4ade6: 206e 0008 moveal %fp@(8),%a0
/*
* 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 */
4adea: 2140 0072 movel %d0,%a0@(114)
4adee: 4280 clrl %d0
4adf0: 1039 0005 d5dc moveb 5d5dc <rtems_maximum_priority>,%d0
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4adf6: 2268 00fe moveal %a0@(254),%a1
4adfa: 90a9 008c subl %a1@(140),%d0
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
4adfe: 2140 0018 movel %d0,%a0@(24)
*/
#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 ) {
4ae02: 4aa8 001c tstl %a0@(28)
4ae06: 6618 bnes 4ae20 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN
/*
* 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 ) {
4ae08: b0a8 0014 cmpl %a0@(20),%d0
4ae0c: 6312 blss 4ae20 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN
_Thread_Change_priority( the_thread, new_priority, true );
4ae0e: 4878 0001 pea 1 <ADD>
4ae12: 2f00 movel %d0,%sp@-
4ae14: 2f08 movel %a0,%sp@-
4ae16: 4eb9 0004 82ac jsr 482ac <_Thread_Change_priority>
4ae1c: 4fef 000c lea %sp@(12),%sp
#if 0
printk( "lower priority\n" );
#endif
}
}
}
4ae20: 4e5e unlk %fp <== NOT EXECUTED
000460cc <_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)
{
460cc: 4e56 ffec linkw %fp,#-20
460d0: 48d7 040c moveml %d2-%d3/%a2,%sp@
460d4: 246e 000c moveal %fp@(12),%a2
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
460d8: 52aa 0066 addql #1,%a2@(102)
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
460dc: 4aaa 0052 tstl %a2@(82)
460e0: 6606 bnes 460e8 <_POSIX_Timer_TSR+0x1c>
460e2: 4aaa 0056 tstl %a2@(86)
460e6: 6776 beqs 4615e <_POSIX_Timer_TSR+0x92> <== NEVER TAKEN
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
460e8: 2f0a movel %a2,%sp@-
460ea: 4879 0004 60cc pea 460cc <_POSIX_Timer_TSR>
460f0: 2f2a 0008 movel %a2@(8),%sp@-
460f4: 2f2a 0062 movel %a2@(98),%sp@-
460f8: 486a 0010 pea %a2@(16)
460fc: 4eb9 0004 b624 jsr 4b624 <_POSIX_Timer_Insert_helper>
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
46102: 4fef 0014 lea %sp@(20),%sp
46106: 4a00 tstb %d0
46108: 676e beqs 46178 <_POSIX_Timer_TSR+0xac> <== NEVER TAKEN
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
4610a: 4879 0005 f8d8 pea 5f8d8 <_TOD>
46110: 486e fff8 pea %fp@(-8)
46114: 4eb9 0004 7718 jsr 47718 <_TOD_Get_with_nanoseconds>
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
}
4611a: 2040 moveal %d0,%a0
4611c: 2410 movel %a0@,%d2
4611e: 2628 0004 movel %a0@(4),%d3
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
46122: 2f3c 3b9a ca00 movel #1000000000,%sp@-
46128: 42a7 clrl %sp@-
4612a: 2f03 movel %d3,%sp@-
4612c: 2f02 movel %d2,%sp@-
4612e: 4eb9 0005 a1d4 jsr 5a1d4 <__divdi3>
46134: 4fef 0010 lea %sp@(16),%sp
46138: 2541 006a movel %d1,%a2@(106)
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
4613c: 2f3c 3b9a ca00 movel #1000000000,%sp@-
46142: 42a7 clrl %sp@-
46144: 2f03 movel %d3,%sp@-
46146: 2f02 movel %d2,%sp@-
46148: 4eb9 0005 a634 jsr 5a634 <__moddi3>
/* Store the time when the timer was started again */
_TOD_Get( &ptimer->time );
/* The state really did not change but just to be safe */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
4614e: 4fef 0018 lea %sp@(24),%sp
46152: 7003 moveq #3,%d0
46154: 2541 006e movel %d1,%a2@(110)
46158: 1540 003c moveb %d0,%a2@(60)
4615c: 6006 bras 46164 <_POSIX_Timer_TSR+0x98>
} else {
/* Indicates that the timer is stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
4615e: 7004 moveq #4,%d0 <== NOT EXECUTED
46160: 1540 003c moveb %d0,%a2@(60) <== 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 ) ) {
46164: 2f2a 0042 movel %a2@(66),%sp@-
46168: 2f2a 0038 movel %a2@(56),%sp@-
4616c: 4eb9 0004 b218 jsr 4b218 <pthread_kill>
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
46172: 508f addql #8,%sp
46174: 42aa 0066 clrl %a2@(102)
}
46178: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
4617e: 4e5e unlk %fp
...
0004c974 <_POSIX_signals_Check_signal>:
{
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
4c974: 4280 clrl %d0
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
4c976: 4e56 ffb4 linkw %fp,#-76
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
4c97a: 102e 0013 moveb %fp@(19),%d0
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
4c97e: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
4c982: 4878 0001 pea 1 <ADD>
4c986: 2a0e movel %fp,%d5
4c988: 0685 ffff ffcc addil #-52,%d5
4c98e: 2f00 movel %d0,%sp@-
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
4c990: 242e 000c movel %fp@(12),%d2
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
4c994: 2f05 movel %d5,%sp@-
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
4c996: 246e 0008 moveal %fp@(8),%a2
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
4c99a: 2f02 movel %d2,%sp@-
4c99c: 2f0a movel %a2,%sp@-
4c99e: 4eb9 0004 ca4c jsr 4ca4c <_POSIX_signals_Clear_signals>
4c9a4: 4fef 0014 lea %sp@(20),%sp
4c9a8: 4a00 tstb %d0
4c9aa: 6700 0092 beqw 4ca3e <_POSIX_signals_Check_signal+0xca>
#endif
/*
* Just to prevent sending a signal which is currently being ignored.
*/
if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
4c9ae: 2002 movel %d2,%d0
4c9b0: 2602 movel %d2,%d3
4c9b2: e588 lsll #2,%d0
4c9b4: e98b lsll #4,%d3
4c9b6: 9680 subl %d0,%d3
4c9b8: 2043 moveal %d3,%a0
4c9ba: d1fc 0005 f358 addal #389976,%a0
4c9c0: 7001 moveq #1,%d0
4c9c2: 2668 0008 moveal %a0@(8),%a3
4c9c6: b08b cmpl %a3,%d0
4c9c8: 6774 beqs 4ca3e <_POSIX_signals_Check_signal+0xca><== NEVER TAKEN
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
4c9ca: 2028 0004 movel %a0@(4),%d0
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
4c9ce: 282a 00d0 movel %a2@(208),%d4
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
4c9d2: 8084 orl %d4,%d0
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
4c9d4: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0
4c9da: 41e8 0020 lea %a0@(32),%a0
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
4c9de: 2540 00d0 movel %d0,%a2@(208)
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
4c9e2: 4878 0028 pea 28 <OPER2+0x14>
4c9e6: 2f08 movel %a0,%sp@-
4c9e8: 486e ffd8 pea %fp@(-40)
4c9ec: 4eb9 0004 d7b8 jsr 4d7b8 <memcpy>
sizeof( Thread_Wait_information ));
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
4c9f2: 4fef 000c lea %sp@(12),%sp
4c9f6: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0
4c9fc: 7002 moveq #2,%d0
4c9fe: b0b0 3800 cmpl %a0@(00000000,%d3:l),%d0
4ca02: 660e bnes 4ca12 <_POSIX_signals_Check_signal+0x9e>
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
4ca04: 42a7 clrl %sp@-
4ca06: 2f05 movel %d5,%sp@-
4ca08: 2f02 movel %d2,%sp@-
4ca0a: 4e93 jsr %a3@
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
4ca0c: 4fef 000c lea %sp@(12),%sp
4ca10: 6006 bras 4ca18 <_POSIX_signals_Check_signal+0xa4>
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
4ca12: 2f02 movel %d2,%sp@-
4ca14: 4e93 jsr %a3@
break;
4ca16: 588f addql #4,%sp
}
/*
* Restore the blocking information
*/
memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information,
4ca18: 4878 0028 pea 28 <OPER2+0x14>
4ca1c: 486e ffd8 pea %fp@(-40)
4ca20: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0
4ca26: 41e8 0020 lea %a0@(32),%a0
4ca2a: 2f08 movel %a0,%sp@-
4ca2c: 4eb9 0004 d7b8 jsr 4d7b8 <memcpy>
sizeof( Thread_Wait_information ));
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
4ca32: 4fef 000c lea %sp@(12),%sp
4ca36: 2544 00d0 movel %d4,%a2@(208)
return true;
4ca3a: 7001 moveq #1,%d0
4ca3c: 6002 bras 4ca40 <_POSIX_signals_Check_signal+0xcc>
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
is_global, true ) )
return false;
4ca3e: 4200 clrb %d0
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
return true;
}
4ca40: 4cee 0c3c ffb4 moveml %fp@(-76),%d2-%d5/%a2-%a3
4ca46: 4e5e unlk %fp
...
0004cf0c <_POSIX_signals_Clear_process_signals>:
4cf0c: 7201 moveq #1,%d1
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
4cf0e: 4e56 0000 linkw %fp,#0
4cf12: 202e 0008 movel %fp@(8),%d0
4cf16: 2f03 movel %d3,%sp@-
4cf18: 2f02 movel %d2,%sp@-
4cf1a: 2400 movel %d0,%d2
4cf1c: 5382 subql #1,%d2
4cf1e: e5a9 lsll %d2,%d1
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
4cf20: 243c 0000 0700 movel #1792,%d2
4cf26: 40c3 movew %sr,%d3
4cf28: 8483 orl %d3,%d2
4cf2a: 46c2 movew %d2,%sr
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
4cf2c: 2400 movel %d0,%d2
4cf2e: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0
4cf34: e58a lsll #2,%d2
4cf36: e988 lsll #4,%d0
4cf38: 9082 subl %d2,%d0
4cf3a: 7402 moveq #2,%d2
4cf3c: b4b0 0800 cmpl %a0@(00000000,%d0:l),%d2
4cf40: 6614 bnes 4cf56 <_POSIX_signals_Clear_process_signals+0x4a>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
4cf42: 2040 moveal %d0,%a0
4cf44: d1fc 0005 f550 addal #390480,%a0
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4cf4a: 2008 movel %a0,%d0
4cf4c: 5880 addql #4,%d0
4cf4e: b090 cmpl %a0@,%d0
4cf50: 6704 beqs 4cf56 <_POSIX_signals_Clear_process_signals+0x4a><== ALWAYS TAKEN
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
4cf52: 46c3 movew %d3,%sr
4cf54: 600a bras 4cf60 <_POSIX_signals_Clear_process_signals+0x54>
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
4cf56: 4681 notl %d1
4cf58: c3b9 0005 f54c andl %d1,5f54c <_POSIX_signals_Pending>
4cf5e: 60f2 bras 4cf52 <_POSIX_signals_Clear_process_signals+0x46>
}
_ISR_Enable( level );
}
4cf60: 241f movel %sp@+,%d2
4cf62: 261f movel %sp@+,%d3
4cf64: 4e5e unlk %fp <== NOT EXECUTED
0004ca4c <_POSIX_signals_Clear_signals>:
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
4ca4c: 7001 moveq #1,%d0
int signo,
siginfo_t *info,
bool is_global,
bool check_blocked
)
{
4ca4e: 4e56 ffec linkw %fp,#-20
4ca52: 206e 0008 moveal %fp@(8),%a0
4ca56: 48d7 043c moveml %d2-%d5/%a2,%sp@
4ca5a: 242e 000c movel %fp@(12),%d2
4ca5e: 2202 movel %d2,%d1
4ca60: 5381 subql #1,%d1
4ca62: 1a2e 0017 moveb %fp@(23),%d5
4ca66: e3a8 lsll %d1,%d0
/* set blocked signals based on if checking for them, SIGNAL_ALL_MASK
* insures that no signals are blocked and all are checked.
*/
if ( check_blocked )
4ca68: 4a2e 001b tstb %fp@(27)
4ca6c: 6708 beqs 4ca76 <_POSIX_signals_Clear_signals+0x2a>
signals_blocked = ~api->signals_blocked;
4ca6e: 2628 00d0 movel %a0@(208),%d3
4ca72: 4683 notl %d3
4ca74: 6002 bras 4ca78 <_POSIX_signals_Clear_signals+0x2c>
else
signals_blocked = SIGNAL_ALL_MASK;
4ca76: 76ff moveq #-1,%d3
/* XXX is this right for siginfo type signals? */
/* XXX are we sure they can be cleared the same way? */
_ISR_Disable( level );
4ca78: 223c 0000 0700 movel #1792,%d1
4ca7e: 40c4 movew %sr,%d4
4ca80: 8284 orl %d4,%d1
4ca82: 46c1 movew %d1,%sr
if ( is_global ) {
4ca84: 4a05 tstb %d5
4ca86: 6700 008a beqw 4cb12 <_POSIX_signals_Clear_signals+0xc6>
if ( mask & (_POSIX_signals_Pending & signals_blocked) ) {
4ca8a: c0b9 0005 f54c andl 5f54c <_POSIX_signals_Pending>,%d0
4ca90: c083 andl %d3,%d0
4ca92: 6700 0096 beqw 4cb2a <_POSIX_signals_Clear_signals+0xde>
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
4ca96: 2202 movel %d2,%d1
4ca98: 2002 movel %d2,%d0
4ca9a: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0
4caa0: e589 lsll #2,%d1
4caa2: e988 lsll #4,%d0
4caa4: 9081 subl %d1,%d0
4caa6: 7202 moveq #2,%d1
4caa8: b2b0 0800 cmpl %a0@(00000000,%d0:l),%d1
4caac: 6658 bnes 4cb06 <_POSIX_signals_Clear_signals+0xba>
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] );
4caae: 2040 moveal %d0,%a0
4cab0: d1fc 0005 f550 addal #390480,%a0
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4cab6: 2248 moveal %a0,%a1
4cab8: 2459 moveal %a1@+,%a2
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
4caba: b3ca cmpal %a2,%a1
4cabc: 670a beqs 4cac8 <_POSIX_signals_Clear_signals+0x7c>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
4cabe: 2252 moveal %a2@,%a1
head->next = new_first;
4cac0: 2089 movel %a1,%a0@
new_first->previous = head;
4cac2: 2348 0004 movel %a0,%a1@(4)
4cac6: 6002 bras 4caca <_POSIX_signals_Clear_signals+0x7e>
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
4cac8: 95ca subal %a2,%a2
_POSIX_signals_Clear_process_signals( signo );
4caca: 2f02 movel %d2,%sp@-
4cacc: 4eb9 0004 cf0c jsr 4cf0c <_POSIX_signals_Clear_process_signals>
/*
* It may be impossible to get here with an empty chain
* BUT until that is proven we need to be defensive and
* protect against it.
*/
if ( psiginfo ) {
4cad2: 588f addql #4,%sp
4cad4: 4a8a tstl %a2
4cad6: 672e beqs 4cb06 <_POSIX_signals_Clear_signals+0xba><== NEVER TAKEN
*info = psiginfo->Info;
4cad8: 4878 000c pea c <OPER1>
4cadc: 486a 0008 pea %a2@(8)
4cae0: 2f2e 0010 movel %fp@(16),%sp@-
4cae4: 4eb9 0004 d7b8 jsr 4d7b8 <memcpy>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
4caea: 2079 0005 f4e0 moveal 5f4e0 <_POSIX_signals_Inactive_siginfo+0x8>,%a0
the_node->next = tail;
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
4caf0: 4fef 000c lea %sp@(12),%sp
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
4caf4: 24bc 0005 f4dc movel #390364,%a2@
tail->previous = the_node;
4cafa: 23ca 0005 f4e0 movel %a2,5f4e0 <_POSIX_signals_Inactive_siginfo+0x8>
old_last->next = the_node;
4cb00: 208a movel %a2,%a0@
the_node->previous = old_last;
4cb02: 2548 0004 movel %a0,%a2@(4)
&psiginfo->Node
);
} else
do_callout = false;
}
_POSIX_signals_Clear_process_signals( signo );
4cb06: 2f02 movel %d2,%sp@-
4cb08: 4eb9 0004 cf0c jsr 4cf0c <_POSIX_signals_Clear_process_signals>
4cb0e: 588f addql #4,%sp
4cb10: 6014 bras 4cb26 <_POSIX_signals_Clear_signals+0xda>
do_callout = true;
}
} else {
if ( mask & (api->signals_pending & signals_blocked) ) {
4cb12: 2428 00d4 movel %a0@(212),%d2
4cb16: 2200 movel %d0,%d1
4cb18: c282 andl %d2,%d1
4cb1a: c283 andl %d3,%d1
4cb1c: 670c beqs 4cb2a <_POSIX_signals_Clear_signals+0xde>
api->signals_pending &= ~mask;
4cb1e: 4680 notl %d0
4cb20: c082 andl %d2,%d0
4cb22: 2140 00d4 movel %d0,%a0@(212)
do_callout = true;
4cb26: 7001 moveq #1,%d0
4cb28: 6002 bras 4cb2c <_POSIX_signals_Clear_signals+0xe0>
bool do_callout;
POSIX_signals_Siginfo_node *psiginfo;
mask = signo_to_mask( signo );
do_callout = false;
4cb2a: 4200 clrb %d0
if ( mask & (api->signals_pending & signals_blocked) ) {
api->signals_pending &= ~mask;
do_callout = true;
}
}
_ISR_Enable( level );
4cb2c: 46c4 movew %d4,%sr
return do_callout;
}
4cb2e: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2
4cb34: 4e5e unlk %fp <== NOT EXECUTED
00046c6c <_POSIX_signals_Get_lowest>:
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
46c6c: 701b moveq #27,%d0
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
sigset_t set
)
{
46c6e: 4e56 fff4 linkw %fp,#-12
46c72: 48d7 001c moveml %d2-%d4,%sp@
46c76: 242e 0008 movel %fp@(8),%d2
46c7a: 7601 moveq #1,%d3
#include <rtems/posix/psignalimpl.h>
#include <rtems/seterr.h>
#include <rtems/posix/time.h>
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
46c7c: 2200 movel %d0,%d1
46c7e: 5381 subql #1,%d1
46c80: 2803 movel %d3,%d4
46c82: e3ac lsll %d1,%d4
46c84: 2204 movel %d4,%d1
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
if ( set & signo_to_mask( signo ) ) {
46c86: c282 andl %d2,%d1
46c88: 6626 bnes 46cb0 <_POSIX_signals_Get_lowest+0x44> <== NEVER TAKEN
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
46c8a: 5280 addql #1,%d0
46c8c: 123c 0020 moveb #32,%d1
46c90: b280 cmpl %d0,%d1
46c92: 66e8 bnes 46c7c <_POSIX_signals_Get_lowest+0x10>
46c94: 7001 moveq #1,%d0
46c96: 7601 moveq #1,%d3
#include <rtems/posix/psignalimpl.h>
#include <rtems/seterr.h>
#include <rtems/posix/time.h>
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
46c98: 2200 movel %d0,%d1
46c9a: 5381 subql #1,%d1
46c9c: 2803 movel %d3,%d4
46c9e: e3ac lsll %d1,%d4
46ca0: 2204 movel %d4,%d1
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
if ( set & signo_to_mask( signo ) ) {
46ca2: c282 andl %d2,%d1
46ca4: 660a bnes 46cb0 <_POSIX_signals_Get_lowest+0x44>
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
46ca6: 5280 addql #1,%d0
46ca8: 123c 001b moveb #27,%d1
46cac: b280 cmpl %d0,%d1
46cae: 66e8 bnes 46c98 <_POSIX_signals_Get_lowest+0x2c> <== ALWAYS TAKEN
* a return 0. This routine will NOT be called unless a signal
* is pending in the set passed in.
*/
found_it:
return signo;
}
46cb0: 4cd7 001c moveml %sp@,%d2-%d4
46cb4: 4e5e unlk %fp <== NOT EXECUTED
0004a9cc <_POSIX_signals_Post_switch_hook>:
*/
static void _POSIX_signals_Post_switch_hook(
Thread_Control *the_thread
)
{
4a9cc: 4e56 ffec linkw %fp,#-20
POSIX_API_Control *api;
int signo;
ISR_Level level;
int hold_errno;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4a9d0: 206e 0008 moveal %fp@(8),%a0
*/
static void _POSIX_signals_Post_switch_hook(
Thread_Control *the_thread
)
{
4a9d4: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
POSIX_API_Control *api;
int signo;
ISR_Level level;
int hold_errno;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4a9d8: 2468 00fe moveal %a0@(254),%a2
/*
* We need to ensure that if the signal handler executes a call
* which overwrites the unblocking status, we restore it.
*/
hold_errno = _Thread_Executing->Wait.return_code;
4a9dc: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0
4a9e2: 2628 0034 movel %a0@(52),%d3
/*
* api may be NULL in case of a thread close in progress
*/
if ( !api )
4a9e6: 4a8a tstl %a2
4a9e8: 677a beqs 4aa64 <_POSIX_signals_Post_switch_hook+0x98><== NEVER TAKEN
*
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
4a9ea: 283c 0000 0700 movel #1792,%d4
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
_POSIX_signals_Check_signal( api, signo, false );
4a9f0: 47f9 0004 c974 lea 4c974 <_POSIX_signals_Check_signal>,%a3
*
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
4a9f6: 2004 movel %d4,%d0
4a9f8: 40c1 movew %sr,%d1
4a9fa: 8081 orl %d1,%d0
4a9fc: 46c0 movew %d0,%sr
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
4a9fe: 2039 0005 f54c movel 5f54c <_POSIX_signals_Pending>,%d0
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
4aa04: 242a 00d0 movel %a2@(208),%d2
4aa08: 4682 notl %d2
(api->signals_pending | _POSIX_signals_Pending)) ) {
4aa0a: 80aa 00d4 orl %a2@(212),%d0
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
4aa0e: c082 andl %d2,%d0
(api->signals_pending | _POSIX_signals_Pending)) ) {
_ISR_Enable( level );
4aa10: 46c1 movew %d1,%sr
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
4aa12: 4a80 tstl %d0
4aa14: 660c bnes 4aa22 <_POSIX_signals_Post_switch_hook+0x56>
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
4aa16: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0
4aa1c: 2143 0034 movel %d3,%a0@(52)
4aa20: 6042 bras 4aa64 <_POSIX_signals_Post_switch_hook+0x98>
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4aa22: 741b moveq #27,%d2
_POSIX_signals_Check_signal( api, signo, false );
4aa24: 42a7 clrl %sp@-
4aa26: 2f02 movel %d2,%sp@-
4aa28: 2f0a movel %a2,%sp@-
4aa2a: 4e93 jsr %a3@
_POSIX_signals_Check_signal( api, signo, true );
4aa2c: 4878 0001 pea 1 <ADD>
4aa30: 2f02 movel %d2,%sp@-
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4aa32: 5282 addql #1,%d2
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
4aa34: 2f0a movel %a2,%sp@-
4aa36: 4e93 jsr %a3@
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4aa38: 4fef 0018 lea %sp@(24),%sp
4aa3c: 7020 moveq #32,%d0
4aa3e: b082 cmpl %d2,%d0
4aa40: 66e2 bnes 4aa24 <_POSIX_signals_Post_switch_hook+0x58>
4aa42: 7401 moveq #1,%d2
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
_POSIX_signals_Check_signal( api, signo, false );
4aa44: 42a7 clrl %sp@-
4aa46: 2f02 movel %d2,%sp@-
4aa48: 2f0a movel %a2,%sp@-
4aa4a: 4e93 jsr %a3@
_POSIX_signals_Check_signal( api, signo, true );
4aa4c: 4878 0001 pea 1 <ADD>
4aa50: 2f02 movel %d2,%sp@-
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
4aa52: 5282 addql #1,%d2
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
4aa54: 2f0a movel %a2,%sp@-
4aa56: 4e93 jsr %a3@
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
4aa58: 4fef 0018 lea %sp@(24),%sp
4aa5c: 701b moveq #27,%d0
4aa5e: b082 cmpl %d2,%d0
4aa60: 66e2 bnes 4aa44 <_POSIX_signals_Post_switch_hook+0x78>
4aa62: 6092 bras 4a9f6 <_POSIX_signals_Post_switch_hook+0x2a>
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
}
4aa64: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
4aa6a: 4e5e unlk %fp <== NOT EXECUTED
0005b1d0 <_POSIX_signals_Unblock_thread>:
5b1d0: 7201 moveq #1,%d1
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
5b1d2: 4e56 fff4 linkw %fp,#-12
5b1d6: 226e 0010 moveal %fp@(16),%a1
5b1da: 48d7 040c moveml %d2-%d3/%a2,%sp@
5b1de: 242e 000c movel %fp@(12),%d2
5b1e2: 2002 movel %d2,%d0
5b1e4: 5380 subql #1,%d0
5b1e6: 246e 0008 moveal %fp@(8),%a2
5b1ea: e1a9 lsll %d0,%d1
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
5b1ec: 202a 0010 movel %a2@(16),%d0
5b1f0: 2600 movel %d0,%d3
5b1f2: 0283 1000 8000 andil #268468224,%d3
{
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
5b1f8: 206a 00fe moveal %a2@(254),%a0
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
5b1fc: 0c83 1000 8000 cmpil #268468224,%d3
5b202: 6652 bnes 5b256 <_POSIX_signals_Unblock_thread+0x86>
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
5b204: 2001 movel %d1,%d0
5b206: c0aa 0030 andl %a2@(48),%d0
5b20a: 660e bnes 5b21a <_POSIX_signals_Unblock_thread+0x4a>
5b20c: 2028 00d0 movel %a0@(208),%d0
5b210: 4680 notl %d0
5b212: c280 andl %d0,%d1
5b214: 6604 bnes 5b21a <_POSIX_signals_Unblock_thread+0x4a>
5b216: 6000 00a8 braw 5b2c0 <_POSIX_signals_Unblock_thread+0xf0>
the_thread->Wait.return_code = EINTR;
5b21a: 7004 moveq #4,%d0
the_info = (siginfo_t *) the_thread->Wait.return_argument;
5b21c: 206a 0028 moveal %a2@(40),%a0
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
the_thread->Wait.return_code = EINTR;
5b220: 2540 0034 movel %d0,%a2@(52)
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
5b224: 4a89 tstl %a1
5b226: 660e bnes 5b236 <_POSIX_signals_Unblock_thread+0x66>
the_info->si_signo = signo;
the_info->si_code = SI_USER;
5b228: 7201 moveq #1,%d1
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
5b22a: 2082 movel %d2,%a0@
the_info->si_code = SI_USER;
5b22c: 2141 0004 movel %d1,%a0@(4)
the_info->si_value.sival_int = 0;
5b230: 42a8 0008 clrl %a0@(8)
5b234: 6012 bras 5b248 <_POSIX_signals_Unblock_thread+0x78>
} else {
*the_info = *info;
5b236: 4878 000c pea c <OPER1>
5b23a: 2f09 movel %a1,%sp@-
5b23c: 2f08 movel %a0,%sp@-
5b23e: 4eb9 0004 d7b8 jsr 4d7b8 <memcpy>
5b244: 4fef 000c lea %sp@(12),%sp
}
_Thread_queue_Extract_with_proxy( the_thread );
5b248: 2f0a movel %a2,%sp@-
5b24a: 4eb9 0004 8d14 jsr 48d14 <_Thread_queue_Extract_with_proxy>
return true;
5b250: 588f addql #4,%sp
5b252: 7001 moveq #1,%d0
5b254: 606c bras 5b2c2 <_POSIX_signals_Unblock_thread+0xf2>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
5b256: 2428 00d0 movel %a0@(208),%d2
5b25a: 4682 notl %d2
5b25c: c282 andl %d2,%d1
5b25e: 6760 beqs 5b2c0 <_POSIX_signals_Unblock_thread+0xf0>
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
5b260: 0800 001c btst #28,%d0
5b264: 673e beqs 5b2a4 <_POSIX_signals_Unblock_thread+0xd4>
the_thread->Wait.return_code = EINTR;
5b266: 7204 moveq #4,%d1
5b268: 2541 0034 movel %d1,%a2@(52)
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
5b26c: 2200 movel %d0,%d1
5b26e: 0281 0003 bee0 andil #245472,%d1
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
5b274: 670c beqs 5b282 <_POSIX_signals_Unblock_thread+0xb2>
_Thread_queue_Extract_with_proxy( the_thread );
5b276: 2f0a movel %a2,%sp@-
5b278: 4eb9 0004 8d14 jsr 48d14 <_Thread_queue_Extract_with_proxy>
5b27e: 588f addql #4,%sp
5b280: 603e bras 5b2c0 <_POSIX_signals_Unblock_thread+0xf0>
else if ( _States_Is_delaying(the_thread->current_state) ) {
5b282: 44c0 movew %d0,%ccr
5b284: 6a3a bpls 5b2c0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN
(void) _Watchdog_Remove( &the_thread->Timer );
5b286: 486a 0048 pea %a2@(72)
5b28a: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
5b290: 2f3c 1007 fff8 movel #268959736,%sp@-
5b296: 2f0a movel %a2,%sp@-
5b298: 4eb9 0004 8388 jsr 48388 <_Thread_Clear_state>
5b29e: 4fef 000c lea %sp@(12),%sp
5b2a2: 601c bras 5b2c0 <_POSIX_signals_Unblock_thread+0xf0>
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
5b2a4: 4a80 tstl %d0
5b2a6: 6618 bnes 5b2c0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
5b2a8: 4ab9 0005 f318 tstl 5f318 <_Per_CPU_Information+0x8>
5b2ae: 6710 beqs 5b2c0 <_POSIX_signals_Unblock_thread+0xf0>
5b2b0: b5f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a2
5b2b6: 6608 bnes 5b2c0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN
_Thread_Dispatch_necessary = true;
5b2b8: 7001 moveq #1,%d0
5b2ba: 13c0 0005 f31c moveb %d0,5f31c <_Per_CPU_Information+0xc>
}
}
return false;
5b2c0: 4200 clrb %d0
}
5b2c2: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
5b2c8: 4e5e unlk %fp <== NOT EXECUTED
00048812 <_RBTree_Extract_unprotected>:
*/
void _RBTree_Extract_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
48812: 4e56 ffec linkw %fp,#-20
48816: 48d7 3c04 moveml %d2/%a2-%a5,%sp@
4881a: 2a6e 0008 moveal %fp@(8),%a5
4881e: 246e 000c moveal %fp@(12),%a2
RBTree_Node *leaf, *target;
RBTree_Color victim_color;
RBTree_Direction dir;
if (!the_node) return;
48822: 4a8a tstl %a2
48824: 6700 00fe beqw 48924 <_RBTree_Extract_unprotected+0x112>
/* check if min needs to be updated */
if (the_node == the_rbtree->first[RBT_LEFT]) {
48828: b5ed 0008 cmpal %a5@(8),%a2
4882c: 6612 bnes 48840 <_RBTree_Extract_unprotected+0x2e>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_RIGHT );
4882e: 4878 0001 pea 1 <ADD>
48832: 2f0a movel %a2,%sp@-
48834: 4eb9 0004 8ba4 jsr 48ba4 <_RBTree_Next_unprotected>
RBTree_Node *next;
next = _RBTree_Successor_unprotected(the_node);
the_rbtree->first[RBT_LEFT] = next;
4883a: 508f addql #8,%sp
4883c: 2b40 0008 movel %d0,%a5@(8)
}
/* Check if max needs to be updated. min=max for 1 element trees so
* do not use else if here. */
if (the_node == the_rbtree->first[RBT_RIGHT]) {
48840: b5ed 000c cmpal %a5@(12),%a2
48844: 6610 bnes 48856 <_RBTree_Extract_unprotected+0x44>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_LEFT );
48846: 42a7 clrl %sp@-
48848: 2f0a movel %a2,%sp@-
4884a: 4eb9 0004 8ba4 jsr 48ba4 <_RBTree_Next_unprotected>
RBTree_Node *previous;
previous = _RBTree_Predecessor_unprotected(the_node);
the_rbtree->first[RBT_RIGHT] = previous;
48850: 508f addql #8,%sp
48852: 2b40 000c movel %d0,%a5@(12)
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
48856: 266a 0004 moveal %a2@(4),%a3
4885a: 4a8b tstl %a3
4885c: 6776 beqs 488d4 <_RBTree_Extract_unprotected+0xc2>
4885e: 4aaa 0008 tstl %a2@(8)
48862: 6604 bnes 48868 <_RBTree_Extract_unprotected+0x56>
48864: 6078 bras 488de <_RBTree_Extract_unprotected+0xcc>
target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */
while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT];
48866: 2640 moveal %d0,%a3
48868: 202b 0008 movel %a3@(8),%d0
4886c: 66f8 bnes 48866 <_RBTree_Extract_unprotected+0x54>
* target's position (target is the right child of target->parent)
* when target vacates it. if there is no child, then target->parent
* should become NULL. This may cause the coloring to be violated.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = target->child[RBT_LEFT];
4886e: 286b 0004 moveal %a3@(4),%a4
if(leaf) {
48872: 4a8c tstl %a4
48874: 6704 beqs 4887a <_RBTree_Extract_unprotected+0x68>
leaf->parent = target->parent;
48876: 2893 movel %a3@,%a4@
48878: 6008 bras 48882 <_RBTree_Extract_unprotected+0x70>
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
4887a: 2f0b movel %a3,%sp@-
4887c: 4eba fe60 jsr %pc@(486de <_RBTree_Extract_validate_unprotected>)
48880: 588f addql #4,%sp
}
victim_color = target->color;
dir = target != target->parent->child[0];
48882: 2053 moveal %a3@,%a0
48884: b7e8 0004 cmpal %a0@(4),%a3
48888: 56c1 sne %d1
target->parent->child[dir] = leaf;
4888a: 7401 moveq #1,%d2
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
dir = target != target->parent->child[0];
4888c: 49c1 extbl %d1
target->parent->child[dir] = leaf;
4888e: 9481 subl %d1,%d2
48890: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4)
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = target;
48894: 7401 moveq #1,%d2
victim_color = target->color;
dir = target != target->parent->child[0];
target->parent->child[dir] = leaf;
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
48896: 2052 moveal %a2@,%a0
48898: b5e8 0004 cmpal %a0@(4),%a2
4889c: 56c1 sne %d1
leaf->parent = target->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
4889e: 202b 000c movel %a3@(12),%d0
dir = target != target->parent->child[0];
target->parent->child[dir] = leaf;
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
488a2: 49c1 extbl %d1
the_node->parent->child[dir] = target;
488a4: 9481 subl %d1,%d2
488a6: 218b 2c00 movel %a3,%a0@(00000000,%d2:l:4)
/* set target's new children to the original node's children */
target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT];
488aa: 276a 0008 0008 movel %a2@(8),%a3@(8)
if (the_node->child[RBT_RIGHT])
488b0: 206a 0008 moveal %a2@(8),%a0
488b4: 4a88 tstl %a0
488b6: 6702 beqs 488ba <_RBTree_Extract_unprotected+0xa8><== NEVER TAKEN
the_node->child[RBT_RIGHT]->parent = target;
488b8: 208b movel %a3,%a0@
target->child[RBT_LEFT] = the_node->child[RBT_LEFT];
488ba: 276a 0004 0004 movel %a2@(4),%a3@(4)
if (the_node->child[RBT_LEFT])
488c0: 206a 0004 moveal %a2@(4),%a0
488c4: 4a88 tstl %a0
488c6: 6702 beqs 488ca <_RBTree_Extract_unprotected+0xb8>
the_node->child[RBT_LEFT]->parent = target;
488c8: 208b movel %a3,%a0@
/* finally, update the parent node and recolor. target has completely
* replaced the_node, and target's child has moved up the tree if needed.
* the_node is no longer part of the tree, although it has valid pointers
* still.
*/
target->parent = the_node->parent;
488ca: 2692 movel %a2@,%a3@
target->color = the_node->color;
488cc: 276a 000c 000c movel %a2@(12),%a3@(12)
488d2: 602e bras 48902 <_RBTree_Extract_unprotected+0xf0>
* the_node's location in the tree. This may cause the coloring to be
* violated. We will fix it later.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
488d4: 286a 0008 moveal %a2@(8),%a4
if( leaf ) {
488d8: 4a8c tstl %a4
488da: 6604 bnes 488e0 <_RBTree_Extract_unprotected+0xce>
488dc: 6006 bras 488e4 <_RBTree_Extract_unprotected+0xd2>
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
488de: 284b moveal %a3,%a4
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
leaf->parent = the_node->parent;
488e0: 2892 movel %a2@,%a4@
488e2: 6008 bras 488ec <_RBTree_Extract_unprotected+0xda>
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
488e4: 2f0a movel %a2,%sp@-
488e6: 4eba fdf6 jsr %pc@(486de <_RBTree_Extract_validate_unprotected>)
488ea: 588f addql #4,%sp
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
488ec: 2052 moveal %a2@,%a0
488ee: b5e8 0004 cmpal %a0@(4),%a2
488f2: 56c1 sne %d1
the_node->parent->child[dir] = leaf;
488f4: 7401 moveq #1,%d2
_RBTree_Extract_validate_unprotected(the_node);
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
488f6: 49c1 extbl %d1
the_node->parent->child[dir] = leaf;
488f8: 9481 subl %d1,%d2
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
}
victim_color = the_node->color;
488fa: 202a 000c movel %a2@(12),%d0
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = leaf;
488fe: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4)
/* fix coloring. leaf has moved up the tree. The color of the deleted
* node is in victim_color. There are two cases:
* 1. Deleted a red node, its child must be black. Nothing must be done.
* 2. Deleted a black node, its child must be red. Paint child black.
*/
if (victim_color == RBT_BLACK) { /* eliminate case 1 */
48902: 4a80 tstl %d0
48904: 6608 bnes 4890e <_RBTree_Extract_unprotected+0xfc>
if (leaf) {
48906: 4a8c tstl %a4
48908: 6704 beqs 4890e <_RBTree_Extract_unprotected+0xfc>
leaf->color = RBT_BLACK; /* case 2 */
4890a: 42ac 000c clrl %a4@(12)
/* Wipe the_node */
_RBTree_Set_off_rbtree(the_node);
/* set root to black, if it exists */
if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK;
4890e: 206d 0004 moveal %a5@(4),%a0
*/
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree(
RBTree_Node *node
)
{
node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL;
48912: 42aa 0008 clrl %a2@(8)
48916: 42aa 0004 clrl %a2@(4)
4891a: 4292 clrl %a2@
4891c: 4a88 tstl %a0
4891e: 6704 beqs 48924 <_RBTree_Extract_unprotected+0x112>
48920: 42a8 000c clrl %a0@(12)
}
48924: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
4892a: 4e5e unlk %fp <== NOT EXECUTED
000494d4 <_RBTree_Initialize>:
void *starting_address,
size_t number_nodes,
size_t node_size,
bool is_unique
)
{
494d4: 4e56 fff0 linkw %fp,#-16
494d8: 202e 001c movel %fp@(28),%d0
494dc: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
494e0: 246e 0008 moveal %fp@(8),%a2
494e4: 242e 0014 movel %fp@(20),%d2
size_t count;
RBTree_Node *next;
/* TODO: Error message? */
if (!the_rbtree) return;
494e8: 4a8a tstl %a2
494ea: 6736 beqs 49522 <_RBTree_Initialize+0x4e> <== NEVER TAKEN
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
494ec: 4292 clrl %a2@
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
494ee: 256e 000c 0010 movel %fp@(12),%a2@(16)
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
494f4: 262e 0010 movel %fp@(16),%d3
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
494f8: 42aa 0004 clrl %a2@(4)
while ( count-- ) {
_RBTree_Insert_unprotected(the_rbtree, next);
494fc: 47f9 0004 92b4 lea 492b4 <_RBTree_Insert_unprotected>,%a3
the_rbtree->first[0] = NULL;
49502: 42aa 0008 clrl %a2@(8)
the_rbtree->first[1] = NULL;
49506: 42aa 000c clrl %a2@(12)
the_rbtree->compare_function = compare_function;
the_rbtree->is_unique = is_unique;
4950a: 1540 0014 moveb %d0,%a2@(20)
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
4950e: 600e bras 4951e <_RBTree_Initialize+0x4a>
_RBTree_Insert_unprotected(the_rbtree, next);
49510: 2f03 movel %d3,%sp@-
49512: 5382 subql #1,%d2
49514: 2f0a movel %a2,%sp@-
49516: 4e93 jsr %a3@
49518: 508f addql #8,%sp
#include <rtems/system.h>
#include <rtems/score/address.h>
#include <rtems/score/rbtree.h>
#include <rtems/score/isr.h>
void _RBTree_Initialize(
4951a: d6ae 0018 addl %fp@(24),%d3
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
4951e: 4a82 tstl %d2
49520: 66ee bnes 49510 <_RBTree_Initialize+0x3c>
_RBTree_Insert_unprotected(the_rbtree, next);
next = (RBTree_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
}
49522: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
49528: 4e5e unlk %fp <== NOT EXECUTED
000489b8 <_RBTree_Insert_unprotected>:
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
489b8: 4e56 ffec linkw %fp,#-20
489bc: 48d7 3c04 moveml %d2/%a2-%a5,%sp@
489c0: 266e 0008 moveal %fp@(8),%a3
489c4: 246e 000c moveal %fp@(12),%a2
if(!the_node) return (RBTree_Node*)-1;
489c8: 4a8a tstl %a2
489ca: 6700 013a beqw 48b06 <_RBTree_Insert_unprotected+0x14e>
RBTree_Node *iter_node = the_rbtree->root;
489ce: 286b 0004 moveal %a3@(4),%a4
int compare_result;
if (!iter_node) { /* special case: first node inserted */
489d2: 2a4c moveal %a4,%a5
489d4: 4a8c tstl %a4
489d6: 6620 bnes 489f8 <_RBTree_Insert_unprotected+0x40>
the_node->color = RBT_BLACK;
489d8: 42aa 000c clrl %a2@(12)
the_rbtree->root = the_node;
489dc: 274a 0004 movel %a2,%a3@(4)
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
489e0: 274a 000c movel %a2,%a3@(12)
489e4: 274a 0008 movel %a2,%a3@(8)
the_node->parent = (RBTree_Node *) the_rbtree;
489e8: 248b movel %a3,%a2@
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
489ea: 42aa 0008 clrl %a2@(8)
489ee: 42aa 0004 clrl %a2@(4)
489f2: 6000 0126 braw 48b1a <_RBTree_Insert_unprotected+0x162>
(dir && _RBTree_Is_greater(compare_result)) ) {
the_rbtree->first[dir] = the_node;
}
break;
} else {
iter_node = iter_node->child[dir];
489f6: 2a4c moveal %a4,%a5
the_node->parent = (RBTree_Node *) the_rbtree;
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
} else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
489f8: 2f0c movel %a4,%sp@-
489fa: 2f0a movel %a2,%sp@-
489fc: 206b 0010 moveal %a3@(16),%a0
48a00: 4e90 jsr %a0@
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
48a02: 508f addql #8,%sp
48a04: 4a2b 0014 tstb %a3@(20)
48a08: 6706 beqs 48a10 <_RBTree_Insert_unprotected+0x58>
48a0a: 4a80 tstl %d0
48a0c: 6700 010c beqw 48b1a <_RBTree_Insert_unprotected+0x162>
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
48a10: 2400 movel %d0,%d2
48a12: 4682 notl %d2
48a14: d482 addl %d2,%d2
48a16: 9582 subxl %d2,%d2
48a18: 4482 negl %d2
if (!iter_node->child[dir]) {
48a1a: 2002 movel %d2,%d0
48a1c: 5280 addql #1,%d0
48a1e: 2874 0c00 moveal %a4@(00000000,%d0:l:4),%a4
48a22: 4a8c tstl %a4
48a24: 66d0 bnes 489f6 <_RBTree_Insert_unprotected+0x3e>
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
48a26: 42aa 0008 clrl %a2@(8)
the_node->color = RBT_RED;
48a2a: 7201 moveq #1,%d1
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
if (!iter_node->child[dir]) {
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
48a2c: 42aa 0004 clrl %a2@(4)
the_node->color = RBT_RED;
iter_node->child[dir] = the_node;
48a30: 2b8a 0c00 movel %a2,%a5@(00000000,%d0:l:4)
the_node->parent = iter_node;
48a34: 248d movel %a5,%a2@
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
48a36: 2a42 moveal %d2,%a5
48a38: 548d addql #2,%a5
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
if (!iter_node->child[dir]) {
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
the_node->color = RBT_RED;
48a3a: 2541 000c movel %d1,%a2@(12)
iter_node->child[dir] = the_node;
the_node->parent = iter_node;
/* update min/max */
compare_result = the_rbtree->compare_function(
48a3e: 2f33 dc00 movel %a3@(00000000,%a5:l:4),%sp@-
48a42: 2f0a movel %a2,%sp@-
48a44: 206b 0010 moveal %a3@(16),%a0
48a48: 4e90 jsr %a0@
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
48a4a: 508f addql #8,%sp
48a4c: 4a82 tstl %d2
48a4e: 6608 bnes 48a58 <_RBTree_Insert_unprotected+0xa0>
48a50: 4a80 tstl %d0
48a52: 6c00 0092 bgew 48ae6 <_RBTree_Insert_unprotected+0x12e>
48a56: 6006 bras 48a5e <_RBTree_Insert_unprotected+0xa6>
(dir && _RBTree_Is_greater(compare_result)) ) {
48a58: 4a80 tstl %d0
48a5a: 6f00 008a blew 48ae6 <_RBTree_Insert_unprotected+0x12e>
the_rbtree->first[dir] = the_node;
48a5e: 278a dc00 movel %a2,%a3@(00000000,%a5:l:4)
48a62: 6000 0082 braw 48ae6 <_RBTree_Insert_unprotected+0x12e>
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
48a66: 4a8b tstl %a3
48a68: 671e beqs 48a88 <_RBTree_Insert_unprotected+0xd0><== NEVER TAKEN
if(!(the_node->parent->parent->parent)) return NULL;
48a6a: 4a93 tstl %a3@
48a6c: 671a beqs 48a88 <_RBTree_Insert_unprotected+0xd0><== NEVER TAKEN
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(the_node == the_node->parent->child[RBT_LEFT])
48a6e: 226b 0004 moveal %a3@(4),%a1
48a72: b3c8 cmpal %a0,%a1
48a74: 6604 bnes 48a7a <_RBTree_Insert_unprotected+0xc2>
return the_node->parent->child[RBT_RIGHT];
48a76: 226b 0008 moveal %a3@(8),%a1
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
48a7a: 4a89 tstl %a1
48a7c: 670c beqs 48a8a <_RBTree_Insert_unprotected+0xd2>
48a7e: 7001 moveq #1,%d0
48a80: b0a9 000c cmpl %a1@(12),%d0
48a84: 6604 bnes 48a8a <_RBTree_Insert_unprotected+0xd2>
48a86: 6006 bras 48a8e <_RBTree_Insert_unprotected+0xd6>
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(!(the_node->parent->parent->parent)) return NULL;
48a88: 93c9 subal %a1,%a1 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
48a8a: 4280 clrl %d0
48a8c: 6002 bras 48a90 <_RBTree_Insert_unprotected+0xd8>
48a8e: 7001 moveq #1,%d0
while (_RBTree_Is_red(_RBTree_Parent(the_node))) {
u = _RBTree_Parent_sibling(the_node);
g = the_node->parent->parent;
/* if uncle is red, repaint uncle/parent black and grandparent red */
if(_RBTree_Is_red(u)) {
48a90: 4a80 tstl %d0
48a92: 6710 beqs 48aa4 <_RBTree_Insert_unprotected+0xec>
the_node->parent->color = RBT_BLACK;
48a94: 42a8 000c clrl %a0@(12)
u->color = RBT_BLACK;
g->color = RBT_RED;
48a98: 7201 moveq #1,%d1
g = the_node->parent->parent;
/* if uncle is red, repaint uncle/parent black and grandparent red */
if(_RBTree_Is_red(u)) {
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
48a9a: 42a9 000c clrl %a1@(12)
g->color = RBT_RED;
48a9e: 2741 000c movel %d1,%a3@(12)
48aa2: 603e bras 48ae2 <_RBTree_Insert_unprotected+0x12a>
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
48aa4: b1eb 0004 cmpal %a3@(4),%a0
48aa8: 56c0 sne %d0
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
48aaa: b5e8 0004 cmpal %a0@(4),%a2
48aae: 56c1 sne %d1
RBTree_Direction pdir = the_node->parent != g->child[0];
48ab0: 49c0 extbl %d0
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
48ab2: 2400 movel %d0,%d2
48ab4: 49c1 extbl %d1
48ab6: 4482 negl %d2
RBTree_Direction pdir = the_node->parent != g->child[0];
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
48ab8: b081 cmpl %d1,%d0
48aba: 670c beqs 48ac8 <_RBTree_Insert_unprotected+0x110>
_RBTree_Rotate(the_node->parent, pdir);
48abc: 2f02 movel %d2,%sp@-
48abe: 2f08 movel %a0,%sp@-
48ac0: 4e95 jsr %a5@
the_node = the_node->child[pdir];
48ac2: 508f addql #8,%sp
48ac4: 2472 2c04 moveal %a2@(00000004,%d2:l:4),%a2
}
the_node->parent->color = RBT_BLACK;
48ac8: 2052 moveal %a2@,%a0
g->color = RBT_RED;
48aca: 7001 moveq #1,%d0
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
48acc: 7201 moveq #1,%d1
48ace: 9282 subl %d2,%d1
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
the_node = the_node->child[pdir];
}
the_node->parent->color = RBT_BLACK;
48ad0: 42a8 000c clrl %a0@(12)
g->color = RBT_RED;
48ad4: 2740 000c movel %d0,%a3@(12)
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
48ad8: 2f01 movel %d1,%sp@-
48ada: 2f0b movel %a3,%sp@-
48adc: 264a moveal %a2,%a3
48ade: 4e95 jsr %a5@
48ae0: 508f addql #8,%sp
48ae2: 244b moveal %a3,%a2
48ae4: 6004 bras 48aea <_RBTree_Insert_unprotected+0x132>
48ae6: 4bfa fe74 lea %pc@(4895c <_RBTree_Rotate>),%a5
_ISR_Disable( level );
return_node = _RBTree_Insert_unprotected( tree, node );
_ISR_Enable( level );
return return_node;
}
48aea: 2052 moveal %a2@,%a0
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
if (!the_node->parent->parent) return NULL;
48aec: 2650 moveal %a0@,%a3
48aee: 4a8b tstl %a3
48af0: 661a bnes 48b0c <_RBTree_Insert_unprotected+0x154>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
48af2: 4280 clrl %d0
RBTree_Node *u,*g;
/* note: the insert root case is handled already */
/* if the parent is black, nothing needs to be done
* otherwise may need to loop a few times */
while (_RBTree_Is_red(_RBTree_Parent(the_node))) {
48af4: 0800 0000 btst #0,%d0
48af8: 6600 ff6c bnew 48a66 <_RBTree_Insert_unprotected+0xae>
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
}
}
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
48afc: 4a8b tstl %a3
48afe: 661a bnes 48b1a <_RBTree_Insert_unprotected+0x162>
48b00: 42aa 000c clrl %a2@(12)
48b04: 6014 bras 48b1a <_RBTree_Insert_unprotected+0x162>
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
if(!the_node) return (RBTree_Node*)-1;
48b06: 387c ffff moveaw #-1,%a4
48b0a: 600e bras 48b1a <_RBTree_Insert_unprotected+0x162>
48b0c: 7001 moveq #1,%d0
48b0e: b0a8 000c cmpl %a0@(12),%d0
48b12: 57c0 seq %d0
48b14: 49c0 extbl %d0
48b16: 4480 negl %d0
48b18: 60da bras 48af4 <_RBTree_Insert_unprotected+0x13c>
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
48b1a: 200c movel %a4,%d0
48b1c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
48b22: 4e5e unlk %fp <== NOT EXECUTED
00048b50 <_RBTree_Iterate_unprotected>:
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
48b50: 7202 moveq #2,%d1
const RBTree_Control *rbtree,
RBTree_Direction dir,
RBTree_Visitor visitor,
void *visitor_arg
)
{
48b52: 4e56 fff0 linkw %fp,#-16
48b56: 206e 0008 moveal %fp@(8),%a0
48b5a: 48d7 041c moveml %d2-%d4/%a2,%sp@
48b5e: 262e 000c movel %fp@(12),%d3
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
48b62: 57c0 seq %d0
bool stop = false;
while ( !stop && current != NULL ) {
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
48b64: 45f9 0004 8ba4 lea 48ba4 <_RBTree_Next_unprotected>,%a2
48b6a: 49c0 extbl %d0
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
48b6c: 9280 subl %d0,%d1
48b6e: 2430 1c00 movel %a0@(00000000,%d1:l:4),%d2
48b72: 6020 bras 48b94 <_RBTree_Iterate_unprotected+0x44>
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
stop = (*visitor)( current, dir, visitor_arg );
48b74: 2f2e 0014 movel %fp@(20),%sp@-
48b78: 206e 0010 moveal %fp@(16),%a0
48b7c: 2f03 movel %d3,%sp@-
48b7e: 2f02 movel %d2,%sp@-
48b80: 4e90 jsr %a0@
current = _RBTree_Next_unprotected( current, dir );
48b82: 2f03 movel %d3,%sp@-
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
stop = (*visitor)( current, dir, visitor_arg );
48b84: 1800 moveb %d0,%d4
current = _RBTree_Next_unprotected( current, dir );
48b86: 2f02 movel %d2,%sp@-
48b88: 4e92 jsr %a2@
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
48b8a: 4fef 0014 lea %sp@(20),%sp
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
48b8e: 2400 movel %d0,%d2
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
48b90: 4a04 tstb %d4
48b92: 6604 bnes 48b98 <_RBTree_Iterate_unprotected+0x48><== NEVER TAKEN
48b94: 4a82 tstl %d2
48b96: 66dc bnes 48b74 <_RBTree_Iterate_unprotected+0x24>
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
}
}
48b98: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
48b9e: 4e5e unlk %fp
...
00048682 <_RBTree_Rotate>:
*/
RTEMS_INLINE_ROUTINE void _RBTree_Rotate(
RBTree_Node *the_node,
RBTree_Direction dir
)
{
48682: 4e56 0000 linkw %fp,#0
48686: 206e 0008 moveal %fp@(8),%a0
4868a: 2f0a movel %a2,%sp@-
4868c: 202e 000c movel %fp@(12),%d0
48690: 2f02 movel %d2,%sp@-
RBTree_Node *c;
if (the_node == NULL) return;
48692: 4a88 tstl %a0
48694: 6740 beqs 486d6 <_RBTree_Rotate+0x54> <== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
48696: 4a80 tstl %d0
48698: 57c1 seq %d1
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
4869a: 7401 moveq #1,%d2
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
4869c: 49c1 extbl %d1
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
4869e: 9481 subl %d1,%d2
486a0: 2270 2c00 moveal %a0@(00000000,%d2:l:4),%a1
486a4: 4a89 tstl %a1
486a6: 672e beqs 486d6 <_RBTree_Rotate+0x54> <== NEVER TAKEN
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
486a8: 5280 addql #1,%d0
486aa: 45f1 0c00 lea %a1@(00000000,%d0:l:4),%a2
486ae: 2192 2c00 movel %a2@,%a0@(00000000,%d2:l:4)
if (c->child[dir])
486b2: 2471 0c00 moveal %a1@(00000000,%d0:l:4),%a2
486b6: 4a8a tstl %a2
486b8: 6702 beqs 486bc <_RBTree_Rotate+0x3a>
c->child[dir]->parent = the_node;
486ba: 2488 movel %a0,%a2@
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
486bc: 2450 moveal %a0@,%a2
486be: 7201 moveq #1,%d1
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
486c0: 2388 0c00 movel %a0,%a1@(00000000,%d0:l:4)
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
486c4: b1ea 0004 cmpal %a2@(4),%a0
486c8: 56c0 sne %d0
c->parent = the_node->parent;
486ca: 228a movel %a2,%a1@
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
486cc: 49c0 extbl %d0
486ce: 9280 subl %d0,%d1
486d0: 2589 1c00 movel %a1,%a2@(00000000,%d1:l:4)
c->parent = the_node->parent;
the_node->parent = c;
486d4: 2089 movel %a1,%a0@
}
486d6: 241f movel %sp@+,%d2
486d8: 245f moveal %sp@+,%a2
486da: 4e5e unlk %fp <== NOT EXECUTED
00048658 <_RBTree_Sibling>:
* exists, and NULL if not.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
48658: 4e56 0000 linkw %fp,#0
4865c: 226e 0008 moveal %fp@(8),%a1
if(!the_node) return NULL;
48660: 4a89 tstl %a1
48662: 6718 beqs 4867c <_RBTree_Sibling+0x24> <== NEVER TAKEN
if(!(the_node->parent)) return NULL;
48664: 2051 moveal %a1@,%a0
48666: 4a88 tstl %a0
48668: 6712 beqs 4867c <_RBTree_Sibling+0x24> <== NEVER TAKEN
if(!(the_node->parent->parent)) return NULL;
4866a: 4a90 tstl %a0@
4866c: 670e beqs 4867c <_RBTree_Sibling+0x24>
if(the_node == the_node->parent->child[RBT_LEFT])
4866e: 2028 0004 movel %a0@(4),%d0
48672: b089 cmpl %a1,%d0
48674: 6608 bnes 4867e <_RBTree_Sibling+0x26>
return the_node->parent->child[RBT_RIGHT];
48676: 2028 0008 movel %a0@(8),%d0
4867a: 6002 bras 4867e <_RBTree_Sibling+0x26>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
4867c: 4280 clrl %d0
if(the_node == the_node->parent->child[RBT_LEFT])
return the_node->parent->child[RBT_RIGHT];
else
return the_node->parent->child[RBT_LEFT];
}
4867e: 4e5e unlk %fp <== NOT EXECUTED
00047028 <_RTEMS_signal_Post_switch_hook>:
#include <rtems/score/thread.h>
#include <rtems/score/apiext.h>
#include <rtems/rtems/tasks.h>
static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing )
{
47028: 4e56 ffec linkw %fp,#-20
RTEMS_API_Control *api;
ASR_Information *asr;
rtems_signal_set signal_set;
Modes_Control prev_mode;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
4702c: 206e 0008 moveal %fp@(8),%a0
#include <rtems/score/thread.h>
#include <rtems/score/apiext.h>
#include <rtems/rtems/tasks.h>
static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing )
{
47030: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
RTEMS_API_Control *api;
ASR_Information *asr;
rtems_signal_set signal_set;
Modes_Control prev_mode;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
47034: 2468 00fa moveal %a0@(250),%a2
if ( !api )
47038: 4a8a tstl %a2
4703a: 6754 beqs 47090 <_RTEMS_signal_Post_switch_hook+0x68><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
4703c: 203c 0000 0700 movel #1792,%d0
47042: 40c1 movew %sr,%d1
47044: 8081 orl %d1,%d0
47046: 46c0 movew %d0,%sr
signal_set = asr->signals_posted;
47048: 262a 0012 movel %a2@(18),%d3
asr->signals_posted = 0;
4704c: 42aa 0012 clrl %a2@(18)
_ISR_Enable( level );
47050: 46c1 movew %d1,%sr
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
47052: 4a83 tstl %d3
47054: 673a beqs 47090 <_RTEMS_signal_Post_switch_hook+0x68>
return;
asr->nest_level += 1;
47056: 52aa 001a addql #1,%a2@(26)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
4705a: 240e movel %fp,%d2
4705c: 5982 subql #4,%d2
4705e: 47f9 0004 7434 lea 47434 <rtems_task_mode>,%a3
47064: 2f02 movel %d2,%sp@-
47066: 2f3c 0000 ffff movel #65535,%sp@-
4706c: 2f2a 000e movel %a2@(14),%sp@-
47070: 4e93 jsr %a3@
(*asr->handler)( signal_set );
47072: 2f03 movel %d3,%sp@-
47074: 206a 000a moveal %a2@(10),%a0
47078: 4e90 jsr %a0@
asr->nest_level -= 1;
4707a: 53aa 001a subql #1,%a2@(26)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
4707e: 2f02 movel %d2,%sp@-
47080: 2f3c 0000 ffff movel #65535,%sp@-
47086: 2f2e fffc movel %fp@(-4),%sp@-
4708a: 4e93 jsr %a3@
4708c: 4fef 001c lea %sp@(28),%sp
}
47090: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3
47096: 4e5e unlk %fp <== NOT EXECUTED
00058390 <_Region_Process_queue>:
#include <rtems/score/apimutex.h>
void _Region_Process_queue(
Region_Control *the_region
)
{
58390: 4e56 ffe4 linkw %fp,#-28
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
58394: 2039 0007 747a movel 7747a <_Thread_Dispatch_disable_level>,%d0
++level;
5839a: 5280 addql #1,%d0
5839c: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@
583a0: 266e 0008 moveal %fp@(8),%a3
_Thread_Dispatch_disable_level = level;
583a4: 23c0 0007 747a movel %d0,7747a <_Thread_Dispatch_disable_level>
* NOTE: Be sure to disable dispatching before unlocking the mutex
* since we do not want to open a window where a context
* switch could occur.
*/
_Thread_Disable_dispatch();
_RTEMS_Unlock_allocator();
583aa: 2f39 0007 74fe movel 774fe <_RTEMS_Allocator_Mutex>,%sp@-
/*
* NOTE: The following loop is O(n) where n is the number of
* threads whose memory request is satisfied.
*/
for ( ; ; ) {
the_thread = _Thread_queue_First( &the_region->Wait_queue );
583b0: 240b movel %a3,%d2
RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment (
Region_Control *the_region,
uintptr_t size
)
{
return _Heap_Allocate( &the_region->Memory, size );
583b2: 260b movel %a3,%d3
583b4: 0682 0000 0010 addil #16,%d2
583ba: 4bf9 0005 8acc lea 58acc <_Thread_queue_First>,%a5
583c0: 0683 0000 0068 addil #104,%d3
if ( the_segment == NULL )
break;
*(void **)the_thread->Wait.return_argument = the_segment;
the_region->number_of_used_blocks += 1;
_Thread_queue_Extract( &the_region->Wait_queue, the_thread );
583c6: 49f9 0005 89c8 lea 589c8 <_Thread_queue_Extract>,%a4
* NOTE: Be sure to disable dispatching before unlocking the mutex
* since we do not want to open a window where a context
* switch could occur.
*/
_Thread_Disable_dispatch();
_RTEMS_Unlock_allocator();
583cc: 4eb9 0005 31b4 jsr 531b4 <_API_Mutex_Unlock>
583d2: 588f addql #4,%sp
583d4: 283c 0005 3c3c movel #343100,%d4
/*
* NOTE: The following loop is O(n) where n is the number of
* threads whose memory request is satisfied.
*/
for ( ; ; ) {
the_thread = _Thread_queue_First( &the_region->Wait_queue );
583da: 2f02 movel %d2,%sp@-
583dc: 4e95 jsr %a5@
if ( the_thread == NULL )
583de: 588f addql #4,%sp
/*
* NOTE: The following loop is O(n) where n is the number of
* threads whose memory request is satisfied.
*/
for ( ; ; ) {
the_thread = _Thread_queue_First( &the_region->Wait_queue );
583e0: 2440 moveal %d0,%a2
if ( the_thread == NULL )
583e2: 4a80 tstl %d0
583e4: 672e beqs 58414 <_Region_Process_queue+0x84>
583e6: 42a7 clrl %sp@-
583e8: 2044 moveal %d4,%a0
583ea: 42a7 clrl %sp@-
583ec: 2f2a 0024 movel %a2@(36),%sp@-
583f0: 2f03 movel %d3,%sp@-
583f2: 4e90 jsr %a0@
the_segment = (void **) _Region_Allocate_segment(
the_region,
the_thread->Wait.count
);
if ( the_segment == NULL )
583f4: 4fef 0010 lea %sp@(16),%sp
583f8: 4a80 tstl %d0
583fa: 6718 beqs 58414 <_Region_Process_queue+0x84>
break;
*(void **)the_thread->Wait.return_argument = the_segment;
583fc: 206a 0028 moveal %a2@(40),%a0
58400: 2080 movel %d0,%a0@
the_region->number_of_used_blocks += 1;
58402: 52ab 0064 addql #1,%a3@(100)
_Thread_queue_Extract( &the_region->Wait_queue, the_thread );
58406: 2f0a movel %a2,%sp@-
58408: 2f02 movel %d2,%sp@-
5840a: 4e94 jsr %a4@
the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
}
5840c: 508f addql #8,%sp
break;
*(void **)the_thread->Wait.return_argument = the_segment;
the_region->number_of_used_blocks += 1;
_Thread_queue_Extract( &the_region->Wait_queue, the_thread );
the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
5840e: 42aa 0034 clrl %a2@(52)
}
58412: 60c6 bras 583da <_Region_Process_queue+0x4a>
_Thread_Enable_dispatch();
}
58414: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
5841a: 4e5e unlk %fp
*(void **)the_thread->Wait.return_argument = the_segment;
the_region->number_of_used_blocks += 1;
_Thread_queue_Extract( &the_region->Wait_queue, the_thread );
the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
5841c: 4ef9 0005 58b8 jmp 558b8 <_Thread_Enable_dispatch>
...
00048520 <_Scheduler_CBS_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
48520: 4e56 0000 linkw %fp,#0
48524: 2f0a movel %a2,%sp@-
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
48526: 4878 001c pea 1c <OPER2+0x8>
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
4852a: 246e 0008 moveal %fp@(8),%a2
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
4852e: 4eb9 0004 9c4c jsr 49c4c <_Workspace_Allocate>
if ( sched ) {
48534: 588f addql #4,%sp
48536: 4a80 tstl %d0
48538: 6712 beqs 4854c <_Scheduler_CBS_Allocate+0x2c> <== NEVER TAKEN
the_thread->scheduler_info = sched;
4853a: 2540 0086 movel %d0,%a2@(134)
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
4853e: 2040 moveal %d0,%a0
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
48540: 7202 moveq #2,%d1
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
if ( sched ) {
the_thread->scheduler_info = sched;
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
48542: 208a movel %a2,%a0@
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
48544: 2141 0014 movel %d1,%a0@(20)
schinfo->cbs_server = NULL;
48548: 42a8 0018 clrl %a0@(24)
}
return sched;
}
4854c: 246e fffc moveal %fp@(-4),%a2
48550: 4e5e unlk %fp <== NOT EXECUTED
000499e8 <_Scheduler_CBS_Budget_callout>:
Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
void _Scheduler_CBS_Budget_callout(
Thread_Control *the_thread
)
{
499e8: 4e56 fffc linkw %fp,#-4
499ec: 2f0a movel %a2,%sp@-
499ee: 246e 0008 moveal %fp@(8),%a2
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server_id server_id;
/* Put violating task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
499f2: 202a 00a8 movel %a2@(168),%d0
if ( the_thread->real_priority != new_priority )
499f6: b0aa 0018 cmpl %a2@(24),%d0
499fa: 6704 beqs 49a00 <_Scheduler_CBS_Budget_callout+0x18><== NEVER TAKEN
the_thread->real_priority = new_priority;
499fc: 2540 0018 movel %d0,%a2@(24)
if ( the_thread->current_priority != new_priority )
49a00: b0aa 0014 cmpl %a2@(20),%d0
49a04: 6712 beqs 49a18 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN
_Thread_Change_priority(the_thread, new_priority, true);
49a06: 4878 0001 pea 1 <ADD>
49a0a: 2f00 movel %d0,%sp@-
49a0c: 2f0a movel %a2,%sp@-
49a0e: 4eb9 0004 9f44 jsr 49f44 <_Thread_Change_priority>
49a14: 4fef 000c lea %sp@(12),%sp
/* Invoke callback function if any. */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
49a18: 246a 0086 moveal %a2@(134),%a2
if ( sched_info->cbs_server->cbs_budget_overrun ) {
49a1c: 206a 0018 moveal %a2@(24),%a0
49a20: 4aa8 000c tstl %a0@(12)
49a24: 671e beqs 49a44 <_Scheduler_CBS_Budget_callout+0x5c>
_Scheduler_CBS_Get_server_id(
49a26: 486e fffc pea %fp@(-4)
49a2a: 2f10 movel %a0@,%sp@-
49a2c: 4eb9 0004 99ac jsr 499ac <_Scheduler_CBS_Get_server_id>
sched_info->cbs_server->task_id,
&server_id
);
sched_info->cbs_server->cbs_budget_overrun( server_id );
49a32: 206a 0018 moveal %a2@(24),%a0
49a36: 2f2e fffc movel %fp@(-4),%sp@-
49a3a: 2068 000c moveal %a0@(12),%a0
49a3e: 4e90 jsr %a0@
49a40: 4fef 000c lea %sp@(12),%sp
}
}
49a44: 246e fff8 moveal %fp@(-8),%a2
49a48: 4e5e unlk %fp <== NOT EXECUTED
000496bc <_Scheduler_CBS_Create_server>:
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
496bc: 4e56 fff4 linkw %fp,#-12
496c0: 48d7 1c00 moveml %a2-%a4,%sp@
496c4: 246e 0008 moveal %fp@(8),%a2
496c8: 266e 0010 moveal %fp@(16),%a3
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
496cc: 4aaa 0004 tstl %a2@(4)
496d0: 6f3e bles 49710 <_Scheduler_CBS_Create_server+0x54>
496d2: 4a92 tstl %a2@
496d4: 6f3a bles 49710 <_Scheduler_CBS_Create_server+0x54>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
496d6: 2239 0006 079c movel 6079c <_Scheduler_CBS_Maximum_servers>,%d1
if ( !_Scheduler_CBS_Server_list[i] )
496dc: 4280 clrl %d0
496de: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0
496e4: 6006 bras 496ec <_Scheduler_CBS_Create_server+0x30>
496e6: 4a98 tstl %a0@+
496e8: 672e beqs 49718 <_Scheduler_CBS_Create_server+0x5c>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
496ea: 5280 addql #1,%d0
496ec: b280 cmpl %d0,%d1
496ee: 66f6 bnes 496e6 <_Scheduler_CBS_Create_server+0x2a>
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
496f0: 70e6 moveq #-26,%d0
496f2: 6050 bras 49744 <_Scheduler_CBS_Create_server+0x88>
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
496f4: 2012 movel %a2@,%d0
496f6: 222a 0004 movel %a2@(4),%d1
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
496fa: 216e 000c 000c movel %fp@(12),%a0@(12)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
49700: 2140 0004 movel %d0,%a0@(4)
49704: 2141 0008 movel %d1,%a0@(8)
the_server->task_id = -1;
49708: 70ff moveq #-1,%d0
4970a: 2080 movel %d0,%a0@
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
4970c: 4280 clrl %d0
4970e: 6034 bras 49744 <_Scheduler_CBS_Create_server+0x88>
if ( params->budget <= 0 ||
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
49710: 70ee moveq #-18,%d0
49712: 6030 bras 49744 <_Scheduler_CBS_Create_server+0x88>
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
49714: 70ef moveq #-17,%d0 <== NOT EXECUTED
49716: 602c bras 49744 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
49718: 2680 movel %d0,%a3@
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
4971a: 4878 0010 pea 10 <INVALID_OPERATION>
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
4971e: 2879 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a4
49724: e588 lsll #2,%d0
49726: d9c0 addal %d0,%a4
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
49728: 4eb9 0004 b150 jsr 4b150 <_Workspace_Allocate>
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
4972e: 588f addql #4,%sp
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
49730: 2880 movel %d0,%a4@
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
49732: 2013 movel %a3@,%d0
49734: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0
4973a: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0
if ( !the_server )
4973e: 4a88 tstl %a0
49740: 66b2 bnes 496f4 <_Scheduler_CBS_Create_server+0x38><== ALWAYS TAKEN
49742: 60d0 bras 49714 <_Scheduler_CBS_Create_server+0x58><== NOT EXECUTED
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
49744: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4
4974a: 4e5e unlk %fp
...
000497c8 <_Scheduler_CBS_Detach_thread>:
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
497c8: 4e56 fff0 linkw %fp,#-16
497cc: 48d7 040c moveml %d2-%d3/%a2,%sp@
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
497d0: 486e fffc pea %fp@(-4)
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
497d4: 242e 000c movel %fp@(12),%d2
497d8: 262e 0008 movel %fp@(8),%d3
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
497dc: 2f02 movel %d2,%sp@-
497de: 4eb9 0004 a3b4 jsr 4a3b4 <_Thread_Get>
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
497e4: 508f addql #8,%sp
{
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
497e6: 2440 moveal %d0,%a2
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
497e8: 4a80 tstl %d0
497ea: 6706 beqs 497f2 <_Scheduler_CBS_Detach_thread+0x2a>
_Thread_Enable_dispatch();
497ec: 4eb9 0004 a394 jsr 4a394 <_Thread_Enable_dispatch>
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
497f2: b6b9 0006 079c cmpl 6079c <_Scheduler_CBS_Maximum_servers>,%d3
497f8: 643c bccs 49836 <_Scheduler_CBS_Detach_thread+0x6e>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
497fa: 4a8a tstl %a2
497fc: 6738 beqs 49836 <_Scheduler_CBS_Detach_thread+0x6e>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
497fe: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0
49804: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0
49808: 4a88 tstl %a0
4980a: 6726 beqs 49832 <_Scheduler_CBS_Detach_thread+0x6a>
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
4980c: b490 cmpl %a0@,%d2
4980e: 6626 bnes 49836 <_Scheduler_CBS_Detach_thread+0x6e><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
49810: 70ff moveq #-1,%d0
49812: 2080 movel %d0,%a0@
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
49814: 206a 0086 moveal %a2@(134),%a0
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
the_thread->budget_callout = the_thread->Start.budget_callout;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
return SCHEDULER_CBS_OK;
49818: 4280 clrl %d0
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
4981a: 42a8 0018 clrl %a0@(24)
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
4981e: 256a 009c 0076 movel %a2@(156),%a2@(118)
the_thread->budget_callout = the_thread->Start.budget_callout;
49824: 256a 00a0 007a movel %a2@(160),%a2@(122)
the_thread->is_preemptible = the_thread->Start.is_preemptible;
4982a: 156a 009a 0070 moveb %a2@(154),%a2@(112)
49830: 6006 bras 49838 <_Scheduler_CBS_Detach_thread+0x70>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
return SCHEDULER_CBS_ERROR_NOSERVER;
49832: 70e7 moveq #-25,%d0
49834: 6002 bras 49838 <_Scheduler_CBS_Detach_thread+0x70>
if ( the_thread ) {
_Thread_Enable_dispatch();
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
49836: 70ee moveq #-18,%d0
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
the_thread->budget_callout = the_thread->Start.budget_callout;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
return SCHEDULER_CBS_OK;
}
49838: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
4983e: 4e5e unlk %fp
...
00049a4c <_Scheduler_CBS_Initialize>:
int _Scheduler_CBS_Initialize(void)
{
49a4c: 4e56 0000 linkw %fp,#0
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
49a50: 2039 0006 079c movel 6079c <_Scheduler_CBS_Maximum_servers>,%d0
49a56: e588 lsll #2,%d0
49a58: 2f00 movel %d0,%sp@-
49a5a: 4eb9 0004 b150 jsr 4b150 <_Workspace_Allocate>
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
49a60: 588f addql #4,%sp
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
49a62: 23c0 0006 24d2 movel %d0,624d2 <_Scheduler_CBS_Server_list>
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
49a68: 671e beqs 49a88 <_Scheduler_CBS_Initialize+0x3c> <== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
49a6a: 2239 0006 079c movel 6079c <_Scheduler_CBS_Maximum_servers>,%d1
49a70: 4280 clrl %d0
49a72: 600c bras 49a80 <_Scheduler_CBS_Initialize+0x34>
_Scheduler_CBS_Server_list[i] = NULL;
49a74: 2079 0006 24d2 moveal 624d2 <_Scheduler_CBS_Server_list>,%a0
49a7a: 42b0 0c00 clrl %a0@(00000000,%d0:l:4)
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
49a7e: 5280 addql #1,%d0
49a80: b280 cmpl %d0,%d1
49a82: 66f0 bnes 49a74 <_Scheduler_CBS_Initialize+0x28>
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
49a84: 4280 clrl %d0
49a86: 6002 bras 49a8a <_Scheduler_CBS_Initialize+0x3e>
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
49a88: 70ef moveq #-17,%d0 <== NOT EXECUTED
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
}
49a8a: 4e5e unlk %fp
...
00048554 <_Scheduler_CBS_Release_job>:
void _Scheduler_CBS_Release_job(
Thread_Control *the_thread,
uint32_t deadline
)
{
48554: 4e56 0000 linkw %fp,#0
48558: 206e 0008 moveal %fp@(8),%a0
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
(Scheduler_CBS_Server *) sched_info->cbs_server;
4855c: 2268 0086 moveal %a0@(134),%a1
void _Scheduler_CBS_Release_job(
Thread_Control *the_thread,
uint32_t deadline
)
{
48560: 202e 000c movel %fp@(12),%d0
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
48564: 2269 0018 moveal %a1@(24),%a1
(Scheduler_CBS_Server *) sched_info->cbs_server;
if (deadline) {
48568: 6722 beqs 4858c <_Scheduler_CBS_Release_job+0x38>
/* Initializing or shifting deadline. */
if (serv_info)
4856a: 4a89 tstl %a1
4856c: 6710 beqs 4857e <_Scheduler_CBS_Release_job+0x2a>
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
4856e: 2039 0006 0574 movel 60574 <_Watchdog_Ticks_since_boot>,%d0
48574: d0a9 0004 addl %a1@(4),%d0
48578: 0880 001f bclr #31,%d0
4857c: 6016 bras 48594 <_Scheduler_CBS_Release_job+0x40>
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
4857e: 2239 0006 0574 movel 60574 <_Watchdog_Ticks_since_boot>,%d1
48584: d081 addl %d1,%d0
48586: 0880 001f bclr #31,%d0
4858a: 600e bras 4859a <_Scheduler_CBS_Release_job+0x46>
& ~SCHEDULER_EDF_PRIO_MSB;
}
else {
/* Switch back to background priority. */
new_priority = the_thread->Start.initial_priority;
4858c: 2028 00a8 movel %a0@(168),%d0
}
/* Budget replenishment for the next job. */
if (serv_info)
48590: 4a89 tstl %a1
48592: 6706 beqs 4859a <_Scheduler_CBS_Release_job+0x46><== NEVER TAKEN
the_thread->cpu_time_budget = serv_info->parameters.budget;
48594: 2169 0008 0072 movel %a1@(8),%a0@(114)
the_thread->real_priority = new_priority;
4859a: 2140 0018 movel %d0,%a0@(24)
_Thread_Change_priority(the_thread, new_priority, true);
4859e: 4878 0001 pea 1 <ADD>
485a2: 2f00 movel %d0,%sp@-
485a4: 2f08 movel %a0,%sp@-
485a6: 4eb9 0004 89c0 jsr 489c0 <_Thread_Change_priority>
485ac: 4fef 000c lea %sp@(12),%sp
}
485b0: 4e5e unlk %fp <== NOT EXECUTED
000485b4 <_Scheduler_CBS_Unblock>:
#include <rtems/score/schedulercbs.h>
void _Scheduler_CBS_Unblock(
Thread_Control *the_thread
)
{
485b4: 4e56 0000 linkw %fp,#0
485b8: 2f0a movel %a2,%sp@-
485ba: 246e 0008 moveal %fp@(8),%a2
485be: 2f02 movel %d2,%sp@-
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server *serv_info;
Priority_Control new_priority;
_Scheduler_EDF_Enqueue(the_thread);
485c0: 2f0a movel %a2,%sp@-
485c2: 4eb9 0004 86b4 jsr 486b4 <_Scheduler_EDF_Enqueue>
/* TODO: flash critical section? */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server;
485c8: 206a 0086 moveal %a2@(134),%a0
* Late unblock rule for deadline-driven tasks. The remaining time to
* deadline must be sufficient to serve the remaining computation time
* without increased utilization of this task. It might cause a deadline
* miss of another task.
*/
if (serv_info) {
485cc: 588f addql #4,%sp
_Scheduler_EDF_Enqueue(the_thread);
/* TODO: flash critical section? */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server;
485ce: 2068 0018 moveal %a0@(24),%a0
* Late unblock rule for deadline-driven tasks. The remaining time to
* deadline must be sufficient to serve the remaining computation time
* without increased utilization of this task. It might cause a deadline
* miss of another task.
*/
if (serv_info) {
485d2: 4a88 tstl %a0
485d4: 674c beqs 48622 <_Scheduler_CBS_Unblock+0x6e>
time_t deadline = serv_info->parameters.deadline;
time_t budget = serv_info->parameters.budget;
time_t deadline_left = the_thread->cpu_time_budget;
time_t budget_left = the_thread->real_priority -
485d6: 222a 0018 movel %a2@(24),%d1
485da: 2401 movel %d1,%d2
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
485dc: 43e8 0004 lea %a0@(4),%a1
*/
if (serv_info) {
time_t deadline = serv_info->parameters.deadline;
time_t budget = serv_info->parameters.budget;
time_t deadline_left = the_thread->cpu_time_budget;
time_t budget_left = the_thread->real_priority -
485e0: 2039 0006 0574 movel 60574 <_Watchdog_Ticks_since_boot>,%d0
485e6: 9480 subl %d0,%d2
485e8: 2002 movel %d2,%d0
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
485ea: 4c11 0800 mulsl %a1@,%d0
485ee: 43ea 0072 lea %a2@(114),%a1
485f2: 2428 0008 movel %a0@(8),%d2
485f6: 4c11 2800 mulsl %a1@,%d2
485fa: b480 cmpl %d0,%d2
485fc: 6c24 bges 48622 <_Scheduler_CBS_Unblock+0x6e>
/* Put late unblocked task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
485fe: 202a 00a8 movel %a2@(168),%d0
if ( the_thread->real_priority != new_priority )
48602: b081 cmpl %d1,%d0
48604: 6704 beqs 4860a <_Scheduler_CBS_Unblock+0x56>
the_thread->real_priority = new_priority;
48606: 2540 0018 movel %d0,%a2@(24)
if ( the_thread->current_priority != new_priority )
4860a: b0aa 0014 cmpl %a2@(20),%d0
4860e: 6712 beqs 48622 <_Scheduler_CBS_Unblock+0x6e>
_Thread_Change_priority(the_thread, new_priority, true);
48610: 4878 0001 pea 1 <ADD>
48614: 2f00 movel %d0,%sp@-
48616: 2f0a movel %a2,%sp@-
48618: 4eb9 0004 89c0 jsr 489c0 <_Thread_Change_priority>
4861e: 4fef 000c lea %sp@(12),%sp
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
48622: 2079 0006 08da moveal 608da <_Per_CPU_Information+0x12>,%a0
48628: 2f28 0014 movel %a0@(20),%sp@-
4862c: 2f2a 0014 movel %a2@(20),%sp@-
48630: 2079 0005 ebe0 moveal 5ebe0 <_Scheduler+0x30>,%a0
48636: 4e90 jsr %a0@
48638: 508f addql #8,%sp
4863a: 4a80 tstl %d0
4863c: 6f20 bles 4865e <_Scheduler_CBS_Unblock+0xaa>
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
4863e: 2079 0006 08d6 moveal 608d6 <_Per_CPU_Information+0xe>,%a0
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
48644: 23ca 0006 08da movel %a2,608da <_Per_CPU_Information+0x12>
if ( _Thread_Executing->is_preemptible ||
4864a: 4a28 0070 tstb %a0@(112)
4864e: 6606 bnes 48656 <_Scheduler_CBS_Unblock+0xa2>
48650: 4aaa 0014 tstl %a2@(20)
48654: 6608 bnes 4865e <_Scheduler_CBS_Unblock+0xaa> <== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
48656: 7001 moveq #1,%d0
48658: 13c0 0006 08d4 moveb %d0,608d4 <_Per_CPU_Information+0xc>
}
}
4865e: 242e fff8 movel %fp@(-8),%d2
48662: 246e fffc moveal %fp@(-4),%a2
48666: 4e5e unlk %fp
...
00048520 <_Scheduler_EDF_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
48520: 4e56 0000 linkw %fp,#0
48524: 2f0a movel %a2,%sp@-
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
48526: 4878 0018 pea 18 <OPER2+0x4>
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
4852a: 246e 0008 moveal %fp@(8),%a2
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
4852e: 4eb9 0004 9bc4 jsr 49bc4 <_Workspace_Allocate>
if ( sched ) {
48534: 588f addql #4,%sp
48536: 4a80 tstl %d0
48538: 670e beqs 48548 <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN
the_thread->scheduler_info = sched;
4853a: 2540 0086 movel %d0,%a2@(134)
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
4853e: 2040 moveal %d0,%a0
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
48540: 7202 moveq #2,%d1
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
if ( sched ) {
the_thread->scheduler_info = sched;
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
48542: 208a movel %a2,%a0@
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
48544: 2141 0014 movel %d1,%a0@(20)
}
return sched;
}
48548: 246e fffc moveal %fp@(-4),%a2
4854c: 4e5e unlk %fp <== NOT EXECUTED
00048710 <_Scheduler_EDF_Free>:
#include <rtems/score/wkspace.h>
void _Scheduler_EDF_Free(
Thread_Control *the_thread
)
{
48710: 4e56 0000 linkw %fp,#0
_Workspace_Free( the_thread->scheduler_info );
48714: 206e 0008 moveal %fp@(8),%a0
48718: 2d68 0086 0008 movel %a0@(134),%fp@(8)
}
4871e: 4e5e unlk %fp
void _Scheduler_EDF_Free(
Thread_Control *the_thread
)
{
_Workspace_Free( the_thread->scheduler_info );
48720: 4ef9 0004 9c68 jmp 49c68 <_Workspace_Free>
...
000486fc <_Scheduler_EDF_Unblock>:
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
486fc: 4e56 0000 linkw %fp,#0
48700: 2f0a movel %a2,%sp@-
48702: 246e 0008 moveal %fp@(8),%a2
_Scheduler_EDF_Enqueue(the_thread);
48706: 2f0a movel %a2,%sp@-
48708: 4eb9 0004 8598 jsr 48598 <_Scheduler_EDF_Enqueue>
4870e: 2f2a 0014 movel %a2@(20),%sp@-
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
48712: 2079 0006 084a moveal 6084a <_Per_CPU_Information+0x12>,%a0
48718: 2f28 0014 movel %a0@(20),%sp@-
4871c: 2079 0005 eb50 moveal 5eb50 <_Scheduler+0x30>,%a0
48722: 4e90 jsr %a0@
48724: 4fef 000c lea %sp@(12),%sp
48728: 4a80 tstl %d0
4872a: 6c20 bges 4874c <_Scheduler_EDF_Unblock+0x50>
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
4872c: 2079 0006 0846 moveal 60846 <_Per_CPU_Information+0xe>,%a0
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
48732: 23ca 0006 084a movel %a2,6084a <_Per_CPU_Information+0x12>
if ( _Thread_Executing->is_preemptible ||
48738: 4a28 0070 tstb %a0@(112)
4873c: 6606 bnes 48744 <_Scheduler_EDF_Unblock+0x48>
4873e: 4aaa 0014 tstl %a2@(20)
48742: 6608 bnes 4874c <_Scheduler_EDF_Unblock+0x50> <== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
48744: 7001 moveq #1,%d0
48746: 13c0 0006 0844 moveb %d0,60844 <_Per_CPU_Information+0xc>
}
}
4874c: 246e fffc moveal %fp@(-4),%a2
48750: 4e5e unlk %fp <== NOT EXECUTED
00047dac <_Scheduler_Handler_initialization>:
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
void _Scheduler_Handler_initialization(void)
{
47dac: 4e56 0000 linkw %fp,#0
(*_Scheduler.Operations.initialize)();
}
47db0: 4e5e unlk %fp
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
void _Scheduler_Handler_initialization(void)
{
(*_Scheduler.Operations.initialize)();
47db2: 2279 0005 d664 moveal 5d664 <_Scheduler+0x4>,%a1
47db8: 4ed1 jmp %a1@
...
00047f84 <_Scheduler_priority_Free>:
#include <rtems/score/wkspace.h>
void _Scheduler_priority_Free (
Thread_Control *the_thread
)
{
47f84: 4e56 0000 linkw %fp,#0
_Workspace_Free( the_thread->scheduler_info );
47f88: 206e 0008 moveal %fp@(8),%a0
47f8c: 2d68 0086 0008 movel %a0@(134),%fp@(8)
}
47f92: 4e5e unlk %fp
void _Scheduler_priority_Free (
Thread_Control *the_thread
)
{
_Workspace_Free( the_thread->scheduler_info );
47f94: 4ef9 0004 94d4 jmp 494d4 <_Workspace_Free>
...
00048080 <_Scheduler_priority_Tick>:
#include <rtems/system.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Tick( void )
{
48080: 4e56 0000 linkw %fp,#0
48084: 2f0a movel %a2,%sp@-
Thread_Control *executing;
executing = _Thread_Executing;
48086: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
4808c: 4a2a 0070 tstb %a2@(112)
48090: 6758 beqs 480ea <_Scheduler_priority_Tick+0x6a>
return;
if ( !_States_Is_ready( executing->current_state ) )
48092: 4aaa 0010 tstl %a2@(16)
48096: 6652 bnes 480ea <_Scheduler_priority_Tick+0x6a>
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
48098: 202a 0076 movel %a2@(118),%d0
4809c: 7201 moveq #1,%d1
4809e: b280 cmpl %d0,%d1
480a0: 6248 bhis 480ea <_Scheduler_priority_Tick+0x6a>
480a2: 123c 0002 moveb #2,%d1
480a6: b280 cmpl %d0,%d1
480a8: 640a bccs 480b4 <_Scheduler_priority_Tick+0x34>
480aa: 123c 0003 moveb #3,%d1
480ae: b280 cmpl %d0,%d1
480b0: 6638 bnes 480ea <_Scheduler_priority_Tick+0x6a> <== NEVER TAKEN
480b2: 6020 bras 480d4 <_Scheduler_priority_Tick+0x54>
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
#endif
if ( (int)(--executing->cpu_time_budget) <= 0 ) {
480b4: 202a 0072 movel %a2@(114),%d0
480b8: 5380 subql #1,%d0
480ba: 2540 0072 movel %d0,%a2@(114)
480be: 6e2a bgts 480ea <_Scheduler_priority_Tick+0x6a>
* always operates on the scheduler that 'owns' the currently executing
* thread.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
{
_Scheduler.Operations.yield();
480c0: 2079 0005 d66c moveal 5d66c <_Scheduler+0xc>,%a0
480c6: 4e90 jsr %a0@
* executing thread's timeslice is reset. Otherwise, the
* currently executing thread is placed at the rear of the
* FIFO for this priority and a new heir is selected.
*/
_Scheduler_Yield();
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
480c8: 41f9 0005 ee8e lea 5ee8e <_Thread_Ticks_per_timeslice>,%a0
480ce: 2550 0072 movel %a0@,%a2@(114)
480d2: 6016 bras 480ea <_Scheduler_priority_Tick+0x6a>
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
480d4: 202a 0072 movel %a2@(114),%d0
480d8: 5380 subql #1,%d0
480da: 2540 0072 movel %d0,%a2@(114)
480de: 660a bnes 480ea <_Scheduler_priority_Tick+0x6a>
(*executing->budget_callout)( executing );
480e0: 2f0a movel %a2,%sp@-
480e2: 206a 007a moveal %a2@(122),%a0
480e6: 4e90 jsr %a0@
480e8: 588f addql #4,%sp
break;
#endif
}
}
480ea: 246e fffc moveal %fp@(-4),%a2
480ee: 4e5e unlk %fp
...
00048300 <_TOD_Set_with_timestamp>:
#include <rtems/score/watchdog.h>
void _TOD_Set_with_timestamp(
const Timestamp_Control *tod
)
{
48300: 4e56 ffec linkw %fp,#-20
48304: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
48308: 246e 0008 moveal %fp@(8),%a2
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
4830c: 47f9 0005 b0a8 lea 5b0a8 <__divdi3>,%a3
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
_TOD_Activate();
_Thread_Enable_dispatch();
}
48312: 2412 movel %a2@,%d2
48314: 262a 0004 movel %a2@(4),%d3
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
48318: 2f3c 3b9a ca00 movel #1000000000,%sp@-
4831e: 42a7 clrl %sp@-
48320: 2f03 movel %d3,%sp@-
48322: 2f02 movel %d2,%sp@-
48324: 4eb9 0005 b508 jsr 5b508 <__moddi3>
4832a: 4fef 0010 lea %sp@(16),%sp
4832e: 2801 movel %d1,%d4
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
48330: 2f3c 3b9a ca00 movel #1000000000,%sp@-
48336: 42a7 clrl %sp@-
48338: 2f03 movel %d3,%sp@-
4833a: 2f02 movel %d2,%sp@-
4833c: 4e93 jsr %a3@
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4833e: 2039 0006 1316 movel 61316 <_Thread_Dispatch_disable_level>,%d0
++level;
48344: 5280 addql #1,%d0
48346: 4fef 0010 lea %sp@(16),%sp
4834a: 2401 movel %d1,%d2
_Thread_Dispatch_disable_level = level;
4834c: 23c0 0006 1316 movel %d0,61316 <_Thread_Dispatch_disable_level>
48352: 2f3c 3b9a ca00 movel #1000000000,%sp@-
48358: 42a7 clrl %sp@-
4835a: 2f39 0006 12bc movel 612bc <_TOD+0x4>,%sp@-
48360: 2f39 0006 12b8 movel 612b8 <_TOD>,%sp@-
48366: 4e93 jsr %a3@
48368: 4fef 0010 lea %sp@(16),%sp
_Thread_Disable_dispatch();
_TOD_Deactivate();
seconds_now = _TOD_Seconds_since_epoch();
if ( seconds_next < seconds_now )
4836c: b282 cmpl %d2,%d1
4836e: 630a blss 4837a <_TOD_Set_with_timestamp+0x7a>
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
_Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
48370: 9282 subl %d2,%d1
48372: 2f01 movel %d1,%sp@-
48374: 4878 0001 pea 1 <ADD>
48378: 6006 bras 48380 <_TOD_Set_with_timestamp+0x80>
4837a: 9481 subl %d1,%d2
4837c: 2f02 movel %d2,%sp@-
4837e: 42a7 clrl %sp@-
48380: 4879 0006 13a6 pea 613a6 <_Watchdog_Seconds_chain>
48386: 4eb9 0004 a584 jsr 4a584 <_Watchdog_Adjust>
4838c: 4fef 000c lea %sp@(12),%sp
_Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next );
else
_Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
_TOD.now = *tod;
48390: 2012 movel %a2@,%d0
48392: 222a 0004 movel %a2@(4),%d1
_TOD.seconds_trigger = nanoseconds;
48396: 23c4 0006 12c8 movel %d4,612c8 <_TOD+0x10>
if ( seconds_next < seconds_now )
_Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next );
else
_Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
_TOD.now = *tod;
4839c: 23c0 0006 12b8 movel %d0,612b8 <_TOD>
483a2: 23c1 0006 12bc movel %d1,612bc <_TOD+0x4>
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
_TOD_Activate();
_Thread_Enable_dispatch();
}
483a8: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
else
_Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
_TOD.now = *tod;
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
483ae: 7201 moveq #1,%d1
_TOD_Activate();
_Thread_Enable_dispatch();
}
483b0: 4e5e unlk %fp
else
_Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
_TOD.now = *tod;
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
483b2: 13c1 0006 12cc moveb %d1,612cc <_TOD+0x14>
_TOD_Activate();
_Thread_Enable_dispatch();
483b8: 4ef9 0004 99dc jmp 499dc <_Thread_Enable_dispatch>
...
00046c1c <_TOD_Validate>:
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
46c1c: 43f9 0005 d33e lea 5d33e <Configuration+0xc>,%a1
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
46c22: 4e56 0000 linkw %fp,#0
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
46c26: 203c 000f 4240 movel #1000000,%d0
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
46c2c: 2f03 movel %d3,%sp@-
46c2e: 206e 0008 moveal %fp@(8),%a0
46c32: 2f02 movel %d2,%sp@-
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
46c34: 4c51 0000 remul %a1@,%d0,%d0
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
46c38: 4a88 tstl %a0
46c3a: 6758 beqs 46c94 <_TOD_Validate+0x78> <== NEVER TAKEN
46c3c: b0a8 0018 cmpl %a0@(24),%d0
46c40: 6352 blss 46c94 <_TOD_Validate+0x78>
(the_tod->ticks >= ticks_per_second) ||
46c42: 703b moveq #59,%d0
46c44: b0a8 0014 cmpl %a0@(20),%d0
46c48: 654a bcss 46c94 <_TOD_Validate+0x78>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
46c4a: b0a8 0010 cmpl %a0@(16),%d0
46c4e: 6544 bcss 46c94 <_TOD_Validate+0x78>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
46c50: 7217 moveq #23,%d1
46c52: b2a8 000c cmpl %a0@(12),%d1
46c56: 653c bcss 46c94 <_TOD_Validate+0x78>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
46c58: 2028 0004 movel %a0@(4),%d0
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
46c5c: 6736 beqs 46c94 <_TOD_Validate+0x78> <== NEVER TAKEN
(the_tod->month == 0) ||
46c5e: 760c moveq #12,%d3
46c60: b680 cmpl %d0,%d3
46c62: 6530 bcss 46c94 <_TOD_Validate+0x78>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
46c64: 2410 movel %a0@,%d2
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
46c66: 0c82 0000 07c3 cmpil #1987,%d2
46c6c: 6326 blss 46c94 <_TOD_Validate+0x78>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
46c6e: 2228 0008 movel %a0@(8),%d1
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
46c72: 6720 beqs 46c94 <_TOD_Validate+0x78> <== NEVER TAKEN
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
46c74: 163c 0003 moveb #3,%d3
46c78: 41f9 0005 e6c8 lea 5e6c8 <_TOD_Days_per_month>,%a0
46c7e: c483 andl %d3,%d2
46c80: 6606 bnes 46c88 <_TOD_Validate+0x6c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
46c82: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0
46c86: 6004 bras 46c8c <_TOD_Validate+0x70>
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
46c88: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0
if ( the_tod->day > days_in_month )
46c8c: b081 cmpl %d1,%d0
46c8e: 54c0 scc %d0
46c90: 4480 negl %d0
46c92: 6002 bras 46c96 <_TOD_Validate+0x7a>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
46c94: 4200 clrb %d0
if ( the_tod->day > days_in_month )
return false;
return true;
}
46c96: 241f movel %sp@+,%d2
46c98: 261f movel %sp@+,%d3
46c9a: 4e5e unlk %fp
...
000482ac <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
482ac: 4e56 fff0 linkw %fp,#-16
482b0: 48d7 041c moveml %d2-%d4/%a2,%sp@
482b4: 246e 0008 moveal %fp@(8),%a2
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
482b8: 282a 0010 movel %a2@(16),%d4
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
482bc: 242e 000c movel %fp@(12),%d2
/*
* 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 );
482c0: 2f0a movel %a2,%sp@-
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
482c2: 162e 0013 moveb %fp@(19),%d3
/*
* 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 );
482c6: 4eb9 0004 8ec8 jsr 48ec8 <_Thread_Set_transient>
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
482cc: 588f addql #4,%sp
482ce: b4aa 0014 cmpl %a2@(20),%d2
482d2: 670c beqs 482e0 <_Thread_Change_priority+0x34>
_Thread_Set_priority( the_thread, new_priority );
482d4: 2f02 movel %d2,%sp@-
482d6: 2f0a movel %a2,%sp@-
482d8: 4eb9 0004 8e6c jsr 48e6c <_Thread_Set_priority>
482de: 508f addql #8,%sp
_ISR_Disable( level );
482e0: 203c 0000 0700 movel #1792,%d0
482e6: 40c2 movew %sr,%d2
482e8: 8082 orl %d2,%d0
482ea: 46c0 movew %d0,%sr
482ec: 7204 moveq #4,%d1
/*
* 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;
482ee: 202a 0010 movel %a2@(16),%d0
482f2: c284 andl %d4,%d1
if ( state != STATES_TRANSIENT ) {
482f4: 7804 moveq #4,%d4
482f6: b880 cmpl %d0,%d4
482f8: 672e beqs 48328 <_Thread_Change_priority+0x7c>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
482fa: 4a81 tstl %d1
482fc: 6608 bnes 48306 <_Thread_Change_priority+0x5a> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
482fe: 72fb moveq #-5,%d1
48300: c280 andl %d0,%d1
48302: 2541 0010 movel %d1,%a2@(16)
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
_ISR_Enable( level );
48306: 46c2 movew %d2,%sr
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
48308: 0280 0003 bee0 andil #245472,%d0
if ( _States_Is_waiting_on_thread_queue( state ) ) {
4830e: 676c beqs 4837c <_Thread_Change_priority+0xd0>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
48310: 2d4a 000c movel %a2,%fp@(12)
48314: 2d6a 0044 0008 movel %a2@(68),%fp@(8)
if ( !_Thread_Is_executing_also_the_heir() &&
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
_ISR_Enable( level );
}
4831a: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
48320: 4e5e unlk %fp
/* 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 );
_ISR_Enable( level );
if ( _States_Is_waiting_on_thread_queue( state ) ) {
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
48322: 4ef9 0004 8dd0 jmp 48dd0 <_Thread_queue_Requeue>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
48328: 4a81 tstl %d1
4832a: 661e bnes 4834a <_Thread_Change_priority+0x9e> <== NEVER TAKEN
* 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 );
4832c: 42aa 0010 clrl %a2@(16)
if ( prepend_it )
48330: 4a03 tstb %d3
48332: 670a beqs 4833e <_Thread_Change_priority+0x92>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
48334: 2f0a movel %a2,%sp@-
48336: 2079 0005 d688 moveal 5d688 <_Scheduler+0x28>,%a0
4833c: 6008 bras 48346 <_Thread_Change_priority+0x9a>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
4833e: 2079 0005 d684 moveal 5d684 <_Scheduler+0x24>,%a0
48344: 2f0a movel %a2,%sp@-
48346: 4e90 jsr %a0@
48348: 588f addql #4,%sp
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
4834a: 203c 0000 0700 movel #1792,%d0
48350: 46c2 movew %d2,%sr
48352: 8082 orl %d2,%d0
48354: 46c0 movew %d0,%sr
* This kernel routine implements the scheduling decision logic for
* the scheduler. It does NOT dispatch.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void )
{
_Scheduler.Operations.schedule();
48356: 2079 0005 d668 moveal 5d668 <_Scheduler+0x8>,%a0
4835c: 4e90 jsr %a0@
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
4835e: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Scheduler_Schedule();
if ( !_Thread_Is_executing_also_the_heir() &&
48364: b1f9 0005 f322 cmpal 5f322 <_Per_CPU_Information+0x12>,%a0
4836a: 670e beqs 4837a <_Thread_Change_priority+0xce>
4836c: 4a28 0070 tstb %a0@(112)
48370: 6708 beqs 4837a <_Thread_Change_priority+0xce>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
48372: 7801 moveq #1,%d4
48374: 13c4 0005 f31c moveb %d4,5f31c <_Per_CPU_Information+0xc>
_ISR_Enable( level );
4837a: 46c2 movew %d2,%sr
}
4837c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
48382: 4e5e unlk %fp
...
00048554 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
48554: 4e56 fffc linkw %fp,#-4
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
48558: 486e fffc pea %fp@(-4)
4855c: 2f2e 0008 movel %fp@(8),%sp@-
48560: 4eb9 0004 871c jsr 4871c <_Thread_Get>
switch ( location ) {
48566: 508f addql #8,%sp
48568: 4aae fffc tstl %fp@(-4)
4856c: 661e bnes 4858c <_Thread_Delay_ended+0x38> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
4856e: 2f3c 1000 0018 movel #268435480,%sp@-
48574: 2f00 movel %d0,%sp@-
48576: 4eb9 0004 8388 jsr 48388 <_Thread_Clear_state>
4857c: 508f addql #8,%sp
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4857e: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0
--level;
48584: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
48586: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level>
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
4858c: 4e5e unlk %fp <== NOT EXECUTED
00048590 <_Thread_Dispatch>:
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
void _Thread_Dispatch( void )
{
48590: 4e56 ffd0 linkw %fp,#-48
48594: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
48598: 283c 0000 0700 movel #1792,%d4
4859e: 2204 movel %d4,%d1
#endif
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
485a0: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2
_ISR_Disable( level );
485a6: 40c0 movew %sr,%d0
485a8: 8280 orl %d0,%d1
485aa: 46c1 movew %d1,%sr
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
485ac: 240e movel %fp,%d2
485ae: 5182 subql #8,%d2
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
485b0: 2a3c 0004 7124 movel #291108,%d5
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
485b6: 49f9 0004 9524 lea 49524 <_CPU_Context_switch>,%a4
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( (executing->fp_context != NULL) &&
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
_Context_Restore_fp( &executing->fp_context );
485bc: 4bf9 0004 968c lea 4968c <_CPU_Context_restore_fp>,%a5
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( (executing->fp_context != NULL) &&
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
485c2: 263c 0004 966a movel #300650,%d3
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
485c8: 6000 0104 braw 486ce <_Thread_Dispatch+0x13e>
* This routine sets thread dispatch level to the
* value passed in.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value)
{
_Thread_Dispatch_disable_level = value;
485cc: 7201 moveq #1,%d1
heir = _Thread_Heir;
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
485ce: 4206 clrb %d6
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
heir = _Thread_Heir;
485d0: 2679 0005 f322 moveal 5f322 <_Per_CPU_Information+0x12>,%a3
485d6: 23c1 0005 eed6 movel %d1,5eed6 <_Thread_Dispatch_disable_level>
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
485dc: 13c6 0005 f31c moveb %d6,5f31c <_Per_CPU_Information+0xc>
_Thread_Executing = heir;
485e2: 23cb 0005 f31e movel %a3,5f31e <_Per_CPU_Information+0xe>
/*
* When the heir and executing are the same, then we are being
* requested to do the post switch dispatching. This is normally
* done to dispatch signals.
*/
if ( heir == executing )
485e8: b5cb cmpal %a3,%a2
485ea: 6612 bnes 485fe <_Thread_Dispatch+0x6e>
485ec: 42b9 0005 eed6 clrl 5eed6 <_Thread_Dispatch_disable_level>
post_switch:
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 0 );
#endif
_ISR_Enable( level );
485f2: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
485f4: 2679 0005 ef4a moveal 5ef4a <_API_extensions_Post_switch_list>,%a3
485fa: 6000 00ec braw 486e8 <_Thread_Dispatch+0x158>
*/
#if __RTEMS_ADA__
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
485fe: 7201 moveq #1,%d1
48600: b2ab 0076 cmpl %a3@(118),%d1
48604: 660a bnes 48610 <_Thread_Dispatch+0x80>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
48606: 41f9 0005 ee8e lea 5ee8e <_Thread_Ticks_per_timeslice>,%a0
4860c: 2750 0072 movel %a0@,%a3@(114)
_ISR_Enable( level );
48610: 46c0 movew %d0,%sr
48612: 4879 0005 ee80 pea 5ee80 <_TOD+0x8>
48618: 2245 moveal %d5,%a1
4861a: 2f02 movel %d2,%sp@-
4861c: 4e91 jsr %a1@
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
4861e: 508f addql #8,%sp
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
48620: 206e fff8 moveal %fp@(-8),%a0
48624: 226e fffc moveal %fp@(-4),%a1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
48628: 2008 movel %a0,%d0
4862a: 2209 movel %a1,%d1
4862c: 2c39 0005 f32a movel 5f32a <_Per_CPU_Information+0x1a>,%d6
48632: 92b9 0005 f32e subl 5f32e <_Per_CPU_Information+0x1e>,%d1
48638: 9186 subxl %d6,%d0
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
4863a: d3aa 0082 addl %d1,%a2@(130)
4863e: 2c2a 007e movel %a2@(126),%d6
48642: dd80 addxl %d0,%d6
48644: 2546 007e movel %d6,%a2@(126)
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
48648: 23c8 0005 f32a movel %a0,5f32a <_Per_CPU_Information+0x1a>
4864e: 23c9 0005 f32e movel %a1,5f32e <_Per_CPU_Information+0x1e>
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
48654: 2079 0005 ef46 moveal 5ef46 <_Thread_libc_reent>,%a0
4865a: 4a88 tstl %a0
4865c: 6708 beqs 48666 <_Thread_Dispatch+0xd6> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
4865e: 2550 00f6 movel %a0@,%a2@(246)
*_Thread_libc_reent = heir->libc_reent;
48662: 20ab 00f6 movel %a3@(246),%a0@
48666: 2c39 0005 d788 movel 5d788 <_User_extensions_Switches_list>,%d6
4866c: 6012 bras 48680 <_Thread_Dispatch+0xf0>
while ( node != tail ) {
const User_extensions_Switch_control *extension =
(const User_extensions_Switch_control *) node;
(*extension->thread_switch)( executing, heir );
4866e: 2f0b movel %a3,%sp@-
48670: 2246 moveal %d6,%a1
48672: 2f0a movel %a2,%sp@-
48674: 2069 0008 moveal %a1@(8),%a0
48678: 4e90 jsr %a0@
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
4867a: 508f addql #8,%sp
4867c: 2046 moveal %d6,%a0
4867e: 2c10 movel %a0@,%d6
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
48680: 0c86 0005 d78c cmpil #382860,%d6
48686: 66e6 bnes 4866e <_Thread_Dispatch+0xde>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
48688: 486b 00be pea %a3@(190)
4868c: 486a 00be pea %a2@(190)
48690: 4e94 jsr %a4@
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( (executing->fp_context != NULL) &&
48692: 508f addql #8,%sp
48694: 4aaa 00f2 tstl %a2@(242)
48698: 6726 beqs 486c0 <_Thread_Dispatch+0x130>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Allocated_fp );
4869a: 2079 0005 ef42 moveal 5ef42 <_Thread_Allocated_fp>,%a0
486a0: b1ca cmpal %a2,%a0
486a2: 671c beqs 486c0 <_Thread_Dispatch+0x130>
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
486a4: 4a88 tstl %a0
486a6: 670a beqs 486b2 <_Thread_Dispatch+0x122>
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
486a8: 4868 00f2 pea %a0@(242)
486ac: 2243 moveal %d3,%a1
486ae: 4e91 jsr %a1@
486b0: 588f addql #4,%sp
_Context_Restore_fp( &executing->fp_context );
486b2: 486a 00f2 pea %a2@(242)
486b6: 4e95 jsr %a5@
_Thread_Allocated_fp = executing;
486b8: 588f addql #4,%sp
486ba: 23ca 0005 ef42 movel %a2,5ef42 <_Thread_Allocated_fp>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
486c0: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2
_ISR_Disable( level );
486c6: 2204 movel %d4,%d1
486c8: 40c0 movew %sr,%d0
486ca: 8280 orl %d0,%d1
486cc: 46c1 movew %d1,%sr
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
486ce: 1239 0005 f31c moveb 5f31c <_Per_CPU_Information+0xc>,%d1
486d4: 6600 fef6 bnew 485cc <_Thread_Dispatch+0x3c>
486d8: 6000 ff12 braw 485ec <_Thread_Dispatch+0x5c>
while ( node != tail ) {
const API_extensions_Post_switch_control *post_switch =
(const API_extensions_Post_switch_control *) node;
(*post_switch->hook)( executing );
486dc: 2f0a movel %a2,%sp@-
486de: 206b 0008 moveal %a3@(8),%a0
486e2: 4e90 jsr %a0@
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
486e4: 2653 moveal %a3@,%a3
486e6: 588f addql #4,%sp
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
486e8: b7fc 0005 ef4e cmpal #388942,%a3
486ee: 66ec bnes 486dc <_Thread_Dispatch+0x14c>
486f0: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5
486f6: 4e5e unlk %fp
...
0004cda4 <_Thread_Handler>:
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Handler( void )
{
4cda4: 4e56 0000 linkw %fp,#0
4cda8: 2f0a movel %a2,%sp@-
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static bool doneConstructors;
bool doCons;
#endif
executing = _Thread_Executing;
4cdaa: 2479 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a2
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Handler( void )
{
4cdb0: 2f02 movel %d2,%sp@-
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
4cdb2: 222a 00a4 movel %a2@(164),%d1
_ISR_Set_level(level);
4cdb6: 40c0 movew %sr,%d0
4cdb8: e189 lsll #8,%d1
4cdba: 0280 0000 f8ff andil #63743,%d0
4cdc0: 8081 orl %d1,%d0
4cdc2: 46c0 movew %d0,%sr
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
doneConstructors = true;
4cdc4: 7001 moveq #1,%d0
doCons = !doneConstructors
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
4cdc6: 1439 0005 e6d4 moveb 5e6d4 <doneConstructors.3726>,%d2
doneConstructors = true;
4cdcc: 13c0 0005 e6d4 moveb %d0,5e6d4 <doneConstructors.3726>
#endif
#endif
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( (executing->fp_context != NULL) &&
4cdd2: 4aaa 00f2 tstl %a2@(242)
4cdd6: 6720 beqs 4cdf8 <_Thread_Handler+0x54>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Allocated_fp );
4cdd8: 2079 0005 ef42 moveal 5ef42 <_Thread_Allocated_fp>,%a0
4cdde: b1ca cmpal %a2,%a0
4cde0: 6716 beqs 4cdf8 <_Thread_Handler+0x54>
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
4cde2: 4a88 tstl %a0
4cde4: 670c beqs 4cdf2 <_Thread_Handler+0x4e>
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
4cde6: 4868 00f2 pea %a0@(242)
4cdea: 4eb9 0004 966a jsr 4966a <_CPU_Context_save_fp>
4cdf0: 588f addql #4,%sp
_Thread_Allocated_fp = executing;
4cdf2: 23ca 0005 ef42 movel %a2,5ef42 <_Thread_Allocated_fp>
);
}
static inline void _User_extensions_Thread_begin( Thread_Control *executing )
{
_User_extensions_Iterate(
4cdf8: 4879 0004 9096 pea 49096 <_User_extensions_Thread_begin_visitor>
4cdfe: 2f0a movel %a2,%sp@-
4ce00: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate>
_User_extensions_Thread_begin( executing );
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
4ce06: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch>
/*
* _init could be a weak symbol and we SHOULD test it but it isn't
* in any configuration I know of and it generates a warning on every
* RTEMS target configuration. --joel (12 May 2007)
*/
if (doCons) /* && (volatile void *)_init) */ {
4ce0c: 508f addql #8,%sp
4ce0e: 4a02 tstb %d2
4ce10: 6606 bnes 4ce18 <_Thread_Handler+0x74>
INIT_NAME ();
4ce12: 4eb9 0005 b620 jsr 5b620 <_init>
_Thread_Enable_dispatch();
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
4ce18: 202a 008e movel %a2@(142),%d0
4ce1c: 6606 bnes 4ce24 <_Thread_Handler+0x80>
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
4ce1e: 2f2a 0096 movel %a2@(150),%sp@-
4ce22: 600a bras 4ce2e <_Thread_Handler+0x8a>
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
4ce24: 7201 moveq #1,%d1
4ce26: b280 cmpl %d0,%d1
4ce28: 6610 bnes 4ce3a <_Thread_Handler+0x96> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
4ce2a: 2f2a 0092 movel %a2@(146),%sp@-
4ce2e: 206a 008a moveal %a2@(138),%a0
4ce32: 4e90 jsr %a0@
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
4ce34: 588f addql #4,%sp
4ce36: 2540 0028 movel %d0,%a2@(40)
}
}
static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
{
_User_extensions_Iterate(
4ce3a: 4879 0004 90ae pea 490ae <_User_extensions_Thread_exitted_visitor>
4ce40: 2f0a movel %a2,%sp@-
4ce42: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate>
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
4ce48: 4878 0005 pea 5 <COMPARE>
4ce4c: 4878 0001 pea 1 <ADD>
4ce50: 42a7 clrl %sp@-
4ce52: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred>
00048978 <_Thread_Handler_initialization>:
#if defined(RTEMS_SMP)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
48978: 4e56 0000 linkw %fp,#0
uint32_t ticks_per_timeslice =
rtems_configuration_get_ticks_per_timeslice();
uint32_t maximum_extensions =
rtems_configuration_get_maximum_extensions();
rtems_stack_allocate_init_hook stack_allocate_init_hook =
4897c: 2079 0005 b878 moveal 5b878 <Configuration+0x24>,%a0
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
48982: 4ab9 0005 b87c tstl 5b87c <Configuration+0x28>
48988: 6708 beqs 48992 <_Thread_Handler_initialization+0x1a><== NEVER TAKEN
4898a: 4ab9 0005 b880 tstl 5b880 <Configuration+0x2c>
48990: 6610 bnes 489a2 <_Thread_Handler_initialization+0x2a>
rtems_configuration_get_stack_free_hook() == NULL)
_Internal_error_Occurred(
48992: 4878 000e pea e <OPER1+0x2>
48996: 4878 0001 pea 1 <ADD>
4899a: 42a7 clrl %sp@-
4899c: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_BAD_STACK_HOOK
);
if ( stack_allocate_init_hook != NULL )
489a2: 4a88 tstl %a0
489a4: 670a beqs 489b0 <_Thread_Handler_initialization+0x38>
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
489a6: 2f39 0005 b858 movel 5b858 <Configuration+0x4>,%sp@-
489ac: 4e90 jsr %a0@
489ae: 588f addql #4,%sp
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
489b0: 4878 0008 pea 8 <DIVIDE_BY_ZERO>
_Thread_Heir = NULL;
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
#endif
_Thread_Maximum_extensions = maximum_extensions;
489b4: 41f9 0005 b85c lea 5b85c <Configuration+0x8>,%a0
489ba: 23d0 0005 ef56 movel %a0@,5ef56 <_Thread_Maximum_extensions>
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
489c0: 41f9 0005 b868 lea 5b868 <Configuration+0x14>,%a0
489c6: 23d0 0005 ee8e movel %a0@,5ee8e <_Thread_Ticks_per_timeslice>
);
if ( stack_allocate_init_hook != NULL )
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
_Thread_Dispatch_necessary = false;
489cc: 4200 clrb %d0
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
489ce: 42a7 clrl %sp@-
489d0: 4878 010a pea 10a <DBL_MANT_DIG+0xd5>
489d4: 4878 0001 pea 1 <ADD>
489d8: 4878 0001 pea 1 <ADD>
489dc: 4878 0001 pea 1 <ADD>
489e0: 4879 0005 efc4 pea 5efc4 <_Thread_Internal_information>
);
if ( stack_allocate_init_hook != NULL )
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
_Thread_Dispatch_necessary = false;
489e6: 13c0 0005 f31c moveb %d0,5f31c <_Per_CPU_Information+0xc>
_Thread_Executing = NULL;
489ec: 42b9 0005 f31e clrl 5f31e <_Per_CPU_Information+0xe>
_Thread_Heir = NULL;
489f2: 42b9 0005 f322 clrl 5f322 <_Per_CPU_Information+0x12>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
489f8: 42b9 0005 ef42 clrl 5ef42 <_Thread_Allocated_fp>
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
489fe: 4eb9 0004 7aec jsr 47aec <_Objects_Initialize_information>
48a04: 4fef 001c lea %sp@(28),%sp
false, /* true if this is a global object class */
NULL /* Proxy extraction support callout */
#endif
);
}
48a08: 4e5e unlk %fp <== NOT EXECUTED
00049468 <_Thread_Restart>:
*/
RTEMS_INLINE_ROUTINE bool _States_Is_dormant (
States_Control the_states
)
{
return (the_states & STATES_DORMANT);
49468: 7001 moveq #1,%d0
bool _Thread_Restart(
Thread_Control *the_thread,
void *pointer_argument,
Thread_Entry_numeric_type numeric_argument
)
{
4946a: 4e56 0000 linkw %fp,#0
4946e: 2f0a movel %a2,%sp@-
49470: 246e 0008 moveal %fp@(8),%a2
49474: c0aa 0010 andl %a2@(16),%d0
if ( !_States_Is_dormant( the_thread->current_state ) ) {
49478: 666e bnes 494e8 <_Thread_Restart+0x80>
_Thread_Set_transient( the_thread );
4947a: 2f0a movel %a2,%sp@-
4947c: 4eb9 0004 9550 jsr 49550 <_Thread_Set_transient>
_Thread_Reset( the_thread, pointer_argument, numeric_argument );
49482: 2f2e 0010 movel %fp@(16),%sp@-
49486: 2f2e 000c movel %fp@(12),%sp@-
4948a: 2f0a movel %a2,%sp@-
4948c: 4eb9 0004 c044 jsr 4c044 <_Thread_Reset>
_Thread_Load_environment( the_thread );
49492: 2f0a movel %a2,%sp@-
49494: 4eb9 0004 bd80 jsr 4bd80 <_Thread_Load_environment>
_Thread_Ready( the_thread );
4949a: 2f0a movel %a2,%sp@-
4949c: 4eb9 0004 c014 jsr 4c014 <_Thread_Ready>
);
}
static inline void _User_extensions_Thread_restart( Thread_Control *restarted )
{
_User_extensions_Iterate(
494a2: 4879 0004 9706 pea 49706 <_User_extensions_Thread_restart_visitor>
494a8: 2f0a movel %a2,%sp@-
494aa: 4eb9 0004 977e jsr 4977e <_User_extensions_Iterate>
_User_extensions_Thread_restart( the_thread );
if ( _Thread_Is_executing ( the_thread ) )
494b0: 4fef 0020 lea %sp@(32),%sp
_Thread_Restart_self();
return true;
494b4: 7001 moveq #1,%d0
_Thread_Ready( the_thread );
_User_extensions_Thread_restart( the_thread );
if ( _Thread_Is_executing ( the_thread ) )
494b6: b5f9 0005 fbd6 cmpal 5fbd6 <_Per_CPU_Information+0xe>,%a2
494bc: 662c bnes 494ea <_Thread_Restart+0x82>
*/
RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
{
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( _Thread_Executing->fp_context != NULL )
494be: 4aaa 00f2 tstl %a2@(242)
494c2: 670c beqs 494d0 <_Thread_Restart+0x68>
_Context_Restore_fp( &_Thread_Executing->fp_context );
494c4: 486a 00f2 pea %a2@(242)
494c8: 4eb9 0004 9d14 jsr 49d14 <_CPU_Context_restore_fp>
494ce: 588f addql #4,%sp
#endif
_CPU_Context_Restart_self( &_Thread_Executing->Registers );
494d0: 2079 0005 fbd6 moveal 5fbd6 <_Per_CPU_Information+0xe>,%a0
494d6: 41e8 00be lea %a0@(190),%a0
494da: 2f08 movel %a0,%sp@-
494dc: 4eb9 0004 9bc2 jsr 49bc2 <_CPU_Context_Restart_self>
494e2: 588f addql #4,%sp <== NOT EXECUTED
_Thread_Restart_self();
return true;
494e4: 7001 moveq #1,%d0 <== NOT EXECUTED
494e6: 6002 bras 494ea <_Thread_Restart+0x82> <== NOT EXECUTED
}
return false;
494e8: 4200 clrb %d0
}
494ea: 246e fffc moveal %fp@(-4),%a2
494ee: 4e5e unlk %fp
...
00048f40 <_Thread_Stack_Free>:
#include <rtems/config.h>
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
48f40: 4e56 0000 linkw %fp,#0
48f44: 206e 0008 moveal %fp@(8),%a0
#if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
/*
* If the API provided the stack space, then don't free it.
*/
if ( !the_thread->Start.core_allocated_stack )
48f48: 4a28 00ac tstb %a0@(172)
48f4c: 6710 beqs 48f5e <_Thread_Stack_Free+0x1e> <== NEVER TAKEN
* Call ONLY the CPU table stack free hook, or the
* the RTEMS workspace free. This is so the free
* routine properly matches the allocation of the stack.
*/
(*stack_free_hook)( the_thread->Start.Initial_stack.area );
48f4e: 2279 0005 b880 moveal 5b880 <Configuration+0x2c>,%a1
48f54: 2d68 00b2 0008 movel %a0@(178),%fp@(8)
}
48f5a: 4e5e unlk %fp
* Call ONLY the CPU table stack free hook, or the
* the RTEMS workspace free. This is so the free
* routine properly matches the allocation of the stack.
*/
(*stack_free_hook)( the_thread->Start.Initial_stack.area );
48f5c: 4ed1 jmp %a1@
}
48f5e: 4e5e unlk %fp <== NOT EXECUTED
...
0004825c <_Thread_blocking_operation_Cancel>:
/*
* If the sync state is timed out, this is very likely not needed.
* But better safe than sorry when it comes to critical sections.
*/
if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
4825c: 7202 moveq #2,%d1
Thread_blocking_operation_States sync_state __attribute__((unused)),
#endif
Thread_Control *the_thread,
ISR_Level level
)
{
4825e: 4e56 0000 linkw %fp,#0
48262: 202e 0010 movel %fp@(16),%d0
48266: 2f0a movel %a2,%sp@-
48268: 246e 000c moveal %fp@(12),%a2
#endif
/*
* The thread is not waiting on anything after this completes.
*/
the_thread->Wait.queue = NULL;
4826c: 42aa 0044 clrl %a2@(68)
/*
* If the sync state is timed out, this is very likely not needed.
* But better safe than sorry when it comes to critical sections.
*/
if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
48270: b2aa 0050 cmpl %a2@(80),%d1
48274: 6618 bnes 4828e <_Thread_blocking_operation_Cancel+0x32>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
48276: 123c 0003 moveb #3,%d1
4827a: 2541 0050 movel %d1,%a2@(80)
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
4827e: 46c0 movew %d0,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
48280: 486a 0048 pea %a2@(72)
48284: 4eb9 0004 92f8 jsr 492f8 <_Watchdog_Remove>
4828a: 588f addql #4,%sp
4828c: 6002 bras 48290 <_Thread_blocking_operation_Cancel+0x34>
} else
_ISR_Enable( level );
4828e: 46c0 movew %d0,%sr
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
48290: 2d4a 0008 movel %a2,%fp@(8)
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
48294: 246e fffc moveal %fp@(-4),%a2
48298: 203c 1007 fff8 movel #268959736,%d0
4829e: 2d40 000c movel %d0,%fp@(12)
482a2: 4e5e unlk %fp
482a4: 4ef9 0004 8388 jmp 48388 <_Thread_Clear_state>
...
0004b948 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
4b948: 4e56 0000 linkw %fp,#0
4b94c: 226e 0008 moveal %fp@(8),%a1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
4b950: 2069 0044 moveal %a1@(68),%a0
* If it is not satisfied, then it is "nothing happened" and
* this is the "timeout" transition. After a request is satisfied,
* a timeout is not allowed to occur.
*/
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&
4b954: 2028 0030 movel %a0@(48),%d0
4b958: 671c beqs 4b976 <_Thread_queue_Process_timeout+0x2e>
4b95a: b3f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a1
4b960: 6614 bnes 4b976 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
4b962: 7203 moveq #3,%d1
4b964: b280 cmpl %d0,%d1
4b966: 6720 beqs 4b988 <_Thread_queue_Process_timeout+0x40>
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
4b968: 7002 moveq #2,%d0
*/
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
4b96a: 2368 003c 0034 movel %a0@(60),%a1@(52)
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
4b970: 2140 0030 movel %d0,%a0@(48)
4b974: 6012 bras 4b988 <_Thread_queue_Process_timeout+0x40>
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
4b976: 2368 003c 0034 movel %a0@(60),%a1@(52)
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
4b97c: 2f09 movel %a1,%sp@-
4b97e: 2f08 movel %a0,%sp@-
4b980: 4eb9 0004 b844 jsr 4b844 <_Thread_queue_Extract>
4b986: 508f addql #8,%sp
}
}
4b988: 4e5e unlk %fp <== NOT EXECUTED
00048dd0 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
48dd0: 4e56 fff0 linkw %fp,#-16
48dd4: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
48dd8: 246e 0008 moveal %fp@(8),%a2
48ddc: 266e 000c moveal %fp@(12),%a3
/*
* Just in case the thread really wasn't blocked on a thread queue
* when we get here.
*/
if ( !the_thread_queue )
48de0: 4a8a tstl %a2
48de2: 6746 beqs 48e2a <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN
/*
* 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 ) {
48de4: 7001 moveq #1,%d0
48de6: b0aa 0034 cmpl %a2@(52),%d0
48dea: 663e bnes 48e2a <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
48dec: 303c 0700 movew #1792,%d0
48df0: 40c2 movew %sr,%d2
48df2: 8082 orl %d2,%d0
48df4: 46c0 movew %d0,%sr
48df6: 202b 0010 movel %a3@(16),%d0
48dfa: 0280 0003 bee0 andil #245472,%d0
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
48e00: 6726 beqs 48e28 <_Thread_queue_Requeue+0x58> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
48e02: 7001 moveq #1,%d0
48e04: 2540 0030 movel %d0,%a2@(48)
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
48e08: 4878 0001 pea 1 <ADD>
48e0c: 2f0b movel %a3,%sp@-
48e0e: 2f0a movel %a2,%sp@-
48e10: 4eb9 0004 b880 jsr 4b880 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
48e16: 486e fffc pea %fp@(-4)
48e1a: 2f0b movel %a3,%sp@-
48e1c: 2f0a movel %a2,%sp@-
48e1e: 4eb9 0004 8bdc jsr 48bdc <_Thread_queue_Enqueue_priority>
48e24: 4fef 0018 lea %sp@(24),%sp
}
_ISR_Enable( level );
48e28: 46c2 movew %d2,%sr
}
}
48e2a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
48e30: 4e5e unlk %fp <== NOT EXECUTED
00048e34 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
48e34: 4e56 fffc linkw %fp,#-4
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
48e38: 486e fffc pea %fp@(-4)
48e3c: 2f2e 0008 movel %fp@(8),%sp@-
48e40: 4eb9 0004 871c jsr 4871c <_Thread_Get>
switch ( location ) {
48e46: 508f addql #8,%sp
48e48: 4aae fffc tstl %fp@(-4)
48e4c: 6618 bnes 48e66 <_Thread_queue_Timeout+0x32> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
48e4e: 2f00 movel %d0,%sp@-
48e50: 4eb9 0004 b948 jsr 4b948 <_Thread_queue_Process_timeout>
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
--level;
_Thread_Dispatch_disable_level = level;
48e56: 588f addql #4,%sp
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
48e58: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0
--level;
48e5e: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
48e60: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level>
_Thread_Unnest_dispatch();
break;
}
}
48e66: 4e5e unlk %fp
...
000526b8 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
526b8: 4e56 ffc0 linkw %fp,#-64
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
526bc: 200e movel %fp,%d0
526be: 220e movel %fp,%d1
526c0: 41ee ffec lea %fp@(-20),%a0
526c4: 5181 subql #8,%d1
526c6: 0680 ffff ffe8 addil #-24,%d0
526cc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
526d0: 246e 0008 moveal %fp@(8),%a2
526d4: 240e movel %fp,%d2
526d6: 0682 ffff fff4 addil #-12,%d2
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
526dc: 280a movel %a2,%d4
/*
* 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 );
526de: 260a movel %a2,%d3
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
526e0: 0684 0000 0030 addil #48,%d4
/*
* 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 );
526e6: 0683 0000 0068 addil #104,%d3
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
526ec: 2c08 movel %a0,%d6
526ee: 2a01 movel %d1,%d5
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
526f0: 2d48 ffe8 movel %a0,%fp@(-24)
head->previous = NULL;
526f4: 42ae ffec clrl %fp@(-20)
tail->previous = head;
526f8: 2d40 fff0 movel %d0,%fp@(-16)
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
526fc: 2d41 fff4 movel %d1,%fp@(-12)
head->previous = NULL;
52700: 42ae fff8 clrl %fp@(-8)
tail->previous = head;
52704: 2d42 fffc movel %d2,%fp@(-4)
{
/*
* 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;
52708: 41ee ffe8 lea %fp@(-24),%a0
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
5270c: 47f9 0005 649c lea 5649c <_Watchdog_Adjust_to_chain>,%a3
52712: 4bf9 0006 6f48 lea 66f48 <__divdi3>,%a5
{
/*
* 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;
52718: 2548 0078 movel %a0,%a2@(120)
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
5271c: 2039 0007 7560 movel 77560 <_Watchdog_Ticks_since_boot>,%d0
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
52722: 222a 003c movel %a2@(60),%d1
watchdogs->last_snapshot = snapshot;
52726: 2540 003c movel %d0,%a2@(60)
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
5272a: 9081 subl %d1,%d0
5272c: 2f02 movel %d2,%sp@-
5272e: 2f00 movel %d0,%sp@-
52730: 2f04 movel %d4,%sp@-
52732: 4e93 jsr %a3@
52734: 2f3c 3b9a ca00 movel #1000000000,%sp@-
5273a: 42a7 clrl %sp@-
5273c: 2f39 0007 7420 movel 77420 <_TOD+0x4>,%sp@-
52742: 2f39 0007 741c movel 7741c <_TOD>,%sp@-
52748: 4e95 jsr %a5@
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
5274a: 202a 0074 movel %a2@(116),%d0
5274e: 2e01 movel %d1,%d7
/*
* 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 ) {
52750: 4fef 001c lea %sp@(28),%sp
52754: b081 cmpl %d1,%d0
52756: 640c bccs 52764 <_Timer_server_Body+0xac>
/*
* 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 );
52758: 2f02 movel %d2,%sp@-
5275a: 9280 subl %d0,%d1
5275c: 2f01 movel %d1,%sp@-
5275e: 2f03 movel %d3,%sp@-
52760: 4e93 jsr %a3@
52762: 6014 bras 52778 <_Timer_server_Body+0xc0>
} else if ( snapshot < last_snapshot ) {
52764: b081 cmpl %d1,%d0
52766: 6314 blss 5277c <_Timer_server_Body+0xc4>
/*
* 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 );
52768: 9081 subl %d1,%d0
5276a: 2f00 movel %d0,%sp@-
5276c: 4878 0001 pea 1 <ADD>
52770: 2f03 movel %d3,%sp@-
52772: 4eb9 0005 641c jsr 5641c <_Watchdog_Adjust>
52778: 4fef 000c lea %sp@(12),%sp
}
watchdogs->last_snapshot = snapshot;
5277c: 2547 0074 movel %d7,%a2@(116)
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
52780: 49f9 0005 6520 lea 56520 <_Watchdog_Insert>,%a4
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
52786: 2e3c 0005 3220 movel #340512,%d7
5278c: 202a 0078 movel %a2@(120),%d0
52790: 2047 moveal %d7,%a0
52792: 2f00 movel %d0,%sp@-
52794: 4e90 jsr %a0@
if ( timer == NULL ) {
52796: 588f addql #4,%sp
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
52798: 2040 moveal %d0,%a0
if ( timer == NULL ) {
5279a: 4a80 tstl %d0
5279c: 6724 beqs 527c2 <_Timer_server_Body+0x10a>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
5279e: 2028 0038 movel %a0@(56),%d0
527a2: 7201 moveq #1,%d1
527a4: b280 cmpl %d0,%d1
527a6: 6608 bnes 527b0 <_Timer_server_Body+0xf8>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
527a8: 4868 0010 pea %a0@(16)
527ac: 2f04 movel %d4,%sp@-
527ae: 600c bras 527bc <_Timer_server_Body+0x104>
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
527b0: 7203 moveq #3,%d1
527b2: b280 cmpl %d0,%d1
527b4: 66d6 bnes 5278c <_Timer_server_Body+0xd4> <== NEVER TAKEN
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
527b6: 4868 0010 pea %a0@(16)
527ba: 2f03 movel %d3,%sp@-
527bc: 4e94 jsr %a4@
527be: 508f addql #8,%sp
527c0: 60ca bras 5278c <_Timer_server_Body+0xd4>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
527c2: 203c 0000 0700 movel #1792,%d0
527c8: 40c1 movew %sr,%d1
527ca: 8081 orl %d1,%d0
527cc: 46c0 movew %d0,%sr
if ( _Chain_Is_empty( insert_chain ) ) {
527ce: bcae ffe8 cmpl %fp@(-24),%d6
527d2: 6614 bnes 527e8 <_Timer_server_Body+0x130> <== NEVER TAKEN
ts->insert_chain = NULL;
527d4: 42aa 0078 clrl %a2@(120)
_ISR_Enable( level );
527d8: 46c1 movew %d1,%sr
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
527da: 2e3c 0000 0700 movel #1792,%d7
_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 ) ) {
527e0: baae fff4 cmpl %fp@(-12),%d5
527e4: 6608 bnes 527ee <_Timer_server_Body+0x136>
527e6: 603e bras 52826 <_Timer_server_Body+0x16e>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
527e8: 46c1 movew %d1,%sr <== NOT EXECUTED
527ea: 6000 ff30 braw 5271c <_Timer_server_Body+0x64> <== NOT EXECUTED
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
527ee: 2007 movel %d7,%d0
527f0: 40c1 movew %sr,%d1
527f2: 8081 orl %d1,%d0
527f4: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
527f6: 206e fff4 moveal %fp@(-12),%a0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
527fa: ba88 cmpl %a0,%d5
527fc: 6722 beqs 52820 <_Timer_server_Body+0x168>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
527fe: 2250 moveal %a0@,%a1
head->next = new_first;
new_first->previous = head;
52800: 2342 0004 movel %d2,%a1@(4)
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
52804: 42a8 0008 clrl %a0@(8)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
52808: 2d49 fff4 movel %a1,%fp@(-12)
_ISR_Enable( level );
5280c: 46c1 movew %d1,%sr
/*
* 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 );
5280e: 2f28 0024 movel %a0@(36),%sp@-
52812: 2f28 0020 movel %a0@(32),%sp@-
52816: 2068 001c moveal %a0@(28),%a0
5281a: 4e90 jsr %a0@
}
5281c: 508f addql #8,%sp
5281e: 60ce bras 527ee <_Timer_server_Body+0x136>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
52820: 46c1 movew %d1,%sr
52822: 6000 fee4 braw 52708 <_Timer_server_Body+0x50>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
52826: 4200 clrb %d0
52828: 1540 007c moveb %d0,%a2@(124)
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
5282c: 2039 0007 747a movel 7747a <_Thread_Dispatch_disable_level>,%d0
++level;
52832: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
52834: 23c0 0007 747a movel %d0,7747a <_Thread_Dispatch_disable_level>
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
5283a: 4878 0008 pea 8 <DIVIDE_BY_ZERO>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
5283e: 47f9 0005 6644 lea 56644 <_Watchdog_Remove>,%a3
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
52844: 2f12 movel %a2@,%sp@-
52846: 4eb9 0005 60cc jsr 560cc <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
5284c: 2f0a movel %a2,%sp@-
5284e: 4eba fda4 jsr %pc@(525f4 <_Timer_server_Reset_interval_system_watchdog>)
_Timer_server_Reset_tod_system_watchdog( ts );
52852: 2f0a movel %a2,%sp@-
52854: 4eba fdfe jsr %pc@(52654 <_Timer_server_Reset_tod_system_watchdog>)
_Thread_Enable_dispatch();
52858: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch>
ts->active = true;
5285e: 7201 moveq #1,%d1
52860: 1541 007c moveb %d1,%a2@(124)
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
52864: 486a 0008 pea %a2@(8)
52868: 4e93 jsr %a3@
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
5286a: 486a 0040 pea %a2@(64)
5286e: 4e93 jsr %a3@
52870: 4fef 0018 lea %sp@(24),%sp
52874: 6000 fe92 braw 52708 <_Timer_server_Body+0x50>
00052878 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
52878: 4e56 fff0 linkw %fp,#-16
5287c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
52880: 246e 0008 moveal %fp@(8),%a2
52884: 266e 000c moveal %fp@(12),%a3
if ( ts->insert_chain == NULL ) {
52888: 202a 0078 movel %a2@(120),%d0
5288c: 6600 0112 bnew 529a0 <_Timer_server_Schedule_operation_method+0x128>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
52890: 2039 0007 747a movel 7747a <_Thread_Dispatch_disable_level>,%d0
++level;
52896: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
52898: 23c0 0007 747a movel %d0,7747a <_Thread_Dispatch_disable_level>
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
5289e: 202b 0038 movel %a3@(56),%d0
528a2: 7201 moveq #1,%d1
528a4: b280 cmpl %d0,%d1
528a6: 6660 bnes 52908 <_Timer_server_Schedule_operation_method+0x90>
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
528a8: 203c 0000 0700 movel #1792,%d0
528ae: 40c2 movew %sr,%d2
528b0: 8082 orl %d2,%d0
528b2: 46c0 movew %d0,%sr
snapshot = _Watchdog_Ticks_since_boot;
528b4: 2039 0007 7560 movel 77560 <_Watchdog_Ticks_since_boot>,%d0
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
528ba: 43ea 0034 lea %a2@(52),%a1
last_snapshot = ts->Interval_watchdogs.last_snapshot;
528be: 222a 003c movel %a2@(60),%d1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
528c2: 206a 0030 moveal %a2@(48),%a0
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
528c6: b3c8 cmpal %a0,%a1
528c8: 6716 beqs 528e0 <_Timer_server_Schedule_operation_method+0x68>
first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain );
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
528ca: 2240 moveal %d0,%a1
528cc: 93c1 subal %d1,%a1
delta_interval = first_watchdog->delta_interval;
528ce: 2228 0010 movel %a0@(16),%d1
if (delta_interval > delta) {
528d2: b3c1 cmpal %d1,%a1
528d4: 6404 bccs 528da <_Timer_server_Schedule_operation_method+0x62>
delta_interval -= delta;
528d6: 9289 subl %a1,%d1
528d8: 6002 bras 528dc <_Timer_server_Schedule_operation_method+0x64>
} else {
delta_interval = 0;
528da: 4281 clrl %d1
}
first_watchdog->delta_interval = delta_interval;
528dc: 2141 0010 movel %d1,%a0@(16)
}
ts->Interval_watchdogs.last_snapshot = snapshot;
528e0: 2540 003c movel %d0,%a2@(60)
_ISR_Enable( level );
528e4: 46c2 movew %d2,%sr
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
528e6: 486b 0010 pea %a3@(16)
528ea: 486a 0030 pea %a2@(48)
528ee: 4eb9 0005 6520 jsr 56520 <_Watchdog_Insert>
if ( !ts->active ) {
528f4: 508f addql #8,%sp
528f6: 102a 007c moveb %a2@(124),%d0
528fa: 6600 0096 bnew 52992 <_Timer_server_Schedule_operation_method+0x11a>
_Timer_server_Reset_interval_system_watchdog( ts );
528fe: 2f0a movel %a2,%sp@-
52900: 4eba fcf2 jsr %pc@(525f4 <_Timer_server_Reset_interval_system_watchdog>)
52904: 6000 008a braw 52990 <_Timer_server_Schedule_operation_method+0x118>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
52908: 7203 moveq #3,%d1
5290a: b280 cmpl %d0,%d1
5290c: 6600 0084 bnew 52992 <_Timer_server_Schedule_operation_method+0x11a>
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
52910: 203c 0000 0700 movel #1792,%d0
52916: 40c2 movew %sr,%d2
52918: 8082 orl %d2,%d0
5291a: 46c0 movew %d0,%sr
5291c: 2f3c 3b9a ca00 movel #1000000000,%sp@-
52922: 42a7 clrl %sp@-
52924: 2f39 0007 7420 movel 77420 <_TOD+0x4>,%sp@-
5292a: 2f39 0007 741c movel 7741c <_TOD>,%sp@-
52930: 4eb9 0006 6f48 jsr 66f48 <__divdi3>
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
52936: 226a 0074 moveal %a2@(116),%a1
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
5293a: 200a movel %a2,%d0
5293c: 4fef 0010 lea %sp@(16),%sp
52940: 0680 0000 006c addil #108,%d0
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
52946: 206a 0068 moveal %a2@(104),%a0
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
5294a: b088 cmpl %a0,%d0
5294c: 6720 beqs 5296e <_Timer_server_Schedule_operation_method+0xf6>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
5294e: 2028 0010 movel %a0@(16),%d0
if ( snapshot > last_snapshot ) {
52952: b3c1 cmpal %d1,%a1
52954: 640c bccs 52962 <_Timer_server_Schedule_operation_method+0xea>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
52956: 2841 moveal %d1,%a4
52958: 99c9 subal %a1,%a4
if (delta_interval > delta) {
5295a: b9c0 cmpal %d0,%a4
5295c: 640a bccs 52968 <_Timer_server_Schedule_operation_method+0xf0><== NEVER TAKEN
delta_interval -= delta;
5295e: 908c subl %a4,%d0
52960: 6008 bras 5296a <_Timer_server_Schedule_operation_method+0xf2>
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
52962: d089 addl %a1,%d0
delta_interval += delta;
52964: 9081 subl %d1,%d0
52966: 6002 bras 5296a <_Timer_server_Schedule_operation_method+0xf2>
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
52968: 4280 clrl %d0 <== NOT EXECUTED
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
delta_interval += delta;
}
first_watchdog->delta_interval = delta_interval;
5296a: 2140 0010 movel %d0,%a0@(16)
}
ts->TOD_watchdogs.last_snapshot = snapshot;
5296e: 2541 0074 movel %d1,%a2@(116)
_ISR_Enable( level );
52972: 46c2 movew %d2,%sr
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
52974: 486b 0010 pea %a3@(16)
52978: 486a 0068 pea %a2@(104)
5297c: 4eb9 0005 6520 jsr 56520 <_Watchdog_Insert>
if ( !ts->active ) {
52982: 508f addql #8,%sp
52984: 102a 007c moveb %a2@(124),%d0
52988: 6608 bnes 52992 <_Timer_server_Schedule_operation_method+0x11a><== NEVER TAKEN
_Timer_server_Reset_tod_system_watchdog( ts );
5298a: 2f0a movel %a2,%sp@-
5298c: 4eba fcc6 jsr %pc@(52654 <_Timer_server_Reset_tod_system_watchdog>)
52990: 588f addql #4,%sp
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
}
}
52992: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
52998: 4e5e unlk %fp
if ( !ts->active ) {
_Timer_server_Reset_tod_system_watchdog( ts );
}
}
_Thread_Enable_dispatch();
5299a: 4ef9 0005 58b8 jmp 558b8 <_Thread_Enable_dispatch>
* server is not preemptible, so we must be in interrupt context here. No
* thread dispatch will happen until the timer server finishes its
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
529a0: 246a 0078 moveal %a2@(120),%a2
529a4: 2d4b 000c movel %a3,%fp@(12)
529a8: 2d4a 0008 movel %a2,%fp@(8)
}
}
529ac: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
529b2: 4e5e unlk %fp
* server is not preemptible, so we must be in interrupt context here. No
* thread dispatch will happen until the timer server finishes its
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
529b4: 4ef9 0005 31e8 jmp 531e8 <_Chain_Append>
0004a2f0 <_Timestamp64_Divide>:
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
4a2f0: 4e56 ffec linkw %fp,#-20
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
4a2f4: 206e 000c moveal %fp@(12),%a0
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
4a2f8: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
4a2fc: 266e 0010 moveal %fp@(16),%a3
4a300: 246e 0014 moveal %fp@(20),%a2
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
4a304: 2410 movel %a0@,%d2
4a306: 2628 0004 movel %a0@(4),%d3
4a30a: 2002 movel %d2,%d0
4a30c: 8083 orl %d3,%d0
4a30e: 6606 bnes 4a316 <_Timestamp64_Divide+0x26> <== ALWAYS TAKEN
*_ival_percentage = 0;
4a310: 4293 clrl %a3@ <== NOT EXECUTED
*_fval_percentage = 0;
4a312: 4292 clrl %a2@ <== NOT EXECUTED
return;
4a314: 605c bras 4a372 <_Timestamp64_Divide+0x82> <== NOT EXECUTED
* This looks odd but gives the results the proper precision.
*
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
4a316: 206e 0008 moveal %fp@(8),%a0
4a31a: 49f9 0005 b0a8 lea 5b0a8 <__divdi3>,%a4
4a320: 2f3c 0001 86a0 movel #100000,%sp@-
4a326: 42a7 clrl %sp@-
4a328: 2f28 0004 movel %a0@(4),%sp@-
4a32c: 2f10 movel %a0@,%sp@-
4a32e: 4eb9 0005 aff8 jsr 5aff8 <__muldi3>
4a334: 4fef 0010 lea %sp@(16),%sp
4a338: 2f03 movel %d3,%sp@-
4a33a: 2f02 movel %d2,%sp@-
4a33c: 2f01 movel %d1,%sp@-
4a33e: 2f00 movel %d0,%sp@-
4a340: 4e94 jsr %a4@
4a342: 4fef 0010 lea %sp@(16),%sp
4a346: 2400 movel %d0,%d2
*_ival_percentage = answer / 1000;
4a348: 4878 03e8 pea 3e8 <DBL_MANT_DIG+0x3b3>
* This looks odd but gives the results the proper precision.
*
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
4a34c: 2601 movel %d1,%d3
*_ival_percentage = answer / 1000;
4a34e: 42a7 clrl %sp@-
4a350: 2f01 movel %d1,%sp@-
4a352: 2f02 movel %d2,%sp@-
4a354: 4e94 jsr %a4@
4a356: 4fef 0010 lea %sp@(16),%sp
4a35a: 2681 movel %d1,%a3@
*_fval_percentage = answer % 1000;
4a35c: 4878 03e8 pea 3e8 <DBL_MANT_DIG+0x3b3>
4a360: 42a7 clrl %sp@-
4a362: 2f03 movel %d3,%sp@-
4a364: 2f02 movel %d2,%sp@-
4a366: 4eb9 0005 b508 jsr 5b508 <__moddi3>
4a36c: 4fef 0010 lea %sp@(16),%sp
4a370: 2481 movel %d1,%a2@
}
4a372: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4a378: 4e5e unlk %fp <== NOT EXECUTED
000491a0 <_User_extensions_Handler_initialization>:
void _User_extensions_Handler_initialization(void)
{
491a0: 4e56 fffc linkw %fp,#-4
uint32_t number_of_initial_extensions =
491a4: 2039 0005 b894 movel 5b894 <Configuration+0x40>,%d0
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
491aa: 6724 beqs 491d0 <_User_extensions_Handler_initialization+0x30><== NEVER TAKEN
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
491ac: 2200 movel %d0,%d1
491ae: e988 lsll #4,%d0
491b0: e589 lsll #2,%d1
{
uint32_t number_of_initial_extensions =
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
User_extensions_Switch_control *initial_extension_switch_controls =
491b2: 9081 subl %d1,%d0
491b4: 2f00 movel %d0,%sp@-
491b6: 4eb9 0004 94ee jsr 494ee <_Workspace_Allocate_or_fatal_error>
_Workspace_Allocate_or_fatal_error(
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
);
User_extensions_Switch_context ctx = { initial_extension_switch_controls };
491bc: 204e moveal %fp,%a0
491be: 2100 movel %d0,%a0@-
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
491c0: 487a ff9e pea %pc@(49160 <_User_extensions_Switch_visitor>)
491c4: 2f08 movel %a0,%sp@-
491c6: 4eb9 0004 90f6 jsr 490f6 <_User_extensions_Iterate>
491cc: 4fef 000c lea %sp@(12),%sp
}
}
491d0: 4e5e unlk %fp <== NOT EXECUTED
0004a584 <_Watchdog_Adjust>:
Watchdog_Interval units
)
{
ISR_Level level;
_ISR_Disable( level );
4a584: 327c 0700 moveaw #1792,%a1
4a588: 2209 movel %a1,%d1
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
4a58a: 4e56 ffec linkw %fp,#-20
4a58e: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
4a592: 246e 0008 moveal %fp@(8),%a2
4a596: 262e 000c movel %fp@(12),%d3
4a59a: 242e 0010 movel %fp@(16),%d2
ISR_Level level;
_ISR_Disable( level );
4a59e: 40c0 movew %sr,%d0
4a5a0: 8280 orl %d0,%d1
4a5a2: 46c1 movew %d1,%sr
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4a5a4: 264a moveal %a2,%a3
4a5a6: 205b moveal %a3@+,%a0
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
4a5a8: b7c8 cmpal %a0,%a3
4a5aa: 674c beqs 4a5f8 <_Watchdog_Adjust+0x74>
switch ( direction ) {
4a5ac: 4a83 tstl %d3
4a5ae: 673c beqs 4a5ec <_Watchdog_Adjust+0x68>
4a5b0: 7201 moveq #1,%d1
4a5b2: b283 cmpl %d3,%d1
4a5b4: 6642 bnes 4a5f8 <_Watchdog_Adjust+0x74> <== NEVER TAKEN
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
4a5b6: d5a8 0010 addl %d2,%a0@(16)
break;
4a5ba: 603c bras 4a5f8 <_Watchdog_Adjust+0x74>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4a5bc: 2052 moveal %a2@,%a0
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
4a5be: 2228 0010 movel %a0@(16),%d1
4a5c2: b282 cmpl %d2,%d1
4a5c4: 6308 blss 4a5ce <_Watchdog_Adjust+0x4a>
_Watchdog_First( header )->delta_interval -= units;
4a5c6: 9282 subl %d2,%d1
4a5c8: 2141 0010 movel %d1,%a0@(16)
break;
4a5cc: 602a bras 4a5f8 <_Watchdog_Adjust+0x74>
} else {
units -= _Watchdog_First( header )->delta_interval;
4a5ce: 9481 subl %d1,%d2
_Watchdog_First( header )->delta_interval = 1;
4a5d0: 7201 moveq #1,%d1
4a5d2: 2141 0010 movel %d1,%a0@(16)
_ISR_Enable( level );
4a5d6: 46c0 movew %d0,%sr
_Watchdog_Tickle( header );
4a5d8: 2f0a movel %a2,%sp@-
4a5da: 4e94 jsr %a4@
_ISR_Disable( level );
4a5dc: 2203 movel %d3,%d1
4a5de: 40c0 movew %sr,%d0
4a5e0: 8280 orl %d0,%d1
4a5e2: 46c1 movew %d1,%sr
if ( _Chain_Is_empty( header ) )
4a5e4: 588f addql #4,%sp
4a5e6: b7d2 cmpal %a2@,%a3
4a5e8: 660a bnes 4a5f4 <_Watchdog_Adjust+0x70>
4a5ea: 600c bras 4a5f8 <_Watchdog_Adjust+0x74>
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
_ISR_Enable( level );
_Watchdog_Tickle( header );
4a5ec: 49f9 0004 a7a4 lea 4a7a4 <_Watchdog_Tickle>,%a4
_ISR_Disable( level );
4a5f2: 2609 movel %a1,%d3
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
4a5f4: 4a82 tstl %d2
4a5f6: 66c4 bnes 4a5bc <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
4a5f8: 46c0 movew %d0,%sr
}
4a5fa: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4a600: 4e5e unlk %fp <== NOT EXECUTED
000492f8 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
492f8: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/watchdog.h>
Watchdog_States _Watchdog_Remove(
Watchdog_Control *the_watchdog
)
{
492fe: 4e56 0000 linkw %fp,#0
49302: 206e 0008 moveal %fp@(8),%a0
49306: 2f0a movel %a2,%sp@-
49308: 2f02 movel %d2,%sp@-
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
4930a: 40c1 movew %sr,%d1
4930c: 8081 orl %d1,%d0
4930e: 46c0 movew %d0,%sr
previous_state = the_watchdog->state;
49310: 2028 0008 movel %a0@(8),%d0
switch ( previous_state ) {
49314: 7401 moveq #1,%d2
49316: b480 cmpl %d0,%d2
49318: 670c beqs 49326 <_Watchdog_Remove+0x2e>
4931a: 6242 bhis 4935e <_Watchdog_Remove+0x66>
4931c: 143c 0003 moveb #3,%d2
49320: b480 cmpl %d0,%d2
49322: 653a bcss 4935e <_Watchdog_Remove+0x66> <== NEVER TAKEN
49324: 6006 bras 4932c <_Watchdog_Remove+0x34>
/*
* It is not actually on the chain so just change the state and
* the Insert operation we interrupted will be aborted.
*/
the_watchdog->state = WATCHDOG_INACTIVE;
49326: 42a8 0008 clrl %a0@(8)
break;
4932a: 6032 bras 4935e <_Watchdog_Remove+0x66>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
4932c: 2250 moveal %a0@,%a1
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
4932e: 42a8 0008 clrl %a0@(8)
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
49332: 4a91 tstl %a1@
49334: 6708 beqs 4933e <_Watchdog_Remove+0x46>
next_watchdog->delta_interval += the_watchdog->delta_interval;
49336: 2428 0010 movel %a0@(16),%d2
4933a: d5a9 0010 addl %d2,%a1@(16)
if ( _Watchdog_Sync_count )
4933e: 2479 0005 efb8 moveal 5efb8 <_Watchdog_Sync_count>,%a2
49344: 4a8a tstl %a2
49346: 670c beqs 49354 <_Watchdog_Remove+0x5c>
_Watchdog_Sync_level = _ISR_Nest_level;
49348: 45f9 0005 f318 lea 5f318 <_Per_CPU_Information+0x8>,%a2
4934e: 23d2 0005 ef5e movel %a2@,5ef5e <_Watchdog_Sync_level>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
49354: 2468 0004 moveal %a0@(4),%a2
next->previous = previous;
49358: 234a 0004 movel %a2,%a1@(4)
previous->next = next;
4935c: 2489 movel %a1,%a2@
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4935e: 2439 0005 efbc movel 5efbc <_Watchdog_Ticks_since_boot>,%d2
49364: 2142 0018 movel %d2,%a0@(24)
_ISR_Enable( level );
49368: 46c1 movew %d1,%sr
return( previous_state );
}
4936a: 241f movel %sp@+,%d2
4936c: 245f moveal %sp@+,%a2
4936e: 4e5e unlk %fp
...
00049374 <_Watchdog_Tickle>:
* See the comment in watchdoginsert.c and watchdogadjust.c
* about why it's safe not to declare header a pointer to
* volatile data - till, 2003/7
*/
_ISR_Disable( level );
49374: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
4937a: 4e56 ffe8 linkw %fp,#-24
4937e: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
49382: 286e 0008 moveal %fp@(8),%a4
* See the comment in watchdoginsert.c and watchdogadjust.c
* about why it's safe not to declare header a pointer to
* volatile data - till, 2003/7
*/
_ISR_Disable( level );
49386: 40c2 movew %sr,%d2
49388: 8082 orl %d2,%d0
4938a: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4938c: 264c moveal %a4,%a3
4938e: 245b moveal %a3@+,%a2
if ( _Chain_Is_empty( header ) )
49390: b7ca cmpal %a2,%a3
49392: 674c beqs 493e0 <_Watchdog_Tickle+0x6c>
* to be inserted has already had its delta_interval adjusted to 0, and
* so is added to the head of the chain with a delta_interval of 0.
*
* Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc)
*/
if (the_watchdog->delta_interval != 0) {
49394: 202a 0010 movel %a2@(16),%d0
49398: 6708 beqs 493a2 <_Watchdog_Tickle+0x2e> <== NEVER TAKEN
the_watchdog->delta_interval--;
4939a: 5380 subql #1,%d0
4939c: 2540 0010 movel %d0,%a2@(16)
if ( the_watchdog->delta_interval != 0 )
493a0: 663e bnes 493e0 <_Watchdog_Tickle+0x6c>
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
493a2: 4bf9 0004 92f8 lea 492f8 <_Watchdog_Remove>,%a5
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
493a8: 263c 0000 0700 movel #1792,%d3
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
493ae: 2f0a movel %a2,%sp@-
493b0: 4e95 jsr %a5@
_ISR_Enable( level );
493b2: 46c2 movew %d2,%sr
switch( watchdog_state ) {
493b4: 7202 moveq #2,%d1
493b6: 588f addql #4,%sp
493b8: b280 cmpl %d0,%d1
493ba: 6610 bnes 493cc <_Watchdog_Tickle+0x58> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
493bc: 2f2a 0024 movel %a2@(36),%sp@-
493c0: 2f2a 0020 movel %a2@(32),%sp@-
493c4: 206a 001c moveal %a2@(28),%a0
493c8: 4e90 jsr %a0@
the_watchdog->id,
the_watchdog->user_data
);
break;
493ca: 508f addql #8,%sp
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
493cc: 2003 movel %d3,%d0
493ce: 40c2 movew %sr,%d2
493d0: 8082 orl %d2,%d0
493d2: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
493d4: 2454 moveal %a4@,%a2
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
493d6: b7ca cmpal %a2,%a3
493d8: 6706 beqs 493e0 <_Watchdog_Tickle+0x6c>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
493da: 4aaa 0010 tstl %a2@(16)
493de: 67ce beqs 493ae <_Watchdog_Tickle+0x3a>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
493e0: 46c2 movew %d2,%sr
}
493e2: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
493e8: 4e5e unlk %fp <== NOT EXECUTED
000493ec <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
493ec: 4e56 ffe4 linkw %fp,#-28
493f0: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@
493f4: 2a2e 0010 movel %fp@(16),%d5
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
493f8: 4a39 0005 b886 tstb 5b886 <Configuration+0x32>
493fe: 6608 bnes 49408 <_Workspace_Handler_initialization+0x1c>
49400: 2439 0005 b858 movel 5b858 <Configuration+0x4>,%d2
49406: 6002 bras 4940a <_Workspace_Handler_initialization+0x1e>
49408: 4282 clrl %d2
4940a: d4b9 0005 b854 addl 5b854 <Configuration>,%d2
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
49410: 4284 clrl %d4
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
49412: 47f9 0004 735c lea 4735c <_Heap_Initialize>,%a3
for (i = 0; i < area_count; ++i) {
Heap_Area *area = &areas [i];
if ( do_zero ) {
memset( area->begin, 0, area->size );
49418: 49f9 0004 d828 lea 4d828 <memset>,%a4
4941e: 246e 0008 moveal %fp@(8),%a2
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
49422: 6070 bras 49494 <_Workspace_Handler_initialization+0xa8>
Heap_Area *area = &areas [i];
if ( do_zero ) {
49424: 4a39 0005 b884 tstb 5b884 <Configuration+0x30>
4942a: 670e beqs 4943a <_Workspace_Handler_initialization+0x4e>
memset( area->begin, 0, area->size );
4942c: 2f2a 0004 movel %a2@(4),%sp@-
49430: 42a7 clrl %sp@-
49432: 2f12 movel %a2@,%sp@-
49434: 4e94 jsr %a4@
49436: 4fef 000c lea %sp@(12),%sp
}
if ( area->size > overhead ) {
4943a: 262a 0004 movel %a2@(4),%d3
4943e: 700e moveq #14,%d0
49440: b083 cmpl %d3,%d0
49442: 644c bccs 49490 <_Workspace_Handler_initialization+0xa4>
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
49444: 4a39 0005 b885 tstb 5b885 <Configuration+0x31>
4944a: 661c bnes 49468 <_Workspace_Handler_initialization+0x7c>
size = area->size;
} else {
if ( remaining > 0 ) {
4944c: 4a82 tstl %d2
4944e: 6716 beqs 49466 <_Workspace_Handler_initialization+0x7a><== NEVER TAKEN
size = remaining < area->size - overhead ?
49450: 2003 movel %d3,%d0
49452: 0680 ffff fff2 addil #-14,%d0
remaining + overhead : area->size;
49458: b082 cmpl %d2,%d0
4945a: 630c blss 49468 <_Workspace_Handler_initialization+0x7c><== NEVER TAKEN
4945c: 2602 movel %d2,%d3
4945e: 0683 0000 000e addil #14,%d3
49464: 6002 bras 49468 <_Workspace_Handler_initialization+0x7c>
} else {
size = 0;
49466: 4283 clrl %d3 <== NOT EXECUTED
}
}
space_available = (*init_or_extend)(
49468: 4878 0004 pea 4 <CONTEXT_ARG>
4946c: 2f03 movel %d3,%sp@-
4946e: 2f12 movel %a2@,%sp@-
49470: 4879 0005 eee6 pea 5eee6 <_Workspace_Area>
49476: 4e93 jsr %a3@
);
area->begin = (char *) area->begin + size;
area->size -= size;
if ( space_available < remaining ) {
49478: 4fef 0010 lea %sp@(16),%sp
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
4947c: d792 addl %d3,%a2@
area->size -= size;
4947e: 97aa 0004 subl %d3,%a2@(4)
if ( space_available < remaining ) {
49482: b480 cmpl %d0,%d2
49484: 6306 blss 4948c <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN
remaining -= space_available;
49486: 9480 subl %d0,%d2 <== NOT EXECUTED
} else {
remaining = 0;
}
init_or_extend = extend;
49488: 2645 moveal %d5,%a3 <== NOT EXECUTED
4948a: 6004 bras 49490 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED
4948c: 2645 moveal %d5,%a3
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
} else {
remaining = 0;
4948e: 4282 clrl %d2
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
49490: 5284 addql #1,%d4
49492: 508a addql #8,%a2
49494: b8ae 000c cmpl %fp@(12),%d4
49498: 668a bnes 49424 <_Workspace_Handler_initialization+0x38>
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
4949a: 4a82 tstl %d2
4949c: 6710 beqs 494ae <_Workspace_Handler_initialization+0xc2>
_Internal_error_Occurred(
4949e: 4878 0002 pea 2 <DOUBLE_FLOAT>
494a2: 4878 0001 pea 1 <ADD>
494a6: 42a7 clrl %sp@-
494a8: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
);
}
}
494ae: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
494b4: 4e5e unlk %fp <== NOT EXECUTED
000462f4 <aio_cancel>:
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
462f4: 4e56 ffe8 linkw %fp,#-24
462f8: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
462fc: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46302: 47f9 0004 740c lea 4740c <pthread_mutex_lock>,%a3
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
46308: 242e 0008 movel %fp@(8),%d2
4630c: 246e 000c moveal %fp@(12),%a2
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
46310: 4e93 jsr %a3@
if (fcntl (fildes, F_GETFD) < 0) {
46312: 4878 0001 pea 1 <ADD>
46316: 2f02 movel %d2,%sp@-
46318: 4eb9 0004 c2b0 jsr 4c2b0 <fcntl>
4631e: 4fef 000c lea %sp@(12),%sp
46322: 4a80 tstl %d0
46324: 6c1c bges 46342 <aio_cancel+0x4e>
pthread_mutex_unlock(&aio_request_queue.mutex);
46326: 4879 0006 0f6c pea 60f6c <aio_request_queue>
4632c: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EBADF);
46332: 4eb9 0004 f05c jsr 4f05c <__errno>
46338: 7209 moveq #9,%d1
4633a: 2040 moveal %d0,%a0
4633c: 2081 movel %d1,%a0@
4633e: 6000 0134 braw 46474 <aio_cancel+0x180>
}
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
46342: 4a8a tstl %a2
46344: 6600 00ce bnew 46414 <aio_cancel+0x120>
AIO_printf ("Cancel all requests\n");
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
46348: 42a7 clrl %sp@-
4634a: 49f9 0004 693e lea 4693e <rtems_aio_search_fd>,%a4
46350: 2f02 movel %d2,%sp@-
46352: 4879 0006 0fb4 pea 60fb4 <aio_request_queue+0x48>
46358: 4e94 jsr %a4@
if (r_chain == NULL) {
4635a: 4fef 000c lea %sp@(12),%sp
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
AIO_printf ("Cancel all requests\n");
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
4635e: 2440 moveal %d0,%a2
if (r_chain == NULL) {
46360: 4a80 tstl %d0
46362: 6678 bnes 463dc <aio_cancel+0xe8> <== NEVER TAKEN
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
46364: 203c 0006 0fc4 movel #397252,%d0
4636a: b0b9 0006 0fc0 cmpl 60fc0 <aio_request_queue+0x54>,%d0
46370: 6714 beqs 46386 <aio_cancel+0x92> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
46372: 42a7 clrl %sp@-
46374: 2f02 movel %d2,%sp@-
46376: 4879 0006 0fc0 pea 60fc0 <aio_request_queue+0x54>
4637c: 4e94 jsr %a4@
if (r_chain == NULL) {
4637e: 4fef 000c lea %sp@(12),%sp
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
if (r_chain == NULL) {
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
46382: 2400 movel %d0,%d2
if (r_chain == NULL) {
46384: 6614 bnes 4639a <aio_cancel+0xa6>
pthread_mutex_unlock(&aio_request_queue.mutex);
46386: 4879 0006 0f6c pea 60f6c <aio_request_queue>
return AIO_ALLDONE;
4638c: 7402 moveq #2,%d2
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
if (r_chain == NULL) {
pthread_mutex_unlock(&aio_request_queue.mutex);
4638e: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
return AIO_ALLDONE;
46394: 588f addql #4,%sp
46396: 6000 0134 braw 464cc <aio_cancel+0x1d8>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
4639a: 2f00 movel %d0,%sp@-
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
pthread_mutex_destroy (&r_chain->mutex);
4639c: 2602 movel %d2,%d3
4639e: 0683 0000 001c addil #28,%d3
463a4: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract>
}
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
463aa: 2f02 movel %d2,%sp@-
463ac: 4eb9 0004 69ce jsr 469ce <rtems_aio_remove_fd>
pthread_mutex_destroy (&r_chain->mutex);
463b2: 2f03 movel %d3,%sp@-
463b4: 4eb9 0004 71d0 jsr 471d0 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->mutex);
463ba: 2f03 movel %d3,%sp@-
463bc: 4eb9 0004 6ec4 jsr 46ec4 <pthread_cond_destroy>
free (r_chain);
463c2: 2f02 movel %d2,%sp@-
463c4: 4eb9 0004 2e98 jsr 42e98 <free>
pthread_mutex_unlock (&aio_request_queue.mutex);
463ca: 4879 0006 0f6c pea 60f6c <aio_request_queue>
463d0: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
return AIO_CANCELED;
463d6: 4fef 0018 lea %sp@(24),%sp
463da: 6032 bras 4640e <aio_cancel+0x11a>
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
463dc: 2400 movel %d0,%d2
463de: 0682 0000 001c addil #28,%d2
463e4: 2f02 movel %d2,%sp@-
463e6: 4e93 jsr %a3@
463e8: 2f0a movel %a2,%sp@-
463ea: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
463f0: 2f0a movel %a2,%sp@-
pthread_mutex_unlock (&r_chain->mutex);
463f2: 45f9 0004 74a4 lea 474a4 <pthread_mutex_unlock>,%a2
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
463f8: 4eb9 0004 69ce jsr 469ce <rtems_aio_remove_fd>
pthread_mutex_unlock (&r_chain->mutex);
463fe: 2f02 movel %d2,%sp@-
46400: 4e92 jsr %a2@
pthread_mutex_unlock (&aio_request_queue.mutex);
46402: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46408: 4e92 jsr %a2@
return AIO_CANCELED;
4640a: 4fef 0014 lea %sp@(20),%sp
4640e: 4282 clrl %d2
46410: 6000 00ba braw 464cc <aio_cancel+0x1d8>
} else {
AIO_printf ("Cancel request\n");
if (aiocbp->aio_fildes != fildes) {
46414: 2612 movel %a2@,%d3
46416: b483 cmpl %d3,%d2
46418: 6702 beqs 4641c <aio_cancel+0x128>
4641a: 6040 bras 4645c <aio_cancel+0x168>
pthread_mutex_unlock (&aio_request_queue.mutex);
rtems_set_errno_and_return_minus_one (EINVAL);
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
4641c: 42a7 clrl %sp@-
4641e: 4bf9 0004 693e lea 4693e <rtems_aio_search_fd>,%a5
46424: 2f03 movel %d3,%sp@-
46426: 4879 0006 0fb4 pea 60fb4 <aio_request_queue+0x48>
4642c: 4e95 jsr %a5@
if (r_chain == NULL) {
4642e: 4fef 000c lea %sp@(12),%sp
if (aiocbp->aio_fildes != fildes) {
pthread_mutex_unlock (&aio_request_queue.mutex);
rtems_set_errno_and_return_minus_one (EINVAL);
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
46432: 2840 moveal %d0,%a4
if (r_chain == NULL) {
46434: 4a80 tstl %d0
46436: 6664 bnes 4649c <aio_cancel+0x1a8>
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
46438: 203c 0006 0fc4 movel #397252,%d0
4643e: b0b9 0006 0fc0 cmpl 60fc0 <aio_request_queue+0x54>,%d0
46444: 6700 ff40 beqw 46386 <aio_cancel+0x92>
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
46448: 42a7 clrl %sp@-
4644a: 2f03 movel %d3,%sp@-
4644c: 4879 0006 0fc0 pea 60fc0 <aio_request_queue+0x54>
46452: 4e95 jsr %a5@
if (r_chain == NULL) {
46454: 4fef 000c lea %sp@(12),%sp
46458: 4a80 tstl %d0
4645a: 661e bnes 4647a <aio_cancel+0x186>
pthread_mutex_unlock (&aio_request_queue.mutex);
4645c: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46462: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EINVAL);
46468: 4eb9 0004 f05c jsr 4f05c <__errno>
4646e: 2040 moveal %d0,%a0
46470: 7016 moveq #22,%d0
46472: 2080 movel %d0,%a0@
46474: 588f addql #4,%sp
46476: 74ff moveq #-1,%d2
46478: 6052 bras 464cc <aio_cancel+0x1d8>
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
4647a: 2f0a movel %a2,%sp@-
4647c: 2040 moveal %d0,%a0
4647e: 4868 0008 pea %a0@(8)
46482: 4eb9 0004 6a24 jsr 46a24 <rtems_aio_remove_req>
pthread_mutex_unlock (&aio_request_queue.mutex);
46488: 4879 0006 0f6c pea 60f6c <aio_request_queue>
rtems_set_errno_and_return_minus_one (EINVAL);
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
4648e: 2400 movel %d0,%d2
pthread_mutex_unlock (&aio_request_queue.mutex);
46490: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
return result;
46496: 4fef 000c lea %sp@(12),%sp
4649a: 6030 bras 464cc <aio_cancel+0x1d8>
return AIO_ALLDONE;
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
4649c: 2600 movel %d0,%d3
4649e: 0683 0000 001c addil #28,%d3
464a4: 2f03 movel %d3,%sp@-
464a6: 4e93 jsr %a3@
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
464a8: 2f0a movel %a2,%sp@-
464aa: 486c 0008 pea %a4@(8)
pthread_mutex_unlock (&r_chain->mutex);
464ae: 45f9 0004 74a4 lea 474a4 <pthread_mutex_unlock>,%a2
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
464b4: 4eb9 0004 6a24 jsr 46a24 <rtems_aio_remove_req>
464ba: 2400 movel %d0,%d2
pthread_mutex_unlock (&r_chain->mutex);
464bc: 2f03 movel %d3,%sp@-
464be: 4e92 jsr %a2@
pthread_mutex_unlock (&aio_request_queue.mutex);
464c0: 4879 0006 0f6c pea 60f6c <aio_request_queue>
464c6: 4e92 jsr %a2@
return result;
464c8: 4fef 0014 lea %sp@(20),%sp
}
return AIO_ALLDONE;
}
464cc: 2002 movel %d2,%d0
464ce: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
464d4: 4e5e unlk %fp <== NOT EXECUTED
000464e8 <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
464e8: 203c 0000 2000 movel #8192,%d0
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
464ee: 4e56 0000 linkw %fp,#0
464f2: 2f0a movel %a2,%sp@-
464f4: 246e 000c moveal %fp@(12),%a2
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
464f8: b0ae 0008 cmpl %fp@(8),%d0
464fc: 671a beqs 46518 <aio_fsync+0x30>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
464fe: 7216 moveq #22,%d1
46500: 70ff moveq #-1,%d0
46502: 2541 0030 movel %d1,%a2@(48)
46506: 2540 0034 movel %d0,%a2@(52)
4650a: 4eb9 0004 f05c jsr 4f05c <__errno>
46510: 2040 moveal %d0,%a0
46512: 7016 moveq #22,%d0
46514: 2080 movel %d0,%a0@
46516: 607e bras 46596 <aio_fsync+0xae>
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
46518: 4878 0003 pea 3 <DIVIDE>
4651c: 2f12 movel %a2@,%sp@-
4651e: 4eb9 0004 c2b0 jsr 4c2b0 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
46524: 508f addql #8,%sp
46526: 7203 moveq #3,%d1
46528: c081 andl %d1,%d0
4652a: 123c 0001 moveb #1,%d1
4652e: 5380 subql #1,%d0
46530: b280 cmpl %d0,%d1
46532: 641a bccs 4654e <aio_fsync+0x66>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
46534: 72ff moveq #-1,%d1
46536: 7009 moveq #9,%d0
46538: 2541 0034 movel %d1,%a2@(52)
4653c: 2540 0030 movel %d0,%a2@(48)
46540: 4eb9 0004 f05c jsr 4f05c <__errno>
46546: 7209 moveq #9,%d1
46548: 2040 moveal %d0,%a0
4654a: 2081 movel %d1,%a0@
4654c: 6048 bras 46596 <aio_fsync+0xae>
req = malloc (sizeof (rtems_aio_request));
4654e: 4878 0018 pea 18 <OPER2+0x4>
46552: 4eb9 0004 32b0 jsr 432b0 <malloc>
if (req == NULL)
46558: 588f addql #4,%sp
4655a: 4a80 tstl %d0
4655c: 661c bnes 4657a <aio_fsync+0x92> <== ALWAYS TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
4655e: 103c 000b moveb #11,%d0 <== NOT EXECUTED
46562: 72ff moveq #-1,%d1 <== NOT EXECUTED
46564: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED
46568: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED
4656c: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED
46572: 2040 moveal %d0,%a0 <== NOT EXECUTED
46574: 700b moveq #11,%d0 <== NOT EXECUTED
46576: 2080 movel %d0,%a0@ <== NOT EXECUTED
46578: 601c bras 46596 <aio_fsync+0xae> <== NOT EXECUTED
req->aiocbp = aiocbp;
4657a: 2040 moveal %d0,%a0
req->aiocbp->aio_lio_opcode = LIO_SYNC;
4657c: 7203 moveq #3,%d1
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
4657e: 214a 0014 movel %a2,%a0@(20)
req->aiocbp->aio_lio_opcode = LIO_SYNC;
46582: 2541 002c movel %d1,%a2@(44)
return rtems_aio_enqueue (req);
}
46586: 246e fffc moveal %fp@(-4),%a2
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
4658a: 2d40 0008 movel %d0,%fp@(8)
}
4658e: 4e5e unlk %fp
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
46590: 4ef9 0004 6a84 jmp 46a84 <rtems_aio_enqueue>
}
46596: 246e fffc moveal %fp@(-4),%a2
4659a: 70ff moveq #-1,%d0
4659c: 4e5e unlk %fp <== NOT EXECUTED
00046c84 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
46c84: 4e56 0000 linkw %fp,#0
46c88: 2f0a movel %a2,%sp@-
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
46c8a: 4878 0003 pea 3 <DIVIDE>
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
46c8e: 246e 0008 moveal %fp@(8),%a2
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
46c92: 2f12 movel %a2@,%sp@-
46c94: 4eb9 0004 c2b0 jsr 4c2b0 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
46c9a: 508f addql #8,%sp
46c9c: 7203 moveq #3,%d1
46c9e: c081 andl %d1,%d0
46ca0: 6722 beqs 46cc4 <aio_read+0x40> <== NEVER TAKEN
46ca2: 123c 0002 moveb #2,%d1
46ca6: b280 cmpl %d0,%d1
46ca8: 671a beqs 46cc4 <aio_read+0x40>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
46caa: 7009 moveq #9,%d0
46cac: 72ff moveq #-1,%d1
46cae: 2540 0030 movel %d0,%a2@(48)
46cb2: 2541 0034 movel %d1,%a2@(52)
46cb6: 4eb9 0004 f05c jsr 4f05c <__errno>
46cbc: 2040 moveal %d0,%a0
46cbe: 7009 moveq #9,%d0
46cc0: 2080 movel %d0,%a0@
46cc2: 6070 bras 46d34 <aio_read+0xb0>
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
46cc4: 4aaa 0014 tstl %a2@(20)
46cc8: 6702 beqs 46ccc <aio_read+0x48>
46cca: 6006 bras 46cd2 <aio_read+0x4e>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
46ccc: 4aaa 0004 tstl %a2@(4)
46cd0: 6a1a bpls 46cec <aio_read+0x68>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
46cd2: 72ff moveq #-1,%d1
46cd4: 7016 moveq #22,%d0
46cd6: 2541 0034 movel %d1,%a2@(52)
46cda: 2540 0030 movel %d0,%a2@(48)
46cde: 4eb9 0004 f05c jsr 4f05c <__errno>
46ce4: 7216 moveq #22,%d1
46ce6: 2040 moveal %d0,%a0
46ce8: 2081 movel %d1,%a0@
46cea: 6048 bras 46d34 <aio_read+0xb0>
req = malloc (sizeof (rtems_aio_request));
46cec: 4878 0018 pea 18 <OPER2+0x4>
46cf0: 4eb9 0004 32b0 jsr 432b0 <malloc>
if (req == NULL)
46cf6: 588f addql #4,%sp
46cf8: 4a80 tstl %d0
46cfa: 661c bnes 46d18 <aio_read+0x94> <== ALWAYS TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
46cfc: 103c 000b moveb #11,%d0 <== NOT EXECUTED
46d00: 72ff moveq #-1,%d1 <== NOT EXECUTED
46d02: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED
46d06: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED
46d0a: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED
46d10: 2040 moveal %d0,%a0 <== NOT EXECUTED
46d12: 700b moveq #11,%d0 <== NOT EXECUTED
46d14: 2080 movel %d0,%a0@ <== NOT EXECUTED
46d16: 601c bras 46d34 <aio_read+0xb0> <== NOT EXECUTED
req->aiocbp = aiocbp;
46d18: 2040 moveal %d0,%a0
req->aiocbp->aio_lio_opcode = LIO_READ;
46d1a: 7201 moveq #1,%d1
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
46d1c: 214a 0014 movel %a2,%a0@(20)
req->aiocbp->aio_lio_opcode = LIO_READ;
46d20: 2541 002c movel %d1,%a2@(44)
return rtems_aio_enqueue (req);
}
46d24: 246e fffc moveal %fp@(-4),%a2
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
46d28: 2d40 0008 movel %d0,%fp@(8)
}
46d2c: 4e5e unlk %fp
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
46d2e: 4ef9 0004 6a84 jmp 46a84 <rtems_aio_enqueue>
}
46d34: 246e fffc moveal %fp@(-4),%a2
46d38: 70ff moveq #-1,%d0
46d3a: 4e5e unlk %fp
...
00046d50 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
46d50: 4e56 0000 linkw %fp,#0
46d54: 2f0a movel %a2,%sp@-
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
46d56: 4878 0003 pea 3 <DIVIDE>
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
46d5a: 246e 0008 moveal %fp@(8),%a2
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
46d5e: 2f12 movel %a2@,%sp@-
46d60: 4eb9 0004 c2b0 jsr 4c2b0 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
46d66: 508f addql #8,%sp
46d68: 7203 moveq #3,%d1
46d6a: c081 andl %d1,%d0
46d6c: 123c 0001 moveb #1,%d1
46d70: 5380 subql #1,%d0
46d72: b280 cmpl %d0,%d1
46d74: 641a bccs 46d90 <aio_write+0x40>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
46d76: 7009 moveq #9,%d0
46d78: 72ff moveq #-1,%d1
46d7a: 2540 0030 movel %d0,%a2@(48)
46d7e: 2541 0034 movel %d1,%a2@(52)
46d82: 4eb9 0004 f05c jsr 4f05c <__errno>
46d88: 2040 moveal %d0,%a0
46d8a: 7009 moveq #9,%d0
46d8c: 2080 movel %d0,%a0@
46d8e: 6070 bras 46e00 <aio_write+0xb0>
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
46d90: 4aaa 0014 tstl %a2@(20)
46d94: 6702 beqs 46d98 <aio_write+0x48>
46d96: 6006 bras 46d9e <aio_write+0x4e>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
46d98: 4aaa 0004 tstl %a2@(4)
46d9c: 6a1a bpls 46db8 <aio_write+0x68>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
46d9e: 72ff moveq #-1,%d1
46da0: 7016 moveq #22,%d0
46da2: 2541 0034 movel %d1,%a2@(52)
46da6: 2540 0030 movel %d0,%a2@(48)
46daa: 4eb9 0004 f05c jsr 4f05c <__errno>
46db0: 7216 moveq #22,%d1
46db2: 2040 moveal %d0,%a0
46db4: 2081 movel %d1,%a0@
46db6: 6048 bras 46e00 <aio_write+0xb0>
req = malloc (sizeof (rtems_aio_request));
46db8: 4878 0018 pea 18 <OPER2+0x4>
46dbc: 4eb9 0004 32b0 jsr 432b0 <malloc>
if (req == NULL)
46dc2: 588f addql #4,%sp
46dc4: 4a80 tstl %d0
46dc6: 661c bnes 46de4 <aio_write+0x94> <== ALWAYS TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
46dc8: 103c 000b moveb #11,%d0 <== NOT EXECUTED
46dcc: 72ff moveq #-1,%d1 <== NOT EXECUTED
46dce: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED
46dd2: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED
46dd6: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED
46ddc: 2040 moveal %d0,%a0 <== NOT EXECUTED
46dde: 700b moveq #11,%d0 <== NOT EXECUTED
46de0: 2080 movel %d0,%a0@ <== NOT EXECUTED
46de2: 601c bras 46e00 <aio_write+0xb0> <== NOT EXECUTED
req->aiocbp = aiocbp;
46de4: 2040 moveal %d0,%a0
req->aiocbp->aio_lio_opcode = LIO_WRITE;
46de6: 7202 moveq #2,%d1
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
46de8: 214a 0014 movel %a2,%a0@(20)
req->aiocbp->aio_lio_opcode = LIO_WRITE;
46dec: 2541 002c movel %d1,%a2@(44)
return rtems_aio_enqueue (req);
}
46df0: 246e fffc moveal %fp@(-4),%a2
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
46df4: 2d40 0008 movel %d0,%fp@(8)
}
46df8: 4e5e unlk %fp
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
46dfa: 4ef9 0004 6a84 jmp 46a84 <rtems_aio_enqueue>
}
46e00: 246e fffc moveal %fp@(-4),%a2
46e04: 70ff moveq #-1,%d0
46e06: 4e5e unlk %fp
...
00045f98 <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
45f98: 4e56 ffec linkw %fp,#-20
45f9c: 222e 0008 movel %fp@(8),%d1
45fa0: 48d7 040c moveml %d2-%d3/%a2,%sp@
45fa4: 246e 000c moveal %fp@(12),%a2
if ( !tp )
45fa8: 4a8a tstl %a2
45faa: 660a bnes 45fb6 <clock_gettime+0x1e>
rtems_set_errno_and_return_minus_one( EINVAL );
45fac: 4eb9 0004 dd90 jsr 4dd90 <__errno>
45fb2: 6000 0088 braw 4603c <clock_gettime+0xa4>
if ( clock_id == CLOCK_REALTIME ) {
45fb6: 7001 moveq #1,%d0
45fb8: b081 cmpl %d1,%d0
45fba: 664c bnes 46008 <clock_gettime+0x70>
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
45fbc: 4879 0006 0a18 pea 60a18 <_TOD>
45fc2: 486e fff8 pea %fp@(-8)
45fc6: 4eb9 0004 7d50 jsr 47d50 <_TOD_Get_with_nanoseconds>
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
45fcc: 2040 moveal %d0,%a0
45fce: 2410 movel %a0@,%d2
45fd0: 2628 0004 movel %a0@(4),%d3
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
45fd4: 2f3c 3b9a ca00 movel #1000000000,%sp@-
45fda: 42a7 clrl %sp@-
45fdc: 2f03 movel %d3,%sp@-
45fde: 2f02 movel %d2,%sp@-
45fe0: 4eb9 0005 b250 jsr 5b250 <__divdi3>
45fe6: 4fef 0010 lea %sp@(16),%sp
45fea: 2481 movel %d1,%a2@
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
45fec: 2f3c 3b9a ca00 movel #1000000000,%sp@-
45ff2: 42a7 clrl %sp@-
45ff4: 2f03 movel %d3,%sp@-
45ff6: 2f02 movel %d2,%sp@-
45ff8: 4eb9 0005 b6b0 jsr 5b6b0 <__moddi3>
45ffe: 4fef 0018 lea %sp@(24),%sp
46002: 2541 0004 movel %d1,%a2@(4)
46006: 6010 bras 46018 <clock_gettime+0x80>
if ( clock_id == CLOCK_REALTIME ) {
_TOD_Get(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
46008: 7004 moveq #4,%d0
4600a: b081 cmpl %d1,%d0
4600c: 660e bnes 4601c <clock_gettime+0x84> <== ALWAYS TAKEN
_TOD_Get_uptime_as_timespec( tp );
4600e: 2f0a movel %a2,%sp@-
46010: 4eb9 0004 7d9c jsr 47d9c <_TOD_Get_uptime_as_timespec>
return 0;
46016: 588f addql #4,%sp
46018: 4280 clrl %d0
4601a: 6028 bras 46044 <clock_gettime+0xac>
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
4601c: 7002 moveq #2,%d0
4601e: b081 cmpl %d1,%d0
46020: 67ec beqs 4600e <clock_gettime+0x76>
46022: 41f9 0004 dd90 lea 4dd90 <__errno>,%a0
return 0;
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
46028: 103c 0003 moveb #3,%d0
4602c: b081 cmpl %d1,%d0
4602e: 660a bnes 4603a <clock_gettime+0xa2>
rtems_set_errno_and_return_minus_one( ENOSYS );
46030: 4e90 jsr %a0@
46032: 7258 moveq #88,%d1
46034: 2040 moveal %d0,%a0
46036: 2081 movel %d1,%a0@
46038: 6008 bras 46042 <clock_gettime+0xaa>
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
4603a: 4e90 jsr %a0@
4603c: 2040 moveal %d0,%a0
4603e: 7016 moveq #22,%d0
46040: 2080 movel %d0,%a0@
46042: 70ff moveq #-1,%d0
return 0;
}
46044: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
4604a: 4e5e unlk %fp
...
0005fdac <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
5fdac: 4e56 ffec linkw %fp,#-20
5fdb0: 202e 0008 movel %fp@(8),%d0
5fdb4: 48d7 040c moveml %d2-%d3/%a2,%sp@
5fdb8: 246e 000c moveal %fp@(12),%a2
if ( !tp )
5fdbc: 4a8a tstl %a2
5fdbe: 6602 bnes 5fdc2 <clock_settime+0x16> <== ALWAYS TAKEN
5fdc0: 6010 bras 5fdd2 <clock_settime+0x26> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
5fdc2: 7201 moveq #1,%d1
5fdc4: b280 cmpl %d0,%d1
5fdc6: 6660 bnes 5fe28 <clock_settime+0x7c>
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
5fdc8: 207c 21da e4ff moveal #567993599,%a0
5fdce: b1d2 cmpal %a2@,%a0
5fdd0: 6508 bcss 5fdda <clock_settime+0x2e>
rtems_set_errno_and_return_minus_one( EINVAL );
5fdd2: 4eb9 0006 e674 jsr 6e674 <__errno>
5fdd8: 606e bras 5fe48 <clock_settime+0x9c>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
5fdda: 2039 0009 756a movel 9756a <_Thread_Dispatch_disable_level>,%d0
++level;
5fde0: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
5fde2: 23c0 0009 756a movel %d0,9756a <_Thread_Dispatch_disable_level>
Timestamp64_Control *_time,
Timestamp64_Control _seconds,
Timestamp64_Control _nanoseconds
)
{
*_time = _seconds * 1000000000L + _nanoseconds;
5fde8: 2f3c 3b9a ca00 movel #1000000000,%sp@-
5fdee: 42a7 clrl %sp@-
5fdf0: 2f12 movel %a2@,%sp@-
5fdf2: 5bc0 smi %d0
5fdf4: 49c0 extbl %d0
5fdf6: 2f00 movel %d0,%sp@-
5fdf8: 4eb9 0008 6408 jsr 86408 <__muldi3>
5fdfe: 4fef 0010 lea %sp@(16),%sp
5fe02: 204e moveal %fp,%a0
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
5fe04: 262a 0004 movel %a2@(4),%d3
5fe08: 5bc2 smi %d2
5fe0a: 49c2 extbl %d2
5fe0c: d283 addl %d3,%d1
5fe0e: d182 addxl %d2,%d0
5fe10: 2101 movel %d1,%a0@-
5fe12: 2100 movel %d0,%a0@-
&tod_as_timestamp,
tod_as_timespec->tv_sec,
tod_as_timespec->tv_nsec
);
_TOD_Set_with_timestamp( &tod_as_timestamp );
5fe14: 2f08 movel %a0,%sp@-
5fe16: 4eb9 0006 0c10 jsr 60c10 <_TOD_Set_with_timestamp>
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
5fe1c: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
5fe22: 588f addql #4,%sp
5fe24: 4280 clrl %d0
5fe26: 6028 bras 5fe50 <clock_settime+0xa4>
5fe28: 41f9 0006 e674 lea 6e674 <__errno>,%a0
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
5fe2e: 7202 moveq #2,%d1
5fe30: b280 cmpl %d0,%d1
5fe32: 6602 bnes 5fe36 <clock_settime+0x8a>
5fe34: 6006 bras 5fe3c <clock_settime+0x90>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
5fe36: 7203 moveq #3,%d1
5fe38: b280 cmpl %d0,%d1
5fe3a: 660a bnes 5fe46 <clock_settime+0x9a>
rtems_set_errno_and_return_minus_one( ENOSYS );
5fe3c: 4e90 jsr %a0@
5fe3e: 7258 moveq #88,%d1
5fe40: 2040 moveal %d0,%a0
5fe42: 2081 movel %d1,%a0@
5fe44: 6008 bras 5fe4e <clock_settime+0xa2>
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
5fe46: 4e90 jsr %a0@
5fe48: 2040 moveal %d0,%a0
5fe4a: 7016 moveq #22,%d0
5fe4c: 2080 movel %d0,%a0@
5fe4e: 70ff moveq #-1,%d0
return 0;
}
5fe50: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
5fe56: 4e5e unlk %fp
...
0005af80 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
5af80: 4e56 ffcc linkw %fp,#-52
5af84: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
5af88: 242e 000c movel %fp@(12),%d2
5af8c: 246e 0010 moveal %fp@(16),%a2
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
5af90: 4eb9 0005 ac08 jsr 5ac08 <getpid>
5af96: b0ae 0008 cmpl %fp@(8),%d0
5af9a: 6710 beqs 5afac <killinfo+0x2c>
rtems_set_errno_and_return_minus_one( ESRCH );
5af9c: 4eb9 0004 cf98 jsr 4cf98 <__errno>
5afa2: 7603 moveq #3,%d3
5afa4: 2040 moveal %d0,%a0
5afa6: 2083 movel %d3,%a0@
5afa8: 6000 01ce braw 5b178 <killinfo+0x1f8>
/*
* Validate the signal passed.
*/
if ( !sig )
5afac: 4a82 tstl %d2
5afae: 6610 bnes 5afc0 <killinfo+0x40>
rtems_set_errno_and_return_minus_one( EINVAL );
5afb0: 4eb9 0004 cf98 jsr 4cf98 <__errno>
5afb6: 7416 moveq #22,%d2
5afb8: 2a40 moveal %d0,%a5
5afba: 2a82 movel %d2,%a5@
5afbc: 6000 01ba braw 5b178 <killinfo+0x1f8>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5afc0: 2002 movel %d2,%d0
5afc2: 5380 subql #1,%d0
if ( !is_valid_signo(sig) )
5afc4: 721f moveq #31,%d1
5afc6: b280 cmpl %d0,%d1
5afc8: 6410 bccs 5afda <killinfo+0x5a>
rtems_set_errno_and_return_minus_one( EINVAL );
5afca: 4eb9 0004 cf98 jsr 4cf98 <__errno>
5afd0: 7216 moveq #22,%d1
5afd2: 2040 moveal %d0,%a0
5afd4: 2081 movel %d1,%a0@
5afd6: 6000 01a0 braw 5b178 <killinfo+0x1f8>
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
5afda: 2202 movel %d2,%d1
5afdc: 2802 movel %d2,%d4
5afde: e589 lsll #2,%d1
5afe0: e98c lsll #4,%d4
5afe2: 9881 subl %d1,%d4
5afe4: 2044 moveal %d4,%a0
5afe6: d1fc 0005 f360 addal #389984,%a0
5afec: 7201 moveq #1,%d1
5afee: b290 cmpl %a0@,%d1
5aff0: 6700 01b2 beqw 5b1a4 <killinfo+0x224>
/*
* 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 ) )
5aff4: 123c 0008 moveb #8,%d1
5aff8: b282 cmpl %d2,%d1
5affa: 6710 beqs 5b00c <killinfo+0x8c>
5affc: 123c 0004 moveb #4,%d1
5b000: b282 cmpl %d2,%d1
5b002: 6708 beqs 5b00c <killinfo+0x8c>
5b004: 123c 000b moveb #11,%d1
5b008: b282 cmpl %d2,%d1
5b00a: 6616 bnes 5b022 <killinfo+0xa2>
return pthread_kill( pthread_self(), sig );
5b00c: 4eb9 0005 b38c jsr 5b38c <pthread_self>
5b012: 2f02 movel %d2,%sp@-
5b014: 2f00 movel %d0,%sp@-
5b016: 4eb9 0005 b2cc jsr 5b2cc <pthread_kill>
5b01c: 508f addql #8,%sp
5b01e: 6000 0186 braw 5b1a6 <killinfo+0x226>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
5b022: 7601 moveq #1,%d3
5b024: e1ab lsll %d0,%d3
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
5b026: 7001 moveq #1,%d0
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
5b028: 2d42 fff4 movel %d2,%fp@(-12)
siginfo->si_code = SI_USER;
5b02c: 2d40 fff8 movel %d0,%fp@(-8)
if ( !value ) {
5b030: 4a8a tstl %a2
5b032: 6606 bnes 5b03a <killinfo+0xba>
siginfo->si_value.sival_int = 0;
5b034: 42ae fffc clrl %fp@(-4)
5b038: 6004 bras 5b03e <killinfo+0xbe>
} else {
siginfo->si_value = *value;
5b03a: 2d52 fffc movel %a2@,%fp@(-4)
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
5b03e: 2039 0005 eed6 movel 5eed6 <_Thread_Dispatch_disable_level>,%d0
++level;
5b044: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
5b046: 23c0 0005 eed6 movel %d0,5eed6 <_Thread_Dispatch_disable_level>
*/
void _POSIX_signals_Manager_Initialization(void);
static inline void _POSIX_signals_Add_post_switch_extension(void)
{
_API_extensions_Add_post_switch( &_POSIX_signals_Post_switch );
5b04c: 4879 0005 d7a4 pea 5d7a4 <_POSIX_signals_Post_switch>
5b052: 4eb9 0004 6bc6 jsr 46bc6 <_API_extensions_Add_post_switch>
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
5b058: 2079 0005 f31e moveal 5f31e <_Per_CPU_Information+0xe>,%a0
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
5b05e: 588f addql #4,%sp
5b060: 2268 00fe moveal %a0@(254),%a1
5b064: 2029 00d0 movel %a1@(208),%d0
5b068: 4680 notl %d0
5b06a: c083 andl %d3,%d0
5b06c: 6600 00ae bnew 5b11c <killinfo+0x19c>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
5b070: 2079 0005 f4e4 moveal 5f4e4 <_POSIX_signals_Wait_queue>,%a0
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
5b076: 601c bras 5b094 <killinfo+0x114>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
5b078: 2003 movel %d3,%d0
5b07a: c0a8 0030 andl %a0@(48),%d0
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
5b07e: 2268 00fe moveal %a0@(254),%a1
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
5b082: 6600 0098 bnew 5b11c <killinfo+0x19c>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
5b086: 2029 00d0 movel %a1@(208),%d0
5b08a: 4680 notl %d0
5b08c: c083 andl %d3,%d0
5b08e: 6600 008c bnew 5b11c <killinfo+0x19c>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
5b092: 2050 moveal %a0@,%a0
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
5b094: b1fc 0005 f4e8 cmpal #390376,%a0
5b09a: 66dc bnes 5b078 <killinfo+0xf8>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
5b09c: 4280 clrl %d0
5b09e: 1039 0005 d5dc moveb 5d5dc <rtems_maximum_priority>,%d0
5b0a4: 45f9 0005 ee9a lea 5ee9a <_Objects_Information_table+0x8>,%a2
5b0aa: 5280 addql #1,%d0
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
5b0ac: 91c8 subal %a0,%a0
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and an API is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
5b0ae: 225a moveal %a2@+,%a1
5b0b0: 4a89 tstl %a1
5b0b2: 675c beqs 5b110 <killinfo+0x190> <== NEVER TAKEN
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
5b0b4: 2269 0004 moveal %a1@(4),%a1
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
5b0b8: 4281 clrl %d1
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
5b0ba: 7a01 moveq #1,%d5
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
5b0bc: 3229 000e movew %a1@(14),%d1
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
5b0c0: 2669 0018 moveal %a1@(24),%a3
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
5b0c4: 2841 moveal %d1,%a4
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
5b0c6: 588b addql #4,%a3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
5b0c8: 6042 bras 5b10c <killinfo+0x18c>
the_thread = (Thread_Control *) object_table[ index ];
5b0ca: 225b moveal %a3@+,%a1
if ( !the_thread )
5b0cc: 4a89 tstl %a1
5b0ce: 673a beqs 5b10a <killinfo+0x18a>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
5b0d0: 2229 0014 movel %a1@(20),%d1
5b0d4: b081 cmpl %d1,%d0
5b0d6: 6532 bcss 5b10a <killinfo+0x18a>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
5b0d8: 2a69 00fe moveal %a1@(254),%a5
5b0dc: 2c2d 00d0 movel %a5@(208),%d6
5b0e0: 4686 notl %d6
5b0e2: cc83 andl %d3,%d6
5b0e4: 6724 beqs 5b10a <killinfo+0x18a>
*
* 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 ) {
5b0e6: b081 cmpl %d1,%d0
5b0e8: 621c bhis 5b106 <killinfo+0x186>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
5b0ea: 4a88 tstl %a0
5b0ec: 671c beqs 5b10a <killinfo+0x18a> <== NEVER TAKEN
5b0ee: 2e28 0010 movel %a0@(16),%d7
5b0f2: 6716 beqs 5b10a <killinfo+0x18a> <== NEVER TAKEN
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
5b0f4: 2c29 0010 movel %a1@(16),%d6
5b0f8: 670c beqs 5b106 <killinfo+0x186>
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
5b0fa: 0807 001c btst #28,%d7
5b0fe: 660a bnes 5b10a <killinfo+0x18a>
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
5b100: 0806 001c btst #28,%d6
5b104: 6704 beqs 5b10a <killinfo+0x18a>
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
5b106: 2001 movel %d1,%d0
5b108: 2049 moveal %a1,%a0
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
5b10a: 5285 addql #1,%d5
5b10c: b9c5 cmpal %d5,%a4
5b10e: 64ba bccs 5b0ca <killinfo+0x14a>
* + 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++) {
5b110: b5fc 0005 eea2 cmpal #388770,%a2
5b116: 6696 bnes 5b0ae <killinfo+0x12e>
}
}
}
}
if ( interested ) {
5b118: 4a88 tstl %a0
5b11a: 671e beqs 5b13a <killinfo+0x1ba>
/*
* 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 ) ) {
5b11c: 486e fff4 pea %fp@(-12)
5b120: 2f02 movel %d2,%sp@-
5b122: 2f08 movel %a0,%sp@-
5b124: 4eb9 0005 b1d0 jsr 5b1d0 <_POSIX_signals_Unblock_thread>
5b12a: 4fef 000c lea %sp@(12),%sp
5b12e: 4a00 tstb %d0
5b130: 6708 beqs 5b13a <killinfo+0x1ba>
_Thread_Enable_dispatch();
5b132: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch>
5b138: 606a bras 5b1a4 <killinfo+0x224>
/*
* 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 );
5b13a: 2f03 movel %d3,%sp@-
5b13c: 4eb9 0005 b1b0 jsr 5b1b0 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
5b142: 588f addql #4,%sp
5b144: 41f9 0005 f358 lea 5f358 <_POSIX_signals_Vectors>,%a0
5b14a: 7002 moveq #2,%d0
5b14c: b0b0 4800 cmpl %a0@(00000000,%d4:l),%d0
5b150: 66e0 bnes 5b132 <killinfo+0x1b2>
psiginfo = (POSIX_signals_Siginfo_node *)
5b152: 4879 0005 f4d8 pea 5f4d8 <_POSIX_signals_Inactive_siginfo>
5b158: 4eb9 0004 6d5c jsr 46d5c <_Chain_Get>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
5b15e: 588f addql #4,%sp
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
5b160: 2440 moveal %d0,%a2
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
5b162: 4a80 tstl %d0
5b164: 6616 bnes 5b17c <killinfo+0x1fc>
_Thread_Enable_dispatch();
5b166: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
5b16c: 4eb9 0004 cf98 jsr 4cf98 <__errno>
5b172: 2040 moveal %d0,%a0
5b174: 700b moveq #11,%d0
5b176: 2080 movel %d0,%a0@
5b178: 70ff moveq #-1,%d0
5b17a: 602a bras 5b1a6 <killinfo+0x226>
}
psiginfo->Info = *siginfo;
5b17c: 4878 000c pea c <OPER1>
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
5b180: 0684 0005 f550 addil #390480,%d4
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
5b186: 486e fff4 pea %fp@(-12)
5b18a: 486a 0008 pea %a2@(8)
5b18e: 4eb9 0004 d7b8 jsr 4d7b8 <memcpy>
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
5b194: 2f0a movel %a2,%sp@-
5b196: 2f04 movel %d4,%sp@-
5b198: 4eb9 0004 6d24 jsr 46d24 <_Chain_Append>
5b19e: 4fef 0014 lea %sp@(20),%sp
5b1a2: 608e bras 5b132 <killinfo+0x1b2>
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
return 0;
5b1a4: 4280 clrl %d0
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5b1a6: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5
5b1ac: 4e5e unlk %fp <== NOT EXECUTED
0004a7bc <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
4a7bc: 4e56 0000 linkw %fp,#0
4a7c0: 206e 0008 moveal %fp@(8),%a0
4a7c4: 222e 000c movel %fp@(12),%d1
4a7c8: 2f02 movel %d2,%sp@-
if ( !attr || !attr->is_initialized )
4a7ca: 4a88 tstl %a0
4a7cc: 671e beqs 4a7ec <pthread_attr_setschedpolicy+0x30>
4a7ce: 4a90 tstl %a0@
4a7d0: 671a beqs 4a7ec <pthread_attr_setschedpolicy+0x30>
return EINVAL;
switch ( policy ) {
4a7d2: 7004 moveq #4,%d0
4a7d4: b081 cmpl %d1,%d0
4a7d6: 6518 bcss 4a7f0 <pthread_attr_setschedpolicy+0x34>
4a7d8: 103c 0001 moveb #1,%d0
4a7dc: 7417 moveq #23,%d2
4a7de: e3a8 lsll %d1,%d0
4a7e0: c082 andl %d2,%d0
4a7e2: 670c beqs 4a7f0 <pthread_attr_setschedpolicy+0x34><== NEVER TAKEN
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
4a7e4: 2141 0014 movel %d1,%a0@(20)
return 0;
4a7e8: 4280 clrl %d0
4a7ea: 600a bras 4a7f6 <pthread_attr_setschedpolicy+0x3a>
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
4a7ec: 7016 moveq #22,%d0
4a7ee: 6006 bras 4a7f6 <pthread_attr_setschedpolicy+0x3a>
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
4a7f0: 203c 0000 0086 movel #134,%d0
}
}
4a7f6: 241f movel %sp@+,%d2
4a7f8: 4e5e unlk %fp <== NOT EXECUTED
000464a0 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
464a0: 4e56 ffe4 linkw %fp,#-28
464a4: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
464a8: 266e 0008 moveal %fp@(8),%a3
464ac: 246e 0010 moveal %fp@(16),%a2
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
464b0: 4a8b tstl %a3
464b2: 6604 bnes 464b8 <pthread_barrier_init+0x18>
464b4: 6000 0094 braw 4654a <pthread_barrier_init+0xaa>
return EINVAL;
if ( count == 0 )
464b8: 4a8a tstl %a2
464ba: 6700 008e beqw 4654a <pthread_barrier_init+0xaa>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
464be: 206e 000c moveal %fp@(12),%a0
464c2: 4a88 tstl %a0
464c4: 6610 bnes 464d6 <pthread_barrier_init+0x36>
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
464c6: 240e movel %fp,%d2
464c8: 5182 subql #8,%d2
464ca: 2f02 movel %d2,%sp@-
464cc: 4eb9 0004 63e8 jsr 463e8 <pthread_barrierattr_init>
464d2: 588f addql #4,%sp
the_attr = &my_attr;
464d4: 2042 moveal %d2,%a0
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
464d6: 4a90 tstl %a0@
464d8: 6770 beqs 4654a <pthread_barrier_init+0xaa>
return EINVAL;
switch ( the_attr->process_shared ) {
464da: 4aa8 0004 tstl %a0@(4)
464de: 666a bnes 4654a <pthread_barrier_init+0xaa> <== NEVER TAKEN
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
464e0: 2039 0006 024a movel 6024a <_Thread_Dispatch_disable_level>,%d0
++level;
464e6: 5280 addql #1,%d0
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
464e8: 42ae fff0 clrl %fp@(-16)
the_attributes.maximum_count = count;
464ec: 2d4a fff4 movel %a2,%fp@(-12)
_Thread_Dispatch_disable_level = level;
464f0: 23c0 0006 024a movel %d0,6024a <_Thread_Dispatch_disable_level>
* This function allocates a barrier control block from
* the inactive chain of free barrier control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void )
{
return (POSIX_Barrier_Control *)
464f6: 4879 0006 0514 pea 60514 <_POSIX_Barrier_Information>
464fc: 4eb9 0004 847c jsr 4847c <_Objects_Allocate>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
46502: 588f addql #4,%sp
46504: 2440 moveal %d0,%a2
46506: 4a80 tstl %d0
46508: 660a bnes 46514 <pthread_barrier_init+0x74>
_Thread_Enable_dispatch();
4650a: 4eb9 0004 94f0 jsr 494f0 <_Thread_Enable_dispatch>
return EAGAIN;
46510: 700b moveq #11,%d0
46512: 6038 bras 4654c <pthread_barrier_init+0xac>
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
46514: 486e fff0 pea %fp@(-16)
46518: 486a 0010 pea %a2@(16)
4651c: 4eb9 0004 7b6c jsr 47b6c <_CORE_barrier_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
46522: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
46526: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
46528: 2079 0006 052c moveal 6052c <_POSIX_Barrier_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
4652e: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
46534: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
46538: 42aa 000c clrl %a2@(12)
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
4653c: 2680 movel %d0,%a3@
_Thread_Enable_dispatch();
4653e: 4eb9 0004 94f0 jsr 494f0 <_Thread_Enable_dispatch>
46544: 508f addql #8,%sp
return 0;
46546: 4280 clrl %d0
46548: 6002 bras 4654c <pthread_barrier_init+0xac>
switch ( the_attr->process_shared ) {
case PTHREAD_PROCESS_PRIVATE: /* only supported values */
break;
case PTHREAD_PROCESS_SHARED:
default:
return EINVAL;
4654a: 7016 moveq #22,%d0
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
return 0;
}
4654c: 4cee 0c04 ffe4 moveml %fp@(-28),%d2/%a2-%a3
46552: 4e5e unlk %fp
...
000463e8 <pthread_barrierattr_init>:
#include <rtems/system.h>
int pthread_barrierattr_init(
pthread_barrierattr_t *attr
)
{
463e8: 4e56 0000 linkw %fp,#0
463ec: 206e 0008 moveal %fp@(8),%a0
if ( !attr )
463f0: 4a88 tstl %a0
463f2: 670c beqs 46400 <pthread_barrierattr_init+0x18> <== NEVER TAKEN
return EINVAL;
attr->is_initialized = true;
463f4: 7001 moveq #1,%d0
attr->process_shared = PTHREAD_PROCESS_PRIVATE;
463f6: 42a8 0004 clrl %a0@(4)
)
{
if ( !attr )
return EINVAL;
attr->is_initialized = true;
463fa: 2080 movel %d0,%a0@
attr->process_shared = PTHREAD_PROCESS_PRIVATE;
return 0;
463fc: 4280 clrl %d0
463fe: 6002 bras 46402 <pthread_barrierattr_init+0x1a>
int pthread_barrierattr_init(
pthread_barrierattr_t *attr
)
{
if ( !attr )
return EINVAL;
46400: 7016 moveq #22,%d0
attr->is_initialized = true;
attr->process_shared = PTHREAD_PROCESS_PRIVATE;
return 0;
}
46402: 4e5e unlk %fp
...
00045eb8 <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
45eb8: 4e56 0000 linkw %fp,#0
45ebc: 2f03 movel %d3,%sp@-
45ebe: 262e 000c movel %fp@(12),%d3
45ec2: 2f02 movel %d2,%sp@-
45ec4: 242e 0008 movel %fp@(8),%d2
/*
* The POSIX standard does not address what to do when the routine
* is NULL. It also does not address what happens when we cannot
* allocate memory or anything else bad happens.
*/
if ( !routine )
45ec8: 6754 beqs 45f1e <pthread_cleanup_push+0x66>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
45eca: 2039 0005 fbe0 movel 5fbe0 <_Thread_Dispatch_disable_level>,%d0
++level;
45ed0: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
45ed2: 23c0 0005 fbe0 movel %d0,5fbe0 <_Thread_Dispatch_disable_level>
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
45ed8: 4878 0010 pea 10 <INVALID_OPERATION>
45edc: 4eb9 0004 9dd0 jsr 49dd0 <_Workspace_Allocate>
if ( handler ) {
45ee2: 588f addql #4,%sp
45ee4: 4a80 tstl %d0
45ee6: 6726 beqs 45f0e <pthread_cleanup_push+0x56> <== NEVER TAKEN
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
45ee8: 2079 0006 0026 moveal 60026 <_Per_CPU_Information+0xe>,%a0
handler_stack = &thread_support->Cancellation_Handlers;
45eee: 2228 00fe movel %a0@(254),%d1
handler->routine = routine;
45ef2: 2040 moveal %d0,%a0
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
if ( handler ) {
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
handler_stack = &thread_support->Cancellation_Handlers;
45ef4: 0681 0000 00e4 addil #228,%d1
handler->routine = routine;
45efa: 2142 0008 movel %d2,%a0@(8)
handler->arg = arg;
45efe: 2143 000c movel %d3,%a0@(12)
_Chain_Append( handler_stack, &handler->Node );
45f02: 2f00 movel %d0,%sp@-
45f04: 2f01 movel %d1,%sp@-
45f06: 4eb9 0004 7624 jsr 47624 <_Chain_Append>
45f0c: 508f addql #8,%sp
}
_Thread_Enable_dispatch();
}
45f0e: 242e fff8 movel %fp@(-8),%d2
45f12: 262e fffc movel %fp@(-4),%d3
45f16: 4e5e unlk %fp
handler->routine = routine;
handler->arg = arg;
_Chain_Append( handler_stack, &handler->Node );
}
_Thread_Enable_dispatch();
45f18: 4ef9 0004 8f88 jmp 48f88 <_Thread_Enable_dispatch>
}
45f1e: 242e fff8 movel %fp@(-8),%d2
45f22: 262e fffc movel %fp@(-4),%d3
45f26: 4e5e unlk %fp
...
00046ca0 <pthread_cond_init>:
*/
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
46ca0: 4e56 0000 linkw %fp,#0
46ca4: 2f0b movel %a3,%sp@-
46ca6: 266e 000c moveal %fp@(12),%a3
46caa: 2f0a movel %a2,%sp@-
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
46cac: 4a8b tstl %a3
46cae: 6606 bnes 46cb6 <pthread_cond_init+0x16>
else the_attr = &_POSIX_Condition_variables_Default_attributes;
46cb0: 47f9 0005 eb36 lea 5eb36 <_POSIX_Condition_variables_Default_attributes>,%a3
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
46cb6: 7001 moveq #1,%d0
46cb8: b0ab 0004 cmpl %a3@(4),%d0
46cbc: 677e beqs 46d3c <pthread_cond_init+0x9c> <== NEVER TAKEN
return EINVAL;
if ( !the_attr->is_initialized )
46cbe: 4a93 tstl %a3@
46cc0: 677a beqs 46d3c <pthread_cond_init+0x9c>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46cc2: 2039 0006 12f6 movel 612f6 <_Thread_Dispatch_disable_level>,%d0
++level;
46cc8: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
46cca: 23c0 0006 12f6 movel %d0,612f6 <_Thread_Dispatch_disable_level>
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
46cd0: 4879 0006 164c pea 6164c <_POSIX_Condition_variables_Information>
46cd6: 4eb9 0004 9288 jsr 49288 <_Objects_Allocate>
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
46cdc: 588f addql #4,%sp
46cde: 2440 moveal %d0,%a2
46ce0: 4a80 tstl %d0
46ce2: 660a bnes 46cee <pthread_cond_init+0x4e>
_Thread_Enable_dispatch();
46ce4: 4eb9 0004 a2fc jsr 4a2fc <_Thread_Enable_dispatch>
return ENOMEM;
46cea: 700c moveq #12,%d0
46cec: 6050 bras 46d3e <pthread_cond_init+0x9e>
}
the_cond->process_shared = the_attr->process_shared;
46cee: 256b 0004 0010 movel %a3@(4),%a2@(16)
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
46cf4: 42aa 0014 clrl %a2@(20)
_Thread_queue_Initialize(
46cf8: 4878 0074 pea 74 <DBL_MANT_DIG+0x3f>
46cfc: 2f3c 1000 0800 movel #268437504,%sp@-
46d02: 42a7 clrl %sp@-
46d04: 486a 0018 pea %a2@(24)
46d08: 4eb9 0004 a9c0 jsr 4a9c0 <_Thread_queue_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
46d0e: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
46d12: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
46d14: 2079 0006 1664 moveal 61664 <_POSIX_Condition_variables_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
46d1a: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
46d20: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
46d24: 206e 0008 moveal %fp@(8),%a0
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
46d28: 42aa 000c clrl %a2@(12)
46d2c: 2080 movel %d0,%a0@
_Thread_Enable_dispatch();
46d2e: 4eb9 0004 a2fc jsr 4a2fc <_Thread_Enable_dispatch>
return 0;
46d34: 4fef 0010 lea %sp@(16),%sp
46d38: 4280 clrl %d0
46d3a: 6002 bras 46d3e <pthread_cond_init+0x9e>
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
return EINVAL;
46d3c: 7016 moveq #22,%d0
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
return 0;
}
46d3e: 246e fff8 moveal %fp@(-8),%a2
46d42: 266e fffc moveal %fp@(-4),%a3
46d46: 4e5e unlk %fp
...
00046b40 <pthread_condattr_destroy>:
*/
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
46b40: 4e56 0000 linkw %fp,#0
46b44: 206e 0008 moveal %fp@(8),%a0
if ( !attr || attr->is_initialized == false )
46b48: 4a88 tstl %a0
46b4a: 670a beqs 46b56 <pthread_condattr_destroy+0x16>
46b4c: 4a90 tstl %a0@
46b4e: 6706 beqs 46b56 <pthread_condattr_destroy+0x16> <== NEVER TAKEN
return EINVAL;
attr->is_initialized = false;
46b50: 4290 clrl %a0@
return 0;
46b52: 4280 clrl %d0
46b54: 6002 bras 46b58 <pthread_condattr_destroy+0x18>
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
46b56: 7016 moveq #22,%d0
attr->is_initialized = false;
return 0;
}
46b58: 4e5e unlk %fp <== NOT EXECUTED
0004cc1c <pthread_exit>:
}
void pthread_exit(
void *value_ptr
)
{
4cc1c: 4e56 0000 linkw %fp,#0
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
4cc20: 2f2e 0008 movel %fp@(8),%sp@-
4cc24: 2f39 0005 f31e movel 5f31e <_Per_CPU_Information+0xe>,%sp@-
4cc2a: 4eb9 0004 cb38 jsr 4cb38 <_POSIX_Thread_Exit>
4cc30: 508f addql #8,%sp <== NOT EXECUTED
}
4cc32: 4e5e unlk %fp <== NOT EXECUTED
...
000483a0 <pthread_getschedparam>:
int pthread_getschedparam(
pthread_t thread,
int *policy,
struct sched_param *param
)
{
483a0: 4e56 fff0 linkw %fp,#-16
483a4: 48d7 1c00 moveml %a2-%a4,%sp@
483a8: 266e 000c moveal %fp@(12),%a3
483ac: 246e 0010 moveal %fp@(16),%a2
Objects_Locations location;
POSIX_API_Control *api;
register Thread_Control *the_thread;
if ( !policy || !param )
483b0: 4a8b tstl %a3
483b2: 6750 beqs 48404 <pthread_getschedparam+0x64> <== NEVER TAKEN
483b4: 4a8a tstl %a2
483b6: 674c beqs 48404 <pthread_getschedparam+0x64> <== NEVER TAKEN
return EINVAL;
the_thread = _Thread_Get( thread, &location );
483b8: 486e fffc pea %fp@(-4)
483bc: 2f2e 0008 movel %fp@(8),%sp@-
483c0: 4eb9 0004 b2a0 jsr 4b2a0 <_Thread_Get>
switch ( location ) {
483c6: 508f addql #8,%sp
register Thread_Control *the_thread;
if ( !policy || !param )
return EINVAL;
the_thread = _Thread_Get( thread, &location );
483c8: 2840 moveal %d0,%a4
switch ( location ) {
483ca: 4aae fffc tstl %fp@(-4)
483ce: 6638 bnes 48408 <pthread_getschedparam+0x68> <== NEVER TAKEN
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
483d0: 206c 00fe moveal %a4@(254),%a0
if ( policy )
*policy = api->schedpolicy;
483d4: 26a8 0084 movel %a0@(132),%a3@
if ( param ) {
*param = api->schedparam;
483d8: 4878 001c pea 1c <OPER2+0x8>
483dc: 4868 0088 pea %a0@(136)
483e0: 2f0a movel %a2,%sp@-
483e2: 4eb9 0005 01e0 jsr 501e0 <memcpy>
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{
return (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
483e8: 4280 clrl %d0
483ea: 1039 0006 1fdc moveb 61fdc <rtems_maximum_priority>,%d0
483f0: 90ac 0014 subl %a4@(20),%d0
483f4: 2480 movel %d0,%a2@
param->sched_priority =
_POSIX_Priority_From_core( the_thread->current_priority );
}
_Thread_Enable_dispatch();
483f6: 4eb9 0004 b280 jsr 4b280 <_Thread_Enable_dispatch>
483fc: 4fef 000c lea %sp@(12),%sp
return 0;
48400: 4280 clrl %d0
48402: 6006 bras 4840a <pthread_getschedparam+0x6a>
Objects_Locations location;
POSIX_API_Control *api;
register Thread_Control *the_thread;
if ( !policy || !param )
return EINVAL;
48404: 7016 moveq #22,%d0
48406: 6002 bras 4840a <pthread_getschedparam+0x6a>
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
48408: 7003 moveq #3,%d0
}
4840a: 4cee 1c00 fff0 moveml %fp@(-16),%a2-%a4
48410: 4e5e unlk %fp <== NOT EXECUTED
0005b2cc <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
5b2cc: 4e56 fff0 linkw %fp,#-16
5b2d0: 48d7 040c moveml %d2-%d3/%a2,%sp@
5b2d4: 242e 000c movel %fp@(12),%d2
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
5b2d8: 6602 bnes 5b2dc <pthread_kill+0x10>
5b2da: 600a bras 5b2e6 <pthread_kill+0x1a>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5b2dc: 2602 movel %d2,%d3
5b2de: 5383 subql #1,%d3
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5b2e0: 701f moveq #31,%d0
5b2e2: b083 cmpl %d3,%d0
5b2e4: 6410 bccs 5b2f6 <pthread_kill+0x2a>
rtems_set_errno_and_return_minus_one( EINVAL );
5b2e6: 4eb9 0004 cf98 jsr 4cf98 <__errno>
5b2ec: 7216 moveq #22,%d1
5b2ee: 2040 moveal %d0,%a0
5b2f0: 2081 movel %d1,%a0@
5b2f2: 6000 008c braw 5b380 <pthread_kill+0xb4>
the_thread = _Thread_Get( thread, &location );
5b2f6: 486e fffc pea %fp@(-4)
5b2fa: 2f2e 0008 movel %fp@(8),%sp@-
5b2fe: 4eb9 0004 871c jsr 4871c <_Thread_Get>
switch ( location ) {
5b304: 508f addql #8,%sp
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
5b306: 2440 moveal %d0,%a2
switch ( location ) {
5b308: 4aae fffc tstl %fp@(-4)
5b30c: 6666 bnes 5b374 <pthread_kill+0xa8> <== NEVER TAKEN
5b30e: 4879 0005 d7a4 pea 5d7a4 <_POSIX_signals_Post_switch>
5b314: 4eb9 0004 6bc6 jsr 46bc6 <_API_extensions_Add_post_switch>
* If sig == 0 then just validate arguments
*/
_POSIX_signals_Add_post_switch_extension();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
5b31a: 206a 00fe moveal %a2@(254),%a0
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
5b31e: 2002 movel %d2,%d0
5b320: 2202 movel %d2,%d1
5b322: 588f addql #4,%sp
5b324: e588 lsll #2,%d0
5b326: e989 lsll #4,%d1
5b328: 9280 subl %d0,%d1
5b32a: 0681 0005 f360 addil #389984,%d1
5b330: 7001 moveq #1,%d0
5b332: 2241 moveal %d1,%a1
5b334: b091 cmpl %a1@,%d0
5b336: 660a bnes 5b342 <pthread_kill+0x76>
_Thread_Enable_dispatch();
5b338: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch>
return 0;
5b33e: 4280 clrl %d0
5b340: 6040 bras 5b382 <pthread_kill+0xb6>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
5b342: 7001 moveq #1,%d0
5b344: e7a8 lsll %d3,%d0
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
5b346: 81a8 00d4 orl %d0,%a0@(212)
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
5b34a: 42a7 clrl %sp@-
5b34c: 2f02 movel %d2,%sp@-
5b34e: 2f0a movel %a2,%sp@-
5b350: 4eb9 0005 b1d0 jsr 5b1d0 <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
5b356: 4fef 000c lea %sp@(12),%sp
5b35a: 4ab9 0005 f318 tstl 5f318 <_Per_CPU_Information+0x8>
5b360: 67d6 beqs 5b338 <pthread_kill+0x6c>
5b362: b5f9 0005 f31e cmpal 5f31e <_Per_CPU_Information+0xe>,%a2
5b368: 66ce bnes 5b338 <pthread_kill+0x6c>
_Thread_Dispatch_necessary = true;
5b36a: 7001 moveq #1,%d0
5b36c: 13c0 0005 f31c moveb %d0,5f31c <_Per_CPU_Information+0xc>
5b372: 60c4 bras 5b338 <pthread_kill+0x6c>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
5b374: 4eb9 0004 cf98 jsr 4cf98 <__errno> <== NOT EXECUTED
5b37a: 2040 moveal %d0,%a0 <== NOT EXECUTED
5b37c: 7003 moveq #3,%d0 <== NOT EXECUTED
5b37e: 2080 movel %d0,%a0@ <== NOT EXECUTED
5b380: 70ff moveq #-1,%d0
}
5b382: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
5b388: 4e5e unlk %fp <== NOT EXECUTED
00047ec4 <pthread_mutex_timedlock>:
*/
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
47ec4: 4e56 fffc linkw %fp,#-4
47ec8: 2f03 movel %d3,%sp@-
47eca: 2f02 movel %d2,%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 );
47ecc: 486e fffc pea %fp@(-4)
47ed0: 2f2e 000c movel %fp@(12),%sp@-
47ed4: 4eb9 0004 7fa8 jsr 47fa8 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
47eda: 508f addql #8,%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 );
47edc: 2400 movel %d0,%d2
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
47ede: 7003 moveq #3,%d0
47ee0: b082 cmpl %d2,%d0
47ee2: 57c3 seq %d3
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
47ee4: 2f2e fffc movel %fp@(-4),%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 );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
47ee8: 4483 negl %d3
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
47eea: 4280 clrl %d0
47eec: 1003 moveb %d3,%d0
47eee: 2f00 movel %d0,%sp@-
47ef0: 2f2e 0008 movel %fp@(8),%sp@-
47ef4: 4eb9 0004 7dc8 jsr 47dc8 <_POSIX_Mutex_Lock_support>
* This service only gives us the option to block. We used a polling
* attempt to lock if the abstime was not in the future. If we did
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
47efa: 4fef 000c lea %sp@(12),%sp
47efe: 4a03 tstb %d3
47f00: 661a bnes 47f1c <pthread_mutex_timedlock+0x58>
47f02: 7210 moveq #16,%d1
47f04: b280 cmpl %d0,%d1
47f06: 6614 bnes 47f1c <pthread_mutex_timedlock+0x58>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
47f08: 4a82 tstl %d2
47f0a: 670e beqs 47f1a <pthread_mutex_timedlock+0x56> <== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
47f0c: 5382 subql #1,%d2
47f0e: 123c 0001 moveb #1,%d1
47f12: b282 cmpl %d2,%d1
47f14: 6506 bcss 47f1c <pthread_mutex_timedlock+0x58> <== NEVER TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
47f16: 7074 moveq #116,%d0
47f18: 6002 bras 47f1c <pthread_mutex_timedlock+0x58>
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
47f1a: 7016 moveq #22,%d0 <== NOT EXECUTED
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
47f1c: 242e fff4 movel %fp@(-12),%d2
47f20: 262e fff8 movel %fp@(-8),%d3
47f24: 4e5e unlk %fp <== NOT EXECUTED
00045d1c <pthread_mutexattr_gettype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
45d1c: 4e56 0000 linkw %fp,#0
45d20: 206e 0008 moveal %fp@(8),%a0
45d24: 226e 000c moveal %fp@(12),%a1
if ( !attr )
45d28: 4a88 tstl %a0
45d2a: 6710 beqs 45d3c <pthread_mutexattr_gettype+0x20>
return EINVAL;
if ( !attr->is_initialized )
45d2c: 4a90 tstl %a0@
45d2e: 670c beqs 45d3c <pthread_mutexattr_gettype+0x20>
return EINVAL;
if ( !type )
45d30: 4a89 tstl %a1
45d32: 6708 beqs 45d3c <pthread_mutexattr_gettype+0x20> <== NEVER TAKEN
return EINVAL;
*type = attr->type;
45d34: 22a8 0010 movel %a0@(16),%a1@
return 0;
45d38: 4280 clrl %d0
45d3a: 6002 bras 45d3e <pthread_mutexattr_gettype+0x22>
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
return EINVAL;
45d3c: 7016 moveq #22,%d0
if ( !type )
return EINVAL;
*type = attr->type;
return 0;
}
45d3e: 4e5e unlk %fp
...
00047b04 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
47b04: 4e56 0000 linkw %fp,#0
47b08: 206e 0008 moveal %fp@(8),%a0
47b0c: 202e 000c movel %fp@(12),%d0
if ( !attr || !attr->is_initialized )
47b10: 4a88 tstl %a0
47b12: 6712 beqs 47b26 <pthread_mutexattr_setpshared+0x22>
47b14: 4a90 tstl %a0@
47b16: 670e beqs 47b26 <pthread_mutexattr_setpshared+0x22>
return EINVAL;
switch ( pshared ) {
47b18: 7201 moveq #1,%d1
47b1a: b280 cmpl %d0,%d1
47b1c: 6508 bcss 47b26 <pthread_mutexattr_setpshared+0x22><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
47b1e: 2140 0004 movel %d0,%a0@(4)
return 0;
47b22: 4280 clrl %d0
47b24: 6002 bras 47b28 <pthread_mutexattr_setpshared+0x24>
default:
return EINVAL;
47b26: 7016 moveq #22,%d0
}
}
47b28: 4e5e unlk %fp <== NOT EXECUTED
00045d70 <pthread_mutexattr_settype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
45d70: 4e56 0000 linkw %fp,#0
45d74: 206e 0008 moveal %fp@(8),%a0
45d78: 202e 000c movel %fp@(12),%d0
if ( !attr || !attr->is_initialized )
45d7c: 4a88 tstl %a0
45d7e: 6712 beqs 45d92 <pthread_mutexattr_settype+0x22>
45d80: 4a90 tstl %a0@
45d82: 670e beqs 45d92 <pthread_mutexattr_settype+0x22> <== NEVER TAKEN
return EINVAL;
switch ( type ) {
45d84: 7203 moveq #3,%d1
45d86: b280 cmpl %d0,%d1
45d88: 6508 bcss 45d92 <pthread_mutexattr_settype+0x22>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
45d8a: 2140 0010 movel %d0,%a0@(16)
return 0;
45d8e: 4280 clrl %d0
45d90: 6002 bras 45d94 <pthread_mutexattr_settype+0x24>
default:
return EINVAL;
45d92: 7016 moveq #22,%d0
}
}
45d94: 4e5e unlk %fp <== NOT EXECUTED
00046878 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
46878: 4e56 fff0 linkw %fp,#-16
4687c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
46880: 246e 0008 moveal %fp@(8),%a2
46884: 266e 000c moveal %fp@(12),%a3
if ( !once_control || !init_routine )
46888: 4a8a tstl %a2
4688a: 674a beqs 468d6 <pthread_once+0x5e>
4688c: 4a8b tstl %a3
4688e: 6746 beqs 468d6 <pthread_once+0x5e>
return EINVAL;
if ( !once_control->init_executed ) {
46890: 4aaa 0004 tstl %a2@(4)
46894: 6644 bnes 468da <pthread_once+0x62>
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
46896: 240e movel %fp,%d2
46898: 5982 subql #4,%d2
4689a: 2f02 movel %d2,%sp@-
4689c: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb>
468a0: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb>
468a4: 4eb9 0004 73cc jsr 473cc <rtems_task_mode>
if ( !once_control->init_executed ) {
468aa: 4fef 000c lea %sp@(12),%sp
468ae: 4aaa 0004 tstl %a2@(4)
468b2: 660c bnes 468c0 <pthread_once+0x48> <== NEVER TAKEN
once_control->is_initialized = true;
468b4: 7001 moveq #1,%d0
468b6: 2480 movel %d0,%a2@
once_control->init_executed = true;
468b8: 7001 moveq #1,%d0
468ba: 2540 0004 movel %d0,%a2@(4)
(*init_routine)();
468be: 4e93 jsr %a3@
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
468c0: 2f02 movel %d2,%sp@-
468c2: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb>
468c6: 2f2e fffc movel %fp@(-4),%sp@-
468ca: 4eb9 0004 73cc jsr 473cc <rtems_task_mode>
468d0: 4fef 000c lea %sp@(12),%sp
468d4: 6004 bras 468da <pthread_once+0x62>
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
if ( !once_control || !init_routine )
return EINVAL;
468d6: 7016 moveq #22,%d0
468d8: 6002 bras 468dc <pthread_once+0x64>
once_control->init_executed = true;
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
}
return 0;
468da: 4280 clrl %d0
}
468dc: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
468e2: 4e5e unlk %fp
...
00046760 <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
46760: 4e56 fff4 linkw %fp,#-12
46764: 2f0b movel %a3,%sp@-
46766: 266e 0008 moveal %fp@(8),%a3
4676a: 2f0a movel %a2,%sp@-
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
4676c: 4a8b tstl %a3
4676e: 6604 bnes 46774 <pthread_rwlock_init+0x14>
46770: 6000 008a braw 467fc <pthread_rwlock_init+0x9c>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
46774: 206e 000c moveal %fp@(12),%a0
46778: 4a88 tstl %a0
4677a: 6610 bnes 4678c <pthread_rwlock_init+0x2c>
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
4677c: 45ee fff8 lea %fp@(-8),%a2
46780: 2f0a movel %a2,%sp@-
46782: 4eb9 0004 6de8 jsr 46de8 <pthread_rwlockattr_init>
46788: 588f addql #4,%sp
the_attr = &default_attr;
4678a: 204a moveal %a2,%a0
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
4678c: 4a90 tstl %a0@
4678e: 676c beqs 467fc <pthread_rwlock_init+0x9c> <== NEVER TAKEN
return EINVAL;
switch ( the_attr->process_shared ) {
46790: 4aa8 0004 tstl %a0@(4)
46794: 6666 bnes 467fc <pthread_rwlock_init+0x9c> <== NEVER TAKEN
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46796: 2039 0006 3440 movel 63440 <_Thread_Dispatch_disable_level>,%d0
++level;
4679c: 5280 addql #1,%d0
*/
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes(
CORE_RWLock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
4679e: 42ae fff4 clrl %fp@(-12)
_Thread_Dispatch_disable_level = level;
467a2: 23c0 0006 3440 movel %d0,63440 <_Thread_Dispatch_disable_level>
* This function allocates a RWLock control block from
* the inactive chain of free RWLock control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void )
{
return (POSIX_RWLock_Control *)
467a8: 4879 0006 35ae pea 635ae <_POSIX_RWLock_Information>
467ae: 4eb9 0004 8ea0 jsr 48ea0 <_Objects_Allocate>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
467b4: 588f addql #4,%sp
467b6: 2440 moveal %d0,%a2
467b8: 4a80 tstl %d0
467ba: 660a bnes 467c6 <pthread_rwlock_init+0x66>
_Thread_Enable_dispatch();
467bc: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
return EAGAIN;
467c2: 700b moveq #11,%d0
467c4: 6038 bras 467fe <pthread_rwlock_init+0x9e>
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
467c6: 486e fff4 pea %fp@(-12)
467ca: 486a 0010 pea %a2@(16)
467ce: 4eb9 0004 88c0 jsr 488c0 <_CORE_RWLock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
467d4: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
467d8: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
467da: 2079 0006 35c6 moveal 635c6 <_POSIX_RWLock_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
467e0: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
467e6: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
467ea: 42aa 000c clrl %a2@(12)
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
467ee: 2680 movel %d0,%a3@
_Thread_Enable_dispatch();
467f0: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
467f6: 508f addql #8,%sp
return 0;
467f8: 4280 clrl %d0
467fa: 6002 bras 467fe <pthread_rwlock_init+0x9e>
switch ( the_attr->process_shared ) {
case PTHREAD_PROCESS_PRIVATE: /* only supported values */
break;
case PTHREAD_PROCESS_SHARED:
default:
return EINVAL;
467fc: 7016 moveq #22,%d0
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
467fe: 246e ffec moveal %fp@(-20),%a2
46802: 266e fff0 moveal %fp@(-16),%a3
46806: 4e5e unlk %fp
...
000470d8 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
470d8: 4e56 ffec linkw %fp,#-20
470dc: 48d7 040c moveml %d2-%d3/%a2,%sp@
470e0: 246e 0008 moveal %fp@(8),%a2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
470e4: 4a8a tstl %a2
470e6: 6604 bnes 470ec <pthread_rwlock_timedrdlock+0x14>
470e8: 6000 0086 braw 47170 <pthread_rwlock_timedrdlock+0x98>
*
* 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 );
470ec: 486e fffc pea %fp@(-4)
470f0: 2f2e 000c movel %fp@(12),%sp@-
470f4: 4eb9 0004 cb58 jsr 4cb58 <_POSIX_Absolute_timeout_to_ticks>
470fa: 486e fff8 pea %fp@(-8)
470fe: 2400 movel %d0,%d2
47100: 2f12 movel %a2@,%sp@-
47102: 4879 0006 1ace pea 61ace <_POSIX_RWLock_Information>
47108: 4eb9 0004 99b4 jsr 499b4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
4710e: 4fef 0014 lea %sp@(20),%sp
47112: 4aae fff8 tstl %fp@(-8)
47116: 6658 bnes 47170 <pthread_rwlock_timedrdlock+0x98>
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
47118: 7203 moveq #3,%d1
4711a: b282 cmpl %d2,%d1
4711c: 57c3 seq %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
4711e: 42a7 clrl %sp@-
47120: 2f2e fffc movel %fp@(-4),%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 );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
47124: 4483 negl %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
47126: 4281 clrl %d1
47128: 1203 moveb %d3,%d1
4712a: 2040 moveal %d0,%a0
4712c: 2f01 movel %d1,%sp@-
4712e: 2f12 movel %a2@,%sp@-
47130: 4868 0010 pea %a0@(16)
47134: 4eb9 0004 8d2c jsr 48d2c <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
4713a: 4eb9 0004 a5b0 jsr 4a5b0 <_Thread_Enable_dispatch>
47140: 2079 0006 1de2 moveal 61de2 <_Per_CPU_Information+0xe>,%a0
if ( !do_wait ) {
47146: 4fef 0014 lea %sp@(20),%sp
4714a: 4a03 tstb %d3
4714c: 6614 bnes 47162 <pthread_rwlock_timedrdlock+0x8a>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
4714e: 7002 moveq #2,%d0
47150: b0a8 0034 cmpl %a0@(52),%d0
47154: 660c bnes 47162 <pthread_rwlock_timedrdlock+0x8a>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
47156: 4a82 tstl %d2
47158: 6716 beqs 47170 <pthread_rwlock_timedrdlock+0x98><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
4715a: 5382 subql #1,%d2
4715c: 7201 moveq #1,%d1
4715e: b282 cmpl %d2,%d1
47160: 6412 bccs 47174 <pthread_rwlock_timedrdlock+0x9c><== ALWAYS TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
47162: 2f28 0034 movel %a0@(52),%sp@-
47166: 4eb9 0004 7228 jsr 47228 <_POSIX_RWLock_Translate_core_RWLock_return_code>
4716c: 588f addql #4,%sp
4716e: 6006 bras 47176 <pthread_rwlock_timedrdlock+0x9e>
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
47170: 7016 moveq #22,%d0
47172: 6002 bras 47176 <pthread_rwlock_timedrdlock+0x9e>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
47174: 7074 moveq #116,%d0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
47176: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
4717c: 4e5e unlk %fp <== NOT EXECUTED
00047180 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
47180: 4e56 ffec linkw %fp,#-20
47184: 48d7 040c moveml %d2-%d3/%a2,%sp@
47188: 246e 0008 moveal %fp@(8),%a2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
4718c: 4a8a tstl %a2
4718e: 6604 bnes 47194 <pthread_rwlock_timedwrlock+0x14>
47190: 6000 0086 braw 47218 <pthread_rwlock_timedwrlock+0x98>
*
* 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 );
47194: 486e fffc pea %fp@(-4)
47198: 2f2e 000c movel %fp@(12),%sp@-
4719c: 4eb9 0004 cb58 jsr 4cb58 <_POSIX_Absolute_timeout_to_ticks>
471a2: 486e fff8 pea %fp@(-8)
471a6: 2400 movel %d0,%d2
471a8: 2f12 movel %a2@,%sp@-
471aa: 4879 0006 1ace pea 61ace <_POSIX_RWLock_Information>
471b0: 4eb9 0004 99b4 jsr 499b4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
471b6: 4fef 0014 lea %sp@(20),%sp
471ba: 4aae fff8 tstl %fp@(-8)
471be: 6658 bnes 47218 <pthread_rwlock_timedwrlock+0x98>
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
471c0: 7203 moveq #3,%d1
471c2: b282 cmpl %d2,%d1
471c4: 57c3 seq %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
471c6: 42a7 clrl %sp@-
471c8: 2f2e fffc movel %fp@(-4),%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 );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
471cc: 4483 negl %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
471ce: 4281 clrl %d1
471d0: 1203 moveb %d3,%d1
471d2: 2040 moveal %d0,%a0
471d4: 2f01 movel %d1,%sp@-
471d6: 2f12 movel %a2@,%sp@-
471d8: 4868 0010 pea %a0@(16)
471dc: 4eb9 0004 8dd8 jsr 48dd8 <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
471e2: 4eb9 0004 a5b0 jsr 4a5b0 <_Thread_Enable_dispatch>
471e8: 2079 0006 1de2 moveal 61de2 <_Per_CPU_Information+0xe>,%a0
if ( !do_wait &&
471ee: 4fef 0014 lea %sp@(20),%sp
471f2: 4a03 tstb %d3
471f4: 6614 bnes 4720a <pthread_rwlock_timedwrlock+0x8a>
471f6: 7002 moveq #2,%d0
471f8: b0a8 0034 cmpl %a0@(52),%d0
471fc: 660c bnes 4720a <pthread_rwlock_timedwrlock+0x8a>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
471fe: 4a82 tstl %d2
47200: 6716 beqs 47218 <pthread_rwlock_timedwrlock+0x98><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
47202: 5382 subql #1,%d2
47204: 7201 moveq #1,%d1
47206: b282 cmpl %d2,%d1
47208: 6412 bccs 4721c <pthread_rwlock_timedwrlock+0x9c><== ALWAYS TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
4720a: 2f28 0034 movel %a0@(52),%sp@-
4720e: 4eb9 0004 7228 jsr 47228 <_POSIX_RWLock_Translate_core_RWLock_return_code>
47214: 588f addql #4,%sp
47216: 6006 bras 4721e <pthread_rwlock_timedwrlock+0x9e>
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
47218: 7016 moveq #22,%d0
4721a: 6002 bras 4721e <pthread_rwlock_timedwrlock+0x9e>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
4721c: 7074 moveq #116,%d0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
4721e: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
47224: 4e5e unlk %fp <== NOT EXECUTED
00047934 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
47934: 4e56 0000 linkw %fp,#0
47938: 206e 0008 moveal %fp@(8),%a0
4793c: 202e 000c movel %fp@(12),%d0
if ( !attr )
47940: 4a88 tstl %a0
47942: 6712 beqs 47956 <pthread_rwlockattr_setpshared+0x22>
return EINVAL;
if ( !attr->is_initialized )
47944: 4a90 tstl %a0@
47946: 670e beqs 47956 <pthread_rwlockattr_setpshared+0x22>
return EINVAL;
switch ( pshared ) {
47948: 7201 moveq #1,%d1
4794a: b280 cmpl %d0,%d1
4794c: 6508 bcss 47956 <pthread_rwlockattr_setpshared+0x22><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
4794e: 2140 0004 movel %d0,%a0@(4)
return 0;
47952: 4280 clrl %d0
47954: 6002 bras 47958 <pthread_rwlockattr_setpshared+0x24>
default:
return EINVAL;
47956: 7016 moveq #22,%d0
}
}
47958: 4e5e unlk %fp <== NOT EXECUTED
00048778 <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
48778: 4e56 ffe0 linkw %fp,#-32
4877c: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
48780: 242e 000c movel %fp@(12),%d2
48784: 282e 0010 movel %fp@(16),%d4
int rc;
/*
* Check all the parameters
*/
if ( !param )
48788: 6700 00d8 beqw 48862 <pthread_setschedparam+0xea>
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
4878c: 486e fff8 pea %fp@(-8)
48790: 486e fff4 pea %fp@(-12)
48794: 2f04 movel %d4,%sp@-
48796: 2f02 movel %d2,%sp@-
48798: 4eb9 0004 d9c4 jsr 4d9c4 <_POSIX_Thread_Translate_sched_param>
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
4879e: 4fef 0010 lea %sp@(16),%sp
* Check all the parameters
*/
if ( !param )
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
487a2: 2600 movel %d0,%d3
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
487a4: 6600 00c2 bnew 48868 <pthread_setschedparam+0xf0>
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
487a8: 486e fffc pea %fp@(-4)
487ac: 2f2e 0008 movel %fp@(8),%sp@-
487b0: 4eb9 0004 b2a0 jsr 4b2a0 <_Thread_Get>
switch ( location ) {
487b6: 508f addql #8,%sp
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
487b8: 2640 moveal %d0,%a3
switch ( location ) {
487ba: 4aae fffc tstl %fp@(-4)
487be: 6600 00a6 bnew 48866 <pthread_setschedparam+0xee>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
487c2: 246b 00fe moveal %a3@(254),%a2
if ( api->schedpolicy == SCHED_SPORADIC )
487c6: 7004 moveq #4,%d0
487c8: b0aa 0084 cmpl %a2@(132),%d0
487cc: 660c bnes 487da <pthread_setschedparam+0x62>
(void) _Watchdog_Remove( &api->Sporadic_timer );
487ce: 486a 00a8 pea %a2@(168)
487d2: 4eb9 0004 c028 jsr 4c028 <_Watchdog_Remove>
487d8: 588f addql #4,%sp
api->schedpolicy = policy;
487da: 2542 0084 movel %d2,%a2@(132)
api->schedparam = *param;
487de: 4878 001c pea 1c <OPER2+0x8>
487e2: 2f04 movel %d4,%sp@-
487e4: 486a 0088 pea %a2@(136)
487e8: 4eb9 0005 01e0 jsr 501e0 <memcpy>
the_thread->budget_algorithm = budget_algorithm;
487ee: 276e fff4 0076 movel %fp@(-12),%a3@(118)
the_thread->budget_callout = budget_callout;
switch ( api->schedpolicy ) {
487f4: 4fef 000c lea %sp@(12),%sp
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
the_thread->budget_algorithm = budget_algorithm;
the_thread->budget_callout = budget_callout;
487f8: 276e fff8 007a movel %fp@(-8),%a3@(122)
switch ( api->schedpolicy ) {
487fe: 4a82 tstl %d2
48800: 6d58 blts 4885a <pthread_setschedparam+0xe2> <== NEVER TAKEN
48802: 7002 moveq #2,%d0
48804: b082 cmpl %d2,%d0
48806: 6c0a bges 48812 <pthread_setschedparam+0x9a>
48808: 103c 0004 moveb #4,%d0
4880c: b082 cmpl %d2,%d0
4880e: 664a bnes 4885a <pthread_setschedparam+0xe2> <== NEVER TAKEN
48810: 602a bras 4883c <pthread_setschedparam+0xc4>
48812: 4280 clrl %d0
48814: 1039 0006 1fdc moveb 61fdc <rtems_maximum_priority>,%d0
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
4881a: 41f9 0006 38de lea 638de <_Thread_Ticks_per_timeslice>,%a0
48820: 90aa 0088 subl %a2@(136),%d0
48824: 2750 0072 movel %a0@,%a3@(114)
the_thread->real_priority =
48828: 2740 0018 movel %d0,%a3@(24)
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
4882c: 4878 0001 pea 1 <ADD>
48830: 2f00 movel %d0,%sp@-
48832: 2f0b movel %a3,%sp@-
48834: 4eb9 0004 ae30 jsr 4ae30 <_Thread_Change_priority>
4883a: 601a bras 48856 <pthread_setschedparam+0xde>
true
);
break;
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
4883c: 256a 0088 00a4 movel %a2@(136),%a2@(164)
_Watchdog_Remove( &api->Sporadic_timer );
48842: 486a 00a8 pea %a2@(168)
48846: 4eb9 0004 c028 jsr 4c028 <_Watchdog_Remove>
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
4884c: 2f0b movel %a3,%sp@-
4884e: 42a7 clrl %sp@-
48850: 4eb9 0004 8654 jsr 48654 <_POSIX_Threads_Sporadic_budget_TSR>
break;
48856: 4fef 000c lea %sp@(12),%sp
}
_Thread_Enable_dispatch();
4885a: 4eb9 0004 b280 jsr 4b280 <_Thread_Enable_dispatch>
48860: 6006 bras 48868 <pthread_setschedparam+0xf0>
/*
* Check all the parameters
*/
if ( !param )
return EINVAL;
48862: 7616 moveq #22,%d3
48864: 6002 bras 48868 <pthread_setschedparam+0xf0>
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
48866: 7603 moveq #3,%d3
}
48868: 2003 movel %d3,%d0
4886a: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3
48870: 4e5e unlk %fp <== NOT EXECUTED
000463cc <pthread_spin_unlock>:
*/
int pthread_spin_unlock(
pthread_spinlock_t *spinlock
)
{
463cc: 4e56 fffc linkw %fp,#-4
463d0: 206e 0008 moveal %fp@(8),%a0
463d4: 2f02 movel %d2,%sp@-
POSIX_Spinlock_Control *the_spinlock = NULL;
Objects_Locations location;
CORE_spinlock_Status status;
if ( !spinlock )
463d6: 4a88 tstl %a0
463d8: 673c beqs 46416 <pthread_spin_unlock+0x4a> <== NEVER TAKEN
463da: 486e fffc pea %fp@(-4)
463de: 2f10 movel %a0@,%sp@-
463e0: 4879 0005 fdfe pea 5fdfe <_POSIX_Spinlock_Information>
463e6: 4eb9 0004 82e0 jsr 482e0 <_Objects_Get>
return EINVAL;
the_spinlock = _POSIX_Spinlock_Get( spinlock, &location );
switch ( location ) {
463ec: 4fef 000c lea %sp@(12),%sp
463f0: 4aae fffc tstl %fp@(-4)
463f4: 6620 bnes 46416 <pthread_spin_unlock+0x4a> <== NEVER TAKEN
case OBJECTS_LOCAL:
status = _CORE_spinlock_Release( &the_spinlock->Spinlock );
463f6: 2040 moveal %d0,%a0
463f8: 4868 0010 pea %a0@(16)
463fc: 4eb9 0004 7878 jsr 47878 <_CORE_spinlock_Release>
46402: 2400 movel %d0,%d2
_Thread_Enable_dispatch();
46404: 4eb9 0004 8edc jsr 48edc <_Thread_Enable_dispatch>
return _POSIX_Spinlock_Translate_core_spinlock_return_code( status );
4640a: 2f02 movel %d2,%sp@-
4640c: 4eb9 0004 6358 jsr 46358 <_POSIX_Spinlock_Translate_core_spinlock_return_code>
46412: 508f addql #8,%sp
46414: 6002 bras 46418 <pthread_spin_unlock+0x4c>
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
46416: 7016 moveq #22,%d0
}
46418: 242e fff8 movel %fp@(-8),%d2
4641c: 4e5e unlk %fp <== NOT EXECUTED
00046618 <pthread_testcancel>:
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
46618: 4e56 0000 linkw %fp,#0
4661c: 2f02 movel %d2,%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() )
4661e: 4ab9 0006 0020 tstl 60020 <_Per_CPU_Information+0x8>
46624: 6646 bnes 4666c <pthread_testcancel+0x54> <== NEVER TAKEN
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
46626: 2079 0006 0026 moveal 60026 <_Per_CPU_Information+0xe>,%a0
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4662c: 2039 0005 fbe0 movel 5fbe0 <_Thread_Dispatch_disable_level>,%d0
++level;
46632: 5280 addql #1,%d0
46634: 2068 00fe moveal %a0@(254),%a0
_Thread_Dispatch_disable_level = level;
46638: 23c0 0005 fbe0 movel %d0,5fbe0 <_Thread_Dispatch_disable_level>
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
4663e: 4aa8 00d8 tstl %a0@(216)
46642: 660a bnes 4664e <pthread_testcancel+0x36> <== NEVER TAKEN
46644: 4aa8 00e0 tstl %a0@(224)
46648: 56c2 sne %d2
4664a: 4482 negl %d2
4664c: 6002 bras 46650 <pthread_testcancel+0x38>
*/
void pthread_testcancel( void )
{
POSIX_API_Control *thread_support;
bool cancel = false;
4664e: 4202 clrb %d2 <== NOT EXECUTED
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
46650: 4eb9 0004 8f88 jsr 48f88 <_Thread_Enable_dispatch>
if ( cancel )
46656: 4a02 tstb %d2
46658: 6712 beqs 4666c <pthread_testcancel+0x54>
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
4665a: 4878 ffff pea ffffffff <LESS>
4665e: 2f39 0006 0026 movel 60026 <_Per_CPU_Information+0xe>,%sp@-
46664: 4eb9 0004 b764 jsr 4b764 <_POSIX_Thread_Exit>
4666a: 508f addql #8,%sp <== NOT EXECUTED
}
4666c: 242e fffc movel %fp@(-4),%d2
46670: 4e5e unlk %fp <== NOT EXECUTED
00046a84 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
46a84: 4e56 ffc8 linkw %fp,#-56
46a88: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
46a8c: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46a92: 49f9 0004 740c lea 4740c <pthread_mutex_lock>,%a4
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
46a98: 246e 0008 moveal %fp@(8),%a2
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
46a9c: 4e94 jsr %a4@
if (result != 0) {
46a9e: 588f addql #4,%sp
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
46aa0: 2400 movel %d0,%d2
if (result != 0) {
46aa2: 670c beqs 46ab0 <rtems_aio_enqueue+0x2c> <== ALWAYS TAKEN
free (req);
46aa4: 2f0a movel %a2,%sp@- <== NOT EXECUTED
46aa6: 4eb9 0004 2e98 jsr 42e98 <free> <== NOT EXECUTED
46aac: 6000 01c6 braw 46c74 <rtems_aio_enqueue+0x1f0> <== NOT EXECUTED
return result;
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
46ab0: 47f9 0004 7c20 lea 47c20 <pthread_self>,%a3
46ab6: 4e93 jsr %a3@
46ab8: 486e ffe4 pea %fp@(-28)
46abc: 486e ffe0 pea %fp@(-32)
46ac0: 2f00 movel %d0,%sp@-
46ac2: 4eb9 0004 785c jsr 4785c <pthread_getschedparam>
req->caller_thread = pthread_self ();
46ac8: 4e93 jsr %a3@
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
46aca: 206a 0014 moveal %a2@(20),%a0
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
46ace: 7277 moveq #119,%d1
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
46ad0: 4fef 000c lea %sp@(12),%sp
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
46ad4: 2540 0010 movel %d0,%a2@(16)
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
46ad8: 202e ffe4 movel %fp@(-28),%d0
46adc: 90a8 0014 subl %a0@(20),%d0
req->policy = policy;
46ae0: 256e ffe0 0008 movel %fp@(-32),%a2@(8)
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
46ae6: 2540 000c movel %d0,%a2@(12)
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
46aea: 2141 0030 movel %d1,%a0@(48)
req->aiocbp->return_value = 0;
46aee: 42a8 0034 clrl %a0@(52)
if ((aio_request_queue.idle_threads == 0) &&
46af2: 4ab9 0006 0fd4 tstl 60fd4 <aio_request_queue+0x68>
46af8: 6600 00b6 bnew 46bb0 <rtems_aio_enqueue+0x12c>
46afc: 7004 moveq #4,%d0
46afe: b0b9 0006 0fd0 cmpl 60fd0 <aio_request_queue+0x64>,%d0
46b04: 6d00 00aa bltw 46bb0 <rtems_aio_enqueue+0x12c>
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
46b08: 4878 0001 pea 1 <ADD>
46b0c: 2f10 movel %a0@,%sp@-
46b0e: 4879 0006 0fb4 pea 60fb4 <aio_request_queue+0x48>
46b14: 4eb9 0004 693e jsr 4693e <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
46b1a: 4fef 000c lea %sp@(12),%sp
46b1e: 7201 moveq #1,%d1
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
46b20: 2640 moveal %d0,%a3
if (r_chain->new_fd == 1) {
46b22: b2ab 0018 cmpl %a3@(24),%d1
46b26: 6664 bnes 46b8c <rtems_aio_enqueue+0x108>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
46b28: 2f0a movel %a2,%sp@-
46b2a: 486b 0008 pea %a3@(8)
46b2e: 4eb9 0004 8d74 jsr 48d74 <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
46b34: 42ab 0018 clrl %a3@(24)
pthread_mutex_init (&r_chain->mutex, NULL);
46b38: 42a7 clrl %sp@-
46b3a: 486b 001c pea %a3@(28)
46b3e: 4eb9 0004 72f0 jsr 472f0 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
46b44: 42a7 clrl %sp@-
46b46: 486b 0020 pea %a3@(32)
46b4a: 4eb9 0004 6f84 jsr 46f84 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
46b50: 2f0b movel %a3,%sp@-
46b52: 487a fa4c pea %pc@(465a0 <rtems_aio_handle>)
46b56: 4879 0006 0f74 pea 60f74 <aio_request_queue+0x8>
46b5c: 486e ffdc pea %fp@(-36)
46b60: 4eb9 0004 7654 jsr 47654 <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
46b66: 4fef 0028 lea %sp@(40),%sp
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
pthread_cond_init (&r_chain->cond, NULL);
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
46b6a: 2600 movel %d0,%d3
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
46b6c: 6714 beqs 46b82 <rtems_aio_enqueue+0xfe> <== ALWAYS TAKEN
pthread_mutex_unlock (&aio_request_queue.mutex);
46b6e: 4879 0006 0f6c pea 60f6c <aio_request_queue> <== NOT EXECUTED
46b74: 2403 movel %d3,%d2 <== NOT EXECUTED
46b76: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock> <== NOT EXECUTED
46b7c: 588f addql #4,%sp <== NOT EXECUTED
46b7e: 6000 00f6 braw 46c76 <rtems_aio_enqueue+0x1f2> <== NOT EXECUTED
return result;
}
++aio_request_queue.active_threads;
46b82: 52b9 0006 0fd0 addql #1,60fd0 <aio_request_queue+0x64>
46b88: 6000 00de braw 46c68 <rtems_aio_enqueue+0x1e4>
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
46b8c: 2600 movel %d0,%d3
46b8e: 0683 0000 001c addil #28,%d3
46b94: 2f03 movel %d3,%sp@-
46b96: 4e94 jsr %a4@
rtems_aio_insert_prio (&r_chain->perfd, req);
46b98: 2f0a movel %a2,%sp@-
46b9a: 486b 0008 pea %a3@(8)
46b9e: 4eba fc5e jsr %pc@(467fe <rtems_aio_insert_prio>)
pthread_cond_signal (&r_chain->cond);
46ba2: 486b 0020 pea %a3@(32)
46ba6: 4eb9 0004 7030 jsr 47030 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
46bac: 2f03 movel %d3,%sp@-
46bae: 603e bras 46bee <rtems_aio_enqueue+0x16a>
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
46bb0: 42a7 clrl %sp@-
46bb2: 2f10 movel %a0@,%sp@-
46bb4: 49f9 0004 693e lea 4693e <rtems_aio_search_fd>,%a4
46bba: 4879 0006 0fb4 pea 60fb4 <aio_request_queue+0x48>
46bc0: 4e94 jsr %a4@
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
46bc2: 4fef 000c lea %sp@(12),%sp
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
46bc6: 2640 moveal %d0,%a3
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
46bc8: 4a80 tstl %d0
46bca: 672e beqs 46bfa <rtems_aio_enqueue+0x176>
{
pthread_mutex_lock (&r_chain->mutex);
46bcc: 49eb 001c lea %a3@(28),%a4
46bd0: 2f0c movel %a4,%sp@-
46bd2: 4eb9 0004 740c jsr 4740c <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
46bd8: 2f0a movel %a2,%sp@-
46bda: 486b 0008 pea %a3@(8)
46bde: 4eba fc1e jsr %pc@(467fe <rtems_aio_insert_prio>)
pthread_cond_signal (&r_chain->cond);
46be2: 486b 0020 pea %a3@(32)
46be6: 4eb9 0004 7030 jsr 47030 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
46bec: 2f0c movel %a4,%sp@-
46bee: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
46bf4: 4fef 0014 lea %sp@(20),%sp
46bf8: 606e bras 46c68 <rtems_aio_enqueue+0x1e4>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
46bfa: 4878 0001 pea 1 <ADD>
46bfe: 206a 0014 moveal %a2@(20),%a0
46c02: 2f10 movel %a0@,%sp@-
46c04: 4879 0006 0fc0 pea 60fc0 <aio_request_queue+0x54>
46c0a: 4e94 jsr %a4@
if (r_chain->new_fd == 1) {
46c0c: 4fef 000c lea %sp@(12),%sp
46c10: 7201 moveq #1,%d1
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
46c12: 2640 moveal %d0,%a3
46c14: 5080 addql #8,%d0
if (r_chain->new_fd == 1) {
46c16: b2ab 0018 cmpl %a3@(24),%d1
46c1a: 662c bnes 46c48 <rtems_aio_enqueue+0x1c4>
46c1c: 2f0a movel %a2,%sp@-
46c1e: 2f00 movel %d0,%sp@-
46c20: 4eb9 0004 8d74 jsr 48d74 <_Chain_Insert>
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
46c26: 42ab 0018 clrl %a3@(24)
pthread_mutex_init (&r_chain->mutex, NULL);
46c2a: 42a7 clrl %sp@-
46c2c: 486b 001c pea %a3@(28)
46c30: 4eb9 0004 72f0 jsr 472f0 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
46c36: 42a7 clrl %sp@-
46c38: 486b 0020 pea %a3@(32)
46c3c: 4eb9 0004 6f84 jsr 46f84 <pthread_cond_init>
46c42: 4fef 0018 lea %sp@(24),%sp
46c46: 600a bras 46c52 <rtems_aio_enqueue+0x1ce>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
46c48: 2f0a movel %a2,%sp@-
46c4a: 2f00 movel %d0,%sp@-
46c4c: 4eba fbb0 jsr %pc@(467fe <rtems_aio_insert_prio>)
46c50: 508f addql #8,%sp
if (aio_request_queue.idle_threads > 0)
46c52: 4ab9 0006 0fd4 tstl 60fd4 <aio_request_queue+0x68>
46c58: 6f0e bles 46c68 <rtems_aio_enqueue+0x1e4> <== ALWAYS TAKEN
pthread_cond_signal (&aio_request_queue.new_req);
46c5a: 4879 0006 0f70 pea 60f70 <aio_request_queue+0x4> <== NOT EXECUTED
46c60: 4eb9 0004 7030 jsr 47030 <pthread_cond_signal> <== NOT EXECUTED
46c66: 588f addql #4,%sp <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
46c68: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46c6e: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
46c74: 588f addql #4,%sp
return 0;
}
46c76: 2002 movel %d2,%d0
46c78: 4cee 1c0c ffc8 moveml %fp@(-56),%d2-%d3/%a2-%a4
46c7e: 4e5e unlk %fp
...
000465a0 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
465a0: 4e56 ffac linkw %fp,#-84
465a4: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
465a8: 240e movel %fp,%d2
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
465aa: 280e movel %fp,%d4
465ac: 2a0e movel %fp,%d5
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
465ae: 4bf9 0004 740c lea 4740c <pthread_mutex_lock>,%a5
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
465b4: 49f9 0004 74a4 lea 474a4 <pthread_mutex_unlock>,%a4
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
465ba: 0682 ffff ffdc addil #-36,%d2
465c0: 263c 0004 6e0c movel #290316,%d3
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
465c6: 0684 ffff ffe4 addil #-28,%d4
465cc: 0685 ffff ffd8 addil #-40,%d5
static void *
rtems_aio_handle (void *arg)
{
rtems_aio_request_chain *r_chain = arg;
465d2: 246e 0008 moveal %fp@(8),%a2
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
465d6: 2c0a movel %a2,%d6
465d8: 0686 0000 001c addil #28,%d6
465de: 2f06 movel %d6,%sp@-
465e0: 4e95 jsr %a5@
if (result != 0)
465e2: 588f addql #4,%sp
465e4: 4a80 tstl %d0
465e6: 6600 020a bnew 467f2 <rtems_aio_handle+0x252>
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
465ea: 200a movel %a2,%d0
465ec: 0680 0000 000c addil #12,%d0
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
465f2: 266a 0008 moveal %a2@(8),%a3
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
465f6: b08b cmpl %a3,%d0
465f8: 6700 00d6 beqw 466d0 <rtems_aio_handle+0x130>
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
465fc: 41f9 0004 7c20 lea 47c20 <pthread_self>,%a0
46602: 2d48 ffd4 movel %a0,%fp@(-44)
46606: 4e90 jsr %a0@
46608: 2f04 movel %d4,%sp@-
4660a: 2f05 movel %d5,%sp@-
4660c: 2f00 movel %d0,%sp@-
4660e: 4eb9 0004 785c jsr 4785c <pthread_getschedparam>
param.sched_priority = req->priority;
46614: 2d6b 000c ffe4 movel %a3@(12),%fp@(-28)
pthread_setschedparam (pthread_self(), req->policy, ¶m);
4661a: 206e ffd4 moveal %fp@(-44),%a0
4661e: 2e2b 0008 movel %a3@(8),%d7
46622: 4e90 jsr %a0@
46624: 2f04 movel %d4,%sp@-
46626: 2f07 movel %d7,%sp@-
46628: 2f00 movel %d0,%sp@-
4662a: 4eb9 0004 7c34 jsr 47c34 <pthread_setschedparam>
46630: 2f0b movel %a3,%sp@-
46632: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
46638: 2f06 movel %d6,%sp@-
4663a: 4e94 jsr %a4@
switch (req->aiocbp->aio_lio_opcode) {
4663c: 206b 0014 moveal %a3@(20),%a0
46640: 4fef 0020 lea %sp@(32),%sp
46644: 7202 moveq #2,%d1
46646: 2028 002c movel %a0@(44),%d0
4664a: b280 cmpl %d0,%d1
4664c: 672a beqs 46678 <rtems_aio_handle+0xd8>
4664e: 123c 0003 moveb #3,%d1
46652: b280 cmpl %d0,%d1
46654: 6740 beqs 46696 <rtems_aio_handle+0xf6> <== NEVER TAKEN
46656: 123c 0001 moveb #1,%d1
4665a: b280 cmpl %d0,%d1
4665c: 6648 bnes 466a6 <rtems_aio_handle+0x106> <== NEVER TAKEN
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
4665e: 2f28 0008 movel %a0@(8),%sp@-
46662: 2f28 0004 movel %a0@(4),%sp@-
46666: 2f28 0010 movel %a0@(16),%sp@-
4666a: 2f28 000c movel %a0@(12),%sp@-
4666e: 2f10 movel %a0@,%sp@-
46670: 4eb9 0004 f9f4 jsr 4f9f4 <pread>
46676: 6018 bras 46690 <rtems_aio_handle+0xf0>
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
46678: 2f28 0008 movel %a0@(8),%sp@-
4667c: 2f28 0004 movel %a0@(4),%sp@-
46680: 2f28 0010 movel %a0@(16),%sp@-
46684: 2f28 000c movel %a0@(12),%sp@-
46688: 2f10 movel %a0@,%sp@-
4668a: 4eb9 0004 fab8 jsr 4fab8 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
46690: 4fef 0014 lea %sp@(20),%sp
46694: 600a bras 466a0 <rtems_aio_handle+0x100>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
46696: 2f10 movel %a0@,%sp@- <== NOT EXECUTED
46698: 4eb9 0004 c4c0 jsr 4c4c0 <fsync> <== NOT EXECUTED
break;
4669e: 588f addql #4,%sp <== NOT EXECUTED
default:
result = -1;
}
if (result == -1) {
466a0: 72ff moveq #-1,%d1
466a2: b280 cmpl %d0,%d1
466a4: 661a bnes 466c0 <rtems_aio_handle+0x120> <== ALWAYS TAKEN
req->aiocbp->return_value = -1;
466a6: 266b 0014 moveal %a3@(20),%a3 <== NOT EXECUTED
466aa: 70ff moveq #-1,%d0 <== NOT EXECUTED
466ac: 2740 0034 movel %d0,%a3@(52) <== NOT EXECUTED
req->aiocbp->error_code = errno;
466b0: 4eb9 0004 f05c jsr 4f05c <__errno> <== NOT EXECUTED
466b6: 2040 moveal %d0,%a0 <== NOT EXECUTED
466b8: 2750 0030 movel %a0@,%a3@(48) <== NOT EXECUTED
466bc: 6000 ff18 braw 465d6 <rtems_aio_handle+0x36> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
466c0: 206b 0014 moveal %a3@(20),%a0
466c4: 2140 0034 movel %d0,%a0@(52)
req->aiocbp->error_code = 0;
466c8: 42a8 0030 clrl %a0@(48)
466cc: 6000 ff08 braw 465d6 <rtems_aio_handle+0x36>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
466d0: 2f06 movel %d6,%sp@-
466d2: 4e94 jsr %a4@
pthread_mutex_lock (&aio_request_queue.mutex);
466d4: 4879 0006 0f6c pea 60f6c <aio_request_queue>
466da: 4e95 jsr %a5@
if (rtems_chain_is_empty (chain))
466dc: 508f addql #8,%sp
466de: b7ea 0008 cmpal %a2@(8),%a3
466e2: 6600 0100 bnew 467e4 <rtems_aio_handle+0x244>
{
clock_gettime (CLOCK_REALTIME, &timeout);
466e6: 2f02 movel %d2,%sp@-
466e8: 4878 0001 pea 1 <ADD>
466ec: 2043 moveal %d3,%a0
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
466ee: 2e0a movel %a2,%d7
466f0: 0687 0000 0020 addil #32,%d7
466f6: 47f9 0004 70a4 lea 470a4 <pthread_cond_timedwait>,%a3
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
466fc: 4e90 jsr %a0@
timeout.tv_sec += 3;
466fe: 56ae ffdc addql #3,%fp@(-36)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
46702: 2f02 movel %d2,%sp@-
46704: 4879 0006 0f6c pea 60f6c <aio_request_queue>
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
4670a: 42ae ffe0 clrl %fp@(-32)
result = pthread_cond_timedwait (&r_chain->cond,
4670e: 2f07 movel %d7,%sp@-
46710: 4e93 jsr %a3@
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
46712: 4fef 0014 lea %sp@(20),%sp
46716: 7274 moveq #116,%d1
46718: b280 cmpl %d0,%d1
4671a: 6600 00c8 bnew 467e4 <rtems_aio_handle+0x244>
4671e: 2f0a movel %a2,%sp@-
46720: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
46726: 2f06 movel %d6,%sp@-
46728: 4eb9 0004 71d0 jsr 471d0 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
4672e: 2f07 movel %d7,%sp@-
46730: 4eb9 0004 6ec4 jsr 46ec4 <pthread_cond_destroy>
free (r_chain);
46736: 2f0a movel %a2,%sp@-
46738: 4eb9 0004 2e98 jsr 42e98 <free>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
4673e: 4fef 0010 lea %sp@(16),%sp
46742: 41f9 0006 0fc4 lea 60fc4 <aio_request_queue+0x58>,%a0
46748: b1f9 0006 0fc0 cmpal 60fc0 <aio_request_queue+0x54>,%a0
4674e: 664e bnes 4679e <rtems_aio_handle+0x1fe>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
46750: 2f02 movel %d2,%sp@-
46752: 4878 0001 pea 1 <ADD>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
46756: 52b9 0006 0fd4 addql #1,60fd4 <aio_request_queue+0x68>
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
4675c: 2043 moveal %d3,%a0
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
4675e: 53b9 0006 0fd0 subql #1,60fd0 <aio_request_queue+0x64>
clock_gettime (CLOCK_REALTIME, &timeout);
46764: 4e90 jsr %a0@
timeout.tv_sec += 3;
46766: 56ae ffdc addql #3,%fp@(-36)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
4676a: 2f02 movel %d2,%sp@-
4676c: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46772: 4879 0006 0f70 pea 60f70 <aio_request_queue+0x4>
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
46778: 42ae ffe0 clrl %fp@(-32)
result = pthread_cond_timedwait (&aio_request_queue.new_req,
4677c: 4e93 jsr %a3@
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
4677e: 4fef 0014 lea %sp@(20),%sp
46782: 7274 moveq #116,%d1
46784: b280 cmpl %d0,%d1
46786: 6616 bnes 4679e <rtems_aio_handle+0x1fe> <== NEVER TAKEN
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
pthread_mutex_unlock (&aio_request_queue.mutex);
46788: 4879 0006 0f6c pea 60f6c <aio_request_queue>
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
4678e: 53b9 0006 0fd4 subql #1,60fd4 <aio_request_queue+0x68>
pthread_mutex_unlock (&aio_request_queue.mutex);
46794: 4eb9 0004 74a4 jsr 474a4 <pthread_mutex_unlock>
4679a: 588f addql #4,%sp
4679c: 6054 bras 467f2 <rtems_aio_handle+0x252>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4679e: 2479 0006 0fc0 moveal 60fc0 <aio_request_queue+0x54>,%a2
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
467a4: 53b9 0006 0fd4 subql #1,60fd4 <aio_request_queue+0x68>
++aio_request_queue.active_threads;
467aa: 52b9 0006 0fd0 addql #1,60fd0 <aio_request_queue+0x64>
467b0: 2f0a movel %a2,%sp@-
467b2: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract>
467b8: 2079 0006 0fb4 moveal 60fb4 <aio_request_queue+0x48>,%a0
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
467be: 588f addql #4,%sp
467c0: 202a 0014 movel %a2@(20),%d0
467c4: 6002 bras 467c8 <rtems_aio_handle+0x228>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
467c6: 2050 moveal %a0@,%a0
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
467c8: b0a8 0014 cmpl %a0@(20),%d0
467cc: 6f08 bles 467d6 <rtems_aio_handle+0x236>
467ce: b1fc 0006 0fb8 cmpal #397240,%a0
467d4: 66f0 bnes 467c6 <rtems_aio_handle+0x226> <== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
467d6: 2f0a movel %a2,%sp@-
467d8: 2f28 0004 movel %a0@(4),%sp@-
467dc: 4eb9 0004 8d74 jsr 48d74 <_Chain_Insert>
467e2: 508f addql #8,%sp
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
467e4: 4879 0006 0f6c pea 60f6c <aio_request_queue>
467ea: 4e94 jsr %a4@
467ec: 588f addql #4,%sp
467ee: 6000 fde6 braw 465d6 <rtems_aio_handle+0x36>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
467f2: 4280 clrl %d0
467f4: 4cee 3cfc ffac moveml %fp@(-84),%d2-%d7/%a2-%a5
467fa: 4e5e unlk %fp <== NOT EXECUTED
00046854 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
46854: 4e56 0000 linkw %fp,#0
46858: 2f02 movel %d2,%sp@-
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
4685a: 4879 0006 0f74 pea 60f74 <aio_request_queue+0x8>
46860: 4eb9 0004 7600 jsr 47600 <pthread_attr_init>
if (result != 0)
46866: 588f addql #4,%sp
int
rtems_aio_init (void)
{
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
46868: 2400 movel %d0,%d2
if (result != 0)
4686a: 6600 00c8 bnew 46934 <rtems_aio_init+0xe0>
return result;
result =
4686e: 42a7 clrl %sp@-
46870: 4879 0006 0f74 pea 60f74 <aio_request_queue+0x8>
46876: 4eb9 0004 762c jsr 4762c <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
4687c: 508f addql #8,%sp
4687e: 4a80 tstl %d0
46880: 670e beqs 46890 <rtems_aio_init+0x3c> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
46882: 4879 0006 0f74 pea 60f74 <aio_request_queue+0x8> <== NOT EXECUTED
46888: 4eb9 0004 75e4 jsr 475e4 <pthread_attr_destroy> <== NOT EXECUTED
4688e: 588f addql #4,%sp <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
46890: 42a7 clrl %sp@-
46892: 4879 0006 0f6c pea 60f6c <aio_request_queue>
46898: 4eb9 0004 72f0 jsr 472f0 <pthread_mutex_init>
if (result != 0)
4689e: 508f addql #8,%sp
468a0: 4a80 tstl %d0
468a2: 670e beqs 468b2 <rtems_aio_init+0x5e> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
468a4: 4879 0006 0f74 pea 60f74 <aio_request_queue+0x8> <== NOT EXECUTED
468aa: 4eb9 0004 75e4 jsr 475e4 <pthread_attr_destroy> <== NOT EXECUTED
468b0: 588f addql #4,%sp <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
468b2: 42a7 clrl %sp@-
468b4: 4879 0006 0f70 pea 60f70 <aio_request_queue+0x4>
468ba: 4eb9 0004 6f84 jsr 46f84 <pthread_cond_init>
if (result != 0) {
468c0: 508f addql #8,%sp
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
468c2: 2400 movel %d0,%d2
if (result != 0) {
468c4: 671a beqs 468e0 <rtems_aio_init+0x8c> <== ALWAYS TAKEN
pthread_mutex_destroy (&aio_request_queue.mutex);
468c6: 4879 0006 0f6c pea 60f6c <aio_request_queue> <== NOT EXECUTED
468cc: 4eb9 0004 71d0 jsr 471d0 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
468d2: 4879 0006 0f74 pea 60f74 <aio_request_queue+0x8> <== NOT EXECUTED
468d8: 4eb9 0004 75e4 jsr 475e4 <pthread_attr_destroy> <== NOT EXECUTED
468de: 508f addql #8,%sp <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
468e0: 42b9 0006 0fb8 clrl 60fb8 <aio_request_queue+0x4c>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
468e6: 203c 0006 0fb8 movel #397240,%d0
468ec: 23c0 0006 0fb4 movel %d0,60fb4 <aio_request_queue+0x48>
head->previous = NULL;
tail->previous = head;
468f2: 203c 0006 0fb4 movel #397236,%d0
468f8: 23c0 0006 0fbc movel %d0,60fbc <aio_request_queue+0x50>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
468fe: 203c 0006 0fc4 movel #397252,%d0
46904: 23c0 0006 0fc0 movel %d0,60fc0 <aio_request_queue+0x54>
head->previous = NULL;
tail->previous = head;
4690a: 203c 0006 0fc0 movel #397248,%d0
46910: 23c0 0006 0fc8 movel %d0,60fc8 <aio_request_queue+0x5c>
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
46916: 203c 0000 b00b movel #45067,%d0
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
4691c: 42b9 0006 0fc4 clrl 60fc4 <aio_request_queue+0x58>
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
46922: 42b9 0006 0fd0 clrl 60fd0 <aio_request_queue+0x64>
aio_request_queue.idle_threads = 0;
46928: 42b9 0006 0fd4 clrl 60fd4 <aio_request_queue+0x68>
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
4692e: 23c0 0006 0fcc movel %d0,60fcc <aio_request_queue+0x60>
return result;
}
46934: 2002 movel %d2,%d0
46936: 242e fffc movel %fp@(-4),%d2
4693a: 4e5e unlk %fp <== NOT EXECUTED
000467fe <rtems_aio_insert_prio>:
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
467fe: 4e56 0000 linkw %fp,#0
46802: 202e 0008 movel %fp@(8),%d0
46806: 2240 moveal %d0,%a1
46808: 2f0b movel %a3,%sp@-
4680a: 2059 moveal %a1@+,%a0
4680c: 2f0a movel %a2,%sp@-
4680e: 246e 000c moveal %fp@(12),%a2
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
46812: b3c8 cmpal %a0,%a1
46814: 6602 bnes 46818 <rtems_aio_insert_prio+0x1a> <== ALWAYS TAKEN
46816: 602a bras 46842 <rtems_aio_insert_prio+0x44> <== NOT EXECUTED
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
46818: 2668 0014 moveal %a0@(20),%a3
4681c: 202b 0014 movel %a3@(20),%d0
while (req->aiocbp->aio_reqprio > prio &&
46820: 266a 0014 moveal %a2@(20),%a3
46824: 222b 0014 movel %a3@(20),%d1
46828: 600a bras 46834 <rtems_aio_insert_prio+0x36>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
4682a: 2050 moveal %a0@,%a0 <== NOT EXECUTED
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
4682c: 2668 0014 moveal %a0@(20),%a3 <== NOT EXECUTED
46830: 202b 0014 movel %a3@(20),%d0 <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
46834: b081 cmpl %d1,%d0
46836: 6d16 blts 4684e <rtems_aio_insert_prio+0x50> <== NEVER TAKEN
46838: 2d4a 000c movel %a2,%fp@(12)
4683c: 2d68 0004 0008 movel %a0@(4),%fp@(8)
}
rtems_chain_insert (node->previous, &req->next_prio);
}
}
46842: 245f moveal %sp@+,%a2
46844: 265f moveal %sp@+,%a3
46846: 4e5e unlk %fp
46848: 4ef9 0004 8d74 jmp 48d74 <_Chain_Insert>
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
4684e: b3c8 cmpal %a0,%a1 <== NOT EXECUTED
46850: 66d8 bnes 4682a <rtems_aio_insert_prio+0x2c> <== NOT EXECUTED
46852: 60e4 bras 46838 <rtems_aio_insert_prio+0x3a> <== NOT EXECUTED
00046a24 <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
46a24: 4e56 0000 linkw %fp,#0
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
46a28: 206e 0008 moveal %fp@(8),%a0
46a2c: 2f0a movel %a2,%sp@-
46a2e: 202e 000c movel %fp@(12),%d0
46a32: 2458 moveal %a0@+,%a2
if (rtems_chain_is_empty (chain))
46a34: b1ca cmpal %a2,%a0
46a36: 660a bnes 46a42 <rtems_aio_remove_req+0x1e>
46a38: 603c bras 46a76 <rtems_aio_remove_req+0x52>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
46a3a: 2452 moveal %a2@,%a2 <== NOT EXECUTED
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
46a3c: b1ca cmpal %a2,%a0 <== NOT EXECUTED
46a3e: 6602 bnes 46a42 <rtems_aio_remove_req+0x1e> <== NOT EXECUTED
46a40: 6038 bras 46a7a <rtems_aio_remove_req+0x56> <== NOT EXECUTED
46a42: b0aa 0014 cmpl %a2@(20),%d0
46a46: 66f2 bnes 46a3a <rtems_aio_remove_req+0x16> <== NEVER TAKEN
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
46a48: b1ca cmpal %a2,%a0
46a4a: 672e beqs 46a7a <rtems_aio_remove_req+0x56> <== NEVER TAKEN
46a4c: 2f0a movel %a2,%sp@-
46a4e: 4eb9 0004 8d18 jsr 48d18 <_Chain_Extract>
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
46a54: 206a 0014 moveal %a2@(20),%a0
46a58: 203c 0000 008c movel #140,%d0
46a5e: 2140 0030 movel %d0,%a0@(48)
current->aiocbp->return_value = -1;
46a62: 70ff moveq #-1,%d0
46a64: 2140 0034 movel %d0,%a0@(52)
free (current);
46a68: 2f0a movel %a2,%sp@-
46a6a: 4eb9 0004 2e98 jsr 42e98 <free>
}
return AIO_CANCELED;
46a70: 508f addql #8,%sp
46a72: 4280 clrl %d0
46a74: 6006 bras 46a7c <rtems_aio_remove_req+0x58>
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
return AIO_ALLDONE;
46a76: 7002 moveq #2,%d0
46a78: 6002 bras 46a7c <rtems_aio_remove_req+0x58>
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
46a7a: 7001 moveq #1,%d0 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
46a7c: 246e fffc moveal %fp@(-4),%a2
46a80: 4e5e unlk %fp <== NOT EXECUTED
0004d3c4 <rtems_barrier_delete>:
#include <rtems/score/threadq.h>
rtems_status_code rtems_barrier_delete(
rtems_id id
)
{
4d3c4: 4e56 fffc linkw %fp,#-4
4d3c8: 2f0a movel %a2,%sp@-
RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Barrier_Control *)
4d3ca: 486e fffc pea %fp@(-4)
4d3ce: 2f2e 0008 movel %fp@(8),%sp@-
4d3d2: 4879 0006 17fc pea 617fc <_Barrier_Information>
4d3d8: 4eb9 0004 9218 jsr 49218 <_Objects_Get>
Barrier_Control *the_barrier;
Objects_Locations location;
the_barrier = _Barrier_Get( id, &location );
switch ( location ) {
4d3de: 4fef 000c lea %sp@(12),%sp
4d3e2: 2440 moveal %d0,%a2
4d3e4: 4aae fffc tstl %fp@(-4)
4d3e8: 663a bnes 4d424 <rtems_barrier_delete+0x60> <== NEVER TAKEN
case OBJECTS_LOCAL:
_CORE_barrier_Flush(
4d3ea: 4878 0002 pea 2 <DOUBLE_FLOAT>
4d3ee: 42a7 clrl %sp@-
4d3f0: 486a 0014 pea %a2@(20)
4d3f4: 4eb9 0004 a458 jsr 4a458 <_Thread_queue_Flush>
&the_barrier->Barrier,
NULL,
CORE_BARRIER_WAS_DELETED
);
_Objects_Close( &_Barrier_Information, &the_barrier->Object );
4d3fa: 2f0a movel %a2,%sp@-
4d3fc: 4879 0006 17fc pea 617fc <_Barrier_Information>
4d402: 4eb9 0004 8e28 jsr 48e28 <_Objects_Close>
*/
RTEMS_INLINE_ROUTINE void _Barrier_Free (
Barrier_Control *the_barrier
)
{
_Objects_Free( &_Barrier_Information, &the_barrier->Object );
4d408: 2f0a movel %a2,%sp@-
4d40a: 4879 0006 17fc pea 617fc <_Barrier_Information>
4d410: 4eb9 0004 90b0 jsr 490b0 <_Objects_Free>
_Barrier_Free( the_barrier );
_Thread_Enable_dispatch();
4d416: 4eb9 0004 9e14 jsr 49e14 <_Thread_Enable_dispatch>
4d41c: 4fef 001c lea %sp@(28),%sp
return RTEMS_SUCCESSFUL;
4d420: 4280 clrl %d0
4d422: 6002 bras 4d426 <rtems_barrier_delete+0x62>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
4d424: 7004 moveq #4,%d0
}
4d426: 246e fff8 moveal %fp@(-8),%a2
4d42a: 4e5e unlk %fp
...
00046de8 <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
46de8: 4e56 ffec linkw %fp,#-20
46dec: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
46df0: 260e movel %fp,%d3
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
46df2: 45f9 0004 73ec lea 473ec <_Chain_Get>,%a2
46df8: 5983 subql #4,%d3
46dfa: 47f9 0004 622c lea 4622c <rtems_event_receive>,%a3
46e00: 6016 bras 46e18 <rtems_chain_get_with_wait+0x30>
46e02: 2f03 movel %d3,%sp@-
46e04: 2f2e 0010 movel %fp@(16),%sp@-
46e08: 42a7 clrl %sp@-
46e0a: 2f2e 000c movel %fp@(12),%sp@-
46e0e: 4e93 jsr %a3@
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
46e10: 4fef 0010 lea %sp@(16),%sp
46e14: 4a80 tstl %d0
46e16: 660e bnes 46e26 <rtems_chain_get_with_wait+0x3e> <== ALWAYS TAKEN
46e18: 2f2e 0008 movel %fp@(8),%sp@-
46e1c: 4e92 jsr %a2@
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
46e1e: 588f addql #4,%sp
46e20: 2400 movel %d0,%d2
46e22: 67de beqs 46e02 <rtems_chain_get_with_wait+0x1a>
46e24: 4280 clrl %d0
timeout,
&out
);
}
*node_ptr = node;
46e26: 206e 0014 moveal %fp@(20),%a0
46e2a: 2082 movel %d2,%a0@
return sc;
}
46e2c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3
46e32: 4e5e unlk %fp
...
0004e94c <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
4e94c: 4e56 0000 linkw %fp,#0
4e950: 202e 0008 movel %fp@(8),%d0
4e954: 206e 0014 moveal %fp@(20),%a0
4e958: 2f0a movel %a2,%sp@-
rtems_status_code sc;
if ( event_out != NULL ) {
4e95a: 4a88 tstl %a0
4e95c: 6758 beqs 4e9b6 <rtems_event_system_receive+0x6a><== NEVER TAKEN
Thread_Control *executing = _Thread_Executing;
4e95e: 2479 0006 2c52 moveal 62c52 <_Per_CPU_Information+0xe>,%a2
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
4e964: 226a 00fa moveal %a2@(250),%a1
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
4e968: 4a80 tstl %d0
4e96a: 6742 beqs 4e9ae <rtems_event_system_receive+0x62><== NEVER TAKEN
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
4e96c: 2239 0006 280a movel 6280a <_Thread_Dispatch_disable_level>,%d1
++level;
4e972: 5281 addql #1,%d1
_Thread_Dispatch_disable_level = level;
4e974: 23c1 0006 280a movel %d1,6280a <_Thread_Dispatch_disable_level>
_Thread_Disable_dispatch();
_Event_Seize(
4e97a: 2f3c 0004 0000 movel #262144,%sp@-
4e980: 4879 0006 302c pea 6302c <_System_event_Sync_state>
4e986: 4869 0004 pea %a1@(4)
4e98a: 2f0a movel %a2,%sp@-
4e98c: 2f08 movel %a0,%sp@-
4e98e: 2f2e 0010 movel %fp@(16),%sp@-
4e992: 2f2e 000c movel %fp@(12),%sp@-
4e996: 2f00 movel %d0,%sp@-
4e998: 4eb9 0004 6e70 jsr 46e70 <_Event_Seize>
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
4e99e: 4fef 0020 lea %sp@(32),%sp
4e9a2: 4eb9 0004 9938 jsr 49938 <_Thread_Enable_dispatch>
sc = executing->Wait.return_code;
4e9a8: 202a 0034 movel %a2@(52),%d0
4e9ac: 600a bras 4e9b8 <rtems_event_system_receive+0x6c>
} else {
*event_out = event->pending_events;
4e9ae: 20a9 0004 movel %a1@(4),%a0@ <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
4e9b2: 4280 clrl %d0 <== NOT EXECUTED
4e9b4: 6002 bras 4e9b8 <rtems_event_system_receive+0x6c><== NOT EXECUTED
}
} else {
sc = RTEMS_INVALID_ADDRESS;
4e9b6: 7009 moveq #9,%d0 <== NOT EXECUTED
}
return sc;
}
4e9b8: 246e fffc moveal %fp@(-4),%a2
4e9bc: 4e5e unlk %fp <== NOT EXECUTED
00046478 <rtems_event_system_send>:
rtems_status_code rtems_event_system_send(
rtems_id id,
rtems_event_set event_in
)
{
46478: 4e56 fffc linkw %fp,#-4
rtems_status_code sc;
Thread_Control *thread;
Objects_Locations location;
RTEMS_API_Control *api;
thread = _Thread_Get( id, &location );
4647c: 486e fffc pea %fp@(-4)
46480: 2f2e 0008 movel %fp@(8),%sp@-
46484: 4eb9 0004 871c jsr 4871c <_Thread_Get>
switch ( location ) {
4648a: 508f addql #8,%sp
4648c: 4aae fffc tstl %fp@(-4)
46490: 6630 bnes 464c2 <rtems_event_system_send+0x4a> <== NEVER TAKEN
case OBJECTS_LOCAL:
api = thread->API_Extensions[ THREAD_API_RTEMS ];
_Event_Surrender(
46492: 2040 moveal %d0,%a0
46494: 2f3c 0004 0000 movel #262144,%sp@-
4649a: 4879 0005 f6f8 pea 5f6f8 <_System_event_Sync_state>
464a0: 2228 00fa movel %a0@(250),%d1
464a4: 5881 addql #4,%d1
464a6: 2f01 movel %d1,%sp@-
464a8: 2f2e 000c movel %fp@(12),%sp@-
464ac: 2f00 movel %d0,%sp@-
464ae: 4eb9 0004 5ed8 jsr 45ed8 <_Event_Surrender>
event_in,
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
464b4: 4eb9 0004 86fc jsr 486fc <_Thread_Enable_dispatch>
sc = RTEMS_SUCCESSFUL;
break;
464ba: 4fef 0014 lea %sp@(20),%sp
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
sc = RTEMS_SUCCESSFUL;
464be: 4280 clrl %d0
break;
464c0: 6002 bras 464c4 <rtems_event_system_send+0x4c>
case OBJECTS_REMOTE:
sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
break;
#endif
default:
sc = RTEMS_INVALID_ID;
464c2: 7004 moveq #4,%d0 <== NOT EXECUTED
break;
}
return sc;
}
464c4: 4e5e unlk %fp <== NOT EXECUTED
0004882c <rtems_iterate_over_all_threads>:
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
{
4882c: 4e56 fff0 linkw %fp,#-16
48830: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
48834: 286e 0008 moveal %fp@(8),%a4
48838: 45f9 0006 12d6 lea 612d6 <_Objects_Information_table+0x4>,%a2
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
4883e: 4a8c tstl %a4
48840: 6736 beqs 48878 <rtems_iterate_over_all_threads+0x4c><== NEVER TAKEN
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
48842: 205a moveal %a2@+,%a0
48844: 2668 0004 moveal %a0@(4),%a3
if ( !information )
48848: 4a8b tstl %a3
4884a: 661e bnes 4886a <rtems_iterate_over_all_threads+0x3e>
Objects_Information *information;
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
4884c: b5fc 0006 12e2 cmpal #398050,%a2
48852: 66ee bnes 48842 <rtems_iterate_over_all_threads+0x16>
48854: 6022 bras 48878 <rtems_iterate_over_all_threads+0x4c>
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
48856: 206b 0018 moveal %a3@(24),%a0
4885a: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0
if ( !the_thread )
4885e: 6706 beqs 48866 <rtems_iterate_over_all_threads+0x3a><== NEVER TAKEN
continue;
(*routine)(the_thread);
48860: 2f00 movel %d0,%sp@-
48862: 4e94 jsr %a4@
48864: 588f addql #4,%sp
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
48866: 5282 addql #1,%d2
48868: 6002 bras 4886c <rtems_iterate_over_all_threads+0x40>
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
4886a: 7401 moveq #1,%d2
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4886c: 4280 clrl %d0
4886e: 302b 000e movew %a3@(14),%d0
48872: b082 cmpl %d2,%d0
48874: 64e0 bccs 48856 <rtems_iterate_over_all_threads+0x2a>
48876: 60d4 bras 4884c <rtems_iterate_over_all_threads+0x20>
(*routine)(the_thread);
}
}
}
48878: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4887e: 4e5e unlk %fp
...
0004d564 <rtems_message_queue_receive>:
void *buffer,
size_t *size,
rtems_option option_set,
rtems_interval timeout
)
{
4d564: 4e56 fff0 linkw %fp,#-16
4d568: 48d7 001c moveml %d2-%d4,%sp@
4d56c: 242e 000c movel %fp@(12),%d2
4d570: 262e 0010 movel %fp@(16),%d3
register Message_queue_Control *the_message_queue;
Objects_Locations location;
bool wait;
if ( !buffer )
4d574: 4a82 tstl %d2
4d576: 6762 beqs 4d5da <rtems_message_queue_receive+0x76><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( !size )
4d578: 4a83 tstl %d3
4d57a: 675e beqs 4d5da <rtems_message_queue_receive+0x76><== NEVER TAKEN
RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Message_queue_Control *)
4d57c: 486e fffc pea %fp@(-4)
4d580: 2f2e 0008 movel %fp@(8),%sp@-
4d584: 4879 0006 8068 pea 68068 <_Message_queue_Information>
4d58a: 4eb9 0004 f718 jsr 4f718 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_message_queue = _Message_queue_Get( id, &location );
switch ( location ) {
4d590: 4fef 000c lea %sp@(12),%sp
4d594: 4aae fffc tstl %fp@(-4)
4d598: 6644 bnes 4d5de <rtems_message_queue_receive+0x7a>
4d59a: 222e 0014 movel %fp@(20),%d1
if ( _Options_Is_no_wait( option_set ) )
wait = false;
else
wait = true;
_CORE_message_queue_Seize(
4d59e: 7801 moveq #1,%d4
4d5a0: 4681 notl %d1
4d5a2: 2040 moveal %d0,%a0
4d5a4: 2f2e 0018 movel %fp@(24),%sp@-
4d5a8: c881 andl %d1,%d4
4d5aa: 2f04 movel %d4,%sp@-
4d5ac: 2f03 movel %d3,%sp@-
4d5ae: 2f02 movel %d2,%sp@-
4d5b0: 2f28 0008 movel %a0@(8),%sp@-
4d5b4: 4868 0014 pea %a0@(20)
4d5b8: 4eb9 0004 e824 jsr 4e824 <_CORE_message_queue_Seize>
buffer,
size,
wait,
timeout
);
_Thread_Enable_dispatch();
4d5be: 4eb9 0005 0410 jsr 50410 <_Thread_Enable_dispatch>
return _Message_queue_Translate_core_message_queue_return_code(
_Thread_Executing->Wait.return_code
4d5c4: 2079 0006 7c86 moveal 67c86 <_Per_CPU_Information+0xe>,%a0
size,
wait,
timeout
);
_Thread_Enable_dispatch();
return _Message_queue_Translate_core_message_queue_return_code(
4d5ca: 2f28 0034 movel %a0@(52),%sp@-
4d5ce: 4eb9 0004 d664 jsr 4d664 <_Message_queue_Translate_core_message_queue_return_code>
4d5d4: 4fef 001c lea %sp@(28),%sp
4d5d8: 6006 bras 4d5e0 <rtems_message_queue_receive+0x7c>
register Message_queue_Control *the_message_queue;
Objects_Locations location;
bool wait;
if ( !buffer )
return RTEMS_INVALID_ADDRESS;
4d5da: 7009 moveq #9,%d0
4d5dc: 6002 bras 4d5e0 <rtems_message_queue_receive+0x7c>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
4d5de: 7004 moveq #4,%d0
}
4d5e0: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4
4d5e6: 4e5e unlk %fp
...
0006b520 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
6b520: 4e56 ffec linkw %fp,#-20
6b524: 48d7 041c moveml %d2-%d4/%a2,%sp@
6b528: 486e fffc pea %fp@(-4)
6b52c: 282e 0008 movel %fp@(8),%d4
6b530: 2f04 movel %d4,%sp@-
6b532: 4879 0009 7f2c pea 97f2c <_Rate_monotonic_Information>
6b538: 242e 000c movel %fp@(12),%d2
6b53c: 4eb9 0004 7878 jsr 47878 <_Objects_Get>
rtems_rate_monotonic_period_states local_state;
ISR_Level level;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
6b542: 4fef 000c lea %sp@(12),%sp
6b546: 2440 moveal %d0,%a2
6b548: 4aae fffc tstl %fp@(-4)
6b54c: 6600 0156 bnew 6b6a4 <rtems_rate_monotonic_period+0x184>
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
6b550: 2039 0009 79b2 movel 979b2 <_Per_CPU_Information+0xe>,%d0
6b556: b0aa 0040 cmpl %a2@(64),%d0
6b55a: 670c beqs 6b568 <rtems_rate_monotonic_period+0x48>
_Thread_Enable_dispatch();
6b55c: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
6b562: 7417 moveq #23,%d2
6b564: 6000 0140 braw 6b6a6 <rtems_rate_monotonic_period+0x186>
}
if ( length == RTEMS_PERIOD_STATUS ) {
6b568: 4a82 tstl %d2
6b56a: 6624 bnes 6b590 <rtems_rate_monotonic_period+0x70>
switch ( the_period->state ) {
6b56c: 202a 0038 movel %a2@(56),%d0
6b570: 7204 moveq #4,%d1
6b572: b280 cmpl %d0,%d1
6b574: 650e bcss 6b584 <rtems_rate_monotonic_period+0x64><== NEVER TAKEN
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
6b576: 41f9 0009 0fe2 lea 90fe2 <CSWTCH.24>,%a0
6b57c: 4282 clrl %d2
6b57e: 1430 0800 moveb %a0@(00000000,%d0:l),%d2
6b582: 6002 bras 6b586 <rtems_rate_monotonic_period+0x66>
_Thread_Enable_dispatch();
return RTEMS_NOT_OWNER_OF_RESOURCE;
}
if ( length == RTEMS_PERIOD_STATUS ) {
switch ( the_period->state ) {
6b584: 4282 clrl %d2 <== NOT EXECUTED
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
6b586: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch>
6b58c: 6000 0118 braw 6b6a6 <rtems_rate_monotonic_period+0x186>
return( return_value );
}
_ISR_Disable( level );
6b590: 203c 0000 0700 movel #1792,%d0
6b596: 40c3 movew %sr,%d3
6b598: 8083 orl %d3,%d0
6b59a: 46c0 movew %d0,%sr
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
6b59c: 202a 0038 movel %a2@(56),%d0
6b5a0: 664a bnes 6b5ec <rtems_rate_monotonic_period+0xcc>
_ISR_Enable( level );
6b5a2: 46c3 movew %d3,%sr
the_period->next_length = length;
6b5a4: 2542 003c movel %d2,%a2@(60)
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
6b5a8: 2f0a movel %a2,%sp@-
6b5aa: 4eb9 0006 b49c jsr 6b49c <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
6b5b0: 7002 moveq #2,%d0
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
6b5b2: 223c 0006 b6b4 movel #439988,%d1
6b5b8: 2540 0038 movel %d0,%a2@(56)
6b5bc: 2541 002c movel %d1,%a2@(44)
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
6b5c0: 42aa 0018 clrl %a2@(24)
the_watchdog->routine = routine;
the_watchdog->id = id;
6b5c4: 2544 0030 movel %d4,%a2@(48)
the_watchdog->user_data = user_data;
6b5c8: 42aa 0034 clrl %a2@(52)
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
6b5cc: 2542 001c movel %d2,%a2@(28)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
6b5d0: 486a 0010 pea %a2@(16)
6b5d4: 4879 0009 7606 pea 97606 <_Watchdog_Ticks_chain>
6b5da: 4eb9 0004 8f4c jsr 48f4c <_Watchdog_Insert>
id,
NULL
);
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
6b5e0: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch>
6b5e6: 4fef 000c lea %sp@(12),%sp
6b5ea: 606a bras 6b656 <rtems_rate_monotonic_period+0x136>
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
6b5ec: 7202 moveq #2,%d1
6b5ee: b280 cmpl %d0,%d1
6b5f0: 6668 bnes 6b65a <rtems_rate_monotonic_period+0x13a>
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
6b5f2: 2f0a movel %a2,%sp@-
6b5f4: 4eba fde2 jsr %pc@(6b3d8 <_Rate_monotonic_Update_statistics>)
/*
* This tells the _Rate_monotonic_Timeout that this task is
* in the process of blocking on the period and that we
* may be changing the length of the next period.
*/
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
6b5f8: 7001 moveq #1,%d0
the_period->next_length = length;
6b5fa: 2542 003c movel %d2,%a2@(60)
/*
* This tells the _Rate_monotonic_Timeout that this task is
* in the process of blocking on the period and that we
* may be changing the length of the next period.
*/
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
6b5fe: 2540 0038 movel %d0,%a2@(56)
the_period->next_length = length;
_ISR_Enable( level );
6b602: 46c3 movew %d3,%sr
_Thread_Executing->Wait.id = the_period->Object.id;
6b604: 2079 0009 79b2 moveal 979b2 <_Per_CPU_Information+0xe>,%a0
6b60a: 216a 0008 0020 movel %a2@(8),%a0@(32)
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
6b610: 4878 4000 pea 4000 <D_MAX_EXP+0x3801>
6b614: 2f08 movel %a0,%sp@-
6b616: 4eb9 0004 8bfc jsr 48bfc <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
6b61c: 203c 0000 0700 movel #1792,%d0
6b622: 40c1 movew %sr,%d1
6b624: 8081 orl %d1,%d0
6b626: 46c0 movew %d0,%sr
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
6b628: 7402 moveq #2,%d2
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
local_state = the_period->state;
6b62a: 202a 0038 movel %a2@(56),%d0
the_period->state = RATE_MONOTONIC_ACTIVE;
6b62e: 2542 0038 movel %d2,%a2@(56)
_ISR_Enable( level );
6b632: 46c1 movew %d1,%sr
/*
* If it did, then we want to unblock ourself and continue as
* if nothing happen. The period was reset in the timeout routine.
*/
if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING )
6b634: 7203 moveq #3,%d1
6b636: 4fef 000c lea %sp@(12),%sp
6b63a: b280 cmpl %d0,%d1
6b63c: 6612 bnes 6b650 <rtems_rate_monotonic_period+0x130>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
6b63e: 4878 4000 pea 4000 <D_MAX_EXP+0x3801>
6b642: 2f39 0009 79b2 movel 979b2 <_Per_CPU_Information+0xe>,%sp@-
6b648: 4eb9 0004 8100 jsr 48100 <_Thread_Clear_state>
6b64e: 508f addql #8,%sp
_Thread_Enable_dispatch();
6b650: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
6b656: 4282 clrl %d2
6b658: 604c bras 6b6a6 <rtems_rate_monotonic_period+0x186>
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
6b65a: 7204 moveq #4,%d1
6b65c: b280 cmpl %d0,%d1
6b65e: 6644 bnes 6b6a4 <rtems_rate_monotonic_period+0x184><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
6b660: 2f0a movel %a2,%sp@-
6b662: 4eba fd74 jsr %pc@(6b3d8 <_Rate_monotonic_Update_statistics>)
_ISR_Enable( level );
6b666: 46c3 movew %d3,%sr
the_period->state = RATE_MONOTONIC_ACTIVE;
6b668: 7002 moveq #2,%d0
the_period->next_length = length;
6b66a: 2542 003c movel %d2,%a2@(60)
*/
_Rate_monotonic_Update_statistics( the_period );
_ISR_Enable( level );
the_period->state = RATE_MONOTONIC_ACTIVE;
6b66e: 2540 0038 movel %d0,%a2@(56)
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
6b672: 2542 001c movel %d2,%a2@(28)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
6b676: 486a 0010 pea %a2@(16)
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
6b67a: 7406 moveq #6,%d2
6b67c: 4879 0009 7606 pea 97606 <_Watchdog_Ticks_chain>
6b682: 4eb9 0004 8f4c jsr 48f4c <_Watchdog_Insert>
6b688: 2f2a 003c movel %a2@(60),%sp@-
6b68c: 2f2a 0040 movel %a2@(64),%sp@-
6b690: 2079 0009 2820 moveal 92820 <_Scheduler+0x34>,%a0
6b696: 4e90 jsr %a0@
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
6b698: 4eb9 0004 8474 jsr 48474 <_Thread_Enable_dispatch>
6b69e: 4fef 0014 lea %sp@(20),%sp
6b6a2: 6002 bras 6b6a6 <rtems_rate_monotonic_period+0x186>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
6b6a4: 7404 moveq #4,%d2
}
6b6a6: 2002 movel %d2,%d0
6b6a8: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2
6b6ae: 4e5e unlk %fp
...
00047228 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
47228: 4e56 ffec linkw %fp,#-20
4722c: 202e 000c movel %fp@(12),%d0
47230: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
47234: 286e 0008 moveal %fp@(8),%a4
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
47238: 2600 movel %d0,%d3
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
4723a: 242c 002e movel %a4@(46),%d2
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
4723e: 4c42 3001 remul %d2,%d1,%d3
if (excess > 0) {
47242: 4a81 tstl %d1
47244: 6700 0090 beqw 472d6 <rtems_rbheap_allocate+0xae>
value += alignment - excess;
47248: d480 addl %d0,%d2 <== NOT EXECUTED
4724a: 9481 subl %d1,%d2 <== NOT EXECUTED
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
4724c: 4a80 tstl %d0 <== NOT EXECUTED
4724e: 6606 bnes 47256 <rtems_rbheap_allocate+0x2e> <== NOT EXECUTED
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
47250: 4280 clrl %d0
47252: 6000 008a braw 472de <rtems_rbheap_allocate+0xb6>
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
47256: b480 cmpl %d0,%d2 <== NOT EXECUTED
47258: 65f6 bcss 47250 <rtems_rbheap_allocate+0x28> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4725a: 224c moveal %a4,%a1
size_t size
)
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
4725c: 95ca subal %a2,%a2
4725e: 2059 moveal %a1@+,%a0
47260: 600a bras 4726c <rtems_rbheap_allocate+0x44>
while (current != tail && big_enough == NULL) {
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
47262: b4a8 001c cmpl %a0@(28),%d2
47266: 6202 bhis 4726a <rtems_rbheap_allocate+0x42>
47268: 2448 moveal %a0,%a2
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
4726a: 2050 moveal %a0@,%a0
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
4726c: b3c8 cmpal %a0,%a1
4726e: 6606 bnes 47276 <rtems_rbheap_allocate+0x4e>
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
47270: 4a8a tstl %a2
47272: 6606 bnes 4727a <rtems_rbheap_allocate+0x52>
47274: 60da bras 47250 <rtems_rbheap_allocate+0x28>
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
47276: 4a8a tstl %a2
47278: 67e8 beqs 47262 <rtems_rbheap_allocate+0x3a> <== ALWAYS TAKEN
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
uintptr_t free_size = free_chunk->size;
4727a: 262a 001c movel %a2@(28),%d3
if (free_size > aligned_size) {
4727e: b483 cmpl %d3,%d2
47280: 643c bccs 472be <rtems_rbheap_allocate+0x96>
rtems_rbheap_chunk *new_chunk = get_chunk(control);
47282: 2f0c movel %a4,%sp@-
47284: 4eba fe50 jsr %pc@(470d6 <get_chunk>)
if (new_chunk != NULL) {
47288: 588f addql #4,%sp
if (free_chunk != NULL) {
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
4728a: 2640 moveal %d0,%a3
if (new_chunk != NULL) {
4728c: 4a80 tstl %d0
4728e: 67c0 beqs 47250 <rtems_rbheap_allocate+0x28> <== NEVER TAKEN
uintptr_t new_free_size = free_size - aligned_size;
47290: 9682 subl %d2,%d3
free_chunk->size = new_free_size;
47292: 2543 001c movel %d3,%a2@(28)
new_chunk->begin = free_chunk->begin + new_free_size;
47296: d6aa 0018 addl %a2@(24),%d3
new_chunk->size = aligned_size;
4729a: 2742 001c movel %d2,%a3@(28)
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
4729e: 2743 0018 movel %d3,%a3@(24)
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
472a2: 42ab 0004 clrl %a3@(4)
472a6: 4293 clrl %a3@
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
472a8: 486b 0008 pea %a3@(8)
472ac: 486c 0018 pea %a4@(24)
472b0: 4eb9 0004 89b8 jsr 489b8 <_RBTree_Insert_unprotected>
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
new_chunk->size = aligned_size;
rtems_chain_set_off_chain(&new_chunk->chain_node);
insert_into_tree(chunk_tree, new_chunk);
ptr = (void *) new_chunk->begin;
472b6: 202b 0018 movel %a3@(24),%d0
472ba: 508f addql #8,%sp
472bc: 6020 bras 472de <rtems_rbheap_allocate+0xb6>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
472be: 2252 moveal %a2@,%a1
previous = the_node->previous;
472c0: 206a 0004 moveal %a2@(4),%a0
next->previous = previous;
472c4: 2348 0004 movel %a0,%a1@(4)
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
472c8: 202a 0018 movel %a2@(24),%d0
previous->next = next;
472cc: 2089 movel %a1,%a0@
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
472ce: 42aa 0004 clrl %a2@(4)
472d2: 4292 clrl %a2@
472d4: 6008 bras 472de <rtems_rbheap_allocate+0xb6>
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
472d6: 2400 movel %d0,%d2
472d8: 6680 bnes 4725a <rtems_rbheap_allocate+0x32>
472da: 6000 ff74 braw 47250 <rtems_rbheap_allocate+0x28>
}
}
}
return ptr;
}
472de: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
472e4: 4e5e unlk %fp <== NOT EXECUTED
000473e0 <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
473e0: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED
473e4: 2f0a movel %a2,%sp@- <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
473e6: 4878 0020 pea 20 <OPER2+0xc> <== NOT EXECUTED
{
/* Do nothing */
}
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
473ea: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
473ee: 4eb9 0004 3294 jsr 43294 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
473f4: 588f addql #4,%sp <== NOT EXECUTED
473f6: 4a80 tstl %d0 <== NOT EXECUTED
473f8: 671a beqs 47414 <rtems_rbheap_extend_descriptors_with_malloc+0x34><== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
473fa: 43ea 000c lea %a2@(12),%a1 <== NOT EXECUTED
473fe: 2040 moveal %d0,%a0 <== NOT EXECUTED
47400: 2149 0004 movel %a1,%a0@(4) <== NOT EXECUTED
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
47404: 206a 000c moveal %a2@(12),%a0 <== NOT EXECUTED
after_node->next = the_node;
the_node->next = before_node;
47408: 2240 moveal %d0,%a1 <== NOT EXECUTED
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
4740a: 2540 000c movel %d0,%a2@(12) <== NOT EXECUTED
the_node->next = before_node;
before_node->previous = the_node;
4740e: 2140 0004 movel %d0,%a0@(4) <== NOT EXECUTED
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
47412: 2288 movel %a0,%a1@ <== NOT EXECUTED
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
47414: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
47418: 4e5e unlk %fp <== NOT EXECUTED
000472e8 <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
472e8: 4e56 ffc8 linkw %fp,#-56
472ec: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
472f0: 266e 0008 moveal %fp@(8),%a3
472f4: 246e 000c moveal %fp@(12),%a2
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
472f8: 4a8a tstl %a2
472fa: 6700 00c8 beqw 473c4 <rtems_rbheap_free+0xdc>
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
472fe: 4878 0020 pea 20 <OPER2+0xc>
return rtems_rbheap_chunk_of_node(
47302: 260e movel %fp,%d3
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
47304: 49eb 0018 lea %a3@(24),%a4
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
47308: 4282 clrl %d2
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
return rtems_rbheap_chunk_of_node(
4730a: 0683 ffff ffe8 addil #-24,%d3
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
47310: 42a7 clrl %sp@-
47312: 486e ffe0 pea %fp@(-32)
47316: 4eb9 0004 e6a8 jsr 4e6a8 <memset>
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
4731c: 4fef 000c lea %sp@(12),%sp
47320: 2d4a fff8 movel %a2,%fp@(-8)
47324: 246b 001c moveal %a3@(28),%a2
47328: 6026 bras 47350 <rtems_rbheap_free+0x68>
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
4732a: 2f0a movel %a2,%sp@-
4732c: 2f03 movel %d3,%sp@-
4732e: 206c 0010 moveal %a4@(16),%a0
47332: 4e90 jsr %a0@
if ( _RBTree_Is_equal( compare_result ) ) {
47334: 508f addql #8,%sp
47336: 4a80 tstl %d0
47338: 6608 bnes 47342 <rtems_rbheap_free+0x5a>
found = iter_node;
if ( the_rbtree->is_unique )
4733a: 4a2c 0014 tstb %a4@(20)
4733e: 6616 bnes 47356 <rtems_rbheap_free+0x6e> <== ALWAYS TAKEN
47340: 240a movel %a2,%d2 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
47342: 4a80 tstl %d0
47344: 5ec0 sgt %d0
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
47346: 7201 moveq #1,%d1
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
47348: 49c0 extbl %d0
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
4734a: 9280 subl %d0,%d1
4734c: 2472 1c00 moveal %a2@(00000000,%d1:l:4),%a2
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
47350: 4a8a tstl %a2
47352: 66d6 bnes 4732a <rtems_rbheap_free+0x42>
47354: 2442 moveal %d2,%a2
return rtems_rbheap_chunk_of_node(
47356: 518a subql #8,%a2
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
47358: 70f8 moveq #-8,%d0
4735a: b08a cmpl %a2,%d0
4735c: 676a beqs 473c8 <rtems_rbheap_free+0xe0>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
4735e: 4a92 tstl %a2@
47360: 660c bnes 4736e <rtems_rbheap_free+0x86>
47362: 4aaa 0004 tstl %a2@(4)
47366: 57c0 seq %d0
47368: 49c0 extbl %d0
4736a: 4480 negl %d0
4736c: 6002 bras 47370 <rtems_rbheap_free+0x88>
4736e: 4280 clrl %d0
if (!rtems_rbheap_is_chunk_free(chunk)) {
47370: 0800 0000 btst #0,%d0
47374: 6756 beqs 473cc <rtems_rbheap_free+0xe4>
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
47376: 42a7 clrl %sp@-
47378: 240a movel %a2,%d2
4737a: 5082 addql #8,%d2
4737c: 4bf9 0004 8ba4 lea 48ba4 <_RBTree_Next_unprotected>,%a5
47382: 2f02 movel %d2,%sp@-
47384: 4e95 jsr %a5@
47386: 4878 0001 pea 1 <ADD>
4738a: 2600 movel %d0,%d3
4738c: 2f02 movel %d2,%sp@-
4738e: 4e95 jsr %a5@
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT);
rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT);
check_and_merge(free_chain, chunk_tree, chunk, succ);
47390: 4bfa fcbe lea %pc@(47050 <check_and_merge>),%a5
47394: 5180 subql #8,%d0
47396: 2f00 movel %d0,%sp@-
47398: 2f0a movel %a2,%sp@-
4739a: 2f0c movel %a4,%sp@-
4739c: 2f0b movel %a3,%sp@-
4739e: 4e95 jsr %a5@
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
473a0: 2053 moveal %a3@,%a0
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
473a2: 4fef 0020 lea %sp@(32),%sp
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
473a6: 254b 0004 movel %a3,%a2@(4)
before_node = after_node->next;
after_node->next = the_node;
473aa: 268a movel %a2,%a3@
the_node->next = before_node;
before_node->previous = the_node;
473ac: 214a 0004 movel %a2,%a0@(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;
473b0: 2488 movel %a0,%a2@
473b2: 2043 moveal %d3,%a0
473b4: 4868 fff8 pea %a0@(-8)
473b8: 2f0a movel %a2,%sp@-
473ba: 2f0c movel %a4,%sp@-
473bc: 2f0b movel %a3,%sp@-
473be: 4e95 jsr %a5@
473c0: 4fef 0010 lea %sp@(16),%sp
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
473c4: 4280 clrl %d0
473c6: 6006 bras 473ce <rtems_rbheap_free+0xe6>
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
}
} else {
sc = RTEMS_INVALID_ID;
473c8: 7004 moveq #4,%d0
473ca: 6002 bras 473ce <rtems_rbheap_free+0xe6>
check_and_merge(free_chain, chunk_tree, chunk, succ);
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
473cc: 700e moveq #14,%d0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
473ce: 4cee 3c0c ffc8 moveml %fp@(-56),%d2-%d3/%a2-%a5
473d4: 4e5e unlk %fp <== NOT EXECUTED
000510b8 <rtems_region_get_segment_size>:
rtems_status_code rtems_region_get_segment_size(
rtems_id id,
void *segment,
uintptr_t *size
)
{
510b8: 4e56 fffc linkw %fp,#-4
510bc: 2f03 movel %d3,%sp@-
510be: 262e 0010 movel %fp@(16),%d3
510c2: 2f02 movel %d2,%sp@-
510c4: 242e 000c movel %fp@(12),%d2
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
register Region_Control *the_region;
if ( !segment )
510c8: 6768 beqs 51132 <rtems_region_get_segment_size+0x7a>
return RTEMS_INVALID_ADDRESS;
if ( !size )
510ca: 4a83 tstl %d3
510cc: 6764 beqs 51132 <rtems_region_get_segment_size+0x7a>
return RTEMS_INVALID_ADDRESS;
_RTEMS_Lock_allocator();
510ce: 2f39 0007 74fe movel 774fe <_RTEMS_Allocator_Mutex>,%sp@-
510d4: 4eb9 0005 3154 jsr 53154 <_API_Mutex_Lock>
510da: 486e fffc pea %fp@(-4)
510de: 2f2e 0008 movel %fp@(8),%sp@-
510e2: 4879 0007 736e pea 7736e <_Region_Information>
510e8: 4eb9 0005 4c10 jsr 54c10 <_Objects_Get_no_protection>
the_region = _Region_Get( id, &location );
switch ( location ) {
510ee: 222e fffc movel %fp@(-4),%d1
510f2: 4fef 0010 lea %sp@(16),%sp
510f6: 6708 beqs 51100 <rtems_region_get_segment_size+0x48>
510f8: 7001 moveq #1,%d0
510fa: b081 cmpl %d1,%d0
510fc: 671e beqs 5111c <rtems_region_get_segment_size+0x64><== ALWAYS TAKEN
510fe: 6018 bras 51118 <rtems_region_get_segment_size+0x60><== NOT EXECUTED
case OBJECTS_LOCAL:
if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) )
51100: 2f03 movel %d3,%sp@-
51102: 2040 moveal %d0,%a0
51104: 2f02 movel %d2,%sp@-
51106: 4868 0068 pea %a0@(104)
5110a: 4eb9 0005 4658 jsr 54658 <_Heap_Size_of_alloc_area>
51110: 4fef 000c lea %sp@(12),%sp
51114: 4a00 tstb %d0
51116: 6708 beqs 51120 <rtems_region_get_segment_size+0x68><== NEVER TAKEN
void *segment,
uintptr_t *size
)
{
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
51118: 4282 clrl %d2
5111a: 6006 bras 51122 <rtems_region_get_segment_size+0x6a>
case OBJECTS_REMOTE: /* this error cannot be returned */
break;
#endif
case OBJECTS_ERROR:
return_status = RTEMS_INVALID_ID;
5111c: 7404 moveq #4,%d2
5111e: 6002 bras 51122 <rtems_region_get_segment_size+0x6a>
the_region = _Region_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) )
return_status = RTEMS_INVALID_ADDRESS;
51120: 7409 moveq #9,%d2 <== NOT EXECUTED
case OBJECTS_ERROR:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
51122: 2f39 0007 74fe movel 774fe <_RTEMS_Allocator_Mutex>,%sp@-
51128: 4eb9 0005 31b4 jsr 531b4 <_API_Mutex_Unlock>
5112e: 588f addql #4,%sp
51130: 6002 bras 51134 <rtems_region_get_segment_size+0x7c>
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
register Region_Control *the_region;
if ( !segment )
return RTEMS_INVALID_ADDRESS;
51132: 7409 moveq #9,%d2
break;
}
_RTEMS_Unlock_allocator();
return return_status;
}
51134: 2002 movel %d2,%d0
51136: 242e fff4 movel %fp@(-12),%d2
5113a: 262e fff8 movel %fp@(-8),%d3
5113e: 4e5e unlk %fp
...
00046968 <rtems_shutdown_executive>:
void rtems_shutdown_executive(
uint32_t result
)
{
if ( _System_state_Is_up( _System_state_Get() ) ) {
46968: 7003 moveq #3,%d0
*/
void rtems_shutdown_executive(
uint32_t result
)
{
4696a: 4e56 0000 linkw %fp,#0
if ( _System_state_Is_up( _System_state_Get() ) ) {
4696e: b0b9 0005 f30a cmpl 5f30a <_System_state_Current>,%d0
46974: 6624 bnes 4699a <rtems_shutdown_executive+0x32>
#if defined(RTEMS_SMP)
_SMP_Request_other_cores_to_shutdown();
#endif
_Per_CPU_Information[0].idle->Wait.return_code = result;
46976: 2079 0005 f326 moveal 5f326 <_Per_CPU_Information+0x16>,%a0
4697c: 103c 0004 moveb #4,%d0
46980: 216e 0008 0034 movel %fp@(8),%a0@(52)
* if we were running within the same context, it would work.
*
* And we will not return to this thread, so there is no point of
* saving the context.
*/
_Context_Restart_self( &_Thread_BSP_context );
46986: 4879 0005 eea2 pea 5eea2 <_Thread_BSP_context>
4698c: 23c0 0005 f30a movel %d0,5f30a <_System_state_Current>
46992: 4eb9 0004 953a jsr 4953a <_CPU_Context_Restart_self>
46998: 588f addql #4,%sp <== NOT EXECUTED
****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ******
****** AND THEN TO BOOT_CARD() ******
*******************************************************************
*******************************************************************/
}
_Internal_error_Occurred(
4699a: 4878 0014 pea 14 <OPER2>
4699e: 4878 0001 pea 1 <ADD>
469a2: 42a7 clrl %sp@-
469a4: 4eb9 0004 7550 jsr 47550 <_Internal_error_Occurred>
...
00051718 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
51718: 4e56 fffc linkw %fp,#-4
5171c: 2f03 movel %d3,%sp@-
5171e: 2f02 movel %d2,%sp@-
51720: 242e 000c movel %fp@(12),%d2
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
51724: 6776 beqs 5179c <rtems_signal_send+0x84>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
51726: 486e fffc pea %fp@(-4)
5172a: 2f2e 0008 movel %fp@(8),%sp@-
5172e: 4eb9 0005 58d8 jsr 558d8 <_Thread_Get>
switch ( location ) {
51734: 508f addql #8,%sp
51736: 4aae fffc tstl %fp@(-4)
5173a: 6664 bnes 517a0 <rtems_signal_send+0x88>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
5173c: 2240 moveal %d0,%a1
5173e: 2069 00fa moveal %a1@(250),%a0
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
51742: 4aa8 000a tstl %a0@(10)
51746: 674a beqs 51792 <rtems_signal_send+0x7a>
51748: 223c 0000 0700 movel #1792,%d1
if ( asr->is_enabled ) {
5174e: 4a28 0008 tstb %a0@(8)
51752: 6726 beqs 5177a <rtems_signal_send+0x62>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
51754: 40c3 movew %sr,%d3
51756: 8283 orl %d3,%d1
51758: 46c1 movew %d1,%sr
*signal_set |= signals;
5175a: 85a8 0012 orl %d2,%a0@(18)
_ISR_Enable( _level );
5175e: 46c3 movew %d3,%sr
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
51760: 4ab9 0007 78c4 tstl 778c4 <_Per_CPU_Information+0x8>
51766: 6720 beqs 51788 <rtems_signal_send+0x70>
51768: b0b9 0007 78ca cmpl 778ca <_Per_CPU_Information+0xe>,%d0
5176e: 6618 bnes 51788 <rtems_signal_send+0x70> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
51770: 7001 moveq #1,%d0
51772: 13c0 0007 78c8 moveb %d0,778c8 <_Per_CPU_Information+0xc>
51778: 600e bras 51788 <rtems_signal_send+0x70>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
5177a: 2001 movel %d1,%d0
5177c: 40c1 movew %sr,%d1
5177e: 8081 orl %d1,%d0
51780: 46c0 movew %d0,%sr
*signal_set |= signals;
51782: 85a8 0016 orl %d2,%a0@(22)
_ISR_Enable( _level );
51786: 46c1 movew %d1,%sr
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
51788: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
5178e: 4280 clrl %d0
51790: 6010 bras 517a2 <rtems_signal_send+0x8a>
}
_Thread_Enable_dispatch();
51792: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
51798: 700b moveq #11,%d0
5179a: 6006 bras 517a2 <rtems_signal_send+0x8a>
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
5179c: 700a moveq #10,%d0
5179e: 6002 bras 517a2 <rtems_signal_send+0x8a>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
517a0: 7004 moveq #4,%d0
}
517a2: 242e fff4 movel %fp@(-12),%d2
517a6: 262e fff8 movel %fp@(-8),%d3
517aa: 4e5e unlk %fp
...
0004e9c0 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
4e9c0: 4e56 ffe4 linkw %fp,#-28
4e9c4: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@
4e9c8: 262e 0008 movel %fp@(8),%d3
4e9cc: 282e 000c movel %fp@(12),%d4
4e9d0: 286e 0010 moveal %fp@(16),%a4
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
4e9d4: 4a8c tstl %a4
4e9d6: 6700 0108 beqw 4eae0 <rtems_task_mode+0x120>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
4e9da: 2679 0006 2c52 moveal 62c52 <_Per_CPU_Information+0xe>,%a3
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
4e9e0: 4a2b 0070 tstb %a3@(112)
4e9e4: 57c2 seq %d2
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
4e9e6: 246b 00fa moveal %a3@(250),%a2
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
4e9ea: 49c2 extbl %d2
4e9ec: 0282 0000 0100 andil #256,%d2
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
4e9f2: 4aab 0076 tstl %a3@(118)
4e9f6: 6704 beqs 4e9fc <rtems_task_mode+0x3c>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
4e9f8: 08c2 0009 bset #9,%d2
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
4e9fc: 4a2a 0008 tstb %a2@(8)
4ea00: 57c5 seq %d5
old_mode |= _ISR_Get_level();
4ea02: 4eb9 0004 a81c jsr 4a81c <_CPU_ISR_Get_level>
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
4ea08: 49c5 extbl %d5
4ea0a: 0285 0000 0400 andil #1024,%d5
4ea10: 8085 orl %d5,%d0
old_mode |= _ISR_Get_level();
4ea12: 8082 orl %d2,%d0
4ea14: 2880 movel %d0,%a4@
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
4ea16: 0804 0008 btst #8,%d4
4ea1a: 670e beqs 4ea2a <rtems_task_mode+0x6a>
4ea1c: 2203 movel %d3,%d1
4ea1e: 7001 moveq #1,%d0
4ea20: e089 lsrl #8,%d1
4ea22: b181 eorl %d0,%d1
4ea24: c280 andl %d0,%d1
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
4ea26: 1741 0070 moveb %d1,%a3@(112)
if ( mask & RTEMS_TIMESLICE_MASK ) {
4ea2a: 0804 0009 btst #9,%d4
4ea2e: 671c beqs 4ea4c <rtems_task_mode+0x8c>
if ( _Modes_Is_timeslice(mode_set) ) {
4ea30: 0803 0009 btst #9,%d3
4ea34: 6712 beqs 4ea48 <rtems_task_mode+0x88>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
4ea36: 41f9 0006 27c2 lea 627c2 <_Thread_Ticks_per_timeslice>,%a0
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4ea3c: 7201 moveq #1,%d1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
4ea3e: 2750 0072 movel %a0@,%a3@(114)
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4ea42: 2741 0076 movel %d1,%a3@(118)
4ea46: 6004 bras 4ea4c <rtems_task_mode+0x8c>
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
4ea48: 42ab 0076 clrl %a3@(118)
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
4ea4c: 7007 moveq #7,%d0
4ea4e: c084 andl %d4,%d0
4ea50: 6712 beqs 4ea64 <rtems_task_mode+0xa4>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
4ea52: 40c1 movew %sr,%d1
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
4ea54: 7007 moveq #7,%d0
4ea56: c083 andl %d3,%d0
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
4ea58: 0281 0000 f8ff andil #63743,%d1
4ea5e: e188 lsll #8,%d0
4ea60: 8280 orl %d0,%d1
4ea62: 46c1 movew %d1,%sr
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
4ea64: 0804 000a btst #10,%d4
4ea68: 6742 beqs 4eaac <rtems_task_mode+0xec>
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
4ea6a: 720a moveq #10,%d1
4ea6c: 2003 movel %d3,%d0
4ea6e: e2a8 lsrl %d1,%d0
4ea70: 123c 0001 moveb #1,%d1
4ea74: b380 eorl %d1,%d0
4ea76: c081 andl %d1,%d0
if ( is_asr_enabled != asr->is_enabled ) {
4ea78: 4281 clrl %d1
4ea7a: 122a 0008 moveb %a2@(8),%d1
4ea7e: b280 cmpl %d0,%d1
4ea80: 672a beqs 4eaac <rtems_task_mode+0xec>
asr->is_enabled = is_asr_enabled;
4ea82: 1540 0008 moveb %d0,%a2@(8)
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
4ea86: 203c 0000 0700 movel #1792,%d0
4ea8c: 40c1 movew %sr,%d1
4ea8e: 8081 orl %d1,%d0
4ea90: 46c0 movew %d0,%sr
_signals = information->signals_pending;
4ea92: 202a 0016 movel %a2@(22),%d0
information->signals_pending = information->signals_posted;
4ea96: 256a 0012 0016 movel %a2@(18),%a2@(22)
information->signals_posted = _signals;
4ea9c: 2540 0012 movel %d0,%a2@(18)
_ISR_Enable( _level );
4eaa0: 46c1 movew %d1,%sr
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
4eaa2: 4aaa 0012 tstl %a2@(18)
4eaa6: 56c0 sne %d0
4eaa8: 4480 negl %d0
4eaaa: 6002 bras 4eaae <rtems_task_mode+0xee>
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
4eaac: 4200 clrb %d0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
4eaae: 7203 moveq #3,%d1
4eab0: b2b9 0006 2c3e cmpl 62c3e <_System_state_Current>,%d1
4eab6: 662c bnes 4eae4 <rtems_task_mode+0x124>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
4eab8: 2079 0006 2c52 moveal 62c52 <_Per_CPU_Information+0xe>,%a0
if ( are_signals_pending ||
4eabe: 4a00 tstb %d0
4eac0: 660e bnes 4ead0 <rtems_task_mode+0x110>
4eac2: b1f9 0006 2c56 cmpal 62c56 <_Per_CPU_Information+0x12>,%a0
4eac8: 671a beqs 4eae4 <rtems_task_mode+0x124>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
4eaca: 4a28 0070 tstb %a0@(112)
4eace: 6714 beqs 4eae4 <rtems_task_mode+0x124> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
4ead0: 7001 moveq #1,%d0
4ead2: 13c0 0006 2c50 moveb %d0,62c50 <_Per_CPU_Information+0xc>
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
4ead8: 4eb9 0004 97cc jsr 497cc <_Thread_Dispatch>
4eade: 6004 bras 4eae4 <rtems_task_mode+0x124>
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
4eae0: 7009 moveq #9,%d0
4eae2: 6002 bras 4eae6 <rtems_task_mode+0x126>
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
4eae4: 4280 clrl %d0
}
4eae6: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
4eaec: 4e5e unlk %fp <== NOT EXECUTED
00049df0 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
49df0: 4e56 fffc linkw %fp,#-4
49df4: 2f0a movel %a2,%sp@-
49df6: 246e 0010 moveal %fp@(16),%a2
49dfa: 2f02 movel %d2,%sp@-
49dfc: 242e 000c movel %fp@(12),%d2
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
49e00: 670c beqs 49e0e <rtems_task_set_priority+0x1e>
RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{
return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
49e02: 4280 clrl %d0
49e04: 1039 0006 0dfc moveb 60dfc <rtems_maximum_priority>,%d0
49e0a: b082 cmpl %d2,%d0
49e0c: 654e bcss 49e5c <rtems_task_set_priority+0x6c>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
49e0e: 4a8a tstl %a2
49e10: 674e beqs 49e60 <rtems_task_set_priority+0x70>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
49e12: 486e fffc pea %fp@(-4)
49e16: 2f2e 0008 movel %fp@(8),%sp@-
49e1a: 4eb9 0004 bf88 jsr 4bf88 <_Thread_Get>
switch ( location ) {
49e20: 508f addql #8,%sp
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
49e22: 2040 moveal %d0,%a0
switch ( location ) {
49e24: 4aae fffc tstl %fp@(-4)
49e28: 663a bnes 49e64 <rtems_task_set_priority+0x74>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
49e2a: 24a8 0014 movel %a0@(20),%a2@
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
49e2e: 4a82 tstl %d2
49e30: 6720 beqs 49e52 <rtems_task_set_priority+0x62>
the_thread->real_priority = new_priority;
49e32: 2142 0018 movel %d2,%a0@(24)
if ( the_thread->resource_count == 0 ||
49e36: 4aa8 001c tstl %a0@(28)
49e3a: 6706 beqs 49e42 <rtems_task_set_priority+0x52>
49e3c: b4a8 0014 cmpl %a0@(20),%d2
49e40: 6410 bccs 49e52 <rtems_task_set_priority+0x62> <== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
49e42: 42a7 clrl %sp@-
49e44: 2f02 movel %d2,%sp@-
49e46: 2f08 movel %a0,%sp@-
49e48: 4eb9 0004 bb18 jsr 4bb18 <_Thread_Change_priority>
49e4e: 4fef 000c lea %sp@(12),%sp
}
_Thread_Enable_dispatch();
49e52: 4eb9 0004 bf68 jsr 4bf68 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
49e58: 4280 clrl %d0
49e5a: 600a bras 49e66 <rtems_task_set_priority+0x76>
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
49e5c: 7013 moveq #19,%d0
49e5e: 6006 bras 49e66 <rtems_task_set_priority+0x76>
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
49e60: 7009 moveq #9,%d0
49e62: 6002 bras 49e66 <rtems_task_set_priority+0x76>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
49e64: 7004 moveq #4,%d0
}
49e66: 242e fff4 movel %fp@(-12),%d2
49e6a: 246e fff8 moveal %fp@(-8),%a2
49e6e: 4e5e unlk %fp
...
00044984 <rtems_task_variable_get>:
rtems_status_code rtems_task_variable_get(
rtems_id tid,
void **ptr,
void **result
)
{
44984: 4e56 fffc linkw %fp,#-4
44988: 2f0a movel %a2,%sp@-
4498a: 246e 0010 moveal %fp@(16),%a2
4498e: 2f02 movel %d2,%sp@-
44990: 242e 000c movel %fp@(12),%d2
Thread_Control *the_thread;
Objects_Locations location;
rtems_task_variable_t *tvp;
if ( !ptr )
44994: 6742 beqs 449d8 <rtems_task_variable_get+0x54> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( !result )
44996: 4a8a tstl %a2
44998: 673e beqs 449d8 <rtems_task_variable_get+0x54> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get (tid, &location);
4499a: 486e fffc pea %fp@(-4)
4499e: 2f2e 0008 movel %fp@(8),%sp@-
449a2: 4eb9 0004 6414 jsr 46414 <_Thread_Get>
switch (location) {
449a8: 508f addql #8,%sp
449aa: 4aae fffc tstl %fp@(-4)
449ae: 662c bnes 449dc <rtems_task_variable_get+0x58>
case OBJECTS_LOCAL:
/*
* Figure out if the variable is in this task's list.
*/
tvp = the_thread->task_variables;
449b0: 2240 moveal %d0,%a1
449b2: 2069 0106 moveal %a1@(262),%a0
while (tvp) {
449b6: 6016 bras 449ce <rtems_task_variable_get+0x4a>
if (tvp->ptr == ptr) {
449b8: b4a8 0004 cmpl %a0@(4),%d2
449bc: 660e bnes 449cc <rtems_task_variable_get+0x48>
/*
* Should this return the current (i.e not the
* saved) value if `tid' is the current task?
*/
*result = tvp->tval;
449be: 24a8 000c movel %a0@(12),%a2@
_Thread_Enable_dispatch();
449c2: 4eb9 0004 63f4 jsr 463f4 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
449c8: 4280 clrl %d0
449ca: 6012 bras 449de <rtems_task_variable_get+0x5a>
}
tvp = (rtems_task_variable_t *)tvp->next;
449cc: 2050 moveal %a0@,%a0
case OBJECTS_LOCAL:
/*
* Figure out if the variable is in this task's list.
*/
tvp = the_thread->task_variables;
while (tvp) {
449ce: 4a88 tstl %a0
449d0: 66e6 bnes 449b8 <rtems_task_variable_get+0x34>
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
tvp = (rtems_task_variable_t *)tvp->next;
}
_Thread_Enable_dispatch();
449d2: 4eb9 0004 63f4 jsr 463f4 <_Thread_Enable_dispatch>
Thread_Control *the_thread;
Objects_Locations location;
rtems_task_variable_t *tvp;
if ( !ptr )
return RTEMS_INVALID_ADDRESS;
449d8: 7009 moveq #9,%d0
449da: 6002 bras 449de <rtems_task_variable_get+0x5a>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
449dc: 7004 moveq #4,%d0
}
449de: 242e fff4 movel %fp@(-12),%d2
449e2: 246e fff8 moveal %fp@(-8),%a2
449e6: 4e5e unlk %fp
...
00052028 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
52028: 4e56 fffc linkw %fp,#-4
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
5202c: 486e fffc pea %fp@(-4)
52030: 2f2e 0008 movel %fp@(8),%sp@-
52034: 4879 0007 7ce6 pea 77ce6 <_Timer_Information>
5203a: 4eb9 0005 4c48 jsr 54c48 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
52040: 4fef 000c lea %sp@(12),%sp
52044: 4aae fffc tstl %fp@(-4)
52048: 6620 bnes 5206a <rtems_timer_cancel+0x42>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
5204a: 7204 moveq #4,%d1
5204c: 2040 moveal %d0,%a0
5204e: b2a8 0038 cmpl %a0@(56),%d1
52052: 670c beqs 52060 <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
52054: 4868 0010 pea %a0@(16)
52058: 4eb9 0005 6644 jsr 56644 <_Watchdog_Remove>
5205e: 588f addql #4,%sp
_Thread_Enable_dispatch();
52060: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
52066: 4280 clrl %d0
52068: 6002 bras 5206c <rtems_timer_cancel+0x44>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
5206a: 7004 moveq #4,%d0
}
5206c: 4e5e unlk %fp <== NOT EXECUTED
000523a0 <rtems_timer_reset>:
*/
rtems_status_code rtems_timer_reset(
rtems_id id
)
{
523a0: 4e56 fffc linkw %fp,#-4
523a4: 2f0b movel %a3,%sp@-
523a6: 2f0a movel %a2,%sp@-
523a8: 486e fffc pea %fp@(-4)
523ac: 2f2e 0008 movel %fp@(8),%sp@-
523b0: 4879 0007 7ce6 pea 77ce6 <_Timer_Information>
523b6: 4eb9 0005 4c48 jsr 54c48 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
rtems_status_code status = RTEMS_SUCCESSFUL;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
523bc: 4fef 000c lea %sp@(12),%sp
523c0: 2440 moveal %d0,%a2
523c2: 4aae fffc tstl %fp@(-4)
523c6: 6656 bnes 5241e <rtems_timer_reset+0x7e> <== NEVER TAKEN
case OBJECTS_LOCAL:
if ( the_timer->the_class == TIMER_INTERVAL ) {
523c8: 202a 0038 movel %a2@(56),%d0
523cc: 661c bnes 523ea <rtems_timer_reset+0x4a>
_Watchdog_Remove( &the_timer->Ticker );
523ce: 45ea 0010 lea %a2@(16),%a2
523d2: 2f0a movel %a2,%sp@-
523d4: 4eb9 0005 6644 jsr 56644 <_Watchdog_Remove>
_Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker );
523da: 2f0a movel %a2,%sp@-
523dc: 4879 0007 7516 pea 77516 <_Watchdog_Ticks_chain>
523e2: 4eb9 0005 6520 jsr 56520 <_Watchdog_Insert>
523e8: 6020 bras 5240a <rtems_timer_reset+0x6a>
} else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) {
523ea: 7201 moveq #1,%d1
523ec: b280 cmpl %d0,%d1
523ee: 6622 bnes 52412 <rtems_timer_reset+0x72> <== NEVER TAKEN
if ( !timer_server ) {
_Thread_Enable_dispatch();
return RTEMS_INCORRECT_STATE;
}
#endif
_Watchdog_Remove( &the_timer->Ticker );
523f0: 486a 0010 pea %a2@(16)
case OBJECTS_LOCAL:
if ( the_timer->the_class == TIMER_INTERVAL ) {
_Watchdog_Remove( &the_timer->Ticker );
_Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker );
} else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) {
Timer_server_Control *timer_server = _Timer_server;
523f4: 2679 0007 7d20 moveal 77d20 <_Timer_server>,%a3
if ( !timer_server ) {
_Thread_Enable_dispatch();
return RTEMS_INCORRECT_STATE;
}
#endif
_Watchdog_Remove( &the_timer->Ticker );
523fa: 4eb9 0005 6644 jsr 56644 <_Watchdog_Remove>
(*timer_server->schedule_operation)( timer_server, the_timer );
52400: 2f0a movel %a2,%sp@-
52402: 2f0b movel %a3,%sp@-
52404: 206b 0004 moveal %a3@(4),%a0
52408: 4e90 jsr %a0@
5240a: 4fef 000c lea %sp@(12),%sp
rtems_id id
)
{
Timer_Control *the_timer;
Objects_Locations location;
rtems_status_code status = RTEMS_SUCCESSFUL;
5240e: 95ca subal %a2,%a2
52410: 6004 bras 52416 <rtems_timer_reset+0x76>
/*
* Must be dormant or time of day timer (e.g. TIMER_DORMANT,
* TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We
* can only reset active interval timers.
*/
status = RTEMS_NOT_DEFINED;
52412: 347c 000b moveaw #11,%a2
}
_Thread_Enable_dispatch();
52416: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch>
5241c: 6004 bras 52422 <rtems_timer_reset+0x82>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
5241e: 347c 0004 moveaw #4,%a2
}
52422: 200a movel %a2,%d0
52424: 246e fff4 moveal %fp@(-12),%a2
52428: 266e fff8 moveal %fp@(-8),%a3
5242c: 4e5e unlk %fp <== NOT EXECUTED
000524f0 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
524f0: 4e56 ffe4 linkw %fp,#-28
524f4: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@
524f8: 262e 0008 movel %fp@(8),%d3
524fc: 242e 000c movel %fp@(12),%d2
52500: 282e 0010 movel %fp@(16),%d4
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
52504: 2679 0007 7d20 moveal 77d20 <_Timer_server>,%a3
if ( !timer_server )
5250a: 4a8b tstl %a3
5250c: 6700 00cc beqw 525da <rtems_timer_server_fire_when+0xea>
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
52510: 4a39 0007 7430 tstb 77430 <_TOD+0x14>
52516: 6700 00c6 beqw 525de <rtems_timer_server_fire_when+0xee>
return RTEMS_NOT_DEFINED;
if ( !routine )
5251a: 4a84 tstl %d4
5251c: 6700 00c4 beqw 525e2 <rtems_timer_server_fire_when+0xf2>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
52520: 2f02 movel %d2,%sp@-
52522: 4eb9 0004 f77c jsr 4f77c <_TOD_Validate>
52528: 588f addql #4,%sp
5252a: 4a00 tstb %d0
5252c: 6606 bnes 52534 <rtems_timer_server_fire_when+0x44>
return RTEMS_INVALID_CLOCK;
5252e: 7014 moveq #20,%d0
52530: 6000 00b6 braw 525e8 <rtems_timer_server_fire_when+0xf8>
seconds = _TOD_To_seconds( wall_time );
52534: 2f02 movel %d2,%sp@-
52536: 49f9 0006 6f48 lea 66f48 <__divdi3>,%a4
5253c: 4eb9 0004 f6d8 jsr 4f6d8 <_TOD_To_seconds>
52542: 2400 movel %d0,%d2
52544: 2f3c 3b9a ca00 movel #1000000000,%sp@-
5254a: 42a7 clrl %sp@-
5254c: 2f39 0007 7420 movel 77420 <_TOD+0x4>,%sp@-
52552: 2f39 0007 741c movel 7741c <_TOD>,%sp@-
52558: 4e94 jsr %a4@
if ( seconds <= _TOD_Seconds_since_epoch() )
5255a: 4fef 0014 lea %sp@(20),%sp
5255e: b282 cmpl %d2,%d1
52560: 64cc bccs 5252e <rtems_timer_server_fire_when+0x3e>
52562: 486e fffc pea %fp@(-4)
52566: 2f03 movel %d3,%sp@-
52568: 4879 0007 7ce6 pea 77ce6 <_Timer_Information>
5256e: 4eb9 0005 4c48 jsr 54c48 <_Objects_Get>
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
52574: 4fef 000c lea %sp@(12),%sp
52578: 2440 moveal %d0,%a2
5257a: 4aae fffc tstl %fp@(-4)
5257e: 6666 bnes 525e6 <rtems_timer_server_fire_when+0xf6>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
52580: 486a 0010 pea %a2@(16)
52584: 4eb9 0005 6644 jsr 56644 <_Watchdog_Remove>
the_watchdog->user_data = user_data;
5258a: 256e 0014 0034 movel %fp@(20),%a2@(52)
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
52590: 7003 moveq #3,%d0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
52592: 42aa 0018 clrl %a2@(24)
52596: 2540 0038 movel %d0,%a2@(56)
the_watchdog->routine = routine;
5259a: 2544 002c movel %d4,%a2@(44)
the_watchdog->id = id;
5259e: 2543 0030 movel %d3,%a2@(48)
525a2: 2f3c 3b9a ca00 movel #1000000000,%sp@-
525a8: 42a7 clrl %sp@-
525aa: 2f39 0007 7420 movel 77420 <_TOD+0x4>,%sp@-
525b0: 2f39 0007 741c movel 7741c <_TOD>,%sp@-
525b6: 4e94 jsr %a4@
525b8: 4fef 0010 lea %sp@(16),%sp
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
525bc: 9481 subl %d1,%d2
525be: 2542 001c movel %d2,%a2@(28)
(*timer_server->schedule_operation)( timer_server, the_timer );
525c2: 2f0a movel %a2,%sp@-
525c4: 2f0b movel %a3,%sp@-
525c6: 206b 0004 moveal %a3@(4),%a0
525ca: 4e90 jsr %a0@
_Thread_Enable_dispatch();
525cc: 4eb9 0005 58b8 jsr 558b8 <_Thread_Enable_dispatch>
525d2: 4fef 000c lea %sp@(12),%sp
return RTEMS_SUCCESSFUL;
525d6: 4280 clrl %d0
525d8: 600e bras 525e8 <rtems_timer_server_fire_when+0xf8>
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
525da: 700e moveq #14,%d0
525dc: 600a bras 525e8 <rtems_timer_server_fire_when+0xf8>
if ( !_TOD.is_set )
return RTEMS_NOT_DEFINED;
525de: 700b moveq #11,%d0 <== NOT EXECUTED
525e0: 6006 bras 525e8 <rtems_timer_server_fire_when+0xf8><== NOT EXECUTED
if ( !routine )
return RTEMS_INVALID_ADDRESS;
525e2: 7009 moveq #9,%d0
525e4: 6002 bras 525e8 <rtems_timer_server_fire_when+0xf8>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
525e6: 7004 moveq #4,%d0
}
525e8: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4
525ee: 4e5e unlk %fp
...
00046c60 <rtems_workspace_greedy_free>:
void rtems_workspace_greedy_free( void *opaque )
{
46c60: 4e56 0000 linkw %fp,#0
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46c64: 2239 0006 0782 movel 60782 <_Thread_Dispatch_disable_level>,%d1
++level;
46c6a: 5281 addql #1,%d1
46c6c: 202e 0008 movel %fp@(8),%d0
_Thread_Dispatch_disable_level = level;
46c70: 23c1 0006 0782 movel %d1,60782 <_Thread_Dispatch_disable_level>
_Thread_Disable_dispatch();
_Heap_Greedy_free( &_Workspace_Area, opaque );
46c76: 2f00 movel %d0,%sp@-
46c78: 4879 0006 0792 pea 60792 <_Workspace_Area>
46c7e: 4eb9 0004 77a0 jsr 477a0 <_Heap_Greedy_free>
_Thread_Enable_dispatch();
46c84: 508f addql #8,%sp
}
46c86: 4e5e unlk %fp
void rtems_workspace_greedy_free( void *opaque )
{
_Thread_Disable_dispatch();
_Heap_Greedy_free( &_Workspace_Area, opaque );
_Thread_Enable_dispatch();
46c88: 4ef9 0004 8c38 jmp 48c38 <_Thread_Enable_dispatch>
...
000468fc <sched_get_priority_max>:
int sched_get_priority_max(
int policy
)
{
switch ( policy ) {
468fc: 7004 moveq #4,%d0
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
468fe: 4e56 0000 linkw %fp,#0
46902: 222e 0008 movel %fp@(8),%d1
switch ( policy ) {
46906: b081 cmpl %d1,%d0
46908: 650c bcss 46916 <sched_get_priority_max+0x1a>
4690a: 103c 0001 moveb #1,%d0
4690e: e3a8 lsll %d1,%d0
46910: 7217 moveq #23,%d1
46912: c081 andl %d1,%d0
46914: 6610 bnes 46926 <sched_get_priority_max+0x2a> <== ALWAYS TAKEN
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
46916: 4eb9 0004 dab4 jsr 4dab4 <__errno>
4691c: 2040 moveal %d0,%a0
4691e: 7016 moveq #22,%d0
46920: 2080 movel %d0,%a0@
46922: 70ff moveq #-1,%d0
46924: 600a bras 46930 <sched_get_priority_max+0x34>
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
46926: 4280 clrl %d0
46928: 1039 0005 e4ec moveb 5e4ec <rtems_maximum_priority>,%d0
4692e: 5380 subql #1,%d0
}
46930: 4e5e unlk %fp <== NOT EXECUTED
00046934 <sched_get_priority_min>:
*/
int sched_get_priority_min(
int policy
)
{
switch ( policy ) {
46934: 7004 moveq #4,%d0
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_min(
int policy
)
{
46936: 4e56 0000 linkw %fp,#0
4693a: 222e 0008 movel %fp@(8),%d1
switch ( policy ) {
4693e: b081 cmpl %d1,%d0
46940: 650c bcss 4694e <sched_get_priority_min+0x1a>
46942: 103c 0001 moveb #1,%d0
46946: e3a8 lsll %d1,%d0
46948: 7217 moveq #23,%d1
4694a: c081 andl %d1,%d0
4694c: 6610 bnes 4695e <sched_get_priority_min+0x2a> <== ALWAYS TAKEN
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
4694e: 4eb9 0004 dab4 jsr 4dab4 <__errno>
46954: 2040 moveal %d0,%a0
46956: 7016 moveq #22,%d0
46958: 2080 movel %d0,%a0@
4695a: 70ff moveq #-1,%d0
4695c: 6002 bras 46960 <sched_get_priority_min+0x2c>
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
4695e: 7001 moveq #1,%d0
}
46960: 4e5e unlk %fp <== NOT EXECUTED
00046964 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
46964: 4e56 0000 linkw %fp,#0
46968: 2f03 movel %d3,%sp@-
4696a: 262e 0008 movel %fp@(8),%d3
4696e: 2f02 movel %d2,%sp@-
46970: 242e 000c movel %fp@(12),%d2
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
46974: 4a83 tstl %d3
46976: 6718 beqs 46990 <sched_rr_get_interval+0x2c> <== NEVER TAKEN
46978: 4eb9 0004 2f9c jsr 42f9c <getpid>
4697e: b083 cmpl %d3,%d0
46980: 670e beqs 46990 <sched_rr_get_interval+0x2c>
rtems_set_errno_and_return_minus_one( ESRCH );
46982: 4eb9 0004 dab4 jsr 4dab4 <__errno>
46988: 7203 moveq #3,%d1
4698a: 2040 moveal %d0,%a0
4698c: 2081 movel %d1,%a0@
4698e: 6010 bras 469a0 <sched_rr_get_interval+0x3c>
if ( !interval )
46990: 4a82 tstl %d2
46992: 6610 bnes 469a4 <sched_rr_get_interval+0x40>
rtems_set_errno_and_return_minus_one( EINVAL );
46994: 4eb9 0004 dab4 jsr 4dab4 <__errno>
4699a: 2040 moveal %d0,%a0
4699c: 7016 moveq #22,%d0
4699e: 2080 movel %d0,%a0@
469a0: 70ff moveq #-1,%d0
469a2: 6012 bras 469b6 <sched_rr_get_interval+0x52>
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
469a4: 2f02 movel %d2,%sp@-
469a6: 2f39 0005 fd8e movel 5fd8e <_Thread_Ticks_per_timeslice>,%sp@-
469ac: 4eb9 0004 9d44 jsr 49d44 <_Timespec_From_ticks>
return 0;
469b2: 508f addql #8,%sp
469b4: 4280 clrl %d0
}
469b6: 242e fff8 movel %fp@(-8),%d2
469ba: 262e fffc movel %fp@(-4),%d3
469be: 4e5e unlk %fp
...
00046e08 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
46e08: 4e56 ffdc linkw %fp,#-36
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46e0c: 2039 0006 3440 movel 63440 <_Thread_Dispatch_disable_level>,%d0
++level;
46e12: 5280 addql #1,%d0
46e14: 48d7 043c moveml %d2-%d5/%a2,%sp@
46e18: 262e 0008 movel %fp@(8),%d3
46e1c: 282e 000c movel %fp@(12),%d4
_Thread_Dispatch_disable_level = level;
46e20: 23c0 0006 3440 movel %d0,63440 <_Thread_Dispatch_disable_level>
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
46e26: 2a04 movel %d4,%d5
46e28: 0285 0000 0200 andil #512,%d5
46e2e: 6706 beqs 46e36 <sem_open+0x2e>
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
46e30: 246e 0014 moveal %fp@(20),%a2
46e34: 6002 bras 46e38 <sem_open+0x30>
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
46e36: 95ca subal %a2,%a2
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
46e38: 486e fffc pea %fp@(-4)
46e3c: 486e fff0 pea %fp@(-16)
46e40: 2f03 movel %d3,%sp@-
46e42: 4879 0006 365c pea 6365c <_POSIX_Semaphore_Information>
46e48: 4eb9 0004 6894 jsr 46894 <_POSIX_Name_to_id>
* and we can just return a pointer to the id. Otherwise we may
* need to check to see if this is a "semaphore does not exist"
* or some other miscellaneous error on the name.
*/
if ( status ) {
46e4e: 4fef 0010 lea %sp@(16),%sp
46e52: 2400 movel %d0,%d2
46e54: 671c beqs 46e72 <sem_open+0x6a>
/*
* Unless provided a valid name that did not already exist
* and we are willing to create then it is an error.
*/
if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
46e56: 7002 moveq #2,%d0
46e58: b082 cmpl %d2,%d0
46e5a: 6604 bnes 46e60 <sem_open+0x58>
46e5c: 4a85 tstl %d5
46e5e: 6662 bnes 46ec2 <sem_open+0xba>
_Thread_Enable_dispatch();
46e60: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
46e66: 4eb9 0004 ea90 jsr 4ea90 <__errno>
46e6c: 2040 moveal %d0,%a0
46e6e: 2082 movel %d2,%a0@
46e70: 607e bras 46ef0 <sem_open+0xe8>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
46e72: 0284 0000 0a00 andil #2560,%d4
46e78: 0c84 0000 0a00 cmpil #2560,%d4
46e7e: 6614 bnes 46e94 <sem_open+0x8c>
_Thread_Enable_dispatch();
46e80: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
46e86: 4eb9 0004 ea90 jsr 4ea90 <__errno>
46e8c: 2040 moveal %d0,%a0
46e8e: 7011 moveq #17,%d0
46e90: 2080 movel %d0,%a0@
46e92: 605c bras 46ef0 <sem_open+0xe8>
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
46e94: 486e fff8 pea %fp@(-8)
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
_Thread_Enable_dispatch();
46e98: 45f9 0004 9fdc lea 49fdc <_Thread_Enable_dispatch>,%a2
46e9e: 2f2e fff0 movel %fp@(-16),%sp@-
46ea2: 4879 0006 365c pea 6365c <_POSIX_Semaphore_Information>
46ea8: 4eb9 0004 9318 jsr 49318 <_Objects_Get>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
46eae: 2040 moveal %d0,%a0
46eb0: 52a8 0016 addql #1,%a0@(22)
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
46eb4: 2d40 fff4 movel %d0,%fp@(-12)
the_semaphore->open_count += 1;
_Thread_Enable_dispatch();
46eb8: 4e92 jsr %a2@
_Thread_Enable_dispatch();
46eba: 4e92 jsr %a2@
goto return_id;
46ebc: 4fef 000c lea %sp@(12),%sp
46ec0: 6026 bras 46ee8 <sem_open+0xe0>
/*
* At this point, the semaphore does not exist and everything has been
* checked. We should go ahead and create a semaphore.
*/
status =_POSIX_Semaphore_Create_support(
46ec2: 486e fff4 pea %fp@(-12)
46ec6: 2f0a movel %a2,%sp@-
46ec8: 42a7 clrl %sp@-
46eca: 2f2e fffc movel %fp@(-4),%sp@-
46ece: 2f03 movel %d3,%sp@-
46ed0: 4eb9 0004 c93c jsr 4c93c <_POSIX_Semaphore_Create_support>
46ed6: 2400 movel %d0,%d2
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
46ed8: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
if ( status == -1 )
46ede: 4fef 0014 lea %sp@(20),%sp
46ee2: 70ff moveq #-1,%d0
46ee4: b082 cmpl %d2,%d0
46ee6: 6708 beqs 46ef0 <sem_open+0xe8> <== NEVER TAKEN
return_id:
#if defined(RTEMS_USE_16_BIT_OBJECT)
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
46ee8: 202e fff4 movel %fp@(-12),%d0
46eec: 5080 addql #8,%d0
46eee: 6002 bras 46ef2 <sem_open+0xea>
*/
_Thread_Enable_dispatch();
if ( status == -1 )
return SEM_FAILED;
46ef0: 70ff moveq #-1,%d0
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
#endif
}
46ef2: 4cee 043c ffdc moveml %fp@(-36),%d2-%d5/%a2
46ef8: 4e5e unlk %fp <== NOT EXECUTED
00046828 <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
46828: 4e56 fff0 linkw %fp,#-16
4682c: 222e 0010 movel %fp@(16),%d1
46830: 48d7 041c moveml %d2-%d4/%a2,%sp@
46834: 242e 0008 movel %fp@(8),%d2
46838: 246e 000c moveal %fp@(12),%a2
ISR_Level level;
if ( oact )
4683c: 4a81 tstl %d1
4683e: 6722 beqs 46862 <sigaction+0x3a>
*oact = _POSIX_signals_Vectors[ sig ];
46840: 2602 movel %d2,%d3
46842: 2002 movel %d2,%d0
46844: 4878 000c pea c <OPER1>
46848: e58b lsll #2,%d3
4684a: e988 lsll #4,%d0
4684c: 9083 subl %d3,%d0
4684e: 0680 0006 0ef8 addil #397048,%d0
46854: 2f00 movel %d0,%sp@-
46856: 2f01 movel %d1,%sp@-
46858: 4eb9 0004 e5c8 jsr 4e5c8 <memcpy>
4685e: 4fef 000c lea %sp@(12),%sp
if ( !sig )
46862: 4a82 tstl %d2
46864: 6602 bnes 46868 <sigaction+0x40>
46866: 6012 bras 4687a <sigaction+0x52>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
46868: 2002 movel %d2,%d0
4686a: 5380 subql #1,%d0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
4686c: 721f moveq #31,%d1
4686e: b280 cmpl %d0,%d1
46870: 6402 bccs 46874 <sigaction+0x4c>
46872: 6006 bras 4687a <sigaction+0x52>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
46874: 7009 moveq #9,%d0
46876: b082 cmpl %d2,%d0
46878: 6610 bnes 4688a <sigaction+0x62>
rtems_set_errno_and_return_minus_one( EINVAL );
4687a: 4eb9 0004 dd90 jsr 4dd90 <__errno>
46880: 2040 moveal %d0,%a0
46882: 7016 moveq #22,%d0
46884: 2080 movel %d0,%a0@
46886: 70ff moveq #-1,%d0
46888: 6068 bras 468f2 <sigaction+0xca>
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
4688a: 4a8a tstl %a2
4688c: 6762 beqs 468f0 <sigaction+0xc8> <== NEVER TAKEN
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
4688e: 203c 0000 0700 movel #1792,%d0
46894: 40c4 movew %sr,%d4
46896: 8084 orl %d4,%d0
46898: 46c0 movew %d0,%sr
4689a: 2602 movel %d2,%d3
4689c: e58b lsll #2,%d3
if ( act->sa_handler == SIG_DFL ) {
4689e: 4aaa 0008 tstl %a2@(8)
468a2: 6626 bnes 468ca <sigaction+0xa2>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
468a4: 4878 000c pea c <OPER1>
468a8: e98a lsll #4,%d2
468aa: 9483 subl %d3,%d2
468ac: 2002 movel %d2,%d0
468ae: 0680 0005 e556 addil #386390,%d0
468b4: 0682 0006 0ef8 addil #397048,%d2
468ba: 2f00 movel %d0,%sp@-
468bc: 2f02 movel %d2,%sp@-
468be: 4eb9 0004 e5c8 jsr 4e5c8 <memcpy>
468c4: 4fef 000c lea %sp@(12),%sp
468c8: 6024 bras 468ee <sigaction+0xc6>
} else {
_POSIX_signals_Clear_process_signals( sig );
468ca: 2f02 movel %d2,%sp@-
_POSIX_signals_Vectors[ sig ] = *act;
468cc: e98a lsll #4,%d2
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
468ce: 4eb9 0004 b8f8 jsr 4b8f8 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
468d4: 4878 000c pea c <OPER1>
468d8: 9483 subl %d3,%d2
468da: 0682 0006 0ef8 addil #397048,%d2
468e0: 2f0a movel %a2,%sp@-
468e2: 2f02 movel %d2,%sp@-
468e4: 4eb9 0004 e5c8 jsr 4e5c8 <memcpy>
468ea: 4fef 0010 lea %sp@(16),%sp
}
_ISR_Enable( level );
468ee: 46c4 movew %d4,%sr
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
468f0: 4280 clrl %d0
}
468f2: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
468f8: 4e5e unlk %fp <== NOT EXECUTED
00046cb8 <sigtimedwait>:
int sigtimedwait(
const sigset_t *set,
siginfo_t *info,
const struct timespec *timeout
)
{
46cb8: 4e56 ffdc linkw %fp,#-36
46cbc: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@
46cc0: 266e 0008 moveal %fp@(8),%a3
46cc4: 246e 000c moveal %fp@(12),%a2
46cc8: 242e 0010 movel %fp@(16),%d2
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
46ccc: 4a8b tstl %a3
46cce: 6602 bnes 46cd2 <sigtimedwait+0x1a>
46cd0: 6030 bras 46d02 <sigtimedwait+0x4a>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
if ( timeout ) {
46cd2: 4a82 tstl %d2
46cd4: 673c beqs 46d12 <sigtimedwait+0x5a>
if ( !_Timespec_Is_valid( timeout ) )
46cd6: 2f02 movel %d2,%sp@-
46cd8: 4eb9 0004 a18c jsr 4a18c <_Timespec_Is_valid>
46cde: 588f addql #4,%sp
46ce0: 4a00 tstb %d0
46ce2: 6610 bnes 46cf4 <sigtimedwait+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
46ce4: 4eb9 0004 e348 jsr 4e348 <__errno>
46cea: 7616 moveq #22,%d3
46cec: 2240 moveal %d0,%a1
46cee: 2283 movel %d3,%a1@
46cf0: 6000 0142 braw 46e34 <sigtimedwait+0x17c>
interval = _Timespec_To_ticks( timeout );
46cf4: 2f02 movel %d2,%sp@-
46cf6: 4eb9 0004 a1b4 jsr 4a1b4 <_Timespec_To_ticks>
if ( !interval )
46cfc: 588f addql #4,%sp
46cfe: 4a80 tstl %d0
46d00: 6612 bnes 46d14 <sigtimedwait+0x5c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
46d02: 4eb9 0004 e348 jsr 4e348 <__errno>
46d08: 7416 moveq #22,%d2
46d0a: 2040 moveal %d0,%a0
46d0c: 2082 movel %d2,%a0@
46d0e: 6000 0124 braw 46e34 <sigtimedwait+0x17c>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
46d12: 4280 clrl %d0
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
46d14: 4a8a tstl %a2
46d16: 6604 bnes 46d1c <sigtimedwait+0x64>
46d18: 45ee fff4 lea %fp@(-12),%a2
the_thread = _Thread_Executing;
46d1c: 2079 0006 12ae moveal 612ae <_Per_CPU_Information+0xe>,%a0
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
46d22: 223c 0000 0700 movel #1792,%d1
the_info = ( info ) ? info : &signal_information;
the_thread = _Thread_Executing;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
46d28: 2868 00fe moveal %a0@(254),%a4
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
46d2c: 40c3 movew %sr,%d3
46d2e: 8283 orl %d3,%d1
46d30: 46c1 movew %d1,%sr
if ( *set & api->signals_pending ) {
46d32: 2413 movel %a3@,%d2
46d34: 2802 movel %d2,%d4
46d36: 222c 00d4 movel %a4@(212),%d1
46d3a: c881 andl %d1,%d4
46d3c: 6728 beqs 46d66 <sigtimedwait+0xae>
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
46d3e: 2f01 movel %d1,%sp@-
46d40: 4eba ff2a jsr %pc@(46c6c <_POSIX_signals_Get_lowest>)
46d44: 2480 movel %d0,%a2@
_POSIX_signals_Clear_signals(
46d46: 4297 clrl %sp@
46d48: 42a7 clrl %sp@-
46d4a: 2f0a movel %a2,%sp@-
46d4c: 2f00 movel %d0,%sp@-
46d4e: 2f0c movel %a4,%sp@-
46d50: 4eb9 0004 bfec jsr 4bfec <_POSIX_signals_Clear_signals>
the_info->si_signo,
the_info,
false,
false
);
_ISR_Enable( level );
46d56: 46c3 movew %d3,%sr
the_info->si_code = SI_USER;
46d58: 7001 moveq #1,%d0
the_info->si_value.sival_int = 0;
46d5a: 42aa 0008 clrl %a2@(8)
return the_info->si_signo;
46d5e: 2412 movel %a2@,%d2
false,
false
);
_ISR_Enable( level );
the_info->si_code = SI_USER;
46d60: 2540 0004 movel %d0,%a2@(4)
46d64: 6032 bras 46d98 <sigtimedwait+0xe0>
return the_info->si_signo;
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
46d66: 2239 0006 14dc movel 614dc <_POSIX_signals_Pending>,%d1
46d6c: c481 andl %d1,%d2
46d6e: 6730 beqs 46da0 <sigtimedwait+0xe8>
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
46d70: 2f01 movel %d1,%sp@-
46d72: 4eba fef8 jsr %pc@(46c6c <_POSIX_signals_Get_lowest>)
46d76: 2400 movel %d0,%d2
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
46d78: 4297 clrl %sp@
46d7a: 4878 0001 pea 1 <ADD>
46d7e: 2f0a movel %a2,%sp@-
46d80: 2f00 movel %d0,%sp@-
46d82: 2f0c movel %a4,%sp@-
46d84: 4eb9 0004 bfec jsr 4bfec <_POSIX_signals_Clear_signals>
_ISR_Enable( level );
46d8a: 46c3 movew %d3,%sr
the_info->si_signo = signo;
the_info->si_code = SI_USER;
46d8c: 7201 moveq #1,%d1
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
_ISR_Enable( level );
the_info->si_signo = signo;
46d8e: 2482 movel %d2,%a2@
the_info->si_code = SI_USER;
46d90: 2541 0004 movel %d1,%a2@(4)
the_info->si_value.sival_int = 0;
46d94: 42aa 0008 clrl %a2@(8)
46d98: 4fef 0014 lea %sp@(20),%sp
46d9c: 6000 0098 braw 46e36 <sigtimedwait+0x17e>
return signo;
}
the_info->si_signo = -1;
46da0: 72ff moveq #-1,%d1
46da2: 2481 movel %d1,%a2@
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46da4: 2239 0006 0e66 movel 60e66 <_Thread_Dispatch_disable_level>,%d1
++level;
46daa: 5281 addql #1,%d1
_Thread_Dispatch_disable_level = level;
46dac: 23c1 0006 0e66 movel %d1,60e66 <_Thread_Dispatch_disable_level>
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
the_thread->Wait.return_code = EINTR;
46db2: 7204 moveq #4,%d1
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
46db4: 43f9 0006 1474 lea 61474 <_POSIX_signals_Wait_queue>,%a1
the_thread->Wait.return_code = EINTR;
46dba: 2141 0034 movel %d1,%a0@(52)
the_thread->Wait.option = *set;
46dbe: 2153 0030 movel %a3@,%a0@(48)
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
46dc2: 123c 0001 moveb #1,%d1
the_thread->Wait.return_argument = the_info;
46dc6: 214a 0028 movel %a2,%a0@(40)
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
46dca: 2149 0044 movel %a1,%a0@(68)
46dce: 23c1 0006 14a4 movel %d1,614a4 <_POSIX_signals_Wait_queue+0x30>
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
the_thread->Wait.return_argument = the_info;
_Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
_ISR_Enable( level );
46dd4: 46c3 movew %d3,%sr
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
46dd6: 4879 0004 9fb0 pea 49fb0 <_Thread_queue_Timeout>
46ddc: 2f00 movel %d0,%sp@-
46dde: 4879 0006 1474 pea 61474 <_POSIX_signals_Wait_queue>
46de4: 4eb9 0004 9cc0 jsr 49cc0 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
46dea: 4eb9 0004 9878 jsr 49878 <_Thread_Enable_dispatch>
/*
* When the thread is set free by a signal, it is need to eliminate
* the signal.
*/
_POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false );
46df0: 42a7 clrl %sp@-
46df2: 42a7 clrl %sp@-
46df4: 2f0a movel %a2,%sp@-
46df6: 2f12 movel %a2@,%sp@-
46df8: 2f0c movel %a4,%sp@-
46dfa: 4eb9 0004 bfec jsr 4bfec <_POSIX_signals_Clear_signals>
/* Set errno only if return code is not EINTR or
* if EINTR was caused by a signal being caught, which
* was not in our set.
*/
if ( (_Thread_Executing->Wait.return_code != EINTR)
46e00: 2079 0006 12ae moveal 612ae <_Per_CPU_Information+0xe>,%a0
46e06: 4fef 0020 lea %sp@(32),%sp
46e0a: 7004 moveq #4,%d0
46e0c: b0a8 0034 cmpl %a0@(52),%d0
46e10: 6610 bnes 46e22 <sigtimedwait+0x16a>
|| !(*set & signo_to_mask( the_info->si_signo )) ) {
46e12: 2412 movel %a2@,%d2
46e14: 2202 movel %d2,%d1
46e16: 5381 subql #1,%d1
46e18: 103c 0001 moveb #1,%d0
46e1c: e3a8 lsll %d1,%d0
46e1e: c093 andl %a3@,%d0
46e20: 6614 bnes 46e36 <sigtimedwait+0x17e>
errno = _Thread_Executing->Wait.return_code;
46e22: 4eb9 0004 e348 jsr 4e348 <__errno>
46e28: 2079 0006 12ae moveal 612ae <_Per_CPU_Information+0xe>,%a0
46e2e: 2240 moveal %d0,%a1
46e30: 22a8 0034 movel %a0@(52),%a1@
return -1;
46e34: 74ff moveq #-1,%d2
}
return the_info->si_signo;
}
46e36: 2002 movel %d2,%d0
46e38: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4
46e3e: 4e5e unlk %fp
...
00048800 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
48800: 4e56 0000 linkw %fp,#0
48804: 2f0a movel %a2,%sp@-
48806: 246e 000c moveal %fp@(12),%a2
int status;
status = sigtimedwait( set, NULL, NULL );
4880a: 42a7 clrl %sp@-
4880c: 42a7 clrl %sp@-
4880e: 2f2e 0008 movel %fp@(8),%sp@-
48812: 4eb9 0004 865c jsr 4865c <sigtimedwait>
if ( status != -1 ) {
48818: 4fef 000c lea %sp@(12),%sp
4881c: 72ff moveq #-1,%d1
4881e: b280 cmpl %d0,%d1
48820: 6708 beqs 4882a <sigwait+0x2a>
if ( sig )
48822: 4a8a tstl %a2
48824: 6710 beqs 48836 <sigwait+0x36> <== NEVER TAKEN
*sig = status;
48826: 2480 movel %d0,%a2@
48828: 600c bras 48836 <sigwait+0x36>
return 0;
}
return errno;
4882a: 4eb9 0004 fa7c jsr 4fa7c <__errno>
48830: 2040 moveal %d0,%a0
48832: 2010 movel %a0@,%d0
48834: 6002 bras 48838 <sigwait+0x38>
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
48836: 4280 clrl %d0
}
return errno;
}
48838: 246e fffc moveal %fp@(-4),%a2
4883c: 4e5e unlk %fp <== NOT EXECUTED
00045d08 <sysconf>:
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
45d08: 7002 moveq #2,%d0
*/
long sysconf(
int name
)
{
45d0a: 4e56 0000 linkw %fp,#0
45d0e: 222e 0008 movel %fp@(8),%d1
45d12: 2f02 movel %d2,%sp@-
if ( name == _SC_CLK_TCK )
45d14: b081 cmpl %d1,%d0
45d16: 6612 bnes 45d2a <sysconf+0x22>
return (TOD_MICROSECONDS_PER_SECOND /
45d18: 41f9 0005 bc38 lea 5bc38 <Configuration+0xc>,%a0
45d1e: 203c 000f 4240 movel #1000000,%d0
45d24: 4c50 0000 remul %a0@,%d0,%d0
45d28: 6040 bras 45d6a <sysconf+0x62>
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
45d2a: 7004 moveq #4,%d0
45d2c: b081 cmpl %d1,%d0
45d2e: 6608 bnes 45d38 <sysconf+0x30>
return rtems_libio_number_iops;
45d30: 2039 0005 d9c4 movel 5d9c4 <rtems_libio_number_iops>,%d0
45d36: 6032 bras 45d6a <sysconf+0x62>
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
45d38: 203c 0000 0400 movel #1024,%d0
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
45d3e: 7433 moveq #51,%d2
45d40: b481 cmpl %d1,%d2
45d42: 6726 beqs 45d6a <sysconf+0x62>
return 1024;
if ( name == _SC_PAGESIZE )
45d44: 143c 0008 moveb #8,%d2
return PAGE_SIZE;
45d48: 303c 1000 movew #4096,%d0
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
45d4c: b481 cmpl %d1,%d2
45d4e: 671a beqs 45d6a <sysconf+0x62>
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
45d50: 143c 004f moveb #79,%d2
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
45d54: 303c 0020 movew #32,%d0
return 1024;
if ( name == _SC_PAGESIZE )
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
45d58: b481 cmpl %d1,%d2
45d5a: 670e beqs 45d6a <sysconf+0x62> <== NEVER TAKEN
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
45d5c: 4eb9 0004 d298 jsr 4d298 <__errno>
45d62: 2040 moveal %d0,%a0
45d64: 7016 moveq #22,%d0
45d66: 2080 movel %d0,%a0@
45d68: 70ff moveq #-1,%d0
}
45d6a: 242e fffc movel %fp@(-4),%d2
45d6e: 4e5e unlk %fp
...
00046efc <timer_create>:
timer_t *timerid
)
{
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
46efc: 7001 moveq #1,%d0
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
46efe: 4e56 0000 linkw %fp,#0
46f02: 2f0b movel %a3,%sp@-
46f04: 266e 0010 moveal %fp@(16),%a3
46f08: 2f0a movel %a2,%sp@-
46f0a: 246e 000c moveal %fp@(12),%a2
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
46f0e: b0ae 0008 cmpl %fp@(8),%d0
46f12: 6702 beqs 46f16 <timer_create+0x1a>
46f14: 6026 bras 46f3c <timer_create+0x40>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
46f16: 4a8b tstl %a3
46f18: 6602 bnes 46f1c <timer_create+0x20>
46f1a: 6020 bras 46f3c <timer_create+0x40>
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
*/
if (evp != NULL) {
46f1c: 4a8a tstl %a2
46f1e: 672a beqs 46f4a <timer_create+0x4e>
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
46f20: 2012 movel %a2@,%d0
46f22: 7201 moveq #1,%d1
46f24: 5380 subql #1,%d0
46f26: b280 cmpl %d0,%d1
46f28: 6402 bccs 46f2c <timer_create+0x30> <== ALWAYS TAKEN
46f2a: 6010 bras 46f3c <timer_create+0x40> <== NOT EXECUTED
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !evp->sigev_signo )
46f2c: 202a 0004 movel %a2@(4),%d0
46f30: 6602 bnes 46f34 <timer_create+0x38> <== ALWAYS TAKEN
46f32: 6008 bras 46f3c <timer_create+0x40> <== NOT EXECUTED
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
46f34: 5380 subql #1,%d0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
46f36: 721f moveq #31,%d1
46f38: b280 cmpl %d0,%d1
46f3a: 640e bccs 46f4a <timer_create+0x4e> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
46f3c: 4eb9 0004 ea90 jsr 4ea90 <__errno>
46f42: 7216 moveq #22,%d1
46f44: 2040 moveal %d0,%a0
46f46: 2081 movel %d1,%a0@
46f48: 6034 bras 46f7e <timer_create+0x82>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
46f4a: 2039 0006 3440 movel 63440 <_Thread_Dispatch_disable_level>,%d0
++level;
46f50: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
46f52: 23c0 0006 3440 movel %d0,63440 <_Thread_Dispatch_disable_level>
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
46f58: 4879 0006 3696 pea 63696 <_POSIX_Timer_Information>
46f5e: 4eb9 0004 8ea0 jsr 48ea0 <_Objects_Allocate>
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
46f64: 588f addql #4,%sp
46f66: 2040 moveal %d0,%a0
46f68: 4a80 tstl %d0
46f6a: 6616 bnes 46f82 <timer_create+0x86>
_Thread_Enable_dispatch();
46f6c: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
46f72: 4eb9 0004 ea90 jsr 4ea90 <__errno>
46f78: 2040 moveal %d0,%a0
46f7a: 700b moveq #11,%d0
46f7c: 2080 movel %d0,%a0@
46f7e: 70ff moveq #-1,%d0
46f80: 606e bras 46ff0 <timer_create+0xf4>
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
46f82: 7002 moveq #2,%d0
46f84: 1140 003c moveb %d0,%a0@(60)
ptimer->thread_id = _Thread_Executing->Object.id;
46f88: 2279 0006 38c2 moveal 638c2 <_Per_CPU_Information+0xe>,%a1
46f8e: 2169 0008 0038 movel %a1@(8),%a0@(56)
if ( evp != NULL ) {
46f94: 4a8a tstl %a2
46f96: 6710 beqs 46fa8 <timer_create+0xac>
ptimer->inf.sigev_notify = evp->sigev_notify;
46f98: 2152 003e movel %a2@,%a0@(62)
ptimer->inf.sigev_signo = evp->sigev_signo;
46f9c: 216a 0004 0042 movel %a2@(4),%a0@(66)
ptimer->inf.sigev_value = evp->sigev_value;
46fa2: 216a 0008 0046 movel %a2@(8),%a0@(70)
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
46fa8: 2028 0008 movel %a0@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
46fac: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
46fae: 2279 0006 36ae moveal 636ae <_POSIX_Timer_Information+0x18>,%a1
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
46fb4: 0281 0000 ffff andil #65535,%d1
}
ptimer->overrun = 0;
46fba: 42a8 0066 clrl %a0@(102)
ptimer->timer_data.it_value.tv_sec = 0;
46fbe: 42a8 005a clrl %a0@(90)
ptimer->timer_data.it_value.tv_nsec = 0;
46fc2: 42a8 005e clrl %a0@(94)
ptimer->timer_data.it_interval.tv_sec = 0;
46fc6: 42a8 0052 clrl %a0@(82)
ptimer->timer_data.it_interval.tv_nsec = 0;
46fca: 42a8 0056 clrl %a0@(86)
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
46fce: 42a8 0018 clrl %a0@(24)
the_watchdog->routine = routine;
46fd2: 42a8 002c clrl %a0@(44)
the_watchdog->id = id;
46fd6: 42a8 0030 clrl %a0@(48)
the_watchdog->user_data = user_data;
46fda: 42a8 0034 clrl %a0@(52)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
46fde: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4)
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
46fe2: 42a8 000c clrl %a0@(12)
_Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL );
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
46fe6: 2680 movel %d0,%a3@
_Thread_Enable_dispatch();
46fe8: 4eb9 0004 9fdc jsr 49fdc <_Thread_Enable_dispatch>
return 0;
46fee: 4280 clrl %d0
}
46ff0: 246e fff8 moveal %fp@(-8),%a2
46ff4: 266e fffc moveal %fp@(-4),%a3
46ff8: 4e5e unlk %fp <== NOT EXECUTED
00045f20 <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *value,
struct itimerspec *ovalue
)
{
45f20: 4e56 ffd0 linkw %fp,#-48
45f24: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
45f28: 246e 000c moveal %fp@(12),%a2
45f2c: 266e 0010 moveal %fp@(16),%a3
45f30: 242e 0014 movel %fp@(20),%d2
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
45f34: 4a8b tstl %a3
45f36: 6604 bnes 45f3c <timer_settime+0x1c> <== ALWAYS TAKEN
45f38: 6000 017a braw 460b4 <timer_settime+0x194> <== NOT EXECUTED
/*
* First, it verifies if the structure "value" is correct
* if the number of nanoseconds is not correct return EINVAL
*/
if ( !_Timespec_Is_valid( &(value->it_value) ) ) {
45f3c: 486b 0008 pea %a3@(8)
45f40: 49f9 0004 9590 lea 49590 <_Timespec_Is_valid>,%a4
45f46: 4e94 jsr %a4@
45f48: 588f addql #4,%sp
45f4a: 4a00 tstb %d0
45f4c: 6604 bnes 45f52 <timer_settime+0x32>
45f4e: 6000 0164 braw 460b4 <timer_settime+0x194>
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
45f52: 2f0b movel %a3,%sp@-
45f54: 4e94 jsr %a4@
45f56: 588f addql #4,%sp
45f58: 4a00 tstb %d0
45f5a: 6604 bnes 45f60 <timer_settime+0x40> <== ALWAYS TAKEN
45f5c: 6000 0156 braw 460b4 <timer_settime+0x194> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
45f60: 7004 moveq #4,%d0
45f62: b08a cmpl %a2,%d0
45f64: 6708 beqs 45f6e <timer_settime+0x4e>
45f66: 4a8a tstl %a2
45f68: 6704 beqs 45f6e <timer_settime+0x4e>
45f6a: 6000 0148 braw 460b4 <timer_settime+0x194>
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
45f6e: 4878 0010 pea 10 <INVALID_OPERATION>
45f72: 2f0b movel %a3,%sp@-
45f74: 486e fff0 pea %fp@(-16)
45f78: 4eb9 0004 e000 jsr 4e000 <memcpy>
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
45f7e: 4fef 000c lea %sp@(12),%sp
45f82: 7004 moveq #4,%d0
45f84: b08a cmpl %a2,%d0
45f86: 6634 bnes 45fbc <timer_settime+0x9c>
struct timespec now;
_TOD_Get( &now );
45f88: 45ee ffe8 lea %fp@(-24),%a2
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
45f8c: 260e movel %fp,%d3
45f8e: 5183 subql #8,%d3
normalize = *value;
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
struct timespec now;
_TOD_Get( &now );
45f90: 2f0a movel %a2,%sp@-
45f92: 4eba ff2c jsr %pc@(45ec0 <_TOD_Get>)
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
45f96: 2f0a movel %a2,%sp@-
45f98: 2f03 movel %d3,%sp@-
45f9a: 4eb9 0004 95b8 jsr 495b8 <_Timespec_Less_than>
45fa0: 4fef 000c lea %sp@(12),%sp
45fa4: 4a00 tstb %d0
45fa6: 6704 beqs 45fac <timer_settime+0x8c>
45fa8: 6000 010a braw 460b4 <timer_settime+0x194>
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
45fac: 2f03 movel %d3,%sp@-
45fae: 2f03 movel %d3,%sp@-
45fb0: 2f0a movel %a2,%sp@-
45fb2: 4eb9 0004 95e8 jsr 495e8 <_Timespec_Subtract>
45fb8: 4fef 000c lea %sp@(12),%sp
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
timer_t id,
Objects_Locations *location
)
{
return (POSIX_Timer_Control *)
45fbc: 486e ffe4 pea %fp@(-28)
45fc0: 2f2e 0008 movel %fp@(8),%sp@-
45fc4: 4879 0005 fb52 pea 5fb52 <_POSIX_Timer_Information>
45fca: 4eb9 0004 8080 jsr 48080 <_Objects_Get>
* something with the structure of times of the timer: to stop, start
* or start it again
*/
ptimer = _POSIX_Timer_Get( timerid, &location );
switch ( location ) {
45fd0: 4fef 000c lea %sp@(12),%sp
45fd4: 2440 moveal %d0,%a2
45fd6: 4aae ffe4 tstl %fp@(-28)
45fda: 6600 00d8 bnew 460b4 <timer_settime+0x194>
case OBJECTS_LOCAL:
/* First, it verifies if the timer must be stopped */
if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) {
45fde: 4aae fff8 tstl %fp@(-8)
45fe2: 664e bnes 46032 <timer_settime+0x112> <== NEVER TAKEN
45fe4: 4aae fffc tstl %fp@(-4)
45fe8: 6648 bnes 46032 <timer_settime+0x112> <== NEVER TAKEN
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
45fea: 486a 0010 pea %a2@(16)
45fee: 4eb9 0004 9960 jsr 49960 <_Watchdog_Remove>
/* The old data of the timer are returned */
if ( ovalue )
45ff4: 588f addql #4,%sp
45ff6: 4a82 tstl %d2
45ff8: 6714 beqs 4600e <timer_settime+0xee> <== NEVER TAKEN
*ovalue = ptimer->timer_data;
45ffa: 4878 0010 pea 10 <INVALID_OPERATION>
45ffe: 486a 0052 pea %a2@(82)
46002: 2f02 movel %d2,%sp@-
46004: 4eb9 0004 e000 jsr 4e000 <memcpy>
4600a: 4fef 000c lea %sp@(12),%sp
/* The new data are set */
ptimer->timer_data = normalize;
4600e: 4878 0010 pea 10 <INVALID_OPERATION>
46012: 486e fff0 pea %fp@(-16)
46016: 486a 0052 pea %a2@(82)
4601a: 4eb9 0004 e000 jsr 4e000 <memcpy>
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
46020: 7004 moveq #4,%d0
46022: 1540 003c moveb %d0,%a2@(60)
/* Returns with success */
_Thread_Enable_dispatch();
46026: 4eb9 0004 8c7c jsr 48c7c <_Thread_Enable_dispatch>
4602c: 4fef 000c lea %sp@(12),%sp
46030: 607e bras 460b0 <timer_settime+0x190>
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
46032: 2f0b movel %a3,%sp@-
46034: 47f9 0004 9630 lea 49630 <_Timespec_To_ticks>,%a3
4603a: 4e93 jsr %a3@
4603c: 2540 0062 movel %d0,%a2@(98)
initial_period = _Timespec_To_ticks( &normalize.it_value );
46040: 486e fff8 pea %fp@(-8)
46044: 4e93 jsr %a3@
activated = _POSIX_Timer_Insert_helper(
46046: 2f0a movel %a2,%sp@-
46048: 4879 0004 60cc pea 460cc <_POSIX_Timer_TSR>
4604e: 2f2a 0008 movel %a2@(8),%sp@-
46052: 2f00 movel %d0,%sp@-
46054: 486a 0010 pea %a2@(16)
46058: 4eb9 0004 b624 jsr 4b624 <_POSIX_Timer_Insert_helper>
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
4605e: 4fef 001c lea %sp@(28),%sp
46062: 4a00 tstb %d0
46064: 6608 bnes 4606e <timer_settime+0x14e>
_Thread_Enable_dispatch();
46066: 4eb9 0004 8c7c jsr 48c7c <_Thread_Enable_dispatch>
4606c: 6042 bras 460b0 <timer_settime+0x190>
/*
* The timer has been started and is running. So we return the
* old ones in "ovalue"
*/
if ( ovalue )
4606e: 4a82 tstl %d2
46070: 6714 beqs 46086 <timer_settime+0x166>
*ovalue = ptimer->timer_data;
46072: 4878 0010 pea 10 <INVALID_OPERATION>
46076: 486a 0052 pea %a2@(82)
4607a: 2f02 movel %d2,%sp@-
4607c: 4eb9 0004 e000 jsr 4e000 <memcpy>
46082: 4fef 000c lea %sp@(12),%sp
ptimer->timer_data = normalize;
46086: 4878 0010 pea 10 <INVALID_OPERATION>
4608a: 486e fff0 pea %fp@(-16)
4608e: 486a 0052 pea %a2@(82)
46092: 4eb9 0004 e000 jsr 4e000 <memcpy>
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
46098: 7003 moveq #3,%d0
4609a: 1540 003c moveb %d0,%a2@(60)
_TOD_Get( &ptimer->time );
4609e: 486a 006a pea %a2@(106)
460a2: 4eba fe1c jsr %pc@(45ec0 <_TOD_Get>)
_Thread_Enable_dispatch();
460a6: 4eb9 0004 8c7c jsr 48c7c <_Thread_Enable_dispatch>
460ac: 4fef 0010 lea %sp@(16),%sp
return 0;
460b0: 4280 clrl %d0
460b2: 600e bras 460c2 <timer_settime+0x1a2>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
460b4: 4eb9 0004 d7e0 jsr 4d7e0 <__errno>
460ba: 2040 moveal %d0,%a0
460bc: 7016 moveq #22,%d0
460be: 2080 movel %d0,%a0@
460c0: 70ff moveq #-1,%d0
}
460c2: 4cee 1c0c ffd0 moveml %fp@(-48),%d2-%d3/%a2-%a4
460c8: 4e5e unlk %fp <== NOT EXECUTED
00045ff2 <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
45ff2: 4e56 ffe8 linkw %fp,#-24
45ff6: 48d7 041c moveml %d2-%d4/%a2,%sp@
45ffa: 242e 0008 movel %fp@(8),%d2
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
45ffe: 4ab9 0006 0d7c tstl 60d7c <_POSIX_signals_Ualarm_timer+0x1c>
46004: 6620 bnes 46026 <ualarm+0x34>
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
46006: 42b9 0006 0d68 clrl 60d68 <_POSIX_signals_Ualarm_timer+0x8>
the_watchdog->routine = routine;
4600c: 203c 0004 5fb0 movel #286640,%d0
the_watchdog->id = id;
46012: 42b9 0006 0d80 clrl 60d80 <_POSIX_signals_Ualarm_timer+0x20>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
46018: 23c0 0006 0d7c movel %d0,60d7c <_POSIX_signals_Ualarm_timer+0x1c>
the_watchdog->id = id;
the_watchdog->user_data = user_data;
4601e: 42b9 0006 0d84 clrl 60d84 <_POSIX_signals_Ualarm_timer+0x24>
46024: 6056 bras 4607c <ualarm+0x8a>
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
46026: 4879 0006 0d60 pea 60d60 <_POSIX_signals_Ualarm_timer>
4602c: 4eb9 0004 97b0 jsr 497b0 <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
46032: 588f addql #4,%sp
46034: 7201 moveq #1,%d1
46036: 5580 subql #2,%d0
46038: b280 cmpl %d0,%d1
4603a: 6540 bcss 4607c <ualarm+0x8a> <== NEVER TAKEN
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
4603c: 2039 0006 0d74 movel 60d74 <_POSIX_signals_Ualarm_timer+0x14>,%d0
46042: d0b9 0006 0d6c addl 60d6c <_POSIX_signals_Ualarm_timer+0xc>,%d0
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
46048: 486e fff8 pea %fp@(-8)
4604c: 90b9 0006 0d78 subl 60d78 <_POSIX_signals_Ualarm_timer+0x18>,%d0
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
46052: 283c 000f 4240 movel #1000000,%d4
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
46058: 2f00 movel %d0,%sp@-
4605a: 4eb9 0004 93c4 jsr 493c4 <_Timespec_From_ticks>
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
46060: 202e fff8 movel %fp@(-8),%d0
46064: 4c04 0800 mulsl %d4,%d0
remaining += tp.tv_nsec / 1000;
46068: 283c 0000 03e8 movel #1000,%d4
4606e: 508f addql #8,%sp
46070: 262e fffc movel %fp@(-4),%d3
46074: 4c44 3803 remsl %d4,%d3,%d3
46078: d680 addl %d0,%d3
4607a: 6002 bras 4607e <ualarm+0x8c>
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
4607c: 4283 clrl %d3
/*
* If useconds is non-zero, then the caller wants to schedule
* the alarm repeatedly at that interval. If the interval is
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
4607e: 4a82 tstl %d2
46080: 674e beqs 460d0 <ualarm+0xde>
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
46082: 283c 0000 03e8 movel #1000,%d4
ticks = _Timespec_To_ticks( &tp );
46088: 45f9 0004 9400 lea 49400 <_Timespec_To_ticks>,%a2
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
4608e: 223c 000f 4240 movel #1000000,%d1
46094: 4c41 2000 remul %d1,%d0,%d2
46098: 4c41 2002 remul %d1,%d2,%d2
4609c: 2d42 fff8 movel %d2,%fp@(-8)
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
460a0: 4c00 4800 mulsl %d0,%d4
ticks = _Timespec_To_ticks( &tp );
460a4: 240e movel %fp,%d2
460a6: 5182 subql #8,%d2
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
460a8: 2d44 fffc movel %d4,%fp@(-4)
ticks = _Timespec_To_ticks( &tp );
460ac: 2f02 movel %d2,%sp@-
460ae: 4e92 jsr %a2@
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
460b0: 2f02 movel %d2,%sp@-
460b2: 4e92 jsr %a2@
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
460b4: 4879 0006 0d60 pea 60d60 <_POSIX_signals_Ualarm_timer>
460ba: 4879 0006 0602 pea 60602 <_Watchdog_Ticks_chain>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
460c0: 23c0 0006 0d6c movel %d0,60d6c <_POSIX_signals_Ualarm_timer+0xc>
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
460c6: 4eb9 0004 968c jsr 4968c <_Watchdog_Insert>
460cc: 4fef 0010 lea %sp@(16),%sp
}
return remaining;
}
460d0: 2003 movel %d3,%d0
460d2: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2
460d8: 4e5e unlk %fp <== NOT EXECUTED