RTEMS 4.11Annotated Report
Sat Dec 22 00:22:19 2012
0004d254 <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;
4d254: 41f9 0006 2da4 lea 62da4 <Configuration+0xc>,%a0
#include <rtems/score/tod.h>
uint32_t TOD_MICROSECONDS_TO_TICKS(
uint32_t microseconds
)
{
4d25a: 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;
4d25e: 202e 0008 movel %fp@(8),%d0
4d262: 4c50 0001 remul %a0@,%d1,%d0
4d266: 4c50 0000 remul %a0@,%d0,%d0
if ( (microseconds % microseconds_per_tick) != 0 )
4d26a: 4a81 tstl %d1
4d26c: 6702 beqs 4d270 <TOD_MICROSECONDS_TO_TICKS+0x1c> <== ALWAYS TAKEN
ticks += 1;
4d26e: 5280 addql #1,%d0 <== NOT EXECUTED
return ticks;
}
4d270: 4e5e unlk %fp <== NOT EXECUTED
00048d34 <TOD_MILLISECONDS_TO_TICKS>:
#include <rtems/score/tod.h>
uint32_t TOD_MILLISECONDS_TO_TICKS(
uint32_t milliseconds
)
{
48d34: 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();
48d38: 2039 0005 ea54 movel 5ea54 <Configuration+0xc>,%d0
#include <rtems/score/tod.h>
uint32_t TOD_MILLISECONDS_TO_TICKS(
uint32_t milliseconds
)
{
48d3e: 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();
48d40: 243c 0000 03e8 movel #1000,%d2
48d46: 4c42 0000 remul %d2,%d0,%d0
ticks = milliseconds / milliseconds_per_tick;
48d4a: 242e 0008 movel %fp@(8),%d2
48d4e: 4c40 2001 remul %d0,%d1,%d2
48d52: 4c40 2002 remul %d0,%d2,%d2
48d56: 2002 movel %d2,%d0
if ( (milliseconds % milliseconds_per_tick) != 0 )
48d58: 4a81 tstl %d1
48d5a: 6702 beqs 48d5e <TOD_MILLISECONDS_TO_TICKS+0x2a> <== ALWAYS TAKEN
ticks += 1;
48d5c: 5280 addql #1,%d0 <== NOT EXECUTED
return ticks;
}
48d5e: 241f movel %sp@+,%d2
48d60: 4e5e unlk %fp <== NOT EXECUTED
00047f60 <_API_Mutex_Unlock>:
#include <rtems/score/apimutex.h>
void _API_Mutex_Unlock(
API_Mutex_Control *the_mutex
)
{
47f60: 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;
47f64: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
47f6a: 5280 addql #1,%d0
47f6c: 206e 0008 moveal %fp@(8),%a0
_Thread_Dispatch_disable_level = level;
47f70: 23c0 0006 0fe6 movel %d0,60fe6 <_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(
47f76: 42a7 clrl %sp@-
47f78: 2f28 0008 movel %a0@(8),%sp@-
47f7c: 4868 0010 pea %a0@(16)
47f80: 4eb9 0004 82f0 jsr 482f0 <_CORE_mutex_Surrender>
&the_mutex->Mutex,
the_mutex->Object.id,
NULL
);
_Thread_Enable_dispatch();
47f86: 4fef 000c lea %sp@(12),%sp
}
47f8a: 4e5e unlk %fp
_CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
NULL
);
_Thread_Enable_dispatch();
47f8c: 4ef9 0004 9cd0 jmp 49cd0 <_Thread_Enable_dispatch>
...
00047e3a <_API_extensions_Add_post_switch>:
void _API_extensions_Add_post_switch(
API_extensions_Post_switch_control *post_switch
)
{
47e3a: 4e56 0000 linkw %fp,#0
47e3e: 206e 0008 moveal %fp@(8),%a0
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
47e42: 4a90 tstl %a0@
47e44: 6704 beqs 47e4a <_API_extensions_Add_post_switch+0x10>
_Chain_Append_if_is_off_chain_unprotected(
&_API_extensions_Post_switch_list,
&post_switch->Node
);
}
47e46: 4e5e unlk %fp
47e48: 4e75 rts
47e4a: 4aa8 0004 tstl %a0@(4)
47e4e: 66f6 bnes 47e46 <_API_extensions_Add_post_switch+0xc><== NEVER TAKEN
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
47e50: 2279 0006 1062 moveal 61062 <_API_extensions_Post_switch_list+0x8>,%a1
47e56: 4e5e unlk %fp
the_node->next = tail;
47e58: 20bc 0006 105e movel #397406,%a0@
tail->previous = the_node;
47e5e: 23c8 0006 1062 movel %a0,61062 <_API_extensions_Post_switch_list+0x8>
old_last->next = the_node;
47e64: 2288 movel %a0,%a1@
the_node->previous = old_last;
47e66: 2149 0004 movel %a1,%a0@(4)
00047e6c <_API_extensions_Run_postdriver>:
}
}
#endif
void _API_extensions_Run_postdriver( void )
{
47e6c: 4e56 0000 linkw %fp,#0
47e70: 2f0a movel %a2,%sp@-
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
47e72: 2479 0006 110e moveal 6110e <_API_extensions_List>,%a2
Chain_Node *the_node;
API_extensions_Control *the_extension;
for ( the_node = _Chain_First( &_API_extensions_List );
47e78: b5fc 0006 1112 cmpal #397586,%a2
47e7e: 6710 beqs 47e90 <_API_extensions_Run_postdriver+0x24><== NEVER TAKEN
* Currently all APIs configure this hook so it is always non-NULL.
*/
#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
if ( the_extension->postdriver_hook )
#endif
(*the_extension->postdriver_hook)();
47e80: 206a 0008 moveal %a2@(8),%a0
47e84: 4e90 jsr %a0@
Chain_Node *the_node;
API_extensions_Control *the_extension;
for ( the_node = _Chain_First( &_API_extensions_List );
!_Chain_Is_tail( &_API_extensions_List, the_node ) ;
the_node = the_node->next ) {
47e86: 2452 moveal %a2@,%a2
void _API_extensions_Run_postdriver( void )
{
Chain_Node *the_node;
API_extensions_Control *the_extension;
for ( the_node = _Chain_First( &_API_extensions_List );
47e88: b5fc 0006 1112 cmpal #397586,%a2
47e8e: 66f0 bnes 47e80 <_API_extensions_Run_postdriver+0x14>
#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
if ( the_extension->postdriver_hook )
#endif
(*the_extension->postdriver_hook)();
}
}
47e90: 246e fffc moveal %fp@(-4),%a2
47e94: 4e5e unlk %fp <== NOT EXECUTED
0004a3cc <_CORE_RWLock_Obtain_for_writing>:
* 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 );
4a3cc: 203c 0000 0700 movel #1792,%d0
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
4a3d2: 4e56 fff4 linkw %fp,#-12
4a3d6: 206e 0008 moveal %fp@(8),%a0
4a3da: 48d7 001c moveml %d2-%d4,%sp@
4a3de: 282e 000c movel %fp@(12),%d4
4a3e2: 262e 0014 movel %fp@(20),%d3
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
4a3e6: 2279 0006 4182 moveal 64182 <_Per_CPU_Information+0xe>,%a1
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_RWLock_API_mp_support_callout api_rwlock_mp_support
)
{
4a3ec: 142e 0013 moveb %fp@(19),%d2
* 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 );
4a3f0: 40c1 movew %sr,%d1
4a3f2: 8081 orl %d1,%d0
4a3f4: 46c0 movew %d0,%sr
switch ( the_rwlock->current_state ) {
4a3f6: 4aa8 0044 tstl %a0@(68)
4a3fa: 6614 bnes 4a410 <_CORE_RWLock_Obtain_for_writing+0x44>
case CORE_RWLOCK_UNLOCKED:
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
4a3fc: 7002 moveq #2,%d0
4a3fe: 2140 0044 movel %d0,%a0@(68)
_ISR_Enable( level );
4a402: 46c1 movew %d1,%sr
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
4a404: 42a9 0034 clrl %a1@(52)
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
4a408: 4cd7 001c moveml %sp@,%d2-%d4
4a40c: 4e5e unlk %fp
4a40e: 4e75 rts
/*
* If the thread is not willing to wait, then return immediately.
*/
if ( !wait ) {
4a410: 4a02 tstb %d2
4a412: 6610 bnes 4a424 <_CORE_RWLock_Obtain_for_writing+0x58>
_ISR_Enable( level );
4a414: 46c1 movew %d1,%sr
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
4a416: 7002 moveq #2,%d0
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
4a418: 4cd7 001c moveml %sp@,%d2-%d4
* If the thread is not willing to wait, then return immediately.
*/
if ( !wait ) {
_ISR_Enable( level );
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
4a41c: 2340 0034 movel %d0,%a1@(52)
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
4a420: 4e5e unlk %fp
4a422: 4e75 rts
4a424: 7001 moveq #1,%d0
4a426: 2140 0030 movel %d0,%a0@(48)
/*
* We need to wait to enter this critical section
*/
_Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue );
executing->Wait.queue = &the_rwlock->Wait_queue;
4a42a: 2348 0044 movel %a0,%a1@(68)
executing->Wait.id = id;
4a42e: 2344 0020 movel %d4,%a1@(32)
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE;
4a432: 2340 0030 movel %d0,%a1@(48)
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
4a436: 42a9 0034 clrl %a1@(52)
_ISR_Enable( level );
4a43a: 46c1 movew %d1,%sr
_Thread_queue_Enqueue_with_handler(
4a43c: 2d43 000c movel %d3,%fp@(12)
4a440: 203c 0004 a538 movel #304440,%d0
4a446: 2d48 0008 movel %a0,%fp@(8)
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
4a44a: 4cd7 001c moveml %sp@,%d2-%d4
executing->Wait.id = id;
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE;
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
_ISR_Enable( level );
_Thread_queue_Enqueue_with_handler(
4a44e: 2d40 0010 movel %d0,%fp@(16)
_CORE_RWLock_Timeout
);
/* return to API level so it can dispatch and we block */
}
4a452: 4e5e unlk %fp
executing->Wait.id = id;
executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE;
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
_ISR_Enable( level );
_Thread_queue_Enqueue_with_handler(
4a454: 4ef9 0004 c340 jmp 4c340 <_Thread_queue_Enqueue_with_handler>
...
0004a45c <_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 );
4a45c: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/watchdog.h>
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
4a462: 4e56 fff0 linkw %fp,#-16
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
4a466: 2079 0006 4182 moveal 64182 <_Per_CPU_Information+0xe>,%a0
#include <rtems/score/watchdog.h>
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
4a46c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
4a470: 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 );
4a474: 40c1 movew %sr,%d1
4a476: 8081 orl %d1,%d0
4a478: 46c0 movew %d0,%sr
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
4a47a: 202a 0044 movel %a2@(68),%d0
4a47e: 6700 0090 beqw 4a510 <_CORE_RWLock_Release+0xb4>
_ISR_Enable( level );
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
return CORE_RWLOCK_SUCCESSFUL;
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
4a482: 7401 moveq #1,%d2
4a484: b480 cmpl %d0,%d2
4a486: 676e beqs 4a4f6 <_CORE_RWLock_Release+0x9a>
return CORE_RWLOCK_SUCCESSFUL;
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
4a488: 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;
4a48c: 42aa 0044 clrl %a2@(68)
_ISR_Enable( level );
4a490: 46c1 movew %d1,%sr
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
4a492: 2f0a movel %a2,%sp@-
4a494: 4eb9 0004 c1d0 jsr 4c1d0 <_Thread_queue_Dequeue>
if ( next ) {
4a49a: 588f addql #4,%sp
4a49c: 4a80 tstl %d0
4a49e: 674a beqs 4a4ea <_CORE_RWLock_Release+0x8e>
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
4a4a0: 7201 moveq #1,%d1
4a4a2: 2040 moveal %d0,%a0
4a4a4: b2a8 0030 cmpl %a0@(48),%d1
4a4a8: 677c beqs 4a526 <_CORE_RWLock_Release+0xca>
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
4a4aa: 7201 moveq #1,%d1
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
4a4ac: 52aa 0048 addql #1,%a2@(72)
4a4b0: 47f9 0004 c6f0 lea 4c6f0 <_Thread_queue_First>,%a3
next = _Thread_queue_First( &the_rwlock->Wait_queue );
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 );
4a4b6: 49f9 0004 c5a4 lea 4c5a4 <_Thread_queue_Extract>,%a4
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
4a4bc: 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 );
4a4c0: 2f0a movel %a2,%sp@-
4a4c2: 4e93 jsr %a3@
if ( !next ||
4a4c4: 588f addql #4,%sp
4a4c6: 4a80 tstl %d0
4a4c8: 6720 beqs 4a4ea <_CORE_RWLock_Release+0x8e>
4a4ca: 7401 moveq #1,%d2
4a4cc: 2040 moveal %d0,%a0
4a4ce: b4a8 0030 cmpl %a0@(48),%d2
4a4d2: 6716 beqs 4a4ea <_CORE_RWLock_Release+0x8e> <== NEVER TAKEN
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
4a4d4: 52aa 0048 addql #1,%a2@(72)
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
4a4d8: 2f00 movel %d0,%sp@-
4a4da: 2f0a movel %a2,%sp@-
4a4dc: 4e94 jsr %a4@
}
4a4de: 508f addql #8,%sp
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
4a4e0: 2f0a movel %a2,%sp@-
4a4e2: 4e93 jsr %a3@
if ( !next ||
4a4e4: 588f addql #4,%sp
4a4e6: 4a80 tstl %d0
4a4e8: 66e0 bnes 4a4ca <_CORE_RWLock_Release+0x6e> <== NEVER TAKEN
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
4a4ea: 4280 clrl %d0
4a4ec: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4a4f2: 4e5e unlk %fp
4a4f4: 4e75 rts
_ISR_Enable( level );
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
return CORE_RWLOCK_SUCCESSFUL;
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
the_rwlock->number_of_readers -= 1;
4a4f6: 202a 0048 movel %a2@(72),%d0
4a4fa: 5380 subql #1,%d0
4a4fc: 2540 0048 movel %d0,%a2@(72)
if ( the_rwlock->number_of_readers != 0 ) {
4a500: 6786 beqs 4a488 <_CORE_RWLock_Release+0x2c>
/* must be unlocked again */
_ISR_Enable( level );
4a502: 46c1 movew %d1,%sr
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
4a504: 4280 clrl %d0
4a506: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4a50c: 4e5e unlk %fp
4a50e: 4e75 rts
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
_ISR_Enable( level );
4a510: 46c1 movew %d1,%sr
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
4a512: 103c 0002 moveb #2,%d0
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
4a516: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
*/
_ISR_Disable( level );
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
_ISR_Enable( level );
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
4a51c: 2140 0034 movel %d0,%a0@(52)
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
4a520: 4280 clrl %d0
4a522: 4e5e unlk %fp
4a524: 4e75 rts
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
if ( next ) {
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
4a526: 7002 moveq #2,%d0
4a528: 2540 0044 movel %d0,%a2@(68)
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
4a52c: 4280 clrl %d0
4a52e: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4a534: 4e5e unlk %fp <== NOT EXECUTED
0004a538 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
4a538: 4e56 fffc linkw %fp,#-4
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
4a53c: 486e fffc pea %fp@(-4)
4a540: 2f2e 0008 movel %fp@(8),%sp@-
4a544: 4eb9 0004 be50 jsr 4be50 <_Thread_Get>
switch ( location ) {
4a54a: 508f addql #8,%sp
4a54c: 4aae fffc tstl %fp@(-4)
4a550: 6618 bnes 4a56a <_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 );
4a552: 2f00 movel %d0,%sp@-
4a554: 4eb9 0004 c810 jsr 4c810 <_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;
4a55a: 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;
4a55c: 2039 0006 3d3a movel 63d3a <_Thread_Dispatch_disable_level>,%d0
--level;
4a562: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
4a564: 23c0 0006 3d3a movel %d0,63d3a <_Thread_Dispatch_disable_level>
_Thread_Unnest_dispatch();
break;
}
}
4a56a: 4e5e unlk %fp
...
00049004 <_CORE_barrier_Wait>:
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
_ISR_Disable( level );
49004: 203c 0000 0700 movel #1792,%d0
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
4900a: 4e56 fff4 linkw %fp,#-12
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
4900e: 2279 0006 2922 moveal 62922 <_Per_CPU_Information+0xe>,%a1
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
49014: 48d7 001c moveml %d2-%d4,%sp@
49018: 206e 0008 moveal %fp@(8),%a0
Thread_Control *executing;
ISR_Level level;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
4901c: 42a9 0034 clrl %a1@(52)
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
49020: 242e 000c movel %fp@(12),%d2
49024: 262e 0014 movel %fp@(20),%d3
49028: 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 );
4902c: 40c1 movew %sr,%d1
4902e: 8081 orl %d1,%d0
49030: 46c0 movew %d0,%sr
the_barrier->number_of_waiting_threads++;
49032: 2028 0048 movel %a0@(72),%d0
49036: 5280 addql #1,%d0
49038: 2140 0048 movel %d0,%a0@(72)
if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) {
4903c: 4aa8 0040 tstl %a0@(64)
49040: 6606 bnes 49048 <_CORE_barrier_Wait+0x44>
if ( the_barrier->number_of_waiting_threads ==
49042: b0a8 0044 cmpl %a0@(68),%d0
49046: 672e beqs 49076 <_CORE_barrier_Wait+0x72>
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;
49048: 7001 moveq #1,%d0
4904a: 2140 0030 movel %d0,%a0@(48)
return;
}
}
_Thread_queue_Enter_critical_section( &the_barrier->Wait_queue );
executing->Wait.queue = &the_barrier->Wait_queue;
4904e: 2348 0044 movel %a0,%a1@(68)
executing->Wait.id = id;
49052: 2342 0020 movel %d2,%a1@(32)
_ISR_Enable( level );
49056: 46c1 movew %d1,%sr
_Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
49058: 2d43 000c movel %d3,%fp@(12)
4905c: 203c 0004 b558 movel #308568,%d0
49062: 2d48 0008 movel %a0,%fp@(8)
}
49066: 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 );
4906a: 2d40 0010 movel %d0,%fp@(16)
}
4906e: 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 );
49070: 4ef9 0004 b188 jmp 4b188 <_Thread_queue_Enqueue_with_handler>
_ISR_Disable( level );
the_barrier->number_of_waiting_threads++;
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;
49076: 7001 moveq #1,%d0
49078: 2340 0034 movel %d0,%a1@(52)
_ISR_Enable( level );
4907c: 46c1 movew %d1,%sr
_CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
4907e: 2d44 0010 movel %d4,%fp@(16)
49082: 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 );
}
49086: 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 );
4908a: 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 );
}
4908e: 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 );
49090: 4ef9 0004 df18 jmp 4df18 <_CORE_barrier_Release>
...
00055c28 <_CORE_message_queue_Close>:
void _CORE_message_queue_Close(
CORE_message_queue_Control *the_message_queue,
Thread_queue_Flush_callout remote_extract_callout,
uint32_t status
)
{
55c28: 4e56 0000 linkw %fp,#0
55c2c: 2f0a movel %a2,%sp@-
/*
* This will flush blocked threads whether they were blocked on
* a send or receive.
*/
_Thread_queue_Flush(
55c2e: 2f2e 0010 movel %fp@(16),%sp@-
55c32: 2f2e 000c movel %fp@(12),%sp@-
void _CORE_message_queue_Close(
CORE_message_queue_Control *the_message_queue,
Thread_queue_Flush_callout remote_extract_callout,
uint32_t status
)
{
55c36: 246e 0008 moveal %fp@(8),%a2
/*
* This will flush blocked threads whether they were blocked on
* a send or receive.
*/
_Thread_queue_Flush(
55c3a: 2f0a movel %a2,%sp@-
55c3c: 4eb9 0005 01e0 jsr 501e0 <_Thread_queue_Flush>
* This removes all messages from the pending message queue. Since
* we just flushed all waiting threads, we don't have to worry about
* the flush satisfying any blocked senders as a side-effect.
*/
if ( the_message_queue->number_of_pending_messages != 0 )
55c42: 4fef 000c lea %sp@(12),%sp
55c46: 4aaa 0048 tstl %a2@(72)
55c4a: 6612 bnes 55c5e <_CORE_message_queue_Close+0x36>
(void) _CORE_message_queue_Flush_support( the_message_queue );
(void) _Workspace_Free( the_message_queue->message_buffers );
55c4c: 2d6a 005c 0008 movel %a2@(92),%fp@(8)
}
55c52: 246e fffc moveal %fp@(-4),%a2
55c56: 4e5e unlk %fp
*/
if ( the_message_queue->number_of_pending_messages != 0 )
(void) _CORE_message_queue_Flush_support( the_message_queue );
(void) _Workspace_Free( the_message_queue->message_buffers );
55c58: 4ef9 0005 0ac0 jmp 50ac0 <_Workspace_Free>
* we just flushed all waiting threads, we don't have to worry about
* the flush satisfying any blocked senders as a side-effect.
*/
if ( the_message_queue->number_of_pending_messages != 0 )
(void) _CORE_message_queue_Flush_support( the_message_queue );
55c5e: 2f0a movel %a2,%sp@-
55c60: 4eb9 0005 5c7c jsr 55c7c <_CORE_message_queue_Flush_support>
(void) _Workspace_Free( the_message_queue->message_buffers );
55c66: 2d6a 005c 0008 movel %a2@(92),%fp@(8)
* we just flushed all waiting threads, we don't have to worry about
* the flush satisfying any blocked senders as a side-effect.
*/
if ( the_message_queue->number_of_pending_messages != 0 )
(void) _CORE_message_queue_Flush_support( the_message_queue );
55c6c: 588f addql #4,%sp
(void) _Workspace_Free( the_message_queue->message_buffers );
}
55c6e: 246e fffc moveal %fp@(-4),%a2
55c72: 4e5e unlk %fp
*/
if ( the_message_queue->number_of_pending_messages != 0 )
(void) _CORE_message_queue_Flush_support( the_message_queue );
(void) _Workspace_Free( the_message_queue->message_buffers );
55c74: 4ef9 0005 0ac0 jmp 50ac0 <_Workspace_Free>
...
00055b90 <_CORE_message_queue_Insert_message>:
void _CORE_message_queue_Insert_message(
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Buffer_control *the_message,
CORE_message_queue_Submit_types submit_type
)
{
55b90: 4e56 fff4 linkw %fp,#-12
55b94: 226e 000c moveal %fp@(12),%a1
55b98: 202e 0010 movel %fp@(16),%d0
55b9c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
55ba0: 206e 0008 moveal %fp@(8),%a0
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
55ba4: 2340 0008 movel %d0,%a1@(8)
_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
else
_CORE_message_queue_Prepend_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
#else
if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) {
55ba8: 0c80 7fff ffff cmpil #2147483647,%d0
55bae: 6700 0082 beqw 55c32 <_CORE_message_queue_Insert_message+0xa2>
_ISR_Disable( level );
SET_NOTIFY();
the_message_queue->number_of_pending_messages++;
_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
} else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) {
55bb2: 0c80 8000 0000 cmpil #-2147483648,%d0
55bb8: 6700 00ae beqw 55c68 <_CORE_message_queue_Insert_message+0xd8>
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_tail( the_chain ));
55bbc: 2208 movel %a0,%d1
55bbe: 0681 0000 0054 addil #84,%d1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
55bc4: 2468 0050 moveal %a0@(80),%a2
int the_priority;
the_priority = _CORE_message_queue_Get_message_priority(the_message);
the_header = &the_message_queue->Pending_messages;
the_node = _Chain_First( the_header );
while ( !_Chain_Is_tail( the_header, the_node ) ) {
55bc8: b5c1 cmpal %d1,%a2
55bca: 6712 beqs 55bde <_CORE_message_queue_Insert_message+0x4e>
this_message = (CORE_message_queue_Buffer_control *) the_node;
this_priority = _CORE_message_queue_Get_message_priority(this_message);
if ( this_priority <= the_priority ) {
55bcc: b0aa 0008 cmpl %a2@(8),%d0
55bd0: 6d0c blts 55bde <_CORE_message_queue_Insert_message+0x4e>
the_node = the_node->next;
55bd2: 2452 moveal %a2@,%a2
int the_priority;
the_priority = _CORE_message_queue_Get_message_priority(the_message);
the_header = &the_message_queue->Pending_messages;
the_node = _Chain_First( the_header );
while ( !_Chain_Is_tail( the_header, the_node ) ) {
55bd4: b5c1 cmpal %d1,%a2
55bd6: 6706 beqs 55bde <_CORE_message_queue_Insert_message+0x4e>
this_message = (CORE_message_queue_Buffer_control *) the_node;
this_priority = _CORE_message_queue_Get_message_priority(this_message);
if ( this_priority <= the_priority ) {
55bd8: b0aa 0008 cmpl %a2@(8),%d0
55bdc: 6cf4 bges 55bd2 <_CORE_message_queue_Insert_message+0x42>
the_node = the_node->next;
continue;
}
break;
}
_ISR_Disable( level );
55bde: 203c 0000 0700 movel #1792,%d0
55be4: 40c1 movew %sr,%d1
55be6: 8081 orl %d1,%d0
55be8: 46c0 movew %d0,%sr
SET_NOTIFY();
55bea: 2028 0048 movel %a0@(72),%d0
the_message_queue->number_of_pending_messages++;
55bee: 2400 movel %d0,%d2
55bf0: 5282 addql #1,%d2
continue;
}
break;
}
_ISR_Disable( level );
SET_NOTIFY();
55bf2: 4a80 tstl %d0
55bf4: 57c0 seq %d0
the_message_queue->number_of_pending_messages++;
_Chain_Insert_unprotected( the_node->previous, &the_message->Node );
55bf6: 246a 0004 moveal %a2@(4),%a2
continue;
}
break;
}
_ISR_Disable( level );
SET_NOTIFY();
55bfa: 4480 negl %d0
the_message_queue->number_of_pending_messages++;
55bfc: 2142 0048 movel %d2,%a0@(72)
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
55c00: 2652 moveal %a2@,%a3
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
55c02: 234a 0004 movel %a2,%a1@(4)
before_node = after_node->next;
after_node->next = the_node;
55c06: 2489 movel %a1,%a2@
the_node->next = before_node;
before_node->previous = the_node;
55c08: 2749 0004 movel %a1,%a3@(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;
55c0c: 228b movel %a3,%a1@
_Chain_Insert_unprotected( the_node->previous, &the_message->Node );
_ISR_Enable( level );
55c0e: 46c1 movew %d1,%sr
/*
* According to POSIX, does this happen before or after the message
* is actually enqueued. It is logical to think afterwards, because
* the message is actually in the queue at this point.
*/
if ( notify && the_message_queue->notify_handler )
55c10: 4a00 tstb %d0
55c12: 6716 beqs 55c2a <_CORE_message_queue_Insert_message+0x9a>
55c14: 2268 0060 moveal %a0@(96),%a1
55c18: 4a89 tstl %a1
55c1a: 670e beqs 55c2a <_CORE_message_queue_Insert_message+0x9a>
(*the_message_queue->notify_handler)(the_message_queue->notify_argument);
55c1c: 2d68 0064 0008 movel %a0@(100),%fp@(8)
#endif
}
55c22: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3
55c26: 4e5e unlk %fp
* According to POSIX, does this happen before or after the message
* is actually enqueued. It is logical to think afterwards, because
* the message is actually in the queue at this point.
*/
if ( notify && the_message_queue->notify_handler )
(*the_message_queue->notify_handler)(the_message_queue->notify_argument);
55c28: 4ed1 jmp %a1@
#endif
}
55c2a: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3
55c2e: 4e5e unlk %fp
55c30: 4e75 rts
else
_CORE_message_queue_Prepend_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
#else
if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) {
_ISR_Disable( level );
55c32: 203c 0000 0700 movel #1792,%d0
55c38: 40c1 movew %sr,%d1
55c3a: 8081 orl %d1,%d0
55c3c: 46c0 movew %d0,%sr
SET_NOTIFY();
55c3e: 2028 0048 movel %a0@(72),%d0
the_message_queue->number_of_pending_messages++;
55c42: 2400 movel %d0,%d2
55c44: 5282 addql #1,%d2
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
55c46: 47e8 0054 lea %a0@(84),%a3
_CORE_message_queue_Prepend_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
#else
if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) {
_ISR_Disable( level );
SET_NOTIFY();
55c4a: 4a80 tstl %d0
55c4c: 57c0 seq %d0
the_message_queue->number_of_pending_messages++;
55c4e: 2142 0048 movel %d2,%a0@(72)
Chain_Node *old_last = tail->previous;
55c52: 2468 0058 moveal %a0@(88),%a2
_CORE_message_queue_Prepend_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
#else
if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) {
_ISR_Disable( level );
SET_NOTIFY();
55c56: 4480 negl %d0
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
55c58: 228b movel %a3,%a1@
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
55c5a: 2149 0058 movel %a1,%a0@(88)
old_last->next = the_node;
55c5e: 2489 movel %a1,%a2@
the_node->previous = old_last;
55c60: 234a 0004 movel %a2,%a1@(4)
the_message_queue->number_of_pending_messages++;
_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
55c64: 46c1 movew %d1,%sr
55c66: 60a8 bras 55c10 <_CORE_message_queue_Insert_message+0x80>
} else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) {
_ISR_Disable( level );
55c68: 203c 0000 0700 movel #1792,%d0
55c6e: 40c1 movew %sr,%d1
55c70: 8081 orl %d1,%d0
55c72: 46c0 movew %d0,%sr
SET_NOTIFY();
55c74: 2028 0048 movel %a0@(72),%d0
the_message_queue->number_of_pending_messages++;
55c78: 2400 movel %d0,%d2
55c7a: 5282 addql #1,%d2
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
55c7c: 47e8 0050 lea %a0@(80),%a3
the_message_queue->number_of_pending_messages++;
_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
} else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) {
_ISR_Disable( level );
SET_NOTIFY();
55c80: 4a80 tstl %d0
55c82: 57c0 seq %d0
the_message_queue->number_of_pending_messages++;
55c84: 2142 0048 movel %d2,%a0@(72)
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
55c88: 2468 0050 moveal %a0@(80),%a2
the_message_queue->number_of_pending_messages++;
_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
} else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) {
_ISR_Disable( level );
SET_NOTIFY();
55c8c: 4480 negl %d0
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
55c8e: 234b 0004 movel %a3,%a1@(4)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
55c92: 2149 0050 movel %a1,%a0@(80)
the_node->next = before_node;
before_node->previous = the_node;
55c96: 2549 0004 movel %a1,%a2@(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;
55c9a: 228a movel %a2,%a1@
the_message_queue->number_of_pending_messages++;
_CORE_message_queue_Prepend_unprotected(the_message_queue, the_message);
_ISR_Enable( level );
55c9c: 46c1 movew %d1,%sr
55c9e: 6000 ff70 braw 55c10 <_CORE_message_queue_Insert_message+0x80>
...
000508f0 <_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 );
508f0: 203c 0000 0700 movel #1792,%d0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
508f6: 4e56 ffe4 linkw %fp,#-28
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
508fa: 2279 0006 abc6 moveal 6abc6 <_Per_CPU_Information+0xe>,%a1
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
50900: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@
50904: 246e 0008 moveal %fp@(8),%a2
50908: 286e 000c moveal %fp@(12),%a4
5090c: 262e 0010 movel %fp@(16),%d3
50910: 206e 0014 moveal %fp@(20),%a0
50914: 2a2e 001c movel %fp@(28),%d5
50918: 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;
5091c: 42a9 0034 clrl %a1@(52)
_ISR_Disable( level );
50920: 40c1 movew %sr,%d1
50922: 8081 orl %d1,%d0
50924: 46c0 movew %d0,%sr
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
50926: 240a movel %a2,%d2
50928: 200a movel %a2,%d0
5092a: 0682 0000 0050 addil #80,%d2
50930: 0680 0000 0054 addil #84,%d0
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
50936: 266a 0050 moveal %a2@(80),%a3
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
5093a: b08b cmpl %a3,%d0
5093c: 6700 0084 beqw 509c2 <_CORE_message_queue_Seize+0xd2>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
50940: 2253 moveal %a3@,%a1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
50942: 2342 0004 movel %d2,%a1@(4)
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
50946: 53aa 0048 subql #1,%a2@(72)
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
5094a: 2549 0050 movel %a1,%a2@(80)
_ISR_Enable( level );
5094e: 46c1 movew %d1,%sr
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
50950: 2279 0006 abc6 moveal 6abc6 <_Per_CPU_Information+0xe>,%a1
_CORE_message_queue_Get_message_priority( the_message );
_CORE_message_queue_Copy_buffer(
the_message->Contents.buffer,
50956: 240b movel %a3,%d2
50958: 0682 0000 0010 addil #16,%d2
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
5095e: 49f9 0005 871c lea 5871c <memcpy>,%a4
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;
50964: 20ab 000c movel %a3@(12),%a0@
_Thread_Executing->Wait.count =
50968: 236b 0008 0024 movel %a3@(8),%a1@(36)
5096e: 2f10 movel %a0@,%sp@-
50970: 2f02 movel %d2,%sp@-
50972: 2f03 movel %d3,%sp@-
50974: 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 );
50976: 2f0a movel %a2,%sp@-
50978: 4eb9 0005 2bec jsr 52bec <_Thread_queue_Dequeue>
if ( !the_thread ) {
5097e: 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 );
50982: 2040 moveal %d0,%a0
if ( !the_thread ) {
50984: 4a80 tstl %d0
50986: 6700 0088 beqw 50a10 <_CORE_message_queue_Seize+0x120>
*/
_CORE_message_queue_Set_message_priority(
the_message,
the_thread->Wait.count
);
the_message->Contents.size = (size_t) the_thread->Wait.option;
5098a: 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;
5098e: 2768 0024 0008 movel %a0@(36),%a3@(8)
50994: 2740 000c movel %d0,%a3@(12)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
50998: 2f00 movel %d0,%sp@-
5099a: 2f28 002c movel %a0@(44),%sp@-
5099e: 2f02 movel %d2,%sp@-
509a0: 4e94 jsr %a4@
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
509a2: 2d6b 0008 0010 movel %a3@(8),%fp@(16)
509a8: 4fef 000c lea %sp@(12),%sp
509ac: 2d4b 000c movel %a3,%fp@(12)
509b0: 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 );
}
509b4: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
509ba: 4e5e unlk %fp
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
509bc: 4ef9 0005 5b90 jmp 55b90 <_CORE_message_queue_Insert_message>
return;
}
#endif
}
if ( !wait ) {
509c2: 4a04 tstb %d4
509c4: 6612 bnes 509d8 <_CORE_message_queue_Seize+0xe8>
_ISR_Enable( level );
509c6: 46c1 movew %d1,%sr
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
509c8: 7004 moveq #4,%d0
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 );
}
509ca: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
#endif
}
if ( !wait ) {
_ISR_Enable( level );
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
509d0: 2340 0034 movel %d0,%a1@(52)
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 );
}
509d4: 4e5e unlk %fp
509d6: 4e75 rts
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;
509d8: 7001 moveq #1,%d0
509da: 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;
executing->Wait.return_argument_second.mutable_object = buffer;
509de: 2343 002c movel %d3,%a1@(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;
509e2: 234a 0044 movel %a2,%a1@(68)
executing->Wait.id = id;
509e6: 234c 0020 movel %a4,%a1@(32)
executing->Wait.return_argument_second.mutable_object = buffer;
executing->Wait.return_argument = size_p;
509ea: 2348 0028 movel %a0,%a1@(40)
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
509ee: 46c1 movew %d1,%sr
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
509f0: 2d45 000c movel %d5,%fp@(12)
509f4: 203c 0005 312c movel #340268,%d0
509fa: 2d4a 0008 movel %a2,%fp@(8)
}
509fe: 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 );
50a04: 2d40 0010 movel %d0,%fp@(16)
}
50a08: 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 );
50a0a: 4ef9 0005 2d5c jmp 52d5c <_Thread_queue_Enqueue_with_handler>
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 );
50a10: 45ea 0068 lea %a2@(104),%a2
50a14: 2d4b 000c movel %a3,%fp@(12)
50a18: 2d4a 0008 movel %a2,%fp@(8)
}
50a1c: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
50a22: 4e5e unlk %fp
50a24: 4ef9 0005 073c jmp 5073c <_Chain_Append>
...
00048204 <_CORE_mutex_Seize>:
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
48204: 4e56 0000 linkw %fp,#0
* This routine returns true if thread dispatch indicates
* that we are in a critical section.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void)
{
if ( _Thread_Dispatch_disable_level == 0 )
48208: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
4820e: 2f0a movel %a2,%sp@-
48210: 246e 0008 moveal %fp@(8),%a2
48214: 2f02 movel %d2,%sp@-
48216: 142e 0013 moveb %fp@(19),%d2
4821a: 4a80 tstl %d0
4821c: 6768 beqs 48286 <_CORE_mutex_Seize+0x82>
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
4821e: 4a02 tstb %d2
48220: 6700 0098 beqw 482ba <_CORE_mutex_Seize+0xb6>
48224: 7001 moveq #1,%d0
48226: b0b9 0006 141a cmpl 6141a <_System_state_Current>,%d0
4822c: 6500 00b2 bcsw 482e0 <_CORE_mutex_Seize+0xdc>
48230: 486e 0018 pea %fp@(24)
48234: 2f0a movel %a2,%sp@-
48236: 4eb9 0004 ced8 jsr 4ced8 <_CORE_mutex_Seize_interrupt_trylock>
4823c: 508f addql #8,%sp
4823e: 4a80 tstl %d0
48240: 6738 beqs 4827a <_CORE_mutex_Seize+0x76> <== ALWAYS 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;
48242: 7001 moveq #1,%d0
48244: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
4824a: 2540 0030 movel %d0,%a2@(48)
*
* 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;
4824e: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
48254: 5280 addql #1,%d0
48256: 216e 000c 0020 movel %fp@(12),%a0@(32)
4825c: 214a 0044 movel %a2,%a0@(68)
_Thread_Dispatch_disable_level = level;
48260: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
48266: 202e 0018 movel %fp@(24),%d0
4826a: 46c0 movew %d0,%sr
4826c: 2f2e 0014 movel %fp@(20),%sp@-
48270: 2f0a movel %a2,%sp@-
48272: 4eb9 0004 816c jsr 4816c <_CORE_mutex_Seize_interrupt_blocking>
48278: 508f addql #8,%sp
}
4827a: 242e fff8 movel %fp@(-8),%d2
4827e: 246e fffc moveal %fp@(-4),%a2
48282: 4e5e unlk %fp
48284: 4e75 rts
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
48286: 486e 0018 pea %fp@(24)
4828a: 2f0a movel %a2,%sp@-
4828c: 4eb9 0004 ced8 jsr 4ced8 <_CORE_mutex_Seize_interrupt_trylock>
48292: 508f addql #8,%sp
48294: 4a80 tstl %d0
48296: 67e2 beqs 4827a <_CORE_mutex_Seize+0x76>
48298: 4a02 tstb %d2
4829a: 66a6 bnes 48242 <_CORE_mutex_Seize+0x3e>
4829c: 202e 0018 movel %fp@(24),%d0
482a0: 46c0 movew %d0,%sr
482a2: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
482a8: 7001 moveq #1,%d0
482aa: 2140 0034 movel %d0,%a0@(52)
}
482ae: 242e fff8 movel %fp@(-8),%d2
482b2: 246e fffc moveal %fp@(-4),%a2
482b6: 4e5e unlk %fp
482b8: 4e75 rts
bool _wait,
Watchdog_Interval _timeout,
ISR_Level _level
)
{
_CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level );
482ba: 486e 0018 pea %fp@(24)
482be: 2f0a movel %a2,%sp@-
482c0: 4eb9 0004 ced8 jsr 4ced8 <_CORE_mutex_Seize_interrupt_trylock>
482c6: 508f addql #8,%sp
482c8: 4a80 tstl %d0
482ca: 67ae beqs 4827a <_CORE_mutex_Seize+0x76> <== ALWAYS TAKEN
482cc: 202e 0018 movel %fp@(24),%d0 <== NOT EXECUTED
482d0: 46c0 movew %d0,%sr <== NOT EXECUTED
482d2: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0 <== NOT EXECUTED
482d8: 7001 moveq #1,%d0 <== NOT EXECUTED
482da: 2140 0034 movel %d0,%a0@(52) <== NOT EXECUTED
482de: 60ce bras 482ae <_CORE_mutex_Seize+0xaa> <== NOT EXECUTED
482e0: 4878 0012 pea 12 <INVALID_OPERATION+0x2>
482e4: 42a7 clrl %sp@-
482e6: 42a7 clrl %sp@-
482e8: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
...
00048444 <_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
)
{
48444: 4e56 0000 linkw %fp,#0
48448: 2f0a movel %a2,%sp@-
4844a: 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)) ) {
4844e: 2f0a movel %a2,%sp@-
48450: 4eb9 0004 a070 jsr 4a070 <_Thread_queue_Dequeue>
48456: 588f addql #4,%sp
48458: 4a80 tstl %d0
4845a: 670a beqs 48466 <_CORE_semaphore_Surrender+0x22>
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
}
return status;
}
4845c: 246e fffc moveal %fp@(-4),%a2
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
48460: 4280 clrl %d0
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
}
return status;
}
48462: 4e5e unlk %fp
48464: 4e75 rts
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
48466: 303c 0700 movew #1792,%d0
4846a: 40c1 movew %sr,%d1
4846c: 8081 orl %d1,%d0
4846e: 46c0 movew %d0,%sr
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
48470: 202a 0048 movel %a2@(72),%d0
48474: b0aa 0040 cmpl %a2@(64),%d0
48478: 6412 bccs 4848c <_CORE_semaphore_Surrender+0x48> <== NEVER TAKEN
the_semaphore->count += 1;
4847a: 5280 addql #1,%d0
4847c: 2540 0048 movel %d0,%a2@(72)
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
48480: 4280 clrl %d0
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
48482: 46c1 movew %d1,%sr
}
return status;
}
48484: 246e fffc moveal %fp@(-4),%a2
48488: 4e5e unlk %fp
4848a: 4e75 rts
} else {
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
4848c: 7004 moveq #4,%d0 <== NOT EXECUTED
_ISR_Enable( level );
4848e: 46c1 movew %d1,%sr <== NOT EXECUTED
48490: 60f2 bras 48484 <_CORE_semaphore_Surrender+0x40> <== NOT EXECUTED
...
00048008 <_Chain_Initialize>:
Chain_Control *the_chain,
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
48008: 4e56 ffec linkw %fp,#-20
4800c: 202e 0010 movel %fp@(16),%d0
48010: 48d7 043c moveml %d2-%d5/%a2,%sp@
48014: 246e 0008 moveal %fp@(8),%a2
Chain_Node *current = head;
Chain_Node *next = starting_address;
head->previous = NULL;
while ( count-- ) {
48018: 2600 movel %d0,%d3
size_t node_size
)
{
size_t count = number_nodes;
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
4801a: 280a movel %a2,%d4
4801c: 5884 addql #4,%d4
Chain_Node *current = head;
Chain_Node *next = starting_address;
head->previous = NULL;
while ( count-- ) {
4801e: 5383 subql #1,%d3
Chain_Control *the_chain,
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
48020: 242e 000c movel %fp@(12),%d2
48024: 222e 0014 movel %fp@(20),%d1
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *current = head;
Chain_Node *next = starting_address;
head->previous = NULL;
48028: 42aa 0004 clrl %a2@(4)
while ( count-- ) {
4802c: 4a80 tstl %d0
4802e: 672e beqs 4805e <_Chain_Initialize+0x56> <== NEVER TAKEN
48030: 2003 movel %d3,%d0
48032: 2042 moveal %d2,%a0
48034: 224a moveal %a2,%a1
current->next = next;
48036: 2288 movel %a0,%a1@
Chain_Node *current = head;
Chain_Node *next = starting_address;
head->previous = NULL;
while ( count-- ) {
48038: 5380 subql #1,%d0
4803a: 7aff moveq #-1,%d5
current->next = next;
next->previous = current;
4803c: 2149 0004 movel %a1,%a0@(4)
48040: 2248 moveal %a0,%a1
current = next;
next = (Chain_Node *)
48042: d1c1 addal %d1,%a0
Chain_Node *current = head;
Chain_Node *next = starting_address;
head->previous = NULL;
while ( count-- ) {
48044: ba80 cmpl %d0,%d5
48046: 66ee bnes 48036 <_Chain_Initialize+0x2e>
#include <rtems/system.h>
#include <rtems/score/address.h>
#include <rtems/score/chain.h>
#include <rtems/score/isr.h>
void _Chain_Initialize(
48048: 4c03 1800 mulsl %d3,%d1
4804c: 2042 moveal %d2,%a0
4804e: d1c1 addal %d1,%a0
current = next;
next = (Chain_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
current->next = tail;
48050: 2084 movel %d4,%a0@
tail->previous = current;
48052: 2548 0008 movel %a0,%a2@(8)
}
48056: 4cd7 043c moveml %sp@,%d2-%d5/%a2
4805a: 4e5e unlk %fp
4805c: 4e75 rts
)
{
size_t count = number_nodes;
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *current = head;
4805e: 204a moveal %a2,%a0 <== NOT EXECUTED
current = next;
next = (Chain_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
current->next = tail;
48060: 2084 movel %d4,%a0@ <== NOT EXECUTED
tail->previous = current;
48062: 2548 0008 movel %a0,%a2@(8) <== NOT EXECUTED
}
48066: 4cd7 043c moveml %sp@,%d2-%d5/%a2 <== NOT EXECUTED
4806a: 4e5e unlk %fp <== NOT EXECUTED
...
00046fa8 <_Event_Surrender>:
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
_ISR_Disable( level );
46fa8: 223c 0000 0700 movel #1792,%d1
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
46fae: 4e56 ffe4 linkw %fp,#-28
46fb2: 202e 000c movel %fp@(12),%d0
46fb6: 48d7 04fc moveml %d2-%d7/%a2,%sp@
46fba: 246e 0008 moveal %fp@(8),%a2
46fbe: 206e 0010 moveal %fp@(16),%a0
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;
46fc2: 2a2a 0030 movel %a2@(48),%d5
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
46fc6: 226e 0014 moveal %fp@(20),%a1
46fca: 282e 0018 movel %fp@(24),%d4
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
_ISR_Disable( level );
46fce: 40c3 movew %sr,%d3
46fd0: 8283 orl %d3,%d1
46fd2: 46c1 movew %d1,%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;
46fd4: 8090 orl %a0@,%d0
46fd6: 2080 movel %d0,%a0@
_Event_sets_Post( event_in, &event->pending_events );
pending_events = event->pending_events;
event_condition = the_thread->Wait.count;
46fd8: 242a 0024 movel %a2@(36),%d2
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 );
46fdc: 2200 movel %d0,%d1
46fde: c282 andl %d2,%d1
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
46fe0: 6700 0090 beqw 47072 <_Event_Surrender+0xca>
/*
* 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() &&
46fe4: 4ab9 0006 1428 tstl 61428 <_Per_CPU_Information+0x8>
46fea: 6708 beqs 46ff4 <_Event_Surrender+0x4c>
46fec: b5f9 0006 142e cmpal 6142e <_Per_CPU_Information+0xe>,%a2
46ff2: 6754 beqs 47048 <_Event_Surrender+0xa0> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
46ff4: c8aa 0010 andl %a2@(16),%d4
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
46ff8: 6778 beqs 47072 <_Event_Surrender+0xca>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
46ffa: b282 cmpl %d2,%d1
46ffc: 6706 beqs 47004 <_Event_Surrender+0x5c>
46ffe: 0805 0001 btst #1,%d5
47002: 676e beqs 47072 <_Event_Surrender+0xca> <== NEVER TAKEN
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) );
47004: 2401 movel %d1,%d2
47006: 4682 notl %d2
47008: c480 andl %d0,%d2
4700a: 2082 movel %d2,%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;
4700c: 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;
47010: 42aa 0024 clrl %a2@(36)
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
47014: 2081 movel %d1,%a0@
_ISR_Flash( level );
47016: 203c 0000 0700 movel #1792,%d0
4701c: 46c3 movew %d3,%sr
4701e: 8083 orl %d3,%d0
47020: 46c0 movew %d0,%sr
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
47022: 7002 moveq #2,%d0
47024: b0aa 0050 cmpl %a2@(80),%d0
47028: 6754 beqs 4707e <_Event_Surrender+0xd6>
_ISR_Enable( level );
4702a: 46c3 movew %d3,%sr
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
4702c: 2d4a 0008 movel %a2,%fp@(8)
47030: 2e3c 1007 fff8 movel #268959736,%d7
47036: 2d47 000c movel %d7,%fp@(12)
}
return;
}
}
_ISR_Enable( level );
}
4703a: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2
47040: 4e5e unlk %fp
47042: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
* 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 ) &&
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
47048: 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 ) &&
4704a: 7e01 moveq #1,%d7
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
4704c: 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 ) &&
4704e: be86 cmpl %d6,%d7
47050: 65a2 bcss 46ff4 <_Event_Surrender+0x4c> <== 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) ) {
47052: b282 cmpl %d2,%d1
47054: 6706 beqs 4705c <_Event_Surrender+0xb4>
47056: 0805 0001 btst #1,%d5
4705a: 6716 beqs 47072 <_Event_Surrender+0xca> <== NEVER TAKEN
4705c: 2401 movel %d1,%d2
4705e: 4682 notl %d2
47060: c480 andl %d0,%d2
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
47062: 7003 moveq #3,%d0
47064: 2082 movel %d2,%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;
47066: 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;
4706a: 42aa 0024 clrl %a2@(36)
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
4706e: 2081 movel %d1,%a0@
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
47070: 2280 movel %d0,%a1@
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
47072: 46c3 movew %d3,%sr
}
47074: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2
4707a: 4e5e unlk %fp
4707c: 4e75 rts
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
4707e: 7003 moveq #3,%d0
47080: 2540 0050 movel %d0,%a2@(80)
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
47084: 46c3 movew %d3,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
47086: 486a 0048 pea %a2@(72)
4708a: 2e3c 1007 fff8 movel #268959736,%d7
47090: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
47096: 588f addql #4,%sp
47098: 2d47 000c movel %d7,%fp@(12)
4709c: 2d4a 0008 movel %a2,%fp@(8)
}
return;
}
}
_ISR_Enable( level );
}
470a0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2
470a6: 4e5e unlk %fp
470a8: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
...
000470b0 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *arg
)
{
470b0: 4e56 fffc linkw %fp,#-4
470b4: 2f02 movel %d2,%sp@-
ISR_Level level;
Thread_blocking_operation_States *sync_state;
sync_state = arg;
the_thread = _Thread_Get( id, &location );
470b6: 486e fffc pea %fp@(-4)
470ba: 2f2e 0008 movel %fp@(8),%sp@-
470be: 4eb9 0004 9cf0 jsr 49cf0 <_Thread_Get>
switch ( location ) {
470c4: 508f addql #8,%sp
470c6: 4aae fffc tstl %fp@(-4)
470ca: 6642 bnes 4710e <_Event_Timeout+0x5e> <== 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 );
470cc: 223c 0000 0700 movel #1792,%d1
470d2: 40c2 movew %sr,%d2
470d4: 8282 orl %d2,%d1
470d6: 46c1 movew %d1,%sr
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
470d8: 2040 moveal %d0,%a0
470da: 42a8 0024 clrl %a0@(36)
if ( _Thread_Is_executing( the_thread ) ) {
470de: b0b9 0006 142e cmpl 6142e <_Per_CPU_Information+0xe>,%d0
470e4: 6730 beqs 47116 <_Event_Timeout+0x66>
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
470e6: 7206 moveq #6,%d1
470e8: 2040 moveal %d0,%a0
470ea: 2141 0034 movel %d1,%a0@(52)
_ISR_Enable( level );
470ee: 46c2 movew %d2,%sr
470f0: 2f3c 1007 fff8 movel #268959736,%sp@-
470f6: 2f00 movel %d0,%sp@-
470f8: 4eb9 0004 98d0 jsr 498d0 <_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;
470fe: 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;
47100: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
--level;
47106: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
47108: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
4710e: 242e fff8 movel %fp@(-8),%d2
47112: 4e5e unlk %fp
47114: 4e75 rts
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
47116: 206e 000c moveal %fp@(12),%a0
4711a: 7201 moveq #1,%d1
4711c: b290 cmpl %a0@,%d1
4711e: 66c6 bnes 470e6 <_Event_Timeout+0x36>
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
47120: 7202 moveq #2,%d1
47122: 2081 movel %d1,%a0@
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
47124: 7206 moveq #6,%d1
47126: 2040 moveal %d0,%a0
47128: 2141 0034 movel %d1,%a0@(52)
_ISR_Enable( level );
4712c: 46c2 movew %d2,%sr
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
4712e: 2f3c 1007 fff8 movel #268959736,%sp@-
47134: 2f00 movel %d0,%sp@-
47136: 4eb9 0004 98d0 jsr 498d0 <_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;
4713c: 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;
4713e: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
--level;
47144: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
47146: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
4714c: 60c0 bras 4710e <_Event_Timeout+0x5e>
...
0004cff0 <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
4cff0: 4e56 ffc4 linkw %fp,#-60
4cff4: 226e 000c moveal %fp@(12),%a1
4cff8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
4cffc: 246e 0008 moveal %fp@(8),%a2
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
4d000: 2c09 movel %a1,%d6
4d002: 5886 addql #4,%d6
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
4d004: 202a 0010 movel %a2@(16),%d0
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
4d008: 262e 0010 movel %fp@(16),%d3
4d00c: 2a2e 0014 movel %fp@(20),%d5
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
4d010: 2d40 fffc movel %d0,%fp@(-4)
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
4d014: bc89 cmpl %a1,%d6
4d016: 6500 0164 bcsw 4d17c <_Heap_Allocate_aligned_with_boundary+0x18c>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
4d01a: 4a85 tstl %d5
4d01c: 670c beqs 4d02a <_Heap_Allocate_aligned_with_boundary+0x3a>
if ( boundary < alloc_size ) {
4d01e: ba89 cmpl %a1,%d5
4d020: 6500 015a bcsw 4d17c <_Heap_Allocate_aligned_with_boundary+0x18c>
return NULL;
}
if ( alignment == 0 ) {
4d024: 4a83 tstl %d3
4d026: 6602 bnes 4d02a <_Heap_Allocate_aligned_with_boundary+0x3a>
alignment = page_size;
4d028: 2600 movel %d0,%d3
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
4d02a: 206a 0008 moveal %a2@(8),%a0
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
4d02e: 4284 clrl %d4
4d030: b1ca cmpal %a2,%a0
4d032: 6732 beqs 4d066 <_Heap_Allocate_aligned_with_boundary+0x76>
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
4d034: 222e fffc movel %fp@(-4),%d1
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
4d038: 7404 moveq #4,%d2
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
4d03a: 5e81 addql #7,%d1
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
4d03c: 9489 subl %a1,%d2
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
4d03e: 2d41 fff8 movel %d1,%fp@(-8)
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
4d042: 2d42 fff4 movel %d2,%fp@(-12)
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
4d046: 2028 0004 movel %a0@(4),%d0
4d04a: b086 cmpl %d6,%d0
4d04c: 632e blss 4d07c <_Heap_Allocate_aligned_with_boundary+0x8c>
if ( alignment == 0 ) {
4d04e: 4a83 tstl %d3
4d050: 6636 bnes 4d088 <_Heap_Allocate_aligned_with_boundary+0x98>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
4d052: 2408 movel %a0,%d2
4d054: 5082 addql #8,%d2
);
}
}
/* Statistics */
++search_count;
4d056: 5284 addql #1,%d4
if ( alloc_begin != 0 ) {
4d058: 4a82 tstl %d2
4d05a: 6600 00f4 bnew 4d150 <_Heap_Allocate_aligned_with_boundary+0x160>
break;
}
block = block->next;
4d05e: 2068 0008 moveal %a0@(8),%a0
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
4d062: b1ca cmpal %a2,%a0
4d064: 66e0 bnes 4d046 <_Heap_Allocate_aligned_with_boundary+0x56>
);
}
}
/* Statistics */
++search_count;
4d066: 4280 clrl %d0
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
4d068: b8aa 0044 cmpl %a2@(68),%d4
4d06c: 6304 blss 4d072 <_Heap_Allocate_aligned_with_boundary+0x82>
stats->max_search = search_count;
4d06e: 2544 0044 movel %d4,%a2@(68)
}
return (void *) alloc_begin;
}
4d072: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5
4d078: 4e5e unlk %fp
4d07a: 4e75 rts
if ( alloc_begin != 0 ) {
break;
}
block = block->next;
4d07c: 2068 0008 moveal %a0@(8),%a0
);
}
}
/* Statistics */
++search_count;
4d080: 5284 addql #1,%d4
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
4d082: b1ca cmpal %a2,%a0
4d084: 66c0 bnes 4d046 <_Heap_Allocate_aligned_with_boundary+0x56>
4d086: 60de bras 4d066 <_Heap_Allocate_aligned_with_boundary+0x76>
- 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;
4d088: 7efe moveq #-2,%d7
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
4d08a: 49e8 0008 lea %a0@(8),%a4
- 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;
4d08e: c087 andl %d7,%d0
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
4d090: 266a 0014 moveal %a2@(20),%a3
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
4d094: d088 addl %a0,%d0
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
4d096: 222e fff8 movel %fp@(-8),%d1
4d09a: 928b subl %a3,%d1
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
4d09c: 242e fff4 movel %fp@(-12),%d2
4d0a0: d480 addl %d0,%d2
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4d0a2: 2e02 movel %d2,%d7
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
4d0a4: d081 addl %d1,%d0
4d0a6: 4c43 7001 remul %d3,%d1,%d7
4d0aa: 9481 subl %d1,%d2
uintptr_t alloc_begin = alloc_end - alloc_size;
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
4d0ac: b480 cmpl %d0,%d2
4d0ae: 630a blss 4d0ba <_Heap_Allocate_aligned_with_boundary+0xca>
4d0b0: 2400 movel %d0,%d2
4d0b2: 4c43 2001 remul %d3,%d1,%d2
4d0b6: 2400 movel %d0,%d2
4d0b8: 9481 subl %d1,%d2
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
4d0ba: 4a85 tstl %d5
4d0bc: 6766 beqs 4d124 <_Heap_Allocate_aligned_with_boundary+0x134>
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment );
}
alloc_end = alloc_begin + alloc_size;
4d0be: 2202 movel %d2,%d1
4d0c0: d289 addl %a1,%d1
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
4d0c2: 4bf4 9800 lea %a4@(00000000,%a1:l),%a5
4d0c6: 2001 movel %d1,%d0
4d0c8: 4c45 0007 remul %d5,%d7,%d0
4d0cc: 2d4d ffec movel %a5,%fp@(-20)
4d0d0: 2a41 moveal %d1,%a5
4d0d2: 9bc7 subal %d7,%a5
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
4d0d4: bbc2 cmpal %d2,%a5
4d0d6: 634c blss 4d124 <_Heap_Allocate_aligned_with_boundary+0x134>
4d0d8: bbc1 cmpal %d1,%a5
4d0da: 6448 bccs 4d124 <_Heap_Allocate_aligned_with_boundary+0x134>
if ( boundary_line < boundary_floor ) {
4d0dc: bbee ffec cmpal %fp@(-20),%a5
4d0e0: 6500 008e bcsw 4d170 <_Heap_Allocate_aligned_with_boundary+0x180>
4d0e4: 200d movel %a5,%d0
4d0e6: 2a44 moveal %d4,%a5
4d0e8: 2e2e ffec movel %fp@(-20),%d7
return 0;
}
alloc_begin = boundary_line - alloc_size;
4d0ec: 9089 subl %a1,%d0
4d0ee: 2400 movel %d0,%d2
4d0f0: 4c43 2001 remul %d3,%d1,%d2
4d0f4: 2400 movel %d0,%d2
4d0f6: 9481 subl %d1,%d2
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
4d0f8: 2202 movel %d2,%d1
4d0fa: d289 addl %a1,%d1
4d0fc: 2801 movel %d1,%d4
4d0fe: 4c45 4000 remul %d5,%d0,%d4
4d102: 2801 movel %d1,%d4
4d104: 9880 subl %d0,%d4
4d106: 2004 movel %d4,%d0
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
4d108: b882 cmpl %d2,%d4
4d10a: 6316 blss 4d122 <_Heap_Allocate_aligned_with_boundary+0x132>
4d10c: b881 cmpl %d1,%d4
4d10e: 6412 bccs 4d122 <_Heap_Allocate_aligned_with_boundary+0x132>
if ( boundary_line < boundary_floor ) {
4d110: b087 cmpl %d7,%d0
4d112: 64d8 bccs 4d0ec <_Heap_Allocate_aligned_with_boundary+0xfc><== ALWAYS TAKEN
4d114: 280d movel %a5,%d4 <== NOT EXECUTED
return 0;
4d116: 4282 clrl %d2 <== NOT EXECUTED
);
}
}
/* Statistics */
++search_count;
4d118: 5284 addql #1,%d4 <== NOT EXECUTED
if ( alloc_begin != 0 ) {
4d11a: 4a82 tstl %d2 <== NOT EXECUTED
4d11c: 6700 ff40 beqw 4d05e <_Heap_Allocate_aligned_with_boundary+0x6e><== NOT EXECUTED
4d120: 602e bras 4d150 <_Heap_Allocate_aligned_with_boundary+0x160><== NOT EXECUTED
4d122: 280d movel %a5,%d4
boundary_line = _Heap_Align_down( alloc_end, boundary );
}
}
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
4d124: b48c cmpl %a4,%d2
4d126: 6548 bcss 4d170 <_Heap_Allocate_aligned_with_boundary+0x180>
4d128: 70f8 moveq #-8,%d0
4d12a: 9088 subl %a0,%d0
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
4d12c: 2a40 moveal %d0,%a5
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4d12e: 2e02 movel %d2,%d7
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
4d130: dbc2 addal %d2,%a5
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4d132: 202e fffc movel %fp@(-4),%d0
4d136: 4c40 7001 remul %d0,%d1,%d7
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
4d13a: 9bc1 subal %d1,%a5
if ( free_size >= min_block_size || free_size == 0 ) {
4d13c: bbcb cmpal %a3,%a5
4d13e: 6400 ff16 bccw 4d056 <_Heap_Allocate_aligned_with_boundary+0x66>
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
return 0;
4d142: 4a8d tstl %a5
4d144: 57c0 seq %d0
);
}
}
/* Statistics */
++search_count;
4d146: 5284 addql #1,%d4
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
return 0;
4d148: 49c0 extbl %d0
4d14a: c480 andl %d0,%d2
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
4d14c: 6700 ff10 beqw 4d05e <_Heap_Allocate_aligned_with_boundary+0x6e>
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
stats->searches += search_count;
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
4d150: 2f09 movel %a1,%sp@-
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
4d152: 52aa 0048 addql #1,%a2@(72)
stats->searches += search_count;
4d156: d9aa 004c addl %d4,%a2@(76)
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
4d15a: 2f02 movel %d2,%sp@-
4d15c: 2f08 movel %a0,%sp@-
4d15e: 2f0a movel %a2,%sp@-
4d160: 4eb9 0004 8858 jsr 48858 <_Heap_Block_allocate>
4d166: 4fef 0010 lea %sp@(16),%sp
4d16a: 2002 movel %d2,%d0
4d16c: 6000 fefa braw 4d068 <_Heap_Allocate_aligned_with_boundary+0x78>
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
return 0;
4d170: 4282 clrl %d2
);
}
}
/* Statistics */
++search_count;
4d172: 5284 addql #1,%d4
if ( alloc_begin != 0 ) {
4d174: 4a82 tstl %d2
4d176: 6700 fee6 beqw 4d05e <_Heap_Allocate_aligned_with_boundary+0x6e>
4d17a: 60d4 bras 4d150 <_Heap_Allocate_aligned_with_boundary+0x160><== NOT EXECUTED
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
/* Integer overflow occured */
return NULL;
4d17c: 4280 clrl %d0
if ( stats->max_search < search_count ) {
stats->max_search = search_count;
}
return (void *) alloc_begin;
}
4d17e: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5
4d184: 4e5e unlk %fp <== NOT EXECUTED
0004d188 <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
4d188: 4e56 ffe8 linkw %fp,#-24
4d18c: 206e 0008 moveal %fp@(8),%a0
4d190: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@
4d194: 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 ) {
4d198: 6700 00ba beqw 4d254 <_Heap_Free+0xcc>
4d19c: 2240 moveal %d0,%a1
4d19e: 5189 subql #8,%a1
4d1a0: 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
4d1a6: 2028 0020 movel %a0@(32),%d0
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
4d1aa: 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;
4d1ac: b089 cmpl %a1,%d0
4d1ae: 6200 009a bhiw 4d24a <_Heap_Free+0xc2>
4d1b2: 2228 0024 movel %a0@(36),%d1
4d1b6: b289 cmpl %a1,%d1
4d1b8: 6500 0090 bcsw 4d24a <_Heap_Free+0xc2>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4d1bc: 2829 0004 movel %a1@(4),%d4
- 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;
4d1c0: 74fe moveq #-2,%d2
4d1c2: c484 andl %d4,%d2
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4d1c4: 45f1 2800 lea %a1@(00000000,%d2: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;
4d1c8: b5c0 cmpal %d0,%a2
4d1ca: 657e bcss 4d24a <_Heap_Free+0xc2> <== NEVER TAKEN
4d1cc: b5c1 cmpal %d1,%a2
4d1ce: 627a bhis 4d24a <_Heap_Free+0xc2> <== NEVER TAKEN
4d1d0: 262a 0004 movel %a2@(4),%d3
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
4d1d4: 0803 0000 btst #0,%d3
4d1d8: 6770 beqs 4d24a <_Heap_Free+0xc2> <== NEVER TAKEN
- 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;
4d1da: 7afe moveq #-2,%d5
4d1dc: c685 andl %d5,%d3
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
4d1de: b5c1 cmpal %d1,%a2
4d1e0: 6700 00b2 beqw 4d294 <_Heap_Free+0x10c>
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;
4d1e4: 7a01 moveq #1,%d5
4d1e6: cab2 3804 andl %a2@(00000004,%d3:l),%d5
4d1ea: 6600 00a8 bnew 4d294 <_Heap_Free+0x10c>
if ( !_Heap_Is_prev_used( block ) ) {
4d1ee: 0804 0000 btst #0,%d4
4d1f2: 666a bnes 4d25e <_Heap_Free+0xd6>
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
4d1f4: 7a01 moveq #1,%d5
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
uintptr_t const prev_size = block->prev_size;
4d1f6: 2811 movel %a1@,%d4
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4d1f8: 93c4 subal %d4,%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;
4d1fa: b3c0 cmpal %d0,%a1
4d1fc: 654c bcss 4d24a <_Heap_Free+0xc2> <== NEVER TAKEN
4d1fe: b3c1 cmpal %d1,%a1
4d200: 6248 bhis 4d24a <_Heap_Free+0xc2> <== 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;
4d202: 7001 moveq #1,%d0
4d204: c0a9 0004 andl %a1@(4),%d0
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) ) {
4d208: 6740 beqs 4d24a <_Heap_Free+0xc2> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
4d20a: 4a05 tstb %d5
4d20c: 6700 00de beqw 4d2ec <_Heap_Free+0x164>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4d210: 266a 0008 moveal %a2@(8),%a3
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
4d214: d882 addl %d2,%d4
4d216: d684 addl %d4,%d3
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4d218: 7001 moveq #1,%d0
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4d21a: 246a 000c moveal %a2@(12),%a2
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
prev->next = next;
4d21e: 254b 0008 movel %a3,%a2@(8)
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;
4d222: 8083 orl %d3,%d0
next->prev = prev;
4d224: 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;
4d228: 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;
4d22c: 2383 3800 movel %d3,%a1@(00000000,%d3: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;
4d230: 2340 0004 movel %d0,%a1@(4)
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
4d234: 53a8 0040 subql #1,%a0@(64)
++stats->frees;
4d238: 52a8 0050 addql #1,%a0@(80)
stats->free_size += block_size;
4d23c: d5a8 0030 addl %d2,%a0@(48)
return( true );
4d240: 7001 moveq #1,%d0
}
4d242: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3
4d246: 4e5e unlk %fp
4d248: 4e75 rts
4d24a: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3
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;
4d24e: 4200 clrb %d0
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4d250: 4e5e unlk %fp
4d252: 4e75 rts
4d254: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3
* 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;
4d258: 7001 moveq #1,%d0
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4d25a: 4e5e unlk %fp
4d25c: 4e75 rts
4d25e: 266a 0008 moveal %a2@(8),%a3
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
uintptr_t const size = block_size + next_block_size;
4d262: d682 addl %d2,%d3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4d264: 7001 moveq #1,%d0
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
4d266: 246a 000c moveal %a2@(12),%a2
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;
4d26a: 8083 orl %d3,%d0
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
new_block->next = next;
4d26c: 234b 0008 movel %a3,%a1@(8)
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
4d270: 2383 3800 movel %d3,%a1@(00000000,%d3:l)
new_block->prev = prev;
4d274: 234a 000c movel %a2,%a1@(12)
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;
4d278: 2340 0004 movel %d0,%a1@(4)
/* Statistics */
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
4d27c: 7001 moveq #1,%d0
next->prev = new_block;
prev->next = new_block;
4d27e: 2549 0008 movel %a1,%a2@(8)
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
4d282: 2749 000c movel %a1,%a3@(12)
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
4d286: 53a8 0040 subql #1,%a0@(64)
++stats->frees;
4d28a: 52a8 0050 addql #1,%a0@(80)
stats->free_size += block_size;
4d28e: d5a8 0030 addl %d2,%a0@(48)
4d292: 60ae bras 4d242 <_Heap_Free+0xba>
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
4d294: 0804 0000 btst #0,%d4
4d298: 6606 bnes 4d2a0 <_Heap_Free+0x118>
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
4d29a: 4205 clrb %d5
4d29c: 6000 ff58 braw 4d1f6 <_Heap_Free+0x6e>
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;
/* Statistics */
++stats->free_blocks;
4d2a0: 2028 0038 movel %a0@(56),%d0
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;
4d2a4: 7201 moveq #1,%d1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4d2a6: 7afe moveq #-2,%d5
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
4d2a8: 5280 addql #1,%d0
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
4d2aa: 2668 0008 moveal %a0@(8),%a3
new_block->next = next;
new_block->prev = block_before;
4d2ae: 2348 000c movel %a0,%a1@(12)
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;
4d2b2: 8282 orl %d2,%d1
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
4d2b4: 234b 0008 movel %a3,%a1@(8)
4d2b8: 2341 0004 movel %d1,%a1@(4)
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4d2bc: cbaa 0004 andl %d5,%a2@(4)
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
4d2c0: 2749 000c movel %a1,%a3@(12)
next_block->prev_size = block_size;
4d2c4: 2482 movel %d2,%a2@
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
4d2c6: 2149 0008 movel %a1,%a0@(8)
/* Statistics */
++stats->free_blocks;
4d2ca: 2140 0038 movel %d0,%a0@(56)
if ( stats->max_free_blocks < stats->free_blocks ) {
4d2ce: b0a8 003c cmpl %a0@(60),%d0
4d2d2: 6300 ff60 blsw 4d234 <_Heap_Free+0xac>
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
4d2d6: 53a8 0040 subql #1,%a0@(64)
++stats->frees;
4d2da: 52a8 0050 addql #1,%a0@(80)
stats->free_size += block_size;
4d2de: d5a8 0030 addl %d2,%a0@(48)
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
4d2e2: 2140 003c movel %d0,%a0@(60)
/* Statistics */
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
4d2e6: 7001 moveq #1,%d0
4d2e8: 6000 ff58 braw 4d242 <_Heap_Free+0xba>
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
4d2ec: d882 addl %d2,%d4
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
4d2ee: 7201 moveq #1,%d1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4d2f0: 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;
4d2f2: 8284 orl %d4,%d1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
4d2f4: 2484 movel %d4,%a2@
/* Statistics */
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
4d2f6: 7001 moveq #1,%d0
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;
4d2f8: 2341 0004 movel %d1,%a1@(4)
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
4d2fc: cbaa 0004 andl %d5,%a2@(4)
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
4d300: 53a8 0040 subql #1,%a0@(64)
++stats->frees;
4d304: 52a8 0050 addql #1,%a0@(80)
stats->free_size += block_size;
4d308: d5a8 0030 addl %d2,%a0@(48)
4d30c: 6000 ff34 braw 4d242 <_Heap_Free+0xba>
00052448 <_Heap_Get_free_information>:
void _Heap_Get_free_information(
Heap_Control *the_heap,
Heap_Information *info
)
{
52448: 4e56 fff0 linkw %fp,#-16
5244c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
52450: 266e 0008 moveal %fp@(8),%a3
52454: 246e 000c moveal %fp@(12),%a2
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
52458: 206b 0008 moveal %a3@(8),%a0
Heap_Block *the_block;
Heap_Block *const tail = _Heap_Free_list_tail(the_heap);
info->number = 0;
5245c: 4292 clrl %a2@
info->largest = 0;
5245e: 42aa 0004 clrl %a2@(4)
info->total = 0;
52462: 42aa 0008 clrl %a2@(8)
for(the_block = _Heap_Free_list_first(the_heap);
52466: b1cb cmpal %a3,%a0
52468: 6732 beqs 5249c <_Heap_Get_free_information+0x54><== NEVER TAKEN
5246a: 327c 0001 moveaw #1,%a1
5246e: 4282 clrl %d2
52470: 4281 clrl %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;
52472: 70fe moveq #-2,%d0
52474: 2609 movel %a1,%d3
52476: 5283 addql #1,%d3
52478: c0a8 0004 andl %a0@(4),%d0
/* As we always coalesce free blocks, prev block must have been used. */
_HAssert(_Heap_Is_prev_used(the_block));
info->number++;
info->total += the_size;
5247c: d280 addl %d0,%d1
if ( info->largest < the_size )
5247e: b480 cmpl %d0,%d2
52480: 6404 bccs 52486 <_Heap_Get_free_information+0x3e>
info->largest = the_size;
52482: 2540 0004 movel %d0,%a2@(4)
info->largest = 0;
info->total = 0;
for(the_block = _Heap_Free_list_first(the_heap);
the_block != tail;
the_block = the_block->next)
52486: 2068 0008 moveal %a0@(8),%a0
info->number = 0;
info->largest = 0;
info->total = 0;
for(the_block = _Heap_Free_list_first(the_heap);
5248a: b1cb cmpal %a3,%a0
5248c: 6708 beqs 52496 <_Heap_Get_free_information+0x4e>
5248e: 242a 0004 movel %a2@(4),%d2
52492: 2243 moveal %d3,%a1
52494: 60dc bras 52472 <_Heap_Get_free_information+0x2a>
52496: 2489 movel %a1,%a2@
52498: 2541 0008 movel %d1,%a2@(8)
info->number++;
info->total += the_size;
if ( info->largest < the_size )
info->largest = the_size;
}
}
5249c: 4cd7 0c0c moveml %sp@,%d2-%d3/%a2-%a3
524a0: 4e5e unlk %fp <== NOT EXECUTED
0004aaa0 <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
4aaa0: 4e56 ffe8 linkw %fp,#-24
4aaa4: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
4aaa8: 246e 0008 moveal %fp@(8),%a2
4aaac: 242e 0010 movel %fp@(16),%d2
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
4aab0: 6700 00ca beqw 4ab7c <_Heap_Greedy_allocate+0xdc>
4aab4: 2a6e 000c moveal %fp@(12),%a5
4aab8: 97cb subal %a3,%a3
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;
4aaba: 99cc subal %a4,%a4
4aabc: 263c 0005 1f50 movel #335696,%d3
* @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 );
4aac2: 42a7 clrl %sp@-
4aac4: 2043 moveal %d3,%a0
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
4aac6: 528b addql #1,%a3
4aac8: 42a7 clrl %sp@-
4aaca: 2f1d movel %a5@+,%sp@-
4aacc: 2f0a movel %a2,%sp@-
4aace: 4e90 jsr %a0@
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
4aad0: 4fef 0010 lea %sp@(16),%sp
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
4aad4: 2040 moveal %d0,%a0
4aad6: 5188 subql #8,%a0
4aad8: 4a80 tstl %d0
4aada: 670e beqs 4aaea <_Heap_Greedy_allocate+0x4a> <== NEVER TAKEN
4aadc: 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);
4aae2: 91c1 subal %d1,%a0
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
4aae4: 214c 0008 movel %a4,%a0@(8)
4aae8: 2848 moveal %a0,%a4
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
4aaea: b48b cmpl %a3,%d2
4aaec: 66d4 bnes 4aac2 <_Heap_Greedy_allocate+0x22>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
4aaee: 266a 0008 moveal %a2@(8),%a3
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4aaf2: b7ca cmpal %a2,%a3
4aaf4: 6700 008c beqw 4ab82 <_Heap_Greedy_allocate+0xe2>
- 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;
4aaf8: 70fe moveq #-2,%d0
4aafa: 4bf9 0004 ae78 lea 4ae78 <_Heap_Block_allocate>,%a5
4ab00: 4282 clrl %d2
4ab02: c0ab 0004 andl %a3@(4),%d0
_Heap_Block_allocate(
4ab06: 2040 moveal %d0,%a0
4ab08: 4868 fff8 pea %a0@(-8)
4ab0c: 486b 0008 pea %a3@(8)
4ab10: 2f0b movel %a3,%sp@-
4ab12: 2f0a movel %a2,%sp@-
4ab14: 4e95 jsr %a5@
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4ab16: 4fef 0010 lea %sp@(16),%sp
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
4ab1a: 2742 0008 movel %d2,%a3@(8)
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
4ab1e: 202a 0008 movel %a2@(8),%d0
4ab22: 240b movel %a3,%d2
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4ab24: b08a cmpl %a2,%d0
4ab26: 672a beqs 4ab52 <_Heap_Greedy_allocate+0xb2>
4ab28: 2640 moveal %d0,%a3
- 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;
4ab2a: 70fe moveq #-2,%d0
4ab2c: c0ab 0004 andl %a3@(4),%d0
_Heap_Block_allocate(
4ab30: 2040 moveal %d0,%a0
4ab32: 4868 fff8 pea %a0@(-8)
4ab36: 486b 0008 pea %a3@(8)
4ab3a: 2f0b movel %a3,%sp@-
4ab3c: 2f0a movel %a2,%sp@-
4ab3e: 4e95 jsr %a5@
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4ab40: 4fef 0010 lea %sp@(16),%sp
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
4ab44: 2742 0008 movel %d2,%a3@(8)
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
4ab48: 202a 0008 movel %a2@(8),%d0
4ab4c: 240b movel %a3,%d2
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4ab4e: b08a cmpl %a2,%d0
4ab50: 66d6 bnes 4ab28 <_Heap_Greedy_allocate+0x88>
4ab52: 4bf9 0005 20e8 lea 520e8 <_Heap_Free>,%a5
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
4ab58: 4a8c tstl %a4
4ab5a: 6714 beqs 4ab70 <_Heap_Greedy_allocate+0xd0>
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
4ab5c: 222c 0008 movel %a4@(8),%d1
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
4ab60: 486c 0008 pea %a4@(8)
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
4ab64: 2841 moveal %d1,%a4
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
4ab66: 2f0a movel %a2,%sp@-
4ab68: 4e95 jsr %a5@
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
4ab6a: 508f addql #8,%sp
4ab6c: 4a8c tstl %a4
4ab6e: 66ec bnes 4ab5c <_Heap_Greedy_allocate+0xbc>
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
4ab70: 200b movel %a3,%d0
4ab72: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4ab78: 4e5e unlk %fp
4ab7a: 4e75 rts
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;
4ab7c: 99cc subal %a4,%a4
4ab7e: 6000 ff6e braw 4aaee <_Heap_Greedy_allocate+0x4e>
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
4ab82: 97cb subal %a3,%a3 <== NOT EXECUTED
4ab84: 4bf9 0005 20e8 lea 520e8 <_Heap_Free>,%a5 <== NOT EXECUTED
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
4ab8a: 4a8c tstl %a4 <== NOT EXECUTED
4ab8c: 66ce bnes 4ab5c <_Heap_Greedy_allocate+0xbc> <== NOT EXECUTED
4ab8e: 60e0 bras 4ab70 <_Heap_Greedy_allocate+0xd0> <== NOT EXECUTED
0004ab90 <_Heap_Greedy_free>:
void _Heap_Greedy_free(
Heap_Control *heap,
Heap_Block *blocks
)
{
4ab90: 4e56 fff4 linkw %fp,#-12
4ab94: 206e 000c moveal %fp@(12),%a0
4ab98: 48d7 040c moveml %d2-%d3/%a2,%sp@
4ab9c: 262e 0008 movel %fp@(8),%d3
4aba0: 45f9 0005 20e8 lea 520e8 <_Heap_Free>,%a2
while ( blocks != NULL ) {
4aba6: 4a88 tstl %a0
4aba8: 6714 beqs 4abbe <_Heap_Greedy_free+0x2e> <== NEVER TAKEN
Heap_Block *current = blocks;
blocks = blocks->next;
4abaa: 2428 0008 movel %a0@(8),%d2
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
4abae: 4868 0008 pea %a0@(8)
4abb2: 2f03 movel %d3,%sp@-
4abb4: 4e92 jsr %a2@
void _Heap_Greedy_free(
Heap_Control *heap,
Heap_Block *blocks
)
{
while ( blocks != NULL ) {
4abb6: 508f addql #8,%sp
Heap_Block *current = blocks;
blocks = blocks->next;
4abb8: 2042 moveal %d2,%a0
void _Heap_Greedy_free(
Heap_Control *heap,
Heap_Block *blocks
)
{
while ( blocks != NULL ) {
4abba: 4a82 tstl %d2
4abbc: 66ec bnes 4abaa <_Heap_Greedy_free+0x1a>
Heap_Block *current = blocks;
blocks = blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
}
4abbe: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
4abc4: 4e5e unlk %fp <== NOT EXECUTED
00052500 <_Heap_Iterate>:
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
52500: 4e56 fff0 linkw %fp,#-16
52504: 226e 0008 moveal %fp@(8),%a1
52508: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
5250c: 266e 000c moveal %fp@(12),%a3
52510: 262e 0010 movel %fp@(16),%d3
Heap_Block *current = heap->first_block;
52514: 2069 0020 moveal %a1@(32),%a0
Heap_Block *end = heap->last_block;
52518: 2429 0024 movel %a1@(36),%d2
bool stop = false;
while ( !stop && current != end ) {
5251c: b488 cmpl %a0,%d2
5251e: 6728 beqs 52548 <_Heap_Iterate+0x48> <== NEVER TAKEN
52520: 70fe moveq #-2,%d0
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 );
52522: 7201 moveq #1,%d1
52524: c0a8 0004 andl %a0@(4),%d0
52528: 2f03 movel %d3,%sp@-
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
5252a: 45f0 0800 lea %a0@(00000000,%d0:l),%a2
5252e: c2aa 0004 andl %a2@(4),%d1
52532: 2f01 movel %d1,%sp@-
52534: 2f00 movel %d0,%sp@-
52536: 2f08 movel %a0,%sp@-
52538: 4e93 jsr %a3@
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
5253a: 4fef 0010 lea %sp@(16),%sp
5253e: 204a moveal %a2,%a0
52540: 4a00 tstb %d0
52542: 6604 bnes 52548 <_Heap_Iterate+0x48> <== NEVER TAKEN
52544: b5c2 cmpal %d2,%a2
52546: 66d8 bnes 52520 <_Heap_Iterate+0x20>
stop = (*visitor)( current, size, used, visitor_arg );
current = next;
}
}
52548: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
5254e: 4e5e unlk %fp
...
0005d634 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
5d634: 4e56 0000 linkw %fp,#0
5d638: 202e 000c movel %fp@(12),%d0
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
5d63c: 2040 moveal %d0,%a0
5d63e: 5188 subql #8,%a0
5d640: 226e 0008 moveal %fp@(8),%a1
5d644: 2f02 movel %d2,%sp@-
5d646: 2400 movel %d0,%d2
5d648: 4c69 2001 0010 remul %a1@(16),%d1,%d2
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
5d64e: 91c1 subal %d1,%a0
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
5d650: 2229 0020 movel %a1@(32),%d1
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
5d654: b288 cmpl %a0,%d1
5d656: 6238 bhis 5d690 <_Heap_Size_of_alloc_area+0x5c>
5d658: 2269 0024 moveal %a1@(36),%a1
5d65c: b3c8 cmpal %a0,%a1
5d65e: 6530 bcss 5d690 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN
- 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;
5d660: 74fe moveq #-2,%d2
5d662: c4a8 0004 andl %a0@(4),%d2
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
5d666: 41f0 2800 lea %a0@(00000000,%d2: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;
5d66a: b1c1 cmpal %d1,%a0
5d66c: 6522 bcss 5d690 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN
5d66e: b1c9 cmpal %a1,%a0
5d670: 621e bhis 5d690 <_Heap_Size_of_alloc_area+0x5c> <== 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;
5d672: 7201 moveq #1,%d1
5d674: c2a8 0004 andl %a0@(4),%d1
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
5d678: 6716 beqs 5d690 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
5d67a: 7204 moveq #4,%d1
5d67c: 9280 subl %d0,%d1
5d67e: 2001 movel %d1,%d0
5d680: d088 addl %a0,%d0
5d682: 226e 0010 moveal %fp@(16),%a1
return true;
}
5d686: 241f movel %sp@+,%d2
5d688: 4e5e unlk %fp
|| !_Heap_Is_prev_used( next_block )
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
5d68a: 2280 movel %d0,%a1@
return true;
5d68c: 7001 moveq #1,%d0
}
5d68e: 4e75 rts
5d690: 241f movel %sp@+,%d2
5d692: 4e5e unlk %fp
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;
5d694: 4200 clrb %d0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
00049126 <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
49126: 4e56 ffc8 linkw %fp,#-56
4912a: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
4912e: 246e 0008 moveal %fp@(8),%a2
uintptr_t const page_size = heap->page_size;
49132: 242a 0010 movel %a2@(16),%d2
uintptr_t const min_block_size = heap->min_block_size;
49136: 262a 0014 movel %a2@(20),%d3
Heap_Block *const first_block = heap->first_block;
4913a: 266a 0020 moveal %a2@(32),%a3
Heap_Block *const last_block = heap->last_block;
4913e: 2a6a 0024 moveal %a2@(36),%a5
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
49142: 4a2e 0013 tstb %fp@(19)
49146: 671a beqs 49162 <_Heap_Walk+0x3c>
49148: 49fa ff86 lea %pc@(490d0 <_Heap_Walk_print>),%a4
if ( !_System_state_Is_up( _System_state_Get() ) ) {
4914c: 7003 moveq #3,%d0
4914e: b0b9 0006 35e2 cmpl 635e2 <_System_state_Current>,%d0
49154: 671a beqs 49170 <_Heap_Walk+0x4a> <== ALWAYS TAKEN
block = next_block;
} while ( block != first_block );
return true;
}
49156: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5
}
block = next_block;
} while ( block != first_block );
return true;
4915c: 7001 moveq #1,%d0
}
4915e: 4e5e unlk %fp
49160: 4e75 rts
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
49162: 49fa ff64 lea %pc@(490c8 <_Heap_Walk_print_nothing>),%a4
if ( !_System_state_Is_up( _System_state_Get() ) ) {
49166: 7003 moveq #3,%d0
49168: b0b9 0006 35e2 cmpl 635e2 <_System_state_Current>,%d0
4916e: 66e6 bnes 49156 <_Heap_Walk+0x30>
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)(
49170: 2f2a 000c movel %a2@(12),%sp@-
49174: 2f2a 0008 movel %a2@(8),%sp@-
49178: 2f0d movel %a5,%sp@-
4917a: 2f0b movel %a3,%sp@-
4917c: 2f2a 001c movel %a2@(28),%sp@-
49180: 2f2a 0018 movel %a2@(24),%sp@-
49184: 2f03 movel %d3,%sp@-
49186: 2f02 movel %d2,%sp@-
49188: 4879 0005 f616 pea 5f616 <_Copyright_Notice+0x94>
4918e: 42a7 clrl %sp@-
49190: 2f2e 000c movel %fp@(12),%sp@-
49194: 4e94 jsr %a4@
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
49196: 4fef 002c lea %sp@(44),%sp
4919a: 4a82 tstl %d2
4919c: 677e beqs 4921c <_Heap_Walk+0xf6>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
4919e: 7003 moveq #3,%d0
491a0: c082 andl %d2,%d0
(*printer)( source, true, "page size is zero\n" );
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
491a2: 6600 0090 bnew 49234 <_Heap_Walk+0x10e>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
491a6: 2203 movel %d3,%d1
491a8: 4c42 1000 remul %d2,%d0,%d1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
491ac: 4a80 tstl %d0
491ae: 6600 009e bnew 4924e <_Heap_Walk+0x128>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
491b2: 200b movel %a3,%d0
491b4: 5080 addql #8,%d0
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
491b6: 4c42 0001 remul %d2,%d1,%d0
);
return false;
}
if (
491ba: 4a81 tstl %d1
491bc: 6600 00aa bnew 49268 <_Heap_Walk+0x142>
block = next_block;
} while ( block != first_block );
return true;
}
491c0: 202b 0004 movel %a3@(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;
491c4: 7801 moveq #1,%d4
491c6: c880 andl %d0,%d4
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
491c8: 6700 00ba beqw 49284 <_Heap_Walk+0x15e>
- 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;
491cc: 72fe moveq #-2,%d1
491ce: c2ad 0004 andl %a5@(4),%d1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
491d2: 41f5 1800 lea %a5@(00000000,%d1:l),%a0
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;
491d6: 7201 moveq #1,%d1
491d8: c2a8 0004 andl %a0@(4),%d1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
491dc: 6726 beqs 49204 <_Heap_Walk+0xde>
);
return false;
}
if (
491de: b1cb cmpal %a3,%a0
491e0: 6700 00bc beqw 4929e <_Heap_Walk+0x178>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
491e4: 4879 0005 f770 pea 5f770 <_Copyright_Notice+0x1ee>
491ea: 4878 0001 pea 1 <ADD>
491ee: 2f2e 000c movel %fp@(12),%sp@-
491f2: 4e94 jsr %a4@
491f4: 4fef 000c lea %sp@(12),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
491f8: 4200 clrb %d0
block = next_block;
} while ( block != first_block );
return true;
}
491fa: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5
49200: 4e5e unlk %fp
49202: 4e75 rts
return false;
}
if ( _Heap_Is_free( last_block ) ) {
(*printer)(
49204: 4879 0005 f75b pea 5f75b <_Copyright_Notice+0x1d9>
4920a: 4878 0001 pea 1 <ADD>
4920e: 2f2e 000c movel %fp@(12),%sp@-
49212: 4e94 jsr %a4@
49214: 4fef 000c lea %sp@(12),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49218: 4200 clrb %d0
4921a: 60de bras 491fa <_Heap_Walk+0xd4>
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
(*printer)( source, true, "page size is zero\n" );
4921c: 4879 0005 f6a7 pea 5f6a7 <_Copyright_Notice+0x125>
49222: 4878 0001 pea 1 <ADD>
49226: 2f2e 000c movel %fp@(12),%sp@-
4922a: 4e94 jsr %a4@
4922c: 4fef 000c lea %sp@(12),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49230: 4200 clrb %d0
49232: 60c6 bras 491fa <_Heap_Walk+0xd4>
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
(*printer)(
49234: 2f02 movel %d2,%sp@-
49236: 4879 0005 f6ba pea 5f6ba <_Copyright_Notice+0x138>
4923c: 4878 0001 pea 1 <ADD>
49240: 2f2e 000c movel %fp@(12),%sp@-
49244: 4e94 jsr %a4@
49246: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4924a: 4200 clrb %d0
4924c: 60ac bras 491fa <_Heap_Walk+0xd4>
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
(*printer)(
4924e: 2f03 movel %d3,%sp@-
49250: 4879 0005 f6d8 pea 5f6d8 <_Copyright_Notice+0x156>
49256: 4878 0001 pea 1 <ADD>
4925a: 2f2e 000c movel %fp@(12),%sp@-
4925e: 4e94 jsr %a4@
49260: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49264: 4200 clrb %d0
49266: 6092 bras 491fa <_Heap_Walk+0xd4>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
49268: 2f0b movel %a3,%sp@-
4926a: 4879 0005 f6fc pea 5f6fc <_Copyright_Notice+0x17a>
49270: 4878 0001 pea 1 <ADD>
49274: 2f2e 000c movel %fp@(12),%sp@-
49278: 4e94 jsr %a4@
4927a: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4927e: 4200 clrb %d0
49280: 6000 ff78 braw 491fa <_Heap_Walk+0xd4>
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
(*printer)(
49284: 4879 0005 f72d pea 5f72d <_Copyright_Notice+0x1ab>
4928a: 4878 0001 pea 1 <ADD>
4928e: 2f2e 000c movel %fp@(12),%sp@-
49292: 4e94 jsr %a4@
49294: 4fef 000c lea %sp@(12),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49298: 4200 clrb %d0
4929a: 6000 ff5e braw 491fa <_Heap_Walk+0xd4>
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
4929e: 222a 0010 movel %a2@(16),%d1
492a2: 2d41 fffc movel %d1,%fp@(-4)
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
492a6: 206a 0008 moveal %a2@(8),%a0
block = next_block;
} while ( block != first_block );
return true;
}
492aa: 222a 0020 movel %a2@(32),%d1
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 ) {
492ae: b1ca cmpal %a2,%a0
492b0: 6700 00c6 beqw 49378 <_Heap_Walk+0x252>
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;
492b4: b1c1 cmpal %d1,%a0
492b6: 6500 009c bcsw 49354 <_Heap_Walk+0x22e>
492ba: 2a2a 0024 movel %a2@(36),%d5
492be: 2d45 fff0 movel %d5,%fp@(-16)
492c2: b1c5 cmpal %d5,%a0
492c4: 6200 008e bhiw 49354 <_Heap_Walk+0x22e>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
492c8: 43e8 0008 lea %a0@(8),%a1
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
492cc: 2c09 movel %a1,%d6
492ce: 2e2e fffc movel %fp@(-4),%d7
492d2: 4c47 6005 remul %d7,%d5,%d6
);
return false;
}
if (
492d6: 4a85 tstl %d5
492d8: 6600 02b8 bnew 49592 <_Heap_Walk+0x46c>
- 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;
492dc: 7afe moveq #-2,%d5
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;
492de: 7c01 moveq #1,%d6
- 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;
492e0: caa8 0004 andl %a0@(4),%d5
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;
492e4: ccb0 5804 andl %a0@(00000004,%d5:l),%d6
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
492e8: 664e bnes 49338 <_Heap_Walk+0x212> <== NEVER TAKEN
492ea: 2e2e fff0 movel %fp@(-16),%d7
492ee: 224a moveal %a2,%a1
492f0: 2c08 movel %a0,%d6
492f2: 2d42 fff8 movel %d2,%fp@(-8)
492f6: 2d40 fff4 movel %d0,%fp@(-12)
);
return false;
}
if ( free_block->prev != prev_block ) {
492fa: 2a28 000c movel %a0@(12),%d5
492fe: b3c5 cmpal %d5,%a1
49300: 6600 02ac bnew 495ae <_Heap_Walk+0x488>
return false;
}
prev_block = free_block;
free_block = free_block->next;
49304: 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 ) {
49308: b1ca cmpal %a2,%a0
4930a: 6764 beqs 49370 <_Heap_Walk+0x24a>
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;
4930c: b288 cmpl %a0,%d1
4930e: 6244 bhis 49354 <_Heap_Walk+0x22e>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
49310: 2408 movel %a0,%d2
49312: 5082 addql #8,%d2
49314: 2246 moveal %d6,%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;
49316: be88 cmpl %a0,%d7
49318: 653a bcss 49354 <_Heap_Walk+0x22e> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
4931a: 202e fffc movel %fp@(-4),%d0
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
4931e: 2c08 movel %a0,%d6
49320: 4c40 2005 remul %d0,%d5,%d2
);
return false;
}
if (
49324: 4a85 tstl %d5
49326: 6600 026a bnew 49592 <_Heap_Walk+0x46c>
- 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;
4932a: 74fe moveq #-2,%d2
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;
4932c: 7001 moveq #1,%d0
- 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;
4932e: c4a8 0004 andl %a0@(4),%d2
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;
49332: c0b0 2804 andl %a0@(00000004,%d2:l),%d0
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
49336: 67c2 beqs 492fa <_Heap_Walk+0x1d4>
(*printer)(
49338: 2f08 movel %a0,%sp@-
4933a: 4879 0005 f7ef pea 5f7ef <_Copyright_Notice+0x26d>
49340: 4878 0001 pea 1 <ADD>
49344: 2f2e 000c movel %fp@(12),%sp@-
49348: 4e94 jsr %a4@
4934a: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4934e: 4200 clrb %d0
49350: 6000 fea8 braw 491fa <_Heap_Walk+0xd4>
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 ) ) {
(*printer)(
49354: 2f08 movel %a0,%sp@-
49356: 4879 0005 f79f pea 5f79f <_Copyright_Notice+0x21d>
4935c: 4878 0001 pea 1 <ADD>
49360: 2f2e 000c movel %fp@(12),%sp@-
49364: 4e94 jsr %a4@
49366: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4936a: 4200 clrb %d0
4936c: 6000 fe8c braw 491fa <_Heap_Walk+0xd4>
49370: 242e fff8 movel %fp@(-8),%d2
49374: 202e fff4 movel %fp@(-12),%d0
49378: 2d42 fffc movel %d2,%fp@(-4)
4937c: 2e00 movel %d0,%d7
- 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;
4937e: 74fe moveq #-2,%d2
49380: 204d moveal %a5,%a0
49382: 2a4b moveal %a3,%a5
49384: 2a0b movel %a3,%d5
49386: 264a moveal %a2,%a3
49388: ce82 andl %d2,%d7
4938a: 2d48 fff8 movel %a0,%fp@(-8)
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
4938e: 45f5 7800 lea %a5@(00000000,%d7: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;
49392: b5c1 cmpal %d1,%a2
49394: 6568 bcss 493fe <_Heap_Walk+0x2d8> <== NEVER TAKEN
49396: b5eb 0024 cmpal %a3@(36),%a2
4939a: 6262 bhis 493fe <_Heap_Walk+0x2d8>
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;
4939c: bbee fff8 cmpal %fp@(-8),%a5
493a0: 56c0 sne %d0
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
493a2: 2c2e fffc movel %fp@(-4),%d6
493a6: 2407 movel %d7,%d2
493a8: 4480 negl %d0
493aa: 4c46 2001 remul %d6,%d1,%d2
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
493ae: 4a81 tstl %d1
493b0: 6700 0084 beqw 49436 <_Heap_Walk+0x310>
493b4: 4a00 tstb %d0
493b6: 6664 bnes 4941c <_Heap_Walk+0x2f6> <== 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;
493b8: 7001 moveq #1,%d0
493ba: c0aa 0004 andl %a2@(4),%d0
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
493be: 6700 00e8 beqw 494a8 <_Heap_Walk+0x382>
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
493c2: 4a84 tstl %d4
493c4: 6700 00c6 beqw 4948c <_Heap_Walk+0x366>
(*printer)(
493c8: 2f07 movel %d7,%sp@-
493ca: 2f0d movel %a5,%sp@-
493cc: 4879 0005 f994 pea 5f994 <_Copyright_Notice+0x412>
493d2: 42a7 clrl %sp@-
493d4: 2f2e 000c movel %fp@(12),%sp@-
493d8: 4e94 jsr %a4@
493da: 4fef 0014 lea %sp@(20),%sp
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
493de: b5c5 cmpal %d5,%a2
493e0: 6700 fd74 beqw 49156 <_Heap_Walk+0x30>
493e4: 2e2a 0004 movel %a2@(4),%d7
493e8: 7801 moveq #1,%d4
- 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;
493ea: 74fe moveq #-2,%d2
493ec: 2a4a moveal %a2,%a5
493ee: c887 andl %d7,%d4
493f0: ce82 andl %d2,%d7
493f2: 222b 0020 movel %a3@(32),%d1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
493f6: 45f5 7800 lea %a5@(00000000,%d7: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;
493fa: b5c1 cmpal %d1,%a2
493fc: 6498 bccs 49396 <_Heap_Walk+0x270> <== ALWAYS TAKEN
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;
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
(*printer)(
493fe: 2f0a movel %a2,%sp@-
49400: 2f0d movel %a5,%sp@-
49402: 4879 0005 f83d pea 5f83d <_Copyright_Notice+0x2bb>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
49408: 4878 0001 pea 1 <ADD>
4940c: 2f2e 000c movel %fp@(12),%sp@-
49410: 4e94 jsr %a4@
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49412: 4fef 0014 lea %sp@(20),%sp
49416: 4200 clrb %d0
49418: 6000 fde0 braw 491fa <_Heap_Walk+0xd4>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
4941c: 2f07 movel %d7,%sp@-
4941e: 2f0d movel %a5,%sp@-
49420: 4879 0005 f86a pea 5f86a <_Copyright_Notice+0x2e8>
49426: 4878 0001 pea 1 <ADD>
4942a: 2f2e 000c movel %fp@(12),%sp@-
4942e: 4e94 jsr %a4@
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49430: 4fef 0014 lea %sp@(20),%sp
49434: 60e0 bras 49416 <_Heap_Walk+0x2f0>
}
if ( block_size < min_block_size && is_not_last_block ) {
49436: be83 cmpl %d3,%d7
49438: 642c bccs 49466 <_Heap_Walk+0x340>
4943a: 4a00 tstb %d0
4943c: 6700 ff7a beqw 493b8 <_Heap_Walk+0x292>
(*printer)(
49440: 2f03 movel %d3,%sp@-
49442: 2f07 movel %d7,%sp@-
49444: 2f0d movel %a5,%sp@-
49446: 4879 0005 f898 pea 5f898 <_Copyright_Notice+0x316>
4944c: 4878 0001 pea 1 <ADD>
49450: 2f2e 000c movel %fp@(12),%sp@-
49454: 4e94 jsr %a4@
block,
block_size,
min_block_size
);
return false;
49456: 4fef 0018 lea %sp@(24),%sp
block = next_block;
} while ( block != first_block );
return true;
}
4945a: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5
block,
block_size,
min_block_size
);
return false;
49460: 4200 clrb %d0
block = next_block;
} while ( block != first_block );
return true;
}
49462: 4e5e unlk %fp
49464: 4e75 rts
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
49466: b5cd cmpal %a5,%a2
49468: 6200 ff4e bhiw 493b8 <_Heap_Walk+0x292>
4946c: 4a00 tstb %d0
4946e: 6700 ff48 beqw 493b8 <_Heap_Walk+0x292>
(*printer)(
49472: 2f0a movel %a2,%sp@-
49474: 2f0d movel %a5,%sp@-
49476: 4879 0005 f8c3 pea 5f8c3 <_Copyright_Notice+0x341>
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
(*printer)(
4947c: 4878 0001 pea 1 <ADD>
49480: 2f2e 000c movel %fp@(12),%sp@-
49484: 4e94 jsr %a4@
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
49486: 4fef 0014 lea %sp@(20),%sp
4948a: 608a bras 49416 <_Heap_Walk+0x2f0>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
4948c: 2f15 movel %a5@,%sp@-
4948e: 2f07 movel %d7,%sp@-
49490: 2f0d movel %a5,%sp@-
49492: 4879 0005 f9ab pea 5f9ab <_Copyright_Notice+0x429>
49498: 42a7 clrl %sp@-
4949a: 2f2e 000c movel %fp@(12),%sp@-
4949e: 4e94 jsr %a4@
494a0: 4fef 0018 lea %sp@(24),%sp
494a4: 6000 ff38 braw 493de <_Heap_Walk+0x2b8>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
494a8: 206b 0008 moveal %a3@(8),%a0
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
494ac: 222d 0008 movel %a5@(8),%d1
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)(
494b0: b2ab 000c cmpl %a3@(12),%d1
494b4: 6700 00b6 beqw 4956c <_Heap_Walk+0x446>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
494b8: 43f9 0005 f4be lea 5f4be <rtems_termios_baud_table+0x10a>,%a1
494be: b28b cmpl %a3,%d1
494c0: 676e beqs 49530 <_Heap_Walk+0x40a>
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 ?
494c2: 202d 000c movel %a5@(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)(
494c6: b088 cmpl %a0,%d0
494c8: 6700 0098 beqw 49562 <_Heap_Walk+0x43c>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
494cc: 41f9 0005 f4be lea 5f4be <rtems_termios_baud_table+0x10a>,%a0
494d2: b08b cmpl %a3,%d0
494d4: 6762 beqs 49538 <_Heap_Walk+0x412>
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)(
494d6: 2f09 movel %a1,%sp@-
494d8: 2f01 movel %d1,%sp@-
494da: 2f08 movel %a0,%sp@-
494dc: 2f00 movel %d0,%sp@-
494de: 2f07 movel %d7,%sp@-
494e0: 2f0d movel %a5,%sp@-
494e2: 4879 0005 f8f7 pea 5f8f7 <_Copyright_Notice+0x375>
494e8: 42a7 clrl %sp@-
494ea: 2f2e 000c movel %fp@(12),%sp@-
494ee: 4e94 jsr %a4@
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
494f0: 2012 movel %a2@,%d0
494f2: 4fef 0024 lea %sp@(36),%sp
494f6: b087 cmpl %d7,%d0
494f8: 6646 bnes 49540 <_Heap_Walk+0x41a>
);
return false;
}
if ( !prev_used ) {
494fa: 4a84 tstl %d4
494fc: 6778 beqs 49576 <_Heap_Walk+0x450>
494fe: 206b 0008 moveal %a3@(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 ) {
49502: b1cb cmpal %a3,%a0
49504: 670e beqs 49514 <_Heap_Walk+0x3ee> <== NEVER TAKEN
if ( free_block == block ) {
49506: b1cd cmpal %a5,%a0
49508: 6700 fed4 beqw 493de <_Heap_Walk+0x2b8>
return true;
}
free_block = free_block->next;
4950c: 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 ) {
49510: b1cb cmpal %a3,%a0
49512: 66f2 bnes 49506 <_Heap_Walk+0x3e0>
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
49514: 2f0d movel %a5,%sp@-
49516: 4879 0005 f9d0 pea 5f9d0 <_Copyright_Notice+0x44e>
4951c: 4878 0001 pea 1 <ADD>
49520: 2f2e 000c movel %fp@(12),%sp@-
49524: 4e94 jsr %a4@
49526: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4952a: 4200 clrb %d0
4952c: 6000 fccc braw 491fa <_Heap_Walk+0xd4>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
49530: 43f9 0005 f5f2 lea 5f5f2 <_Copyright_Notice+0x70>,%a1
49536: 608a bras 494c2 <_Heap_Walk+0x39c>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
49538: 41f9 0005 f60c lea 5f60c <_Copyright_Notice+0x8a>,%a0
4953e: 6096 bras 494d6 <_Heap_Walk+0x3b0>
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
(*printer)(
49540: 2f0a movel %a2,%sp@-
49542: 2f00 movel %d0,%sp@-
49544: 2f07 movel %d7,%sp@-
49546: 2f0d movel %a5,%sp@-
49548: 4879 0005 f92c pea 5f92c <_Copyright_Notice+0x3aa>
4954e: 4878 0001 pea 1 <ADD>
49552: 2f2e 000c movel %fp@(12),%sp@-
49556: 4e94 jsr %a4@
49558: 4fef 001c lea %sp@(28),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4955c: 4200 clrb %d0
4955e: 6000 fc9a braw 491fa <_Heap_Walk+0xd4>
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)(
49562: 41f9 0005 f5fc lea 5f5fc <_Copyright_Notice+0x7a>,%a0
49568: 6000 ff6c braw 494d6 <_Heap_Walk+0x3b0>
4956c: 43f9 0005 f5e3 lea 5f5e3 <_Copyright_Notice+0x61>,%a1
49572: 6000 ff4e braw 494c2 <_Heap_Walk+0x39c>
return false;
}
if ( !prev_used ) {
(*printer)(
49576: 2f0d movel %a5,%sp@-
49578: 4879 0005 f965 pea 5f965 <_Copyright_Notice+0x3e3>
4957e: 4878 0001 pea 1 <ADD>
49582: 2f2e 000c movel %fp@(12),%sp@-
49586: 4e94 jsr %a4@
49588: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
4958c: 4200 clrb %d0
4958e: 6000 fc6a braw 491fa <_Heap_Walk+0xd4>
}
if (
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
49592: 2f08 movel %a0,%sp@-
49594: 4879 0005 f7bf pea 5f7bf <_Copyright_Notice+0x23d>
4959a: 4878 0001 pea 1 <ADD>
4959e: 2f2e 000c movel %fp@(12),%sp@-
495a2: 4e94 jsr %a4@
495a4: 4fef 0010 lea %sp@(16),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
495a8: 4200 clrb %d0
495aa: 6000 fc4e braw 491fa <_Heap_Walk+0xd4>
return false;
}
if ( free_block->prev != prev_block ) {
(*printer)(
495ae: 2f05 movel %d5,%sp@-
495b0: 2f08 movel %a0,%sp@-
495b2: 4879 0005 f80b pea 5f80b <_Copyright_Notice+0x289>
495b8: 4878 0001 pea 1 <ADD>
495bc: 2f2e 000c movel %fp@(12),%sp@-
495c0: 4e94 jsr %a4@
495c2: 4fef 0014 lea %sp@(20),%sp
"block 0x%08x: block size %u not page aligned\n",
block,
block_size
);
return false;
495c6: 4200 clrb %d0
495c8: 6000 fc30 braw 491fa <_Heap_Walk+0xd4>
00047d04 <_IO_Initialize_all_drivers>:
void _IO_Initialize_all_drivers( void )
{
47d04: 4e56 0000 linkw %fp,#0
47d08: 2f0a movel %a2,%sp@-
47d0a: 2f02 movel %d2,%sp@-
rtems_device_major_number major;
for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
47d0c: 4ab9 0006 184a tstl 6184a <_IO_Number_of_drivers>
47d12: 671e beqs 47d32 <_IO_Initialize_all_drivers+0x2e><== NEVER TAKEN
47d14: 4282 clrl %d2
47d16: 45f9 0004 ce68 lea 4ce68 <rtems_io_initialize>,%a2
(void) rtems_io_initialize( major, 0, NULL );
47d1c: 42a7 clrl %sp@-
47d1e: 42a7 clrl %sp@-
47d20: 2f02 movel %d2,%sp@-
void _IO_Initialize_all_drivers( void )
{
rtems_device_major_number major;
for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
47d22: 5282 addql #1,%d2
(void) rtems_io_initialize( major, 0, NULL );
47d24: 4e92 jsr %a2@
void _IO_Initialize_all_drivers( void )
{
rtems_device_major_number major;
for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
47d26: 4fef 000c lea %sp@(12),%sp
47d2a: b4b9 0006 184a cmpl 6184a <_IO_Number_of_drivers>,%d2
47d30: 65ea bcss 47d1c <_IO_Initialize_all_drivers+0x18>
(void) rtems_io_initialize( major, 0, NULL );
}
47d32: 242e fff8 movel %fp@(-8),%d2
47d36: 246e fffc moveal %fp@(-4),%a2
47d3a: 4e5e unlk %fp
...
00047c64 <_IO_Manager_initialization>:
#include <rtems/score/wkspace.h>
#include <string.h>
void _IO_Manager_initialization(void)
{
47c64: 4e56 fff0 linkw %fp,#-16
47c68: 48d7 003c moveml %d2-%d5,%sp@
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = rtems_configuration_get_device_driver_table();
47c6c: 2439 0005 d990 movel 5d990 <Configuration+0x3c>,%d2
drivers_in_table = rtems_configuration_get_number_of_device_drivers();
47c72: 2839 0005 d98c movel 5d98c <Configuration+0x38>,%d4
number_of_drivers = rtems_configuration_get_maximum_drivers();
47c78: 2639 0005 d988 movel 5d988 <Configuration+0x34>,%d3
/*
* If the user claims there are less drivers than are actually in
* the table, then let's just go with the table's count.
*/
if ( number_of_drivers <= drivers_in_table )
47c7e: b684 cmpl %d4,%d3
47c80: 636c blss 47cee <_IO_Manager_initialization+0x8a>
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
_Workspace_Allocate_or_fatal_error(
47c82: 2003 movel %d3,%d0
47c84: 2a03 movel %d3,%d5
47c86: e788 lsll #3,%d0
47c88: eb8d lsll #5,%d5
47c8a: 9a80 subl %d0,%d5
47c8c: 2f05 movel %d5,%sp@-
47c8e: 4eb9 0004 acf6 jsr 4acf6 <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
47c94: 2f05 movel %d5,%sp@-
47c96: 42a7 clrl %sp@-
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
47c98: 23c0 0006 184e movel %d0,6184e <_IO_Driver_address_table>
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
47c9e: 2f00 movel %d0,%sp@-
_IO_Driver_address_table = (rtems_driver_address_table *)
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
47ca0: 23c3 0006 184a movel %d3,6184a <_IO_Number_of_drivers>
memset(
47ca6: 4eb9 0004 f8b4 jsr 4f8b4 <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
47cac: 4fef 0010 lea %sp@(16),%sp
47cb0: 4a84 tstl %d4
47cb2: 6730 beqs 47ce4 <_IO_Manager_initialization+0x80><== NEVER TAKEN
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _IO_Manager_initialization(void)
47cb4: 2a04 movel %d4,%d5
47cb6: 2204 movel %d4,%d1
47cb8: 4280 clrl %d0
47cba: e78d lsll #3,%d5
47cbc: eb89 lsll #5,%d1
47cbe: 2639 0006 184e movel 6184e <_IO_Driver_address_table>,%d3
47cc4: 9285 subl %d5,%d1
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
_IO_Driver_address_table[index] = driver_table[index];
47cc6: 2242 moveal %d2,%a1
47cc8: 2043 moveal %d3,%a0
47cca: d3c0 addal %d0,%a1
47ccc: d1c0 addal %d0,%a0
47cce: 0680 0000 0018 addil #24,%d0
47cd4: 20d9 movel %a1@+,%a0@+
47cd6: 20d9 movel %a1@+,%a0@+
47cd8: 20d9 movel %a1@+,%a0@+
47cda: 20d9 movel %a1@+,%a0@+
47cdc: 20d9 movel %a1@+,%a0@+
47cde: 2091 movel %a1@,%a0@
memset(
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
47ce0: b280 cmpl %d0,%d1
47ce2: 66e2 bnes 47cc6 <_IO_Manager_initialization+0x62>
_IO_Driver_address_table[index] = driver_table[index];
}
47ce4: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5
47cea: 4e5e unlk %fp
47cec: 4e75 rts
* If the maximum number of driver is the same as the number in the
* table, then we do not have to copy the driver table. They can't
* register any dynamically.
*/
if ( number_of_drivers == drivers_in_table ) {
_IO_Driver_address_table = driver_table;
47cee: 23c2 0006 184e movel %d2,6184e <_IO_Driver_address_table>
_IO_Number_of_drivers = number_of_drivers;
47cf4: 23c4 0006 184a movel %d4,6184a <_IO_Number_of_drivers>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
_IO_Driver_address_table[index] = driver_table[index];
}
47cfa: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5
47d00: 4e5e unlk %fp <== NOT EXECUTED
00048974 <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
48974: 4e56 ffe8 linkw %fp,#-24
48978: 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 );
4897c: 4879 0004 a854 pea 4a854 <_User_extensions_Fatal_visitor>
48982: 262e 0010 movel %fp@(16),%d3
48986: 486e fff6 pea %fp@(-10)
4898a: 282e 0008 movel %fp@(8),%d4
4898e: 242e 000c movel %fp@(12),%d2
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
48992: 2d44 fff6 movel %d4,%fp@(-10)
48996: 1d42 fffa moveb %d2,%fp@(-6)
4899a: 2d43 fffc movel %d3,%fp@(-4)
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
4899e: 4eb9 0004 a884 jsr 4a884 <_User_extensions_Iterate>
_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;
489a4: 13c2 0006 1414 moveb %d2,61414 <_Internal_errors_What_happened+0x4><== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
489aa: 2043 moveal %d3,%a0 <== NOT EXECUTED
489ac: 243c 0000 0700 movel #1792,%d2 <== NOT EXECUTED
Internal_errors_t the_error
)
{
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
489b2: 23c4 0006 1410 movel %d4,61410 <_Internal_errors_What_happened><== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
_Internal_errors_What_happened.the_error = the_error;
489b8: 23c3 0006 1416 movel %d3,61416 <_Internal_errors_What_happened+0x6><== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
489be: 40c0 movew %sr,%d0 <== NOT EXECUTED
489c0: 8082 orl %d2,%d0 <== NOT EXECUTED
489c2: 46c0 movew %d0,%sr <== NOT EXECUTED
489c4: 2008 movel %a0,%d0 <== NOT EXECUTED
489c6: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED
489cc: 4ac8 halt <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _System_state_Set (
System_state_Codes state
)
{
_System_state_Current = state;
489ce: 7005 moveq #5,%d0 <== NOT EXECUTED
489d0: 508f addql #8,%sp <== NOT EXECUTED
489d2: 23c0 0006 141a movel %d0,6141a <_System_state_Current> <== NOT EXECUTED
489d8: 60fe bras 489d8 <_Internal_error_Occurred+0x64> <== NOT EXECUTED
...
00048a3c <_Objects_Allocate>:
#endif
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
48a3c: 4e56 fff0 linkw %fp,#-16
48a40: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
48a44: 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 )
48a48: 4aaa 0014 tstl %a2@(20)
48a4c: 6770 beqs 48abe <_Objects_Allocate+0x82> <== NEVER TAKEN
/*
* 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 );
48a4e: 240a movel %a2,%d2
48a50: 0682 0000 001c addil #28,%d2
48a56: 47f9 0004 7fcc lea 47fcc <_Chain_Get>,%a3
48a5c: 2f02 movel %d2,%sp@-
48a5e: 4e93 jsr %a3@
if ( information->auto_extend ) {
48a60: 588f addql #4,%sp
48a62: 4a2a 0010 tstb %a2@(16)
48a66: 673a beqs 48aa2 <_Objects_Allocate+0x66>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
48a68: 4a80 tstl %d0
48a6a: 6740 beqs 48aac <_Objects_Allocate+0x70>
}
if ( the_object ) {
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
48a6c: 2040 moveal %d0,%a0
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
48a6e: 4282 clrl %d2
}
if ( the_object ) {
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
48a70: 2228 0008 movel %a0@(8),%d1
48a74: 262a 0006 movel %a2@(6),%d3
48a78: 0281 0000 ffff andil #65535,%d1
48a7e: 0283 0000 ffff andil #65535,%d3
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
48a84: 342a 0012 movew %a2@(18),%d2
information->inactive_per_block[ block ]--;
48a88: 206a 002a moveal %a2@(42),%a0
}
if ( the_object ) {
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
48a8c: 9283 subl %d3,%d1
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
48a8e: 4c42 1001 remul %d2,%d1,%d1
information->inactive_per_block[ block ]--;
information->inactive--;
48a92: 326a 0028 moveaw %a2@(40),%a1
block = (uint32_t) _Objects_Get_index( the_object->id ) -
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
48a96: e589 lsll #2,%d1
information->inactive--;
48a98: 5389 subql #1,%a1
block = (uint32_t) _Objects_Get_index( the_object->id ) -
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
information->inactive_per_block[ block ]--;
48a9a: d1c1 addal %d1,%a0
48a9c: 5390 subql #1,%a0@
information->inactive--;
48a9e: 3549 0028 movew %a1,%a2@(40)
);
}
#endif
return the_object;
}
48aa2: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
48aa8: 4e5e unlk %fp
48aaa: 4e75 rts
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
_Objects_Extend_information( information );
48aac: 2f0a movel %a2,%sp@-
48aae: 4eb9 0004 8af8 jsr 48af8 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
48ab4: 2f02 movel %d2,%sp@-
48ab6: 4e93 jsr %a3@
}
if ( the_object ) {
48ab8: 508f addql #8,%sp
48aba: 4a80 tstl %d0
48abc: 66ae bnes 48a6c <_Objects_Allocate+0x30>
* 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 )
return NULL;
48abe: 4280 clrl %d0
);
}
#endif
return the_object;
}
48ac0: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
48ac6: 4e5e unlk %fp
...
00048acc <_Objects_Close>:
void _Objects_Close(
Objects_Information *information,
Objects_Control *the_object
)
{
48acc: 4e56 0000 linkw %fp,#0
48ad0: 226e 000c moveal %fp@(12),%a1
48ad4: 206e 0008 moveal %fp@(8),%a0
RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
Objects_Information *information,
Objects_Control *the_object
)
{
_Objects_Set_local_object(
48ad8: 2029 0008 movel %a1@(8),%d0
48adc: 2f0a movel %a2,%sp@-
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
48ade: 2468 0018 moveal %a0@(24),%a2
RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
Objects_Information *information,
Objects_Control *the_object
)
{
_Objects_Set_local_object(
48ae2: 0280 0000 ffff andil #65535,%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
48ae8: 42b2 0c00 clrl %a2@(00000000,%d0:l:4)
_Objects_Invalidate_Id( information, the_object );
_Objects_Namespace_remove( information, the_object );
}
48aec: 245f moveal %sp@+,%a2
48aee: 4e5e unlk %fp
Objects_Control *the_object
)
{
_Objects_Invalidate_Id( information, the_object );
_Objects_Namespace_remove( information, the_object );
48af0: 4ef9 0004 9080 jmp 49080 <_Objects_Namespace_remove>
...
00048af8 <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
48af8: 4e56 ffc8 linkw %fp,#-56
48afc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
48b00: 246e 0008 moveal %fp@(8),%a2
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
48b04: 2a2a 0006 movel %a2@(6),%d5
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
48b08: 206a 002e moveal %a2@(46),%a0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
48b0c: 0285 0000 ffff andil #65535,%d5
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
48b12: 4a88 tstl %a0
48b14: 6700 020c beqw 48d22 <_Objects_Extend_information+0x22a>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
48b18: 3e2a 000e movew %a2@(14),%d7
48b1c: 302a 0012 movew %a2@(18),%d0
48b20: 3807 movew %d7,%d4
48b22: 0284 0000 ffff andil #65535,%d4
48b28: 88c0 divuw %d0,%d4
48b2a: 0284 0000 ffff andil #65535,%d4
for ( ; block < block_count; block++ ) {
48b30: 6700 0260 beqw 48d92 <_Objects_Extend_information+0x29a>
if ( information->object_blocks[ block ] == NULL ) {
48b34: 4a90 tstl %a0@
48b36: 6700 026c beqw 48da4 <_Objects_Extend_information+0x2ac>
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
48b3a: 5888 addql #4,%a0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
48b3c: 2605 movel %d5,%d3
index_base = minimum_index;
block = 0;
48b3e: 4282 clrl %d2
48b40: 0280 0000 ffff andil #65535,%d0
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
48b46: d680 addl %d0,%d3
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
48b48: 5282 addql #1,%d2
48b4a: b484 cmpl %d4,%d2
48b4c: 6400 01ac bccw 48cfa <_Objects_Extend_information+0x202>
if ( information->object_blocks[ block ] == NULL ) {
48b50: 4a98 tstl %a0@+
48b52: 66f2 bnes 48b46 <_Objects_Extend_information+0x4e>
do_extend = false;
48b54: 97cb subal %a3,%a3
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
48b56: 0287 0000 ffff andil #65535,%d7
48b5c: de80 addl %d0,%d7
/*
* We need to limit the number of objects to the maximum number
* representable in the index portion of the object Id. In the
* case of 16-bit Ids, this is only 256 object instances.
*/
if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
48b5e: 0c87 0000 ffff cmpil #65535,%d7
48b64: 6200 018a bhiw 48cf0 <_Objects_Extend_information+0x1f8>
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
48b68: 41ea 0014 lea %a2@(20),%a0
48b6c: 4c10 0800 mulsl %a0@,%d0
if ( information->auto_extend ) {
48b70: 4a2a 0010 tstb %a2@(16)
48b74: 6700 018c beqw 48d02 <_Objects_Extend_information+0x20a>
new_object_block = _Workspace_Allocate( block_size );
48b78: 2f00 movel %d0,%sp@-
48b7a: 4eb9 0004 acc0 jsr 4acc0 <_Workspace_Allocate>
if ( !new_object_block )
48b80: 588f addql #4,%sp
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
new_object_block = _Workspace_Allocate( block_size );
48b82: 2c00 movel %d0,%d6
if ( !new_object_block )
48b84: 6700 016a beqw 48cf0 <_Objects_Extend_information+0x1f8>
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
48b88: 300b movew %a3,%d0
48b8a: 4a00 tstb %d0
48b8c: 6700 00c4 beqw 48c52 <_Objects_Extend_information+0x15a>
*/
/*
* Up the block count and maximum
*/
block_count++;
48b90: 2844 moveal %d4,%a4
48b92: 528c addql #1,%a4
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
48b94: 2007 movel %d7,%d0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
48b96: 41f4 ca00 lea %a4@(00000000,%a4:l:2),%a0
((maximum + minimum_index) * sizeof(Objects_Control *));
48b9a: d088 addl %a0,%d0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
48b9c: d085 addl %d5,%d0
block_count++;
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
48b9e: e588 lsll #2,%d0
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
48ba0: 4a2a 0010 tstb %a2@(16)
48ba4: 6700 016c beqw 48d12 <_Objects_Extend_information+0x21a>
object_blocks = _Workspace_Allocate( block_size );
48ba8: 2f00 movel %d0,%sp@-
48baa: 4eb9 0004 acc0 jsr 4acc0 <_Workspace_Allocate>
if ( !object_blocks ) {
48bb0: 588f addql #4,%sp
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
object_blocks = _Workspace_Allocate( block_size );
48bb2: 2640 moveal %d0,%a3
if ( !object_blocks ) {
48bb4: 4a80 tstl %d0
48bb6: 6700 01c6 beqw 48d7e <_Objects_Extend_information+0x286>
}
/*
* Break the block into the various sections.
*/
inactive_per_block = (uint32_t *) _Addresses_Add_offset(
48bba: 220c movel %a4,%d1
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
48bbc: 4280 clrl %d0
}
/*
* Break the block into the various sections.
*/
inactive_per_block = (uint32_t *) _Addresses_Add_offset(
48bbe: e589 lsll #2,%d1
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
48bc0: 302a 000e movew %a2@(14),%d0
48bc4: 43f3 1800 lea %a3@(00000000,%d1:l),%a1
48bc8: 49f1 1800 lea %a1@(00000000,%d1:l),%a4
48bcc: b085 cmpl %d5,%d0
48bce: 6200 016a bhiw 48d3a <_Objects_Extend_information+0x242>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
48bd2: 4a85 tstl %d5
48bd4: 670c beqs 48be2 <_Objects_Extend_information+0xea><== NEVER TAKEN
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
48bd6: 204c moveal %a4,%a0
48bd8: 4bf4 5c00 lea %a4@(00000000,%d5:l:4),%a5
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
local_table[ index ] = NULL;
48bdc: 4298 clrl %a0@+
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
48bde: bbc8 cmpal %a0,%a5
48be0: 66fa bnes 48bdc <_Objects_Extend_information+0xe4><== NEVER TAKEN
48be2: e58c lsll #2,%d4
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
48be4: 4280 clrl %d0
48be6: 2203 movel %d3,%d1
48be8: 302a 0012 movew %a2@(18),%d0
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
48bec: 42b3 4800 clrl %a3@(00000000,%d4:l)
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
48bf0: d280 addl %d0,%d1
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
48bf2: 42b1 4800 clrl %a1@(00000000,%d4:l)
for ( index=index_base ;
48bf6: b283 cmpl %d3,%d1
48bf8: 630e blss 48c08 <_Objects_Extend_information+0x110><== NEVER TAKEN
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
48bfa: 4281 clrl %d1
48bfc: 41f4 3c00 lea %a4@(00000000,%d3:l:4),%a0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
48c00: 4298 clrl %a0@+
48c02: 5281 addql #1,%d1
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
48c04: b081 cmpl %d1,%d0
48c06: 66f8 bnes 48c00 <_Objects_Extend_information+0x108>
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
}
_ISR_Disable( level );
48c08: 203c 0000 0700 movel #1792,%d0
48c0e: 40c4 movew %sr,%d4
48c10: 8084 orl %d4,%d0
48c12: 46c0 movew %d0,%sr
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
48c14: 2012 movel %a2@,%d0
48c16: 7a18 moveq #24,%d5
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
48c18: 4281 clrl %d1
48c1a: eba8 lsll %d5,%d0
48c1c: 322a 0004 movew %a2@(4),%d1
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
48c20: 1a3c 001b moveb #27,%d5
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
48c24: 08c0 0010 bset #16,%d0
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
48c28: eba9 lsll %d5,%d1
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
48c2a: 206a 002e moveal %a2@(46),%a0
48c2e: 8081 orl %d1,%d0
information->object_blocks = object_blocks;
48c30: 254b 002e movel %a3,%a2@(46)
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
48c34: 8087 orl %d7,%d0
information->inactive_per_block = inactive_per_block;
48c36: 2549 002a movel %a1,%a2@(42)
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
48c3a: 3547 000e movew %d7,%a2@(14)
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
48c3e: 254c 0018 movel %a4,%a2@(24)
48c42: 2540 000a movel %d0,%a2@(10)
information->the_class,
_Objects_Local_node,
information->maximum
);
_ISR_Enable( level );
48c46: 46c4 movew %d4,%sr
_Workspace_Free( old_tables );
48c48: 2f08 movel %a0,%sp@-
48c4a: 4eb9 0004 acdc jsr 4acdc <_Workspace_Free>
48c50: 588f addql #4,%sp
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
48c52: 206a 002e moveal %a2@(46),%a0
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
48c56: 4280 clrl %d0
48c58: 280e movel %fp,%d4
48c5a: 0684 ffff fff4 addil #-12,%d4
48c60: 47f9 0004 7fcc lea 47fcc <_Chain_Get>,%a3
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
48c66: 2a0a movel %a2,%d5
48c68: 0685 0000 001c addil #28,%d5
48c6e: 49f9 0004 7f94 lea 47f94 <_Chain_Append>,%a4
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
48c74: e58a lsll #2,%d2
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
48c76: 302a 0012 movew %a2@(18),%d0
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
48c7a: 2186 2800 movel %d6,%a0@(00000000,%d2:l)
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
48c7e: 2f2a 0014 movel %a2@(20),%sp@-
48c82: 206a 002e moveal %a2@(46),%a0
48c86: 2f00 movel %d0,%sp@-
48c88: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@-
48c8c: 2f04 movel %d4,%sp@-
48c8e: 4eb9 0004 8008 jsr 48008 <_Chain_Initialize>
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
48c94: 4fef 0010 lea %sp@(16),%sp
48c98: 2f04 movel %d4,%sp@-
48c9a: 4e93 jsr %a3@
48c9c: 588f addql #4,%sp
48c9e: 4a80 tstl %d0
48ca0: 6734 beqs 48cd6 <_Objects_Extend_information+0x1de><== NEVER TAKEN
48ca2: 2212 movel %a2@,%d1
48ca4: 7e18 moveq #24,%d7
the_object->id = _Objects_Build_id(
48ca6: 4286 clrl %d6
48ca8: 2040 moveal %d0,%a0
48caa: 3c2a 0004 movew %a2@(4),%d6
48cae: efa9 lsll %d7,%d1
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
48cb0: 1e3c 001b moveb #27,%d7
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
48cb4: 08c1 0010 bset #16,%d1
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
48cb8: efae lsll %d7,%d6
48cba: 8286 orl %d6,%d1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
48cbc: 8283 orl %d3,%d1
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
48cbe: 5283 addql #1,%d3
48cc0: 2141 0008 movel %d1,%a0@(8)
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
48cc4: 2f00 movel %d0,%sp@-
48cc6: 2f05 movel %d5,%sp@-
48cc8: 4e94 jsr %a4@
index++;
48cca: 508f addql #8,%sp
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
48ccc: 2f04 movel %d4,%sp@-
48cce: 4e93 jsr %a3@
48cd0: 588f addql #4,%sp
48cd2: 4a80 tstl %d0
48cd4: 66cc bnes 48ca2 <_Objects_Extend_information+0x1aa>
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
48cd6: 4281 clrl %d1
48cd8: 302a 0012 movew %a2@(18),%d0
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
48cdc: 326a 0028 moveaw %a2@(40),%a1
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
48ce0: 206a 002a moveal %a2@(42),%a0
48ce4: 3200 movew %d0,%d1
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
48ce6: d089 addl %a1,%d0
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
48ce8: 2181 2800 movel %d1,%a0@(00000000,%d2:l)
information->inactive =
48cec: 3540 0028 movew %d0,%a2@(40)
(Objects_Maximum)(information->inactive + information->allocation_size);
}
48cf0: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5
48cf6: 4e5e unlk %fp
48cf8: 4e75 rts
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
48cfa: 367c 0001 moveaw #1,%a3
48cfe: 6000 fe56 braw 48b56 <_Objects_Extend_information+0x5e>
if ( information->auto_extend ) {
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
48d02: 2f00 movel %d0,%sp@-
48d04: 4eb9 0004 acf6 jsr 4acf6 <_Workspace_Allocate_or_fatal_error>
48d0a: 588f addql #4,%sp
48d0c: 2c00 movel %d0,%d6
48d0e: 6000 fe78 braw 48b88 <_Objects_Extend_information+0x90>
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
return;
}
} else {
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
48d12: 2f00 movel %d0,%sp@-
48d14: 4eb9 0004 acf6 jsr 4acf6 <_Workspace_Allocate_or_fatal_error>
48d1a: 588f addql #4,%sp
48d1c: 2640 moveal %d0,%a3
48d1e: 6000 fe9a braw 48bba <_Objects_Extend_information+0xc2>
48d22: 4280 clrl %d0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
48d24: 2605 movel %d5,%d3
index_base = minimum_index;
block = 0;
48d26: 4282 clrl %d2
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
48d28: 4284 clrl %d4
48d2a: 3e2a 000e movew %a2@(14),%d7
48d2e: 302a 0012 movew %a2@(18),%d0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
48d32: 367c 0001 moveaw #1,%a3
48d36: 6000 fe1e braw 48b56 <_Objects_Extend_information+0x5e>
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
48d3a: 4bf9 0004 f844 lea 4f844 <memcpy>,%a5
48d40: e58c lsll #2,%d4
48d42: 2f04 movel %d4,%sp@-
48d44: 2f2a 002e movel %a2@(46),%sp@-
48d48: 2d49 fff0 movel %a1,%fp@(-16)
48d4c: 2f0b movel %a3,%sp@-
48d4e: 4e95 jsr %a5@
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
48d50: 226e fff0 moveal %fp@(-16),%a1
48d54: 2f04 movel %d4,%sp@-
48d56: 2f2a 002a movel %a2@(42),%sp@-
48d5a: 2f09 movel %a1,%sp@-
48d5c: 4e95 jsr %a5@
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
48d5e: 4280 clrl %d0
48d60: 302a 000e movew %a2@(14),%d0
48d64: da80 addl %d0,%d5
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
48d66: e58d lsll #2,%d5
48d68: 2f05 movel %d5,%sp@-
48d6a: 2f2a 0018 movel %a2@(24),%sp@-
48d6e: 2f0c movel %a4,%sp@-
48d70: 4e95 jsr %a5@
48d72: 226e fff0 moveal %fp@(-16),%a1
48d76: 4fef 0024 lea %sp@(36),%sp
48d7a: 6000 fe68 braw 48be4 <_Objects_Extend_information+0xec>
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
object_blocks = _Workspace_Allocate( block_size );
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
48d7e: 2f06 movel %d6,%sp@-
48d80: 4eb9 0004 acdc jsr 4acdc <_Workspace_Free>
48d86: 588f addql #4,%sp
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
}
48d88: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5
48d8e: 4e5e unlk %fp
48d90: 4e75 rts
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
48d92: 2605 movel %d5,%d3 <== NOT EXECUTED
index_base = minimum_index;
block = 0;
48d94: 4282 clrl %d2 <== NOT EXECUTED
48d96: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
48d9c: 367c 0001 moveaw #1,%a3 <== NOT EXECUTED
48da0: 6000 fdb4 braw 48b56 <_Objects_Extend_information+0x5e><== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
48da4: 2605 movel %d5,%d3 <== NOT EXECUTED
index_base = minimum_index;
block = 0;
48da6: 4282 clrl %d2 <== NOT EXECUTED
48da8: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
48dae: 97cb subal %a3,%a3 <== NOT EXECUTED
48db0: 6000 fda4 braw 48b56 <_Objects_Extend_information+0x5e><== NOT EXECUTED
00048e6c <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
48e6c: 4e56 0000 linkw %fp,#0
48e70: 2f03 movel %d3,%sp@-
48e72: 262e 0008 movel %fp@(8),%d3
48e76: 2f02 movel %d2,%sp@-
48e78: 342e 000e movew %fp@(14),%d2
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
48e7c: 6740 beqs 48ebe <_Objects_Get_information+0x52>
/*
* 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 );
48e7e: 2f03 movel %d3,%sp@-
48e80: 4eb9 0004 d310 jsr 4d310 <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
48e86: 588f addql #4,%sp
48e88: 4a80 tstl %d0
48e8a: 6732 beqs 48ebe <_Objects_Get_information+0x52>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
48e8c: 0282 0000 ffff andil #65535,%d2
48e92: b480 cmpl %d0,%d2
48e94: 6228 bhis 48ebe <_Objects_Get_information+0x52>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
48e96: 41f9 0006 0fa2 lea 60fa2 <_Objects_Information_table>,%a0
48e9c: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0
48ea0: 4a88 tstl %a0
48ea2: 671a beqs 48ebe <_Objects_Get_information+0x52> <== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
48ea4: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0
if ( !info )
48ea8: 6714 beqs 48ebe <_Objects_Get_information+0x52> <== 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 )
48eaa: 2040 moveal %d0,%a0
48eac: 4a68 000e tstw %a0@(14)
48eb0: 670c beqs 48ebe <_Objects_Get_information+0x52>
return NULL;
#endif
return info;
}
48eb2: 242e fff8 movel %fp@(-8),%d2
48eb6: 262e fffc movel %fp@(-4),%d3
48eba: 4e5e unlk %fp
48ebc: 4e75 rts
48ebe: 242e fff8 movel %fp@(-8),%d2
{
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
48ec2: 4280 clrl %d0
if ( info->maximum == 0 )
return NULL;
#endif
return info;
}
48ec4: 262e fffc movel %fp@(-4),%d3
48ec8: 4e5e unlk %fp <== NOT EXECUTED
000563a8 <_Objects_Get_name_as_string>:
char *_Objects_Get_name_as_string(
Objects_Id id,
size_t length,
char *name
)
{
563a8: 4e56 ffe0 linkw %fp,#-32
563ac: 48d7 043c moveml %d2-%d5/%a2,%sp@
563b0: 262e 000c movel %fp@(12),%d3
563b4: 282e 0010 movel %fp@(16),%d4
char lname[5];
Objects_Control *the_object;
Objects_Locations location;
Objects_Id tmpId;
if ( length == 0 )
563b8: 4a83 tstl %d3
563ba: 6700 00a8 beqw 56464 <_Objects_Get_name_as_string+0xbc>
return NULL;
if ( name == NULL )
563be: 4a84 tstl %d4
563c0: 6700 00a2 beqw 56464 <_Objects_Get_name_as_string+0xbc>
return NULL;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
563c4: 4aae 0008 tstl %fp@(8)
563c8: 6600 0092 bnew 5645c <_Objects_Get_name_as_string+0xb4>
563cc: 2079 0006 fa12 moveal 6fa12 <_Per_CPU_Information+0xe>,%a0
563d2: 2428 0008 movel %a0@(8),%d2
information = _Objects_Get_information_id( tmpId );
563d6: 2f02 movel %d2,%sp@-
563d8: 4eb9 0004 eb1c jsr 4eb1c <_Objects_Get_information_id>
if ( !information )
563de: 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 );
563e0: 2440 moveal %d0,%a2
if ( !information )
563e2: 4a80 tstl %d0
563e4: 677e beqs 56464 <_Objects_Get_name_as_string+0xbc>
return NULL;
the_object = _Objects_Get( information, tmpId, &location );
563e6: 486e fff6 pea %fp@(-10)
563ea: 2f02 movel %d2,%sp@-
563ec: 2f00 movel %d0,%sp@-
563ee: 4eb9 0004 ec10 jsr 4ec10 <_Objects_Get>
switch ( location ) {
563f4: 4fef 000c lea %sp@(12),%sp
563f8: 4aae fff6 tstl %fp@(-10)
563fc: 6666 bnes 56464 <_Objects_Get_name_as_string+0xbc>
return NULL;
case OBJECTS_LOCAL:
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
563fe: 4a2a 0032 tstb %a2@(50)
56402: 676e beqs 56472 <_Objects_Get_name_as_string+0xca>
s = the_object->name.name_p;
56404: 2040 moveal %d0,%a0
56406: 2268 000c moveal %a0@(12),%a1
lname[ 4 ] = '\0';
s = lname;
}
d = name;
if ( s ) {
5640a: 4a89 tstl %a1
5640c: 6700 0098 beqw 564a6 <_Objects_Get_name_as_string+0xfe>
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
56410: 5383 subql #1,%d3
56412: 6700 0092 beqw 564a6 <_Objects_Get_name_as_string+0xfe>
56416: 1211 moveb %a1@,%d1
56418: 6700 008c beqw 564a6 <_Objects_Get_name_as_string+0xfe>
* This method objects the name of an object and returns its name
* in the form of a C string. It attempts to be careful about
* overflowing the user's string and about returning unprintable characters.
*/
char *_Objects_Get_name_as_string(
5641c: d689 addl %a1,%d3
5641e: 5289 addql #1,%a1
56420: 2044 moveal %d4,%a0
}
d = name;
if ( s ) {
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
*d = (isprint((unsigned char)*s)) ? *s : '*';
56422: 4282 clrl %d2
56424: 1401 moveb %d1,%d2
56426: 2479 0006 d820 moveal 6d820 <__ctype_ptr__>,%a2
5642c: 1432 2801 moveb %a2@(00000001,%d2:l),%d2
56430: 49c2 extbl %d2
56432: 0282 0000 0097 andil #151,%d2
56438: 6602 bnes 5643c <_Objects_Get_name_as_string+0x94>
5643a: 722a moveq #42,%d1
5643c: 10c1 moveb %d1,%a0@+
s = lname;
}
d = name;
if ( s ) {
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
5643e: 2448 moveal %a0,%a2
56440: b689 cmpl %a1,%d3
56442: 6704 beqs 56448 <_Objects_Get_name_as_string+0xa0>
56444: 1219 moveb %a1@+,%d1
56446: 66da bnes 56422 <_Objects_Get_name_as_string+0x7a>
*d = (isprint((unsigned char)*s)) ? *s : '*';
}
}
*d = '\0';
56448: 4212 clrb %a2@
_Thread_Enable_dispatch();
5644a: 4eb9 0004 fa3c jsr 4fa3c <_Thread_Enable_dispatch>
return name;
}
return NULL; /* unreachable path */
}
56450: 2004 movel %d4,%d0
56452: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2
56458: 4e5e unlk %fp
5645a: 4e75 rts
return NULL;
if ( name == NULL )
return NULL;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
5645c: 242e 0008 movel %fp@(8),%d2
56460: 6000 ff74 braw 563d6 <_Objects_Get_name_as_string+0x2e>
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE:
/* not supported */
#endif
case OBJECTS_ERROR:
return NULL;
56464: 4284 clrl %d4
_Thread_Enable_dispatch();
return name;
}
return NULL; /* unreachable path */
}
56466: 2004 movel %d4,%d0
56468: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2
5646e: 4e5e unlk %fp
56470: 4e75 rts
if ( information->is_string ) {
s = the_object->name.name_p;
} else
#endif
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
56472: 2440 moveal %d0,%a2
lname[ 0 ] = (u32_name >> 24) & 0xff;
56474: 7218 moveq #24,%d1
lname[ 1 ] = (u32_name >> 16) & 0xff;
lname[ 2 ] = (u32_name >> 8) & 0xff;
lname[ 3 ] = (u32_name >> 0) & 0xff;
lname[ 4 ] = '\0';
s = lname;
56476: 43ee fffb lea %fp@(-5),%a1
if ( information->is_string ) {
s = the_object->name.name_p;
} else
#endif
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
5647a: 202a 000c movel %a2@(12),%d0
lname[ 0 ] = (u32_name >> 24) & 0xff;
5647e: 2a00 movel %d0,%d5
56480: e2ad lsrl %d1,%d5
lname[ 1 ] = (u32_name >> 16) & 0xff;
lname[ 2 ] = (u32_name >> 8) & 0xff;
56482: 2200 movel %d0,%d1
#endif
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
lname[ 0 ] = (u32_name >> 24) & 0xff;
lname[ 1 ] = (u32_name >> 16) & 0xff;
56484: 2400 movel %d0,%d2
lname[ 2 ] = (u32_name >> 8) & 0xff;
56486: e089 lsrl #8,%d1
lname[ 3 ] = (u32_name >> 0) & 0xff;
56488: 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;
5648c: 4242 clrw %d2
5648e: 4842 swap %d2
lname[ 2 ] = (u32_name >> 8) & 0xff;
lname[ 3 ] = (u32_name >> 0) & 0xff;
lname[ 4 ] = '\0';
56490: 4200 clrb %d0
} else
#endif
{
uint32_t u32_name = (uint32_t) the_object->name.name_u32;
lname[ 0 ] = (u32_name >> 24) & 0xff;
56492: 1d45 fffb moveb %d5,%fp@(-5)
lname[ 1 ] = (u32_name >> 16) & 0xff;
56496: 1d42 fffc moveb %d2,%fp@(-4)
lname[ 2 ] = (u32_name >> 8) & 0xff;
5649a: 1d41 fffd moveb %d1,%fp@(-3)
lname[ 3 ] = (u32_name >> 0) & 0xff;
lname[ 4 ] = '\0';
5649e: 1d40 ffff moveb %d0,%fp@(-1)
564a2: 6000 ff6c braw 56410 <_Objects_Get_name_as_string+0x68>
}
d = name;
if ( s ) {
for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
*d = (isprint((unsigned char)*s)) ? *s : '*';
564a6: 2444 moveal %d4,%a2
}
}
*d = '\0';
564a8: 4212 clrb %a2@
_Thread_Enable_dispatch();
564aa: 4eb9 0004 fa3c jsr 4fa3c <_Thread_Enable_dispatch>
564b0: 609e bras 56450 <_Objects_Get_name_as_string+0xa8>
...
0005a574 <_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;
5a574: 7001 moveq #1,%d0
if ( information->maximum >= index ) {
5a576: 4281 clrl %d1
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
5a578: 4e56 0000 linkw %fp,#0
5a57c: 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;
5a580: 90a8 0006 subl %a0@(6),%d0
5a584: d0ae 000c addl %fp@(12),%d0
if ( information->maximum >= index ) {
5a588: 3228 000e movew %a0@(14),%d1
5a58c: b280 cmpl %d0,%d1
5a58e: 6514 bcss 5a5a4 <_Objects_Get_no_protection+0x30>
if ( (the_object = information->local_table[ index ]) != NULL ) {
5a590: 2068 0018 moveal %a0@(24),%a0
5a594: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0
5a598: 670a beqs 5a5a4 <_Objects_Get_no_protection+0x30><== NEVER TAKEN
*location = OBJECTS_LOCAL;
5a59a: 206e 0010 moveal %fp@(16),%a0
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
return NULL;
}
5a59e: 4e5e unlk %fp
*/
index = id - information->minimum_id + 1;
if ( information->maximum >= index ) {
if ( (the_object = information->local_table[ index ]) != NULL ) {
*location = OBJECTS_LOCAL;
5a5a0: 4290 clrl %a0@
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
return NULL;
}
5a5a2: 4e75 rts
/*
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
5a5a4: 226e 0010 moveal %fp@(16),%a1
5a5a8: 7001 moveq #1,%d0
return NULL;
}
5a5aa: 4e5e unlk %fp
/*
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
5a5ac: 2280 movel %d0,%a1@
return NULL;
5a5ae: 4280 clrl %d0
}
...
0004ec78 <_Objects_Id_to_name>:
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
4ec78: 4e56 fffc linkw %fp,#-4
4ec7c: 202e 0008 movel %fp@(8),%d0
4ec80: 2f02 movel %d2,%sp@-
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
4ec82: 4a80 tstl %d0
4ec84: 664e bnes 4ecd4 <_Objects_Id_to_name+0x5c>
4ec86: 2079 0006 fa12 moveal 6fa12 <_Per_CPU_Information+0xe>,%a0
4ec8c: 2228 0008 movel %a0@(8),%d1
4ec90: 7418 moveq #24,%d2
4ec92: 2001 movel %d1,%d0
4ec94: e4a8 lsrl %d2,%d0
4ec96: 143c 0007 moveb #7,%d2
4ec9a: c082 andl %d2,%d0
*/
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
uint32_t the_api
)
{
if ( !the_api || the_api > OBJECTS_APIS_LAST )
4ec9c: 143c 0002 moveb #2,%d2
4eca0: 2040 moveal %d0,%a0
4eca2: 5388 subql #1,%a0
4eca4: b488 cmpl %a0,%d2
4eca6: 6522 bcss 4ecca <_Objects_Id_to_name+0x52>
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
if ( !_Objects_Information_table[ the_api ] )
4eca8: 41f9 0006 f54e lea 6f54e <_Objects_Information_table>,%a0
4ecae: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0
4ecb2: 4a88 tstl %a0
4ecb4: 6714 beqs 4ecca <_Objects_Id_to_name+0x52>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
4ecb6: 2001 movel %d1,%d0
4ecb8: 741b moveq #27,%d2
4ecba: e4a8 lsrl %d2,%d0
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );
information = _Objects_Information_table[ the_api ][ the_class ];
4ecbc: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0
if ( !information )
4ecc0: 4a88 tstl %a0
4ecc2: 6706 beqs 4ecca <_Objects_Id_to_name+0x52> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
4ecc4: 4a28 0032 tstb %a0@(50)
4ecc8: 670e beqs 4ecd8 <_Objects_Id_to_name+0x60> <== ALWAYS TAKEN
return OBJECTS_INVALID_ID;
*name = the_object->name;
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
4ecca: 242e fff8 movel %fp@(-8),%d2
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
4ecce: 7003 moveq #3,%d0
return OBJECTS_INVALID_ID;
*name = the_object->name;
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
4ecd0: 4e5e unlk %fp
4ecd2: 4e75 rts
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
4ecd4: 2200 movel %d0,%d1
4ecd6: 60b8 bras 4ec90 <_Objects_Id_to_name+0x18>
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
4ecd8: 486e fffc pea %fp@(-4)
4ecdc: 2f01 movel %d1,%sp@-
4ecde: 2f08 movel %a0,%sp@-
4ece0: 4eb9 0004 ec10 jsr 4ec10 <_Objects_Get>
if ( !the_object )
4ece6: 4fef 000c lea %sp@(12),%sp
4ecea: 4a80 tstl %d0
4ecec: 67dc beqs 4ecca <_Objects_Id_to_name+0x52>
return OBJECTS_INVALID_ID;
*name = the_object->name;
4ecee: 206e 000c moveal %fp@(12),%a0
4ecf2: 2240 moveal %d0,%a1
4ecf4: 20a9 000c movel %a1@(12),%a0@
_Thread_Enable_dispatch();
4ecf8: 4eb9 0004 fa3c jsr 4fa3c <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
4ecfe: 242e fff8 movel %fp@(-8),%d2
if ( !the_object )
return OBJECTS_INVALID_ID;
*name = the_object->name;
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
4ed02: 4280 clrl %d0
}
4ed04: 4e5e unlk %fp <== NOT EXECUTED
00049260 <_Objects_Set_name>:
{
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
49260: 4280 clrl %d0
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
49262: 4e56 fff0 linkw %fp,#-16
49266: 48d7 3c00 moveml %a2-%a5,%sp@
4926a: 2a6e 0008 moveal %fp@(8),%a5
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
4926e: 302d 0034 movew %a5@(52),%d0
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
49272: 246e 0010 moveal %fp@(16),%a2
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
49276: 2f00 movel %d0,%sp@-
bool _Objects_Set_name(
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
49278: 286e 000c moveal %fp@(12),%a4
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
4927c: 2f0a movel %a2,%sp@-
4927e: 4eb9 0005 0b30 jsr 50b30 <strnlen>
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
49284: 508f addql #8,%sp
{
size_t length;
const char *s;
s = name;
length = strnlen( name, information->name_length );
49286: 2640 moveal %d0,%a3
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
49288: 4a2d 0032 tstb %a5@(50)
4928c: 6662 bnes 492f0 <_Objects_Set_name+0x90>
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
4928e: 7218 moveq #24,%d1
49290: 1012 moveb %a2@,%d0
49292: 49c0 extbl %d0
49294: e3a8 lsll %d1,%d0
49296: 123c 0001 moveb #1,%d1
4929a: b28b cmpl %a3,%d1
4929c: 643c bccs 492da <_Objects_Set_name+0x7a>
4929e: 122a 0001 moveb %a2@(1),%d1
492a2: 49c1 extbl %d1
492a4: 4841 swap %d1
492a6: 4241 clrw %d1
492a8: 8280 orl %d0,%d1
492aa: 7002 moveq #2,%d0
492ac: b08b cmpl %a3,%d0
492ae: 6730 beqs 492e0 <_Objects_Set_name+0x80>
492b0: 102a 0002 moveb %a2@(2),%d0
492b4: 49c0 extbl %d0
492b6: e188 lsll #8,%d0
492b8: 8280 orl %d0,%d1
492ba: 7003 moveq #3,%d0
492bc: b08b cmpl %a3,%d0
492be: 6700 0082 beqw 49342 <_Objects_Set_name+0xe2>
492c2: 102a 0003 moveb %a2@(3),%d0
492c6: 49c0 extbl %d0
492c8: 8280 orl %d0,%d1
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
492ca: 7001 moveq #1,%d0
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
492cc: 2941 000c movel %d1,%a4@(12)
);
}
return true;
}
492d0: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5
492d6: 4e5e unlk %fp
492d8: 4e75 rts
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
492da: 2200 movel %d0,%d1
492dc: 08c1 0015 bset #21,%d1
492e0: 7020 moveq #32,%d0
492e2: 08c1 000d bset #13,%d1
492e6: 8280 orl %d0,%d1
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
492e8: 7001 moveq #1,%d0
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
492ea: 2941 000c movel %d1,%a4@(12)
492ee: 60e0 bras 492d0 <_Objects_Set_name+0x70>
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
char *d;
d = _Workspace_Allocate( length + 1 );
492f0: 486b 0001 pea %a3@(1)
492f4: 4eb9 0004 aed8 jsr 4aed8 <_Workspace_Allocate>
if ( !d )
492fa: 588f addql #4,%sp
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) {
char *d;
d = _Workspace_Allocate( length + 1 );
492fc: 2a40 moveal %d0,%a5
if ( !d )
492fe: 4a80 tstl %d0
49300: 6734 beqs 49336 <_Objects_Set_name+0xd6>
return false;
_Workspace_Free( (void *)the_object->name.name_p );
49302: 2f2c 000c movel %a4@(12),%sp@-
49306: 4eb9 0004 aef4 jsr 4aef4 <_Workspace_Free>
the_object->name.name_p = NULL;
strncpy( d, name, length );
4930c: 2f0b movel %a3,%sp@-
4930e: 2f0a movel %a2,%sp@-
d = _Workspace_Allocate( length + 1 );
if ( !d )
return false;
_Workspace_Free( (void *)the_object->name.name_p );
the_object->name.name_p = NULL;
49310: 42ac 000c clrl %a4@(12)
strncpy( d, name, length );
49314: 2f0d movel %a5,%sp@-
49316: 4eb9 0005 0a94 jsr 50a94 <strncpy>
d[length] = '\0';
the_object->name.name_p = d;
4931c: 4fef 0010 lea %sp@(16),%sp
_Workspace_Free( (void *)the_object->name.name_p );
the_object->name.name_p = NULL;
strncpy( d, name, length );
d[length] = '\0';
49320: 4200 clrb %d0
49322: 1b80 b800 moveb %d0,%a5@(00000000,%a3:l)
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
49326: 7001 moveq #1,%d0
_Workspace_Free( (void *)the_object->name.name_p );
the_object->name.name_p = NULL;
strncpy( d, name, length );
d[length] = '\0';
the_object->name.name_p = d;
49328: 294d 000c movel %a5,%a4@(12)
);
}
return true;
}
4932c: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5
49332: 4e5e unlk %fp
49334: 4e75 rts
49336: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5
if ( information->is_string ) {
char *d;
d = _Workspace_Allocate( length + 1 );
if ( !d )
return false;
4933c: 4200 clrb %d0
);
}
return true;
}
4933e: 4e5e unlk %fp
49340: 4e75 rts
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
49342: 7020 moveq #32,%d0
49344: 8280 orl %d0,%d1
((3 < length) ? s[ 3 ] : ' ')
);
}
return true;
49346: 7001 moveq #1,%d0
d[length] = '\0';
the_object->name.name_p = d;
} else
#endif
{
the_object->name.name_u32 = _Objects_Build_name(
49348: 2941 000c movel %d1,%a4@(12)
4934c: 6082 bras 492d0 <_Objects_Set_name+0x70>
...
00049138 <_Objects_Shrink_information>:
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
49138: 4281 clrl %d1
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
Objects_Information *information
)
{
4913a: 4e56 ffec linkw %fp,#-20
4913e: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
49142: 246e 0008 moveal %fp@(8),%a2
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
49146: 4283 clrl %d3
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
49148: 242a 0006 movel %a2@(6),%d2
block_count = (information->maximum - index_base) /
4914c: 362a 000e movew %a2@(14),%d3
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
49150: 0282 0000 ffff andil #65535,%d2
block_count = (information->maximum - index_base) /
49156: 322a 0012 movew %a2@(18),%d1
4915a: 9682 subl %d2,%d3
4915c: 4c41 3003 remul %d1,%d3,%d3
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
49160: 6778 beqs 491da <_Objects_Shrink_information+0xa2><== NEVER TAKEN
if ( information->inactive_per_block[ block ] ==
49162: 206a 002a moveal %a2@(42),%a0
49166: b290 cmpl %a0@,%d1
49168: 6700 0088 beqw 491f2 <_Objects_Shrink_information+0xba>
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
4916c: 5888 addql #4,%a0
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
4916e: 4280 clrl %d0
49170: 5280 addql #1,%d0
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
49172: d481 addl %d1,%d2
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
49174: b680 cmpl %d0,%d3
49176: 6762 beqs 491da <_Objects_Shrink_information+0xa2>
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
49178: 2800 movel %d0,%d4
4917a: e58c lsll #2,%d4
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] ==
4917c: b298 cmpl %a0@+,%d1
4917e: 66f0 bnes 49170 <_Objects_Shrink_information+0x38>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
49180: 206a 001c moveal %a2@(28),%a0
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
49184: 47f9 0004 ceb0 lea 4ceb0 <_Chain_Extract>,%a3
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) _Chain_First( &information->Inactive );
do {
index = _Objects_Get_index( the_object->id );
4918a: 2028 0008 movel %a0@(8),%d0
4918e: 0280 0000 ffff andil #65535,%d0
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
49194: 2610 movel %a0@,%d3
if ((index >= index_base) &&
49196: b480 cmpl %d0,%d2
49198: 620c bhis 491a6 <_Objects_Shrink_information+0x6e>
(index < (index_base + information->allocation_size))) {
4919a: 4281 clrl %d1
4919c: 322a 0012 movew %a2@(18),%d1
491a0: d282 addl %d2,%d1
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
491a2: b280 cmpl %d0,%d1
491a4: 623e bhis 491e4 <_Objects_Shrink_information+0xac>
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
491a6: 2043 moveal %d3,%a0
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
491a8: 4a83 tstl %d3
491aa: 66de bnes 4918a <_Objects_Shrink_information+0x52>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
491ac: 206a 002e moveal %a2@(46),%a0
491b0: 2f30 4800 movel %a0@(00000000,%d4:l),%sp@-
491b4: 4eb9 0004 acdc jsr 4acdc <_Workspace_Free>
information->object_blocks[ block ] = NULL;
491ba: 206a 002e moveal %a2@(46),%a0
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
return;
491be: 588f addql #4,%sp
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
491c0: 42b0 4800 clrl %a0@(00000000,%d4:l)
information->inactive_per_block[ block ] = 0;
491c4: 206a 002a moveal %a2@(42),%a0
information->inactive -= information->allocation_size;
491c8: 302a 0028 movew %a2@(40),%d0
491cc: 322a 0012 movew %a2@(18),%d1
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
491d0: 42b0 4800 clrl %a0@(00000000,%d4:l)
information->inactive -= information->allocation_size;
491d4: 9081 subl %d1,%d0
491d6: 3540 0028 movew %d0,%a2@(40)
return;
}
index_base += information->allocation_size;
}
}
491da: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
491e0: 4e5e unlk %fp
491e2: 4e75 rts
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
491e4: 2f08 movel %a0,%sp@-
491e6: 4e93 jsr %a3@
491e8: 588f addql #4,%sp
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
491ea: 2043 moveal %d3,%a0
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
491ec: 4a83 tstl %d3
491ee: 669a bnes 4918a <_Objects_Shrink_information+0x52>
491f0: 60ba bras 491ac <_Objects_Shrink_information+0x74>
491f2: 206a 001c moveal %a2@(28),%a0 <== NOT EXECUTED
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] ==
491f6: 4284 clrl %d4 <== NOT EXECUTED
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
491f8: 47f9 0004 ceb0 lea 4ceb0 <_Chain_Extract>,%a3 <== NOT EXECUTED
491fe: 608a bras 4918a <_Objects_Shrink_information+0x52><== NOT EXECUTED
000480d8 <_POSIX_Condition_variables_Wait_support>:
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
480d8: 4e56 ffec linkw %fp,#-20
480dc: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
480e0: 240e movel %fp,%d2
480e2: 5982 subql #4,%d2
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
480e4: 246e 000c moveal %fp@(12),%a2
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
480e8: 2f02 movel %d2,%sp@-
pthread_cond_t *cond,
pthread_mutex_t *mutex,
Watchdog_Interval timeout,
bool already_timedout
)
{
480ea: 162e 0017 moveb %fp@(23),%d3
register POSIX_Condition_variables_Control *the_cond;
Objects_Locations location;
int status;
int mutex_status;
if ( !_POSIX_Mutex_Get( mutex, &location ) ) {
480ee: 2f0a movel %a2,%sp@-
480f0: 4eb9 0004 825c jsr 4825c <_POSIX_Mutex_Get>
480f6: 508f addql #8,%sp
480f8: 4a80 tstl %d0
480fa: 6766 beqs 48162 <_POSIX_Condition_variables_Wait_support+0x8a>
*
* 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;
480fc: 2039 0006 37b6 movel 637b6 <_Thread_Dispatch_disable_level>,%d0
--level;
48102: 5380 subql #1,%d0
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
48104: 2f02 movel %d2,%sp@-
48106: 2f2e 0008 movel %fp@(8),%sp@-
_Thread_Dispatch_disable_level = level;
4810a: 23c0 0006 37b6 movel %d0,637b6 <_Thread_Dispatch_disable_level>
48110: 4eb9 0004 7ec4 jsr 47ec4 <_POSIX_Condition_variables_Get>
switch ( location ) {
48116: 508f addql #8,%sp
return EINVAL;
}
_Thread_Unnest_dispatch();
the_cond = _POSIX_Condition_variables_Get( cond, &location );
48118: 2640 moveal %d0,%a3
switch ( location ) {
4811a: 4aae fffc tstl %fp@(-4)
4811e: 6642 bnes 48162 <_POSIX_Condition_variables_Wait_support+0x8a>
case OBJECTS_LOCAL:
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
48120: 202b 0014 movel %a3@(20),%d0
48124: 6718 beqs 4813e <_POSIX_Condition_variables_Wait_support+0x66>
48126: b092 cmpl %a2@,%d0
48128: 6714 beqs 4813e <_POSIX_Condition_variables_Wait_support+0x66>
_Thread_Enable_dispatch();
4812a: 4eb9 0004 bcd0 jsr 4bcd0 <_Thread_Enable_dispatch>
return EINVAL;
48130: 7416 moveq #22,%d2
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
48132: 2002 movel %d2,%d0
48134: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3
4813a: 4e5e unlk %fp
4813c: 4e75 rts
if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) {
_Thread_Enable_dispatch();
return EINVAL;
}
(void) pthread_mutex_unlock( mutex );
4813e: 2f0a movel %a2,%sp@-
48140: 4eb9 0004 8514 jsr 48514 <pthread_mutex_unlock>
_Thread_Enable_dispatch();
return EINVAL;
}
*/
if ( !already_timedout ) {
48146: 588f addql #4,%sp
48148: 4a03 tstb %d3
4814a: 6724 beqs 48170 <_POSIX_Condition_variables_Wait_support+0x98>
status = _Thread_Executing->Wait.return_code;
if ( status == EINTR )
status = 0;
} else {
_Thread_Enable_dispatch();
4814c: 4eb9 0004 bcd0 jsr 4bcd0 <_Thread_Enable_dispatch>
status = ETIMEDOUT;
48152: 7474 moveq #116,%d2
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
48154: 2f0a movel %a2,%sp@-
48156: 4eb9 0004 8478 jsr 48478 <pthread_mutex_lock>
if ( mutex_status )
4815c: 588f addql #4,%sp
4815e: 4a80 tstl %d0
48160: 67d0 beqs 48132 <_POSIX_Condition_variables_Wait_support+0x5a><== ALWAYS TAKEN
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
48162: 7416 moveq #22,%d2
}
48164: 2002 movel %d2,%d0
48166: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3
4816c: 4e5e unlk %fp
4816e: 4e75 rts
return EINVAL;
}
*/
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
48170: 2752 0014 movel %a2@,%a3@(20)
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;
48174: 7201 moveq #1,%d1
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
48176: 200b movel %a3,%d0
48178: 0680 0000 0018 addil #24,%d0
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
4817e: 2079 0006 3bfe moveal 63bfe <_Per_CPU_Information+0xe>,%a0
48184: 2741 0048 movel %d1,%a3@(72)
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
48188: 226e 0008 moveal %fp@(8),%a1
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
4818c: 42a8 0034 clrl %a0@(52)
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
_Thread_Executing->Wait.id = *cond;
48190: 2151 0020 movel %a1@,%a0@(32)
if ( !already_timedout ) {
the_cond->Mutex = *mutex;
_Thread_queue_Enter_critical_section( &the_cond->Wait_queue );
_Thread_Executing->Wait.return_code = 0;
_Thread_Executing->Wait.queue = &the_cond->Wait_queue;
48194: 2140 0044 movel %d0,%a0@(68)
_Thread_Executing->Wait.id = *cond;
_Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
48198: 4879 0004 c60c pea 4c60c <_Thread_queue_Timeout>
4819e: 2f2e 0010 movel %fp@(16),%sp@-
481a2: 2f00 movel %d0,%sp@-
481a4: 4eb9 0004 c1e0 jsr 4c1e0 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
481aa: 4eb9 0004 bcd0 jsr 4bcd0 <_Thread_Enable_dispatch>
* a POSIX signal, then pthread_cond_wait returns spuriously,
* according to the POSIX standard. It means that pthread_cond_wait
* returns a success status, except for the fact that it was not
* woken up a pthread_cond_signal or a pthread_cond_broadcast.
*/
status = _Thread_Executing->Wait.return_code;
481b0: 2079 0006 3bfe moveal 63bfe <_Per_CPU_Information+0xe>,%a0
if ( status == EINTR )
status = 0;
481b6: 7004 moveq #4,%d0
* according to the POSIX standard. It means that pthread_cond_wait
* returns a success status, except for the fact that it was not
* woken up a pthread_cond_signal or a pthread_cond_broadcast.
*/
status = _Thread_Executing->Wait.return_code;
if ( status == EINTR )
481b8: 4fef 000c lea %sp@(12),%sp
* a POSIX signal, then pthread_cond_wait returns spuriously,
* according to the POSIX standard. It means that pthread_cond_wait
* returns a success status, except for the fact that it was not
* woken up a pthread_cond_signal or a pthread_cond_broadcast.
*/
status = _Thread_Executing->Wait.return_code;
481bc: 2428 0034 movel %a0@(52),%d2
if ( status == EINTR )
status = 0;
481c0: b082 cmpl %d2,%d0
481c2: 56c0 sne %d0
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
481c4: 2f0a movel %a2,%sp@-
* returns a success status, except for the fact that it was not
* woken up a pthread_cond_signal or a pthread_cond_broadcast.
*/
status = _Thread_Executing->Wait.return_code;
if ( status == EINTR )
status = 0;
481c6: 49c0 extbl %d0
481c8: c480 andl %d0,%d2
/*
* When we get here the dispatch disable level is 0.
*/
mutex_status = pthread_mutex_lock( mutex );
481ca: 4eb9 0004 8478 jsr 48478 <pthread_mutex_lock>
if ( mutex_status )
481d0: 588f addql #4,%sp
481d2: 4a80 tstl %d0
481d4: 668c bnes 48162 <_POSIX_Condition_variables_Wait_support+0x8a>
481d6: 6000 ff5a braw 48132 <_POSIX_Condition_variables_Wait_support+0x5a>
...
000472b8 <_POSIX_Keys_Free_memory>:
#include <rtems/posix/key.h>
void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
472b8: 4e56 0000 linkw %fp,#0
472bc: 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 ] );
472be: 47f9 0004 bc14 lea 4bc14 <_Workspace_Free>,%a3
#include <rtems/posix/key.h>
void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
472c4: 2f0a movel %a2,%sp@-
472c6: 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 ] );
472ca: 2f2a 0018 movel %a2@(24),%sp@-
472ce: 4e93 jsr %a3@
472d0: 2f2a 001c movel %a2@(28),%sp@-
472d4: 4e93 jsr %a3@
472d6: 2d6a 0020 0008 movel %a2@(32),%fp@(8)
472dc: 508f addql #8,%sp
}
472de: 246e fff8 moveal %fp@(-8),%a2
472e2: 266e fffc moveal %fp@(-4),%a3
472e6: 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 ] );
472e8: 4ef9 0004 bc14 jmp 4bc14 <_Workspace_Free>
...
0004e7d4 <_POSIX_Keys_Run_destructors>:
4e7d4: 7218 moveq #24,%d1
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
4e7d6: 4e56 ffec linkw %fp,#-20
4e7da: 206e 0008 moveal %fp@(8),%a0
4e7de: 48d7 007c moveml %d2-%d6,%sp@
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
4e7e2: 2628 0008 movel %a0@(8),%d3
4e7e6: 2003 movel %d3,%d0
4e7e8: e2a8 lsrl %d1,%d0
4e7ea: 123c 0007 moveb #7,%d1
4e7ee: c081 andl %d1,%d0
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 ];
4e7f0: 0283 0000 ffff andil #65535,%d3
4e7f6: 2c00 movel %d0,%d6
4e7f8: 5a86 addql #5,%d6
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
4e7fa: 3039 0006 1310 movew 61310 <_POSIX_Keys_Information+0xe>,%d0
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 ];
4e800: e58b lsll #2,%d3
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4e802: 4a40 tstw %d0
4e804: 660a bnes 4e810 <_POSIX_Keys_Run_destructors+0x3c>
done = false;
}
}
}
}
}
4e806: 4cee 007c ffec moveml %fp@(-20),%d2-%d6
4e80c: 4e5e unlk %fp
4e80e: 4e75 rts
4e810: 4285 clrl %d5
4e812: 7201 moveq #1,%d1
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4e814: 7401 moveq #1,%d2
4e816: 7801 moveq #1,%d4
4e818: 3a00 movew %d0,%d5
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
4e81a: 2079 0006 131a moveal 6131a <_POSIX_Keys_Information+0x18>,%a0
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4e820: 5282 addql #1,%d2
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
4e822: 2070 1c00 moveal %a0@(00000000,%d1:l:4),%a0
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
4e826: 4a88 tstl %a0
4e828: 671e beqs 4e848 <_POSIX_Keys_Run_destructors+0x74>
4e82a: 4aa8 0010 tstl %a0@(16)
4e82e: 6718 beqs 4e848 <_POSIX_Keys_Run_destructors+0x74>
void *value = key->Values [ thread_api ][ thread_index ];
4e830: 2270 6c00 moveal %a0@(00000000,%d6:l:4),%a1
4e834: d3c3 addal %d3,%a1
4e836: 2211 movel %a1@,%d1
if ( value != NULL ) {
4e838: 670e beqs 4e848 <_POSIX_Keys_Run_destructors+0x74><== ALWAYS TAKEN
key->Values [ thread_api ][ thread_index ] = NULL;
4e83a: 4291 clrl %a1@ <== NOT EXECUTED
(*key->destructor)( value );
done = false;
4e83c: 4204 clrb %d4 <== NOT EXECUTED
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
if ( value != NULL ) {
key->Values [ thread_api ][ thread_index ] = NULL;
(*key->destructor)( value );
4e83e: 2f01 movel %d1,%sp@- <== NOT EXECUTED
4e840: 2068 0010 moveal %a0@(16),%a0 <== NOT EXECUTED
4e844: 4e90 jsr %a0@ <== NOT EXECUTED
4e846: 588f addql #4,%sp <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4e848: 4281 clrl %d1
4e84a: 3202 movew %d2,%d1
4e84c: b285 cmpl %d5,%d1
4e84e: 63ca blss 4e81a <_POSIX_Keys_Run_destructors+0x46>
* 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 ) {
4e850: 4a04 tstb %d4
4e852: 66b2 bnes 4e806 <_POSIX_Keys_Run_destructors+0x32><== ALWAYS TAKEN
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
4e854: 3039 0006 1310 movew 61310 <_POSIX_Keys_Information+0xe>,%d0<== NOT EXECUTED
done = true;
for ( index = 1 ; index <= max ; ++index ) {
4e85a: 67aa beqs 4e806 <_POSIX_Keys_Run_destructors+0x32><== NOT EXECUTED
4e85c: 60b2 bras 4e810 <_POSIX_Keys_Run_destructors+0x3c><== NOT EXECUTED
...
0004cac4 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
4cac4: 4e56 ffe4 linkw %fp,#-28
4cac8: 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(
4cacc: 486e fff8 pea %fp@(-8)
4cad0: 242e 0008 movel %fp@(8),%d2
4cad4: 2f02 movel %d2,%sp@-
4cad6: 4879 0006 a7da pea 6a7da <_POSIX_Message_queue_Information_fds>
4cadc: 246e 0014 moveal %fp@(20),%a2
4cae0: 182e 001b moveb %fp@(27),%d4
4cae4: 4eb9 0005 01a8 jsr 501a8 <_Objects_Get>
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
4caea: 4fef 000c lea %sp@(12),%sp
4caee: 4aae fff8 tstl %fp@(-8)
4caf2: 671a beqs 4cb0e <_POSIX_Message_queue_Receive_support+0x4a>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4caf4: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cafa: 72ff moveq #-1,%d1
4cafc: 2040 moveal %d0,%a0
4cafe: 7009 moveq #9,%d0
}
4cb00: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4cb06: 2080 movel %d0,%a0@
}
4cb08: 2001 movel %d1,%d0
4cb0a: 4e5e unlk %fp
4cb0c: 4e75 rts
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
4cb0e: 2040 moveal %d0,%a0
4cb10: 7603 moveq #3,%d3
4cb12: 7a01 moveq #1,%d5
4cb14: 2228 0014 movel %a0@(20),%d1
4cb18: c681 andl %d1,%d3
4cb1a: ba83 cmpl %d3,%d5
4cb1c: 6700 00c4 beqw 4cbe2 <_POSIX_Message_queue_Receive_support+0x11e>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
4cb20: 2068 0010 moveal %a0@(16),%a0
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
4cb24: 202e 0010 movel %fp@(16),%d0
4cb28: b0a8 0066 cmpl %a0@(102),%d0
4cb2c: 656a bcss 4cb98 <_POSIX_Message_queue_Receive_support+0xd4>
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
4cb2e: 70ff moveq #-1,%d0
4cb30: 2d40 fffc movel %d0,%fp@(-4)
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4cb34: 4a04 tstb %d4
4cb36: 6756 beqs 4cb8e <_POSIX_Message_queue_Receive_support+0xca>
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
4cb38: 0801 000e btst #14,%d1
4cb3c: 57c0 seq %d0
4cb3e: 49c0 extbl %d0
4cb40: 4480 negl %d0
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
4cb42: 2f2e 001c movel %fp@(28),%sp@-
4cb46: 2f00 movel %d0,%sp@-
4cb48: 486e fffc pea %fp@(-4)
4cb4c: 2f2e 000c movel %fp@(12),%sp@-
4cb50: 2f02 movel %d2,%sp@-
4cb52: 4868 001a pea %a0@(26)
4cb56: 4eb9 0004 f010 jsr 4f010 <_CORE_message_queue_Seize>
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
4cb5c: 4eb9 0005 0f4c jsr 50f4c <_Thread_Enable_dispatch>
if (msg_prio) {
*msg_prio = _POSIX_Message_queue_Priority_from_core(
_Thread_Executing->Wait.count
4cb62: 2079 0006 a85e moveal 6a85e <_Per_CPU_Information+0xe>,%a0
do_wait,
timeout
);
_Thread_Enable_dispatch();
if (msg_prio) {
4cb68: 4fef 0018 lea %sp@(24),%sp
4cb6c: 4a8a tstl %a2
4cb6e: 6708 beqs 4cb78 <_POSIX_Message_queue_Receive_support+0xb4><== 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);
4cb70: 2028 0024 movel %a0@(36),%d0
4cb74: 6d1c blts 4cb92 <_POSIX_Message_queue_Receive_support+0xce>
*msg_prio = _POSIX_Message_queue_Priority_from_core(
4cb76: 2480 movel %d0,%a2@
_Thread_Executing->Wait.count
);
}
if ( !_Thread_Executing->Wait.return_code )
4cb78: 4aa8 0034 tstl %a0@(52)
4cb7c: 663a bnes 4cbb8 <_POSIX_Message_queue_Receive_support+0xf4>
return length_out;
4cb7e: 222e fffc movel %fp@(-4),%d1
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cb82: 2001 movel %d1,%d0
4cb84: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2
4cb8a: 4e5e unlk %fp
4cb8c: 4e75 rts
length_out = -1;
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4cb8e: 4280 clrl %d0
4cb90: 60b0 bras 4cb42 <_POSIX_Message_queue_Receive_support+0x7e>
4cb92: 4480 negl %d0
timeout
);
_Thread_Enable_dispatch();
if (msg_prio) {
*msg_prio = _POSIX_Message_queue_Priority_from_core(
4cb94: 2480 movel %d0,%a2@
4cb96: 60e0 bras 4cb78 <_POSIX_Message_queue_Receive_support+0xb4>
}
the_mq = the_mq_fd->Queue;
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
_Thread_Enable_dispatch();
4cb98: 4eb9 0005 0f4c jsr 50f4c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EMSGSIZE );
4cb9e: 747a moveq #122,%d2
4cba0: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cba6: 72ff moveq #-1,%d1
4cba8: 2040 moveal %d0,%a0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cbaa: 2001 movel %d1,%d0
the_mq = the_mq_fd->Queue;
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EMSGSIZE );
4cbac: 2082 movel %d2,%a0@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cbae: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2
4cbb4: 4e5e unlk %fp
4cbb6: 4e75 rts
}
if ( !_Thread_Executing->Wait.return_code )
return length_out;
rtems_set_errno_and_return_minus_one(
4cbb8: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cbbe: 2079 0006 a85e moveal 6a85e <_Per_CPU_Information+0xe>,%a0
4cbc4: 2440 moveal %d0,%a2
4cbc6: 2f28 0034 movel %a0@(52),%sp@-
4cbca: 4eb9 0004 ce9c jsr 4ce9c <_POSIX_Message_queue_Translate_core_message_queue_return_code>
4cbd0: 588f addql #4,%sp
4cbd2: 72ff moveq #-1,%d1
4cbd4: 2480 movel %d0,%a2@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cbd6: 2001 movel %d1,%d0
4cbd8: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2
4cbde: 4e5e unlk %fp
4cbe0: 4e75 rts
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
_Thread_Enable_dispatch();
4cbe2: 4eb9 0005 0f4c jsr 50f4c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EBADF );
4cbe8: 7609 moveq #9,%d3
4cbea: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cbf0: 72ff moveq #-1,%d1
4cbf2: 2040 moveal %d0,%a0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cbf4: 2001 movel %d1,%d0
switch ( location ) {
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EBADF );
4cbf6: 2083 movel %d3,%a0@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cbf8: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2
4cbfe: 4e5e unlk %fp
...
0004cc28 <_POSIX_Message_queue_Send_support>:
/*
* Validate the priority.
* XXX - Do not validate msg_prio is not less than 0.
*/
if ( msg_prio > MQ_PRIO_MAX )
4cc28: 7020 moveq #32,%d0
size_t msg_len,
unsigned int msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
4cc2a: 4e56 ffe8 linkw %fp,#-24
4cc2e: 48d7 043c moveml %d2-%d5/%a2,%sp@
4cc32: 262e 0008 movel %fp@(8),%d3
4cc36: 242e 0014 movel %fp@(20),%d2
4cc3a: 182e 001b moveb %fp@(27),%d4
/*
* Validate the priority.
* XXX - Do not validate msg_prio is not less than 0.
*/
if ( msg_prio > MQ_PRIO_MAX )
4cc3e: b082 cmpl %d2,%d0
4cc40: 6500 0106 bcsw 4cd48 <_POSIX_Message_queue_Send_support+0x120>
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(
4cc44: 486e fffc pea %fp@(-4)
4cc48: 2f03 movel %d3,%sp@-
4cc4a: 4879 0006 a7da pea 6a7da <_POSIX_Message_queue_Information_fds>
4cc50: 4eb9 0005 01a8 jsr 501a8 <_Objects_Get>
rtems_set_errno_and_return_minus_one( EINVAL );
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
4cc56: 4fef 000c lea %sp@(12),%sp
4cc5a: 4aae fffc tstl %fp@(-4)
4cc5e: 6600 00ac bnew 4cd0c <_POSIX_Message_queue_Send_support+0xe4>
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) {
4cc62: 2240 moveal %d0,%a1
4cc64: 7a03 moveq #3,%d5
4cc66: 2229 0014 movel %a1@(20),%d1
4cc6a: ca81 andl %d1,%d5
4cc6c: 6700 00f4 beqw 4cd62 <_POSIX_Message_queue_Send_support+0x13a>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
4cc70: 2240 moveal %d0,%a1
4cc72: 2069 0010 moveal %a1@(16),%a0
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4cc76: 4a04 tstb %d4
4cc78: 674e beqs 4ccc8 <_POSIX_Message_queue_Send_support+0xa0>
do_wait = wait;
/*
* Now perform the actual message receive
*/
msg_status = _CORE_message_queue_Submit(
4cc7a: 2f2e 001c movel %fp@(28),%sp@-
4cc7e: 4482 negl %d2
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
4cc80: 0801 000e btst #14,%d1
4cc84: 57c0 seq %d0
4cc86: 49c0 extbl %d0
4cc88: 4480 negl %d0
do_wait = wait;
/*
* Now perform the actual message receive
*/
msg_status = _CORE_message_queue_Submit(
4cc8a: 2f00 movel %d0,%sp@-
4cc8c: 2f02 movel %d2,%sp@-
4cc8e: 42a7 clrl %sp@-
4cc90: 2f03 movel %d3,%sp@-
4cc92: 2f2e 0010 movel %fp@(16),%sp@-
4cc96: 2f2e 000c movel %fp@(12),%sp@-
4cc9a: 4868 001a pea %a0@(26)
4cc9e: 4eb9 0004 f14c jsr 4f14c <_CORE_message_queue_Submit>
_POSIX_Message_queue_Priority_to_core( msg_prio ),
do_wait,
timeout /* no timeout */
);
_Thread_Enable_dispatch();
4cca4: 4fef 0020 lea %sp@(32),%sp
do_wait = wait;
/*
* Now perform the actual message receive
*/
msg_status = _CORE_message_queue_Submit(
4cca8: 2400 movel %d0,%d2
_POSIX_Message_queue_Priority_to_core( msg_prio ),
do_wait,
timeout /* no timeout */
);
_Thread_Enable_dispatch();
4ccaa: 4eb9 0005 0f4c jsr 50f4c <_Thread_Enable_dispatch>
* after it wakes up. The returned status is correct for
* non-blocking operations but if we blocked, then we need
* to look at the status in our TCB.
*/
if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT )
4ccb0: 7007 moveq #7,%d0
4ccb2: b082 cmpl %d2,%d0
4ccb4: 6746 beqs 4ccfc <_POSIX_Message_queue_Send_support+0xd4>
msg_status = _Thread_Executing->Wait.return_code;
if ( !msg_status )
return msg_status;
4ccb6: 4281 clrl %d1
*/
if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT )
msg_status = _Thread_Executing->Wait.return_code;
if ( !msg_status )
4ccb8: 4a82 tstl %d2
4ccba: 666a bnes 4cd26 <_POSIX_Message_queue_Send_support+0xfe>
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4ccbc: 2001 movel %d1,%d0
4ccbe: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2
4ccc4: 4e5e unlk %fp
4ccc6: 4e75 rts
do_wait = wait;
/*
* Now perform the actual message receive
*/
msg_status = _CORE_message_queue_Submit(
4ccc8: 2f2e 001c movel %fp@(28),%sp@-
the_mq = the_mq_fd->Queue;
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
4cccc: 4280 clrl %d0
do_wait = wait;
/*
* Now perform the actual message receive
*/
msg_status = _CORE_message_queue_Submit(
4ccce: 4482 negl %d2
4ccd0: 2f00 movel %d0,%sp@-
4ccd2: 2f02 movel %d2,%sp@-
4ccd4: 42a7 clrl %sp@-
4ccd6: 2f03 movel %d3,%sp@-
4ccd8: 2f2e 0010 movel %fp@(16),%sp@-
4ccdc: 2f2e 000c movel %fp@(12),%sp@-
4cce0: 4868 001a pea %a0@(26)
4cce4: 4eb9 0004 f14c jsr 4f14c <_CORE_message_queue_Submit>
_POSIX_Message_queue_Priority_to_core( msg_prio ),
do_wait,
timeout /* no timeout */
);
_Thread_Enable_dispatch();
4ccea: 4fef 0020 lea %sp@(32),%sp
do_wait = wait;
/*
* Now perform the actual message receive
*/
msg_status = _CORE_message_queue_Submit(
4ccee: 2400 movel %d0,%d2
_POSIX_Message_queue_Priority_to_core( msg_prio ),
do_wait,
timeout /* no timeout */
);
_Thread_Enable_dispatch();
4ccf0: 4eb9 0005 0f4c jsr 50f4c <_Thread_Enable_dispatch>
* after it wakes up. The returned status is correct for
* non-blocking operations but if we blocked, then we need
* to look at the status in our TCB.
*/
if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT )
4ccf6: 7007 moveq #7,%d0
4ccf8: b082 cmpl %d2,%d0
4ccfa: 66ba bnes 4ccb6 <_POSIX_Message_queue_Send_support+0x8e><== ALWAYS TAKEN
msg_status = _Thread_Executing->Wait.return_code;
4ccfc: 2079 0006 a85e moveal 6a85e <_Per_CPU_Information+0xe>,%a0
if ( !msg_status )
return msg_status;
4cd02: 4281 clrl %d1
* non-blocking operations but if we blocked, then we need
* to look at the status in our TCB.
*/
if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT )
msg_status = _Thread_Executing->Wait.return_code;
4cd04: 2428 0034 movel %a0@(52),%d2
if ( !msg_status )
4cd08: 67b2 beqs 4ccbc <_POSIX_Message_queue_Send_support+0x94>
4cd0a: 601a bras 4cd26 <_POSIX_Message_queue_Send_support+0xfe>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4cd0c: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cd12: 72ff moveq #-1,%d1
4cd14: 2040 moveal %d0,%a0
4cd16: 7009 moveq #9,%d0
}
4cd18: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
4cd1e: 2080 movel %d0,%a0@
}
4cd20: 2001 movel %d1,%d0
4cd22: 4e5e unlk %fp
4cd24: 4e75 rts
msg_status = _Thread_Executing->Wait.return_code;
if ( !msg_status )
return msg_status;
rtems_set_errno_and_return_minus_one(
4cd26: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cd2c: 2440 moveal %d0,%a2
4cd2e: 2f02 movel %d2,%sp@-
4cd30: 4eb9 0004 ce9c jsr 4ce9c <_POSIX_Message_queue_Translate_core_message_queue_return_code>
4cd36: 588f addql #4,%sp
4cd38: 72ff moveq #-1,%d1
4cd3a: 2480 movel %d0,%a2@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cd3c: 2001 movel %d1,%d0
4cd3e: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2
4cd44: 4e5e unlk %fp
4cd46: 4e75 rts
* Validate the priority.
* XXX - Do not validate msg_prio is not less than 0.
*/
if ( msg_prio > MQ_PRIO_MAX )
rtems_set_errno_and_return_minus_one( EINVAL );
4cd48: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cd4e: 7616 moveq #22,%d3
4cd50: 72ff moveq #-1,%d1
4cd52: 2040 moveal %d0,%a0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cd54: 2001 movel %d1,%d0
* Validate the priority.
* XXX - Do not validate msg_prio is not less than 0.
*/
if ( msg_prio > MQ_PRIO_MAX )
rtems_set_errno_and_return_minus_one( EINVAL );
4cd56: 2083 movel %d3,%a0@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cd58: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2
4cd5e: 4e5e unlk %fp
4cd60: 4e75 rts
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) {
_Thread_Enable_dispatch();
4cd62: 4eb9 0005 0f4c jsr 50f4c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EBADF );
4cd68: 7409 moveq #9,%d2
4cd6a: 4eb9 0005 68c0 jsr 568c0 <__errno>
4cd70: 72ff moveq #-1,%d1
4cd72: 2040 moveal %d0,%a0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cd74: 2001 movel %d1,%d0
switch ( location ) {
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EBADF );
4cd76: 2082 movel %d2,%a0@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
}
4cd78: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2
4cd7e: 4e5e unlk %fp
...
0004ea10 <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
4ea10: 4e56 0000 linkw %fp,#0
4ea14: 2f0a movel %a2,%sp@-
4ea16: 2f02 movel %d2,%sp@-
4ea18: 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)
4ea1c: 4aae 0010 tstl %fp@(16)
4ea20: 6600 00fe bnew 4eb20 <_POSIX_Semaphore_Create_support+0x110>
*
* 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;
4ea24: 2039 0006 5a90 movel 65a90 <_Thread_Dispatch_disable_level>,%d0
++level;
4ea2a: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
4ea2c: 23c0 0006 5a90 movel %d0,65a90 <_Thread_Dispatch_disable_level>
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
4ea32: 4879 0006 5cac pea 65cac <_POSIX_Semaphore_Information>
4ea38: 4eb9 0004 a7bc jsr 4a7bc <_Objects_Allocate>
rtems_set_errno_and_return_minus_one( ENOSYS );
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
4ea3e: 588f addql #4,%sp
4ea40: 2440 moveal %d0,%a2
4ea42: 4a80 tstl %d0
4ea44: 6700 00f4 beqw 4eb3a <_POSIX_Semaphore_Create_support+0x12a>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
4ea48: 4a82 tstl %d2
4ea4a: 6778 beqs 4eac4 <_POSIX_Semaphore_Create_support+0xb4>
name = _Workspace_String_duplicate( name_arg, name_len );
4ea4c: 2f2e 000c movel %fp@(12),%sp@-
4ea50: 2f02 movel %d2,%sp@-
4ea52: 4eb9 0004 f910 jsr 4f910 <_Workspace_String_duplicate>
if ( !name ) {
4ea58: 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 );
4ea5a: 2400 movel %d0,%d2
if ( !name ) {
4ea5c: 6700 00fc beqw 4eb5a <_POSIX_Semaphore_Create_support+0x14a>
the_semaphore->process_shared = pshared;
if ( name ) {
the_semaphore->named = true;
the_semaphore->open_count = 1;
4ea60: 7001 moveq #1,%d0
4ea62: 2540 0016 movel %d0,%a2@(22)
}
the_semaphore->process_shared = pshared;
if ( name ) {
the_semaphore->named = true;
4ea66: 1540 0014 moveb %d0,%a2@(20)
the_semaphore->open_count = 1;
the_semaphore->linked = true;
4ea6a: 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;
4ea6e: 70ff moveq #-1,%d0
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
4ea70: 42aa 0010 clrl %a2@(16)
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
4ea74: 2540 005a movel %d0,%a2@(90)
* 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;
4ea78: 42aa 005e clrl %a2@(94)
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
4ea7c: 2f2e 0014 movel %fp@(20),%sp@-
4ea80: 486a 005a pea %a2@(90)
4ea84: 486a 001a pea %a2@(26)
4ea88: 4eb9 0004 a15c jsr 4a15c <_CORE_semaphore_Initialize>
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4ea8e: 202a 0008 movel %a2@(8),%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4ea92: 2079 0006 5cc4 moveal 65cc4 <_POSIX_Semaphore_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4ea98: 0280 0000 ffff andil #65535,%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4ea9e: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4)
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
4eaa2: 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;
4eaa6: 2542 000c movel %d2,%a2@(12)
4eaaa: 208a movel %a2,%a0@
_Thread_Enable_dispatch();
4eaac: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
return 0;
4eab2: 4fef 000c lea %sp@(12),%sp
4eab6: 4280 clrl %d0
}
4eab8: 242e fff8 movel %fp@(-8),%d2
4eabc: 246e fffc moveal %fp@(-4),%a2
4eac0: 4e5e unlk %fp
4eac2: 4e75 rts
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
4eac4: 42aa 0010 clrl %a2@(16)
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( ENOMEM );
}
} else {
name = NULL;
4eac8: 4282 clrl %d2
if ( name ) {
the_semaphore->named = true;
the_semaphore->open_count = 1;
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
4eaca: 4200 clrb %d0
the_semaphore->open_count = 0;
4eacc: 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;
4ead0: 1540 0014 moveb %d0,%a2@(20)
the_semaphore->open_count = 0;
the_semaphore->linked = false;
4ead4: 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;
4ead8: 70ff moveq #-1,%d0
* 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;
4eada: 42aa 005e clrl %a2@(94)
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
4eade: 2540 005a movel %d0,%a2@(90)
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
4eae2: 2f2e 0014 movel %fp@(20),%sp@-
4eae6: 486a 005a pea %a2@(90)
4eaea: 486a 001a pea %a2@(26)
4eaee: 4eb9 0004 a15c jsr 4a15c <_CORE_semaphore_Initialize>
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4eaf4: 202a 0008 movel %a2@(8),%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4eaf8: 2079 0006 5cc4 moveal 65cc4 <_POSIX_Semaphore_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
4eafe: 0280 0000 ffff andil #65535,%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4eb04: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4)
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
4eb08: 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;
4eb0c: 2542 000c movel %d2,%a2@(12)
4eb10: 208a movel %a2,%a0@
_Thread_Enable_dispatch();
4eb12: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
return 0;
4eb18: 4fef 000c lea %sp@(12),%sp
4eb1c: 4280 clrl %d0
4eb1e: 6098 bras 4eab8 <_POSIX_Semaphore_Create_support+0xa8>
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
rtems_set_errno_and_return_minus_one( ENOSYS );
4eb20: 4eb9 0005 1060 jsr 51060 <__errno>
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb26: 242e fff8 movel %fp@(-8),%d2
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
rtems_set_errno_and_return_minus_one( ENOSYS );
4eb2a: 2040 moveal %d0,%a0
4eb2c: 7258 moveq #88,%d1
4eb2e: 70ff moveq #-1,%d0
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb30: 246e fffc moveal %fp@(-4),%a2
4eb34: 4e5e unlk %fp
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
rtems_set_errno_and_return_minus_one( ENOSYS );
4eb36: 2081 movel %d1,%a0@
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb38: 4e75 rts
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
4eb3a: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
4eb40: 741c moveq #28,%d2
4eb42: 4eb9 0005 1060 jsr 51060 <__errno>
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb48: 246e fffc moveal %fp@(-4),%a2
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( ENOSPC );
4eb4c: 2040 moveal %d0,%a0
4eb4e: 70ff moveq #-1,%d0
4eb50: 2082 movel %d2,%a0@
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb52: 242e fff8 movel %fp@(-8),%d2
4eb56: 4e5e unlk %fp
4eb58: 4e75 rts
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
4eb5a: 2f0a movel %a2,%sp@- <== NOT EXECUTED
4eb5c: 4879 0006 5cac pea 65cac <_POSIX_Semaphore_Information> <== NOT EXECUTED
4eb62: 4eb9 0004 ab34 jsr 4ab34 <_Objects_Free> <== NOT EXECUTED
*/
if ( name_arg != NULL ) {
name = _Workspace_String_duplicate( name_arg, name_len );
if ( !name ) {
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
4eb68: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
4eb6e: 4eb9 0005 1060 jsr 51060 <__errno> <== NOT EXECUTED
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb74: 242e fff8 movel %fp@(-8),%d2 <== NOT EXECUTED
if ( name_arg != NULL ) {
name = _Workspace_String_duplicate( name_arg, name_len );
if ( !name ) {
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( ENOMEM );
4eb78: 2040 moveal %d0,%a0 <== NOT EXECUTED
4eb7a: 720c moveq #12,%d1 <== NOT EXECUTED
4eb7c: 508f addql #8,%sp <== NOT EXECUTED
4eb7e: 70ff moveq #-1,%d0 <== NOT EXECUTED
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
4eb80: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
4eb84: 4e5e unlk %fp <== NOT EXECUTED
if ( name_arg != NULL ) {
name = _Workspace_String_duplicate( name_arg, name_len );
if ( !name ) {
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( ENOMEM );
4eb86: 2081 movel %d1,%a0@ <== NOT EXECUTED
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
...
0004c3c8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
#include <rtems/posix/pthread.h>
void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
Thread_Control *the_thread
)
{
4c3c8: 4e56 0000 linkw %fp,#0
4c3cc: 226e 0008 moveal %fp@(8),%a1
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
4c3d0: 2069 00fe moveal %a1@(254),%a0
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
4c3d4: 4aa8 00d8 tstl %a0@(216)
4c3d8: 6608 bnes 4c3e2 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x1a><== NEVER TAKEN
4c3da: 7001 moveq #1,%d0
4c3dc: b0a8 00dc cmpl %a0@(220),%d0
4c3e0: 6708 beqs 4c3ea <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x22>
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
} else
_Thread_Enable_dispatch();
}
4c3e2: 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();
4c3e4: 4ef9 0004 9da8 jmp 49da8 <_Thread_Enable_dispatch>
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
4c3ea: 4aa8 00e0 tstl %a0@(224)
4c3ee: 67f2 beqs 4c3e2 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x1a>
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
4c3f0: 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;
4c3f4: 2039 0006 144a movel 6144a <_Thread_Dispatch_disable_level>,%d0
--level;
4c3fa: 5380 subql #1,%d0
4c3fc: 2f09 movel %a1,%sp@-
_Thread_Dispatch_disable_level = level;
4c3fe: 23c0 0006 144a movel %d0,6144a <_Thread_Dispatch_disable_level>
4c404: 4eb9 0004 caf0 jsr 4caf0 <_POSIX_Thread_Exit>
4c40a: 508f addql #8,%sp
} else
_Thread_Enable_dispatch();
}
4c40c: 4e5e unlk %fp <== NOT EXECUTED
0004eaf0 <_POSIX_Thread_Exit>:
void _POSIX_Thread_Exit(
Thread_Control *the_thread,
void *value_ptr
)
{
4eaf0: 4e56 ffe8 linkw %fp,#-24
4eaf4: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
4eaf8: 246e 0008 moveal %fp@(8),%a2
* are ready to be switched out. Otherwise, an ISR could
* occur and preempt us out while we still hold the
* allocator mutex.
*/
_RTEMS_Lock_allocator();
4eafc: 49f9 0004 7f00 lea 47f00 <_API_Mutex_Lock>,%a4
{
Objects_Information *the_information;
Thread_Control *unblocked;
POSIX_API_Control *api;
the_information = _Objects_Get_information_id( the_thread->Object.id );
4eb02: 2f2a 0008 movel %a2@(8),%sp@-
void _POSIX_Thread_Exit(
Thread_Control *the_thread,
void *value_ptr
)
{
4eb06: 242e 000c movel %fp@(12),%d2
Objects_Information *the_information;
Thread_Control *unblocked;
POSIX_API_Control *api;
the_information = _Objects_Get_information_id( the_thread->Object.id );
4eb0a: 4eb9 0004 8e40 jsr 48e40 <_Objects_Get_information_id>
* are ready to be switched out. Otherwise, an ISR could
* occur and preempt us out while we still hold the
* allocator mutex.
*/
_RTEMS_Lock_allocator();
4eb10: 2f39 0006 106a movel 6106a <_RTEMS_Allocator_Mutex>,%sp@-
{
Objects_Information *the_information;
Thread_Control *unblocked;
POSIX_API_Control *api;
the_information = _Objects_Get_information_id( the_thread->Object.id );
4eb16: 2600 movel %d0,%d3
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4eb18: 266a 00fe moveal %a2@(254),%a3
* are ready to be switched out. Otherwise, an ISR could
* occur and preempt us out while we still hold the
* allocator mutex.
*/
_RTEMS_Lock_allocator();
4eb1c: 4e94 jsr %a4@
*
* 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;
4eb1e: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
4eb24: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
4eb26: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
the_thread->Wait.return_argument = value_ptr;
/*
* Process join
*/
if ( api->detachstate == PTHREAD_CREATE_JOINABLE ) {
4eb2c: 7001 moveq #1,%d0
4eb2e: 508f addql #8,%sp
*/
_RTEMS_Lock_allocator();
_Thread_Disable_dispatch();
the_thread->Wait.return_argument = value_ptr;
4eb30: 2542 0028 movel %d2,%a2@(40)
/*
* Process join
*/
if ( api->detachstate == PTHREAD_CREATE_JOINABLE ) {
4eb34: b0ab 0040 cmpl %a3@(64),%d0
4eb38: 6738 beqs 4eb72 <_POSIX_Thread_Exit+0x82>
}
/*
* Now shut down the thread
*/
_Thread_Close( the_information, the_thread );
4eb3a: 2f0a movel %a2,%sp@-
4eb3c: 47f9 0004 7f60 lea 47f60 <_API_Mutex_Unlock>,%a3
4eb42: 2f03 movel %d3,%sp@-
4eb44: 4eb9 0004 992c jsr 4992c <_Thread_Close>
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
4eb4a: 2f0a movel %a2,%sp@-
4eb4c: 4879 0006 1154 pea 61154 <_POSIX_Threads_Information>
4eb52: 4eb9 0004 8db4 jsr 48db4 <_Objects_Free>
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
4eb58: 2f39 0006 106a movel 6106a <_RTEMS_Allocator_Mutex>,%sp@-
4eb5e: 4e93 jsr %a3@
_Thread_Enable_dispatch();
4eb60: 4fef 0014 lea %sp@(20),%sp
}
4eb64: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4eb6a: 4e5e unlk %fp
_Thread_Close( the_information, the_thread );
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
_Thread_Enable_dispatch();
4eb6c: 4ef9 0004 9cd0 jmp 49cd0 <_Thread_Enable_dispatch>
/*
* Process join
*/
if ( api->detachstate == PTHREAD_CREATE_JOINABLE ) {
unblocked = _Thread_queue_Dequeue( &api->Join_List );
4eb72: 47eb 0044 lea %a3@(68),%a3
4eb76: 4bf9 0004 a070 lea 4a070 <_Thread_queue_Dequeue>,%a5
4eb7c: 2f0b movel %a3,%sp@-
4eb7e: 4e95 jsr %a5@
if ( unblocked ) {
4eb80: 588f addql #4,%sp
4eb82: 4a80 tstl %d0
4eb84: 6726 beqs 4ebac <_POSIX_Thread_Exit+0xbc>
do {
*(void **)unblocked->Wait.return_argument = value_ptr;
4eb86: 2240 moveal %d0,%a1
4eb88: 2069 0028 moveal %a1@(40),%a0
4eb8c: 2082 movel %d2,%a0@
} while ( (unblocked = _Thread_queue_Dequeue( &api->Join_List )) );
4eb8e: 2f0b movel %a3,%sp@-
4eb90: 4e95 jsr %a5@
4eb92: 588f addql #4,%sp
4eb94: 4a80 tstl %d0
4eb96: 67a2 beqs 4eb3a <_POSIX_Thread_Exit+0x4a>
*/
if ( api->detachstate == PTHREAD_CREATE_JOINABLE ) {
unblocked = _Thread_queue_Dequeue( &api->Join_List );
if ( unblocked ) {
do {
*(void **)unblocked->Wait.return_argument = value_ptr;
4eb98: 2240 moveal %d0,%a1
4eb9a: 2069 0028 moveal %a1@(40),%a0
4eb9e: 2082 movel %d2,%a0@
} while ( (unblocked = _Thread_queue_Dequeue( &api->Join_List )) );
4eba0: 2f0b movel %a3,%sp@-
4eba2: 4e95 jsr %a5@
4eba4: 588f addql #4,%sp
4eba6: 4a80 tstl %d0
4eba8: 66dc bnes 4eb86 <_POSIX_Thread_Exit+0x96> <== NEVER TAKEN
4ebaa: 608e bras 4eb3a <_POSIX_Thread_Exit+0x4a>
} else {
_Thread_Set_state(
4ebac: 4878 1004 pea 1004 <D_MAX_EXP+0x805>
the_thread,
STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_TRANSIENT
);
_RTEMS_Unlock_allocator();
4ebb0: 47f9 0004 7f60 lea 47f60 <_API_Mutex_Unlock>,%a3
if ( unblocked ) {
do {
*(void **)unblocked->Wait.return_argument = value_ptr;
} while ( (unblocked = _Thread_queue_Dequeue( &api->Join_List )) );
} else {
_Thread_Set_state(
4ebb6: 2f0a movel %a2,%sp@-
4ebb8: 4eb9 0004 a600 jsr 4a600 <_Thread_Set_state>
the_thread,
STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_TRANSIENT
);
_RTEMS_Unlock_allocator();
4ebbe: 2f39 0006 106a movel 6106a <_RTEMS_Allocator_Mutex>,%sp@-
4ebc4: 4e93 jsr %a3@
_Thread_Enable_dispatch();
4ebc6: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
/* now waiting for thread to arrive */
_RTEMS_Lock_allocator();
4ebcc: 2f39 0006 106a movel 6106a <_RTEMS_Allocator_Mutex>,%sp@-
4ebd2: 4e94 jsr %a4@
*
* 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;
4ebd4: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
4ebda: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
4ebdc: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
void _Thread_Disable_dispatch( void );
#else
RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void )
{
_Thread_Dispatch_increment_disable_level();
RTEMS_COMPILER_MEMORY_BARRIER();
4ebe2: 4fef 0010 lea %sp@(16),%sp
}
/*
* Now shut down the thread
*/
_Thread_Close( the_information, the_thread );
4ebe6: 2f0a movel %a2,%sp@-
4ebe8: 2f03 movel %d3,%sp@-
4ebea: 4eb9 0004 992c jsr 4992c <_Thread_Close>
4ebf0: 2f0a movel %a2,%sp@-
4ebf2: 4879 0006 1154 pea 61154 <_POSIX_Threads_Information>
4ebf8: 4eb9 0004 8db4 jsr 48db4 <_Objects_Free>
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
4ebfe: 2f39 0006 106a movel 6106a <_RTEMS_Allocator_Mutex>,%sp@-
4ec04: 4e93 jsr %a3@
_Thread_Enable_dispatch();
4ec06: 4fef 0014 lea %sp@(20),%sp
}
4ec0a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4ec10: 4e5e unlk %fp
_Thread_Close( the_information, the_thread );
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
_Thread_Enable_dispatch();
4ec12: 4ef9 0004 9cd0 jmp 49cd0 <_Thread_Enable_dispatch>
0004d9bc <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
4d9bc: 4e56 fff0 linkw %fp,#-16
4d9c0: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
4d9c4: 246e 000c moveal %fp@(12),%a2
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
4d9c8: 47f9 0004 d998 lea 4d998 <_POSIX_Priority_Is_valid>,%a3
4d9ce: 2f12 movel %a2@,%sp@-
4d9d0: 4e93 jsr %a3@
4d9d2: 588f addql #4,%sp
4d9d4: 4a00 tstb %d0
4d9d6: 660c bnes 4d9e4 <_POSIX_Thread_Translate_sched_param+0x28><== ALWAYS TAKEN
return EINVAL;
4d9d8: 7016 moveq #22,%d0
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
}
4d9da: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4d9e0: 4e5e unlk %fp
4d9e2: 4e75 rts
)
{
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
4d9e4: 206e 0010 moveal %fp@(16),%a0
4d9e8: 4290 clrl %a0@
*budget_callout = NULL;
4d9ea: 206e 0014 moveal %fp@(20),%a0
4d9ee: 4290 clrl %a0@
if ( policy == SCHED_OTHER ) {
4d9f0: 4aae 0008 tstl %fp@(8)
4d9f4: 677a beqs 4da70 <_POSIX_Thread_Translate_sched_param+0xb4>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
return 0;
}
if ( policy == SCHED_FIFO ) {
4d9f6: 7001 moveq #1,%d0
4d9f8: b0ae 0008 cmpl %fp@(8),%d0
4d9fc: 6700 0086 beqw 4da84 <_POSIX_Thread_Translate_sched_param+0xc8>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
4da00: 103c 0002 moveb #2,%d0
4da04: b0ae 0008 cmpl %fp@(8),%d0
4da08: 6700 0086 beqw 4da90 <_POSIX_Thread_Translate_sched_param+0xd4>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
return 0;
}
if ( policy == SCHED_SPORADIC ) {
4da0c: 7004 moveq #4,%d0
4da0e: b0ae 0008 cmpl %fp@(8),%d0
4da12: 66c4 bnes 4d9d8 <_POSIX_Thread_Translate_sched_param+0x1c>
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
4da14: 4aaa 0008 tstl %a2@(8)
4da18: 6606 bnes 4da20 <_POSIX_Thread_Translate_sched_param+0x64>
4da1a: 4aaa 000c tstl %a2@(12)
4da1e: 67b8 beqs 4d9d8 <_POSIX_Thread_Translate_sched_param+0x1c>
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
4da20: 4aaa 0010 tstl %a2@(16)
4da24: 6606 bnes 4da2c <_POSIX_Thread_Translate_sched_param+0x70>
4da26: 4aaa 0014 tstl %a2@(20)
4da2a: 67ac beqs 4d9d8 <_POSIX_Thread_Translate_sched_param+0x1c>
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
4da2c: 486a 0008 pea %a2@(8)
4da30: 49f9 0004 b8f4 lea 4b8f4 <_Timespec_To_ticks>,%a4
4da36: 4e94 jsr %a4@
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
4da38: 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 ) <
4da3c: 2400 movel %d0,%d2
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
4da3e: 4e94 jsr %a4@
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 ) <
4da40: 508f addql #8,%sp
4da42: b082 cmpl %d2,%d0
4da44: 6292 bhis 4d9d8 <_POSIX_Thread_Translate_sched_param+0x1c>
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
4da46: 2f2a 0004 movel %a2@(4),%sp@-
4da4a: 4e93 jsr %a3@
4da4c: 588f addql #4,%sp
4da4e: 4a00 tstb %d0
4da50: 6786 beqs 4d9d8 <_POSIX_Thread_Translate_sched_param+0x1c>
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
4da52: 206e 0010 moveal %fp@(16),%a0
4da56: 7003 moveq #3,%d0
4da58: 2080 movel %d0,%a0@
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
4da5a: 206e 0014 moveal %fp@(20),%a0
return 0;
4da5e: 4280 clrl %d0
}
return EINVAL;
}
4da60: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
4da66: 20bc 0004 7be0 movel #293856,%a0@
return 0;
}
return EINVAL;
}
4da6c: 4e5e unlk %fp
4da6e: 4e75 rts
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
*budget_callout = NULL;
if ( policy == SCHED_OTHER ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4da70: 206e 0010 moveal %fp@(16),%a0
4da74: 7401 moveq #1,%d2
return 0;
4da76: 4280 clrl %d0
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
*budget_callout = NULL;
if ( policy == SCHED_OTHER ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
4da78: 2082 movel %d2,%a0@
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
}
4da7a: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4da80: 4e5e unlk %fp
4da82: 4e75 rts
return 0;
}
if ( policy == SCHED_FIFO ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
4da84: 4280 clrl %d0
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
}
4da86: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4da8c: 4e5e unlk %fp
4da8e: 4e75 rts
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
4da90: 206e 0010 moveal %fp@(16),%a0
4da94: 7202 moveq #2,%d1
return 0;
4da96: 4200 clrb %d0
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
}
4da98: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
4da9e: 2081 movel %d1,%a0@
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
}
4daa0: 4e5e unlk %fp <== NOT EXECUTED
0004c6fe <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
4c6fe: 4e56 ffec linkw %fp,#-20
4c702: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
4c706: 266e 000c moveal %fp@(12),%a3
4c70a: 45f9 0004 a070 lea 4a070 <_Thread_queue_Dequeue>,%a2
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
4c710: 2f0b movel %a3,%sp@-
{
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
4c712: 286b 00fe moveal %a3@(254),%a4
4c716: 240c movel %a4,%d2
4c718: 0682 0000 0044 addil #68,%d2
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
4c71e: 4eb9 0004 e768 jsr 4e768 <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
4c724: 2f0b movel %a3,%sp@-
4c726: 4eb9 0004 e7d4 jsr 4e7d4 <_POSIX_Keys_Run_destructors>
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
4c72c: 262b 0028 movel %a3@(40),%d3
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
4c730: 508f addql #8,%sp
4c732: 2f02 movel %d2,%sp@-
4c734: 4e92 jsr %a2@
4c736: 588f addql #4,%sp
4c738: 4a80 tstl %d0
4c73a: 6712 beqs 4c74e <_POSIX_Threads_Delete_extension+0x50><== ALWAYS TAKEN
*(void **)the_thread->Wait.return_argument = value_ptr;
4c73c: 2240 moveal %d0,%a1 <== NOT EXECUTED
4c73e: 2069 0028 moveal %a1@(40),%a0 <== NOT EXECUTED
4c742: 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 )) )
4c744: 2f02 movel %d2,%sp@- <== NOT EXECUTED
4c746: 4e92 jsr %a2@ <== NOT EXECUTED
4c748: 588f addql #4,%sp <== NOT EXECUTED
4c74a: 4a80 tstl %d0 <== NOT EXECUTED
4c74c: 66ee bnes 4c73c <_POSIX_Threads_Delete_extension+0x3e><== NOT EXECUTED
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
4c74e: 103c 0004 moveb #4,%d0
4c752: b0ac 0084 cmpl %a4@(132),%d0
4c756: 6716 beqs 4c76e <_POSIX_Threads_Delete_extension+0x70>
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
4c758: 42ab 00fe clrl %a3@(254)
_Workspace_Free( api );
4c75c: 2d4c 0008 movel %a4,%fp@(8)
}
4c760: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4c766: 4e5e unlk %fp
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
_Workspace_Free( api );
4c768: 4ef9 0004 acdc jmp 4acdc <_Workspace_Free>
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
4c76e: 486c 00a8 pea %a4@(168)
4c772: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
4c778: 588f addql #4,%sp
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
4c77a: 42ab 00fe clrl %a3@(254)
_Workspace_Free( api );
4c77e: 2d4c 0008 movel %a4,%fp@(8)
}
4c782: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4c788: 4e5e unlk %fp
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
_Workspace_Free( api );
4c78a: 4ef9 0004 acdc jmp 4acdc <_Workspace_Free>
0004787c <_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)
{
4787c: 4e56 ff98 linkw %fp,#-104
47880: 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;
47884: 2479 0006 0966 moveal 60966 <Configuration_POSIX_API+0x34>,%a2
maximum = Configuration_POSIX_API.number_of_initialization_threads;
4788a: 2839 0006 0962 movel 60962 <Configuration_POSIX_API+0x30>,%d4
if ( !user_threads || maximum == 0 )
47890: 4a8a tstl %a2
47892: 6704 beqs 47898 <_POSIX_Threads_Initialize_user_threads_body+0x1c><== NEVER TAKEN
47894: 4a84 tstl %d4
47896: 660a bnes 478a2 <_POSIX_Threads_Initialize_user_threads_body+0x26><== ALWAYS TAKEN
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
47898: 4cee 3c7c ff98 moveml %fp@(-104),%d2-%d6/%a2-%a5 <== NOT EXECUTED
4789e: 4e5e unlk %fp <== NOT EXECUTED
478a0: 4e75 rts <== NOT EXECUTED
478a2: 240e movel %fp,%d2
478a4: 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 )
478a6: 4283 clrl %d3
478a8: 0682 ffff ffc0 addil #-64,%d2
478ae: 2c3c 0004 daa4 movel #318116,%d6
478b4: 4bf9 0004 dad0 lea 4dad0 <pthread_attr_setinheritsched>,%a5
478ba: 49f9 0004 db0c lea 4db0c <pthread_attr_setstacksize>,%a4
478c0: 0685 ffff ffbc addil #-68,%d5
478c6: 47f9 0004 74a8 lea 474a8 <pthread_create>,%a3
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
478cc: 2f02 movel %d2,%sp@-
478ce: 2046 moveal %d6,%a0
478d0: 4e90 jsr %a0@
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
478d2: 4878 0002 pea 2 <DOUBLE_FLOAT>
478d6: 2f02 movel %d2,%sp@-
478d8: 4e95 jsr %a5@
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
478da: 2f2a 0004 movel %a2@(4),%sp@-
478de: 2f02 movel %d2,%sp@-
478e0: 4e94 jsr %a4@
status = pthread_create(
478e2: 42a7 clrl %sp@-
478e4: 2f12 movel %a2@,%sp@-
478e6: 2f02 movel %d2,%sp@-
478e8: 2f05 movel %d5,%sp@-
478ea: 4e93 jsr %a3@
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
478ec: 4fef 0024 lea %sp@(36),%sp
478f0: 4a80 tstl %d0
478f2: 6612 bnes 47906 <_POSIX_Threads_Initialize_user_threads_body+0x8a>
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
478f4: 5283 addql #1,%d3
478f6: 508a addql #8,%a2
478f8: b883 cmpl %d3,%d4
478fa: 66d0 bnes 478cc <_POSIX_Threads_Initialize_user_threads_body+0x50><== NEVER TAKEN
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
478fc: 4cee 3c7c ff98 moveml %fp@(-104),%d2-%d6/%a2-%a5
47902: 4e5e unlk %fp
47904: 4e75 rts
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
47906: 2f00 movel %d0,%sp@-
47908: 4878 0001 pea 1 <ADD>
4790c: 4878 0002 pea 2 <DOUBLE_FLOAT>
47910: 4eb9 0004 9b08 jsr 49b08 <_Internal_error_Occurred>
...
0004c8dc <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
4c8dc: 4e56 fff4 linkw %fp,#-12
4c8e0: 48d7 1c00 moveml %a2-%a4,%sp@
4c8e4: 266e 000c moveal %fp@(12),%a3
the_thread = argument;
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 );
4c8e8: 49f9 0004 d630 lea 4d630 <_Timespec_To_ticks>,%a4
Thread_Control *the_thread;
POSIX_API_Control *api;
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4c8ee: 246b 00fe moveal %a3@(254),%a2
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
4c8f2: 486a 0098 pea %a2@(152)
4c8f6: 4e94 jsr %a4@
*/
#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 ) {
4c8f8: 588f addql #4,%sp
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
4c8fa: 4281 clrl %d1
4c8fc: 1239 0005 f6ec moveb 5f6ec <rtems_maximum_priority>,%d1
4c902: 92aa 0088 subl %a2@(136),%d1
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;
4c906: 2740 0072 movel %d0,%a3@(114)
new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority );
the_thread->real_priority = new_priority;
4c90a: 2741 0018 movel %d1,%a3@(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 ) {
4c90e: 4aab 001c tstl %a3@(28)
4c912: 6606 bnes 4c91a <_POSIX_Threads_Sporadic_budget_TSR+0x3e><== NEVER TAKEN
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
4c914: b2ab 0014 cmpl %a3@(20),%d1
4c918: 652c bcss 4c946 <_POSIX_Threads_Sporadic_budget_TSR+0x6a>
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
4c91a: 486a 0090 pea %a2@(144)
4c91e: 4e94 jsr %a4@
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4c920: 588f addql #4,%sp
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4c922: 2540 00b4 movel %d0,%a2@(180)
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
4c926: 45ea 00a8 lea %a2@(168),%a2
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4c92a: 203c 0006 1082 movel #397442,%d0
4c930: 2d4a 000c movel %a2,%fp@(12)
}
4c934: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4
4c93a: 2d40 0008 movel %d0,%fp@(8)
4c93e: 4e5e unlk %fp
4c940: 4ef9 0004 a970 jmp 4a970 <_Watchdog_Insert>
if ( the_thread->resource_count == 0 ) {
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
_Thread_Change_priority( the_thread, new_priority, true );
4c946: 4878 0001 pea 1 <ADD>
4c94a: 2f01 movel %d1,%sp@-
4c94c: 2f0b movel %a3,%sp@-
4c94e: 4eb9 0004 97ec jsr 497ec <_Thread_Change_priority>
4c954: 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 );
4c958: 486a 0090 pea %a2@(144)
4c95c: 4e94 jsr %a4@
4c95e: 588f addql #4,%sp
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4c960: 2540 00b4 movel %d0,%a2@(180)
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
4c964: 45ea 00a8 lea %a2@(168),%a2
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
4c968: 203c 0006 1082 movel #397442,%d0
4c96e: 2d4a 000c movel %a2,%fp@(12)
}
4c972: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4
4c978: 2d40 0008 movel %d0,%fp@(8)
4c97c: 4e5e unlk %fp
4c97e: 4ef9 0004 a970 jmp 4a970 <_Watchdog_Insert>
0004c984 <_POSIX_Threads_Sporadic_budget_callout>:
4c984: 4280 clrl %d0
/*
* 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 */
4c986: 72ff moveq #-1,%d1
* _POSIX_Threads_Sporadic_budget_callout
*/
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
4c988: 4e56 0000 linkw %fp,#0
4c98c: 206e 0008 moveal %fp@(8),%a0
4c990: 1039 0005 f6ec moveb 5f6ec <rtems_maximum_priority>,%d0
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
4c996: 2268 00fe moveal %a0@(254),%a1
4c99a: 90a9 008c subl %a1@(140),%d0
/*
* 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 */
4c99e: 2141 0072 movel %d1,%a0@(114)
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
4c9a2: 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 ) {
4c9a6: 4aa8 001c tstl %a0@(28)
4c9aa: 6606 bnes 4c9b2 <_POSIX_Threads_Sporadic_budget_callout+0x2e><== 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 ) {
4c9ac: b0a8 0014 cmpl %a0@(20),%d0
4c9b0: 6204 bhis 4c9b6 <_POSIX_Threads_Sporadic_budget_callout+0x32><== ALWAYS TAKEN
#if 0
printk( "lower priority\n" );
#endif
}
}
}
4c9b2: 4e5e unlk %fp <== NOT EXECUTED
4c9b4: 4e75 rts <== NOT EXECUTED
* 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 ) {
_Thread_Change_priority( the_thread, new_priority, true );
4c9b6: 4878 0001 pea 1 <ADD>
4c9ba: 2f00 movel %d0,%sp@-
4c9bc: 2f08 movel %a0,%sp@-
4c9be: 4eb9 0004 97ec jsr 497ec <_Thread_Change_priority>
4c9c4: 4fef 000c lea %sp@(12),%sp
#if 0
printk( "lower priority\n" );
#endif
}
}
}
4c9c8: 4e5e unlk %fp <== NOT EXECUTED
0004e768 <_POSIX_Threads_cancel_run>:
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
handler_stack = &thread_support->Cancellation_Handlers;
thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
4e768: 7001 moveq #1,%d0
#include <rtems/posix/threadsup.h>
void _POSIX_Threads_cancel_run(
Thread_Control *the_thread
)
{
4e76a: 4e56 ffec linkw %fp,#-20
POSIX_Cancel_Handler_control *handler;
Chain_Control *handler_stack;
POSIX_API_Control *thread_support;
ISR_Level level;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
4e76e: 206e 0008 moveal %fp@(8),%a0
#include <rtems/posix/threadsup.h>
void _POSIX_Threads_cancel_run(
Thread_Control *the_thread
)
{
4e772: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
POSIX_Cancel_Handler_control *handler;
Chain_Control *handler_stack;
POSIX_API_Control *thread_support;
ISR_Level level;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
4e776: 2668 00fe moveal %a0@(254),%a3
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4e77a: 240b movel %a3,%d2
4e77c: 49f9 0004 acdc lea 4acdc <_Workspace_Free>,%a4
handler_stack = &thread_support->Cancellation_Handlers;
thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
while ( !_Chain_Is_empty( handler_stack ) ) {
_ISR_Disable( level );
4e782: 263c 0000 0700 movel #1792,%d3
4e788: 0682 0000 00e8 addil #232,%d2
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
handler_stack = &thread_support->Cancellation_Handlers;
thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
4e78e: 2740 00d8 movel %d0,%a3@(216)
while ( !_Chain_Is_empty( handler_stack ) ) {
4e792: b4ab 00e4 cmpl %a3@(228),%d2
4e796: 6730 beqs 4e7c8 <_POSIX_Threads_cancel_run+0x60>
_ISR_Disable( level );
4e798: 2003 movel %d3,%d0
4e79a: 40c1 movew %sr,%d1
4e79c: 8081 orl %d1,%d0
4e79e: 46c0 movew %d0,%sr
handler = (POSIX_Cancel_Handler_control *)
4e7a0: 246b 00ec moveal %a3@(236),%a2
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
4e7a4: 2252 moveal %a2@,%a1
previous = the_node->previous;
4e7a6: 206a 0004 moveal %a2@(4),%a0
next->previous = previous;
4e7aa: 2348 0004 movel %a0,%a1@(4)
previous->next = next;
4e7ae: 2089 movel %a1,%a0@
_Chain_Tail( handler_stack )->previous;
_Chain_Extract_unprotected( &handler->Node );
_ISR_Enable( level );
4e7b0: 46c1 movew %d1,%sr
(*handler->routine)( handler->arg );
4e7b2: 2f2a 000c movel %a2@(12),%sp@-
4e7b6: 206a 0008 moveal %a2@(8),%a0
4e7ba: 4e90 jsr %a0@
_Workspace_Free( handler );
4e7bc: 2f0a movel %a2,%sp@-
4e7be: 4e94 jsr %a4@
handler_stack = &thread_support->Cancellation_Handlers;
thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
while ( !_Chain_Is_empty( handler_stack ) ) {
4e7c0: 508f addql #8,%sp
4e7c2: b4ab 00e4 cmpl %a3@(228),%d2
4e7c6: 66d0 bnes 4e798 <_POSIX_Threads_cancel_run+0x30> <== NEVER TAKEN
(*handler->routine)( handler->arg );
_Workspace_Free( handler );
}
}
4e7c8: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4e7ce: 4e5e unlk %fp
...
00047240 <_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)
{
47240: 4e56 ffec linkw %fp,#-20
47244: 48d7 040c moveml %d2-%d3/%a2,%sp@
47248: 246e 000c moveal %fp@(12),%a2
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
4724c: 52aa 0066 addql #1,%a2@(102)
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
47250: 4aaa 0052 tstl %a2@(82)
47254: 6606 bnes 4725c <_POSIX_Timer_TSR+0x1c>
47256: 4aaa 0056 tstl %a2@(86)
4725a: 672c beqs 47288 <_POSIX_Timer_TSR+0x48> <== NEVER TAKEN
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
4725c: 2f0a movel %a2,%sp@-
4725e: 4879 0004 7240 pea 47240 <_POSIX_Timer_TSR>
47264: 2f2a 0008 movel %a2@(8),%sp@-
47268: 2f2a 0062 movel %a2@(98),%sp@-
4726c: 486a 0010 pea %a2@(16)
47270: 4eb9 0004 d33c jsr 4d33c <_POSIX_Timer_Insert_helper>
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
47276: 4fef 0014 lea %sp@(20),%sp
4727a: 4a00 tstb %d0
4727c: 662e bnes 472ac <_POSIX_Timer_TSR+0x6c>
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
}
4727e: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 <== NOT EXECUTED
47284: 4e5e unlk %fp <== NOT EXECUTED
47286: 4e75 rts <== NOT EXECUTED
/* The state really did not change but just to be safe */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
} else {
/* Indicates that the timer is stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
47288: 7004 moveq #4,%d0 <== NOT EXECUTED
4728a: 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 ) ) {
4728e: 2f2a 0042 movel %a2@(66),%sp@- <== NOT EXECUTED
47292: 2f2a 0038 movel %a2@(56),%sp@- <== NOT EXECUTED
47296: 4eb9 0004 ce74 jsr 4ce74 <pthread_kill> <== NOT EXECUTED
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
4729c: 508f addql #8,%sp <== NOT EXECUTED
4729e: 42aa 0066 clrl %a2@(102) <== NOT EXECUTED
}
472a2: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
472a8: 4e5e unlk %fp
472aa: 4e75 rts
472ac: 4879 0006 1b48 pea 61b48 <_TOD>
472b2: 486e fff8 pea %fp@(-8)
472b6: 4eb9 0004 8bc8 jsr 48bc8 <_TOD_Get_with_nanoseconds>
472bc: 2040 moveal %d0,%a0
472be: 2410 movel %a0@,%d2
472c0: 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);
472c4: 2f3c 3b9a ca00 movel #1000000000,%sp@-
472ca: 42a7 clrl %sp@-
472cc: 2f03 movel %d3,%sp@-
472ce: 2f02 movel %d2,%sp@-
472d0: 4eb9 0005 c398 jsr 5c398 <__divdi3>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
472d6: 4fef 000c lea %sp@(12),%sp
472da: 2ebc 3b9a ca00 movel #1000000000,%sp@
472e0: 42a7 clrl %sp@-
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
472e2: 2541 006a movel %d1,%a2@(106)
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
472e6: 2f03 movel %d3,%sp@-
472e8: 2f02 movel %d2,%sp@-
472ea: 4eb9 0005 c7f8 jsr 5c7f8 <__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;
472f0: 4fef 0018 lea %sp@(24),%sp
472f4: 7003 moveq #3,%d0
472f6: 2541 006e movel %d1,%a2@(110)
472fa: 1540 003c moveb %d0,%a2@(60)
/*
* 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 ) ) {
472fe: 2f2a 0042 movel %a2@(66),%sp@-
47302: 2f2a 0038 movel %a2@(56),%sp@-
47306: 4eb9 0004 ce74 jsr 4ce74 <pthread_kill>
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
4730c: 508f addql #8,%sp
4730e: 42aa 0066 clrl %a2@(102)
47312: 608e bras 472a2 <_POSIX_Timer_TSR+0x62>
0004ef90 <_POSIX_signals_Clear_process_signals>:
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
4ef90: 223c 0000 0700 movel #1792,%d1
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
4ef96: 4e56 0000 linkw %fp,#0
4ef9a: 202e 0008 movel %fp@(8),%d0
4ef9e: 2f03 movel %d3,%sp@-
4efa0: 2600 movel %d0,%d3
4efa2: 5383 subql #1,%d3
4efa4: 2f02 movel %d2,%sp@-
4efa6: 7401 moveq #1,%d2
4efa8: e7aa lsll %d3,%d2
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
4efaa: 40c3 movew %sr,%d3
4efac: 8283 orl %d3,%d1
4efae: 46c1 movew %d1,%sr
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
4efb0: 2200 movel %d0,%d1
4efb2: 41f9 0006 1468 lea 61468 <_POSIX_signals_Vectors>,%a0
4efb8: e589 lsll #2,%d1
4efba: e988 lsll #4,%d0
4efbc: 9081 subl %d1,%d0
4efbe: 7202 moveq #2,%d1
4efc0: b2b0 0800 cmpl %a0@(00000000,%d0:l),%d1
4efc4: 6712 beqs 4efd8 <_POSIX_signals_Clear_process_signals+0x48>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
4efc6: 4682 notl %d2
4efc8: c5b9 0006 165c andl %d2,6165c <_POSIX_signals_Pending>
}
_ISR_Enable( level );
4efce: 46c3 movew %d3,%sr
}
4efd0: 241f movel %sp@+,%d2
4efd2: 261f movel %sp@+,%d3
4efd4: 4e5e unlk %fp
4efd6: 4e75 rts
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
4efd8: 2040 moveal %d0,%a0
4efda: d1fc 0006 1660 addal #398944,%a0
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4efe0: 2008 movel %a0,%d0
4efe2: 5880 addql #4,%d0
4efe4: b090 cmpl %a0@,%d0
4efe6: 67de beqs 4efc6 <_POSIX_signals_Clear_process_signals+0x36><== ALWAYS TAKEN
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
4efe8: 46c3 movew %d3,%sr <== NOT EXECUTED
}
4efea: 241f movel %sp@+,%d2 <== NOT EXECUTED
4efec: 261f movel %sp@+,%d3 <== NOT EXECUTED
4efee: 4e5e unlk %fp <== NOT EXECUTED
...
00048000 <_POSIX_signals_Get_lowest>:
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
48000: 701b moveq #27,%d0
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
sigset_t set
)
{
48002: 4e56 fff4 linkw %fp,#-12
48006: 48d7 001c moveml %d2-%d4,%sp@
4800a: 242e 0008 movel %fp@(8),%d2
4800e: 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(
48010: 2200 movel %d0,%d1
48012: 5381 subql #1,%d1
48014: 2803 movel %d3,%d4
48016: e3ac lsll %d1,%d4
48018: 2204 movel %d4,%d1
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
if ( set & signo_to_mask( signo ) ) {
4801a: c282 andl %d2,%d1
4801c: 6626 bnes 48044 <_POSIX_signals_Get_lowest+0x44> <== NEVER TAKEN
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4801e: 5280 addql #1,%d0
48020: 123c 0020 moveb #32,%d1
48024: b280 cmpl %d0,%d1
48026: 66e8 bnes 48010 <_POSIX_signals_Get_lowest+0x10>
48028: 7001 moveq #1,%d0
4802a: 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(
4802c: 2200 movel %d0,%d1
4802e: 5381 subql #1,%d1
48030: 2803 movel %d3,%d4
48032: e3ac lsll %d1,%d4
48034: 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 ) ) {
48036: c282 andl %d2,%d1
48038: 660a bnes 48044 <_POSIX_signals_Get_lowest+0x44>
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
4803a: 5280 addql #1,%d0
4803c: 123c 001b moveb #27,%d1
48040: b280 cmpl %d0,%d1
48042: 66e8 bnes 4802c <_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;
}
48044: 4cd7 001c moveml %sp@,%d2-%d4
48048: 4e5e unlk %fp <== NOT EXECUTED
0004c480 <_POSIX_signals_Post_switch_hook>:
*/
static void _POSIX_signals_Post_switch_hook(
Thread_Control *the_thread
)
{
4c480: 4e56 ffec linkw %fp,#-20
4c484: 206e 0008 moveal %fp@(8),%a0
4c488: 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 ];
4c48c: 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;
4c490: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
4c496: 2828 0034 movel %a0@(52),%d4
/*
* api may be NULL in case of a thread close in progress
*/
if ( !api )
4c49a: 4a8a tstl %a2
4c49c: 6700 0098 beqw 4c536 <_POSIX_signals_Post_switch_hook+0xb6>
*
* 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 );
4c4a0: 263c 0000 0700 movel #1792,%d3
4c4a6: 47f9 0004 e860 lea 4e860 <_POSIX_signals_Check_signal>,%a3
4c4ac: 2003 movel %d3,%d0
4c4ae: 40c1 movew %sr,%d1
4c4b0: 8081 orl %d1,%d0
4c4b2: 46c0 movew %d0,%sr
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
4c4b4: 2039 0006 165c movel 6165c <_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 &
4c4ba: 242a 00d0 movel %a2@(208),%d2
4c4be: 4682 notl %d2
(api->signals_pending | _POSIX_signals_Pending)) ) {
4c4c0: 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 &
4c4c4: c082 andl %d2,%d0
(api->signals_pending | _POSIX_signals_Pending)) ) {
_ISR_Enable( level );
4c4c6: 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 &
4c4c8: 4a80 tstl %d0
4c4ca: 6760 beqs 4c52c <_POSIX_signals_Post_switch_hook+0xac>
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4c4cc: 741b moveq #27,%d2
_POSIX_signals_Check_signal( api, signo, false );
4c4ce: 42a7 clrl %sp@-
4c4d0: 2f02 movel %d2,%sp@-
4c4d2: 2f0a movel %a2,%sp@-
4c4d4: 4e93 jsr %a3@
_POSIX_signals_Check_signal( api, signo, true );
4c4d6: 4878 0001 pea 1 <ADD>
4c4da: 2f02 movel %d2,%sp@-
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4c4dc: 5282 addql #1,%d2
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
4c4de: 2f0a movel %a2,%sp@-
4c4e0: 4e93 jsr %a3@
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
4c4e2: 4fef 0018 lea %sp@(24),%sp
4c4e6: 7020 moveq #32,%d0
4c4e8: b082 cmpl %d2,%d0
4c4ea: 66e2 bnes 4c4ce <_POSIX_signals_Post_switch_hook+0x4e>
4c4ec: 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 );
4c4ee: 42a7 clrl %sp@-
4c4f0: 2f02 movel %d2,%sp@-
4c4f2: 2f0a movel %a2,%sp@-
4c4f4: 4e93 jsr %a3@
_POSIX_signals_Check_signal( api, signo, true );
4c4f6: 4878 0001 pea 1 <ADD>
4c4fa: 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++ ) {
4c4fc: 5282 addql #1,%d2
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
4c4fe: 2f0a movel %a2,%sp@-
4c500: 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++ ) {
4c502: 4fef 0018 lea %sp@(24),%sp
4c506: 701b moveq #27,%d0
4c508: b082 cmpl %d2,%d0
4c50a: 67a0 beqs 4c4ac <_POSIX_signals_Post_switch_hook+0x2c><== NEVER TAKEN
_POSIX_signals_Check_signal( api, signo, false );
4c50c: 42a7 clrl %sp@-
4c50e: 2f02 movel %d2,%sp@-
4c510: 2f0a movel %a2,%sp@-
4c512: 4e93 jsr %a3@
_POSIX_signals_Check_signal( api, signo, true );
4c514: 4878 0001 pea 1 <ADD>
4c518: 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++ ) {
4c51a: 5282 addql #1,%d2
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
4c51c: 2f0a movel %a2,%sp@-
4c51e: 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++ ) {
4c520: 4fef 0018 lea %sp@(24),%sp
4c524: 701b moveq #27,%d0
4c526: b082 cmpl %d2,%d0
4c528: 66c4 bnes 4c4ee <_POSIX_signals_Post_switch_hook+0x6e>
4c52a: 6080 bras 4c4ac <_POSIX_signals_Post_switch_hook+0x2c>
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
4c52c: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
4c532: 2144 0034 movel %d4,%a0@(52)
}
4c536: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
4c53c: 4e5e unlk %fp <== NOT EXECUTED
0005d2a8 <_POSIX_signals_Unblock_thread>:
5d2a8: 7001 moveq #1,%d0
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
5d2aa: 4e56 fff4 linkw %fp,#-12
5d2ae: 48d7 040c moveml %d2-%d3/%a2,%sp@
5d2b2: 246e 0008 moveal %fp@(8),%a2
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
5d2b6: 222a 0010 movel %a2@(16),%d1
5d2ba: 2401 movel %d1,%d2
5d2bc: 262e 000c movel %fp@(12),%d3
5d2c0: 5383 subql #1,%d3
5d2c2: 0282 1000 8000 andil #268468224,%d2
{
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
5d2c8: 206a 00fe moveal %a2@(254),%a0
5d2cc: e7a8 lsll %d3,%d0
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
5d2ce: 0c82 1000 8000 cmpil #268468224,%d2
5d2d4: 6776 beqs 5d34c <_POSIX_signals_Unblock_thread+0xa4>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
5d2d6: 2428 00d0 movel %a0@(208),%d2
5d2da: 4682 notl %d2
5d2dc: c082 andl %d2,%d0
5d2de: 6760 beqs 5d340 <_POSIX_signals_Unblock_thread+0x98>
* 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 ) ) {
5d2e0: 0801 001c btst #28,%d1
5d2e4: 673e beqs 5d324 <_POSIX_signals_Unblock_thread+0x7c>
the_thread->Wait.return_code = EINTR;
5d2e6: 7004 moveq #4,%d0
5d2e8: 2540 0034 movel %d0,%a2@(52)
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
5d2ec: 2001 movel %d1,%d0
5d2ee: 0280 0003 bee0 andil #245472,%d0
/*
* 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) )
5d2f4: 6600 00aa bnew 5d3a0 <_POSIX_signals_Unblock_thread+0xf8>
_Thread_queue_Extract_with_proxy( the_thread );
else if ( _States_Is_delaying(the_thread->current_state) ) {
5d2f8: 44c1 movew %d1,%ccr
5d2fa: 6a44 bpls 5d340 <_POSIX_signals_Unblock_thread+0x98><== NEVER TAKEN
(void) _Watchdog_Remove( &the_thread->Timer );
5d2fc: 486a 0048 pea %a2@(72)
5d300: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
5d306: 2f3c 1007 fff8 movel #268959736,%sp@-
5d30c: 2f0a movel %a2,%sp@-
5d30e: 4eb9 0004 98d0 jsr 498d0 <_Thread_Clear_state>
5d314: 4fef 000c lea %sp@(12),%sp
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
}
5d318: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
5d31e: 4200 clrb %d0
}
5d320: 4e5e unlk %fp
5d322: 4e75 rts
else if ( _States_Is_delaying(the_thread->current_state) ) {
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
5d324: 4a81 tstl %d1
5d326: 6618 bnes 5d340 <_POSIX_signals_Unblock_thread+0x98><== NEVER TAKEN
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
5d328: 4ab9 0006 1428 tstl 61428 <_Per_CPU_Information+0x8>
5d32e: 6710 beqs 5d340 <_POSIX_signals_Unblock_thread+0x98>
5d330: b5f9 0006 142e cmpal 6142e <_Per_CPU_Information+0xe>,%a2
5d336: 6608 bnes 5d340 <_POSIX_signals_Unblock_thread+0x98><== NEVER TAKEN
_Thread_Dispatch_necessary = true;
5d338: 7001 moveq #1,%d0
5d33a: 13c0 0006 142c moveb %d0,6142c <_Per_CPU_Information+0xc>
}
}
return false;
}
5d340: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
5d346: 4200 clrb %d0
}
5d348: 4e5e unlk %fp
5d34a: 4e75 rts
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
5d34c: 2200 movel %d0,%d1
5d34e: c2aa 0030 andl %a2@(48),%d1
5d352: 6730 beqs 5d384 <_POSIX_signals_Unblock_thread+0xdc>
the_thread->Wait.return_code = EINTR;
5d354: 7004 moveq #4,%d0
the_info = (siginfo_t *) the_thread->Wait.return_argument;
5d356: 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;
5d35a: 2540 0034 movel %d0,%a2@(52)
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
5d35e: 4aae 0010 tstl %fp@(16)
5d362: 6752 beqs 5d3b6 <_POSIX_signals_Unblock_thread+0x10e>
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
5d364: 226e 0010 moveal %fp@(16),%a1
5d368: 20d9 movel %a1@+,%a0@+
5d36a: 20d9 movel %a1@+,%a0@+
5d36c: 2091 movel %a1@,%a0@
}
_Thread_queue_Extract_with_proxy( the_thread );
5d36e: 2f0a movel %a2,%sp@-
5d370: 4eb9 0004 a444 jsr 4a444 <_Thread_queue_Extract_with_proxy>
return true;
5d376: 588f addql #4,%sp
5d378: 7001 moveq #1,%d0
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
}
5d37a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
5d380: 4e5e unlk %fp
5d382: 4e75 rts
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
5d384: 2228 00d0 movel %a0@(208),%d1
5d388: 4681 notl %d1
5d38a: c081 andl %d1,%d0
5d38c: 67b2 beqs 5d340 <_POSIX_signals_Unblock_thread+0x98>
the_thread->Wait.return_code = EINTR;
5d38e: 7004 moveq #4,%d0
the_info = (siginfo_t *) the_thread->Wait.return_argument;
5d390: 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;
5d394: 2540 0034 movel %d0,%a2@(52)
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
5d398: 4aae 0010 tstl %fp@(16)
5d39c: 66c6 bnes 5d364 <_POSIX_signals_Unblock_thread+0xbc><== ALWAYS TAKEN
5d39e: 6016 bras 5d3b6 <_POSIX_signals_Unblock_thread+0x10e><== NOT EXECUTED
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
_Thread_queue_Extract_with_proxy( the_thread );
5d3a0: 2f0a movel %a2,%sp@-
5d3a2: 4eb9 0004 a444 jsr 4a444 <_Thread_queue_Extract_with_proxy>
5d3a8: 588f addql #4,%sp
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
}
5d3aa: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
5d3b0: 4200 clrb %d0
}
5d3b2: 4e5e unlk %fp
5d3b4: 4e75 rts
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
5d3b6: 20ae 000c movel %fp@(12),%a0@
the_info->si_code = SI_USER;
5d3ba: 103c 0001 moveb #1,%d0
the_info->si_value.sival_int = 0;
5d3be: 42a8 0008 clrl %a0@(8)
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
5d3c2: 2140 0004 movel %d0,%a0@(4)
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
}
_Thread_queue_Extract_with_proxy( the_thread );
5d3c6: 2f0a movel %a2,%sp@-
5d3c8: 4eb9 0004 a444 jsr 4a444 <_Thread_queue_Extract_with_proxy>
return true;
5d3ce: 588f addql #4,%sp
5d3d0: 7001 moveq #1,%d0
5d3d2: 60a6 bras 5d37a <_POSIX_signals_Unblock_thread+0xd2>
0004e31c <_Protected_heap_Walk>:
bool _Protected_heap_Walk(
Heap_Control *the_heap,
int source,
bool do_dump
)
{
4e31c: 4e56 fff0 linkw %fp,#-16
* This routine returns true if thread dispatch indicates
* that we are in a critical section.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void)
{
if ( _Thread_Dispatch_disable_level == 0 )
4e320: 2039 0006 75b2 movel 675b2 <_Thread_Dispatch_disable_level>,%d0
4e326: 48d7 001c moveml %d2-%d4,%sp@
4e32a: 262e 0008 movel %fp@(8),%d3
4e32e: 282e 000c movel %fp@(12),%d4
4e332: 142e 0013 moveb %fp@(19),%d2
4e336: 4a80 tstl %d0
4e338: 6640 bnes 4e37a <_Protected_heap_Walk+0x5e>
* a critical section, it should be safe to walk it unlocked.
*
* NOTE: Dispatching is also disabled during initialization.
*/
if ( _Thread_Dispatch_in_critical_section() == false ) {
_RTEMS_Lock_allocator();
4e33a: 2f39 0006 7636 movel 67636 <_RTEMS_Allocator_Mutex>,%sp@-
status = _Heap_Walk( the_heap, source, do_dump );
4e340: 0282 0000 00ff andil #255,%d2
* a critical section, it should be safe to walk it unlocked.
*
* NOTE: Dispatching is also disabled during initialization.
*/
if ( _Thread_Dispatch_in_critical_section() == false ) {
_RTEMS_Lock_allocator();
4e346: 4eb9 0004 c300 jsr 4c300 <_API_Mutex_Lock>
status = _Heap_Walk( the_heap, source, do_dump );
4e34c: 2f02 movel %d2,%sp@-
4e34e: 2f04 movel %d4,%sp@-
4e350: 2f03 movel %d3,%sp@-
4e352: 4eb9 0004 d40a jsr 4d40a <_Heap_Walk>
_RTEMS_Unlock_allocator();
4e358: 2f39 0006 7636 movel 67636 <_RTEMS_Allocator_Mutex>,%sp@-
4e35e: 2d40 fffc movel %d0,%fp@(-4)
4e362: 4eb9 0004 c360 jsr 4c360 <_API_Mutex_Unlock>
4e368: 202e fffc movel %fp@(-4),%d0
4e36c: 4fef 0014 lea %sp@(20),%sp
} else {
status = _Heap_Walk( the_heap, source, do_dump );
}
return status;
}
4e370: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4
4e376: 4e5e unlk %fp
4e378: 4e75 rts
if ( _Thread_Dispatch_in_critical_section() == false ) {
_RTEMS_Lock_allocator();
status = _Heap_Walk( the_heap, source, do_dump );
_RTEMS_Unlock_allocator();
} else {
status = _Heap_Walk( the_heap, source, do_dump );
4e37a: 2d44 000c movel %d4,%fp@(12)
4e37e: 0282 0000 00ff andil #255,%d2
4e384: 2d43 0008 movel %d3,%fp@(8)
4e388: 2d42 0010 movel %d2,%fp@(16)
}
return status;
}
4e38c: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4
4e392: 4e5e unlk %fp
if ( _Thread_Dispatch_in_critical_section() == false ) {
_RTEMS_Lock_allocator();
status = _Heap_Walk( the_heap, source, do_dump );
_RTEMS_Unlock_allocator();
} else {
status = _Heap_Walk( the_heap, source, do_dump );
4e394: 4ef9 0004 d40a jmp 4d40a <_Heap_Walk>
...
00049fbe <_RBTree_Extract_unprotected>:
*/
void _RBTree_Extract_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
49fbe: 4e56 ffec linkw %fp,#-20
49fc2: 48d7 3c04 moveml %d2/%a2-%a5,%sp@
49fc6: 2a6e 0008 moveal %fp@(8),%a5
49fca: 266e 000c moveal %fp@(12),%a3
RBTree_Node *leaf, *target;
RBTree_Color victim_color;
RBTree_Direction dir;
if (!the_node) return;
49fce: 4a8b tstl %a3
49fd0: 6700 00b0 beqw 4a082 <_RBTree_Extract_unprotected+0xc4>
/* check if min needs to be updated */
if (the_node == the_rbtree->first[RBT_LEFT]) {
49fd4: b7ed 0008 cmpal %a5@(8),%a3
49fd8: 6700 00d2 beqw 4a0ac <_RBTree_Extract_unprotected+0xee>
the_rbtree->first[RBT_LEFT] = next;
}
/* 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]) {
49fdc: b7ed 000c cmpal %a5@(12),%a3
49fe0: 6700 00e4 beqw 4a0c6 <_RBTree_Extract_unprotected+0x108>
* 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]) {
49fe4: 246b 0004 moveal %a3@(4),%a2
49fe8: 4a8a tstl %a2
49fea: 6700 00f4 beqw 4a0e0 <_RBTree_Extract_unprotected+0x122>
49fee: 4aab 0008 tstl %a3@(8)
49ff2: 6700 0098 beqw 4a08c <_RBTree_Extract_unprotected+0xce>
target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */
while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT];
49ff6: 202a 0008 movel %a2@(8),%d0
49ffa: 6708 beqs 4a004 <_RBTree_Extract_unprotected+0x46>
49ffc: 2440 moveal %d0,%a2
49ffe: 202a 0008 movel %a2@(8),%d0
4a002: 66f8 bnes 49ffc <_RBTree_Extract_unprotected+0x3e>
* 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];
4a004: 286a 0004 moveal %a2@(4),%a4
if(leaf) {
4a008: 4a8c tstl %a4
4a00a: 6700 00fc beqw 4a108 <_RBTree_Extract_unprotected+0x14a>
leaf->parent = target->parent;
4a00e: 2892 movel %a2@,%a4@
} 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];
4a010: 2252 moveal %a2@,%a1
4a012: b5e9 0004 cmpal %a1@(4),%a2
4a016: 56c0 sne %d0
target->parent->child[dir] = leaf;
4a018: 7201 moveq #1,%d1
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = target;
4a01a: 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];
4a01c: 49c0 extbl %d0
target->parent->child[dir] = leaf;
4a01e: 9280 subl %d0,%d1
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
4a020: 2053 moveal %a3@,%a0
/* 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];
target->parent->child[dir] = leaf;
4a022: 238c 1c00 movel %a4,%a1@(00000000,%d1:l:4)
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
4a026: b7e8 0004 cmpal %a0@(4),%a3
4a02a: 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;
4a02c: 202a 000c movel %a2@(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];
4a030: 49c1 extbl %d1
the_node->parent->child[dir] = target;
4a032: 9481 subl %d1,%d2
4a034: 218a 2c00 movel %a2,%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];
4a038: 256b 0008 0008 movel %a3@(8),%a2@(8)
if (the_node->child[RBT_RIGHT])
4a03e: 206b 0008 moveal %a3@(8),%a0
4a042: 4a88 tstl %a0
4a044: 6702 beqs 4a048 <_RBTree_Extract_unprotected+0x8a><== NEVER TAKEN
the_node->child[RBT_RIGHT]->parent = target;
4a046: 208a movel %a2,%a0@
target->child[RBT_LEFT] = the_node->child[RBT_LEFT];
4a048: 256b 0004 0004 movel %a3@(4),%a2@(4)
if (the_node->child[RBT_LEFT])
4a04e: 206b 0004 moveal %a3@(4),%a0
4a052: 4a88 tstl %a0
4a054: 6702 beqs 4a058 <_RBTree_Extract_unprotected+0x9a>
the_node->child[RBT_LEFT]->parent = target;
4a056: 208a movel %a2,%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;
4a058: 2493 movel %a3@,%a2@
target->color = the_node->color;
4a05a: 256b 000c 000c movel %a3@(12),%a2@(12)
/* 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 */
4a060: 4a80 tstl %d0
4a062: 6608 bnes 4a06c <_RBTree_Extract_unprotected+0xae>
if (leaf) {
4a064: 4a8c tstl %a4
4a066: 6704 beqs 4a06c <_RBTree_Extract_unprotected+0xae>
leaf->color = RBT_BLACK; /* case 2 */
4a068: 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;
4a06c: 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;
4a070: 42ab 0008 clrl %a3@(8)
4a074: 42ab 0004 clrl %a3@(4)
4a078: 4293 clrl %a3@
4a07a: 4a88 tstl %a0
4a07c: 6704 beqs 4a082 <_RBTree_Extract_unprotected+0xc4>
4a07e: 42a8 000c clrl %a0@(12)
}
4a082: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
4a088: 4e5e unlk %fp
4a08a: 4e75 rts
* 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]) {
4a08c: 284a moveal %a2,%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;
4a08e: 2893 movel %a3@,%a4@
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = leaf;
4a090: 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];
4a092: 2053 moveal %a3@,%a0
4a094: b7e8 0004 cmpal %a0@(4),%a3
4a098: 56c1 sne %d1
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;
4a09a: 202b 000c movel %a3@(12),%d0
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
4a09e: 49c1 extbl %d1
the_node->parent->child[dir] = leaf;
4a0a0: 9481 subl %d1,%d2
4a0a2: 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 */
4a0a6: 4a80 tstl %d0
4a0a8: 66c2 bnes 4a06c <_RBTree_Extract_unprotected+0xae>
4a0aa: 60b8 bras 4a064 <_RBTree_Extract_unprotected+0xa6>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_RIGHT );
4a0ac: 4878 0001 pea 1 <ADD>
4a0b0: 2f0b movel %a3,%sp@-
4a0b2: 4eb9 0004 a3c0 jsr 4a3c0 <_RBTree_Next_unprotected>
/* check if min needs to be updated */
if (the_node == the_rbtree->first[RBT_LEFT]) {
RBTree_Node *next;
next = _RBTree_Successor_unprotected(the_node);
the_rbtree->first[RBT_LEFT] = next;
4a0b8: 508f addql #8,%sp
4a0ba: 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]) {
4a0be: b7ed 000c cmpal %a5@(12),%a3
4a0c2: 6600 ff20 bnew 49fe4 <_RBTree_Extract_unprotected+0x26>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_LEFT );
4a0c6: 42a7 clrl %sp@-
4a0c8: 2f0b movel %a3,%sp@-
4a0ca: 4eb9 0004 a3c0 jsr 4a3c0 <_RBTree_Next_unprotected>
* 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]) {
4a0d0: 246b 0004 moveal %a3@(4),%a2
/* 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]) {
RBTree_Node *previous;
previous = _RBTree_Predecessor_unprotected(the_node);
the_rbtree->first[RBT_RIGHT] = previous;
4a0d4: 508f addql #8,%sp
4a0d6: 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]) {
4a0da: 4a8a tstl %a2
4a0dc: 6600 ff10 bnew 49fee <_RBTree_Extract_unprotected+0x30>
* 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];
4a0e0: 286b 0008 moveal %a3@(8),%a4
if( leaf ) {
4a0e4: 4a8c tstl %a4
4a0e6: 66a6 bnes 4a08e <_RBTree_Extract_unprotected+0xd0>
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
4a0e8: 2f0b movel %a3,%sp@-
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = leaf;
4a0ea: 7401 moveq #1,%d2
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
4a0ec: 4eba fcc2 jsr %pc@(49db0 <_RBTree_Extract_validate_unprotected>)
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
4a0f0: 2053 moveal %a3@,%a0
4a0f2: b7e8 0004 cmpal %a0@(4),%a3
4a0f6: 56c1 sne %d1
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;
4a0f8: 202b 000c movel %a3@(12),%d0
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
4a0fc: 49c1 extbl %d1
the_node->parent->child[dir] = leaf;
4a0fe: 9481 subl %d1,%d2
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
4a100: 588f addql #4,%sp
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = leaf;
4a102: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4)
4a106: 609e bras 4a0a6 <_RBTree_Extract_unprotected+0xe8>
leaf = target->child[RBT_LEFT];
if(leaf) {
leaf->parent = target->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
4a108: 2f0a movel %a2,%sp@-
4a10a: 4eba fca4 jsr %pc@(49db0 <_RBTree_Extract_validate_unprotected>)
4a10e: 588f addql #4,%sp
4a110: 6000 fefe braw 4a010 <_RBTree_Extract_unprotected+0x52>
00049db0 <_RBTree_Extract_validate_unprotected>:
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
RBTree_Node *the_node
)
{
49db0: 4e56 ffec linkw %fp,#-20
49db4: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
49db8: 266e 0008 moveal %fp@(8),%a3
RBTree_Node *parent, *sibling;
RBTree_Direction dir;
parent = the_node->parent;
49dbc: 2053 moveal %a3@,%a0
if(!parent->parent) return;
49dbe: 4a90 tstl %a0@
49dc0: 677e beqs 49e40 <_RBTree_Extract_validate_unprotected+0x90>
{
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])
49dc2: 2268 0004 moveal %a0@(4),%a1
49dc6: b3cb cmpal %a3,%a1
49dc8: 6700 01de beqw 49fa8 <_RBTree_Extract_validate_unprotected+0x1f8>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
49dcc: 7401 moveq #1,%d2
49dce: b4ab 000c cmpl %a3@(12),%d2
49dd2: 6764 beqs 49e38 <_RBTree_Extract_validate_unprotected+0x88>
sibling = _RBTree_Sibling(the_node);
/* continue to correct tree as long as the_node is black and not the root */
while (!_RBTree_Is_red(the_node) && parent->parent) {
49dd4: 4a90 tstl %a0@
49dd6: 6760 beqs 49e38 <_RBTree_Extract_validate_unprotected+0x88>
49dd8: 4a89 tstl %a1
49dda: 670a beqs 49de6 <_RBTree_Extract_validate_unprotected+0x36><== NEVER TAKEN
49ddc: 7001 moveq #1,%d0
49dde: b0a9 000c cmpl %a1@(12),%d0
49de2: 6700 011c beqw 49f00 <_RBTree_Extract_validate_unprotected+0x150>
_RBTree_Rotate(parent, dir);
sibling = parent->child[_RBTree_Opposite_direction(dir)];
}
/* sibling is black, see if both of its children are also black. */
if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) &&
49de6: 2469 0008 moveal %a1@(8),%a2
49dea: 4a8a tstl %a2
49dec: 6708 beqs 49df6 <_RBTree_Extract_validate_unprotected+0x46>
49dee: 7601 moveq #1,%d3
49df0: b6aa 000c cmpl %a2@(12),%d3
49df4: 6752 beqs 49e48 <_RBTree_Extract_validate_unprotected+0x98>
!_RBTree_Is_red(sibling->child[RBT_LEFT])) {
49df6: 2469 0004 moveal %a1@(4),%a2
49dfa: 4a8a tstl %a2
49dfc: 6708 beqs 49e06 <_RBTree_Extract_validate_unprotected+0x56>
49dfe: 7001 moveq #1,%d0
49e00: b0aa 000c cmpl %a2@(12),%d0
49e04: 6742 beqs 49e48 <_RBTree_Extract_validate_unprotected+0x98>
sibling->color = RBT_RED;
49e06: 7001 moveq #1,%d0
49e08: 2340 000c movel %d0,%a1@(12)
49e0c: b0a8 000c cmpl %a0@(12),%d0
49e10: 6700 019e beqw 49fb0 <_RBTree_Extract_validate_unprotected+0x200>
if (_RBTree_Is_red(parent)) {
parent->color = RBT_BLACK;
break;
}
the_node = parent; /* done if parent is red */
parent = the_node->parent;
49e14: 2450 moveal %a0@,%a2
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
49e16: 4a8a tstl %a2
49e18: 6700 0154 beqw 49f6e <_RBTree_Extract_validate_unprotected+0x1be>
if(!(the_node->parent->parent)) return NULL;
49e1c: 4a92 tstl %a2@
49e1e: 6700 014e beqw 49f6e <_RBTree_Extract_validate_unprotected+0x1be>
if(the_node == the_node->parent->child[RBT_LEFT])
49e22: 226a 0004 moveal %a2@(4),%a1
49e26: b3c8 cmpal %a0,%a1
49e28: 6700 0138 beqw 49f62 <_RBTree_Extract_validate_unprotected+0x1b2>
49e2c: 2648 moveal %a0,%a3
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
49e2e: 204a moveal %a2,%a0
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
49e30: 7401 moveq #1,%d2
49e32: b4ab 000c cmpl %a3@(12),%d2
49e36: 669c bnes 49dd4 <_RBTree_Extract_validate_unprotected+0x24><== ALWAYS TAKEN
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
_RBTree_Rotate(parent, dir);
break; /* done */
}
} /* while */
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
49e38: 2053 moveal %a3@,%a0
49e3a: 4a90 tstl %a0@
49e3c: 6700 0140 beqw 49f7e <_RBTree_Extract_validate_unprotected+0x1ce>
}
49e40: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4
49e44: 4e5e unlk %fp
49e46: 4e75 rts
* cases, either the_node is to the left or the right of the parent.
* In both cases, first check if one of sibling's children is black,
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
49e48: b7e8 0004 cmpal %a0@(4),%a3
49e4c: 56c0 sne %d0
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
49e4e: 7201 moveq #1,%d1
49e50: 4480 negl %d0
49e52: b181 eorl %d0,%d1
49e54: 0280 0000 00ff andil #255,%d0
49e5a: 0281 0000 00ff andil #255,%d1
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
49e60: 5281 addql #1,%d1
49e62: 2471 1c00 moveal %a1@(00000000,%d1:l:4),%a2
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
49e66: 4a8a tstl %a2
49e68: 670a beqs 49e74 <_RBTree_Extract_validate_unprotected+0xc4>
49e6a: 7401 moveq #1,%d2
49e6c: b4aa 000c cmpl %a2@(12),%d2
49e70: 6700 0118 beqw 49f8a <_RBTree_Extract_validate_unprotected+0x1da>
sibling->color = RBT_RED;
sibling->child[dir]->color = RBT_BLACK;
49e74: 5280 addql #1,%d0
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
49e76: 7401 moveq #1,%d2
sibling->child[dir]->color = RBT_BLACK;
49e78: 2471 0c00 moveal %a1@(00000000,%d0:l:4),%a2
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
49e7c: 2342 000c movel %d2,%a1@(12)
sibling->child[dir]->color = RBT_BLACK;
49e80: 42aa 000c clrl %a2@(12)
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
49e84: 4a8a tstl %a2
49e86: 672c beqs 49eb4 <_RBTree_Extract_validate_unprotected+0x104><== NEVER TAKEN
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
49e88: 49f2 1c00 lea %a2@(00000000,%d1:l:4),%a4
49e8c: 2394 0c00 movel %a4@,%a1@(00000000,%d0:l:4)
if (c->child[dir])
49e90: 2872 1c00 moveal %a2@(00000000,%d1:l:4),%a4
49e94: 4a8c tstl %a4
49e96: 6702 beqs 49e9a <_RBTree_Extract_validate_unprotected+0xea>
c->child[dir]->parent = the_node;
49e98: 2889 movel %a1,%a4@
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
49e9a: 2851 moveal %a1@,%a4
49e9c: 7601 moveq #1,%d3
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;
49e9e: 2589 1c00 movel %a1,%a2@(00000000,%d1:l:4)
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
49ea2: b3ec 0004 cmpal %a4@(4),%a1
49ea6: 56c2 sne %d2
c->parent = the_node->parent;
49ea8: 248c movel %a4,%a2@
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;
49eaa: 49c2 extbl %d2
49eac: 9682 subl %d2,%d3
49eae: 298a 3c00 movel %a2,%a4@(00000000,%d3:l:4)
c->parent = the_node->parent;
the_node->parent = c;
49eb2: 228a movel %a2,%a1@
_RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir));
sibling = parent->child[_RBTree_Opposite_direction(dir)];
49eb4: 2870 1c00 moveal %a0@(00000000,%d1:l:4),%a4
}
sibling->color = parent->color;
49eb8: 2968 000c 000c movel %a0@(12),%a4@(12)
49ebe: 2274 1c00 moveal %a4@(00000000,%d1:l:4),%a1
parent->color = RBT_BLACK;
49ec2: 42a8 000c clrl %a0@(12)
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
49ec6: 42a9 000c clrl %a1@(12)
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
49eca: 43f4 0c00 lea %a4@(00000000,%d0:l:4),%a1
49ece: 2191 1c00 movel %a1@,%a0@(00000000,%d1:l:4)
if (c->child[dir])
49ed2: 2274 0c00 moveal %a4@(00000000,%d0:l:4),%a1
49ed6: 4a89 tstl %a1
49ed8: 6702 beqs 49edc <_RBTree_Extract_validate_unprotected+0x12c>
c->child[dir]->parent = the_node;
49eda: 2288 movel %a0,%a1@
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
49edc: 2250 moveal %a0@,%a1
49ede: 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;
49ee0: 2988 0c00 movel %a0,%a4@(00000000,%d0:l:4)
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
49ee4: b1e9 0004 cmpal %a1@(4),%a0
49ee8: 56c0 sne %d0
c->parent = the_node->parent;
49eea: 2889 movel %a1,%a4@
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;
49eec: 49c0 extbl %d0
49eee: 9280 subl %d0,%d1
c->parent = the_node->parent;
the_node->parent = c;
49ef0: 208c movel %a4,%a0@
_RBTree_Rotate(parent, dir);
break; /* done */
}
} /* while */
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
49ef2: 2053 moveal %a3@,%a0
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;
49ef4: 238c 1c00 movel %a4,%a1@(00000000,%d1:l:4)
49ef8: 4a90 tstl %a0@
49efa: 6600 ff44 bnew 49e40 <_RBTree_Extract_validate_unprotected+0x90>
49efe: 607e bras 49f7e <_RBTree_Extract_validate_unprotected+0x1ce><== NOT EXECUTED
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
sibling->color = RBT_BLACK;
dir = the_node != parent->child[0];
49f00: b7e8 0004 cmpal %a0@(4),%a3
49f04: 56c1 sne %d1
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
49f06: 7001 moveq #1,%d0
* then rotate parent left, making the sibling be the_node's grandparent.
* Now the_node has a black sibling and red parent. After rotation,
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
49f08: 7601 moveq #1,%d3
sibling->color = RBT_BLACK;
dir = the_node != parent->child[0];
49f0a: 4481 negl %d1
49f0c: b380 eorl %d1,%d0
* then rotate parent left, making the sibling be the_node's grandparent.
* Now the_node has a black sibling and red parent. After rotation,
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
49f0e: 2143 000c movel %d3,%a0@(12)
49f12: 0280 0000 00ff andil #255,%d0
sibling->color = RBT_BLACK;
49f18: 42a9 000c clrl %a1@(12)
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
49f1c: 5280 addql #1,%d0
49f1e: 2470 0c00 moveal %a0@(00000000,%d0:l:4),%a2
dir = the_node != parent->child[0];
49f22: 0281 0000 00ff andil #255,%d1
49f28: 4a8a tstl %a2
49f2a: 674c beqs 49f78 <_RBTree_Extract_validate_unprotected+0x1c8><== NEVER TAKEN
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
49f2c: 5281 addql #1,%d1
49f2e: 43f2 1c00 lea %a2@(00000000,%d1:l:4),%a1
49f32: 2191 0c00 movel %a1@,%a0@(00000000,%d0:l:4)
if (c->child[dir])
49f36: 2272 1c00 moveal %a2@(00000000,%d1:l:4),%a1
49f3a: 4a89 tstl %a1
49f3c: 6702 beqs 49f40 <_RBTree_Extract_validate_unprotected+0x190><== NEVER TAKEN
c->child[dir]->parent = the_node;
49f3e: 2288 movel %a0,%a1@
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
49f40: 2250 moveal %a0@,%a1
49f42: 7401 moveq #1,%d2
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;
49f44: 2588 1c00 movel %a0,%a2@(00000000,%d1:l:4)
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
49f48: b1e9 0004 cmpal %a1@(4),%a0
49f4c: 56c1 sne %d1
c->parent = the_node->parent;
49f4e: 2489 movel %a1,%a2@
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;
49f50: 49c1 extbl %d1
49f52: 9481 subl %d1,%d2
49f54: 238a 2c00 movel %a2,%a1@(00000000,%d2:l:4)
49f58: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1
c->parent = the_node->parent;
the_node->parent = c;
49f5c: 208a movel %a2,%a0@
49f5e: 6000 fe86 braw 49de6 <_RBTree_Extract_validate_unprotected+0x36>
49f62: 2648 moveal %a0,%a3
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
49f64: 204a moveal %a2,%a0
if(!(the_node->parent->parent)) return NULL;
if(the_node == the_node->parent->child[RBT_LEFT])
return the_node->parent->child[RBT_RIGHT];
49f66: 226a 0008 moveal %a2@(8),%a1
49f6a: 6000 fec4 braw 49e30 <_RBTree_Extract_validate_unprotected+0x80>
49f6e: 2648 moveal %a0,%a3
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
49f70: 93c9 subal %a1,%a1
49f72: 204a moveal %a2,%a0
49f74: 6000 feba braw 49e30 <_RBTree_Extract_validate_unprotected+0x80>
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
49f78: 93c9 subal %a1,%a1 <== NOT EXECUTED
49f7a: 6000 fe6a braw 49de6 <_RBTree_Extract_validate_unprotected+0x36><== NOT EXECUTED
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
_RBTree_Rotate(parent, dir);
break; /* done */
}
} /* while */
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
49f7e: 42ab 000c clrl %a3@(12)
}
49f82: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4
49f86: 4e5e unlk %fp
49f88: 4e75 rts
49f8a: 2870 1c00 moveal %a0@(00000000,%d1:l:4),%a4
sibling->color = RBT_RED;
sibling->child[dir]->color = RBT_BLACK;
_RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir));
sibling = parent->child[_RBTree_Opposite_direction(dir)];
}
sibling->color = parent->color;
49f8e: 2368 000c 000c movel %a0@(12),%a1@(12)
parent->color = RBT_BLACK;
49f94: 42a8 000c clrl %a0@(12)
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
49f98: 42aa 000c clrl %a2@(12)
49f9c: 4a8c tstl %a4
49f9e: 6700 fe98 beqw 49e38 <_RBTree_Extract_validate_unprotected+0x88>
49fa2: 5280 addql #1,%d0
49fa4: 6000 ff24 braw 49eca <_RBTree_Extract_validate_unprotected+0x11a>
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])
return the_node->parent->child[RBT_RIGHT];
49fa8: 2268 0008 moveal %a0@(8),%a1
49fac: 6000 fe1e braw 49dcc <_RBTree_Extract_validate_unprotected+0x1c>
/* sibling is black, see if both of its children are also black. */
if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) &&
!_RBTree_Is_red(sibling->child[RBT_LEFT])) {
sibling->color = RBT_RED;
if (_RBTree_Is_red(parent)) {
parent->color = RBT_BLACK;
49fb0: 42a8 000c clrl %a0@(12)
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
_RBTree_Rotate(parent, dir);
break; /* done */
}
} /* while */
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
49fb4: 2053 moveal %a3@,%a0
49fb6: 4a90 tstl %a0@
49fb8: 6600 fe86 bnew 49e40 <_RBTree_Extract_validate_unprotected+0x90>
49fbc: 60c0 bras 49f7e <_RBTree_Extract_validate_unprotected+0x1ce><== NOT EXECUTED
0004a620 <_RBTree_Find>:
{
ISR_Level level;
RBTree_Node *return_node;
return_node = NULL;
_ISR_Disable( level );
4a620: 203c 0000 0700 movel #1792,%d0
RBTree_Node *_RBTree_Find(
RBTree_Control *the_rbtree,
RBTree_Node *search_node
)
{
4a626: 4e56 ffec linkw %fp,#-20
4a62a: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
4a62e: 266e 0008 moveal %fp@(8),%a3
4a632: 242e 000c movel %fp@(12),%d2
ISR_Level level;
RBTree_Node *return_node;
return_node = NULL;
_ISR_Disable( level );
4a636: 40c4 movew %sr,%d4
4a638: 8084 orl %d4,%d0
4a63a: 46c0 movew %d0,%sr
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
4a63c: 246b 0004 moveal %a3@(4),%a2
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
4a640: 4283 clrl %d3
4a642: 4a8a tstl %a2
4a644: 672a beqs 4a670 <_RBTree_Find+0x50> <== NEVER TAKEN
compare_result = the_rbtree->compare_function(the_node, iter_node);
4a646: 2f0a movel %a2,%sp@-
4a648: 206b 0010 moveal %a3@(16),%a0
4a64c: 2f02 movel %d2,%sp@-
4a64e: 4e90 jsr %a0@
if ( _RBTree_Is_equal( compare_result ) ) {
4a650: 508f addql #8,%sp
4a652: 4a80 tstl %d0
4a654: 6608 bnes 4a65e <_RBTree_Find+0x3e>
found = iter_node;
if ( the_rbtree->is_unique )
4a656: 260a movel %a2,%d3
4a658: 4a2b 0014 tstb %a3@(20)
4a65c: 6612 bnes 4a670 <_RBTree_Find+0x50>
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
4a65e: 4a80 tstl %d0
4a660: 5ec1 sgt %d1
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
4a662: 7001 moveq #1,%d0
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
4a664: 49c1 extbl %d1
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
4a666: 9081 subl %d1,%d0
4a668: 2472 0c00 moveal %a2@(00000000,%d0:l:4),%a2
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
4a66c: 4a8a tstl %a2
4a66e: 66d6 bnes 4a646 <_RBTree_Find+0x26>
return_node = _RBTree_Find_unprotected( the_rbtree, search_node );
_ISR_Enable( level );
4a670: 46c4 movew %d4,%sr
return return_node;
}
4a672: 2003 movel %d3,%d0
4a674: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
4a67a: 4e5e unlk %fp
...
0004a5e0 <_RBTree_Find_header>:
{
ISR_Level level;
RBTree_Control *return_header;
return_header = NULL;
_ISR_Disable( level );
4a5e0: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/isr.h>
RBTree_Control *_RBTree_Find_header(
RBTree_Node *the_node
)
{
4a5e6: 4e56 0000 linkw %fp,#0
4a5ea: 206e 0008 moveal %fp@(8),%a0
4a5ee: 2f02 movel %d2,%sp@-
ISR_Level level;
RBTree_Control *return_header;
return_header = NULL;
_ISR_Disable( level );
4a5f0: 40c2 movew %sr,%d2
4a5f2: 8082 orl %d2,%d0
4a5f4: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected(
RBTree_Node *the_node
)
{
if(!the_node) return NULL;
4a5f6: 4a88 tstl %a0
4a5f8: 671a beqs 4a614 <_RBTree_Find_header+0x34>
if(!(the_node->parent)) return NULL;
4a5fa: 2050 moveal %a0@,%a0
4a5fc: 4a88 tstl %a0
4a5fe: 670a beqs 4a60a <_RBTree_Find_header+0x2a>
4a600: 2210 movel %a0@,%d1
while(the_node->parent) the_node = the_node->parent;
4a602: 6706 beqs 4a60a <_RBTree_Find_header+0x2a> <== NEVER TAKEN
4a604: 2041 moveal %d1,%a0
4a606: 2210 movel %a0@,%d1
4a608: 66fa bnes 4a604 <_RBTree_Find_header+0x24>
return_header = _RBTree_Find_header_unprotected( the_node );
_ISR_Enable( level );
4a60a: 46c2 movew %d2,%sr
return return_header;
}
4a60c: 241f movel %sp@+,%d2
4a60e: 2008 movel %a0,%d0
4a610: 4e5e unlk %fp
4a612: 4e75 rts
*/
RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected(
RBTree_Node *the_node
)
{
if(!the_node) return NULL;
4a614: 91c8 subal %a0,%a0
RBTree_Control *return_header;
return_header = NULL;
_ISR_Disable( level );
return_header = _RBTree_Find_header_unprotected( the_node );
_ISR_Enable( level );
4a616: 46c2 movew %d2,%sr
return return_header;
}
4a618: 241f movel %sp@+,%d2
4a61a: 2008 movel %a0,%d0
4a61c: 4e5e unlk %fp <== NOT EXECUTED
0004a974 <_RBTree_Initialize>:
void *starting_address,
size_t number_nodes,
size_t node_size,
bool is_unique
)
{
4a974: 4e56 ffec linkw %fp,#-20
4a978: 202e 001c movel %fp@(28),%d0
4a97c: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
4a980: 246e 0008 moveal %fp@(8),%a2
4a984: 242e 0014 movel %fp@(20),%d2
4a988: 282e 0018 movel %fp@(24),%d4
size_t count;
RBTree_Node *next;
/* TODO: Error message? */
if (!the_rbtree) return;
4a98c: 4a8a tstl %a2
4a98e: 6736 beqs 4a9c6 <_RBTree_Initialize+0x52> <== NEVER TAKEN
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
4a990: 4292 clrl %a2@
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
4a992: 256e 000c 0010 movel %fp@(12),%a2@(16)
the_rbtree->is_unique = is_unique;
4a998: 1540 0014 moveb %d0,%a2@(20)
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
4a99c: 42aa 0004 clrl %a2@(4)
the_rbtree->first[0] = NULL;
4a9a0: 42aa 0008 clrl %a2@(8)
the_rbtree->first[1] = NULL;
4a9a4: 42aa 000c clrl %a2@(12)
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
4a9a8: 4a82 tstl %d2
4a9aa: 671a beqs 4a9c6 <_RBTree_Initialize+0x52> <== NEVER TAKEN
4a9ac: 262e 0010 movel %fp@(16),%d3
4a9b0: 47f9 0004 a6bc lea 4a6bc <_RBTree_Insert_unprotected>,%a3
_RBTree_Insert_unprotected(the_rbtree, next);
4a9b6: 2f03 movel %d3,%sp@-
#include <rtems/system.h>
#include <rtems/score/address.h>
#include <rtems/score/rbtree.h>
#include <rtems/score/isr.h>
void _RBTree_Initialize(
4a9b8: d684 addl %d4,%d3
4a9ba: 5382 subql #1,%d2
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
_RBTree_Insert_unprotected(the_rbtree, next);
4a9bc: 2f0a movel %a2,%sp@-
4a9be: 4e93 jsr %a3@
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
4a9c0: 508f addql #8,%sp
4a9c2: 4a82 tstl %d2
4a9c4: 66f0 bnes 4a9b6 <_RBTree_Initialize+0x42>
_RBTree_Insert_unprotected(the_rbtree, next);
next = (RBTree_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
}
4a9c6: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
4a9cc: 4e5e unlk %fp <== NOT EXECUTED
0004a140 <_RBTree_Insert_unprotected>:
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
4a140: 4e56 ffe4 linkw %fp,#-28
4a144: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@
4a148: 286e 0008 moveal %fp@(8),%a4
4a14c: 266e 000c moveal %fp@(12),%a3
if(!the_node) return (RBTree_Node*)-1;
4a150: 4a8b tstl %a3
4a152: 6700 01b6 beqw 4a30a <_RBTree_Insert_unprotected+0x1ca>
RBTree_Node *iter_node = the_rbtree->root;
4a156: 246c 0004 moveal %a4@(4),%a2
int compare_result;
if (!iter_node) { /* special case: first node inserted */
4a15a: 4a8a tstl %a2
4a15c: 6700 01ba beqw 4a318 <_RBTree_Insert_unprotected+0x1d8>
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);
4a160: 2f0a movel %a2,%sp@-
4a162: 206c 0010 moveal %a4@(16),%a0
4a166: 2f0b movel %a3,%sp@-
4a168: 4e90 jsr %a0@
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
4a16a: 508f addql #8,%sp
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
4a16c: 2400 movel %d0,%d2
4a16e: 4682 notl %d2
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);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
4a170: 4a2c 0014 tstb %a4@(20)
4a174: 6706 beqs 4a17c <_RBTree_Insert_unprotected+0x3c>
4a176: 4a80 tstl %d0
4a178: 6700 0182 beqw 4a2fc <_RBTree_Insert_unprotected+0x1bc>
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
4a17c: d482 addl %d2,%d2
4a17e: 9582 subxl %d2,%d2
4a180: 4482 negl %d2
if (!iter_node->child[dir]) {
4a182: 2202 movel %d2,%d1
4a184: 5281 addql #1,%d1
4a186: 2632 1c00 movel %a2@(00000000,%d1:l:4),%d3
4a18a: 6704 beqs 4a190 <_RBTree_Insert_unprotected+0x50>
(dir && _RBTree_Is_greater(compare_result)) ) {
the_rbtree->first[dir] = the_node;
}
break;
} else {
iter_node = iter_node->child[dir];
4a18c: 2443 moveal %d3,%a2
4a18e: 60d0 bras 4a160 <_RBTree_Insert_unprotected+0x20>
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
the_node->color = RBT_RED;
iter_node->child[dir] = the_node;
the_node->parent = iter_node;
/* update min/max */
compare_result = the_rbtree->compare_function(
4a190: 206c 0010 moveal %a4@(16),%a0
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;
4a194: 7001 moveq #1,%d0
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
4a196: 2a42 moveal %d2,%a5
4a198: 548d addql #2,%a5
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;
4a19a: 42ab 0008 clrl %a3@(8)
4a19e: 42ab 0004 clrl %a3@(4)
the_node->color = RBT_RED;
iter_node->child[dir] = the_node;
4a1a2: 258b 1c00 movel %a3,%a2@(00000000,%d1:l:4)
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;
4a1a6: 2740 000c movel %d0,%a3@(12)
iter_node->child[dir] = the_node;
the_node->parent = iter_node;
4a1aa: 268a movel %a2,%a3@
/* update min/max */
compare_result = the_rbtree->compare_function(
4a1ac: 2f34 dc00 movel %a4@(00000000,%a5:l:4),%sp@-
4a1b0: 2f0b movel %a3,%sp@-
4a1b2: 4e90 jsr %a0@
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
4a1b4: 508f addql #8,%sp
4a1b6: 4a82 tstl %d2
4a1b8: 6600 0124 bnew 4a2de <_RBTree_Insert_unprotected+0x19e>
4a1bc: 4a80 tstl %d0
4a1be: 6d00 0124 bltw 4a2e4 <_RBTree_Insert_unprotected+0x1a4>
_ISR_Disable( level );
return_node = _RBTree_Insert_unprotected( tree, node );
_ISR_Enable( level );
return return_node;
}
4a1c2: 2053 moveal %a3@,%a0
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
if (!the_node->parent->parent) return NULL;
4a1c4: 2250 moveal %a0@,%a1
4a1c6: 2449 moveal %a1,%a2
4a1c8: 4a89 tstl %a1
4a1ca: 6700 00ee beqw 4a2ba <_RBTree_Insert_unprotected+0x17a>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
4a1ce: 7801 moveq #1,%d4
4a1d0: b8a8 000c cmpl %a0@(12),%d4
4a1d4: 670c beqs 4a1e2 <_RBTree_Insert_unprotected+0xa2>
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4a1d6: 2003 movel %d3,%d0
4a1d8: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
4a1de: 4e5e unlk %fp
4a1e0: 4e75 rts
)
{
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;
4a1e2: 4a91 tstl %a1@
4a1e4: 6700 0106 beqw 4a2ec <_RBTree_Insert_unprotected+0x1ac>
{
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])
4a1e8: 2229 0004 movel %a1@(4),%d1
4a1ec: b288 cmpl %a0,%d1
4a1ee: 6700 0104 beqw 4a2f4 <_RBTree_Insert_unprotected+0x1b4>
4a1f2: 2841 moveal %d1,%a4
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
4a1f4: 4a8c tstl %a4
4a1f6: 670a beqs 4a202 <_RBTree_Insert_unprotected+0xc2>
4a1f8: 7401 moveq #1,%d2
4a1fa: b4ac 000c cmpl %a4@(12),%d2
4a1fe: 6700 00ca beqw 4a2ca <_RBTree_Insert_unprotected+0x18a>
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];
4a202: b7e8 0004 cmpal %a0@(4),%a3
4a206: 56c2 sne %d2
RBTree_Direction pdir = the_node->parent != g->child[0];
4a208: b288 cmpl %a0,%d1
4a20a: 56c1 sne %d1
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];
4a20c: 49c2 extbl %d2
RBTree_Direction pdir = the_node->parent != g->child[0];
4a20e: 49c1 extbl %d1
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];
4a210: 2001 movel %d1,%d0
4a212: 4480 negl %d0
RBTree_Direction pdir = the_node->parent != g->child[0];
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
4a214: b282 cmpl %d2,%d1
4a216: 6748 beqs 4a260 <_RBTree_Insert_unprotected+0x120>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
4a218: 4a80 tstl %d0
4a21a: 57c2 seq %d2
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
4a21c: 7801 moveq #1,%d4
4a21e: 2200 movel %d0,%d1
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
4a220: 49c2 extbl %d2
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
4a222: 9882 subl %d2,%d4
4a224: 5281 addql #1,%d1
4a226: 2870 4c00 moveal %a0@(00000000,%d4:l:4),%a4
4a22a: 4a8c tstl %a4
4a22c: 672c beqs 4a25a <_RBTree_Insert_unprotected+0x11a><== NEVER TAKEN
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
4a22e: 4bf4 1c00 lea %a4@(00000000,%d1:l:4),%a5
4a232: 2195 4c00 movel %a5@,%a0@(00000000,%d4:l:4)
if (c->child[dir])
4a236: 2a74 1c00 moveal %a4@(00000000,%d1:l:4),%a5
4a23a: 4a8d tstl %a5
4a23c: 6704 beqs 4a242 <_RBTree_Insert_unprotected+0x102>
c->child[dir]->parent = the_node;
4a23e: 2a88 movel %a0,%a5@
4a240: 2250 moveal %a0@,%a1
c->child[dir] = the_node;
4a242: 2988 1c00 movel %a0,%a4@(00000000,%d1:l:4)
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4a246: 7801 moveq #1,%d4
4a248: b1e9 0004 cmpal %a1@(4),%a0
4a24c: 56c2 sne %d2
c->parent = the_node->parent;
4a24e: 2889 movel %a1,%a4@
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;
4a250: 49c2 extbl %d2
4a252: 9882 subl %d2,%d4
4a254: 238c 4c00 movel %a4,%a1@(00000000,%d4:l:4)
c->parent = the_node->parent;
the_node->parent = c;
4a258: 208c movel %a4,%a0@
_RBTree_Rotate(the_node->parent, pdir);
the_node = the_node->child[pdir];
4a25a: 2673 1c00 moveal %a3@(00000000,%d1:l:4),%a3
4a25e: 2053 moveal %a3@,%a0
}
the_node->parent->color = RBT_BLACK;
g->color = RBT_RED;
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
4a260: 7201 moveq #1,%d1
4a262: 9280 subl %d0,%d1
4a264: 2001 movel %d1,%d0
4a266: 7201 moveq #1,%d1
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
the_node = the_node->child[pdir];
}
the_node->parent->color = RBT_BLACK;
g->color = RBT_RED;
4a268: 7401 moveq #1,%d2
4a26a: b181 eorl %d0,%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;
4a26c: 42a8 000c clrl %a0@(12)
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
4a270: 5281 addql #1,%d1
4a272: 2072 1c00 moveal %a2@(00000000,%d1:l:4),%a0
g->color = RBT_RED;
4a276: 2542 000c movel %d2,%a2@(12)
4a27a: 4a88 tstl %a0
4a27c: 6700 ff44 beqw 4a1c2 <_RBTree_Insert_unprotected+0x82>
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
4a280: 5280 addql #1,%d0
4a282: 43f0 0c00 lea %a0@(00000000,%d0:l:4),%a1
4a286: 2591 1c00 movel %a1@,%a2@(00000000,%d1:l:4)
if (c->child[dir])
4a28a: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1
4a28e: 4a89 tstl %a1
4a290: 6702 beqs 4a294 <_RBTree_Insert_unprotected+0x154>
c->child[dir]->parent = the_node;
4a292: 228a movel %a2,%a1@
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4a294: 2252 moveal %a2@,%a1
4a296: 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;
4a298: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4)
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
4a29c: b5e9 0004 cmpal %a1@(4),%a2
4a2a0: 56c0 sne %d0
c->parent = the_node->parent;
4a2a2: 2089 movel %a1,%a0@
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;
4a2a4: 49c0 extbl %d0
4a2a6: 9280 subl %d0,%d1
4a2a8: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4)
c->parent = the_node->parent;
the_node->parent = c;
4a2ac: 2488 movel %a0,%a2@
_ISR_Disable( level );
return_node = _RBTree_Insert_unprotected( tree, node );
_ISR_Enable( level );
return return_node;
}
4a2ae: 2053 moveal %a3@,%a0
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
if (!the_node->parent->parent) return NULL;
4a2b0: 2250 moveal %a0@,%a1
4a2b2: 2449 moveal %a1,%a2
4a2b4: 4a89 tstl %a1
4a2b6: 6600 ff16 bnew 4a1ce <_RBTree_Insert_unprotected+0x8e>
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4a2ba: 2003 movel %d3,%d0
/* 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;
4a2bc: 42ab 000c clrl %a3@(12)
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4a2c0: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
4a2c6: 4e5e unlk %fp
4a2c8: 4e75 rts
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)) {
the_node->parent->color = RBT_BLACK;
4a2ca: 42a8 000c clrl %a0@(12)
u->color = RBT_BLACK;
g->color = RBT_RED;
4a2ce: 7401 moveq #1,%d2
4a2d0: 2649 moveal %a1,%a3
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;
4a2d2: 42ac 000c clrl %a4@(12)
g->color = RBT_RED;
4a2d6: 2342 000c movel %d2,%a1@(12)
4a2da: 6000 fee6 braw 4a1c2 <_RBTree_Insert_unprotected+0x82>
compare_result = the_rbtree->compare_function(
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
(dir && _RBTree_Is_greater(compare_result)) ) {
4a2de: 4a80 tstl %d0
4a2e0: 6f00 fee0 blew 4a1c2 <_RBTree_Insert_unprotected+0x82>
the_rbtree->first[dir] = the_node;
4a2e4: 298b dc00 movel %a3,%a4@(00000000,%a5:l:4)
4a2e8: 6000 fed8 braw 4a1c2 <_RBTree_Insert_unprotected+0x82>
4a2ec: 2229 0004 movel %a1@(4),%d1 <== NOT EXECUTED
4a2f0: 6000 ff10 braw 4a202 <_RBTree_Insert_unprotected+0xc2><== NOT EXECUTED
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])
return the_node->parent->child[RBT_RIGHT];
4a2f4: 2869 0008 moveal %a1@(8),%a4
4a2f8: 6000 fefa braw 4a1f4 <_RBTree_Insert_unprotected+0xb4>
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);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
4a2fc: 260a movel %a2,%d3
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4a2fe: 2003 movel %d3,%d0
4a300: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
4a306: 4e5e unlk %fp
4a308: 4e75 rts
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
if(!the_node) return (RBTree_Node*)-1;
4a30a: 76ff moveq #-1,%d3
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4a30c: 2003 movel %d3,%d0
4a30e: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
4a314: 4e5e unlk %fp
4a316: 4e75 rts
RBTree_Node *iter_node = the_rbtree->root;
int compare_result;
if (!iter_node) { /* special case: first node inserted */
the_node->color = RBT_BLACK;
4a318: 42ab 000c clrl %a3@(12)
} /* while(iter_node) */
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
4a31c: 4283 clrl %d3
}
4a31e: 2003 movel %d3,%d0
RBTree_Node *iter_node = the_rbtree->root;
int compare_result;
if (!iter_node) { /* special case: first node inserted */
the_node->color = RBT_BLACK;
the_rbtree->root = the_node;
4a320: 294b 0004 movel %a3,%a4@(4)
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
4a324: 294b 000c movel %a3,%a4@(12)
4a328: 294b 0008 movel %a3,%a4@(8)
the_node->parent = (RBTree_Node *) the_rbtree;
4a32c: 268c movel %a4,%a3@
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
4a32e: 42ab 0008 clrl %a3@(8)
4a332: 42ab 0004 clrl %a3@(4)
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
4a336: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5
4a33c: 4e5e unlk %fp <== NOT EXECUTED
0004a36c <_RBTree_Iterate_unprotected>:
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
4a36c: 7202 moveq #2,%d1
const RBTree_Control *rbtree,
RBTree_Direction dir,
RBTree_Visitor visitor,
void *visitor_arg
)
{
4a36e: 4e56 ffe8 linkw %fp,#-24
4a372: 206e 0008 moveal %fp@(8),%a0
4a376: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@
4a37a: 262e 000c movel %fp@(12),%d3
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
4a37e: 57c0 seq %d0
4a380: 246e 0010 moveal %fp@(16),%a2
4a384: 49c0 extbl %d0
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
4a386: 9280 subl %d0,%d1
4a388: 47f9 0004 a3c0 lea 4a3c0 <_RBTree_Next_unprotected>,%a3
4a38e: 2430 1c00 movel %a0@(00000000,%d1:l:4),%d2
4a392: 2a2e 0014 movel %fp@(20),%d5
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
4a396: 4a82 tstl %d2
4a398: 671a beqs 4a3b4 <_RBTree_Iterate_unprotected+0x48>
stop = (*visitor)( current, dir, visitor_arg );
4a39a: 2f05 movel %d5,%sp@-
4a39c: 2f03 movel %d3,%sp@-
4a39e: 2f02 movel %d2,%sp@-
4a3a0: 4e92 jsr %a2@
current = _RBTree_Next_unprotected( current, dir );
4a3a2: 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 );
4a3a4: 1800 moveb %d0,%d4
current = _RBTree_Next_unprotected( current, dir );
4a3a6: 2f02 movel %d2,%sp@-
4a3a8: 4e93 jsr %a3@
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
4a3aa: 4fef 0014 lea %sp@(20),%sp
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
4a3ae: 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 ) {
4a3b0: 4a04 tstb %d4
4a3b2: 67e2 beqs 4a396 <_RBTree_Iterate_unprotected+0x2a><== ALWAYS TAKEN
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
}
}
4a3b4: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3
4a3ba: 4e5e unlk %fp
...
0004a3c0 <_RBTree_Next_unprotected>:
RBTree_Node *_RBTree_Next_unprotected(
const RBTree_Node *node,
RBTree_Direction dir
)
{
4a3c0: 4e56 0000 linkw %fp,#0
4a3c4: 222e 000c movel %fp@(12),%d1
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
4a3c8: 57c0 seq %d0
4a3ca: 226e 0008 moveal %fp@(8),%a1
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
RBTree_Node *current = node->child [dir];
4a3ce: 5281 addql #1,%d1
4a3d0: 49c0 extbl %d0
4a3d2: 4480 negl %d0
4a3d4: 2071 1c00 moveal %a1@(00000000,%d1:l:4),%a0
RBTree_Node *_RBTree_Next_unprotected(
const RBTree_Node *node,
RBTree_Direction dir
)
{
4a3d8: 2f0a movel %a2,%sp@-
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
RBTree_Node *current = node->child [dir];
RBTree_Node *next = NULL;
if ( current != NULL ) {
4a3da: 4a88 tstl %a0
4a3dc: 6718 beqs 4a3f6 <_RBTree_Next_unprotected+0x36>
4a3de: 5280 addql #1,%d0
next = current;
while ( (current = current->child [opp_dir]) != NULL ) {
4a3e0: 2230 0c00 movel %a0@(00000000,%d0:l:4),%d1
4a3e4: 6708 beqs 4a3ee <_RBTree_Next_unprotected+0x2e>
4a3e6: 2041 moveal %d1,%a0
4a3e8: 2230 0c00 movel %a0@(00000000,%d0:l:4),%d1
4a3ec: 66f8 bnes 4a3e6 <_RBTree_Next_unprotected+0x26> <== NEVER TAKEN
}
}
}
return next;
}
4a3ee: 245f moveal %sp@+,%a2
RBTree_Node *parent = node->parent;
if ( parent->parent && node == parent->child [opp_dir] ) {
next = parent;
} else {
while ( parent->parent && node == parent->child [dir] ) {
4a3f0: 2008 movel %a0,%d0
}
}
}
return next;
}
4a3f2: 4e5e unlk %fp
4a3f4: 4e75 rts
next = current;
while ( (current = current->child [opp_dir]) != NULL ) {
next = current;
}
} else {
RBTree_Node *parent = node->parent;
4a3f6: 2051 moveal %a1@,%a0
if ( parent->parent && node == parent->child [opp_dir] ) {
4a3f8: 2450 moveal %a0@,%a2
4a3fa: 4a8a tstl %a2
4a3fc: 6706 beqs 4a404 <_RBTree_Next_unprotected+0x44>
4a3fe: b3f0 0c04 cmpal %a0@(00000004,%d0:l:4),%a1
4a402: 67ea beqs 4a3ee <_RBTree_Next_unprotected+0x2e>
next = parent;
} else {
while ( parent->parent && node == parent->child [dir] ) {
4a404: 4a8a tstl %a2
4a406: 670e beqs 4a416 <_RBTree_Next_unprotected+0x56>
4a408: b3f0 1c00 cmpal %a0@(00000000,%d1:l:4),%a1
4a40c: 66e0 bnes 4a3ee <_RBTree_Next_unprotected+0x2e>
4a40e: 2248 moveal %a0,%a1
4a410: 204a moveal %a2,%a0
4a412: 2452 moveal %a2@,%a2
4a414: 60ee bras 4a404 <_RBTree_Next_unprotected+0x44>
}
}
}
return next;
}
4a416: 245f moveal %sp@+,%a2
RBTree_Direction dir
)
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
RBTree_Node *current = node->child [dir];
RBTree_Node *next = NULL;
4a418: 4280 clrl %d0
}
}
}
return next;
}
4a41a: 4e5e unlk %fp <== NOT EXECUTED
000486cc <_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 )
{
486cc: 4e56 ffec linkw %fp,#-20
486d0: 206e 0008 moveal %fp@(8),%a0
486d4: 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 ];
486d8: 2468 00fa moveal %a0@(250),%a2
if ( !api )
486dc: 4a8a tstl %a2
486de: 671a beqs 486fa <_RTEMS_signal_Post_switch_hook+0x2e><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
486e0: 203c 0000 0700 movel #1792,%d0
486e6: 40c1 movew %sr,%d1
486e8: 8081 orl %d1,%d0
486ea: 46c0 movew %d0,%sr
signal_set = asr->signals_posted;
486ec: 242a 0012 movel %a2@(18),%d2
asr->signals_posted = 0;
486f0: 42aa 0012 clrl %a2@(18)
_ISR_Enable( level );
486f4: 46c1 movew %d1,%sr
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
486f6: 4a82 tstl %d2
486f8: 660a bnes 48704 <_RTEMS_signal_Post_switch_hook+0x38>
(*asr->handler)( signal_set );
asr->nest_level -= 1;
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
}
486fa: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3
48700: 4e5e unlk %fp
48702: 4e75 rts
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
48704: 52aa 001a addql #1,%a2@(26)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
48708: 260e movel %fp,%d3
4870a: 5983 subql #4,%d3
4870c: 47f9 0004 8b5c lea 48b5c <rtems_task_mode>,%a3
48712: 2f03 movel %d3,%sp@-
48714: 2f3c 0000 ffff movel #65535,%sp@-
4871a: 2f2a 000e movel %a2@(14),%sp@-
4871e: 4e93 jsr %a3@
(*asr->handler)( signal_set );
48720: 2f02 movel %d2,%sp@-
48722: 206a 000a moveal %a2@(10),%a0
48726: 4e90 jsr %a0@
asr->nest_level -= 1;
48728: 53aa 001a subql #1,%a2@(26)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
4872c: 2f03 movel %d3,%sp@-
4872e: 2f3c 0000 ffff movel #65535,%sp@-
48734: 2f2e fffc movel %fp@(-4),%sp@-
48738: 4e93 jsr %a3@
4873a: 4fef 001c lea %sp@(28),%sp
}
4873e: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3
48744: 4e5e unlk %fp <== NOT EXECUTED
0004cd02 <_RTEMS_tasks_Create_extension>:
static bool _RTEMS_tasks_Create_extension(
Thread_Control *executing,
Thread_Control *created
)
{
4cd02: 4e56 0000 linkw %fp,#0
4cd06: 2f0a movel %a2,%sp@-
4cd08: 246e 000c moveal %fp@(12),%a2
/*
* Notepads must be the last entry in the structure and they
* can be left off if disabled in the configuration.
*/
to_allocate = sizeof( RTEMS_API_Control );
if ( !rtems_configuration_get_notepads_enabled() )
4cd0c: 4a39 0005 f6f6 tstb 5f6f6 <Configuration_RTEMS_API+0x4>
4cd12: 675c beqs 4cd70 <_RTEMS_tasks_Create_extension+0x6e>
/*
* Notepads must be the last entry in the structure and they
* can be left off if disabled in the configuration.
*/
to_allocate = sizeof( RTEMS_API_Control );
4cd14: 705e moveq #94,%d0
if ( !rtems_configuration_get_notepads_enabled() )
to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t));
api = _Workspace_Allocate( to_allocate );
4cd16: 2f00 movel %d0,%sp@-
4cd18: 4eb9 0004 acc0 jsr 4acc0 <_Workspace_Allocate>
if ( !api )
4cd1e: 588f addql #4,%sp
*/
to_allocate = sizeof( RTEMS_API_Control );
if ( !rtems_configuration_get_notepads_enabled() )
to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t));
api = _Workspace_Allocate( to_allocate );
4cd20: 2040 moveal %d0,%a0
if ( !api )
4cd22: 4a80 tstl %d0
4cd24: 675c beqs 4cd82 <_RTEMS_tasks_Create_extension+0x80>
return false;
created->API_Extensions[ THREAD_API_RTEMS ] = api;
4cd26: 2540 00fa movel %d0,%a2@(250)
*/
RTEMS_INLINE_ROUTINE void _ASR_Initialize (
ASR_Information *information
)
{
information->is_enabled = false;
4cd2a: 4200 clrb %d0
4cd2c: 4290 clrl %a0@
4cd2e: 1140 0008 moveb %d0,%a0@(8)
4cd32: 42a8 0004 clrl %a0@(4)
information->handler = NULL;
4cd36: 42a8 000a clrl %a0@(10)
information->mode_set = RTEMS_DEFAULT_MODES;
4cd3a: 42a8 000e clrl %a0@(14)
information->signals_posted = 0;
4cd3e: 42a8 0012 clrl %a0@(18)
information->signals_pending = 0;
4cd42: 42a8 0016 clrl %a0@(22)
information->nest_level = 0;
4cd46: 42a8 001a clrl %a0@(26)
_Event_Initialize( &api->Event );
_Event_Initialize( &api->System_event );
_ASR_Initialize( &api->Signal );
created->task_variables = NULL;
4cd4a: 42aa 0106 clrl %a2@(262)
if ( rtems_configuration_get_notepads_enabled() ) {
4cd4e: 4a39 0005 f6f6 tstb 5f6f6 <Configuration_RTEMS_API+0x4>
4cd54: 6710 beqs 4cd66 <_RTEMS_tasks_Create_extension+0x64>
* task is created via another API, then this routine is invoked
* and this API given the opportunity to initialize its extension
* area.
*/
static bool _RTEMS_tasks_Create_extension(
4cd56: 41e8 001e lea %a0@(30),%a0
4cd5a: 4280 clrl %d0
_ASR_Initialize( &api->Signal );
created->task_variables = NULL;
if ( rtems_configuration_get_notepads_enabled() ) {
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
api->Notepads[i] = 0;
4cd5c: 4298 clrl %a0@+
_Event_Initialize( &api->System_event );
_ASR_Initialize( &api->Signal );
created->task_variables = NULL;
if ( rtems_configuration_get_notepads_enabled() ) {
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
4cd5e: 5280 addql #1,%d0
4cd60: 7210 moveq #16,%d1
4cd62: b280 cmpl %d0,%d1
4cd64: 66f6 bnes 4cd5c <_RTEMS_tasks_Create_extension+0x5a>
api->Notepads[i] = 0;
}
return true;
}
4cd66: 246e fffc moveal %fp@(-4),%a2
4cd6a: 4e5e unlk %fp
if ( rtems_configuration_get_notepads_enabled() ) {
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
api->Notepads[i] = 0;
}
return true;
4cd6c: 7001 moveq #1,%d0
}
4cd6e: 4e75 rts
* Notepads must be the last entry in the structure and they
* can be left off if disabled in the configuration.
*/
to_allocate = sizeof( RTEMS_API_Control );
if ( !rtems_configuration_get_notepads_enabled() )
to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t));
4cd70: 701e moveq #30,%d0
api = _Workspace_Allocate( to_allocate );
4cd72: 2f00 movel %d0,%sp@-
4cd74: 4eb9 0004 acc0 jsr 4acc0 <_Workspace_Allocate>
if ( !api )
4cd7a: 588f addql #4,%sp
*/
to_allocate = sizeof( RTEMS_API_Control );
if ( !rtems_configuration_get_notepads_enabled() )
to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t));
api = _Workspace_Allocate( to_allocate );
4cd7c: 2040 moveal %d0,%a0
if ( !api )
4cd7e: 4a80 tstl %d0
4cd80: 66a4 bnes 4cd26 <_RTEMS_tasks_Create_extension+0x24><== ALWAYS TAKEN
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
api->Notepads[i] = 0;
}
return true;
}
4cd82: 246e fffc moveal %fp@(-4),%a2
4cd86: 4e5e unlk %fp
to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t));
api = _Workspace_Allocate( to_allocate );
if ( !api )
return false;
4cd88: 4200 clrb %d0 <== NOT EXECUTED
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
api->Notepads[i] = 0;
}
return true;
}
00047908 <_RTEMS_tasks_Initialize_user_tasks_body>:
*
* Output parameters: NONE
*/
void _RTEMS_tasks_Initialize_user_tasks_body( void )
{
47908: 4e56 ffe4 linkw %fp,#-28
4790c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@
rtems_initialization_tasks_table *user_tasks;
/*
* Move information into local variables
*/
user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table;
47910: 2479 0005 f71c moveal 5f71c <Configuration_RTEMS_API+0x2a>,%a2
maximum = Configuration_RTEMS_API.number_of_initialization_tasks;
47916: 2639 0005 f718 movel 5f718 <Configuration_RTEMS_API+0x26>,%d3
/*
* Verify that we have a set of user tasks to iterate
*/
if ( !user_tasks )
4791c: 4a8a tstl %a2
4791e: 6754 beqs 47974 <_RTEMS_tasks_Initialize_user_tasks_body+0x6c>
return;
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
47920: 4a83 tstl %d3
47922: 6750 beqs 47974 <_RTEMS_tasks_Initialize_user_tasks_body+0x6c><== NEVER TAKEN
47924: 280e movel %fp,%d4
47926: 4282 clrl %d2
47928: 5984 subql #4,%d4
4792a: 47f9 0004 76c4 lea 476c4 <rtems_task_create>,%a3
&id
);
if ( !rtems_is_status_successful( return_value ) )
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
return_value = rtems_task_start(
47930: 49f9 0004 7990 lea 47990 <rtems_task_start>,%a4
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
return_value = rtems_task_create(
47936: 2f04 movel %d4,%sp@-
47938: 2f2a 000c movel %a2@(12),%sp@-
4793c: 2f2a 0014 movel %a2@(20),%sp@-
47940: 2f2a 0004 movel %a2@(4),%sp@-
47944: 2f2a 0008 movel %a2@(8),%sp@-
47948: 2f12 movel %a2@,%sp@-
4794a: 4e93 jsr %a3@
user_tasks[ index ].stack_size,
user_tasks[ index ].mode_set,
user_tasks[ index ].attribute_set,
&id
);
if ( !rtems_is_status_successful( return_value ) )
4794c: 4fef 0018 lea %sp@(24),%sp
47950: 4a80 tstl %d0
47952: 662a bnes 4797e <_RTEMS_tasks_Initialize_user_tasks_body+0x76>
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
return_value = rtems_task_start(
47954: 2f2a 0018 movel %a2@(24),%sp@-
47958: 2f2a 0010 movel %a2@(16),%sp@-
4795c: 2f2e fffc movel %fp@(-4),%sp@-
47960: 4e94 jsr %a4@
id,
user_tasks[ index ].entry_point,
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
47962: 4fef 000c lea %sp@(12),%sp
47966: 4a80 tstl %d0
47968: 6614 bnes 4797e <_RTEMS_tasks_Initialize_user_tasks_body+0x76>
return;
/*
* Now iterate over the initialization tasks and create/start them.
*/
for ( index=0 ; index < maximum ; index++ ) {
4796a: 5282 addql #1,%d2
4796c: 45ea 001c lea %a2@(28),%a2
47970: b682 cmpl %d2,%d3
47972: 66c2 bnes 47936 <_RTEMS_tasks_Initialize_user_tasks_body+0x2e><== NEVER TAKEN
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
}
}
47974: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4
4797a: 4e5e unlk %fp
4797c: 4e75 rts
id,
user_tasks[ index ].entry_point,
user_tasks[ index ].argument
);
if ( !rtems_is_status_successful( return_value ) )
_Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value );
4797e: 2f00 movel %d0,%sp@-
47980: 4878 0001 pea 1 <ADD>
47984: 4878 0001 pea 1 <ADD>
47988: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
...
0004cc62 <_RTEMS_tasks_Switch_extension>:
static void _RTEMS_tasks_Switch_extension(
Thread_Control *executing,
Thread_Control *heir
)
{
4cc62: 4e56 0000 linkw %fp,#0
4cc66: 206e 0008 moveal %fp@(8),%a0
/*
* Per Task Variables
*/
tvp = executing->task_variables;
4cc6a: 2068 0106 moveal %a0@(262),%a0
while (tvp) {
4cc6e: 4a88 tstl %a0
4cc70: 6712 beqs 4cc84 <_RTEMS_tasks_Switch_extension+0x22>
tvp->tval = *tvp->ptr;
4cc72: 2268 0004 moveal %a0@(4),%a1
4cc76: 2151 000c movel %a1@,%a0@(12)
*tvp->ptr = tvp->gval;
4cc7a: 22a8 0008 movel %a0@(8),%a1@
tvp = (rtems_task_variable_t *)tvp->next;
4cc7e: 2050 moveal %a0@,%a0
/*
* Per Task Variables
*/
tvp = executing->task_variables;
while (tvp) {
4cc80: 4a88 tstl %a0
4cc82: 66ee bnes 4cc72 <_RTEMS_tasks_Switch_extension+0x10><== NEVER TAKEN
tvp->tval = *tvp->ptr;
*tvp->ptr = tvp->gval;
tvp = (rtems_task_variable_t *)tvp->next;
}
tvp = heir->task_variables;
4cc84: 206e 000c moveal %fp@(12),%a0
4cc88: 2068 0106 moveal %a0@(262),%a0
while (tvp) {
4cc8c: 4a88 tstl %a0
4cc8e: 6712 beqs 4cca2 <_RTEMS_tasks_Switch_extension+0x40>
tvp->gval = *tvp->ptr;
4cc90: 2268 0004 moveal %a0@(4),%a1
4cc94: 2151 0008 movel %a1@,%a0@(8)
*tvp->ptr = tvp->tval;
4cc98: 22a8 000c movel %a0@(12),%a1@
tvp = (rtems_task_variable_t *)tvp->next;
4cc9c: 2050 moveal %a0@,%a0
*tvp->ptr = tvp->gval;
tvp = (rtems_task_variable_t *)tvp->next;
}
tvp = heir->task_variables;
while (tvp) {
4cc9e: 4a88 tstl %a0
4cca0: 66ee bnes 4cc90 <_RTEMS_tasks_Switch_extension+0x2e><== NEVER TAKEN
tvp->gval = *tvp->ptr;
*tvp->ptr = tvp->tval;
tvp = (rtems_task_variable_t *)tvp->next;
}
}
4cca2: 4e5e unlk %fp <== NOT EXECUTED
00074b08 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
74b08: 4e56 fffc linkw %fp,#-4
74b0c: 2f0a movel %a2,%sp@-
74b0e: 486e fffc pea %fp@(-4)
74b12: 2f2e 0008 movel %fp@(8),%sp@-
74b16: 4879 000a 1e9c pea a1e9c <_Rate_monotonic_Information>
74b1c: 4eb9 0004 8c58 jsr 48c58 <_Objects_Get>
/*
* When we get here, the Timer is already off the chain so we do not
* have to worry about that -- hence no _Watchdog_Remove().
*/
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
74b22: 4fef 000c lea %sp@(12),%sp
74b26: 2440 moveal %d0,%a2
74b28: 4aae fffc tstl %fp@(-4)
74b2c: 6636 bnes 74b64 <_Rate_monotonic_Timeout+0x5c> <== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
74b2e: 206a 0040 moveal %a2@(64),%a0
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_PERIOD);
74b32: 2028 0010 movel %a0@(16),%d0
74b36: 0280 0000 4000 andil #16384,%d0
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
74b3c: 670a beqs 74b48 <_Rate_monotonic_Timeout+0x40>
74b3e: 202a 0008 movel %a2@(8),%d0
74b42: b0a8 0020 cmpl %a0@(32),%d0
74b46: 675e beqs 74ba6 <_Rate_monotonic_Timeout+0x9e>
_Thread_Unblock( the_thread );
_Rate_monotonic_Initiate_statistics( the_period );
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
74b48: 7001 moveq #1,%d0
74b4a: b0aa 0038 cmpl %a2@(56),%d0
74b4e: 671c beqs 74b6c <_Rate_monotonic_Timeout+0x64>
_Rate_monotonic_Initiate_statistics( the_period );
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
74b50: 7004 moveq #4,%d0
74b52: 2540 0038 movel %d0,%a2@(56)
*
* 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;
74b56: 2039 000a 14da movel a14da <_Thread_Dispatch_disable_level>,%d0
--level;
74b5c: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
74b5e: 23c0 000a 14da movel %d0,a14da <_Thread_Dispatch_disable_level>
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
74b64: 246e fff8 moveal %fp@(-8),%a2
74b68: 4e5e unlk %fp
74b6a: 4e75 rts
_Rate_monotonic_Initiate_statistics( the_period );
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
74b6c: 103c 0003 moveb #3,%d0
74b70: 2540 0038 movel %d0,%a2@(56)
_Rate_monotonic_Initiate_statistics( the_period );
74b74: 2f0a movel %a2,%sp@-
74b76: 4eb9 0007 4844 jsr 74844 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
74b7c: 256a 003c 001c movel %a2@(60),%a2@(28)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
74b82: 486a 0010 pea %a2@(16)
74b86: 4879 000a 1576 pea a1576 <_Watchdog_Ticks_chain>
74b8c: 4eb9 0004 a614 jsr 4a614 <_Watchdog_Insert>
74b92: 4fef 000c lea %sp@(12),%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;
74b96: 2039 000a 14da movel a14da <_Thread_Dispatch_disable_level>,%d0
--level;
74b9c: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
74b9e: 23c0 000a 14da movel %d0,a14da <_Thread_Dispatch_disable_level>
74ba4: 60be bras 74b64 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
74ba6: 2f3c 1007 fff8 movel #268959736,%sp@-
74bac: 2f08 movel %a0,%sp@-
74bae: 4eb9 0004 9574 jsr 49574 <_Thread_Clear_state>
the_thread = the_period->owner;
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
the_thread->Wait.id == the_period->Object.id ) {
_Thread_Unblock( the_thread );
_Rate_monotonic_Initiate_statistics( the_period );
74bb4: 2f0a movel %a2,%sp@-
74bb6: 4eb9 0007 4844 jsr 74844 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
74bbc: 256a 003c 001c movel %a2@(60),%a2@(28)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
74bc2: 486a 0010 pea %a2@(16)
74bc6: 4879 000a 1576 pea a1576 <_Watchdog_Ticks_chain>
74bcc: 4eb9 0004 a614 jsr 4a614 <_Watchdog_Insert>
74bd2: 4fef 0014 lea %sp@(20),%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;
74bd6: 2039 000a 14da movel a14da <_Thread_Dispatch_disable_level>,%d0
--level;
74bdc: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
74bde: 23c0 000a 14da movel %d0,a14da <_Thread_Dispatch_disable_level>
74be4: 6000 ff7e braw 74b64 <_Rate_monotonic_Timeout+0x5c>
00049c44 <_Scheduler_CBS_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
49c44: 4e56 0000 linkw %fp,#0
49c48: 2f0a movel %a2,%sp@-
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
49c4a: 4878 001c pea 1c <OPER2+0x8>
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
49c4e: 246e 0008 moveal %fp@(8),%a2
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
49c52: 4eb9 0004 b6b4 jsr 4b6b4 <_Workspace_Allocate>
if ( sched ) {
49c58: 588f addql #4,%sp
49c5a: 4a80 tstl %d0
49c5c: 6712 beqs 49c70 <_Scheduler_CBS_Allocate+0x2c> <== NEVER TAKEN
the_thread->scheduler_info = sched;
49c5e: 2540 0086 movel %d0,%a2@(134)
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
49c62: 2040 moveal %d0,%a0
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
49c64: 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;
49c66: 208a movel %a2,%a0@
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
49c68: 2141 0014 movel %d1,%a0@(20)
schinfo->cbs_server = NULL;
49c6c: 42a8 0018 clrl %a0@(24)
}
return sched;
}
49c70: 246e fffc moveal %fp@(-4),%a2
49c74: 4e5e unlk %fp <== NOT EXECUTED
0004b37c <_Scheduler_CBS_Budget_callout>:
Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
void _Scheduler_CBS_Budget_callout(
Thread_Control *the_thread
)
{
4b37c: 4e56 fffc linkw %fp,#-4
4b380: 2f0a movel %a2,%sp@-
4b382: 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;
4b386: 202a 00a8 movel %a2@(168),%d0
if ( the_thread->real_priority != new_priority )
4b38a: b0aa 0018 cmpl %a2@(24),%d0
4b38e: 6704 beqs 4b394 <_Scheduler_CBS_Budget_callout+0x18><== NEVER TAKEN
the_thread->real_priority = new_priority;
4b390: 2540 0018 movel %d0,%a2@(24)
if ( the_thread->current_priority != new_priority )
4b394: b0aa 0014 cmpl %a2@(20),%d0
4b398: 6712 beqs 4b3ac <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN
_Thread_Change_priority(the_thread, new_priority, true);
4b39a: 4878 0001 pea 1 <ADD>
4b39e: 2f00 movel %d0,%sp@-
4b3a0: 2f0a movel %a2,%sp@-
4b3a2: 4eb9 0004 b95c jsr 4b95c <_Thread_Change_priority>
4b3a8: 4fef 000c lea %sp@(12),%sp
/* Invoke callback function if any. */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
4b3ac: 246a 0086 moveal %a2@(134),%a2
if ( sched_info->cbs_server->cbs_budget_overrun ) {
4b3b0: 206a 0018 moveal %a2@(24),%a0
4b3b4: 4aa8 000c tstl %a0@(12)
4b3b8: 671e beqs 4b3d8 <_Scheduler_CBS_Budget_callout+0x5c>
_Scheduler_CBS_Get_server_id(
4b3ba: 486e fffc pea %fp@(-4)
4b3be: 2f10 movel %a0@,%sp@-
4b3c0: 4eb9 0004 b338 jsr 4b338 <_Scheduler_CBS_Get_server_id>
sched_info->cbs_server->task_id,
&server_id
);
sched_info->cbs_server->cbs_budget_overrun( server_id );
4b3c6: 206a 0018 moveal %a2@(24),%a0
4b3ca: 2f2e fffc movel %fp@(-4),%sp@-
4b3ce: 2068 000c moveal %a0@(12),%a0
4b3d2: 4e90 jsr %a0@
4b3d4: 4fef 000c lea %sp@(12),%sp
}
}
4b3d8: 246e fff8 moveal %fp@(-8),%a2
4b3dc: 4e5e unlk %fp <== NOT EXECUTED
0004af34 <_Scheduler_CBS_Cleanup>:
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulercbs.h>
int _Scheduler_CBS_Cleanup (void)
{
4af34: 4e56 0000 linkw %fp,#0
4af38: 2079 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a0
4af3e: 2f0a movel %a2,%sp@-
4af40: 2f02 movel %d2,%sp@-
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4af42: 4ab9 0006 2e3c tstl 62e3c <_Scheduler_CBS_Maximum_servers>
4af48: 6724 beqs 4af6e <_Scheduler_CBS_Cleanup+0x3a> <== NEVER TAKEN
4af4a: 4282 clrl %d2
if ( _Scheduler_CBS_Server_list[ i ] )
_Scheduler_CBS_Destroy_server( i );
4af4c: 45f9 0004 b03c lea 4b03c <_Scheduler_CBS_Destroy_server>,%a2
int _Scheduler_CBS_Cleanup (void)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( _Scheduler_CBS_Server_list[ i ] )
4af52: 4ab0 2c00 tstl %a0@(00000000,%d2:l:4)
4af56: 670c beqs 4af64 <_Scheduler_CBS_Cleanup+0x30>
_Scheduler_CBS_Destroy_server( i );
4af58: 2f02 movel %d2,%sp@-
4af5a: 4e92 jsr %a2@
4af5c: 2079 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a0
4af62: 588f addql #4,%sp
int _Scheduler_CBS_Cleanup (void)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4af64: 5282 addql #1,%d2
4af66: b4b9 0006 2e3c cmpl 62e3c <_Scheduler_CBS_Maximum_servers>,%d2
4af6c: 65e4 bcss 4af52 <_Scheduler_CBS_Cleanup+0x1e>
if ( _Scheduler_CBS_Server_list[ i ] )
_Scheduler_CBS_Destroy_server( i );
}
_Workspace_Free( _Scheduler_CBS_Server_list );
4af6e: 2f08 movel %a0,%sp@-
4af70: 4eb9 0004 ce4c jsr 4ce4c <_Workspace_Free>
return SCHEDULER_CBS_OK;
}
4af76: 242e fff8 movel %fp@(-8),%d2
4af7a: 4280 clrl %d0
4af7c: 246e fffc moveal %fp@(-4),%a2
4af80: 4e5e unlk %fp <== NOT EXECUTED
0004af84 <_Scheduler_CBS_Create_server>:
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
4af84: 4e56 fff0 linkw %fp,#-16
4af88: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
4af8c: 266e 0008 moveal %fp@(8),%a3
4af90: 246e 0010 moveal %fp@(16),%a2
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
4af94: 4aab 0004 tstl %a3@(4)
4af98: 6f00 0088 blew 4b022 <_Scheduler_CBS_Create_server+0x9e>
4af9c: 4a93 tstl %a3@
4af9e: 6f00 0082 blew 4b022 <_Scheduler_CBS_Create_server+0x9e>
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++ ) {
4afa2: 2239 0006 2e3c movel 62e3c <_Scheduler_CBS_Maximum_servers>,%d1
4afa8: 6766 beqs 4b010 <_Scheduler_CBS_Create_server+0x8c><== NEVER TAKEN
if ( !_Scheduler_CBS_Server_list[i] )
4afaa: 2279 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a1
4afb0: 4a91 tstl %a1@
4afb2: 6768 beqs 4b01c <_Scheduler_CBS_Create_server+0x98>
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulercbs.h>
int _Scheduler_CBS_Create_server (
4afb4: 41e9 0004 lea %a1@(4),%a0
4afb8: 4280 clrl %d0
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++ ) {
4afba: 5280 addql #1,%d0
4afbc: b280 cmpl %d0,%d1
4afbe: 6750 beqs 4b010 <_Scheduler_CBS_Create_server+0x8c>
if ( !_Scheduler_CBS_Server_list[i] )
4afc0: 4a98 tstl %a0@+
4afc2: 66f6 bnes 4afba <_Scheduler_CBS_Create_server+0x36>
4afc4: 2200 movel %d0,%d1
4afc6: e589 lsll #2,%d1
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
4afc8: 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 *)
4afcc: 49f1 1800 lea %a1@(00000000,%d1:l),%a4
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
4afd0: 2480 movel %d0,%a2@
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
4afd2: 4eb9 0004 ce30 jsr 4ce30 <_Workspace_Allocate>
the_server = _Scheduler_CBS_Server_list[*server_id];
4afd8: 2212 movel %a2@,%d1
if ( !the_server )
4afda: 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 *)
4afdc: 2880 movel %d0,%a4@
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
4afde: 2079 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a0
4afe4: 2070 1c00 moveal %a0@(00000000,%d1:l:4),%a0
if ( !the_server )
4afe8: 4a88 tstl %a0
4afea: 6742 beqs 4b02e <_Scheduler_CBS_Create_server+0xaa><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
4afec: 4280 clrl %d0
_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;
4afee: 2213 movel %a3@,%d1
4aff0: 242b 0004 movel %a3@(4),%d2
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
4aff4: 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;
4affa: 2141 0004 movel %d1,%a0@(4)
4affe: 2142 0008 movel %d2,%a0@(8)
the_server->task_id = -1;
4b002: 72ff moveq #-1,%d1
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
4b004: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
the_server->task_id = -1;
4b00a: 2081 movel %d1,%a0@
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
4b00c: 4e5e unlk %fp
4b00e: 4e75 rts
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
4b010: 70e6 moveq #-26,%d0
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
4b012: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4b018: 4e5e unlk %fp
4b01a: 4e75 rts
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( !_Scheduler_CBS_Server_list[i] )
4b01c: 4281 clrl %d1
4b01e: 4280 clrl %d0
4b020: 60a6 bras 4afc8 <_Scheduler_CBS_Create_server+0x44>
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;
4b022: 70ee moveq #-18,%d0
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
4b024: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4b02a: 4e5e unlk %fp
4b02c: 4e75 rts
*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;
4b02e: 70ef moveq #-17,%d0 <== NOT EXECUTED
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
4b030: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 <== NOT EXECUTED
4b036: 4e5e unlk %fp <== NOT EXECUTED
...
0004b0dc <_Scheduler_CBS_Detach_thread>:
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
4b0dc: 4e56 fff0 linkw %fp,#-16
4b0e0: 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);
4b0e4: 486e fffc pea %fp@(-4)
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
4b0e8: 242e 000c movel %fp@(12),%d2
4b0ec: 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);
4b0f0: 2f02 movel %d2,%sp@-
4b0f2: 4eb9 0004 be60 jsr 4be60 <_Thread_Get>
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
4b0f8: 508f addql #8,%sp
{
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
4b0fa: 2440 moveal %d0,%a2
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
4b0fc: 4a80 tstl %d0
4b0fe: 674a beqs 4b14a <_Scheduler_CBS_Detach_thread+0x6e>
_Thread_Enable_dispatch();
4b100: 4eb9 0004 be40 jsr 4be40 <_Thread_Enable_dispatch>
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
4b106: b6b9 0006 2e3c cmpl 62e3c <_Scheduler_CBS_Maximum_servers>,%d3
4b10c: 643c bccs 4b14a <_Scheduler_CBS_Detach_thread+0x6e>
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] )
4b10e: 2079 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a0
4b114: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0
4b118: 4a88 tstl %a0
4b11a: 673a beqs 4b156 <_Scheduler_CBS_Detach_thread+0x7a>
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
4b11c: b490 cmpl %a0@,%d2
4b11e: 662a bnes 4b14a <_Scheduler_CBS_Detach_thread+0x6e><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
4b120: 70ff moveq #-1,%d0
4b122: 2080 movel %d0,%a0@
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
4b124: 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;
4b128: 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;
4b12a: 42a8 0018 clrl %a0@(24)
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
4b12e: 256a 009c 0076 movel %a2@(156),%a2@(118)
the_thread->budget_callout = the_thread->Start.budget_callout;
4b134: 256a 00a0 007a movel %a2@(160),%a2@(122)
the_thread->is_preemptible = the_thread->Start.is_preemptible;
4b13a: 156a 009a 0070 moveb %a2@(154),%a2@(112)
return SCHEDULER_CBS_OK;
}
4b140: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
4b146: 4e5e unlk %fp
4b148: 4e75 rts
if ( the_thread ) {
_Thread_Enable_dispatch();
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
4b14a: 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;
}
4b14c: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
4b152: 4e5e unlk %fp
4b154: 4e75 rts
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;
4b156: 70e7 moveq #-25,%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;
}
4b158: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
4b15e: 4e5e unlk %fp
...
0004b338 <_Scheduler_CBS_Get_server_id>:
int _Scheduler_CBS_Get_server_id (
rtems_id task_id,
Scheduler_CBS_Server_id *server_id
)
{
4b338: 4e56 0000 linkw %fp,#0
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4b33c: 2239 0006 2e3c movel 62e3c <_Scheduler_CBS_Maximum_servers>,%d1
int _Scheduler_CBS_Get_server_id (
rtems_id task_id,
Scheduler_CBS_Server_id *server_id
)
{
4b342: 2f02 movel %d2,%sp@-
4b344: 242e 0008 movel %fp@(8),%d2
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4b348: 4a81 tstl %d1
4b34a: 6718 beqs 4b364 <_Scheduler_CBS_Get_server_id+0x2c><== NEVER TAKEN
4b34c: 2279 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a1
4b352: 4280 clrl %d0
if ( _Scheduler_CBS_Server_list[i] &&
4b354: 2059 moveal %a1@+,%a0
4b356: 4a88 tstl %a0
4b358: 6704 beqs 4b35e <_Scheduler_CBS_Get_server_id+0x26>
4b35a: b490 cmpl %a0@,%d2
4b35c: 670e beqs 4b36c <_Scheduler_CBS_Get_server_id+0x34>
rtems_id task_id,
Scheduler_CBS_Server_id *server_id
)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
4b35e: 5280 addql #1,%d0
4b360: b280 cmpl %d0,%d1
4b362: 66f0 bnes 4b354 <_Scheduler_CBS_Get_server_id+0x1c>
*server_id = i;
return SCHEDULER_CBS_OK;
}
}
return SCHEDULER_CBS_ERROR_NOSERVER;
}
4b364: 241f movel %sp@+,%d2
_Scheduler_CBS_Server_list[i]->task_id == task_id ) {
*server_id = i;
return SCHEDULER_CBS_OK;
}
}
return SCHEDULER_CBS_ERROR_NOSERVER;
4b366: 70e7 moveq #-25,%d0
}
4b368: 4e5e unlk %fp
4b36a: 4e75 rts
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( _Scheduler_CBS_Server_list[i] &&
_Scheduler_CBS_Server_list[i]->task_id == task_id ) {
*server_id = i;
4b36c: 206e 000c moveal %fp@(12),%a0
return SCHEDULER_CBS_OK;
}
}
return SCHEDULER_CBS_ERROR_NOSERVER;
}
4b370: 241f movel %sp@+,%d2
4b372: 4e5e unlk %fp
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( _Scheduler_CBS_Server_list[i] &&
_Scheduler_CBS_Server_list[i]->task_id == task_id ) {
*server_id = i;
4b374: 2080 movel %d0,%a0@
return SCHEDULER_CBS_OK;
4b376: 4280 clrl %d0
}
}
return SCHEDULER_CBS_ERROR_NOSERVER;
}
...
0004b3e0 <_Scheduler_CBS_Initialize>:
int _Scheduler_CBS_Initialize(void)
{
4b3e0: 4e56 0000 linkw %fp,#0
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
4b3e4: 2039 0006 2e3c movel 62e3c <_Scheduler_CBS_Maximum_servers>,%d0
4b3ea: e588 lsll #2,%d0
4b3ec: 2f00 movel %d0,%sp@-
4b3ee: 4eb9 0004 ce30 jsr 4ce30 <_Workspace_Allocate>
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
4b3f4: 588f addql #4,%sp
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
4b3f6: 2040 moveal %d0,%a0
4b3f8: 23c0 0006 4b72 movel %d0,64b72 <_Scheduler_CBS_Server_list>
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
4b3fe: 672c beqs 4b42c <_Scheduler_CBS_Initialize+0x4c> <== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
4b400: 2039 0006 2e3c movel 62e3c <_Scheduler_CBS_Maximum_servers>,%d0
4b406: 4281 clrl %d1
4b408: 4a80 tstl %d0
4b40a: 671a beqs 4b426 <_Scheduler_CBS_Initialize+0x46> <== NEVER TAKEN
_Scheduler_CBS_Server_list[i] = NULL;
4b40c: 42b0 1c00 clrl %a0@(00000000,%d1: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++) {
4b410: 5281 addql #1,%d1
4b412: b081 cmpl %d1,%d0
4b414: 6710 beqs 4b426 <_Scheduler_CBS_Initialize+0x46> <== NEVER TAKEN
4b416: 2079 0006 4b72 moveal 64b72 <_Scheduler_CBS_Server_list>,%a0
_Scheduler_CBS_Server_list[i] = NULL;
4b41c: 42b0 1c00 clrl %a0@(00000000,%d1: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++) {
4b420: 5281 addql #1,%d1
4b422: b081 cmpl %d1,%d0
4b424: 66f0 bnes 4b416 <_Scheduler_CBS_Initialize+0x36>
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
4b426: 4280 clrl %d0
}
4b428: 4e5e unlk %fp
4b42a: 4e75 rts
{
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;
4b42c: 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;
}
4b42e: 4e5e unlk %fp <== NOT EXECUTED
...
00049c78 <_Scheduler_CBS_Release_job>:
void _Scheduler_CBS_Release_job(
Thread_Control *the_thread,
uint32_t deadline
)
{
49c78: 4e56 0000 linkw %fp,#0
49c7c: 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;
49c80: 2268 0086 moveal %a0@(134),%a1
)
{
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
49c84: 2269 0018 moveal %a1@(24),%a1
(Scheduler_CBS_Server *) sched_info->cbs_server;
if (deadline) {
49c88: 4aae 000c tstl %fp@(12)
49c8c: 6732 beqs 49cc0 <_Scheduler_CBS_Release_job+0x48>
/* Initializing or shifting deadline. */
if (serv_info)
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
49c8e: 2039 0006 2994 movel 62994 <_Watchdog_Ticks_since_boot>,%d0
Scheduler_CBS_Server *serv_info =
(Scheduler_CBS_Server *) sched_info->cbs_server;
if (deadline) {
/* Initializing or shifting deadline. */
if (serv_info)
49c94: 4a89 tstl %a1
49c96: 6738 beqs 49cd0 <_Scheduler_CBS_Release_job+0x58>
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
49c98: d0a9 0004 addl %a1@(4),%d0
49c9c: 0880 001f bclr #31,%d0
new_priority = the_thread->Start.initial_priority;
}
/* Budget replenishment for the next job. */
if (serv_info)
the_thread->cpu_time_budget = serv_info->parameters.budget;
49ca0: 2169 0008 0072 movel %a1@(8),%a0@(114)
the_thread->real_priority = new_priority;
_Thread_Change_priority(the_thread, new_priority, true);
49ca6: 4878 0001 pea 1 <ADD>
49caa: 2f00 movel %d0,%sp@-
/* Budget replenishment for the next job. */
if (serv_info)
the_thread->cpu_time_budget = serv_info->parameters.budget;
the_thread->real_priority = new_priority;
49cac: 2140 0018 movel %d0,%a0@(24)
_Thread_Change_priority(the_thread, new_priority, true);
49cb0: 2f08 movel %a0,%sp@-
49cb2: 4eb9 0004 a14c jsr 4a14c <_Thread_Change_priority>
49cb8: 4fef 000c lea %sp@(12),%sp
}
49cbc: 4e5e unlk %fp
49cbe: 4e75 rts
new_priority = (_Watchdog_Ticks_since_boot + deadline)
& ~SCHEDULER_EDF_PRIO_MSB;
}
else {
/* Switch back to background priority. */
new_priority = the_thread->Start.initial_priority;
49cc0: 2028 00a8 movel %a0@(168),%d0
}
/* Budget replenishment for the next job. */
if (serv_info)
49cc4: 4a89 tstl %a1
49cc6: 67de beqs 49ca6 <_Scheduler_CBS_Release_job+0x2e><== NEVER TAKEN
the_thread->cpu_time_budget = serv_info->parameters.budget;
49cc8: 2169 0008 0072 movel %a1@(8),%a0@(114)
49cce: 60d6 bras 49ca6 <_Scheduler_CBS_Release_job+0x2e>
/* Initializing or shifting deadline. */
if (serv_info)
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
49cd0: d0ae 000c addl %fp@(12),%d0
/* Budget replenishment for the next job. */
if (serv_info)
the_thread->cpu_time_budget = serv_info->parameters.budget;
the_thread->real_priority = new_priority;
_Thread_Change_priority(the_thread, new_priority, true);
49cd4: 4878 0001 pea 1 <ADD>
/* Initializing or shifting deadline. */
if (serv_info)
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
49cd8: 0880 001f bclr #31,%d0
/* Budget replenishment for the next job. */
if (serv_info)
the_thread->cpu_time_budget = serv_info->parameters.budget;
the_thread->real_priority = new_priority;
_Thread_Change_priority(the_thread, new_priority, true);
49cdc: 2f00 movel %d0,%sp@-
/* Budget replenishment for the next job. */
if (serv_info)
the_thread->cpu_time_budget = serv_info->parameters.budget;
the_thread->real_priority = new_priority;
49cde: 2140 0018 movel %d0,%a0@(24)
_Thread_Change_priority(the_thread, new_priority, true);
49ce2: 2f08 movel %a0,%sp@-
49ce4: 4eb9 0004 a14c jsr 4a14c <_Thread_Change_priority>
49cea: 4fef 000c lea %sp@(12),%sp
}
49cee: 4e5e unlk %fp
...
00049cf4 <_Scheduler_CBS_Unblock>:
#include <rtems/score/schedulercbs.h>
void _Scheduler_CBS_Unblock(
Thread_Control *the_thread
)
{
49cf4: 4e56 0000 linkw %fp,#0
49cf8: 2f0a movel %a2,%sp@-
49cfa: 246e 0008 moveal %fp@(8),%a2
49cfe: 2f02 movel %d2,%sp@-
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server *serv_info;
Priority_Control new_priority;
_Scheduler_EDF_Enqueue(the_thread);
49d00: 2f0a movel %a2,%sp@-
49d02: 4eb9 0004 9e18 jsr 49e18 <_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;
49d08: 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) {
49d0c: 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;
49d0e: 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) {
49d12: 4a88 tstl %a0
49d14: 6700 0094 beqw 49daa <_Scheduler_CBS_Unblock+0xb6>
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 -
49d18: 222a 0018 movel %a2@(24),%d1
49d1c: 2401 movel %d1,%d2
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
49d1e: 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 -
49d22: 2039 0006 2994 movel 62994 <_Watchdog_Ticks_since_boot>,%d0
49d28: 9480 subl %d0,%d2
49d2a: 2002 movel %d2,%d0
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
49d2c: 4c11 0800 mulsl %a1@,%d0
49d30: 43ea 0072 lea %a2@(114),%a1
49d34: 2428 0008 movel %a0@(8),%d2
49d38: 4c11 2800 mulsl %a1@,%d2
49d3c: b480 cmpl %d0,%d2
49d3e: 6c6a bges 49daa <_Scheduler_CBS_Unblock+0xb6>
/* Put late unblocked task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
49d40: 206a 00a8 moveal %a2@(168),%a0
if ( the_thread->real_priority != new_priority )
49d44: b1c1 cmpal %d1,%a0
49d46: 6704 beqs 49d4c <_Scheduler_CBS_Unblock+0x58>
the_thread->real_priority = new_priority;
49d48: 2548 0018 movel %a0,%a2@(24)
if ( the_thread->current_priority != new_priority )
49d4c: 202a 0014 movel %a2@(20),%d0
49d50: b1c0 cmpal %d0,%a0
49d52: 6716 beqs 49d6a <_Scheduler_CBS_Unblock+0x76>
_Thread_Change_priority(the_thread, new_priority, true);
49d54: 4878 0001 pea 1 <ADD>
49d58: 2f08 movel %a0,%sp@-
49d5a: 2f0a movel %a2,%sp@-
49d5c: 4eb9 0004 a14c jsr 4a14c <_Thread_Change_priority>
49d62: 202a 0014 movel %a2@(20),%d0
49d66: 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,
49d6a: 2079 0006 2cfa moveal 62cfa <_Per_CPU_Information+0x12>,%a0
49d70: 2f28 0014 movel %a0@(20),%sp@-
49d74: 2079 0006 1000 moveal 61000 <_Scheduler+0x30>,%a0
49d7a: 2f00 movel %d0,%sp@-
49d7c: 4e90 jsr %a0@
49d7e: 508f addql #8,%sp
49d80: 4a80 tstl %d0
49d82: 6f1a bles 49d9e <_Scheduler_CBS_Unblock+0xaa>
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
49d84: 2079 0006 2cf6 moveal 62cf6 <_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;
49d8a: 23ca 0006 2cfa movel %a2,62cfa <_Per_CPU_Information+0x12>
if ( _Thread_Executing->is_preemptible ||
49d90: 4a28 0070 tstb %a0@(112)
49d94: 671a beqs 49db0 <_Scheduler_CBS_Unblock+0xbc>
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
49d96: 7001 moveq #1,%d0
49d98: 13c0 0006 2cf4 moveb %d0,62cf4 <_Per_CPU_Information+0xc>
}
}
49d9e: 242e fff8 movel %fp@(-8),%d2
49da2: 246e fffc moveal %fp@(-4),%a2
49da6: 4e5e unlk %fp
49da8: 4e75 rts
49daa: 202a 0014 movel %a2@(20),%d0
49dae: 60ba bras 49d6a <_Scheduler_CBS_Unblock+0x76>
* 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;
if ( _Thread_Executing->is_preemptible ||
49db0: 4aaa 0014 tstl %a2@(20)
49db4: 66e8 bnes 49d9e <_Scheduler_CBS_Unblock+0xaa> <== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
49db6: 7001 moveq #1,%d0 <== NOT EXECUTED
49db8: 13c0 0006 2cf4 moveb %d0,62cf4 <_Per_CPU_Information+0xc> <== NOT EXECUTED
49dbe: 60de bras 49d9e <_Scheduler_CBS_Unblock+0xaa> <== NOT EXECUTED
00049c44 <_Scheduler_EDF_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
49c44: 4e56 0000 linkw %fp,#0
49c48: 2f0a movel %a2,%sp@-
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
49c4a: 4878 0018 pea 18 <OPER2+0x4>
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
49c4e: 246e 0008 moveal %fp@(8),%a2
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
49c52: 4eb9 0004 b628 jsr 4b628 <_Workspace_Allocate>
if ( sched ) {
49c58: 588f addql #4,%sp
49c5a: 4a80 tstl %d0
49c5c: 670e beqs 49c6c <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN
the_thread->scheduler_info = sched;
49c5e: 2540 0086 movel %d0,%a2@(134)
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
49c62: 2040 moveal %d0,%a0
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
49c64: 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;
49c66: 208a movel %a2,%a0@
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
49c68: 2141 0014 movel %d1,%a0@(20)
}
return sched;
}
49c6c: 246e fffc moveal %fp@(-4),%a2
49c70: 4e5e unlk %fp <== NOT EXECUTED
00049dc0 <_Scheduler_EDF_Block>:
#include <rtems/score/thread.h>
void _Scheduler_EDF_Block(
Thread_Control *the_thread
)
{
49dc0: 4e56 0000 linkw %fp,#0
49dc4: 2f02 movel %d2,%sp@-
49dc6: 242e 0008 movel %fp@(8),%d2
_Scheduler_EDF_Extract( the_thread );
49dca: 2f02 movel %d2,%sp@-
49dcc: 4eb9 0004 9e48 jsr 49e48 <_Scheduler_EDF_Extract>
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
49dd2: 588f addql #4,%sp
49dd4: b4b9 0006 2cfa cmpl 62cfa <_Per_CPU_Information+0x12>,%d2
49dda: 6720 beqs 49dfc <_Scheduler_EDF_Block+0x3c>
_Scheduler_EDF_Schedule();
if ( _Thread_Is_executing( the_thread ) )
49ddc: b4b9 0006 2cf6 cmpl 62cf6 <_Per_CPU_Information+0xe>,%d2
49de2: 6708 beqs 49dec <_Scheduler_EDF_Block+0x2c> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
}
49de4: 242e fffc movel %fp@(-4),%d2
49de8: 4e5e unlk %fp
49dea: 4e75 rts
49dec: 242e fffc movel %fp@(-4),%d2
49df0: 4e5e unlk %fp
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_EDF_Schedule();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
49df2: 7001 moveq #1,%d0
49df4: 13c0 0006 2cf4 moveb %d0,62cf4 <_Per_CPU_Information+0xc>
}
49dfa: 4e75 rts
_Scheduler_EDF_Extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_EDF_Schedule();
49dfc: 4eb9 0004 9f28 jsr 49f28 <_Scheduler_EDF_Schedule>
if ( _Thread_Is_executing( the_thread ) )
49e02: b4b9 0006 2cf6 cmpl 62cf6 <_Per_CPU_Information+0xe>,%d2
49e08: 66da bnes 49de4 <_Scheduler_EDF_Block+0x24> <== NEVER TAKEN
49e0a: 60e0 bras 49dec <_Scheduler_EDF_Block+0x2c>
00049e74 <_Scheduler_EDF_Free>:
#include <rtems/score/wkspace.h>
void _Scheduler_EDF_Free(
Thread_Control *the_thread
)
{
49e74: 4e56 0000 linkw %fp,#0
49e78: 206e 0008 moveal %fp@(8),%a0
_Workspace_Free( the_thread->scheduler_info );
49e7c: 2d68 0086 0008 movel %a0@(134),%fp@(8)
}
49e82: 4e5e unlk %fp
void _Scheduler_EDF_Free(
Thread_Control *the_thread
)
{
_Workspace_Free( the_thread->scheduler_info );
49e84: 4ef9 0004 b6d0 jmp 4b6d0 <_Workspace_Free>
...
00049e48 <_Scheduler_EDF_Unblock>:
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
49e48: 4e56 0000 linkw %fp,#0
49e4c: 2f0a movel %a2,%sp@-
49e4e: 246e 0008 moveal %fp@(8),%a2
_Scheduler_EDF_Enqueue(the_thread);
49e52: 2f0a movel %a2,%sp@-
49e54: 4eb9 0004 9ccc jsr 49ccc <_Scheduler_EDF_Enqueue>
49e5a: 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(
49e5e: 2079 0006 2c6a moveal 62c6a <_Per_CPU_Information+0x12>,%a0
49e64: 2f28 0014 movel %a0@(20),%sp@-
49e68: 2079 0006 0f70 moveal 60f70 <_Scheduler+0x30>,%a0
49e6e: 4e90 jsr %a0@
49e70: 4fef 000c lea %sp@(12),%sp
49e74: 4a80 tstl %d0
49e76: 6d08 blts 49e80 <_Scheduler_EDF_Unblock+0x38>
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
}
}
49e78: 246e fffc moveal %fp@(-4),%a2
49e7c: 4e5e unlk %fp
49e7e: 4e75 rts
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
49e80: 2079 0006 2c66 moveal 62c66 <_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;
49e86: 23ca 0006 2c6a movel %a2,62c6a <_Per_CPU_Information+0x12>
if ( _Thread_Executing->is_preemptible ||
49e8c: 4a28 0070 tstb %a0@(112)
49e90: 6710 beqs 49ea2 <_Scheduler_EDF_Unblock+0x5a>
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
49e92: 7001 moveq #1,%d0
49e94: 13c0 0006 2c64 moveb %d0,62c64 <_Per_CPU_Information+0xc>
}
}
49e9a: 246e fffc moveal %fp@(-4),%a2
49e9e: 4e5e unlk %fp
49ea0: 4e75 rts
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
49ea2: 4aaa 0014 tstl %a2@(20)
49ea6: 66d0 bnes 49e78 <_Scheduler_EDF_Unblock+0x30> <== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
49ea8: 7001 moveq #1,%d0 <== NOT EXECUTED
49eaa: 13c0 0006 2c64 moveb %d0,62c64 <_Per_CPU_Information+0xc> <== NOT EXECUTED
49eb0: 60e8 bras 49e9a <_Scheduler_EDF_Unblock+0x52> <== NOT EXECUTED
...
00049288 <_Scheduler_Handler_initialization>:
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
void _Scheduler_Handler_initialization(void)
{
49288: 4e56 0000 linkw %fp,#0
(*_Scheduler.Operations.initialize)();
}
4928c: 4e5e unlk %fp
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
void _Scheduler_Handler_initialization(void)
{
(*_Scheduler.Operations.initialize)();
4928e: 2279 0005 f774 moveal 5f774 <_Scheduler+0x4>,%a1
49294: 4ed1 jmp %a1@
...
000492b4 <_Scheduler_priority_Block>:
#include <rtems/score/thread.h>
void _Scheduler_priority_Block(
Thread_Control *the_thread
)
{
492b4: 4e56 0000 linkw %fp,#0
492b8: 206e 0008 moveal %fp@(8),%a0
492bc: 2f0b movel %a3,%sp@-
492be: 2f0a movel %a2,%sp@-
)
{
Scheduler_priority_Per_thread *sched_info;
Chain_Control *ready;
sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info;
492c0: 2468 0086 moveal %a0@(134),%a2
ready = sched_info->ready_chain;
492c4: 2252 moveal %a2@,%a1
if ( _Chain_Has_only_one_node( ready ) ) {
492c6: 2029 0008 movel %a1@(8),%d0
492ca: b091 cmpl %a1@,%d0
492cc: 6700 0088 beqw 49356 <_Scheduler_priority_Block+0xa2>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
492d0: 2450 moveal %a0@,%a2
previous = the_node->previous;
492d2: 2268 0004 moveal %a0@(4),%a1
next->previous = previous;
492d6: 2549 0004 movel %a1,%a2@(4)
previous->next = next;
492da: 228a movel %a2,%a1@
_Scheduler_priority_Ready_queue_extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
492dc: b1f9 0006 1432 cmpal 61432 <_Per_CPU_Information+0x12>,%a0
492e2: 6720 beqs 49304 <_Scheduler_priority_Block+0x50>
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
492e4: b1f9 0006 142e cmpal 6142e <_Per_CPU_Information+0xe>,%a0
492ea: 6708 beqs 492f4 <_Scheduler_priority_Block+0x40>
_Thread_Dispatch_necessary = true;
}
492ec: 245f moveal %sp@+,%a2
492ee: 265f moveal %sp@+,%a3
492f0: 4e5e unlk %fp
492f2: 4e75 rts
492f4: 245f moveal %sp@+,%a2
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
492f6: 7001 moveq #1,%d0
}
492f8: 265f moveal %sp@+,%a3
492fa: 4e5e unlk %fp
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
492fc: 13c0 0006 142c moveb %d0,6142c <_Per_CPU_Information+0xc>
}
49302: 4e75 rts
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
49304: 3039 0006 1444 movew 61444 <_Priority_Major_bit_map>,%d0
4930a: 4840 swap %d0
4930c: 04c0 ff1 %d0
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
4930e: 43f9 0006 1448 lea 61448 <_Priority_Bit_map>,%a1
49314: 0280 0000 ffff andil #65535,%d0
4931a: 3231 0a00 movew %a1@(00000000,%d0:l:2),%d1
4931e: 4841 swap %d1
49320: 04c1 ff1 %d1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
49322: 2279 0005 f770 moveal 5f770 <_Scheduler>,%a1
return (_Priority_Bits_index( major ) << 4) +
49328: 0281 0000 ffff andil #65535,%d1
4932e: e988 lsll #4,%d0
49330: d081 addl %d1,%d0
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
49332: 2200 movel %d0,%d1
49334: e988 lsll #4,%d0
49336: e589 lsll #2,%d1
49338: 9081 subl %d1,%d0
4933a: d3c0 addal %d0,%a1
4933c: 2019 movel %a1@+,%d0
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
4933e: b3c0 cmpal %d0,%a1
49340: 56c1 sne %d1
49342: 49c1 extbl %d1
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
49344: c081 andl %d1,%d0
49346: 23c0 0006 1432 movel %d0,61432 <_Per_CPU_Information+0x12>
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
4934c: b1f9 0006 142e cmpal 6142e <_Per_CPU_Information+0xe>,%a0
49352: 6698 bnes 492ec <_Scheduler_priority_Block+0x38>
49354: 609e bras 492f4 <_Scheduler_priority_Block+0x40>
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor &= the_priority_map->block_minor;
49356: 266a 0004 moveal %a2@(4),%a3
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 );
4935a: 2209 movel %a1,%d1
4935c: 5881 addql #4,%d1
4935e: 2281 movel %d1,%a1@
49360: 3013 movew %a3@,%d0
49362: 322a 000e movew %a2@(14),%d1
head->next = tail;
head->previous = NULL;
49366: 42a9 0004 clrl %a1@(4)
4936a: c081 andl %d1,%d0
tail->previous = head;
4936c: 2349 0008 movel %a1,%a1@(8)
49370: 3680 movew %d0,%a3@
if ( *the_priority_map->minor == 0 )
49372: 6600 ff68 bnew 492dc <_Scheduler_priority_Block+0x28>
_Priority_Major_bit_map &= the_priority_map->block_major;
49376: 3239 0006 1444 movew 61444 <_Priority_Major_bit_map>,%d1
4937c: 302a 000c movew %a2@(12),%d0
49380: c081 andl %d1,%d0
49382: 33c0 0006 1444 movew %d0,61444 <_Priority_Major_bit_map>
{
_Scheduler_priority_Ready_queue_extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
49388: b1f9 0006 1432 cmpal 61432 <_Per_CPU_Information+0x12>,%a0
4938e: 6600 ff54 bnew 492e4 <_Scheduler_priority_Block+0x30>
49392: 6000 ff70 braw 49304 <_Scheduler_priority_Block+0x50>
...
0004948c <_Scheduler_priority_Free>:
#include <rtems/score/wkspace.h>
void _Scheduler_priority_Free (
Thread_Control *the_thread
)
{
4948c: 4e56 0000 linkw %fp,#0
49490: 206e 0008 moveal %fp@(8),%a0
_Workspace_Free( the_thread->scheduler_info );
49494: 2d68 0086 0008 movel %a0@(134),%fp@(8)
}
4949a: 4e5e unlk %fp
void _Scheduler_priority_Free (
Thread_Control *the_thread
)
{
_Workspace_Free( the_thread->scheduler_info );
4949c: 4ef9 0004 acdc jmp 4acdc <_Workspace_Free>
...
00049588 <_Scheduler_priority_Tick>:
#include <rtems/system.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Tick( void )
{
49588: 4e56 0000 linkw %fp,#0
4958c: 2f0a movel %a2,%sp@-
Thread_Control *executing;
executing = _Thread_Executing;
4958e: 2479 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a2
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
49594: 4a2a 0070 tstb %a2@(112)
49598: 6720 beqs 495ba <_Scheduler_priority_Tick+0x32>
return;
if ( !_States_Is_ready( executing->current_state ) )
4959a: 4aaa 0010 tstl %a2@(16)
4959e: 661a bnes 495ba <_Scheduler_priority_Tick+0x32>
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
495a0: 202a 0076 movel %a2@(118),%d0
495a4: 7201 moveq #1,%d1
495a6: b280 cmpl %d0,%d1
495a8: 6210 bhis 495ba <_Scheduler_priority_Tick+0x32>
495aa: 123c 0002 moveb #2,%d1
495ae: b280 cmpl %d0,%d1
495b0: 642e bccs 495e0 <_Scheduler_priority_Tick+0x58>
495b2: 123c 0003 moveb #3,%d1
495b6: b280 cmpl %d0,%d1
495b8: 6708 beqs 495c2 <_Scheduler_priority_Tick+0x3a> <== ALWAYS TAKEN
if ( --executing->cpu_time_budget == 0 )
(*executing->budget_callout)( executing );
break;
#endif
}
}
495ba: 246e fffc moveal %fp@(-4),%a2
495be: 4e5e unlk %fp
495c0: 4e75 rts
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
495c2: 202a 0072 movel %a2@(114),%d0
495c6: 5380 subql #1,%d0
495c8: 2540 0072 movel %d0,%a2@(114)
495cc: 66ec bnes 495ba <_Scheduler_priority_Tick+0x32>
(*executing->budget_callout)( executing );
495ce: 2f0a movel %a2,%sp@-
495d0: 206a 007a moveal %a2@(122),%a0
495d4: 4e90 jsr %a0@
break;
#endif
}
}
495d6: 246e fffc moveal %fp@(-4),%a2
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
(*executing->budget_callout)( executing );
495da: 588f addql #4,%sp
break;
#endif
}
}
495dc: 4e5e unlk %fp
495de: 4e75 rts
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 ) {
495e0: 202a 0072 movel %a2@(114),%d0
495e4: 5380 subql #1,%d0
495e6: 2540 0072 movel %d0,%a2@(114)
495ea: 6ece bgts 495ba <_Scheduler_priority_Tick+0x32>
* always operates on the scheduler that 'owns' the currently executing
* thread.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
{
_Scheduler.Operations.yield();
495ec: 2079 0005 f77c moveal 5f77c <_Scheduler+0xc>,%a0
495f2: 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;
495f4: 41f9 0006 0f9e lea 60f9e <_Thread_Ticks_per_timeslice>,%a0
495fa: 2550 0072 movel %a0@,%a2@(114)
if ( --executing->cpu_time_budget == 0 )
(*executing->budget_callout)( executing );
break;
#endif
}
}
495fe: 246e fffc moveal %fp@(-4),%a2
49602: 4e5e unlk %fp
...
00049ca8 <_Scheduler_simple_Block>:
#include <rtems/score/schedulersimple.h>
void _Scheduler_simple_Block(
Thread_Control *the_thread
)
{
49ca8: 4e56 0000 linkw %fp,#0
49cac: 2f02 movel %d2,%sp@-
49cae: 242e 0008 movel %fp@(8),%d2
_Scheduler_simple_Extract(the_thread);
49cb2: 2f02 movel %d2,%sp@-
49cb4: 4eb9 0004 9d0c jsr 49d0c <_Scheduler_simple_Extract>
if ( _Thread_Is_heir( the_thread ) )
49cba: 588f addql #4,%sp
49cbc: b4b9 0006 237a cmpl 6237a <_Per_CPU_Information+0x12>,%d2
49cc2: 6720 beqs 49ce4 <_Scheduler_simple_Block+0x3c>
_Scheduler_simple_Schedule();
if ( _Thread_Is_executing( the_thread ) )
49cc4: b4b9 0006 2376 cmpl 62376 <_Per_CPU_Information+0xe>,%d2
49cca: 6708 beqs 49cd4 <_Scheduler_simple_Block+0x2c> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
}
49ccc: 242e fffc movel %fp@(-4),%d2
49cd0: 4e5e unlk %fp
49cd2: 4e75 rts
49cd4: 242e fffc movel %fp@(-4),%d2
49cd8: 4e5e unlk %fp
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_simple_Schedule();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
49cda: 7001 moveq #1,%d0
49cdc: 13c0 0006 2374 moveb %d0,62374 <_Per_CPU_Information+0xc>
}
49ce2: 4e75 rts
)
{
_Scheduler_simple_Extract(the_thread);
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_simple_Schedule();
49ce4: 4eb9 0004 9e08 jsr 49e08 <_Scheduler_simple_Schedule>
if ( _Thread_Is_executing( the_thread ) )
49cea: b4b9 0006 2376 cmpl 62376 <_Per_CPU_Information+0xe>,%d2
49cf0: 66da bnes 49ccc <_Scheduler_simple_Block+0x24> <== NEVER TAKEN
49cf2: 60e0 bras 49cd4 <_Scheduler_simple_Block+0x2c>
00049c4c <_TOD_Set_with_timestamp>:
#include <rtems/score/watchdog.h>
void _TOD_Set_with_timestamp(
const Timestamp_Control *tod
)
{
49c4c: 4e56 ffec linkw %fp,#-20
49c50: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
49c54: 246e 0008 moveal %fp@(8),%a2
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
49c58: 47f9 0005 d728 lea 5d728 <__divdi3>,%a3
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
_TOD_Activate();
_Thread_Enable_dispatch();
}
49c5e: 2412 movel %a2@,%d2
49c60: 262a 0004 movel %a2@(4),%d3
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
49c64: 2f3c 3b9a ca00 movel #1000000000,%sp@-
49c6a: 42a7 clrl %sp@-
49c6c: 2f03 movel %d3,%sp@-
49c6e: 2f02 movel %d2,%sp@-
49c70: 4eb9 0005 db88 jsr 5db88 <__moddi3>
49c76: 4fef 0010 lea %sp@(16),%sp
49c7a: 2801 movel %d1,%d4
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
49c7c: 2f3c 3b9a ca00 movel #1000000000,%sp@-
49c82: 42a7 clrl %sp@-
49c84: 2f03 movel %d3,%sp@-
49c86: 2f02 movel %d2,%sp@-
49c88: 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;
49c8a: 2039 0006 3a86 movel 63a86 <_Thread_Dispatch_disable_level>,%d0
++level;
49c90: 5280 addql #1,%d0
49c92: 4fef 0010 lea %sp@(16),%sp
49c96: 2401 movel %d1,%d2
_Thread_Dispatch_disable_level = level;
49c98: 23c0 0006 3a86 movel %d0,63a86 <_Thread_Dispatch_disable_level>
49c9e: 2f3c 3b9a ca00 movel #1000000000,%sp@-
49ca4: 42a7 clrl %sp@-
49ca6: 2f39 0006 3a2c movel 63a2c <_TOD+0x4>,%sp@-
49cac: 2f39 0006 3a28 movel 63a28 <_TOD>,%sp@-
49cb2: 4e93 jsr %a3@
49cb4: 4fef 0010 lea %sp@(16),%sp
_Thread_Disable_dispatch();
_TOD_Deactivate();
seconds_now = _TOD_Seconds_since_epoch();
if ( seconds_next < seconds_now )
49cb8: b282 cmpl %d2,%d1
49cba: 6244 bhis 49d00 <_TOD_Set_with_timestamp+0xb4>
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
_Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units );
49cbc: 9481 subl %d1,%d2
49cbe: 2f02 movel %d2,%sp@-
49cc0: 42a7 clrl %sp@-
49cc2: 4879 0006 3b16 pea 63b16 <_Watchdog_Seconds_chain>
49cc8: 4eb9 0004 c364 jsr 4c364 <_Watchdog_Adjust>
49cce: 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;
49cd2: 2012 movel %a2@,%d0
49cd4: 222a 0004 movel %a2@(4),%d1
_TOD.seconds_trigger = nanoseconds;
49cd8: 23c4 0006 3a38 movel %d4,63a38 <_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;
49cde: 23c0 0006 3a28 movel %d0,63a28 <_TOD>
49ce4: 23c1 0006 3a2c movel %d1,63a2c <_TOD+0x4>
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
_TOD_Activate();
_Thread_Enable_dispatch();
}
49cea: 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;
49cf0: 7201 moveq #1,%d1
_TOD_Activate();
_Thread_Enable_dispatch();
}
49cf2: 4e5e unlk %fp
else
_Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
_TOD.now = *tod;
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
49cf4: 13c1 0006 3a3c moveb %d1,63a3c <_TOD+0x14>
_TOD_Activate();
_Thread_Enable_dispatch();
49cfa: 4ef9 0004 b5e4 jmp 4b5e4 <_Thread_Enable_dispatch>
49d00: 9282 subl %d2,%d1
49d02: 2f01 movel %d1,%sp@-
49d04: 4878 0001 pea 1 <ADD>
49d08: 4879 0006 3b16 pea 63b16 <_Watchdog_Seconds_chain>
49d0e: 4eb9 0004 c364 jsr 4c364 <_Watchdog_Adjust>
49d14: 4fef 000c lea %sp@(12),%sp
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;
49d18: 2012 movel %a2@,%d0
49d1a: 222a 0004 movel %a2@(4),%d1
_TOD.seconds_trigger = nanoseconds;
49d1e: 23c4 0006 3a38 movel %d4,63a38 <_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;
49d24: 23c0 0006 3a28 movel %d0,63a28 <_TOD>
49d2a: 23c1 0006 3a2c movel %d1,63a2c <_TOD+0x4>
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
_TOD_Activate();
_Thread_Enable_dispatch();
}
49d30: 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;
49d36: 7201 moveq #1,%d1
_TOD_Activate();
_Thread_Enable_dispatch();
}
49d38: 4e5e unlk %fp
else
_Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now );
_TOD.now = *tod;
_TOD.seconds_trigger = nanoseconds;
_TOD.is_set = true;
49d3a: 13c1 0006 3a3c moveb %d1,63a3c <_TOD+0x14>
_TOD_Activate();
_Thread_Enable_dispatch();
49d40: 4ef9 0004 b5e4 jmp 4b5e4 <_Thread_Enable_dispatch>
...
00048210 <_TOD_Validate>:
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
48210: 43f9 0005 fa9e lea 5fa9e <Configuration+0xc>,%a1
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
48216: 4e56 0000 linkw %fp,#0
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
4821a: 203c 000f 4240 movel #1000000,%d0
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
48220: 206e 0008 moveal %fp@(8),%a0
48224: 2f02 movel %d2,%sp@-
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
48226: 4c51 0000 remul %a1@,%d0,%d0
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
4822a: 4a88 tstl %a0
4822c: 6758 beqs 48286 <_TOD_Validate+0x76> <== NEVER TAKEN
4822e: b0a8 0018 cmpl %a0@(24),%d0
48232: 6352 blss 48286 <_TOD_Validate+0x76>
(the_tod->ticks >= ticks_per_second) ||
48234: 703b moveq #59,%d0
48236: b0a8 0014 cmpl %a0@(20),%d0
4823a: 654a bcss 48286 <_TOD_Validate+0x76>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
4823c: b0a8 0010 cmpl %a0@(16),%d0
48240: 6544 bcss 48286 <_TOD_Validate+0x76>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
48242: 7217 moveq #23,%d1
48244: b2a8 000c cmpl %a0@(12),%d1
48248: 653c bcss 48286 <_TOD_Validate+0x76>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
4824a: 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) ||
4824e: 6736 beqs 48286 <_TOD_Validate+0x76> <== NEVER TAKEN
(the_tod->month == 0) ||
48250: 740c moveq #12,%d2
48252: b480 cmpl %d0,%d2
48254: 6530 bcss 48286 <_TOD_Validate+0x76>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
48256: 2210 movel %a0@,%d1
(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) ||
48258: 0c81 0000 07c3 cmpil #1987,%d1
4825e: 6326 blss 48286 <_TOD_Validate+0x76>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
48260: 2068 0008 moveal %a0@(8),%a0
(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) ||
48264: 4a88 tstl %a0
48266: 671e beqs 48286 <_TOD_Validate+0x76> <== NEVER TAKEN
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
48268: 143c 0003 moveb #3,%d2
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
4826c: 43f9 0006 0e28 lea 60e28 <_TOD_Days_per_month>,%a1
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
48272: c282 andl %d2,%d1
48274: 6618 bnes 4828e <_TOD_Validate+0x7e>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
48276: 2031 0c34 movel %a1@(00000034,%d0:l:4),%d0
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
if ( the_tod->day > days_in_month )
4827a: b1c0 cmpal %d0,%a0
4827c: 53c0 sls %d0
4827e: 4480 negl %d0
return false;
return true;
}
48280: 241f movel %sp@+,%d2
48282: 4e5e unlk %fp
48284: 4e75 rts
48286: 241f movel %sp@+,%d2
48288: 4e5e unlk %fp
(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;
4828a: 4200 clrb %d0
if ( the_tod->day > days_in_month )
return false;
return true;
}
4828c: 4e75 rts
return false;
if ( (the_tod->year % 4) == 0 )
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
4828e: 2031 0c00 movel %a1@(00000000,%d0:l:4),%d0
if ( the_tod->day > days_in_month )
48292: b1c0 cmpal %d0,%a0
48294: 53c0 sls %d0
48296: 4480 negl %d0
48298: 60e6 bras 48280 <_TOD_Validate+0x70>
...
000497ec <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
497ec: 4e56 fff0 linkw %fp,#-16
497f0: 48d7 041c moveml %d2-%d4/%a2,%sp@
497f4: 246e 0008 moveal %fp@(8),%a2
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
497f8: 262a 0010 movel %a2@(16),%d3
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
497fc: 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 );
49800: 2f0a movel %a2,%sp@-
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
49802: 182e 0013 moveb %fp@(19),%d4
/*
* 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 );
49806: 4eb9 0004 a64c jsr 4a64c <_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 )
4980c: 588f addql #4,%sp
4980e: b4aa 0014 cmpl %a2@(20),%d2
49812: 670c beqs 49820 <_Thread_Change_priority+0x34>
_Thread_Set_priority( the_thread, new_priority );
49814: 2f02 movel %d2,%sp@-
49816: 2f0a movel %a2,%sp@-
49818: 4eb9 0004 a5e8 jsr 4a5e8 <_Thread_Set_priority>
4981e: 508f addql #8,%sp
_ISR_Disable( level );
49820: 203c 0000 0700 movel #1792,%d0
49826: 40c2 movew %sr,%d2
49828: 8082 orl %d2,%d0
4982a: 46c0 movew %d0,%sr
/*
* 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;
4982c: 202a 0010 movel %a2@(16),%d0
if ( state != STATES_TRANSIENT ) {
49830: 7204 moveq #4,%d1
49832: b280 cmpl %d0,%d1
49834: 6738 beqs 4986e <_Thread_Change_priority+0x82>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
49836: 44c3 movew %d3,%ccr
49838: 6708 beqs 49842 <_Thread_Change_priority+0x56> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
4983a: 72fb moveq #-5,%d1
4983c: c280 andl %d0,%d1
4983e: 2541 0010 movel %d1,%a2@(16)
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
_ISR_Enable( level );
49842: 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);
49844: 0280 0003 bee0 andil #245472,%d0
if ( _States_Is_waiting_on_thread_queue( state ) ) {
4984a: 660a bnes 49856 <_Thread_Change_priority+0x6a>
if ( !_Thread_Is_executing_also_the_heir() &&
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
_ISR_Enable( level );
}
4984c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
49852: 4e5e unlk %fp
49854: 4e75 rts
/* 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 );
49856: 2d4a 000c movel %a2,%fp@(12)
4985a: 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 );
}
49860: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
49866: 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 );
49868: 4ef9 0004 a538 jmp 4a538 <_Thread_queue_Requeue>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
4986e: 44c3 movew %d3,%ccr
49870: 6714 beqs 49886 <_Thread_Change_priority+0x9a> <== 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 );
49872: 42aa 0010 clrl %a2@(16)
if ( prepend_it )
49876: 4a04 tstb %d4
49878: 6748 beqs 498c2 <_Thread_Change_priority+0xd6>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
4987a: 2f0a movel %a2,%sp@-
4987c: 2079 0005 f798 moveal 5f798 <_Scheduler+0x28>,%a0
49882: 4e90 jsr %a0@
49884: 588f addql #4,%sp
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
49886: 203c 0000 0700 movel #1792,%d0
4988c: 46c2 movew %d2,%sr
4988e: 8082 orl %d2,%d0
49890: 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();
49892: 2079 0005 f778 moveal 5f778 <_Scheduler+0x8>,%a0
49898: 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 );
4989a: 2079 0006 142e moveal 6142e <_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() &&
498a0: b1f9 0006 1432 cmpal 61432 <_Per_CPU_Information+0x12>,%a0
498a6: 670e beqs 498b6 <_Thread_Change_priority+0xca>
498a8: 4a28 0070 tstb %a0@(112)
498ac: 6708 beqs 498b6 <_Thread_Change_priority+0xca>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
498ae: 7001 moveq #1,%d0
498b0: 13c0 0006 142c moveb %d0,6142c <_Per_CPU_Information+0xc>
_ISR_Enable( level );
498b6: 46c2 movew %d2,%sr
}
498b8: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
498be: 4e5e unlk %fp
498c0: 4e75 rts
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
498c2: 2f0a movel %a2,%sp@-
498c4: 2079 0005 f794 moveal 5f794 <_Scheduler+0x24>,%a0
498ca: 4e90 jsr %a0@
498cc: 588f addql #4,%sp
498ce: 60b6 bras 49886 <_Thread_Change_priority+0x9a>
0004992c <_Thread_Close>:
void _Thread_Close(
Objects_Information *information,
Thread_Control *the_thread
)
{
4992c: 4e56 0000 linkw %fp,#0
49930: 2f0b movel %a3,%sp@-
49932: 266e 0008 moveal %fp@(8),%a3
49936: 2f0a movel %a2,%sp@-
49938: 246e 000c moveal %fp@(12),%a2
RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
Objects_Information *information,
Objects_Control *the_object
)
{
_Objects_Set_local_object(
4993c: 202a 0008 movel %a2@(8),%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
49940: 206b 0018 moveal %a3@(24),%a0
RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
Objects_Information *information,
Objects_Control *the_object
)
{
_Objects_Set_local_object(
49944: 0280 0000 ffff andil #65535,%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4994a: 42b0 0c00 clrl %a0@(00000000,%d0:l:4)
return ctx.ok;
}
static inline void _User_extensions_Thread_delete( Thread_Control *deleted )
{
_User_extensions_Iterate(
4994e: 4879 0004 a7dc pea 4a7dc <_User_extensions_Thread_delete_visitor>
*
* 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;
49954: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
--level;
4995a: 5380 subql #1,%d0
4995c: 2f0a movel %a2,%sp@-
_Thread_Dispatch_disable_level = level;
4995e: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
49964: 4eb9 0004 a884 jsr 4a884 <_User_extensions_Iterate>
*
* 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;
4996a: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
49970: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
49972: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
/*
* Now we are in a dispatching critical section again and we
* can take the thread OUT of the published set. It is invalid
* to use this thread's Id OR name after this call.
*/
_Objects_Close( information, &the_thread->Object );
49978: 2f0a movel %a2,%sp@-
4997a: 2f0b movel %a3,%sp@-
4997c: 4eb9 0004 8acc jsr 48acc <_Objects_Close>
/*
* By setting the dormant state, the thread will not be considered
* for scheduling when we remove any blocking states.
*/
_Thread_Set_state( the_thread, STATES_DORMANT );
49982: 4878 0001 pea 1 <ADD>
49986: 2f0a movel %a2,%sp@-
49988: 4eb9 0004 a600 jsr 4a600 <_Thread_Set_state>
if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
4998e: 2f0a movel %a2,%sp@-
49990: 4eb9 0004 a444 jsr 4a444 <_Thread_queue_Extract_with_proxy>
49996: 4fef 001c lea %sp@(28),%sp
4999a: 4a00 tstb %d0
4999c: 660a bnes 499a8 <_Thread_Close+0x7c>
if ( _Watchdog_Is_active( &the_thread->Timer ) )
4999e: 7002 moveq #2,%d0
499a0: b0aa 0050 cmpl %a2@(80),%d0
499a4: 6700 0088 beqw 49a2e <_Thread_Close+0x102>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Free(
Thread_Control *the_thread
)
{
return _Scheduler.Operations.free( the_thread );
499a8: 2f0a movel %a2,%sp@-
499aa: 2079 0005 f78c moveal 5f78c <_Scheduler+0x1c>,%a0
499b0: 4e90 jsr %a0@
/*
* The thread might have been FP. So deal with that.
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( _Thread_Is_allocated_fp( the_thread ) )
499b2: 588f addql #4,%sp
499b4: b5f9 0006 1052 cmpal 61052 <_Thread_Allocated_fp>,%a2
499ba: 6736 beqs 499f2 <_Thread_Close+0xc6>
_Thread_Deallocate_fp();
#endif
the_thread->fp_context = NULL;
_Workspace_Free( the_thread->Start.fp_context );
499bc: 2f2a 00b6 movel %a2@(182),%sp@-
499c0: 47f9 0004 acdc lea 4acdc <_Workspace_Free>,%a3
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( _Thread_Is_allocated_fp( the_thread ) )
_Thread_Deallocate_fp();
#endif
the_thread->fp_context = NULL;
499c6: 42aa 00f2 clrl %a2@(242)
_Workspace_Free( the_thread->Start.fp_context );
499ca: 4e93 jsr %a3@
/*
* Free the rest of the memory associated with this task
* and set the associated pointers to NULL for safety.
*/
_Thread_Stack_Free( the_thread );
499cc: 2f0a movel %a2,%sp@-
499ce: 4eb9 0004 a6d0 jsr 4a6d0 <_Thread_Stack_Free>
the_thread->Start.stack = NULL;
_Workspace_Free( the_thread->extensions );
499d4: 2f2a 0102 movel %a2@(258),%sp@-
/*
* Free the rest of the memory associated with this task
* and set the associated pointers to NULL for safety.
*/
_Thread_Stack_Free( the_thread );
the_thread->Start.stack = NULL;
499d8: 42aa 00ba clrl %a2@(186)
_Workspace_Free( the_thread->extensions );
499dc: 4e93 jsr %a3@
the_thread->extensions = NULL;
}
499de: 266e fffc moveal %fp@(-4),%a3
*/
_Thread_Stack_Free( the_thread );
the_thread->Start.stack = NULL;
_Workspace_Free( the_thread->extensions );
the_thread->extensions = NULL;
499e2: 4fef 000c lea %sp@(12),%sp
499e6: 42aa 0102 clrl %a2@(258)
}
499ea: 246e fff8 moveal %fp@(-8),%a2
499ee: 4e5e unlk %fp
499f0: 4e75 rts
if ( _Thread_Is_allocated_fp( the_thread ) )
_Thread_Deallocate_fp();
#endif
the_thread->fp_context = NULL;
_Workspace_Free( the_thread->Start.fp_context );
499f2: 2f2a 00b6 movel %a2@(182),%sp@-
499f6: 47f9 0004 acdc lea 4acdc <_Workspace_Free>,%a3
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( _Thread_Is_allocated_fp( the_thread ) )
_Thread_Deallocate_fp();
#endif
the_thread->fp_context = NULL;
499fc: 42aa 00f2 clrl %a2@(242)
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
{
_Thread_Allocated_fp = NULL;
49a00: 42b9 0006 1052 clrl 61052 <_Thread_Allocated_fp>
_Workspace_Free( the_thread->Start.fp_context );
49a06: 4e93 jsr %a3@
/*
* Free the rest of the memory associated with this task
* and set the associated pointers to NULL for safety.
*/
_Thread_Stack_Free( the_thread );
49a08: 2f0a movel %a2,%sp@-
49a0a: 4eb9 0004 a6d0 jsr 4a6d0 <_Thread_Stack_Free>
the_thread->Start.stack = NULL;
_Workspace_Free( the_thread->extensions );
49a10: 2f2a 0102 movel %a2@(258),%sp@-
/*
* Free the rest of the memory associated with this task
* and set the associated pointers to NULL for safety.
*/
_Thread_Stack_Free( the_thread );
the_thread->Start.stack = NULL;
49a14: 42aa 00ba clrl %a2@(186)
_Workspace_Free( the_thread->extensions );
49a18: 4e93 jsr %a3@
the_thread->extensions = NULL;
}
49a1a: 266e fffc moveal %fp@(-4),%a3
*/
_Thread_Stack_Free( the_thread );
the_thread->Start.stack = NULL;
_Workspace_Free( the_thread->extensions );
the_thread->extensions = NULL;
49a1e: 4fef 000c lea %sp@(12),%sp
49a22: 42aa 0102 clrl %a2@(258)
}
49a26: 246e fff8 moveal %fp@(-8),%a2
49a2a: 4e5e unlk %fp
49a2c: 4e75 rts
*/
_Thread_Set_state( the_thread, STATES_DORMANT );
if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
if ( _Watchdog_Is_active( &the_thread->Timer ) )
(void) _Watchdog_Remove( &the_thread->Timer );
49a2e: 486a 0048 pea %a2@(72)
49a32: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
49a38: 588f addql #4,%sp
49a3a: 2079 0005 f78c moveal 5f78c <_Scheduler+0x1c>,%a0
49a40: 2f0a movel %a2,%sp@-
49a42: 4e90 jsr %a0@
/*
* The thread might have been FP. So deal with that.
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( _Thread_Is_allocated_fp( the_thread ) )
49a44: 588f addql #4,%sp
49a46: b5f9 0006 1052 cmpal 61052 <_Thread_Allocated_fp>,%a2
49a4c: 6600 ff6e bnew 499bc <_Thread_Close+0x90>
49a50: 60a0 bras 499f2 <_Thread_Close+0xc6> <== NOT EXECUTED
...
00049b00 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
49b00: 4e56 fffc linkw %fp,#-4
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
49b04: 486e fffc pea %fp@(-4)
49b08: 2f2e 0008 movel %fp@(8),%sp@-
49b0c: 4eb9 0004 9cf0 jsr 49cf0 <_Thread_Get>
switch ( location ) {
49b12: 508f addql #8,%sp
49b14: 4aae fffc tstl %fp@(-4)
49b18: 661e bnes 49b38 <_Thread_Delay_ended+0x38> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
49b1a: 2f3c 1000 0018 movel #268435480,%sp@-
49b20: 2f00 movel %d0,%sp@-
49b22: 4eb9 0004 98d0 jsr 498d0 <_Thread_Clear_state>
49b28: 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;
49b2a: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
--level;
49b30: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
49b32: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
49b38: 4e5e unlk %fp <== NOT EXECUTED
00049b3c <_Thread_Dispatch>:
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
void _Thread_Dispatch( void )
{
49b3c: 4e56 ffd0 linkw %fp,#-48
49b40: 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 );
49b44: 283c 0000 0700 movel #1792,%d4
49b4a: 2004 movel %d4,%d0
#endif
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
49b4c: 2479 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a2
_ISR_Disable( level );
49b52: 40c1 movew %sr,%d1
49b54: 8081 orl %d1,%d0
49b56: 46c0 movew %d0,%sr
while ( _Thread_Dispatch_necessary == true ) {
49b58: 1039 0006 142c moveb 6142c <_Per_CPU_Information+0xc>,%d0
49b5e: 6700 012e beqw 49c8e <_Thread_Dispatch+0x152>
* 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;
49b62: 7001 moveq #1,%d0
heir = _Thread_Heir;
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
49b64: 4207 clrb %d7
* 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;
49b66: 2679 0006 1432 moveal 61432 <_Per_CPU_Information+0x12>,%a3
49b6c: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
49b72: 13c7 0006 142c moveb %d7,6142c <_Per_CPU_Information+0xc>
_Thread_Executing = heir;
49b78: 23cb 0006 142e movel %a3,6142e <_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 )
49b7e: b7ca cmpal %a2,%a3
49b80: 6700 010c beqw 49c8e <_Thread_Dispatch+0x152>
49b84: 2a0e movel %fp,%d5
49b86: 5185 subql #8,%d5
49b88: 4bf9 0004 8494 lea 48494 <_TOD_Get_with_nanoseconds>,%a5
#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 );
49b8e: 2c3c 0004 ae94 movel #306836,%d6
*/
#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 )
49b94: 7001 moveq #1,%d0
49b96: b0ab 0076 cmpl %a3@(118),%d0
49b9a: 6700 0126 beqw 49cc2 <_Thread_Dispatch+0x186>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
_ISR_Enable( level );
49b9e: 46c1 movew %d1,%sr
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
49ba0: 4879 0006 0f90 pea 60f90 <_TOD+0x8>
49ba6: 2f05 movel %d5,%sp@-
49ba8: 4e95 jsr %a5@
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
49baa: 2079 0006 1056 moveal 61056 <_Thread_libc_reent>,%a0
49bb0: 508f addql #8,%sp
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
_Timestamp_Subtract(
49bb2: 202e fff8 movel %fp@(-8),%d0
49bb6: 222e fffc movel %fp@(-4),%d1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
49bba: 2400 movel %d0,%d2
49bbc: 2601 movel %d1,%d3
49bbe: 2e39 0006 143a movel 6143a <_Per_CPU_Information+0x1a>,%d7
49bc4: 96b9 0006 143e subl 6143e <_Per_CPU_Information+0x1e>,%d3
49bca: 9587 subxl %d7,%d2
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
49bcc: d7aa 0082 addl %d3,%a2@(130)
49bd0: 2e2a 007e movel %a2@(126),%d7
49bd4: df82 addxl %d2,%d7
49bd6: 2547 007e movel %d7,%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;
49bda: 23c0 0006 143a movel %d0,6143a <_Per_CPU_Information+0x1a>
49be0: 23c1 0006 143e movel %d1,6143e <_Per_CPU_Information+0x1e>
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
49be6: 4a88 tstl %a0
49be8: 6708 beqs 49bf2 <_Thread_Dispatch+0xb6> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
49bea: 2550 00f6 movel %a0@,%a2@(246)
*_Thread_libc_reent = heir->libc_reent;
49bee: 20ab 00f6 movel %a3@(246),%a0@
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
49bf2: 2879 0005 f898 moveal 5f898 <_User_extensions_Switches_list>,%a4
{
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 ) {
49bf8: b9fc 0005 f89c cmpal #391324,%a4
49bfe: 6716 beqs 49c16 <_Thread_Dispatch+0xda> <== NEVER TAKEN
const User_extensions_Switch_control *extension =
(const User_extensions_Switch_control *) node;
(*extension->thread_switch)( executing, heir );
49c00: 2f0b movel %a3,%sp@-
49c02: 2f0a movel %a2,%sp@-
49c04: 206c 0008 moveal %a4@(8),%a0
49c08: 4e90 jsr %a0@
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
49c0a: 2854 moveal %a4@,%a4
{
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 ) {
49c0c: 508f addql #8,%sp
49c0e: b9fc 0005 f89c cmpal #391324,%a4
49c14: 66ea bnes 49c00 <_Thread_Dispatch+0xc4>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
49c16: 486b 00be pea %a3@(190)
49c1a: 486a 00be pea %a2@(190)
49c1e: 4eb9 0004 ad2c jsr 4ad2c <_CPU_Context_switch>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( (executing->fp_context != NULL) &&
49c24: 508f addql #8,%sp
49c26: 4aaa 00f2 tstl %a2@(242)
49c2a: 672a beqs 49c56 <_Thread_Dispatch+0x11a>
#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 );
49c2c: 2079 0006 1052 moveal 61052 <_Thread_Allocated_fp>,%a0
49c32: b1ca cmpal %a2,%a0
49c34: 6720 beqs 49c56 <_Thread_Dispatch+0x11a>
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
49c36: 4a88 tstl %a0
49c38: 670c beqs 49c46 <_Thread_Dispatch+0x10a>
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
49c3a: 4868 00f2 pea %a0@(242)
49c3e: 4eb9 0004 ae5c jsr 4ae5c <_CPU_Context_save_fp>
49c44: 588f addql #4,%sp
_Context_Restore_fp( &executing->fp_context );
49c46: 486a 00f2 pea %a2@(242)
49c4a: 2046 moveal %d6,%a0
49c4c: 4e90 jsr %a0@
_Thread_Allocated_fp = executing;
49c4e: 588f addql #4,%sp
49c50: 23ca 0006 1052 movel %a2,61052 <_Thread_Allocated_fp>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
49c56: 2479 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a2
_ISR_Disable( level );
49c5c: 2004 movel %d4,%d0
49c5e: 40c1 movew %sr,%d1
49c60: 8081 orl %d1,%d0
49c62: 46c0 movew %d0,%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 ) {
49c64: 1039 0006 142c moveb 6142c <_Per_CPU_Information+0xc>,%d0
49c6a: 6722 beqs 49c8e <_Thread_Dispatch+0x152>
* 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;
49c6c: 7001 moveq #1,%d0
heir = _Thread_Heir;
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
49c6e: 4207 clrb %d7
* 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;
49c70: 2679 0006 1432 moveal 61432 <_Per_CPU_Information+0x12>,%a3
49c76: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
49c7c: 13c7 0006 142c moveb %d7,6142c <_Per_CPU_Information+0xc>
_Thread_Executing = heir;
49c82: 23cb 0006 142e movel %a3,6142e <_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 )
49c88: b5cb cmpal %a3,%a2
49c8a: 6600 ff08 bnew 49b94 <_Thread_Dispatch+0x58>
49c8e: 42b9 0006 0fe6 clrl 60fe6 <_Thread_Dispatch_disable_level>
post_switch:
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 0 );
#endif
_ISR_Enable( level );
49c94: 46c1 movew %d1,%sr
49c96: 2679 0006 105a moveal 6105a <_API_extensions_Post_switch_list>,%a3
{
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 ) {
49c9c: b7fc 0006 105e cmpal #397406,%a3
49ca2: 6714 beqs 49cb8 <_Thread_Dispatch+0x17c>
const API_extensions_Post_switch_control *post_switch =
(const API_extensions_Post_switch_control *) node;
(*post_switch->hook)( executing );
49ca4: 2f0a movel %a2,%sp@-
49ca6: 206b 0008 moveal %a3@(8),%a0
49caa: 4e90 jsr %a0@
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
49cac: 2653 moveal %a3@,%a3
{
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 ) {
49cae: 588f addql #4,%sp
49cb0: b7fc 0006 105e cmpal #397406,%a3
49cb6: 66ec bnes 49ca4 <_Thread_Dispatch+0x168> <== NEVER TAKEN
49cb8: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5
49cbe: 4e5e unlk %fp
49cc0: 4e75 rts
#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 )
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
49cc2: 41f9 0006 0f9e lea 60f9e <_Thread_Ticks_per_timeslice>,%a0
49cc8: 2750 0072 movel %a0@,%a3@(114)
49ccc: 6000 fed0 braw 49b9e <_Thread_Dispatch+0x62>
0004edb4 <_Thread_Handler>:
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Handler( void )
{
4edb4: 4e56 fff4 linkw %fp,#-12
4edb8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static bool doneConstructors;
bool doCons;
#endif
executing = _Thread_Executing;
4edbc: 2479 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a2
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
4edc2: 222a 00a4 movel %a2@(164),%d1
_ISR_Set_level(level);
4edc6: 40c0 movew %sr,%d0
4edc8: e189 lsll #8,%d1
4edca: 0280 0000 f8ff andil #63743,%d0
4edd0: 8081 orl %d1,%d0
4edd2: 46c0 movew %d0,%sr
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
doneConstructors = true;
4edd4: 7001 moveq #1,%d0
doCons = !doneConstructors
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
4edd6: 1439 0006 07e4 moveb 607e4 <doneConstructors.3726>,%d2
doneConstructors = true;
4eddc: 13c0 0006 07e4 moveb %d0,607e4 <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) &&
4ede2: 4aaa 00f2 tstl %a2@(242)
4ede6: 6720 beqs 4ee08 <_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 );
4ede8: 2079 0006 1052 moveal 61052 <_Thread_Allocated_fp>,%a0
4edee: b1ca cmpal %a2,%a0
4edf0: 6716 beqs 4ee08 <_Thread_Handler+0x54>
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
4edf2: 4a88 tstl %a0
4edf4: 670c beqs 4ee02 <_Thread_Handler+0x4e>
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
4edf6: 4868 00f2 pea %a0@(242)
4edfa: 4eb9 0004 ae5c jsr 4ae5c <_CPU_Context_save_fp>
4ee00: 588f addql #4,%sp
_Thread_Allocated_fp = executing;
4ee02: 23ca 0006 1052 movel %a2,61052 <_Thread_Allocated_fp>
);
}
static inline void _User_extensions_Thread_begin( Thread_Control *executing )
{
_User_extensions_Iterate(
4ee08: 4879 0004 a824 pea 4a824 <_User_extensions_Thread_begin_visitor>
4ee0e: 47f9 0004 a884 lea 4a884 <_User_extensions_Iterate>,%a3
4ee14: 2f0a movel %a2,%sp@-
4ee16: 4e93 jsr %a3@
_User_extensions_Thread_begin( executing );
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
4ee18: 4eb9 0004 9cd0 jsr 49cd0 <_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) */ {
4ee1e: 508f addql #8,%sp
4ee20: 4a02 tstb %d2
4ee22: 6726 beqs 4ee4a <_Thread_Handler+0x96>
_Thread_Enable_dispatch();
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
4ee24: 202a 008e movel %a2@(142),%d0
4ee28: 672c beqs 4ee56 <_Thread_Handler+0xa2>
(*(Thread_Entry_numeric) executing->Start.entry_point)(
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
4ee2a: 7201 moveq #1,%d1
4ee2c: b280 cmpl %d0,%d1
4ee2e: 6750 beqs 4ee80 <_Thread_Handler+0xcc> <== ALWAYS TAKEN
}
}
static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
{
_User_extensions_Iterate(
4ee30: 4879 0004 a83c pea 4a83c <_User_extensions_Thread_exitted_visitor><== NOT EXECUTED
4ee36: 2f0a movel %a2,%sp@- <== NOT EXECUTED
4ee38: 4e93 jsr %a3@ <== NOT EXECUTED
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
4ee3a: 4878 0005 pea 5 <COMPARE> <== NOT EXECUTED
4ee3e: 4878 0001 pea 1 <ADD> <== NOT EXECUTED
4ee42: 42a7 clrl %sp@- <== NOT EXECUTED
4ee44: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred> <== NOT EXECUTED
* _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) */ {
INIT_NAME ();
4ee4a: 4eb9 0005 d72c jsr 5d72c <_init>
_Thread_Enable_dispatch();
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
4ee50: 202a 008e movel %a2@(142),%d0
4ee54: 66d4 bnes 4ee2a <_Thread_Handler+0x76>
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
4ee56: 2f2a 0096 movel %a2@(150),%sp@-
4ee5a: 206a 008a moveal %a2@(138),%a0
4ee5e: 4e90 jsr %a0@
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
executing->Wait.return_argument =
4ee60: 588f addql #4,%sp
4ee62: 2540 0028 movel %d0,%a2@(40)
4ee66: 4879 0004 a83c pea 4a83c <_User_extensions_Thread_exitted_visitor>
4ee6c: 2f0a movel %a2,%sp@-
4ee6e: 4e93 jsr %a3@
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
4ee70: 4878 0005 pea 5 <COMPARE>
4ee74: 4878 0001 pea 1 <ADD>
4ee78: 42a7 clrl %sp@-
4ee7a: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
4ee80: 2f2a 0092 movel %a2@(146),%sp@-
4ee84: 206a 008a moveal %a2@(138),%a0
4ee88: 4e90 jsr %a0@
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
4ee8a: 588f addql #4,%sp
4ee8c: 2540 0028 movel %d0,%a2@(40)
4ee90: 4879 0004 a83c pea 4a83c <_User_extensions_Thread_exitted_visitor>
4ee96: 2f0a movel %a2,%sp@-
4ee98: 4e93 jsr %a3@
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
4ee9a: 4878 0005 pea 5 <COMPARE> <== NOT EXECUTED
4ee9e: 4878 0001 pea 1 <ADD> <== NOT EXECUTED
4eea2: 42a7 clrl %sp@- <== NOT EXECUTED
4eea4: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred> <== NOT EXECUTED
...
00049fdc <_Thread_Handler_initialization>:
#if defined(RTEMS_SMP)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
49fdc: 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 =
49fe0: 2079 0005 d978 moveal 5d978 <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 ||
49fe6: 4ab9 0005 d97c tstl 5d97c <Configuration+0x28>
49fec: 6772 beqs 4a060 <_Thread_Handler_initialization+0x84><== NEVER TAKEN
49fee: 4ab9 0005 d980 tstl 5d980 <Configuration+0x2c>
49ff4: 676a beqs 4a060 <_Thread_Handler_initialization+0x84>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_BAD_STACK_HOOK
);
if ( stack_allocate_init_hook != NULL )
49ff6: 4a88 tstl %a0
49ff8: 670a beqs 4a004 <_Thread_Handler_initialization+0x28>
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
49ffa: 2f39 0005 d958 movel 5d958 <Configuration+0x4>,%sp@-
4a000: 4e90 jsr %a0@
4a002: 588f addql #4,%sp
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
4a004: 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;
4a008: 41f9 0005 d95c lea 5d95c <Configuration+0x8>,%a0
4a00e: 23d0 0006 1066 movel %a0@,61066 <_Thread_Maximum_extensions>
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
4a014: 41f9 0005 d968 lea 5d968 <Configuration+0x14>,%a0
4a01a: 23d0 0006 0f9e movel %a0@,60f9e <_Thread_Ticks_per_timeslice>
);
if ( stack_allocate_init_hook != NULL )
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
_Thread_Dispatch_necessary = false;
4a020: 4200 clrb %d0
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
4a022: 42a7 clrl %sp@-
4a024: 4878 010a pea 10a <DBL_MANT_DIG+0xd5>
4a028: 4878 0001 pea 1 <ADD>
4a02c: 4878 0001 pea 1 <ADD>
4a030: 4878 0001 pea 1 <ADD>
4a034: 4879 0006 10d4 pea 610d4 <_Thread_Internal_information>
);
if ( stack_allocate_init_hook != NULL )
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
_Thread_Dispatch_necessary = false;
4a03a: 13c0 0006 142c moveb %d0,6142c <_Per_CPU_Information+0xc>
_Thread_Executing = NULL;
4a040: 42b9 0006 142e clrl 6142e <_Per_CPU_Information+0xe>
_Thread_Heir = NULL;
4a046: 42b9 0006 1432 clrl 61432 <_Per_CPU_Information+0x12>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
4a04c: 42b9 0006 1052 clrl 61052 <_Thread_Allocated_fp>
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
4a052: 4eb9 0004 8f9c jsr 48f9c <_Objects_Initialize_information>
4a058: 4fef 001c lea %sp@(28),%sp
false, /* true if this is a global object class */
NULL /* Proxy extraction support callout */
#endif
);
}
4a05c: 4e5e unlk %fp
4a05e: 4e75 rts
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
rtems_configuration_get_stack_free_hook() == NULL)
_Internal_error_Occurred(
4a060: 4878 000e pea e <OPER1+0x2>
4a064: 4878 0001 pea 1 <ADD>
4a068: 42a7 clrl %sp@-
4a06a: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
00049d8c <_Thread_Initialize>:
Thread_CPU_budget_algorithms budget_algorithm,
Thread_CPU_budget_algorithm_callout budget_callout,
uint32_t isr_level,
Objects_Name name
)
{
49d8c: 4e56 ffd8 linkw %fp,#-40
49d90: 202e 0010 movel %fp@(16),%d0
49d94: 48d7 0cfc moveml %d2-%d7/%a2-%a3,%sp@
49d98: 246e 000c moveal %fp@(12),%a2
49d9c: 266e 001c moveal %fp@(28),%a3
49da0: 282e 0024 movel %fp@(36),%d4
49da4: 142e 001b moveb %fp@(27),%d2
49da8: 1c2e 0023 moveb %fp@(35),%d6
/*
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
49dac: 42aa 00fa clrl %a2@(250)
49db0: 42aa 00fe clrl %a2@(254)
extensions_area = NULL;
the_thread->libc_reent = NULL;
49db4: 42aa 00f6 clrl %a2@(246)
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
49db8: 4a80 tstl %d0
49dba: 6700 01b6 beqw 49f72 <_Thread_Initialize+0x1e6>
stack = the_thread->Start.stack;
the_thread->Start.core_allocated_stack = true;
} else {
stack = stack_area;
actual_stack_size = stack_size;
the_thread->Start.core_allocated_stack = false;
49dbe: 222e 0014 movel %fp@(20),%d1
49dc2: 4207 clrb %d7
49dc4: 1547 00ac moveb %d7,%a2@(172)
Stack_Control *the_stack,
void *starting_address,
size_t size
)
{
the_stack->area = starting_address;
49dc8: 2540 00b2 movel %d0,%a2@(178)
the_stack->size = size;
49dcc: 2541 00ae movel %d1,%a2@(174)
/*
* Allocate the floating point area for this thread
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( is_fp ) {
49dd0: 4a02 tstb %d2
49dd2: 6600 011c bnew 49ef0 <_Thread_Initialize+0x164>
extensions_area = NULL;
the_thread->libc_reent = NULL;
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
fp_area = NULL;
49dd6: 4283 clrl %d3
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
49dd8: 2039 0006 1066 movel 61066 <_Thread_Maximum_extensions>,%d0
fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE );
if ( !fp_area )
goto failed;
fp_area = _Context_Fp_start( fp_area, 0 );
}
the_thread->fp_context = fp_area;
49dde: 2543 00f2 movel %d3,%a2@(242)
the_thread->Start.fp_context = fp_area;
49de2: 2543 00b6 movel %d3,%a2@(182)
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
49de6: 42aa 0050 clrl %a2@(80)
the_watchdog->routine = routine;
49dea: 42aa 0064 clrl %a2@(100)
the_watchdog->id = id;
49dee: 42aa 0068 clrl %a2@(104)
the_watchdog->user_data = user_data;
49df2: 42aa 006c clrl %a2@(108)
#endif
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
49df6: 4a80 tstl %d0
49df8: 6600 0140 bnew 49f3a <_Thread_Initialize+0x1ae>
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
goto failed;
}
the_thread->extensions = (void **) extensions_area;
49dfc: 42aa 0102 clrl %a2@(258)
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
extensions_area = NULL;
49e00: 4285 clrl %d5
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
the_thread->Start.budget_algorithm = budget_algorithm;
49e02: 2544 009c movel %d4,%a2@(156)
the_thread->Start.budget_callout = budget_callout;
switch ( budget_algorithm ) {
49e06: 7002 moveq #2,%d0
/*
* General initialization
*/
the_thread->Start.is_preemptible = is_preemptible;
49e08: 1546 009a moveb %d6,%a2@(154)
the_thread->Start.budget_algorithm = budget_algorithm;
the_thread->Start.budget_callout = budget_callout;
49e0c: 256e 0028 00a0 movel %fp@(40),%a2@(160)
switch ( budget_algorithm ) {
49e12: b084 cmpl %d4,%d0
49e14: 6700 00c0 beqw 49ed6 <_Thread_Initialize+0x14a>
#endif
}
the_thread->Start.isr_level = isr_level;
the_thread->current_state = STATES_DORMANT;
49e18: 7001 moveq #1,%d0
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
break;
#endif
}
the_thread->Start.isr_level = isr_level;
49e1a: 256e 002c 00a4 movel %fp@(44),%a2@(164)
*/
RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate(
Thread_Control *the_thread
)
{
return _Scheduler.Operations.allocate( the_thread );
49e20: 2079 0005 f788 moveal 5f788 <_Scheduler+0x18>,%a0
the_thread->current_state = STATES_DORMANT;
49e26: 2540 0010 movel %d0,%a2@(16)
the_thread->Wait.queue = NULL;
49e2a: 42aa 0044 clrl %a2@(68)
the_thread->resource_count = 0;
49e2e: 42aa 001c clrl %a2@(28)
the_thread->real_priority = priority;
49e32: 254b 0018 movel %a3,%a2@(24)
the_thread->Start.initial_priority = priority;
49e36: 254b 00a8 movel %a3,%a2@(168)
49e3a: 2f0a movel %a2,%sp@-
49e3c: 4e90 jsr %a0@
sched =_Scheduler_Allocate( the_thread );
if ( !sched )
49e3e: 588f addql #4,%sp
49e40: 2400 movel %d0,%d2
49e42: 6756 beqs 49e9a <_Thread_Initialize+0x10e>
goto failed;
_Thread_Set_priority( the_thread, priority );
49e44: 2f0b movel %a3,%sp@-
static inline void _Timestamp64_implementation_Set_to_zero(
Timestamp64_Control *_time
)
{
*_time = 0;
49e46: 4286 clrl %d6
49e48: 4287 clrl %d7
49e4a: 2f0a movel %a2,%sp@-
49e4c: 4eb9 0004 a5e8 jsr 4a5e8 <_Thread_Set_priority>
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
49e52: 206e 0008 moveal %fp@(8),%a0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
49e56: 202a 0008 movel %a2@(8),%d0
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
49e5a: 2068 0018 moveal %a0@(24),%a0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
49e5e: 0280 0000 ffff andil #65535,%d0
49e64: 2546 007e movel %d6,%a2@(126)
49e68: 2547 0082 movel %d7,%a2@(130)
* @{
*/
static inline bool _User_extensions_Thread_create( Thread_Control *created )
{
User_extensions_Thread_create_context ctx = { created, true };
49e6c: 7e01 moveq #1,%d7
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
49e6e: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4)
_User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
49e72: 4879 0004 a7a4 pea 4a7a4 <_User_extensions_Thread_create_visitor>
49e78: 486e fffa pea %fp@(-6)
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
49e7c: 256e 0030 000c movel %fp@(48),%a2@(12)
* @{
*/
static inline bool _User_extensions_Thread_create( Thread_Control *created )
{
User_extensions_Thread_create_context ctx = { created, true };
49e82: 1d47 fffe moveb %d7,%fp@(-2)
49e86: 2d4a fffa movel %a2,%fp@(-6)
_User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
49e8a: 4eb9 0004 a884 jsr 4a884 <_User_extensions_Iterate>
* user extensions with dispatching enabled. The Allocator
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
49e90: 4fef 0010 lea %sp@(16),%sp
49e94: 4a2e fffe tstb %fp@(-2)
49e98: 664a bnes 49ee4 <_Thread_Initialize+0x158>
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
49e9a: 2f2a 00f6 movel %a2@(246),%sp@-
49e9e: 47f9 0004 acdc lea 4acdc <_Workspace_Free>,%a3
49ea4: 4e93 jsr %a3@
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
_Workspace_Free( the_thread->API_Extensions[i] );
49ea6: 2f2a 00fa movel %a2@(250),%sp@-
49eaa: 4e93 jsr %a3@
49eac: 2f2a 00fe movel %a2@(254),%sp@-
49eb0: 4e93 jsr %a3@
_Workspace_Free( extensions_area );
49eb2: 2f05 movel %d5,%sp@-
49eb4: 4e93 jsr %a3@
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Workspace_Free( fp_area );
49eb6: 2f03 movel %d3,%sp@-
49eb8: 4e93 jsr %a3@
#endif
_Workspace_Free( sched );
49eba: 2f02 movel %d2,%sp@-
49ebc: 4e93 jsr %a3@
_Thread_Stack_Free( the_thread );
49ebe: 2f0a movel %a2,%sp@-
49ec0: 4eb9 0004 a6d0 jsr 4a6d0 <_Thread_Stack_Free>
return false;
49ec6: 4fef 001c lea %sp@(28),%sp
49eca: 4200 clrb %d0
}
49ecc: 4cee 0cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a3
49ed2: 4e5e unlk %fp
49ed4: 4e75 rts
case THREAD_CPU_BUDGET_ALGORITHM_NONE:
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
49ed6: 41f9 0006 0f9e lea 60f9e <_Thread_Ticks_per_timeslice>,%a0
49edc: 2550 0072 movel %a0@,%a2@(114)
break;
49ee0: 6000 ff36 braw 49e18 <_Thread_Initialize+0x8c>
_Workspace_Free( sched );
_Thread_Stack_Free( the_thread );
return false;
}
49ee4: 4cee 0cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a3
* Mutex provides sufficient protection to let the user extensions
* run safely.
*/
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
49eea: 7001 moveq #1,%d0
_Workspace_Free( sched );
_Thread_Stack_Free( the_thread );
return false;
}
49eec: 4e5e unlk %fp
49eee: 4e75 rts
/*
* Allocate the floating point area for this thread
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( is_fp ) {
fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE );
49ef0: 4878 001c pea 1c <OPER2+0x8>
49ef4: 4eb9 0004 acc0 jsr 4acc0 <_Workspace_Allocate>
if ( !fp_area )
49efa: 588f addql #4,%sp
/*
* Allocate the floating point area for this thread
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( is_fp ) {
fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE );
49efc: 2600 movel %d0,%d3
if ( !fp_area )
49efe: 6600 fed8 bnew 49dd8 <_Thread_Initialize+0x4c>
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
49f02: 2f2a 00f6 movel %a2@(246),%sp@-
49f06: 47f9 0004 acdc lea 4acdc <_Workspace_Free>,%a3
* Zero out all the allocated memory fields
*/
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
the_thread->API_Extensions[i] = NULL;
extensions_area = NULL;
49f0c: 4285 clrl %d5
size_t actual_stack_size = 0;
void *stack = NULL;
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
void *fp_area;
#endif
void *sched = NULL;
49f0e: 4282 clrl %d2
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
49f10: 4e93 jsr %a3@
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
_Workspace_Free( the_thread->API_Extensions[i] );
49f12: 2f2a 00fa movel %a2@(250),%sp@-
49f16: 4e93 jsr %a3@
49f18: 2f2a 00fe movel %a2@(254),%sp@-
49f1c: 4e93 jsr %a3@
_Workspace_Free( extensions_area );
49f1e: 2f05 movel %d5,%sp@-
49f20: 4e93 jsr %a3@
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Workspace_Free( fp_area );
49f22: 2f03 movel %d3,%sp@-
49f24: 4e93 jsr %a3@
#endif
_Workspace_Free( sched );
49f26: 2f02 movel %d2,%sp@-
49f28: 4e93 jsr %a3@
_Thread_Stack_Free( the_thread );
49f2a: 2f0a movel %a2,%sp@-
49f2c: 4eb9 0004 a6d0 jsr 4a6d0 <_Thread_Stack_Free>
return false;
49f32: 4fef 001c lea %sp@(28),%sp
49f36: 4200 clrb %d0
49f38: 6092 bras 49ecc <_Thread_Initialize+0x140>
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
extensions_area = _Workspace_Allocate(
49f3a: e588 lsll #2,%d0
49f3c: 2040 moveal %d0,%a0
49f3e: 4868 0004 pea %a0@(4)
49f42: 4eb9 0004 acc0 jsr 4acc0 <_Workspace_Allocate>
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
49f48: 588f addql #4,%sp
/*
* Allocate the extensions area for this thread
*/
if ( _Thread_Maximum_extensions ) {
extensions_area = _Workspace_Allocate(
49f4a: 2a00 movel %d0,%d5
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
49f4c: 6756 beqs 49fa4 <_Thread_Initialize+0x218>
49f4e: 2439 0006 1066 movel 61066 <_Thread_Maximum_extensions>,%d2
goto failed;
}
the_thread->extensions = (void **) extensions_area;
49f54: 2240 moveal %d0,%a1
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
49f56: 91c8 subal %a0,%a0
(_Thread_Maximum_extensions + 1) * sizeof( void * )
);
if ( !extensions_area )
goto failed;
}
the_thread->extensions = (void **) extensions_area;
49f58: 4281 clrl %d1
49f5a: 2540 0102 movel %d0,%a2@(258)
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
the_thread->extensions[i] = NULL;
49f5e: 42b1 8c00 clrl %a1@(00000000,%a0:l:4)
* create the extension long after tasks have been created
* so they cannot rely on the thread create user extension
* call.
*/
if ( the_thread->extensions ) {
for ( i = 0; i <= _Thread_Maximum_extensions ; i++ )
49f62: 5281 addql #1,%d1
49f64: 2041 moveal %d1,%a0
49f66: b481 cmpl %d1,%d2
49f68: 6500 fe98 bcsw 49e02 <_Thread_Initialize+0x76>
49f6c: 226a 0102 moveal %a2@(258),%a1
49f70: 60ec bras 49f5e <_Thread_Initialize+0x1d2>
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
49f72: 2f2e 0014 movel %fp@(20),%sp@-
49f76: 2f0a movel %a2,%sp@-
49f78: 4eb9 0004 a694 jsr 4a694 <_Thread_Stack_Allocate>
if ( !actual_stack_size || actual_stack_size < stack_size )
49f7e: 508f addql #8,%sp
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
49f80: 2200 movel %d0,%d1
if ( !actual_stack_size || actual_stack_size < stack_size )
49f82: 6714 beqs 49f98 <_Thread_Initialize+0x20c>
49f84: b0ae 0014 cmpl %fp@(20),%d0
49f88: 650e bcss 49f98 <_Thread_Initialize+0x20c> <== NEVER TAKEN
return false; /* stack allocation failed */
stack = the_thread->Start.stack;
49f8a: 202a 00ba movel %a2@(186),%d0
the_thread->Start.core_allocated_stack = true;
49f8e: 7601 moveq #1,%d3
49f90: 1543 00ac moveb %d3,%a2@(172)
49f94: 6000 fe32 braw 49dc8 <_Thread_Initialize+0x3c>
_Workspace_Free( sched );
_Thread_Stack_Free( the_thread );
return false;
}
49f98: 4cee 0cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a3
stack = the_thread->Start.stack;
#else
if ( !stack_area ) {
actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size );
if ( !actual_stack_size || actual_stack_size < stack_size )
return false; /* stack allocation failed */
49f9e: 4200 clrb %d0
_Workspace_Free( sched );
_Thread_Stack_Free( the_thread );
return false;
}
49fa0: 4e5e unlk %fp
49fa2: 4e75 rts
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
49fa4: 2f2a 00f6 movel %a2@(246),%sp@-
49fa8: 47f9 0004 acdc lea 4acdc <_Workspace_Free>,%a3
size_t actual_stack_size = 0;
void *stack = NULL;
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
void *fp_area;
#endif
void *sched = NULL;
49fae: 4282 clrl %d2
extension_status = _User_extensions_Thread_create( the_thread );
if ( extension_status )
return true;
failed:
_Workspace_Free( the_thread->libc_reent );
49fb0: 4e93 jsr %a3@
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
_Workspace_Free( the_thread->API_Extensions[i] );
49fb2: 2f2a 00fa movel %a2@(250),%sp@-
49fb6: 4e93 jsr %a3@
49fb8: 2f2a 00fe movel %a2@(254),%sp@-
49fbc: 4e93 jsr %a3@
_Workspace_Free( extensions_area );
49fbe: 2f05 movel %d5,%sp@-
49fc0: 4e93 jsr %a3@
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Workspace_Free( fp_area );
49fc2: 2f03 movel %d3,%sp@-
49fc4: 4e93 jsr %a3@
#endif
_Workspace_Free( sched );
49fc6: 2f02 movel %d2,%sp@-
49fc8: 4e93 jsr %a3@
_Thread_Stack_Free( the_thread );
49fca: 2f0a movel %a2,%sp@-
49fcc: 4eb9 0004 a6d0 jsr 4a6d0 <_Thread_Stack_Free>
return false;
49fd2: 4fef 001c lea %sp@(28),%sp
49fd6: 4200 clrb %d0
49fd8: 6000 fef2 braw 49ecc <_Thread_Initialize+0x140>
0004df54 <_Thread_Reset>:
void _Thread_Reset(
Thread_Control *the_thread,
void *pointer_argument,
Thread_Entry_numeric_type numeric_argument
)
{
4df54: 4e56 0000 linkw %fp,#0
4df58: 2f0a movel %a2,%sp@-
4df5a: 246e 0008 moveal %fp@(8),%a2
the_thread->resource_count = 0;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
4df5e: 256a 009c 0076 movel %a2@(156),%a2@(118)
the_thread->budget_callout = the_thread->Start.budget_callout;
4df64: 256a 00a0 007a movel %a2@(160),%a2@(122)
the_thread->Start.pointer_argument = pointer_argument;
4df6a: 256e 000c 0092 movel %fp@(12),%a2@(146)
the_thread->Start.numeric_argument = numeric_argument;
4df70: 256e 0010 0096 movel %fp@(16),%a2@(150)
void *pointer_argument,
Thread_Entry_numeric_type numeric_argument
)
{
the_thread->resource_count = 0;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
4df76: 156a 009a 0070 moveb %a2@(154),%a2@(112)
Thread_Control *the_thread,
void *pointer_argument,
Thread_Entry_numeric_type numeric_argument
)
{
the_thread->resource_count = 0;
4df7c: 42aa 001c clrl %a2@(28)
the_thread->budget_callout = the_thread->Start.budget_callout;
the_thread->Start.pointer_argument = pointer_argument;
the_thread->Start.numeric_argument = numeric_argument;
if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
4df80: 2f0a movel %a2,%sp@-
4df82: 4eb9 0004 acd8 jsr 4acd8 <_Thread_queue_Extract_with_proxy>
4df88: 588f addql #4,%sp
4df8a: 4a00 tstb %d0
4df8c: 6608 bnes 4df96 <_Thread_Reset+0x42>
if ( _Watchdog_Is_active( &the_thread->Timer ) )
4df8e: 7002 moveq #2,%d0
4df90: b0aa 0050 cmpl %a2@(80),%d0
4df94: 672a beqs 4dfc0 <_Thread_Reset+0x6c>
(void) _Watchdog_Remove( &the_thread->Timer );
}
if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
4df96: 202a 00a8 movel %a2@(168),%d0
4df9a: b0aa 0014 cmpl %a2@(20),%d0
4df9e: 6718 beqs 4dfb8 <_Thread_Reset+0x64>
the_thread->real_priority = the_thread->Start.initial_priority;
4dfa0: 2540 0018 movel %d0,%a2@(24)
_Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
4dfa4: 2d4a 0008 movel %a2,%fp@(8)
}
}
4dfa8: 246e fffc moveal %fp@(-4),%a2
(void) _Watchdog_Remove( &the_thread->Timer );
}
if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
the_thread->real_priority = the_thread->Start.initial_priority;
_Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
4dfac: 2d40 000c movel %d0,%fp@(12)
}
}
4dfb0: 4e5e unlk %fp
(void) _Watchdog_Remove( &the_thread->Timer );
}
if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
the_thread->real_priority = the_thread->Start.initial_priority;
_Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
4dfb2: 4ef9 0004 af0c jmp 4af0c <_Thread_Set_priority>
}
}
4dfb8: 246e fffc moveal %fp@(-4),%a2
4dfbc: 4e5e unlk %fp
4dfbe: 4e75 rts
the_thread->Start.numeric_argument = numeric_argument;
if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
if ( _Watchdog_Is_active( &the_thread->Timer ) )
(void) _Watchdog_Remove( &the_thread->Timer );
4dfc0: 486a 0048 pea %a2@(72)
4dfc4: 4eb9 0004 b3c4 jsr 4b3c4 <_Watchdog_Remove>
4dfca: 588f addql #4,%sp
4dfcc: 60c8 bras 4df96 <_Thread_Reset+0x42>
...
0004ae7c <_Thread_Restart>:
*/
RTEMS_INLINE_ROUTINE bool _States_Is_dormant (
States_Control the_states
)
{
return (the_states & STATES_DORMANT);
4ae7c: 7001 moveq #1,%d0
bool _Thread_Restart(
Thread_Control *the_thread,
void *pointer_argument,
Thread_Entry_numeric_type numeric_argument
)
{
4ae7e: 4e56 0000 linkw %fp,#0
4ae82: 2f0a movel %a2,%sp@-
4ae84: 246e 0008 moveal %fp@(8),%a2
4ae88: c0aa 0010 andl %a2@(16),%d0
if ( !_States_Is_dormant( the_thread->current_state ) ) {
4ae8c: 670a beqs 4ae98 <_Thread_Restart+0x1c>
_Thread_Restart_self();
return true;
}
return false;
4ae8e: 4200 clrb %d0
}
4ae90: 246e fffc moveal %fp@(-4),%a2
4ae94: 4e5e unlk %fp
4ae96: 4e75 rts
Thread_Entry_numeric_type numeric_argument
)
{
if ( !_States_Is_dormant( the_thread->current_state ) ) {
_Thread_Set_transient( the_thread );
4ae98: 2f0a movel %a2,%sp@-
4ae9a: 4eb9 0004 af70 jsr 4af70 <_Thread_Set_transient>
_Thread_Reset( the_thread, pointer_argument, numeric_argument );
4aea0: 2f2e 0010 movel %fp@(16),%sp@-
4aea4: 2f2e 000c movel %fp@(12),%sp@-
4aea8: 2f0a movel %a2,%sp@-
4aeaa: 4eb9 0004 df54 jsr 4df54 <_Thread_Reset>
_Thread_Load_environment( the_thread );
4aeb0: 2f0a movel %a2,%sp@-
4aeb2: 4eb9 0004 dc58 jsr 4dc58 <_Thread_Load_environment>
_Thread_Ready( the_thread );
4aeb8: 2f0a movel %a2,%sp@-
4aeba: 4eb9 0004 df24 jsr 4df24 <_Thread_Ready>
);
}
static inline void _User_extensions_Thread_restart( Thread_Control *restarted )
{
_User_extensions_Iterate(
4aec0: 4879 0004 b130 pea 4b130 <_User_extensions_Thread_restart_visitor>
4aec6: 2f0a movel %a2,%sp@-
4aec8: 4eb9 0004 b1a8 jsr 4b1a8 <_User_extensions_Iterate>
_User_extensions_Thread_restart( the_thread );
if ( _Thread_Is_executing ( the_thread ) )
4aece: 4fef 0020 lea %sp@(32),%sp
_Thread_Restart_self();
return true;
4aed2: 7001 moveq #1,%d0
_Thread_Ready( the_thread );
_User_extensions_Thread_restart( the_thread );
if ( _Thread_Is_executing ( the_thread ) )
4aed4: b5f9 0006 1f86 cmpal 61f86 <_Per_CPU_Information+0xe>,%a2
4aeda: 66b4 bnes 4ae90 <_Thread_Restart+0x14>
*/
RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
{
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( _Thread_Executing->fp_context != NULL )
4aedc: 4aaa 00f2 tstl %a2@(242)
4aee0: 6712 beqs 4aef4 <_Thread_Restart+0x78>
_Context_Restore_fp( &_Thread_Executing->fp_context );
4aee2: 486a 00f2 pea %a2@(242)
4aee6: 4eb9 0004 b7b8 jsr 4b7b8 <_CPU_Context_restore_fp>
4aeec: 2479 0006 1f86 moveal 61f86 <_Per_CPU_Information+0xe>,%a2
4aef2: 588f addql #4,%sp
#endif
_CPU_Context_Restart_self( &_Thread_Executing->Registers );
4aef4: 486a 00be pea %a2@(190)
4aef8: 4eb9 0004 b666 jsr 4b666 <_CPU_Context_Restart_self>
return true;
}
return false;
}
4aefe: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
4af02: 588f addql #4,%sp <== NOT EXECUTED
4af04: 4e5e unlk %fp <== NOT EXECUTED
_User_extensions_Thread_restart( the_thread );
if ( _Thread_Is_executing ( the_thread ) )
_Thread_Restart_self();
return true;
4af06: 7001 moveq #1,%d0 <== NOT EXECUTED
}
return false;
}
...
0004a6d0 <_Thread_Stack_Free>:
#include <rtems/config.h>
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
4a6d0: 4e56 0000 linkw %fp,#0
4a6d4: 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 )
4a6d8: 4a28 00ac tstb %a0@(172)
4a6dc: 6604 bnes 4a6e2 <_Thread_Stack_Free+0x12> <== ALWAYS TAKEN
* 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 );
}
4a6de: 4e5e unlk %fp <== NOT EXECUTED
4a6e0: 4e75 rts <== NOT EXECUTED
* 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 );
4a6e2: 2279 0005 d980 moveal 5d980 <Configuration+0x2c>,%a1
4a6e8: 2d68 00b2 0008 movel %a0@(178),%fp@(8)
}
4a6ee: 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 );
4a6f0: 4ed1 jmp %a1@
...
00049784 <_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 ) ) {
49784: 7202 moveq #2,%d1
Thread_blocking_operation_States sync_state __attribute__((unused)),
#endif
Thread_Control *the_thread,
ISR_Level level
)
{
49786: 4e56 0000 linkw %fp,#0
4978a: 202e 0010 movel %fp@(16),%d0
4978e: 2f0a movel %a2,%sp@-
49790: 246e 000c moveal %fp@(12),%a2
#endif
/*
* The thread is not waiting on anything after this completes.
*/
the_thread->Wait.queue = NULL;
49794: 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 ) ) {
49798: b2aa 0050 cmpl %a2@(80),%d1
4979c: 671c beqs 497ba <_Thread_blocking_operation_Cancel+0x36>
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
(void) _Watchdog_Remove( &the_thread->Timer );
} else
_ISR_Enable( level );
4979e: 46c0 movew %d0,%sr
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
497a0: 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
}
497a4: 246e fffc moveal %fp@(-4),%a2
497a8: 203c 1007 fff8 movel #268959736,%d0
497ae: 2d40 000c movel %d0,%fp@(12)
497b2: 4e5e unlk %fp
497b4: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
497ba: 123c 0003 moveb #3,%d1
497be: 2541 0050 movel %d1,%a2@(80)
* 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 ) ) {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
497c2: 46c0 movew %d0,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
497c4: 486a 0048 pea %a2@(72)
497c8: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
497ce: 588f addql #4,%sp
497d0: 203c 1007 fff8 movel #268959736,%d0
497d6: 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
}
497da: 246e fffc moveal %fp@(-4),%a2
497de: 2d40 000c movel %d0,%fp@(12)
497e2: 4e5e unlk %fp
497e4: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
...
0004a0ec <_Thread_queue_Dequeue_priority>:
Chain_Node *new_second_node;
Chain_Node *last_node;
Chain_Node *next_node;
Chain_Node *previous_node;
_ISR_Disable( level );
4a0ec: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/tqdata.h>
Thread_Control *_Thread_queue_Dequeue_priority(
Thread_queue_Control *the_thread_queue
)
{
4a0f2: 4e56 ffe8 linkw %fp,#-24
4a0f6: 226e 0008 moveal %fp@(8),%a1
4a0fa: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
Chain_Node *new_second_node;
Chain_Node *last_node;
Chain_Node *next_node;
Chain_Node *previous_node;
_ISR_Disable( level );
4a0fe: 40c3 movew %sr,%d3
4a100: 8083 orl %d3,%d0
4a102: 46c0 movew %d0,%sr
for( index=0 ;
4a104: 4281 clrl %d1
index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
index++ ) {
if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) {
4a106: 2401 movel %d1,%d2
4a108: 2001 movel %d1,%d0
Chain_Node *previous_node;
_ISR_Disable( level );
for( index=0 ;
index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
index++ ) {
4a10a: 5281 addql #1,%d1
if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) {
4a10c: e58a lsll #2,%d2
4a10e: e988 lsll #4,%d0
4a110: 9082 subl %d2,%d0
4a112: 41f1 0800 lea %a1@(00000000,%d0:l),%a0
4a116: 2458 moveal %a0@+,%a2
4a118: b1ca cmpal %a2,%a0
4a11a: 6616 bnes 4a132 <_Thread_queue_Dequeue_priority+0x46>
Chain_Node *last_node;
Chain_Node *next_node;
Chain_Node *previous_node;
_ISR_Disable( level );
for( index=0 ;
4a11c: 7004 moveq #4,%d0
4a11e: b081 cmpl %d1,%d0
4a120: 66e4 bnes 4a106 <_Thread_queue_Dequeue_priority+0x1a>
}
/*
* We did not find a thread to unblock.
*/
_ISR_Enable( level );
4a122: 46c3 movew %d3,%sr
return NULL;
4a124: 95ca subal %a2,%a2
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
return( the_thread );
}
4a126: 200a movel %a2,%d0
4a128: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4a12e: 4e5e unlk %fp
4a130: 4e75 rts
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4a132: 200a movel %a2,%d0
4a134: 0680 0000 003c addil #60,%d0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4a13a: 206a 0038 moveal %a2@(56),%a0
dequeue:
the_thread->Wait.queue = NULL;
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
next_node = the_thread->Object.Node.next;
4a13e: 2252 moveal %a2@,%a1
previous_node = the_thread->Object.Node.previous;
4a140: 266a 0004 moveal %a2@(4),%a3
*/
_ISR_Enable( level );
return NULL;
dequeue:
the_thread->Wait.queue = NULL;
4a144: 42aa 0044 clrl %a2@(68)
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
next_node = the_thread->Object.Node.next;
previous_node = the_thread->Object.Node.previous;
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
4a148: b088 cmpl %a0,%d0
4a14a: 6700 008a beqw 4a1d6 <_Thread_queue_Dequeue_priority+0xea>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
4a14e: 286a 0040 moveal %a2@(64),%a4
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
4a152: 2a50 moveal %a0@,%a5
previous_node->next = new_first_node;
next_node->previous = new_first_node;
4a154: 2348 0004 movel %a0,%a1@(4)
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
4a158: 2688 movel %a0,%a3@
next_node->previous = new_first_node;
new_first_node->next = next_node;
new_first_node->previous = previous_node;
4a15a: 214b 0004 movel %a3,%a0@(4)
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
next_node->previous = new_first_node;
new_first_node->next = next_node;
4a15e: 2089 movel %a1,%a0@
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
4a160: 226a 0040 moveal %a2@(64),%a1
4a164: b3ea 0038 cmpal %a2@(56),%a1
4a168: 6716 beqs 4a180 <_Thread_queue_Dequeue_priority+0x94>
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
new_second_node->previous = head;
head->next = new_second_node;
4a16a: 214d 0038 movel %a5,%a0@(56)
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
4a16e: 43e8 003c lea %a0@(60),%a1
4a172: 2889 movel %a1,%a4@
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
4a174: 43e8 0038 lea %a0@(56),%a1
4a178: 2b49 0004 movel %a1,%a5@(4)
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
new_second_node->previous = head;
head->next = new_second_node;
tail->previous = last_node;
4a17c: 214c 0040 movel %a4,%a0@(64)
} else {
previous_node->next = next_node;
next_node->previous = previous_node;
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
4a180: 7002 moveq #2,%d0
4a182: b0aa 0050 cmpl %a2@(80),%d0
4a186: 671e beqs 4a1a6 <_Thread_queue_Dequeue_priority+0xba>
_ISR_Enable( level );
4a188: 46c3 movew %d3,%sr
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
4a18a: 2f3c 1007 fff8 movel #268959736,%sp@-
4a190: 2f0a movel %a2,%sp@-
4a192: 4eb9 0004 98d0 jsr 498d0 <_Thread_Clear_state>
4a198: 508f addql #8,%sp
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
return( the_thread );
}
4a19a: 200a movel %a2,%d0
4a19c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4a1a2: 4e5e unlk %fp
4a1a4: 4e75 rts
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
4a1a6: 7003 moveq #3,%d0
4a1a8: 2540 0050 movel %d0,%a2@(80)
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
4a1ac: 46c3 movew %d3,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
4a1ae: 486a 0048 pea %a2@(72)
4a1b2: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
4a1b8: 2f3c 1007 fff8 movel #268959736,%sp@-
4a1be: 2f0a movel %a2,%sp@-
4a1c0: 4eb9 0004 98d0 jsr 498d0 <_Thread_Clear_state>
4a1c6: 4fef 000c lea %sp@(12),%sp
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
return( the_thread );
}
4a1ca: 200a movel %a2,%d0
4a1cc: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4a1d2: 4e5e unlk %fp
4a1d4: 4e75 rts
head->next = new_second_node;
tail->previous = last_node;
last_node->next = tail;
}
} else {
previous_node->next = next_node;
4a1d6: 2689 movel %a1,%a3@
next_node->previous = previous_node;
4a1d8: 234b 0004 movel %a3,%a1@(4)
4a1dc: 60a2 bras 4a180 <_Thread_queue_Dequeue_priority+0x94>
...
0004a28c <_Thread_queue_Enqueue_priority>:
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
4a28c: 4e56 ffe0 linkw %fp,#-32
4a290: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@
4a294: 266e 000c moveal %fp@(12),%a3
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
4a298: 45eb 0038 lea %a3@(56),%a2
Chain_Node *tail = _Chain_Tail( the_chain );
4a29c: 41eb 003c lea %a3@(60),%a0
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
4a2a0: 222b 0014 movel %a3@(20),%d1
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
4a2a4: 2001 movel %d1,%d0
4a2a6: ec88 lsrl #6,%d0
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
4a2a8: 2400 movel %d0,%d2
4a2aa: e988 lsll #4,%d0
4a2ac: e58a lsll #2,%d2
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
4a2ae: 286e 0008 moveal %fp@(8),%a4
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
4a2b2: 9082 subl %d2,%d0
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
4a2b4: 274a 0040 movel %a2,%a3@(64)
block_state = the_thread_queue->state;
4a2b8: 242c 0038 movel %a4@(56),%d2
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
4a2bc: 45f4 0800 lea %a4@(00000000,%d0:l),%a2
Chain_Node *tail = _Chain_Tail( the_chain );
4a2c0: 2748 0038 movel %a0,%a3@(56)
head->next = tail;
head->previous = NULL;
4a2c4: 42ab 003c clrl %a3@(60)
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
4a2c8: 0801 0005 btst #5,%d1
4a2cc: 6656 bnes 4a324 <_Thread_queue_Enqueue_priority+0x98>
4a2ce: 2c0a movel %a2,%d6
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
4a2d0: 2a3c 0000 0700 movel #1792,%d5
4a2d6: 5886 addql #4,%d6
4a2d8: 2005 movel %d5,%d0
4a2da: 40c3 movew %sr,%d3
4a2dc: 8083 orl %d3,%d0
4a2de: 46c0 movew %d0,%sr
4a2e0: 2803 movel %d3,%d4
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4a2e2: 2052 moveal %a2@,%a0
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
4a2e4: bc88 cmpl %a0,%d6
4a2e6: 6700 0148 beqw 4a430 <_Thread_queue_Enqueue_priority+0x1a4>
search_priority = search_thread->current_priority;
4a2ea: 2268 0014 moveal %a0@(20),%a1
if ( priority <= search_priority )
4a2ee: b3c1 cmpal %d1,%a1
4a2f0: 6418 bccs 4a30a <_Thread_queue_Enqueue_priority+0x7e>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
4a2f2: 2005 movel %d5,%d0
4a2f4: 46c3 movew %d3,%sr
4a2f6: 8083 orl %d3,%d0
4a2f8: 46c0 movew %d0,%sr
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
4a2fa: 2002 movel %d2,%d0
4a2fc: c0a8 0010 andl %a0@(16),%d0
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
4a300: 6700 0092 beqw 4a394 <_Thread_queue_Enqueue_priority+0x108>
_ISR_Enable( level );
goto restart_forward_search;
}
search_thread =
4a304: 2050 moveal %a0@,%a0
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
4a306: bc88 cmpl %a0,%d6
4a308: 66e0 bnes 4a2ea <_Thread_queue_Enqueue_priority+0x5e>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
4a30a: 202c 0030 movel %a4@(48),%d0
4a30e: 7401 moveq #1,%d2
4a310: b480 cmpl %d0,%d2
4a312: 6700 00b6 beqw 4a3ca <_Thread_queue_Enqueue_priority+0x13e>
* For example, the blocking thread could have been given
* the mutex by an ISR or timed out.
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
4a316: 206e 0010 moveal %fp@(16),%a0
4a31a: 2084 movel %d4,%a0@
return the_thread_queue->sync_state;
}
4a31c: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4
4a320: 4e5e unlk %fp
4a322: 4e75 rts
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
4a324: 2a3c 0000 0700 movel #1792,%d5
4a32a: 2005 movel %d5,%d0
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
4a32c: 1c39 0005 f6ec moveb 5f6ec <rtems_maximum_priority>,%d6
_ISR_Disable( level );
4a332: 40c3 movew %sr,%d3
4a334: 8083 orl %d3,%d0
4a336: 46c0 movew %d0,%sr
4a338: 2803 movel %d3,%d4
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
4a33a: 206a 0008 moveal %a2@(8),%a0
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
4a33e: b5c8 cmpal %a0,%a2
4a340: 6700 00d4 beqw 4a416 <_Thread_queue_Enqueue_priority+0x18a>
search_priority = search_thread->current_priority;
4a344: 2268 0014 moveal %a0@(20),%a1
if ( priority >= search_priority )
4a348: b3c1 cmpal %d1,%a1
4a34a: 6318 blss 4a364 <_Thread_queue_Enqueue_priority+0xd8>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
4a34c: 2005 movel %d5,%d0
4a34e: 46c3 movew %d3,%sr
4a350: 8083 orl %d3,%d0
4a352: 46c0 movew %d0,%sr
4a354: 2002 movel %d2,%d0
4a356: c0a8 0010 andl %a0@(16),%d0
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
4a35a: 6750 beqs 4a3ac <_Thread_queue_Enqueue_priority+0x120>
_ISR_Enable( level );
goto restart_reverse_search;
}
search_thread = (Thread_Control *)
4a35c: 2068 0004 moveal %a0@(4),%a0
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
4a360: b5c8 cmpal %a0,%a2
4a362: 66e0 bnes 4a344 <_Thread_queue_Enqueue_priority+0xb8>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
4a364: 202c 0030 movel %a4@(48),%d0
4a368: 7401 moveq #1,%d2
4a36a: b480 cmpl %d0,%d2
4a36c: 66a8 bnes 4a316 <_Thread_queue_Enqueue_priority+0x8a><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
4a36e: 42ac 0030 clrl %a4@(48)
if ( priority == search_priority )
4a372: b3c1 cmpal %d1,%a1
4a374: 677c beqs 4a3f2 <_Thread_queue_Enqueue_priority+0x166>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
4a376: 2250 moveal %a0@,%a1
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
4a378: 2748 0004 movel %a0,%a3@(4)
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
4a37c: 2689 movel %a1,%a3@
the_node->previous = search_node;
search_node->next = the_node;
next_node->previous = the_node;
4a37e: 234b 0004 movel %a3,%a1@(4)
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
search_node->next = the_node;
4a382: 208b movel %a3,%a0@
next_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
4a384: 274c 0044 movel %a4,%a3@(68)
_ISR_Enable( level );
4a388: 46c3 movew %d3,%sr
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
4a38a: 7001 moveq #1,%d0
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
4a38c: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4
4a390: 4e5e unlk %fp
4a392: 4e75 rts
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
_ISR_Enable( level );
4a394: 46c3 movew %d3,%sr
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
4a396: 2005 movel %d5,%d0
4a398: 40c3 movew %sr,%d3
4a39a: 8083 orl %d3,%d0
4a39c: 46c0 movew %d0,%sr
4a39e: 2803 movel %d3,%d4
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4a3a0: 2052 moveal %a2@,%a0
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
4a3a2: bc88 cmpl %a0,%d6
4a3a4: 6600 ff44 bnew 4a2ea <_Thread_queue_Enqueue_priority+0x5e>
4a3a8: 6000 0086 braw 4a430 <_Thread_queue_Enqueue_priority+0x1a4>
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
_ISR_Enable( level );
4a3ac: 46c3 movew %d3,%sr
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
4a3ae: 2005 movel %d5,%d0
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
4a3b0: 1c39 0005 f6ec moveb 5f6ec <rtems_maximum_priority>,%d6
_ISR_Disable( level );
4a3b6: 40c3 movew %sr,%d3
4a3b8: 8083 orl %d3,%d0
4a3ba: 46c0 movew %d0,%sr
4a3bc: 2803 movel %d3,%d4
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
4a3be: 206a 0008 moveal %a2@(8),%a0
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
4a3c2: b5c8 cmpal %a0,%a2
4a3c4: 6600 ff7e bnew 4a344 <_Thread_queue_Enqueue_priority+0xb8>
4a3c8: 604c bras 4a416 <_Thread_queue_Enqueue_priority+0x18a>
if ( the_thread_queue->sync_state !=
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
4a3ca: 42ac 0030 clrl %a4@(48)
if ( priority == search_priority )
4a3ce: b3c1 cmpal %d1,%a1
4a3d0: 6720 beqs 4a3f2 <_Thread_queue_Enqueue_priority+0x166>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
4a3d2: 2268 0004 moveal %a0@(4),%a1
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
4a3d6: 2688 movel %a0,%a3@
the_node->previous = previous_node;
4a3d8: 2749 0004 movel %a1,%a3@(4)
previous_node->next = the_node;
4a3dc: 228b movel %a3,%a1@
search_node->previous = the_node;
4a3de: 214b 0004 movel %a3,%a0@(4)
the_thread->Wait.queue = the_thread_queue;
4a3e2: 274c 0044 movel %a4,%a3@(68)
_ISR_Enable( level );
4a3e6: 46c3 movew %d3,%sr
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
4a3e8: 7001 moveq #1,%d0
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
4a3ea: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4
4a3ee: 4e5e unlk %fp
4a3f0: 4e75 rts
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
4a3f2: 2268 0040 moveal %a0@(64),%a1
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
4a3f6: 45e8 003c lea %a0@(60),%a2
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
4a3fa: 2749 0004 movel %a1,%a3@(4)
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
4a3fe: 268a movel %a2,%a3@
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
previous_node->next = the_node;
search_node->previous = the_node;
4a400: 214b 0040 movel %a3,%a0@(64)
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
the_node->previous = previous_node;
previous_node->next = the_node;
4a404: 228b movel %a3,%a1@
search_node->previous = the_node;
the_thread->Wait.queue = the_thread_queue;
4a406: 274c 0044 movel %a4,%a3@(68)
_ISR_Enable( level );
4a40a: 46c4 movew %d4,%sr
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
4a40c: 7001 moveq #1,%d0
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
4a40e: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4
4a412: 4e5e unlk %fp
4a414: 4e75 rts
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
4a416: 202c 0030 movel %a4@(48),%d0
4a41a: 7401 moveq #1,%d2
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
4a41c: 0286 0000 00ff andil #255,%d6
4a422: 2246 moveal %d6,%a1
4a424: 5289 addql #1,%a1
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
4a426: b480 cmpl %d0,%d2
4a428: 6600 feec bnew 4a316 <_Thread_queue_Enqueue_priority+0x8a>
4a42c: 6000 ff40 braw 4a36e <_Thread_queue_Enqueue_priority+0xe2>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
4a430: 202c 0030 movel %a4@(48),%d0
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
4a434: 327c ffff moveaw #-1,%a1
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
4a438: 7401 moveq #1,%d2
4a43a: b480 cmpl %d0,%d2
4a43c: 6600 fed8 bnew 4a316 <_Thread_queue_Enqueue_priority+0x8a>
4a440: 6088 bras 4a3ca <_Thread_queue_Enqueue_priority+0x13e>
...
0004eeac <_Thread_queue_Extract_fifo>:
Thread_Control *the_thread
)
{
ISR_Level level;
_ISR_Disable( level );
4eeac: 203c 0000 0700 movel #1792,%d0
void _Thread_queue_Extract_fifo(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread
)
{
4eeb2: 4e56 0000 linkw %fp,#0
4eeb6: 2f0a movel %a2,%sp@-
4eeb8: 246e 000c moveal %fp@(12),%a2
ISR_Level level;
_ISR_Disable( level );
4eebc: 40c1 movew %sr,%d1
4eebe: 8081 orl %d1,%d0
4eec0: 46c0 movew %d0,%sr
4eec2: 202a 0010 movel %a2@(16),%d0
4eec6: 0280 0003 bee0 andil #245472,%d0
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4eecc: 6734 beqs 4ef02 <_Thread_queue_Extract_fifo+0x56>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
4eece: 2252 moveal %a2@,%a1
_Chain_Extract_unprotected( &the_thread->Object.Node );
the_thread->Wait.queue = NULL;
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
4eed0: 7002 moveq #2,%d0
previous = the_node->previous;
4eed2: 206a 0004 moveal %a2@(4),%a0
next->previous = previous;
4eed6: 2348 0004 movel %a0,%a1@(4)
previous->next = next;
4eeda: 2089 movel %a1,%a0@
return;
}
_Chain_Extract_unprotected( &the_thread->Object.Node );
the_thread->Wait.queue = NULL;
4eedc: 42aa 0044 clrl %a2@(68)
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
4eee0: b0aa 0050 cmpl %a2@(80),%d0
4eee4: 6726 beqs 4ef0c <_Thread_queue_Extract_fifo+0x60>
_ISR_Enable( level );
4eee6: 46c1 movew %d1,%sr
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
4eee8: 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
}
4eeec: 246e fffc moveal %fp@(-4),%a2
4eef0: 203c 1007 fff8 movel #268959736,%d0
4eef6: 2d40 000c movel %d0,%fp@(12)
4eefa: 4e5e unlk %fp
4eefc: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
ISR_Level level;
_ISR_Disable( level );
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
_ISR_Enable( level );
4ef02: 46c1 movew %d1,%sr
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
4ef04: 246e fffc moveal %fp@(-4),%a2
4ef08: 4e5e unlk %fp
4ef0a: 4e75 rts
4ef0c: 7003 moveq #3,%d0
4ef0e: 2540 0050 movel %d0,%a2@(80)
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
4ef12: 46c1 movew %d1,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
4ef14: 486a 0048 pea %a2@(72)
4ef18: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
4ef1e: 588f addql #4,%sp
4ef20: 203c 1007 fff8 movel #268959736,%d0
4ef26: 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
}
4ef2a: 246e fffc moveal %fp@(-4),%a2
4ef2e: 2d40 000c movel %d0,%fp@(12)
4ef32: 4e5e unlk %fp
4ef34: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
...
0004d4d4 <_Thread_queue_Extract_priority_helper>:
Chain_Node *new_first_node;
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
4d4d4: 203c 0000 0700 movel #1792,%d0
void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread,
bool requeuing
)
{
4d4da: 4e56 ffec linkw %fp,#-20
4d4de: 48d7 3c04 moveml %d2/%a2-%a5,%sp@
4d4e2: 246e 000c moveal %fp@(12),%a2
4d4e6: 142e 0013 moveb %fp@(19),%d2
Chain_Node *new_first_node;
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
4d4ea: 40c1 movew %sr,%d1
4d4ec: 8081 orl %d1,%d0
4d4ee: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
4d4f0: 202a 0010 movel %a2@(16),%d0
4d4f4: 0280 0003 bee0 andil #245472,%d0
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4d4fa: 6772 beqs 4d56e <_Thread_queue_Extract_priority_helper+0x9a>
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
4d4fc: 200a movel %a2,%d0
4d4fe: 0680 0000 003c addil #60,%d0
/*
* The thread was actually waiting on a thread queue so let's remove it.
*/
next_node = the_node->next;
4d504: 2252 moveal %a2@,%a1
previous_node = the_node->previous;
4d506: 266a 0004 moveal %a2@(4),%a3
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4d50a: 206a 0038 moveal %a2@(56),%a0
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
4d50e: b088 cmpl %a0,%d0
4d510: 6768 beqs 4d57a <_Thread_queue_Extract_priority_helper+0xa6>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
4d512: 286a 0040 moveal %a2@(64),%a4
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
4d516: 2a50 moveal %a0@,%a5
previous_node->next = new_first_node;
next_node->previous = new_first_node;
4d518: 2348 0004 movel %a0,%a1@(4)
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
4d51c: 2688 movel %a0,%a3@
next_node->previous = new_first_node;
new_first_node->next = next_node;
new_first_node->previous = previous_node;
4d51e: 214b 0004 movel %a3,%a0@(4)
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
4d522: 202a 0040 movel %a2@(64),%d0
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
next_node->previous = new_first_node;
new_first_node->next = next_node;
4d526: 2089 movel %a1,%a0@
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
4d528: b0aa 0038 cmpl %a2@(56),%d0
4d52c: 6716 beqs 4d544 <_Thread_queue_Extract_priority_helper+0x70>
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
new_second_node->previous = head;
head->next = new_second_node;
4d52e: 214d 0038 movel %a5,%a0@(56)
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
4d532: 43e8 003c lea %a0@(60),%a1
4d536: 2889 movel %a1,%a4@
new_first_node->next = next_node;
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
4d538: 43e8 0038 lea %a0@(56),%a1
4d53c: 2b49 0004 movel %a1,%a5@(4)
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
new_second_node->previous = head;
head->next = new_second_node;
tail->previous = last_node;
4d540: 214c 0040 movel %a4,%a0@(64)
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
4d544: 4a02 tstb %d2
4d546: 6626 bnes 4d56e <_Thread_queue_Extract_priority_helper+0x9a>
_ISR_Enable( level );
return;
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
4d548: 7002 moveq #2,%d0
4d54a: b0aa 0050 cmpl %a2@(80),%d0
4d54e: 6736 beqs 4d586 <_Thread_queue_Extract_priority_helper+0xb2>
_ISR_Enable( level );
4d550: 46c1 movew %d1,%sr
4d552: 2d4a 0008 movel %a2,%fp@(8)
4d556: 227c 1007 fff8 moveal #268959736,%a1
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
4d55c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
4d562: 2d49 000c movel %a1,%fp@(12)
4d566: 4e5e unlk %fp
4d568: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
_ISR_Enable( level );
4d56e: 46c1 movew %d1,%sr
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
4d570: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
4d576: 4e5e unlk %fp
4d578: 4e75 rts
head->next = new_second_node;
tail->previous = last_node;
last_node->next = tail;
}
} else {
previous_node->next = next_node;
4d57a: 2689 movel %a1,%a3@
next_node->previous = previous_node;
4d57c: 234b 0004 movel %a3,%a1@(4)
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
4d580: 4a02 tstb %d2
4d582: 67c4 beqs 4d548 <_Thread_queue_Extract_priority_helper+0x74>
4d584: 60e8 bras 4d56e <_Thread_queue_Extract_priority_helper+0x9a>
4d586: 7003 moveq #3,%d0
4d588: 2540 0050 movel %d0,%a2@(80)
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
_ISR_Enable( level );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
4d58c: 46c1 movew %d1,%sr
(void) _Watchdog_Remove( &the_thread->Timer );
4d58e: 486a 0048 pea %a2@(72)
4d592: 4eb9 0004 aaa0 jsr 4aaa0 <_Watchdog_Remove>
4d598: 588f addql #4,%sp
4d59a: 227c 1007 fff8 moveal #268959736,%a1
4d5a0: 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
}
4d5a4: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5
4d5aa: 2d49 000c movel %a1,%fp@(12)
4d5ae: 4e5e unlk %fp
4d5b0: 4ef9 0004 98d0 jmp 498d0 <_Thread_Clear_state>
...
0004a4b0 <_Thread_queue_Initialize>:
the_thread_queue->state = state;
the_thread_queue->discipline = the_discipline;
the_thread_queue->timeout_status = timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
4a4b0: 7201 moveq #1,%d1
Thread_queue_Control *the_thread_queue,
Thread_queue_Disciplines the_discipline,
States_Control state,
uint32_t timeout_status
)
{
4a4b2: 4e56 0000 linkw %fp,#0
4a4b6: 206e 0008 moveal %fp@(8),%a0
4a4ba: 2f02 movel %d2,%sp@-
4a4bc: 202e 000c movel %fp@(12),%d0
the_thread_queue->state = state;
4a4c0: 216e 0010 0038 movel %fp@(16),%a0@(56)
the_thread_queue->discipline = the_discipline;
the_thread_queue->timeout_status = timeout_status;
4a4c6: 216e 0014 003c movel %fp@(20),%a0@(60)
States_Control state,
uint32_t timeout_status
)
{
the_thread_queue->state = state;
the_thread_queue->discipline = the_discipline;
4a4cc: 2140 0034 movel %d0,%a0@(52)
the_thread_queue->timeout_status = timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
4a4d0: 42a8 0030 clrl %a0@(48)
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
4a4d4: b280 cmpl %d0,%d1
4a4d6: 6714 beqs 4a4ec <_Thread_queue_Initialize+0x3c>
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 );
4a4d8: 2008 movel %a0,%d0
4a4da: 5880 addql #4,%d0
head->next = tail;
head->previous = NULL;
4a4dc: 42a8 0004 clrl %a0@(4)
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 );
4a4e0: 2080 movel %d0,%a0@
head->next = tail;
head->previous = NULL;
tail->previous = head;
4a4e2: 2148 0008 movel %a0,%a0@(8)
_Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
} else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */
_Chain_Initialize_empty( &the_thread_queue->Queues.Fifo );
}
}
4a4e6: 241f movel %sp@+,%d2
4a4e8: 4e5e unlk %fp
4a4ea: 4e75 rts
the_thread_queue->state = state;
the_thread_queue->discipline = the_discipline;
the_thread_queue->timeout_status = timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
4a4ec: 4280 clrl %d0
uint32_t index;
for( index=0 ;
index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
index++)
_Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
4a4ee: 2400 movel %d0,%d2
4a4f0: 2200 movel %d0,%d1
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
uint32_t index;
for( index=0 ;
index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
index++)
4a4f2: 5280 addql #1,%d0
_Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
4a4f4: e58a lsll #2,%d2
4a4f6: e989 lsll #4,%d1
4a4f8: 9282 subl %d2,%d1
4a4fa: 43f0 1800 lea %a0@(00000000,%d1:l),%a1
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 );
4a4fe: 2209 movel %a1,%d1
4a500: 5881 addql #4,%d1
4a502: 2281 movel %d1,%a1@
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
uint32_t index;
for( index=0 ;
4a504: 7204 moveq #4,%d1
head->next = tail;
head->previous = NULL;
4a506: 42a9 0004 clrl %a1@(4)
tail->previous = head;
4a50a: 2349 0008 movel %a1,%a1@(8)
4a50e: b280 cmpl %d0,%d1
4a510: 67d4 beqs 4a4e6 <_Thread_queue_Initialize+0x36> <== NEVER TAKEN
index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
index++)
_Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
4a512: 2400 movel %d0,%d2
4a514: 2200 movel %d0,%d1
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
uint32_t index;
for( index=0 ;
index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
index++)
4a516: 5280 addql #1,%d0
_Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
4a518: e58a lsll #2,%d2
4a51a: e989 lsll #4,%d1
4a51c: 9282 subl %d2,%d1
4a51e: 43f0 1800 lea %a0@(00000000,%d1:l),%a1
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 );
4a522: 2209 movel %a1,%d1
4a524: 5881 addql #4,%d1
4a526: 2281 movel %d1,%a1@
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
uint32_t index;
for( index=0 ;
4a528: 7204 moveq #4,%d1
head->next = tail;
head->previous = NULL;
4a52a: 42a9 0004 clrl %a1@(4)
tail->previous = head;
4a52e: 2349 0008 movel %a1,%a1@(8)
4a532: b280 cmpl %d0,%d1
4a534: 66b8 bnes 4a4ee <_Thread_queue_Initialize+0x3e>
4a536: 60ae bras 4a4e6 <_Thread_queue_Initialize+0x36>
0004d5b8 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
4d5b8: 4e56 0000 linkw %fp,#0
4d5bc: 206e 0008 moveal %fp@(8),%a0
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
4d5c0: 2268 0044 moveal %a0@(68),%a1
* 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 &&
4d5c4: 2029 0030 movel %a1@(48),%d0
4d5c8: 6708 beqs 4d5d2 <_Thread_queue_Process_timeout+0x1a>
4d5ca: b1f9 0006 142e cmpal 6142e <_Per_CPU_Information+0xe>,%a0
4d5d0: 6716 beqs 4d5e8 <_Thread_queue_Process_timeout+0x30><== ALWAYS TAKEN
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
4d5d2: 2169 003c 0034 movel %a1@(60),%a0@(52)
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
4d5d8: 2f08 movel %a0,%sp@-
4d5da: 2f09 movel %a1,%sp@-
4d5dc: 4eb9 0004 d49c jsr 4d49c <_Thread_queue_Extract>
4d5e2: 508f addql #8,%sp
}
}
4d5e4: 4e5e unlk %fp
4d5e6: 4e75 rts
* a timeout is not allowed to occur.
*/
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 ) {
4d5e8: 7203 moveq #3,%d1
4d5ea: b280 cmpl %d0,%d1
4d5ec: 67f6 beqs 4d5e4 <_Thread_queue_Process_timeout+0x2c>
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
4d5ee: 7002 moveq #2,%d0
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
}
}
4d5f0: 4e5e unlk %fp
*/
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;
4d5f2: 2169 003c 0034 movel %a1@(60),%a0@(52)
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
4d5f8: 2340 0030 movel %d0,%a1@(48)
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
}
}
...
0004a538 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
4a538: 4e56 fffc linkw %fp,#-4
4a53c: 2f0a movel %a2,%sp@-
4a53e: 246e 0008 moveal %fp@(8),%a2
4a542: 2f02 movel %d2,%sp@-
/*
* Just in case the thread really wasn't blocked on a thread queue
* when we get here.
*/
if ( !the_thread_queue )
4a544: 4a8a tstl %a2
4a546: 6708 beqs 4a550 <_Thread_queue_Requeue+0x18> <== 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 ) {
4a548: 7001 moveq #1,%d0
4a54a: b0aa 0034 cmpl %a2@(52),%d0
4a54e: 670c beqs 4a55c <_Thread_queue_Requeue+0x24> <== ALWAYS TAKEN
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
}
_ISR_Enable( level );
}
}
4a550: 242e fff4 movel %fp@(-12),%d2 <== NOT EXECUTED
4a554: 246e fff8 moveal %fp@(-8),%a2 <== NOT EXECUTED
4a558: 4e5e unlk %fp <== NOT EXECUTED
4a55a: 4e75 rts <== NOT EXECUTED
if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
4a55c: 303c 0700 movew #1792,%d0
4a560: 40c2 movew %sr,%d2
4a562: 8082 orl %d2,%d0
4a564: 46c0 movew %d0,%sr
4a566: 206e 000c moveal %fp@(12),%a0
4a56a: 2028 0010 movel %a0@(16),%d0
4a56e: 0280 0003 bee0 andil #245472,%d0
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
4a574: 660e bnes 4a584 <_Thread_queue_Requeue+0x4c> <== ALWAYS TAKEN
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
}
_ISR_Enable( level );
4a576: 46c2 movew %d2,%sr <== NOT EXECUTED
}
}
4a578: 242e fff4 movel %fp@(-12),%d2
4a57c: 246e fff8 moveal %fp@(-8),%a2
4a580: 4e5e unlk %fp
4a582: 4e75 rts
ISR_Level level_ignored;
_ISR_Disable( level );
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
4a584: 4878 0001 pea 1 <ADD>
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;
4a588: 7001 moveq #1,%d0
4a58a: 2f08 movel %a0,%sp@-
4a58c: 2540 0030 movel %d0,%a2@(48)
4a590: 2f0a movel %a2,%sp@-
4a592: 4eb9 0004 d4d4 jsr 4d4d4 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
4a598: 486e fffc pea %fp@(-4)
4a59c: 2f2e 000c movel %fp@(12),%sp@-
4a5a0: 2f0a movel %a2,%sp@-
4a5a2: 4eb9 0004 a28c jsr 4a28c <_Thread_queue_Enqueue_priority>
4a5a8: 4fef 0018 lea %sp@(24),%sp
}
_ISR_Enable( level );
4a5ac: 46c2 movew %d2,%sr
4a5ae: 60c8 bras 4a578 <_Thread_queue_Requeue+0x40>
0004a5b0 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
4a5b0: 4e56 fffc linkw %fp,#-4
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
4a5b4: 486e fffc pea %fp@(-4)
4a5b8: 2f2e 0008 movel %fp@(8),%sp@-
4a5bc: 4eb9 0004 9cf0 jsr 49cf0 <_Thread_Get>
switch ( location ) {
4a5c2: 508f addql #8,%sp
4a5c4: 4aae fffc tstl %fp@(-4)
4a5c8: 6618 bnes 4a5e2 <_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 );
4a5ca: 2f00 movel %d0,%sp@-
4a5cc: 4eb9 0004 d5b8 jsr 4d5b8 <_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;
4a5d2: 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;
4a5d4: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
--level;
4a5da: 5380 subql #1,%d0
_Thread_Dispatch_disable_level = level;
4a5dc: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
_Thread_Unnest_dispatch();
break;
}
}
4a5e2: 4e5e unlk %fp
...
00057cc4 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
57cc4: 4e56 ffb0 linkw %fp,#-80
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
57cc8: 41ee ffe8 lea %fp@(-24),%a0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
57ccc: 200e movel %fp,%d0
57cce: 5180 subql #8,%d0
57cd0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
57cd4: 246e 0008 moveal %fp@(8),%a2
57cd8: 2a0e movel %fp,%d5
57cda: 2c0e movel %fp,%d6
57cdc: 0685 ffff fff4 addil #-12,%d5
57ce2: 0686 ffff ffec addil #-20,%d6
57ce8: 260a movel %a2,%d3
57cea: 240a movel %a2,%d2
57cec: 4bf9 0005 c114 lea 5c114 <_Watchdog_Adjust_to_chain>,%a5
57cf2: 0683 0000 0030 addil #48,%d3
57cf8: 0682 0000 0068 addil #104,%d2
57cfe: 47f9 0005 87e4 lea 587e4 <_Chain_Get>,%a3
57d04: 49f9 0005 c1a0 lea 5c1a0 <_Watchdog_Insert>,%a4
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
57d0a: 283c 0000 0700 movel #1792,%d4
head->previous = NULL;
tail->previous = head;
57d10: 2d48 fff0 movel %a0,%fp@(-16)
57d14: 41ea 0008 lea %a2@(8),%a0
57d18: 2d48 ffe0 movel %a0,%fp@(-32)
57d1c: 41ea 0040 lea %a2@(64),%a0
57d20: 2d48 ffe4 movel %a0,%fp@(-28)
{
/*
* 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;
57d24: 41ee ffe8 lea %fp@(-24),%a0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
57d28: 2d40 fff4 movel %d0,%fp@(-12)
head->previous = NULL;
57d2c: 42ae ffec clrl %fp@(-20)
57d30: 42ae fff8 clrl %fp@(-8)
tail->previous = head;
57d34: 2d45 fffc movel %d5,%fp@(-4)
57d38: 2d40 ffd8 movel %d0,%fp@(-40)
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
57d3c: 2d46 ffe8 movel %d6,%fp@(-24)
57d40: 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;
57d44: 2039 0007 db50 movel 7db50 <_Watchdog_Ticks_since_boot>,%d0
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
57d4a: 222a 003c movel %a2@(60),%d1
watchdogs->last_snapshot = snapshot;
57d4e: 2540 003c movel %d0,%a2@(60)
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
57d52: 9081 subl %d1,%d0
57d54: 2f05 movel %d5,%sp@-
57d56: 2f00 movel %d0,%sp@-
57d58: 2f03 movel %d3,%sp@-
57d5a: 4e95 jsr %a5@
57d5c: 2f3c 3b9a ca00 movel #1000000000,%sp@-
57d62: 42a7 clrl %sp@-
57d64: 2f39 0007 da10 movel 7da10 <_TOD+0x4>,%sp@-
57d6a: 2f39 0007 da0c movel 7da0c <_TOD>,%sp@-
57d70: 4eb9 0006 d424 jsr 6d424 <__divdi3>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
57d76: 202a 0074 movel %a2@(116),%d0
/*
* 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 ) {
57d7a: 4fef 001c lea %sp@(28),%sp
57d7e: b081 cmpl %d1,%d0
57d80: 6500 009a bcsw 57e1c <_Timer_server_Body+0x158>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
57d84: b081 cmpl %d1,%d0
57d86: 6200 00b8 bhiw 57e40 <_Timer_server_Body+0x17c>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
57d8a: 2541 0074 movel %d1,%a2@(116)
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
57d8e: 202a 0078 movel %a2@(120),%d0
57d92: 2f00 movel %d0,%sp@-
57d94: 4e93 jsr %a3@
if ( timer == NULL ) {
57d96: 588f addql #4,%sp
57d98: 4a80 tstl %d0
57d9a: 672e beqs 57dca <_Timer_server_Body+0x106> <== ALWAYS TAKEN
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
57d9c: 2040 moveal %d0,%a0 <== NOT EXECUTED
57d9e: 7e01 moveq #1,%d7 <== NOT EXECUTED
57da0: 2228 0038 movel %a0@(56),%d1 <== NOT EXECUTED
57da4: be81 cmpl %d1,%d7 <== NOT EXECUTED
57da6: 6700 00bc beqw 57e64 <_Timer_server_Body+0x1a0> <== NOT EXECUTED
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
57daa: 7e03 moveq #3,%d7 <== NOT EXECUTED
57dac: be81 cmpl %d1,%d7 <== NOT EXECUTED
57dae: 66de bnes 57d8e <_Timer_server_Body+0xca> <== NOT EXECUTED
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
57db0: 2040 moveal %d0,%a0 <== NOT EXECUTED
57db2: 4868 0010 pea %a0@(16) <== NOT EXECUTED
57db6: 2f02 movel %d2,%sp@- <== NOT EXECUTED
57db8: 4e94 jsr %a4@ <== NOT EXECUTED
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
57dba: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED
)
{
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 );
57dbe: 508f addql #8,%sp <== NOT EXECUTED
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
57dc0: 2f00 movel %d0,%sp@- <== NOT EXECUTED
57dc2: 4e93 jsr %a3@ <== NOT EXECUTED
if ( timer == NULL ) {
57dc4: 588f addql #4,%sp <== NOT EXECUTED
57dc6: 4a80 tstl %d0 <== NOT EXECUTED
57dc8: 66d2 bnes 57d9c <_Timer_server_Body+0xd8> <== NOT EXECUTED
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
57dca: 2004 movel %d4,%d0
57dcc: 40c1 movew %sr,%d1
57dce: 8081 orl %d1,%d0
57dd0: 46c0 movew %d0,%sr
if ( _Chain_Is_empty( insert_chain ) ) {
57dd2: bcae ffe8 cmpl %fp@(-24),%d6
57dd6: 6700 009a beqw 57e72 <_Timer_server_Body+0x1ae>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
57dda: 46c1 movew %d1,%sr <== NOT EXECUTED
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
57ddc: 2039 0007 db50 movel 7db50 <_Watchdog_Ticks_since_boot>,%d0<== NOT EXECUTED
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
57de2: 222a 003c movel %a2@(60),%d1 <== NOT EXECUTED
watchdogs->last_snapshot = snapshot;
57de6: 2540 003c movel %d0,%a2@(60) <== NOT EXECUTED
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
57dea: 9081 subl %d1,%d0 <== NOT EXECUTED
57dec: 2f05 movel %d5,%sp@- <== NOT EXECUTED
57dee: 2f00 movel %d0,%sp@- <== NOT EXECUTED
57df0: 2f03 movel %d3,%sp@- <== NOT EXECUTED
57df2: 4e95 jsr %a5@ <== NOT EXECUTED
57df4: 2f3c 3b9a ca00 movel #1000000000,%sp@- <== NOT EXECUTED
57dfa: 42a7 clrl %sp@- <== NOT EXECUTED
57dfc: 2f39 0007 da10 movel 7da10 <_TOD+0x4>,%sp@- <== NOT EXECUTED
57e02: 2f39 0007 da0c movel 7da0c <_TOD>,%sp@- <== NOT EXECUTED
57e08: 4eb9 0006 d424 jsr 6d424 <__divdi3> <== NOT EXECUTED
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
57e0e: 202a 0074 movel %a2@(116),%d0 <== NOT EXECUTED
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
57e12: 4fef 001c lea %sp@(28),%sp <== NOT EXECUTED
57e16: b081 cmpl %d1,%d0 <== NOT EXECUTED
57e18: 6400 ff6a bccw 57d84 <_Timer_server_Body+0xc0> <== NOT EXECUTED
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
57e1c: 2f05 movel %d5,%sp@-
57e1e: 2e01 movel %d1,%d7
57e20: 9e80 subl %d0,%d7
57e22: 2f07 movel %d7,%sp@-
57e24: 2d41 ffdc movel %d1,%fp@(-36)
57e28: 2f02 movel %d2,%sp@-
57e2a: 4eb9 0005 c114 jsr 5c114 <_Watchdog_Adjust_to_chain>
57e30: 222e ffdc movel %fp@(-36),%d1
57e34: 4fef 000c lea %sp@(12),%sp
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
57e38: 2541 0074 movel %d1,%a2@(116)
57e3c: 6000 ff50 braw 57d8e <_Timer_server_Body+0xca>
/*
* 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 );
57e40: 9081 subl %d1,%d0
57e42: 2f00 movel %d0,%sp@-
57e44: 4878 0001 pea 1 <ADD>
57e48: 2d41 ffdc movel %d1,%fp@(-36)
57e4c: 2f02 movel %d2,%sp@-
57e4e: 4eb9 0005 c080 jsr 5c080 <_Watchdog_Adjust>
57e54: 222e ffdc movel %fp@(-36),%d1
57e58: 4fef 000c lea %sp@(12),%sp
}
watchdogs->last_snapshot = snapshot;
57e5c: 2541 0074 movel %d1,%a2@(116)
57e60: 6000 ff2c braw 57d8e <_Timer_server_Body+0xca>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
57e64: 4868 0010 pea %a0@(16) <== NOT EXECUTED
57e68: 2f03 movel %d3,%sp@- <== NOT EXECUTED
57e6a: 4e94 jsr %a4@ <== NOT EXECUTED
57e6c: 508f addql #8,%sp <== NOT EXECUTED
57e6e: 6000 ff1e braw 57d8e <_Timer_server_Body+0xca> <== NOT EXECUTED
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
57e72: 42aa 0078 clrl %a2@(120)
_ISR_Enable( level );
57e76: 46c1 movew %d1,%sr
_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 ) ) {
57e78: 2e2e ffd8 movel %fp@(-40),%d7
57e7c: beae fff4 cmpl %fp@(-12),%d7
57e80: 6758 beqs 57eda <_Timer_server_Body+0x216>
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
57e82: 2004 movel %d4,%d0
57e84: 40c1 movew %sr,%d1
57e86: 8081 orl %d1,%d0
57e88: 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;
57e8a: 206e fff4 moveal %fp@(-12),%a0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
57e8e: be88 cmpl %a0,%d7
57e90: 673a beqs 57ecc <_Timer_server_Body+0x208> <== NEVER TAKEN
57e92: 2e0a movel %a2,%d7
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
57e94: 2250 moveal %a0@,%a1
head->next = new_first;
new_first->previous = head;
57e96: 45ee fff4 lea %fp@(-12),%a2
57e9a: 234a 0004 movel %a2,%a1@(4)
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
57e9e: 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;
57ea2: 2d49 fff4 movel %a1,%fp@(-12)
_ISR_Enable( level );
57ea6: 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 );
57ea8: 2f28 0024 movel %a0@(36),%sp@-
57eac: 2f28 0020 movel %a0@(32),%sp@-
57eb0: 2068 001c moveal %a0@(28),%a0
57eb4: 4e90 jsr %a0@
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
57eb6: 2004 movel %d4,%d0
57eb8: 40c1 movew %sr,%d1
57eba: 8081 orl %d1,%d0
57ebc: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
57ebe: 508f addql #8,%sp
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
57ec0: 206e fff4 moveal %fp@(-12),%a0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
57ec4: b1ee ffd8 cmpal %fp@(-40),%a0
57ec8: 66ca bnes 57e94 <_Timer_server_Body+0x1d0>
57eca: 2447 moveal %d7,%a2
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
57ecc: 46c1 movew %d1,%sr
{
/*
* 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;
57ece: 41ee ffe8 lea %fp@(-24),%a0
57ed2: 2548 0078 movel %a0,%a2@(120)
57ed6: 6000 fe6c braw 57d44 <_Timer_server_Body+0x80>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
57eda: 4200 clrb %d0
57edc: 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;
57ee0: 2039 0007 da6a movel 7da6a <_Thread_Dispatch_disable_level>,%d0
++level;
57ee6: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
57ee8: 23c0 0007 da6a movel %d0,7da6a <_Thread_Dispatch_disable_level>
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
57eee: 4878 0008 pea 8 <DIVIDE_BY_ZERO>
57ef2: 2f12 movel %a2@,%sp@-
_Timer_server_Reset_interval_system_watchdog( ts );
_Timer_server_Reset_tod_system_watchdog( ts );
_Thread_Enable_dispatch();
ts->active = true;
57ef4: 7e01 moveq #1,%d7
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
57ef6: 4eb9 0005 bd10 jsr 5bd10 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
57efc: 2f0a movel %a2,%sp@-
57efe: 4eba fb7c jsr %pc@(57a7c <_Timer_server_Reset_interval_system_watchdog>)
_Timer_server_Reset_tod_system_watchdog( ts );
57f02: 2f0a movel %a2,%sp@-
57f04: 4eba fbe0 jsr %pc@(57ae6 <_Timer_server_Reset_tod_system_watchdog>)
_Thread_Enable_dispatch();
57f08: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
ts->active = true;
57f0e: 1547 007c moveb %d7,%a2@(124)
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
57f12: 2f2e ffe0 movel %fp@(-32),%sp@-
57f16: 4eb9 0005 c2d0 jsr 5c2d0 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
57f1c: 2f2e ffe4 movel %fp@(-28),%sp@-
57f20: 4eb9 0005 c2d0 jsr 5c2d0 <_Watchdog_Remove>
57f26: 4fef 0018 lea %sp@(24),%sp
{
/*
* 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;
57f2a: 41ee ffe8 lea %fp@(-24),%a0
57f2e: 2548 0078 movel %a0,%a2@(120)
57f32: 6000 fe10 braw 57d44 <_Timer_server_Body+0x80>
00057b54 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
57b54: 4e56 fff0 linkw %fp,#-16
57b58: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
57b5c: 246e 0008 moveal %fp@(8),%a2
57b60: 266e 000c moveal %fp@(12),%a3
if ( ts->insert_chain == NULL ) {
57b64: 202a 0078 movel %a2@(120),%d0
57b68: 671a beqs 57b84 <_Timer_server_Schedule_operation_method+0x30><== ALWAYS TAKEN
* 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 );
57b6a: 246a 0078 moveal %a2@(120),%a2 <== NOT EXECUTED
57b6e: 2d4b 000c movel %a3,%fp@(12) <== NOT EXECUTED
57b72: 2d4a 0008 movel %a2,%fp@(8) <== NOT EXECUTED
}
}
57b76: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 <== NOT EXECUTED
57b7c: 4e5e unlk %fp <== NOT EXECUTED
* 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 );
57b7e: 4ef9 0005 87ac jmp 587ac <_Chain_Append> <== NOT EXECUTED
*
* 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;
57b84: 2039 0007 da6a movel 7da6a <_Thread_Dispatch_disable_level>,%d0
++level;
57b8a: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
57b8c: 23c0 0007 da6a movel %d0,7da6a <_Thread_Dispatch_disable_level>
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
57b92: 202b 0038 movel %a3@(56),%d0
57b96: 7201 moveq #1,%d1
57b98: b280 cmpl %d0,%d1
57b9a: 6700 009e beqw 57c3a <_Timer_server_Schedule_operation_method+0xe6>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
if ( !ts->active ) {
_Timer_server_Reset_interval_system_watchdog( ts );
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
57b9e: 7603 moveq #3,%d3
57ba0: b680 cmpl %d0,%d3
57ba2: 670e beqs 57bb2 <_Timer_server_Schedule_operation_method+0x5e>
* 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 );
}
}
57ba4: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
57baa: 4e5e unlk %fp
if ( !ts->active ) {
_Timer_server_Reset_tod_system_watchdog( ts );
}
}
_Thread_Enable_dispatch();
57bac: 4ef9 0005 b350 jmp 5b350 <_Thread_Enable_dispatch>
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
57bb2: 203c 0000 0700 movel #1792,%d0
57bb8: 40c2 movew %sr,%d2
57bba: 8082 orl %d2,%d0
57bbc: 46c0 movew %d0,%sr
57bbe: 2f3c 3b9a ca00 movel #1000000000,%sp@-
57bc4: 42a7 clrl %sp@-
57bc6: 2f39 0007 da10 movel 7da10 <_TOD+0x4>,%sp@-
57bcc: 2f39 0007 da0c movel 7da0c <_TOD>,%sp@-
57bd2: 4eb9 0006 d424 jsr 6d424 <__divdi3>
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
57bd8: 202a 0074 movel %a2@(116),%d0
57bdc: 4fef 0010 lea %sp@(16),%sp
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
57be0: 43ea 006c lea %a2@(108),%a1
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
57be4: 206a 0068 moveal %a2@(104),%a0
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
57be8: b3c8 cmpal %a0,%a1
57bea: 671c beqs 57c08 <_Timer_server_Schedule_operation_method+0xb4>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
57bec: 2268 0010 moveal %a0@(16),%a1
if ( snapshot > last_snapshot ) {
57bf0: b081 cmpl %d1,%d0
57bf2: 6400 00ba bccw 57cae <_Timer_server_Schedule_operation_method+0x15a>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
57bf6: 2601 movel %d1,%d3
57bf8: 9680 subl %d0,%d3
if (delta_interval > delta) {
57bfa: b689 cmpl %a1,%d3
57bfc: 6400 00bc bccw 57cba <_Timer_server_Schedule_operation_method+0x166>
delta_interval -= delta;
57c00: 93c3 subal %d3,%a1
57c02: 2009 movel %a1,%d0
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
delta_interval += delta;
}
first_watchdog->delta_interval = delta_interval;
57c04: 2140 0010 movel %d0,%a0@(16)
}
ts->TOD_watchdogs.last_snapshot = snapshot;
57c08: 2541 0074 movel %d1,%a2@(116)
_ISR_Enable( level );
57c0c: 46c2 movew %d2,%sr
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
57c0e: 486b 0010 pea %a3@(16)
57c12: 486a 0068 pea %a2@(104)
57c16: 4eb9 0005 c1a0 jsr 5c1a0 <_Watchdog_Insert>
if ( !ts->active ) {
57c1c: 508f addql #8,%sp
57c1e: 102a 007c moveb %a2@(124),%d0
57c22: 6680 bnes 57ba4 <_Timer_server_Schedule_operation_method+0x50><== NEVER TAKEN
_Timer_server_Reset_tod_system_watchdog( ts );
57c24: 2f0a movel %a2,%sp@-
57c26: 4eba febe jsr %pc@(57ae6 <_Timer_server_Reset_tod_system_watchdog>)
57c2a: 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 );
}
}
57c2c: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
57c32: 4e5e unlk %fp
if ( !ts->active ) {
_Timer_server_Reset_tod_system_watchdog( ts );
}
}
_Thread_Enable_dispatch();
57c34: 4ef9 0005 b350 jmp 5b350 <_Thread_Enable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
57c3a: 203c 0000 0700 movel #1792,%d0
57c40: 40c2 movew %sr,%d2
57c42: 8082 orl %d2,%d0
57c44: 46c0 movew %d0,%sr
snapshot = _Watchdog_Ticks_since_boot;
57c46: 2039 0007 db50 movel 7db50 <_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 );
57c4c: 220a movel %a2,%d1
57c4e: 0681 0000 0034 addil #52,%d1
last_snapshot = ts->Interval_watchdogs.last_snapshot;
57c54: 262a 003c movel %a2@(60),%d3
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
57c58: 206a 0030 moveal %a2@(48),%a0
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
57c5c: b288 cmpl %a0,%d1
57c5e: 6712 beqs 57c72 <_Timer_server_Schedule_operation_method+0x11e>
first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain );
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
57c60: 2200 movel %d0,%d1
57c62: 9283 subl %d3,%d1
delta_interval = first_watchdog->delta_interval;
57c64: 2268 0010 moveal %a0@(16),%a1
if (delta_interval > delta) {
57c68: b3c1 cmpal %d1,%a1
57c6a: 633a blss 57ca6 <_Timer_server_Schedule_operation_method+0x152>
delta_interval -= delta;
57c6c: 93c1 subal %d1,%a1
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
57c6e: 2149 0010 movel %a1,%a0@(16)
}
ts->Interval_watchdogs.last_snapshot = snapshot;
57c72: 2540 003c movel %d0,%a2@(60)
_ISR_Enable( level );
57c76: 46c2 movew %d2,%sr
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
57c78: 486b 0010 pea %a3@(16)
57c7c: 486a 0030 pea %a2@(48)
57c80: 4eb9 0005 c1a0 jsr 5c1a0 <_Watchdog_Insert>
if ( !ts->active ) {
57c86: 508f addql #8,%sp
57c88: 102a 007c moveb %a2@(124),%d0
57c8c: 6600 ff16 bnew 57ba4 <_Timer_server_Schedule_operation_method+0x50>
_Timer_server_Reset_interval_system_watchdog( ts );
57c90: 2f0a movel %a2,%sp@-
57c92: 4eba fde8 jsr %pc@(57a7c <_Timer_server_Reset_interval_system_watchdog>)
57c96: 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 );
}
}
57c98: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3
57c9e: 4e5e unlk %fp
if ( !ts->active ) {
_Timer_server_Reset_tod_system_watchdog( ts );
}
}
_Thread_Enable_dispatch();
57ca0: 4ef9 0005 b350 jmp 5b350 <_Thread_Enable_dispatch>
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
57ca6: 93c9 subal %a1,%a1
}
first_watchdog->delta_interval = delta_interval;
57ca8: 2149 0010 movel %a1,%a0@(16)
57cac: 60c4 bras 57c72 <_Timer_server_Schedule_operation_method+0x11e>
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
57cae: d089 addl %a1,%d0
delta_interval += delta;
57cb0: 9081 subl %d1,%d0
}
first_watchdog->delta_interval = delta_interval;
57cb2: 2140 0010 movel %d0,%a0@(16)
57cb6: 6000 ff50 braw 57c08 <_Timer_server_Schedule_operation_method+0xb4>
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
57cba: 4280 clrl %d0 <== NOT EXECUTED
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
delta_interval += delta;
}
first_watchdog->delta_interval = delta_interval;
57cbc: 2140 0010 movel %d0,%a0@(16) <== NOT EXECUTED
57cc0: 6000 ff46 braw 57c08 <_Timer_server_Schedule_operation_method+0xb4><== NOT EXECUTED
0004c600 <_Timespec_Add_to>:
uint32_t _Timespec_Add_to(
struct timespec *time,
const struct timespec *add
)
{
4c600: 4e56 0000 linkw %fp,#0
4c604: 226e 000c moveal %fp@(12),%a1
4c608: 2f0a movel %a2,%sp@-
4c60a: 246e 0008 moveal %fp@(8),%a2
uint32_t seconds = add->tv_sec;
/* Add the basics */
time->tv_sec += add->tv_sec;
time->tv_nsec += add->tv_nsec;
4c60e: 206a 0004 moveal %a2@(4),%a0
4c612: d1e9 0004 addal %a1@(4),%a0
/* Now adjust it so nanoseconds is in range */
while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
4c616: 2208 movel %a0,%d1
uint32_t _Timespec_Add_to(
struct timespec *time,
const struct timespec *add
)
{
uint32_t seconds = add->tv_sec;
4c618: 2011 movel %a1@,%d0
/* Add the basics */
time->tv_sec += add->tv_sec;
4c61a: d192 addl %d0,%a2@
time->tv_nsec += add->tv_nsec;
4c61c: 2548 0004 movel %a0,%a2@(4)
/* Now adjust it so nanoseconds is in range */
while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
4c620: b1fc 3b9a c9ff cmpal #999999999,%a0
4c626: 6320 blss 4c648 <_Timespec_Add_to+0x48>
4c628: 2052 moveal %a2@,%a0
4c62a: 5288 addql #1,%a0
#include <sys/types.h>
#include <rtems/score/timespec.h>
#include <rtems/score/tod.h>
#include <rtems/score/watchdog.h>
uint32_t _Timespec_Add_to(
4c62c: 91c0 subal %d0,%a0
4c62e: 43f0 0800 lea %a0@(00000000,%d0:l),%a1
time->tv_sec += add->tv_sec;
time->tv_nsec += add->tv_nsec;
/* Now adjust it so nanoseconds is in range */
while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
4c632: 0681 c465 3600 addil #-1000000000,%d1
time->tv_sec++;
seconds++;
4c638: 5280 addql #1,%d0
/* Add the basics */
time->tv_sec += add->tv_sec;
time->tv_nsec += add->tv_nsec;
/* Now adjust it so nanoseconds is in range */
while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
4c63a: 0c81 3b9a c9ff cmpil #999999999,%d1
4c640: 62ec bhis 4c62e <_Timespec_Add_to+0x2e> <== NEVER TAKEN
4c642: 2541 0004 movel %d1,%a2@(4)
4c646: 2489 movel %a1,%a2@
time->tv_sec++;
seconds++;
}
return seconds;
}
4c648: 245f moveal %sp@+,%a2
4c64a: 4e5e unlk %fp
...
0004c0b8 <_Timestamp64_Divide>:
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
4c0b8: 4e56 fff4 linkw %fp,#-12
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
4c0bc: 206e 000c moveal %fp@(12),%a0
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
4c0c0: 48d7 040c moveml %d2-%d3/%a2,%sp@
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
4c0c4: 2410 movel %a0@,%d2
4c0c6: 2628 0004 movel %a0@(4),%d3
4c0ca: 2002 movel %d2,%d0
4c0cc: 8083 orl %d3,%d0
4c0ce: 676e beqs 4c13e <_Timestamp64_Divide+0x86> <== NEVER TAKEN
* This looks odd but gives the results the proper precision.
*
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
4c0d0: 206e 0008 moveal %fp@(8),%a0
4c0d4: 45f9 0005 d728 lea 5d728 <__divdi3>,%a2
4c0da: 2f3c 0001 86a0 movel #100000,%sp@-
4c0e0: 42a7 clrl %sp@-
4c0e2: 2f28 0004 movel %a0@(4),%sp@-
4c0e6: 2f10 movel %a0@,%sp@-
4c0e8: 4eb9 0005 d6c0 jsr 5d6c0 <__muldi3>
4c0ee: 4fef 000c lea %sp@(12),%sp
4c0f2: 2e83 movel %d3,%sp@
4c0f4: 2f02 movel %d2,%sp@-
4c0f6: 2f01 movel %d1,%sp@-
4c0f8: 2f00 movel %d0,%sp@-
4c0fa: 4e92 jsr %a2@
4c0fc: 4fef 0010 lea %sp@(16),%sp
4c100: 2400 movel %d0,%d2
*_ival_percentage = answer / 1000;
4c102: 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;
4c106: 2601 movel %d1,%d3
*_ival_percentage = answer / 1000;
4c108: 42a7 clrl %sp@-
4c10a: 2f01 movel %d1,%sp@-
4c10c: 2f02 movel %d2,%sp@-
4c10e: 4e92 jsr %a2@
4c110: 4fef 0010 lea %sp@(16),%sp
*_fval_percentage = answer % 1000;
4c114: 4878 03e8 pea 3e8 <DBL_MANT_DIG+0x3b3>
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
4c118: 206e 0010 moveal %fp@(16),%a0
*_fval_percentage = answer % 1000;
4c11c: 42a7 clrl %sp@-
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
4c11e: 2081 movel %d1,%a0@
*_fval_percentage = answer % 1000;
4c120: 2f03 movel %d3,%sp@-
4c122: 2f02 movel %d2,%sp@-
4c124: 4eb9 0005 db88 jsr 5db88 <__moddi3>
4c12a: 206e 0014 moveal %fp@(20),%a0
4c12e: 4fef 0010 lea %sp@(16),%sp
}
4c132: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
*/
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
*_fval_percentage = answer % 1000;
4c138: 2081 movel %d1,%a0@
}
4c13a: 4e5e unlk %fp
4c13c: 4e75 rts
)
{
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
*_ival_percentage = 0;
4c13e: 206e 0010 moveal %fp@(16),%a0 <== NOT EXECUTED
4c142: 4290 clrl %a0@ <== NOT EXECUTED
*_fval_percentage = 0;
4c144: 206e 0014 moveal %fp@(20),%a0 <== NOT EXECUTED
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
*_fval_percentage = answer % 1000;
}
4c148: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 <== NOT EXECUTED
{
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
*_ival_percentage = 0;
*_fval_percentage = 0;
4c14e: 4290 clrl %a0@ <== NOT EXECUTED
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
*_fval_percentage = answer % 1000;
}
4c150: 4e5e unlk %fp <== NOT EXECUTED
0004a938 <_User_extensions_Handler_initialization>:
void _User_extensions_Handler_initialization(void)
{
4a938: 4e56 fffc linkw %fp,#-4
uint32_t number_of_initial_extensions =
4a93c: 2039 0005 d994 movel 5d994 <Configuration+0x40>,%d0
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
4a942: 6604 bnes 4a948 <_User_extensions_Handler_initialization+0x10><== ALWAYS TAKEN
);
User_extensions_Switch_context ctx = { initial_extension_switch_controls };
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
}
}
4a944: 4e5e unlk %fp <== NOT EXECUTED
4a946: 4e75 rts <== NOT EXECUTED
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 =
_Workspace_Allocate_or_fatal_error(
4a948: 2200 movel %d0,%d1
4a94a: e988 lsll #4,%d0
4a94c: 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 =
4a94e: 9081 subl %d1,%d0
4a950: 2f00 movel %d0,%sp@-
4a952: 4eb9 0004 acf6 jsr 4acf6 <_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 };
4a958: 204e moveal %fp,%a0
4a95a: 2100 movel %d0,%a0@-
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
4a95c: 487a ff9a pea %pc@(4a8f8 <_User_extensions_Switch_visitor>)
4a960: 2f08 movel %a0,%sp@-
4a962: 4eb9 0004 a884 jsr 4a884 <_User_extensions_Iterate>
4a968: 4fef 000c lea %sp@(12),%sp
}
}
4a96c: 4e5e unlk %fp <== NOT EXECUTED
0004a884 <_User_extensions_Iterate>:
void _User_extensions_Iterate(
void *arg,
User_extensions_Visitor visitor
)
{
4a884: 4e56 ffec linkw %fp,#-20
Thread_Control *executing = _Thread_Executing;
const User_extensions_Table *callouts_current =
rtems_configuration_get_user_extension_table();
const User_extensions_Table *callouts_end =
callouts_current + rtems_configuration_get_number_of_initial_extensions();
4a888: 2039 0005 d994 movel 5d994 <Configuration+0x40>,%d0
void _User_extensions_Iterate(
void *arg,
User_extensions_Visitor visitor
)
{
4a88e: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@
Thread_Control *executing = _Thread_Executing;
const User_extensions_Table *callouts_current =
rtems_configuration_get_user_extension_table();
const User_extensions_Table *callouts_end =
callouts_current + rtems_configuration_get_number_of_initial_extensions();
4a892: eb88 lsll #5,%d0
void *arg,
User_extensions_Visitor visitor
)
{
Thread_Control *executing = _Thread_Executing;
const User_extensions_Table *callouts_current =
4a894: 2439 0005 d998 movel 5d998 <Configuration+0x44>,%d2
rtems_configuration_get_user_extension_table();
const User_extensions_Table *callouts_end =
4a89a: 2442 moveal %d2,%a2
4a89c: d5c0 addal %d0,%a2
void _User_extensions_Iterate(
void *arg,
User_extensions_Visitor visitor
)
{
4a89e: 282e 0008 movel %fp@(8),%d4
4a8a2: 266e 000c moveal %fp@(12),%a3
Thread_Control *executing = _Thread_Executing;
4a8a6: 2639 0006 142e movel 6142e <_Per_CPU_Information+0xe>,%d3
const User_extensions_Table *callouts_end =
callouts_current + rtems_configuration_get_number_of_initial_extensions();
const Chain_Node *node;
const Chain_Node *tail;
while ( callouts_current != callouts_end ) {
4a8ac: b5c2 cmpal %d2,%a2
4a8ae: 6716 beqs 4a8c6 <_User_extensions_Iterate+0x42> <== NEVER TAKEN
(*visitor)( executing, arg, callouts_current );
4a8b0: 2f02 movel %d2,%sp@-
++callouts_current;
4a8b2: 0682 0000 0020 addil #32,%d2
callouts_current + rtems_configuration_get_number_of_initial_extensions();
const Chain_Node *node;
const Chain_Node *tail;
while ( callouts_current != callouts_end ) {
(*visitor)( executing, arg, callouts_current );
4a8b8: 2f04 movel %d4,%sp@-
4a8ba: 2f03 movel %d3,%sp@-
4a8bc: 4e93 jsr %a3@
const User_extensions_Table *callouts_end =
callouts_current + rtems_configuration_get_number_of_initial_extensions();
const Chain_Node *node;
const Chain_Node *tail;
while ( callouts_current != callouts_end ) {
4a8be: 4fef 000c lea %sp@(12),%sp
4a8c2: b48a cmpl %a2,%d2
4a8c4: 66ea bnes 4a8b0 <_User_extensions_Iterate+0x2c>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4a8c6: 2479 0005 f88c moveal 5f88c <_User_extensions_List>,%a2
++callouts_current;
}
node = _Chain_Immutable_first( &_User_extensions_List );
tail = _Chain_Immutable_tail( &_User_extensions_List );
while ( node != tail ) {
4a8cc: b5fc 0005 f890 cmpal #391312,%a2
4a8d2: 6718 beqs 4a8ec <_User_extensions_Iterate+0x68>
const User_extensions_Control *extension =
(const User_extensions_Control *) node;
(*visitor)( executing, arg, &extension->Callouts );
4a8d4: 486a 0014 pea %a2@(20)
4a8d8: 2f04 movel %d4,%sp@-
4a8da: 2f03 movel %d3,%sp@-
4a8dc: 4e93 jsr %a3@
node = _Chain_Immutable_next( node );
}
}
4a8de: 2452 moveal %a2@,%a2
++callouts_current;
}
node = _Chain_Immutable_first( &_User_extensions_List );
tail = _Chain_Immutable_tail( &_User_extensions_List );
while ( node != tail ) {
4a8e0: 4fef 000c lea %sp@(12),%sp
4a8e4: b5fc 0005 f890 cmpal #391312,%a2
4a8ea: 66e8 bnes 4a8d4 <_User_extensions_Iterate+0x50>
(*visitor)( executing, arg, &extension->Callouts );
node = _Chain_Immutable_next( node );
}
}
4a8ec: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3
4a8f2: 4e5e unlk %fp
...
0004c364 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
4c364: 4e56 ffe8 linkw %fp,#-24
4c368: 226e 000c moveal %fp@(12),%a1
4c36c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@
ISR_Level level;
_ISR_Disable( level );
4c370: 263c 0000 0700 movel #1792,%d3
4c376: 2003 movel %d3,%d0
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
4c378: 266e 0008 moveal %fp@(8),%a3
4c37c: 242e 0010 movel %fp@(16),%d2
ISR_Level level;
_ISR_Disable( level );
4c380: 40c1 movew %sr,%d1
4c382: 8081 orl %d1,%d0
4c384: 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;
4c386: 244b moveal %a3,%a2
4c388: 205a moveal %a2@+,%a0
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
4c38a: b5c8 cmpal %a0,%a2
4c38c: 6746 beqs 4c3d4 <_Watchdog_Adjust+0x70>
switch ( direction ) {
4c38e: 4a89 tstl %a1
4c390: 664e bnes 4c3e0 <_Watchdog_Adjust+0x7c>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
4c392: 4a82 tstl %d2
4c394: 673e beqs 4c3d4 <_Watchdog_Adjust+0x70> <== NEVER TAKEN
if ( units < _Watchdog_First( header )->delta_interval ) {
4c396: 2028 0010 movel %a0@(16),%d0
4c39a: b082 cmpl %d2,%d0
4c39c: 6230 bhis 4c3ce <_Watchdog_Adjust+0x6a> <== NEVER TAKEN
4c39e: 49f9 0004 c5c8 lea 4c5c8 <_Watchdog_Tickle>,%a4
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
4c3a4: 7801 moveq #1,%d4
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
4c3a6: 9480 subl %d0,%d2
_Watchdog_First( header )->delta_interval = 1;
4c3a8: 2144 0010 movel %d4,%a0@(16)
_ISR_Enable( level );
4c3ac: 46c1 movew %d1,%sr
_Watchdog_Tickle( header );
4c3ae: 2f0b movel %a3,%sp@-
4c3b0: 4e94 jsr %a4@
_ISR_Disable( level );
4c3b2: 2003 movel %d3,%d0
4c3b4: 40c1 movew %sr,%d1
4c3b6: 8081 orl %d1,%d0
4c3b8: 46c0 movew %d0,%sr
if ( _Chain_Is_empty( header ) )
4c3ba: 588f addql #4,%sp
4c3bc: 2053 moveal %a3@,%a0
4c3be: b1ca cmpal %a2,%a0
4c3c0: 6712 beqs 4c3d4 <_Watchdog_Adjust+0x70>
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
4c3c2: 4a82 tstl %d2
4c3c4: 670e beqs 4c3d4 <_Watchdog_Adjust+0x70> <== NEVER TAKEN
if ( units < _Watchdog_First( header )->delta_interval ) {
4c3c6: 2028 0010 movel %a0@(16),%d0
4c3ca: b480 cmpl %d0,%d2
4c3cc: 64d6 bccs 4c3a4 <_Watchdog_Adjust+0x40>
_Watchdog_First( header )->delta_interval -= units;
4c3ce: 9082 subl %d2,%d0
4c3d0: 2140 0010 movel %d0,%a0@(16)
}
break;
}
}
_ISR_Enable( level );
4c3d4: 46c1 movew %d1,%sr
}
4c3d6: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4
4c3dc: 4e5e unlk %fp
4c3de: 4e75 rts
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
4c3e0: 7001 moveq #1,%d0
4c3e2: b089 cmpl %a1,%d0
4c3e4: 66ee bnes 4c3d4 <_Watchdog_Adjust+0x70> <== NEVER TAKEN
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
4c3e6: d5a8 0010 addl %d2,%a0@(16)
}
break;
}
}
_ISR_Enable( level );
4c3ea: 46c1 movew %d1,%sr
}
4c3ec: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4
4c3f2: 4e5e unlk %fp
...
0005c114 <_Watchdog_Adjust_to_chain>:
Chain_Control *header,
Watchdog_Interval units_arg,
Chain_Control *to_fire
)
{
5c114: 4e56 ffe4 linkw %fp,#-28
5c118: 226e 0010 moveal %fp@(16),%a1
5c11c: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@
Watchdog_Interval units = units_arg;
ISR_Level level;
Watchdog_Control *first;
_ISR_Disable( level );
5c120: 263c 0000 0700 movel #1792,%d3
5c126: 2003 movel %d3,%d0
Chain_Control *header,
Watchdog_Interval units_arg,
Chain_Control *to_fire
)
{
5c128: 242e 0008 movel %fp@(8),%d2
Watchdog_Interval units = units_arg;
ISR_Level level;
Watchdog_Control *first;
_ISR_Disable( level );
5c12c: 40c1 movew %sr,%d1
5c12e: 8081 orl %d1,%d0
5c130: 46c0 movew %d0,%sr
5c132: 2a42 moveal %d2,%a5
Watchdog_Interval units_arg,
Chain_Control *to_fire
)
{
Watchdog_Interval units = units_arg;
5c134: 282e 000c movel %fp@(12),%d4
5c138: 205d moveal %a5@+,%a0
Watchdog_Control *first;
_ISR_Disable( level );
while ( 1 ) {
if ( _Chain_Is_empty( header ) ) {
5c13a: b1cd cmpal %a5,%a0
5c13c: 6748 beqs 5c186 <_Watchdog_Adjust_to_chain+0x72>
/*
* If it is longer than "units" until the first element on the chain
* fires, then bump it and quit.
*/
if ( units < first->delta_interval ) {
5c13e: 2028 0010 movel %a0@(16),%d0
5c142: b084 cmpl %d4,%d0
5c144: 624a bhis 5c190 <_Watchdog_Adjust_to_chain+0x7c>
/*
* The first set happens in less than units, so take all of them
* off the chain and adjust units to reflect this.
*/
units -= first->delta_interval;
5c146: 9880 subl %d0,%d4
first->delta_interval = 0;
5c148: 42a8 0010 clrl %a0@(16)
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
5c14c: 2850 moveal %a0@,%a4
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
5c14e: 2009 movel %a1,%d0
5c150: 5880 addql #4,%d0
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
5c152: 2668 0004 moveal %a0@(4),%a3
next->previous = previous;
5c156: 294b 0004 movel %a3,%a4@(4)
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
5c15a: 2469 0008 moveal %a1@(8),%a2
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
previous->next = next;
5c15e: 268c movel %a4,%a3@
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
5c160: 2348 0008 movel %a0,%a1@(8)
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
5c164: 2080 movel %d0,%a0@
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
5c166: 214a 0004 movel %a2,%a0@(4)
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
old_last->next = the_node;
5c16a: 2488 movel %a0,%a2@
while ( 1 ) {
_Chain_Extract_unprotected( &first->Node );
_Chain_Append_unprotected( to_fire, &first->Node );
_ISR_Flash( level );
5c16c: 2003 movel %d3,%d0
5c16e: 46c1 movew %d1,%sr
5c170: 8081 orl %d1,%d0
5c172: 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;
5c174: 2442 moveal %d2,%a2
5c176: 2052 moveal %a2@,%a0
if ( _Chain_Is_empty( header ) )
5c178: b1cd cmpal %a5,%a0
5c17a: 67be beqs 5c13a <_Watchdog_Adjust_to_chain+0x26>
break;
first = _Watchdog_First( header );
if ( first->delta_interval != 0 )
5c17c: 4aa8 0010 tstl %a0@(16)
5c180: 67ca beqs 5c14c <_Watchdog_Adjust_to_chain+0x38>
Watchdog_Control *first;
_ISR_Disable( level );
while ( 1 ) {
if ( _Chain_Is_empty( header ) ) {
5c182: b1cd cmpal %a5,%a0
5c184: 66b8 bnes 5c13e <_Watchdog_Adjust_to_chain+0x2a> <== ALWAYS TAKEN
if ( first->delta_interval != 0 )
break;
}
}
_ISR_Enable( level );
5c186: 46c1 movew %d1,%sr
}
5c188: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5
5c18c: 4e5e unlk %fp
5c18e: 4e75 rts
/*
* If it is longer than "units" until the first element on the chain
* fires, then bump it and quit.
*/
if ( units < first->delta_interval ) {
first->delta_interval -= units;
5c190: 9084 subl %d4,%d0
5c192: 2140 0010 movel %d0,%a0@(16)
if ( first->delta_interval != 0 )
break;
}
}
_ISR_Enable( level );
5c196: 46c1 movew %d1,%sr
}
5c198: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5
5c19c: 4e5e unlk %fp <== NOT EXECUTED
0004a970 <_Watchdog_Insert>:
void _Watchdog_Insert(
Chain_Control *header,
Watchdog_Control *the_watchdog
)
{
4a970: 4e56 fff0 linkw %fp,#-16
4a974: 226e 000c moveal %fp@(12),%a1
4a978: 48d7 041c moveml %d2-%d4/%a2,%sp@
Watchdog_Interval delta_interval;
insert_isr_nest_level = _ISR_Nest_level;
_ISR_Disable( level );
4a97c: 283c 0000 0700 movel #1792,%d4
4a982: 2004 movel %d4,%d0
Watchdog_Control *after;
uint32_t insert_isr_nest_level;
Watchdog_Interval delta_interval;
insert_isr_nest_level = _ISR_Nest_level;
4a984: 2639 0006 1428 movel 61428 <_Per_CPU_Information+0x8>,%d3
_ISR_Disable( level );
4a98a: 40c2 movew %sr,%d2
4a98c: 8082 orl %d2,%d0
4a98e: 46c0 movew %d0,%sr
/*
* Check to see if the watchdog has just been inserted by a
* higher priority interrupt. If so, abandon this insert.
*/
if ( the_watchdog->state != WATCHDOG_INACTIVE ) {
4a990: 4aa9 0008 tstl %a1@(8)
4a994: 6600 009c bnew 4aa32 <_Watchdog_Insert+0xc2>
_ISR_Enable( level );
return;
}
the_watchdog->state = WATCHDOG_BEING_INSERTED;
_Watchdog_Sync_count++;
4a998: 2039 0006 10c8 movel 610c8 <_Watchdog_Sync_count>,%d0
if ( the_watchdog->state != WATCHDOG_INACTIVE ) {
_ISR_Enable( level );
return;
}
the_watchdog->state = WATCHDOG_BEING_INSERTED;
4a99e: 7201 moveq #1,%d1
_Watchdog_Sync_count++;
4a9a0: 5280 addql #1,%d0
if ( the_watchdog->state != WATCHDOG_INACTIVE ) {
_ISR_Enable( level );
return;
}
the_watchdog->state = WATCHDOG_BEING_INSERTED;
4a9a2: 2341 0008 movel %d1,%a1@(8)
_Watchdog_Sync_count++;
4a9a6: 23c0 0006 10c8 movel %d0,610c8 <_Watchdog_Sync_count>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4a9ac: 246e 0008 moveal %fp@(8),%a2
restart:
delta_interval = the_watchdog->initial;
4a9b0: 2029 000c movel %a1@(12),%d0
4a9b4: 2052 moveal %a2@,%a0
for ( after = _Watchdog_First( header ) ;
;
after = _Watchdog_Next( after ) ) {
if ( delta_interval == 0 || !_Watchdog_Next( after ) )
4a9b6: 6740 beqs 4a9f8 <_Watchdog_Insert+0x88>
4a9b8: 4a90 tstl %a0@
4a9ba: 673c beqs 4a9f8 <_Watchdog_Insert+0x88>
break;
if ( delta_interval < after->delta_interval ) {
4a9bc: 2228 0010 movel %a0@(16),%d1
4a9c0: b280 cmpl %d0,%d1
4a9c2: 622e bhis 4a9f2 <_Watchdog_Insert+0x82>
after->delta_interval -= delta_interval;
break;
}
delta_interval -= after->delta_interval;
4a9c4: 9081 subl %d1,%d0
_ISR_Flash( level );
4a9c6: 2204 movel %d4,%d1
4a9c8: 46c2 movew %d2,%sr
4a9ca: 8282 orl %d2,%d1
4a9cc: 46c1 movew %d1,%sr
if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) {
4a9ce: 7201 moveq #1,%d1
4a9d0: b2a9 0008 cmpl %a1@(8),%d1
4a9d4: 6648 bnes 4aa1e <_Watchdog_Insert+0xae>
goto exit_insert;
}
if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
4a9d6: 2239 0006 106e movel 6106e <_Watchdog_Sync_level>,%d1
4a9dc: b283 cmpl %d3,%d1
4a9de: 625c bhis 4aa3c <_Watchdog_Insert+0xcc>
exit_insert:
_Watchdog_Sync_level = insert_isr_nest_level;
_Watchdog_Sync_count--;
_ISR_Enable( level );
}
4a9e0: 2050 moveal %a0@,%a0
for ( after = _Watchdog_First( header ) ;
;
after = _Watchdog_Next( after ) ) {
if ( delta_interval == 0 || !_Watchdog_Next( after ) )
4a9e2: 4a80 tstl %d0
4a9e4: 6712 beqs 4a9f8 <_Watchdog_Insert+0x88>
4a9e6: 4a90 tstl %a0@
4a9e8: 670e beqs 4a9f8 <_Watchdog_Insert+0x88>
break;
if ( delta_interval < after->delta_interval ) {
4a9ea: 2228 0010 movel %a0@(16),%d1
4a9ee: b081 cmpl %d1,%d0
4a9f0: 64d2 bccs 4a9c4 <_Watchdog_Insert+0x54>
after->delta_interval -= delta_interval;
4a9f2: 9280 subl %d0,%d1
4a9f4: 2141 0010 movel %d1,%a0@(16)
_Watchdog_Activate( the_watchdog );
the_watchdog->delta_interval = delta_interval;
_Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
4a9f8: 2068 0004 moveal %a0@(4),%a0
RTEMS_INLINE_ROUTINE void _Watchdog_Activate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_ACTIVE;
4a9fc: 7202 moveq #2,%d1
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
4a9fe: 2450 moveal %a0@,%a2
}
}
_Watchdog_Activate( the_watchdog );
the_watchdog->delta_interval = delta_interval;
4aa00: 2340 0010 movel %d0,%a1@(16)
_Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
the_watchdog->start_time = _Watchdog_Ticks_since_boot;
4aa04: 2039 0006 10cc movel 610cc <_Watchdog_Ticks_since_boot>,%d0
4aa0a: 2341 0008 movel %d1,%a1@(8)
4aa0e: 2340 0014 movel %d0,%a1@(20)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
4aa12: 2348 0004 movel %a0,%a1@(4)
before_node = after_node->next;
after_node->next = the_node;
4aa16: 2089 movel %a1,%a0@
the_node->next = before_node;
before_node->previous = the_node;
4aa18: 2549 0004 movel %a1,%a2@(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;
4aa1c: 228a movel %a2,%a1@
exit_insert:
_Watchdog_Sync_level = insert_isr_nest_level;
4aa1e: 23c3 0006 106e movel %d3,6106e <_Watchdog_Sync_level>
_Watchdog_Sync_count--;
4aa24: 2039 0006 10c8 movel 610c8 <_Watchdog_Sync_count>,%d0
4aa2a: 5380 subql #1,%d0
4aa2c: 23c0 0006 10c8 movel %d0,610c8 <_Watchdog_Sync_count>
_ISR_Enable( level );
4aa32: 46c2 movew %d2,%sr
}
4aa34: 4cd7 041c moveml %sp@,%d2-%d4/%a2
4aa38: 4e5e unlk %fp
4aa3a: 4e75 rts
if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) {
goto exit_insert;
}
if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
_Watchdog_Sync_level = insert_isr_nest_level;
4aa3c: 23c3 0006 106e movel %d3,6106e <_Watchdog_Sync_level>
goto restart;
4aa42: 6000 ff68 braw 4a9ac <_Watchdog_Insert+0x3c>
...
0004aaa0 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
4aaa0: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/watchdog.h>
Watchdog_States _Watchdog_Remove(
Watchdog_Control *the_watchdog
)
{
4aaa6: 4e56 0000 linkw %fp,#0
4aaaa: 206e 0008 moveal %fp@(8),%a0
4aaae: 2f0a movel %a2,%sp@-
4aab0: 2f02 movel %d2,%sp@-
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
4aab2: 40c1 movew %sr,%d1
4aab4: 8081 orl %d1,%d0
4aab6: 46c0 movew %d0,%sr
previous_state = the_watchdog->state;
4aab8: 2028 0008 movel %a0@(8),%d0
switch ( previous_state ) {
4aabc: 7401 moveq #1,%d2
4aabe: b480 cmpl %d0,%d2
4aac0: 6764 beqs 4ab26 <_Watchdog_Remove+0x86>
4aac2: 6314 blss 4aad8 <_Watchdog_Remove+0x38>
_Watchdog_Sync_level = _ISR_Nest_level;
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4aac4: 2439 0006 10cc movel 610cc <_Watchdog_Ticks_since_boot>,%d2
4aaca: 2142 0018 movel %d2,%a0@(24)
_ISR_Enable( level );
4aace: 46c1 movew %d1,%sr
return( previous_state );
}
4aad0: 241f movel %sp@+,%d2
4aad2: 245f moveal %sp@+,%a2
4aad4: 4e5e unlk %fp
4aad6: 4e75 rts
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
previous_state = the_watchdog->state;
switch ( previous_state ) {
4aad8: 143c 0003 moveb #3,%d2
4aadc: b480 cmpl %d0,%d2
4aade: 65e4 bcss 4aac4 <_Watchdog_Remove+0x24> <== NEVER TAKEN
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
4aae0: 2250 moveal %a0@,%a1
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
4aae2: 42a8 0008 clrl %a0@(8)
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
4aae6: 4a91 tstl %a1@
4aae8: 6708 beqs 4aaf2 <_Watchdog_Remove+0x52>
next_watchdog->delta_interval += the_watchdog->delta_interval;
4aaea: 2428 0010 movel %a0@(16),%d2
4aaee: d5a9 0010 addl %d2,%a1@(16)
if ( _Watchdog_Sync_count )
4aaf2: 2479 0006 10c8 moveal 610c8 <_Watchdog_Sync_count>,%a2
4aaf8: 4a8a tstl %a2
4aafa: 670c beqs 4ab08 <_Watchdog_Remove+0x68>
_Watchdog_Sync_level = _ISR_Nest_level;
4aafc: 45f9 0006 1428 lea 61428 <_Per_CPU_Information+0x8>,%a2
4ab02: 23d2 0006 106e movel %a2@,6106e <_Watchdog_Sync_level>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
4ab08: 2468 0004 moveal %a0@(4),%a2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4ab0c: 2439 0006 10cc movel 610cc <_Watchdog_Ticks_since_boot>,%d2
next->previous = previous;
4ab12: 234a 0004 movel %a2,%a1@(4)
previous->next = next;
4ab16: 2489 movel %a1,%a2@
4ab18: 2142 0018 movel %d2,%a0@(24)
_ISR_Enable( level );
4ab1c: 46c1 movew %d1,%sr
return( previous_state );
}
4ab1e: 241f movel %sp@+,%d2
4ab20: 245f moveal %sp@+,%a2
4ab22: 4e5e unlk %fp
4ab24: 4e75 rts
_Watchdog_Sync_level = _ISR_Nest_level;
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4ab26: 2439 0006 10cc movel 610cc <_Watchdog_Ticks_since_boot>,%d2
/*
* 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;
4ab2c: 42a8 0008 clrl %a0@(8)
_Watchdog_Sync_level = _ISR_Nest_level;
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
4ab30: 2142 0018 movel %d2,%a0@(24)
_ISR_Enable( level );
4ab34: 46c1 movew %d1,%sr
return( previous_state );
}
4ab36: 241f movel %sp@+,%d2
4ab38: 245f moveal %sp@+,%a2
4ab3a: 4e5e unlk %fp
...
0004bc98 <_Watchdog_Report_chain>:
)
{
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
4bc98: 203c 0000 0700 movel #1792,%d0
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
4bc9e: 4e56 ffe8 linkw %fp,#-24
4bca2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
4bca6: 242e 0008 movel %fp@(8),%d2
4bcaa: 266e 000c moveal %fp@(12),%a3
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
4bcae: 40c3 movew %sr,%d3
4bcb0: 8083 orl %d3,%d0
4bcb2: 46c0 movew %d0,%sr
printk( "Watchdog Chain: %s %p\n", name, header );
4bcb4: 2f0b movel %a3,%sp@-
4bcb6: 4bf9 0004 4990 lea 44990 <printk>,%a5
4bcbc: 2f02 movel %d2,%sp@-
4bcbe: 4879 0006 0597 pea 60597 <_Copyright_Notice+0x4b>
4bcc4: 4e95 jsr %a5@
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
4bcc6: 245b moveal %a3@+,%a2
if ( !_Chain_Is_empty( header ) ) {
4bcc8: 4fef 000c lea %sp@(12),%sp
4bccc: b7ca cmpal %a2,%a3
4bcce: 672c beqs 4bcfc <_Watchdog_Report_chain+0x64>
4bcd0: 49f9 0004 bd14 lea 4bd14 <_Watchdog_Report>,%a4
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
4bcd6: 2f0a movel %a2,%sp@-
4bcd8: 42a7 clrl %sp@-
4bcda: 4e94 jsr %a4@
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
node != _Chain_Tail(header) ;
node = node->next )
4bcdc: 2452 moveal %a2@,%a2
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
4bcde: 508f addql #8,%sp
4bce0: b7ca cmpal %a2,%a3
4bce2: 66f2 bnes 4bcd6 <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
4bce4: 2f02 movel %d2,%sp@-
4bce6: 4879 0006 05ae pea 605ae <_Copyright_Notice+0x62>
4bcec: 4e95 jsr %a5@
4bcee: 508f addql #8,%sp
} else {
printk( "Chain is empty\n" );
}
_ISR_Enable( level );
4bcf0: 46c3 movew %d3,%sr
}
4bcf2: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4bcf8: 4e5e unlk %fp
4bcfa: 4e75 rts
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
4bcfc: 4879 0006 05bd pea 605bd <_Copyright_Notice+0x71>
4bd02: 4e95 jsr %a5@
4bd04: 588f addql #4,%sp
}
_ISR_Enable( level );
4bd06: 46c3 movew %d3,%sr
}
4bd08: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4bd0e: 4e5e unlk %fp
...
0004ab40 <_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 );
4ab40: 203c 0000 0700 movel #1792,%d0
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
4ab46: 4e56 ffe8 linkw %fp,#-24
4ab4a: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
4ab4e: 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 );
4ab52: 40c2 movew %sr,%d2
4ab54: 8082 orl %d2,%d0
4ab56: 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;
4ab58: 264c moveal %a4,%a3
4ab5a: 245b moveal %a3@+,%a2
if ( _Chain_Is_empty( header ) )
4ab5c: b7ca cmpal %a2,%a3
4ab5e: 673c beqs 4ab9c <_Watchdog_Tickle+0x5c>
* 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) {
4ab60: 202a 0010 movel %a2@(16),%d0
4ab64: 6708 beqs 4ab6e <_Watchdog_Tickle+0x2e> <== NEVER TAKEN
the_watchdog->delta_interval--;
4ab66: 5380 subql #1,%d0
4ab68: 2540 0010 movel %d0,%a2@(16)
if ( the_watchdog->delta_interval != 0 )
4ab6c: 662e bnes 4ab9c <_Watchdog_Tickle+0x5c>
4ab6e: 4bf9 0004 aaa0 lea 4aaa0 <_Watchdog_Remove>,%a5
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
4ab74: 263c 0000 0700 movel #1792,%d3
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
4ab7a: 2f0a movel %a2,%sp@-
4ab7c: 4e95 jsr %a5@
_ISR_Enable( level );
4ab7e: 46c2 movew %d2,%sr
switch( watchdog_state ) {
4ab80: 7202 moveq #2,%d1
4ab82: 588f addql #4,%sp
4ab84: b280 cmpl %d0,%d1
4ab86: 6720 beqs 4aba8 <_Watchdog_Tickle+0x68> <== ALWAYS TAKEN
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
4ab88: 2003 movel %d3,%d0
4ab8a: 40c2 movew %sr,%d2
4ab8c: 8082 orl %d2,%d0
4ab8e: 46c0 movew %d0,%sr
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4ab90: 2454 moveal %a4@,%a2
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
4ab92: b5cb cmpal %a3,%a2
4ab94: 6706 beqs 4ab9c <_Watchdog_Tickle+0x5c>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
4ab96: 4aaa 0010 tstl %a2@(16)
4ab9a: 67de beqs 4ab7a <_Watchdog_Tickle+0x3a>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
4ab9c: 46c2 movew %d2,%sr
}
4ab9e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4aba4: 4e5e unlk %fp
4aba6: 4e75 rts
_ISR_Enable( level );
switch( watchdog_state ) {
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
4aba8: 2f2a 0024 movel %a2@(36),%sp@-
4abac: 2f2a 0020 movel %a2@(32),%sp@-
4abb0: 206a 001c moveal %a2@(28),%a0
4abb4: 4e90 jsr %a0@
the_watchdog->id,
the_watchdog->user_data
);
break;
4abb6: 508f addql #8,%sp
4abb8: 60ce bras 4ab88 <_Watchdog_Tickle+0x48>
...
0004acf6 <_Workspace_Allocate_or_fatal_error>:
void *_Workspace_Allocate_or_fatal_error(
size_t size
)
{
4acf6: 4e56 0000 linkw %fp,#0
4acfa: 42a7 clrl %sp@-
4acfc: 42a7 clrl %sp@-
4acfe: 2f2e 0008 movel %fp@(8),%sp@-
4ad02: 4879 0006 0ff6 pea 60ff6 <_Workspace_Area>
4ad08: 4eb9 0004 cff0 jsr 4cff0 <_Heap_Allocate_aligned_with_boundary>
__builtin_return_address( 1 ),
memory
);
#endif
if ( memory == NULL )
4ad0e: 4fef 0010 lea %sp@(16),%sp
4ad12: 4a80 tstl %d0
4ad14: 6704 beqs 4ad1a <_Workspace_Allocate_or_fatal_error+0x24>
true,
INTERNAL_ERROR_WORKSPACE_ALLOCATION
);
return memory;
}
4ad16: 4e5e unlk %fp
4ad18: 4e75 rts
memory
);
#endif
if ( memory == NULL )
_Internal_error_Occurred(
4ad1a: 4878 0003 pea 3 <DIVIDE>
4ad1e: 4878 0001 pea 1 <ADD>
4ad22: 42a7 clrl %sp@-
4ad24: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
...
0004abbc <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
4abbc: 4e56 ffd8 linkw %fp,#-40
4abc0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
4abc4: 266e 0008 moveal %fp@(8),%a3
4abc8: 2c2e 000c movel %fp@(12),%d6
4abcc: 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();
4abd0: 4a39 0005 d986 tstb 5d986 <Configuration+0x32>
4abd6: 6600 00d2 bnew 4acaa <_Workspace_Handler_initialization+0xee>
4abda: 2839 0005 d958 movel 5d958 <Configuration+0x4>,%d4
4abe0: d8b9 0005 d954 addl 5d954 <Configuration>,%d4
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
4abe6: 1e39 0005 d984 moveb 5d984 <Configuration+0x30>,%d7
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) {
4abec: 4a86 tstl %d6
4abee: 6768 beqs 4ac58 <_Workspace_Handler_initialization+0x9c><== NEVER TAKEN
/* #define DEBUG_WORKSPACE */
#if defined(DEBUG_WORKSPACE)
#include <rtems/bspIo.h>
#endif
void _Workspace_Handler_initialization(
4abf0: 45eb 0004 lea %a3@(4),%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) {
4abf4: 4283 clrl %d3
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
4abf6: 49f9 0004 8708 lea 48708 <_Heap_Initialize>,%a4
for (i = 0; i < area_count; ++i) {
Heap_Area *area = &areas [i];
if ( do_zero ) {
memset( area->begin, 0, area->size );
4abfc: 4bf9 0004 f8b4 lea 4f8b4 <memset>,%a5
size_t i;
for (i = 0; i < area_count; ++i) {
Heap_Area *area = &areas [i];
if ( do_zero ) {
4ac02: 4a07 tstb %d7
4ac04: 6660 bnes 4ac66 <_Workspace_Handler_initialization+0xaa>
memset( area->begin, 0, area->size );
}
if ( area->size > overhead ) {
4ac06: 2412 movel %a2@,%d2
4ac08: 700e moveq #14,%d0
4ac0a: b082 cmpl %d2,%d0
4ac0c: 6440 bccs 4ac4e <_Workspace_Handler_initialization+0x92>
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
4ac0e: 4a39 0005 d985 tstb 5d985 <Configuration+0x31>
4ac14: 6618 bnes 4ac2e <_Workspace_Handler_initialization+0x72>
size = area->size;
} else {
if ( remaining > 0 ) {
4ac16: 4a84 tstl %d4
4ac18: 675a beqs 4ac74 <_Workspace_Handler_initialization+0xb8><== NEVER TAKEN
size = remaining < area->size - overhead ?
4ac1a: 2002 movel %d2,%d0
4ac1c: 0680 ffff fff2 addil #-14,%d0
remaining + overhead : area->size;
4ac22: b880 cmpl %d0,%d4
4ac24: 6408 bccs 4ac2e <_Workspace_Handler_initialization+0x72><== NEVER TAKEN
4ac26: 2404 movel %d4,%d2
4ac28: 0682 0000 000e addil #14,%d2
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4ac2e: 4878 0004 pea 4 <CONTEXT_ARG>
4ac32: 2f02 movel %d2,%sp@-
4ac34: 2f13 movel %a3@,%sp@-
4ac36: 4879 0006 0ff6 pea 60ff6 <_Workspace_Area>
4ac3c: 4e94 jsr %a4@
);
area->begin = (char *) area->begin + size;
area->size -= size;
if ( space_available < remaining ) {
4ac3e: 4fef 0010 lea %sp@(16),%sp
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
4ac42: d593 addl %d2,%a3@
area->size -= size;
4ac44: 9592 subl %d2,%a2@
if ( space_available < remaining ) {
4ac46: b880 cmpl %d0,%d4
4ac48: 634e blss 4ac98 <_Workspace_Handler_initialization+0xdc><== ALWAYS TAKEN
remaining -= space_available;
4ac4a: 9880 subl %d0,%d4 <== NOT EXECUTED
} else {
remaining = 0;
}
init_or_extend = extend;
4ac4c: 2845 moveal %d5,%a4 <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4ac4e: 5283 addql #1,%d3
4ac50: 508a addql #8,%a2
4ac52: 508b addql #8,%a3
4ac54: bc83 cmpl %d3,%d6
4ac56: 66aa bnes 4ac02 <_Workspace_Handler_initialization+0x46><== NEVER TAKEN
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
4ac58: 4a84 tstl %d4
4ac5a: 6654 bnes 4acb0 <_Workspace_Handler_initialization+0xf4>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
);
}
}
4ac5c: 4cee 3cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a5
4ac62: 4e5e unlk %fp
4ac64: 4e75 rts
for (i = 0; i < area_count; ++i) {
Heap_Area *area = &areas [i];
if ( do_zero ) {
memset( area->begin, 0, area->size );
4ac66: 2f12 movel %a2@,%sp@-
4ac68: 42a7 clrl %sp@-
4ac6a: 2f13 movel %a3@,%sp@-
4ac6c: 4e95 jsr %a5@
4ac6e: 4fef 000c lea %sp@(12),%sp
4ac72: 6092 bras 4ac06 <_Workspace_Handler_initialization+0x4a>
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4ac74: 4878 0004 pea 4 <CONTEXT_ARG> <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4ac78: 5283 addql #1,%d3 <== NOT EXECUTED
4ac7a: 508a addql #8,%a2 <== NOT EXECUTED
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
4ac7c: 42a7 clrl %sp@- <== NOT EXECUTED
4ac7e: 2f13 movel %a3@,%sp@- <== NOT EXECUTED
4ac80: 508b addql #8,%a3 <== NOT EXECUTED
4ac82: 4879 0006 0ff6 pea 60ff6 <_Workspace_Area> <== NOT EXECUTED
4ac88: 4e94 jsr %a4@ <== NOT EXECUTED
4ac8a: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED
remaining -= space_available;
} else {
remaining = 0;
}
init_or_extend = extend;
4ac8e: 2845 moveal %d5,%a4 <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
4ac90: bc83 cmpl %d3,%d6 <== NOT EXECUTED
4ac92: 6600 ff6e bnew 4ac02 <_Workspace_Handler_initialization+0x46><== NOT EXECUTED
4ac96: 60c0 bras 4ac58 <_Workspace_Handler_initialization+0x9c><== NOT EXECUTED
remaining -= space_available;
} else {
remaining = 0;
}
init_or_extend = extend;
4ac98: 2845 moveal %d5,%a4
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
} else {
remaining = 0;
4ac9a: 4284 clrl %d4
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) {
4ac9c: 5283 addql #1,%d3
4ac9e: 508a addql #8,%a2
4aca0: 508b addql #8,%a3
4aca2: bc83 cmpl %d3,%d6
4aca4: 6600 ff5c bnew 4ac02 <_Workspace_Handler_initialization+0x46>
4aca8: 60ae bras 4ac58 <_Workspace_Handler_initialization+0x9c>
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
4acaa: 4284 clrl %d4
4acac: 6000 ff32 braw 4abe0 <_Workspace_Handler_initialization+0x24>
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
_Internal_error_Occurred(
4acb0: 4878 0002 pea 2 <DOUBLE_FLOAT>
4acb4: 4878 0001 pea 1 <ADD>
4acb8: 42a7 clrl %sp@-
4acba: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
0005ce28 <_kill_r>:
int _kill_r(
struct _reent *ptr,
pid_t pid,
int sig
)
{
5ce28: 4e56 0000 linkw %fp,#0
return killinfo( pid, sig, NULL );
5ce2c: 2d6e 000c 0008 movel %fp@(12),%fp@(8)
int _kill_r(
struct _reent *ptr,
pid_t pid,
int sig
)
{
5ce32: 202e 0010 movel %fp@(16),%d0
return killinfo( pid, sig, NULL );
5ce36: 42ae 0010 clrl %fp@(16)
5ce3a: 2d40 000c movel %d0,%fp@(12)
}
5ce3e: 4e5e unlk %fp
struct _reent *ptr,
pid_t pid,
int sig
)
{
return killinfo( pid, sig, NULL );
5ce40: 4ef9 0005 d020 jmp 5d020 <killinfo>
...
0004727c <adjtime>:
*/
int adjtime(
const struct timeval *delta,
struct timeval *olddelta
)
{
4727c: 4e56 ffe0 linkw %fp,#-32
47280: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@
47284: 246e 0008 moveal %fp@(8),%a2
47288: 266e 000c moveal %fp@(12),%a3
long adjustment;
/*
* Simple validations
*/
if ( !delta )
4728c: 4a8a tstl %a2
4728e: 6700 0136 beqw 473c6 <adjtime+0x14a>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND )
47292: 202a 0004 movel %a2@(4),%d0
47296: 0c80 000f 423f cmpil #999999,%d0
4729c: 6200 0128 bhiw 473c6 <adjtime+0x14a>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( olddelta ) {
472a0: 4a8b tstl %a3
472a2: 670a beqs 472ae <adjtime+0x32>
olddelta->tv_sec = 0;
olddelta->tv_usec = 0;
472a4: 42ab 0004 clrl %a3@(4)
472a8: 202a 0004 movel %a2@(4),%d0
if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( olddelta ) {
olddelta->tv_sec = 0;
472ac: 4293 clrl %a3@
olddelta->tv_usec = 0;
}
/* convert delta to microseconds */
adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND);
472ae: 223c 000f 4240 movel #1000000,%d1
472b4: 4c12 1800 mulsl %a2@,%d1
adjustment += delta->tv_usec;
472b8: d081 addl %d1,%d0
/* too small to account for */
if ( adjustment < rtems_configuration_get_microseconds_per_tick() )
472ba: b0b9 0005 ea6c cmpl 5ea6c <Configuration+0xc>,%d0
472c0: 640c bccs 472ce <adjtime+0x52>
return 0;
472c2: 4280 clrl %d0
/* set the user's output */
if ( olddelta )
*olddelta = *delta;
return 0;
}
472c4: 4cee 0c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a3
472ca: 4e5e unlk %fp
472cc: 4e75 rts
*
* 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;
472ce: 2039 0006 25ae movel 625ae <_Thread_Dispatch_disable_level>,%d0
++level;
472d4: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
472d6: 23c0 0006 25ae movel %d0,625ae <_Thread_Dispatch_disable_level>
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
472dc: 4879 0006 2550 pea 62550 <_TOD>
_TOD_Get_with_nanoseconds( &tod_as_timestamp, &_TOD.now );
472e2: 280e movel %fp,%d4
472e4: 5184 subql #8,%d4
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
472e6: 2f04 movel %d4,%sp@-
472e8: 4eb9 0004 8dac jsr 48dac <_TOD_Get_with_nanoseconds>
472ee: 2040 moveal %d0,%a0
472f0: 2410 movel %a0@,%d2
472f2: 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);
472f6: 2f3c 3b9a ca00 movel #1000000000,%sp@-
472fc: 42a7 clrl %sp@-
472fe: 2f03 movel %d3,%sp@-
47300: 2f02 movel %d2,%sp@-
47302: 4eb9 0005 c8a4 jsr 5c8a4 <__divdi3>
_Thread_Disable_dispatch();
_TOD_Get( &ts );
ts.tv_sec += delta->tv_sec;
47308: 2a12 movel %a2@,%d5
4730a: 4fef 0010 lea %sp@(16),%sp
4730e: da81 addl %d1,%d5
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
47310: 2f3c 3b9a ca00 movel #1000000000,%sp@-
47316: 42a7 clrl %sp@-
47318: 2f03 movel %d3,%sp@-
4731a: 2f02 movel %d2,%sp@-
4731c: 4eb9 0005 cd04 jsr 5cd04 <__moddi3>
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
47322: 242a 0004 movel %a2@(4),%d2
47326: 203c 0000 03e8 movel #1000,%d0
4732c: 4c00 2800 mulsl %d0,%d2
int _EXFUN(setitimer, (int __which, const struct itimerval *__value,
struct itimerval *__ovalue));
#if defined(__rtems__)
/* BSD function used by RTEMS code */
int _EXFUN(adjtime,(const struct timeval *, struct timeval *));
47330: 2045 moveal %d5,%a0
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
47332: 4fef 0018 lea %sp@(24),%sp
47336: 5288 addql #1,%a0
_Thread_Disable_dispatch();
_TOD_Get( &ts );
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
47338: d282 addl %d2,%d1
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
4733a: 0c81 3b9a c9ff cmpil #999999999,%d1
47340: 6312 blss 47354 <adjtime+0xd8>
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
47342: 2a08 movel %a0,%d5
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
47344: 0681 c465 3600 addil #-1000000000,%d1
4734a: 5288 addql #1,%a0
ts.tv_sec += delta->tv_sec;
ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND;
/* if adjustment is too much positive */
while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
4734c: 0c81 3b9a c9ff cmpil #999999999,%d1
47352: 62ee bhis 47342 <adjtime+0xc6> <== NEVER TAKEN
47354: 2005 movel %d5,%d0
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
47356: 2401 movel %d1,%d2
47358: 5380 subql #1,%d0
ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec--;
4735a: 2200 movel %d0,%d1
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND;
4735c: 0682 3b9a ca00 addil #1000000000,%d2
47362: 5380 subql #1,%d0
ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
ts.tv_sec++;
}
/* if adjustment is too much negative */
while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) {
47364: 0c82 c465 3600 cmpil #-1000000000,%d2
4736a: 63ee blss 4735a <adjtime+0xde>
Timestamp64_Control *_time,
Timestamp64_Control _seconds,
Timestamp64_Control _nanoseconds
)
{
*_time = _seconds * 1000000000L + _nanoseconds;
4736c: 2f3c 3b9a ca00 movel #1000000000,%sp@-
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
47372: 2602 movel %d2,%d3
47374: 5bc2 smi %d2
47376: 49c2 extbl %d2
47378: 42a7 clrl %sp@-
4737a: 2f01 movel %d1,%sp@-
4737c: 5bc0 smi %d0
4737e: 49c0 extbl %d0
47380: 2f00 movel %d0,%sp@-
47382: 4eb9 0005 c83c jsr 5c83c <__muldi3>
&tod_as_timestamp,
tod_as_timespec->tv_sec,
tod_as_timespec->tv_nsec
);
_TOD_Set_with_timestamp( &tod_as_timestamp );
47388: 4fef 000c lea %sp@(12),%sp
4738c: d283 addl %d3,%d1
4738e: d182 addxl %d2,%d0
47390: 2e84 movel %d4,%sp@
47392: 2d40 fff8 movel %d0,%fp@(-8)
47396: 2d41 fffc movel %d1,%fp@(-4)
4739a: 4eb9 0004 8e30 jsr 48e30 <_TOD_Set_with_timestamp>
ts.tv_sec--;
}
_TOD_Set( &ts );
_Thread_Enable_dispatch();
473a0: 4eb9 0004 a664 jsr 4a664 <_Thread_Enable_dispatch>
/* set the user's output */
if ( olddelta )
473a6: 588f addql #4,%sp
473a8: 4a8b tstl %a3
473aa: 6700 ff16 beqw 472c2 <adjtime+0x46>
*olddelta = *delta;
return 0;
473ae: 4280 clrl %d0
_Thread_Enable_dispatch();
/* set the user's output */
if ( olddelta )
*olddelta = *delta;
473b0: 2212 movel %a2@,%d1
473b2: 242a 0004 movel %a2@(4),%d2
473b6: 2681 movel %d1,%a3@
473b8: 2742 0004 movel %d2,%a3@(4)
return 0;
}
473bc: 4cee 0c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a3
473c2: 4e5e unlk %fp
473c4: 4e75 rts
*/
if ( !delta )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND )
rtems_set_errno_and_return_minus_one( EINVAL );
473c6: 4eb9 0004 faf0 jsr 4faf0 <__errno>
473cc: 7216 moveq #22,%d1
473ce: 2040 moveal %d0,%a0
473d0: 70ff moveq #-1,%d0
/* set the user's output */
if ( olddelta )
*olddelta = *delta;
return 0;
}
473d2: 4cee 0c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a3
*/
if ( !delta )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND )
rtems_set_errno_and_return_minus_one( EINVAL );
473d8: 2081 movel %d1,%a0@
/* set the user's output */
if ( olddelta )
*olddelta = *delta;
return 0;
}
473da: 4e5e unlk %fp
...
000474ac <aio_cancel>:
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
474ac: 4e56 ffe8 linkw %fp,#-24
474b0: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
474b4: 4879 0006 35ac pea 635ac <aio_request_queue>
474ba: 49f9 0004 8868 lea 48868 <pthread_mutex_lock>,%a4
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
474c0: 242e 0008 movel %fp@(8),%d2
474c4: 246e 000c moveal %fp@(12),%a2
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
474c8: 4e94 jsr %a4@
if (fcntl (fildes, F_GETFD) < 0) {
474ca: 4878 0001 pea 1 <ADD>
474ce: 2f02 movel %d2,%sp@-
474d0: 4eb9 0004 e148 jsr 4e148 <fcntl>
474d6: 4fef 000c lea %sp@(12),%sp
474da: 4a80 tstl %d0
474dc: 6d00 01c4 bltw 476a2 <aio_cancel+0x1f6>
pthread_mutex_unlock(&aio_request_queue.mutex);
rtems_set_errno_and_return_minus_one (EBADF);
}
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
474e0: 4a8a tstl %a2
474e2: 6700 00f4 beqw 475d8 <aio_cancel+0x12c>
pthread_mutex_unlock (&aio_request_queue.mutex);
return AIO_CANCELED;
} else {
AIO_printf ("Cancel request\n");
if (aiocbp->aio_fildes != fildes) {
474e6: 2612 movel %a2@,%d3
474e8: b483 cmpl %d3,%d2
474ea: 6600 00c4 bnew 475b0 <aio_cancel+0x104>
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);
474ee: 42a7 clrl %sp@-
474f0: 4bf9 0004 7c32 lea 47c32 <rtems_aio_search_fd>,%a5
474f6: 2f03 movel %d3,%sp@-
474f8: 4879 0006 35f4 pea 635f4 <aio_request_queue+0x48>
474fe: 4e95 jsr %a5@
if (r_chain == NULL) {
47500: 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);
47504: 2640 moveal %d0,%a3
if (r_chain == NULL) {
47506: 4a80 tstl %d0
47508: 673c beqs 47546 <aio_cancel+0x9a>
return AIO_ALLDONE;
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
4750a: 2600 movel %d0,%d3
4750c: 0683 0000 001c addil #28,%d3
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
pthread_mutex_unlock (&r_chain->mutex);
47512: 4bf9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a5
return AIO_ALLDONE;
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
47518: 2f03 movel %d3,%sp@-
4751a: 4e94 jsr %a4@
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
4751c: 2f0a movel %a2,%sp@-
4751e: 486b 0008 pea %a3@(8)
47522: 4eb9 0004 7d5a jsr 47d5a <rtems_aio_remove_req>
47528: 2400 movel %d0,%d2
pthread_mutex_unlock (&r_chain->mutex);
4752a: 2f03 movel %d3,%sp@-
4752c: 4e95 jsr %a5@
pthread_mutex_unlock (&aio_request_queue.mutex);
4752e: 4879 0006 35ac pea 635ac <aio_request_queue>
47534: 4e95 jsr %a5@
return result;
47536: 4fef 0014 lea %sp@(20),%sp
}
return AIO_ALLDONE;
}
4753a: 2002 movel %d2,%d0
4753c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
47542: 4e5e unlk %fp
47544: 4e75 rts
rtems_set_errno_and_return_minus_one (EINVAL);
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
if (r_chain == NULL) {
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
47546: 203c 0006 3604 movel #407044,%d0
4754c: b0b9 0006 3600 cmpl 63600 <aio_request_queue+0x54>,%d0
47552: 6740 beqs 47594 <aio_cancel+0xe8> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
47554: 42a7 clrl %sp@-
47556: 2f03 movel %d3,%sp@-
47558: 4879 0006 3600 pea 63600 <aio_request_queue+0x54>
4755e: 4e95 jsr %a5@
if (r_chain == NULL) {
47560: 4fef 000c lea %sp@(12),%sp
47564: 4a80 tstl %d0
47566: 6748 beqs 475b0 <aio_cancel+0x104>
rtems_set_errno_and_return_minus_one (EINVAL);
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
47568: 2f0a movel %a2,%sp@-
4756a: 2040 moveal %d0,%a0
4756c: 4868 0008 pea %a0@(8)
47570: 4eb9 0004 7d5a jsr 47d5a <rtems_aio_remove_req>
pthread_mutex_unlock (&aio_request_queue.mutex);
47576: 4879 0006 35ac pea 635ac <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);
4757c: 2400 movel %d0,%d2
pthread_mutex_unlock (&aio_request_queue.mutex);
4757e: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock>
return result;
47584: 4fef 000c lea %sp@(12),%sp
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
47588: 2002 movel %d2,%d0
4758a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
47590: 4e5e unlk %fp
47592: 4e75 rts
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);
47594: 4879 0006 35ac pea 635ac <aio_request_queue>
return AIO_ALLDONE;
4759a: 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);
4759c: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock>
return AIO_ALLDONE;
475a2: 588f addql #4,%sp
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
475a4: 2002 movel %d2,%d0
475a6: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
475ac: 4e5e unlk %fp
475ae: 4e75 rts
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
if (r_chain == NULL) {
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);
475b0: 4879 0006 35ac pea 635ac <aio_request_queue>
rtems_set_errno_and_return_minus_one (EINVAL);
475b6: 74ff moveq #-1,%d2
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
if (r_chain == NULL) {
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);
475b8: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EINVAL);
475be: 4eb9 0005 15f8 jsr 515f8 <__errno>
475c4: 588f addql #4,%sp
475c6: 2040 moveal %d0,%a0
475c8: 7016 moveq #22,%d0
475ca: 2080 movel %d0,%a0@
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
475cc: 2002 movel %d2,%d0
475ce: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
475d4: 4e5e unlk %fp
475d6: 4e75 rts
/* 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);
475d8: 42a7 clrl %sp@-
475da: 45f9 0004 7c32 lea 47c32 <rtems_aio_search_fd>,%a2
475e0: 2f02 movel %d2,%sp@-
475e2: 4879 0006 35f4 pea 635f4 <aio_request_queue+0x48>
475e8: 4e92 jsr %a2@
if (r_chain == NULL) {
475ea: 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);
475ee: 2600 movel %d0,%d3
if (r_chain == NULL) {
475f0: 673e beqs 47630 <aio_cancel+0x184>
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
475f2: 2640 moveal %d0,%a3
475f4: 47eb 001c lea %a3@(28),%a3
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
pthread_mutex_unlock (&r_chain->mutex);
475f8: 45f9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a2
pthread_mutex_unlock (&aio_request_queue.mutex);
return AIO_CANCELED;
475fe: 4282 clrl %d2
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
47600: 2f0b movel %a3,%sp@-
47602: 4e94 jsr %a4@
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
47604: 2f03 movel %d3,%sp@-
47606: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
4760c: 2f03 movel %d3,%sp@-
4760e: 4eb9 0004 7d02 jsr 47d02 <rtems_aio_remove_fd>
pthread_mutex_unlock (&r_chain->mutex);
47614: 2f0b movel %a3,%sp@-
47616: 4e92 jsr %a2@
pthread_mutex_unlock (&aio_request_queue.mutex);
47618: 4879 0006 35ac pea 635ac <aio_request_queue>
4761e: 4e92 jsr %a2@
return AIO_CANCELED;
47620: 4fef 0014 lea %sp@(20),%sp
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
47624: 2002 movel %d2,%d0
47626: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4762c: 4e5e unlk %fp
4762e: 4e75 rts
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)) {
47630: 203c 0006 3604 movel #407044,%d0
47636: b0b9 0006 3600 cmpl 63600 <aio_request_queue+0x54>,%d0
4763c: 6700 ff56 beqw 47594 <aio_cancel+0xe8>
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
47640: 42a7 clrl %sp@-
47642: 2f02 movel %d2,%sp@-
47644: 4879 0006 3600 pea 63600 <aio_request_queue+0x54>
4764a: 4e92 jsr %a2@
if (r_chain == NULL) {
4764c: 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);
47650: 2600 movel %d0,%d3
if (r_chain == NULL) {
47652: 6700 ff40 beqw 47594 <aio_cancel+0xe8>
47656: 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);
47658: 2440 moveal %d0,%a2
4765a: 45ea 001c lea %a2@(28),%a2
pthread_cond_destroy (&r_chain->mutex);
free (r_chain);
pthread_mutex_unlock (&aio_request_queue.mutex);
return AIO_CANCELED;
4765e: 4282 clrl %d2
47660: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract>
}
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
47666: 2f03 movel %d3,%sp@-
47668: 4eb9 0004 7d02 jsr 47d02 <rtems_aio_remove_fd>
pthread_mutex_destroy (&r_chain->mutex);
4766e: 2f0a movel %a2,%sp@-
47670: 4eb9 0004 85cc jsr 485cc <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->mutex);
47676: 2f0a movel %a2,%sp@-
47678: 4eb9 0004 8258 jsr 48258 <pthread_cond_destroy>
free (r_chain);
4767e: 2f03 movel %d3,%sp@-
47680: 4eb9 0004 35f8 jsr 435f8 <free>
pthread_mutex_unlock (&aio_request_queue.mutex);
47686: 4879 0006 35ac pea 635ac <aio_request_queue>
4768c: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock>
return AIO_CANCELED;
47692: 4fef 0018 lea %sp@(24),%sp
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
47696: 2002 movel %d2,%d0
47698: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
4769e: 4e5e unlk %fp
476a0: 4e75 rts
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
if (fcntl (fildes, F_GETFD) < 0) {
pthread_mutex_unlock(&aio_request_queue.mutex);
476a2: 4879 0006 35ac pea 635ac <aio_request_queue>
rtems_set_errno_and_return_minus_one (EBADF);
476a8: 74ff moveq #-1,%d2
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
if (fcntl (fildes, F_GETFD) < 0) {
pthread_mutex_unlock(&aio_request_queue.mutex);
476aa: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EBADF);
476b0: 4eb9 0005 15f8 jsr 515f8 <__errno>
476b6: 588f addql #4,%sp
476b8: 7209 moveq #9,%d1
476ba: 2040 moveal %d0,%a0
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
476bc: 2002 movel %d2,%d0
476be: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5
pthread_mutex_lock (&aio_request_queue.mutex);
if (fcntl (fildes, F_GETFD) < 0) {
pthread_mutex_unlock(&aio_request_queue.mutex);
rtems_set_errno_and_return_minus_one (EBADF);
476c4: 2081 movel %d1,%a0@
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
return AIO_ALLDONE;
}
476c6: 4e5e unlk %fp
...
000476dc <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
476dc: 203c 0000 2000 movel #8192,%d0
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
476e2: 4e56 0000 linkw %fp,#0
476e6: 2f0a movel %a2,%sp@-
476e8: 246e 000c moveal %fp@(12),%a2
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
476ec: b0ae 0008 cmpl %fp@(8),%d0
476f0: 6648 bnes 4773a <aio_fsync+0x5e>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
476f2: 4878 0003 pea 3 <DIVIDE>
476f6: 2f12 movel %a2@,%sp@-
476f8: 4eb9 0004 e148 jsr 4e148 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
476fe: 508f addql #8,%sp
47700: 7203 moveq #3,%d1
47702: c081 andl %d1,%d0
47704: 123c 0001 moveb #1,%d1
47708: 5380 subql #1,%d0
4770a: b280 cmpl %d0,%d1
4770c: 654e bcss 4775c <aio_fsync+0x80>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
4770e: 4878 0018 pea 18 <OPER2+0x4>
47712: 4eb9 0004 3a48 jsr 43a48 <malloc>
if (req == NULL)
47718: 588f addql #4,%sp
4771a: 4a80 tstl %d0
4771c: 6760 beqs 4777e <aio_fsync+0xa2> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
4771e: 2040 moveal %d0,%a0
req->aiocbp->aio_lio_opcode = LIO_SYNC;
47720: 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;
47722: 214a 0014 movel %a2,%a0@(20)
req->aiocbp->aio_lio_opcode = LIO_SYNC;
47726: 2541 002c movel %d1,%a2@(44)
return rtems_aio_enqueue (req);
}
4772a: 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);
4772e: 2d40 0008 movel %d0,%fp@(8)
}
47732: 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);
47734: 4ef9 0004 7dbe jmp 47dbe <rtems_aio_enqueue>
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
4773a: 7216 moveq #22,%d1
4773c: 70ff moveq #-1,%d0
4773e: 2541 0030 movel %d1,%a2@(48)
47742: 2540 0034 movel %d0,%a2@(52)
47746: 4eb9 0005 15f8 jsr 515f8 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
4774c: 246e fffc moveal %fp@(-4),%a2
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
47750: 2040 moveal %d0,%a0
47752: 7016 moveq #22,%d0
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
47754: 4e5e unlk %fp
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
47756: 2080 movel %d0,%a0@
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
47758: 70ff moveq #-1,%d0
4775a: 4e75 rts
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
4775c: 72ff moveq #-1,%d1
4775e: 7009 moveq #9,%d0
47760: 2541 0034 movel %d1,%a2@(52)
47764: 2540 0030 movel %d0,%a2@(48)
47768: 4eb9 0005 15f8 jsr 515f8 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
4776e: 246e fffc moveal %fp@(-4),%a2
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
47772: 2040 moveal %d0,%a0
47774: 7209 moveq #9,%d1
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
47776: 70ff moveq #-1,%d0
47778: 4e5e unlk %fp
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
4777a: 2081 movel %d1,%a0@
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
4777c: 4e75 rts
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
4777e: 103c 000b moveb #11,%d0 <== NOT EXECUTED
47782: 72ff moveq #-1,%d1 <== NOT EXECUTED
47784: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED
47788: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED
4778c: 4eb9 0005 15f8 jsr 515f8 <__errno> <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
47792: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
47796: 2040 moveal %d0,%a0 <== NOT EXECUTED
47798: 700b moveq #11,%d0 <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
4779a: 4e5e unlk %fp <== NOT EXECUTED
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
4779c: 2080 movel %d0,%a0@ <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
4779e: 70ff moveq #-1,%d0 <== NOT EXECUTED
...
00047fec <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
47fec: 4e56 0000 linkw %fp,#0
47ff0: 2f0a movel %a2,%sp@-
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
47ff2: 4878 0003 pea 3 <DIVIDE>
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
47ff6: 246e 0008 moveal %fp@(8),%a2
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
47ffa: 2f12 movel %a2@,%sp@-
47ffc: 4eb9 0004 e148 jsr 4e148 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
48002: 508f addql #8,%sp
48004: 7203 moveq #3,%d1
48006: c081 andl %d1,%d0
48008: 6708 beqs 48012 <aio_read+0x26> <== NEVER TAKEN
4800a: 123c 0002 moveb #2,%d1
4800e: b280 cmpl %d0,%d1
48010: 6638 bnes 4804a <aio_read+0x5e>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
48012: 4aaa 0014 tstl %a2@(20)
48016: 6654 bnes 4806c <aio_read+0x80>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
48018: 4aaa 0004 tstl %a2@(4)
4801c: 6b4e bmis 4806c <aio_read+0x80>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
4801e: 4878 0018 pea 18 <OPER2+0x4>
48022: 4eb9 0004 3a48 jsr 43a48 <malloc>
if (req == NULL)
48028: 588f addql #4,%sp
4802a: 4a80 tstl %d0
4802c: 6760 beqs 4808e <aio_read+0xa2> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
4802e: 2040 moveal %d0,%a0
req->aiocbp->aio_lio_opcode = LIO_READ;
48030: 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;
48032: 214a 0014 movel %a2,%a0@(20)
req->aiocbp->aio_lio_opcode = LIO_READ;
48036: 2541 002c movel %d1,%a2@(44)
return rtems_aio_enqueue (req);
}
4803a: 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);
4803e: 2d40 0008 movel %d0,%fp@(8)
}
48042: 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);
48044: 4ef9 0004 7dbe jmp 47dbe <rtems_aio_enqueue>
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
4804a: 7009 moveq #9,%d0
4804c: 72ff moveq #-1,%d1
4804e: 2540 0030 movel %d0,%a2@(48)
48052: 2541 0034 movel %d1,%a2@(52)
48056: 4eb9 0005 15f8 jsr 515f8 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
4805c: 246e fffc moveal %fp@(-4),%a2
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
48060: 2040 moveal %d0,%a0
48062: 7009 moveq #9,%d0
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
48064: 4e5e unlk %fp
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
48066: 2080 movel %d0,%a0@
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
48068: 70ff moveq #-1,%d0
4806a: 4e75 rts
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
4806c: 72ff moveq #-1,%d1
4806e: 7016 moveq #22,%d0
48070: 2541 0034 movel %d1,%a2@(52)
48074: 2540 0030 movel %d0,%a2@(48)
48078: 4eb9 0005 15f8 jsr 515f8 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
4807e: 246e fffc moveal %fp@(-4),%a2
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
48082: 2040 moveal %d0,%a0
48084: 7216 moveq #22,%d1
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
48086: 70ff moveq #-1,%d0
48088: 4e5e unlk %fp
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
4808a: 2081 movel %d1,%a0@
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
4808c: 4e75 rts
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
4808e: 103c 000b moveb #11,%d0 <== NOT EXECUTED
48092: 72ff moveq #-1,%d1 <== NOT EXECUTED
48094: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED
48098: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED
4809c: 4eb9 0005 15f8 jsr 515f8 <__errno> <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
480a2: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
480a6: 2040 moveal %d0,%a0 <== NOT EXECUTED
480a8: 700b moveq #11,%d0 <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
480aa: 4e5e unlk %fp <== NOT EXECUTED
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
480ac: 2080 movel %d0,%a0@ <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
480ae: 70ff moveq #-1,%d0 <== NOT EXECUTED
...
000480c4 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
480c4: 4e56 0000 linkw %fp,#0
480c8: 2f0a movel %a2,%sp@-
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
480ca: 4878 0003 pea 3 <DIVIDE>
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
480ce: 246e 0008 moveal %fp@(8),%a2
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
480d2: 2f12 movel %a2@,%sp@-
480d4: 4eb9 0004 e148 jsr 4e148 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
480da: 508f addql #8,%sp
480dc: 7203 moveq #3,%d1
480de: c081 andl %d1,%d0
480e0: 123c 0001 moveb #1,%d1
480e4: 5380 subql #1,%d0
480e6: b280 cmpl %d0,%d1
480e8: 6538 bcss 48122 <aio_write+0x5e>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
480ea: 4aaa 0014 tstl %a2@(20)
480ee: 6654 bnes 48144 <aio_write+0x80>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
480f0: 4aaa 0004 tstl %a2@(4)
480f4: 6b4e bmis 48144 <aio_write+0x80>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
480f6: 4878 0018 pea 18 <OPER2+0x4>
480fa: 4eb9 0004 3a48 jsr 43a48 <malloc>
if (req == NULL)
48100: 588f addql #4,%sp
48102: 4a80 tstl %d0
48104: 6760 beqs 48166 <aio_write+0xa2> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
48106: 2040 moveal %d0,%a0
req->aiocbp->aio_lio_opcode = LIO_WRITE;
48108: 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;
4810a: 214a 0014 movel %a2,%a0@(20)
req->aiocbp->aio_lio_opcode = LIO_WRITE;
4810e: 2541 002c movel %d1,%a2@(44)
return rtems_aio_enqueue (req);
}
48112: 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);
48116: 2d40 0008 movel %d0,%fp@(8)
}
4811a: 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);
4811c: 4ef9 0004 7dbe jmp 47dbe <rtems_aio_enqueue>
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
48122: 7009 moveq #9,%d0
48124: 72ff moveq #-1,%d1
48126: 2540 0030 movel %d0,%a2@(48)
4812a: 2541 0034 movel %d1,%a2@(52)
4812e: 4eb9 0005 15f8 jsr 515f8 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
48134: 246e fffc moveal %fp@(-4),%a2
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
48138: 2040 moveal %d0,%a0
4813a: 7009 moveq #9,%d0
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
4813c: 4e5e unlk %fp
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
4813e: 2080 movel %d0,%a0@
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
48140: 70ff moveq #-1,%d0
48142: 4e75 rts
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
48144: 72ff moveq #-1,%d1
48146: 7016 moveq #22,%d0
48148: 2541 0034 movel %d1,%a2@(52)
4814c: 2540 0030 movel %d0,%a2@(48)
48150: 4eb9 0005 15f8 jsr 515f8 <__errno>
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
48156: 246e fffc moveal %fp@(-4),%a2
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
4815a: 2040 moveal %d0,%a0
4815c: 7216 moveq #22,%d1
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
4815e: 70ff moveq #-1,%d0
48160: 4e5e unlk %fp
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
48162: 2081 movel %d1,%a0@
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
48164: 4e75 rts
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
48166: 103c 000b moveb #11,%d0 <== NOT EXECUTED
4816a: 72ff moveq #-1,%d1 <== NOT EXECUTED
4816c: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED
48170: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED
48174: 4eb9 0005 15f8 jsr 515f8 <__errno> <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
4817a: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
4817e: 2040 moveal %d0,%a0 <== NOT EXECUTED
48180: 700b moveq #11,%d0 <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
48182: 4e5e unlk %fp <== NOT EXECUTED
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
48184: 2080 movel %d0,%a0@ <== NOT EXECUTED
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
48186: 70ff moveq #-1,%d0 <== NOT EXECUTED
...
000491d4 <alarm>:
}
unsigned int alarm(
unsigned int seconds
)
{
491d4: 4e56 fff4 linkw %fp,#-12
491d8: 48d7 001c moveml %d2-%d4,%sp@
491dc: 242e 0008 movel %fp@(8),%d2
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
491e0: 4ab9 0006 5c94 tstl 65c94 <_POSIX_signals_Alarm_timer+0x1c>
491e6: 674e beqs 49236 <alarm+0x62>
_Watchdog_Initialize( the_timer, _POSIX_signals_Alarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
491e8: 4879 0006 5c78 pea 65c78 <_POSIX_signals_Alarm_timer>
491ee: 4eb9 0004 e2ec jsr 4e2ec <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
491f4: 588f addql #4,%sp
491f6: 7201 moveq #1,%d1
491f8: 5580 subql #2,%d0
491fa: b280 cmpl %d0,%d1
491fc: 645e bccs 4925c <alarm+0x88>
unsigned int alarm(
unsigned int seconds
)
{
unsigned int remaining = 0;
491fe: 4283 clrl %d3
remaining = the_timer->initial -
((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND);
}
}
if ( seconds )
49200: 4a82 tstl %d2
49202: 660c bnes 49210 <alarm+0x3c> <== NEVER TAKEN
_Watchdog_Insert_seconds( the_timer, seconds );
return remaining;
}
49204: 2003 movel %d3,%d0
49206: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4
4920c: 4e5e unlk %fp
4920e: 4e75 rts
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
49210: 4879 0006 5c78 pea 65c78 <_POSIX_signals_Alarm_timer>
49216: 4879 0006 5fae pea 65fae <_Watchdog_Seconds_chain>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
4921c: 23c2 0006 5c84 movel %d2,65c84 <_POSIX_signals_Alarm_timer+0xc>
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
49222: 4eb9 0004 e1bc jsr 4e1bc <_Watchdog_Insert>
49228: 508f addql #8,%sp
4922a: 2003 movel %d3,%d0
4922c: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4
49232: 4e5e unlk %fp
49234: 4e75 rts
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
49236: 42b9 0006 5c80 clrl 65c80 <_POSIX_signals_Alarm_timer+0x8>
unsigned int alarm(
unsigned int seconds
)
{
unsigned int remaining = 0;
4923c: 4283 clrl %d3
the_watchdog->routine = routine;
4923e: 203c 0004 91b8 movel #299448,%d0
the_watchdog->id = id;
49244: 42b9 0006 5c98 clrl 65c98 <_POSIX_signals_Alarm_timer+0x20>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
4924a: 23c0 0006 5c94 movel %d0,65c94 <_POSIX_signals_Alarm_timer+0x1c>
the_watchdog->id = id;
the_watchdog->user_data = user_data;
49250: 42b9 0006 5c9c clrl 65c9c <_POSIX_signals_Alarm_timer+0x24>
remaining = the_timer->initial -
((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND);
}
}
if ( seconds )
49256: 4a82 tstl %d2
49258: 67aa beqs 49204 <alarm+0x30> <== NEVER TAKEN
4925a: 60b4 bras 49210 <alarm+0x3c>
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
remaining = the_timer->initial -
((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND);
4925c: 2839 0006 5c90 movel 65c90 <_POSIX_signals_Alarm_timer+0x18>,%d4
49262: 98b9 0006 5c8c subl 65c8c <_POSIX_signals_Alarm_timer+0x14>,%d4
* The stop_time and start_time fields are snapshots of ticks since
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
remaining = the_timer->initial -
49268: 2639 0006 5c84 movel 65c84 <_POSIX_signals_Alarm_timer+0xc>,%d3
((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND);
4926e: 4eb9 0004 bd08 jsr 4bd08 <TOD_TICKS_PER_SECOND_method>
49274: 4c40 4004 remul %d0,%d4,%d4
* The stop_time and start_time fields are snapshots of ticks since
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
remaining = the_timer->initial -
49278: 9684 subl %d4,%d3
((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND);
}
}
if ( seconds )
4927a: 4a82 tstl %d2
4927c: 6786 beqs 49204 <alarm+0x30> <== NEVER TAKEN
4927e: 6090 bras 49210 <alarm+0x3c>
00048590 <check_and_merge>:
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
48590: 72f8 moveq #-8,%d1
rtems_chain_control *free_chain,
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
48592: 4e56 fff4 linkw %fp,#-12
48596: 202e 000c movel %fp@(12),%d0
4859a: 48d7 1c00 moveml %a2-%a4,%sp@
4859e: 266e 0008 moveal %fp@(8),%a3
485a2: 226e 0010 moveal %fp@(16),%a1
485a6: 206e 0014 moveal %fp@(20),%a0
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
485aa: b288 cmpl %a0,%d1
485ac: 6754 beqs 48602 <check_and_merge+0x72>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
485ae: 2450 moveal %a0@,%a2
485b0: 4a8a tstl %a2
485b2: 6748 beqs 485fc <check_and_merge+0x6c>
if (b->begin < a->begin) {
485b4: 2229 0018 movel %a1@(24),%d1
485b8: b2a8 0018 cmpl %a0@(24),%d1
485bc: 6308 blss 485c6 <check_and_merge+0x36>
485be: 2451 moveal %a1@,%a2
485c0: 2209 movel %a1,%d1
485c2: 2248 moveal %a0,%a1
485c4: 2041 moveal %d1,%a0
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
485c6: 2868 0004 moveal %a0@(4),%a4
a = b;
b = t;
}
a->size += b->size;
485ca: 2228 001c movel %a0@(28),%d1
485ce: d3a9 001c addl %d1,%a1@(28)
next->previous = previous;
previous->next = next;
485d2: 288a movel %a2,%a4@
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
485d4: 2253 moveal %a3@,%a1
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
485d6: 254c 0004 movel %a4,%a2@(4)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
485da: 2688 movel %a0,%a3@
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
485dc: 214b 0004 movel %a3,%a0@(4)
rtems_chain_extract_unprotected(&b->chain_node);
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
485e0: 4cd7 1c00 moveml %sp@,%a2-%a4
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
485e4: 2089 movel %a1,%a0@
before_node->previous = the_node;
485e6: 2348 0004 movel %a0,%a1@(4)
}
a->size += b->size;
rtems_chain_extract_unprotected(&b->chain_node);
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
485ea: 5088 addql #8,%a0
485ec: 2d40 0008 movel %d0,%fp@(8)
485f0: 2d48 000c movel %a0,%fp@(12)
}
}
485f4: 4e5e unlk %fp
}
a->size += b->size;
rtems_chain_extract_unprotected(&b->chain_node);
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
485f6: 4ef9 0004 9fbe jmp 49fbe <_RBTree_Extract_unprotected>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
485fc: 4aa8 0004 tstl %a0@(4)
48600: 66b2 bnes 485b4 <check_and_merge+0x24> <== NEVER TAKEN
}
}
48602: 4cd7 1c00 moveml %sp@,%a2-%a4
48606: 4e5e unlk %fp <== NOT EXECUTED
000470c8 <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
470c8: 4e56 ffec linkw %fp,#-20
470cc: 202e 0008 movel %fp@(8),%d0
470d0: 48d7 040c moveml %d2-%d3/%a2,%sp@
470d4: 246e 000c moveal %fp@(12),%a2
if ( !tp )
470d8: 4a8a tstl %a2
470da: 671a beqs 470f6 <clock_gettime+0x2e>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
470dc: 7201 moveq #1,%d1
470de: b280 cmpl %d0,%d1
470e0: 675a beqs 4713c <clock_gettime+0x74>
_TOD_Get(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
470e2: 7204 moveq #4,%d1
470e4: b280 cmpl %d0,%d1
470e6: 673e beqs 47126 <clock_gettime+0x5e> <== NEVER TAKEN
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
470e8: 7202 moveq #2,%d1
470ea: b280 cmpl %d0,%d1
470ec: 6738 beqs 47126 <clock_gettime+0x5e>
return 0;
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
470ee: 123c 0003 moveb #3,%d1
470f2: b280 cmpl %d0,%d1
470f4: 6718 beqs 4710e <clock_gettime+0x46>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
470f6: 4eb9 0005 0090 jsr 50090 <__errno>
470fc: 7216 moveq #22,%d1
470fe: 2040 moveal %d0,%a0
47100: 70ff moveq #-1,%d0
return 0;
}
47102: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
47108: 2081 movel %d1,%a0@
return 0;
}
4710a: 4e5e unlk %fp
4710c: 4e75 rts
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
rtems_set_errno_and_return_minus_one( ENOSYS );
4710e: 4eb9 0005 0090 jsr 50090 <__errno>
47114: 7458 moveq #88,%d2
47116: 2040 moveal %d0,%a0
47118: 70ff moveq #-1,%d0
4711a: 2082 movel %d2,%a0@
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
4711c: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
47122: 4e5e unlk %fp
47124: 4e75 rts
_TOD_Get(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
_TOD_Get_uptime_as_timespec( tp );
47126: 2f0a movel %a2,%sp@-
47128: 4eb9 0004 9330 jsr 49330 <_TOD_Get_uptime_as_timespec>
return 0;
4712e: 588f addql #4,%sp
47130: 4280 clrl %d0
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
47132: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
47138: 4e5e unlk %fp
4713a: 4e75 rts
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
4713c: 4879 0006 2d68 pea 62d68 <_TOD>
47142: 486e fff8 pea %fp@(-8)
47146: 4eb9 0004 92e4 jsr 492e4 <_TOD_Get_with_nanoseconds>
4714c: 2040 moveal %d0,%a0
4714e: 2410 movel %a0@,%d2
47150: 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);
47154: 2f3c 3b9a ca00 movel #1000000000,%sp@-
4715a: 42a7 clrl %sp@-
4715c: 2f03 movel %d3,%sp@-
4715e: 2f02 movel %d2,%sp@-
47160: 4eb9 0005 d4ec jsr 5d4ec <__divdi3>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
47166: 4fef 000c lea %sp@(12),%sp
4716a: 2ebc 3b9a ca00 movel #1000000000,%sp@
47170: 42a7 clrl %sp@-
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
47172: 2481 movel %d1,%a2@
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
47174: 2f03 movel %d3,%sp@-
47176: 2f02 movel %d2,%sp@-
47178: 4eb9 0005 d94c jsr 5d94c <__moddi3>
4717e: 4fef 0018 lea %sp@(24),%sp
if ( !tp )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
_TOD_Get(tp);
return 0;
47182: 4280 clrl %d0
47184: 2541 0004 movel %d1,%a2@(4)
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
47188: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
4718e: 4e5e unlk %fp
...
000669a0 <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
669a0: 4e56 fff8 linkw %fp,#-8
669a4: 202e 0008 movel %fp@(8),%d0
669a8: 2f03 movel %d3,%sp@-
669aa: 206e 000c moveal %fp@(12),%a0
669ae: 2f02 movel %d2,%sp@-
if ( !tp )
669b0: 4a88 tstl %a0
669b2: 6712 beqs 669c6 <clock_settime+0x26> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
669b4: 7201 moveq #1,%d1
669b6: b280 cmpl %d0,%d1
669b8: 6740 beqs 669fa <clock_settime+0x5a>
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
669ba: 7202 moveq #2,%d1
669bc: b280 cmpl %d0,%d1
669be: 6720 beqs 669e0 <clock_settime+0x40>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
669c0: 7203 moveq #3,%d1
669c2: b280 cmpl %d0,%d1
669c4: 671a beqs 669e0 <clock_settime+0x40>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
669c6: 4eb9 0007 8640 jsr 78640 <__errno>
return 0;
}
669cc: 242e fff0 movel %fp@(-16),%d2
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
669d0: 2040 moveal %d0,%a0
669d2: 7216 moveq #22,%d1
669d4: 70ff moveq #-1,%d0
return 0;
}
669d6: 262e fff4 movel %fp@(-12),%d3
669da: 4e5e unlk %fp
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
669dc: 2081 movel %d1,%a0@
return 0;
}
669de: 4e75 rts
else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
rtems_set_errno_and_return_minus_one( ENOSYS );
669e0: 4eb9 0007 8640 jsr 78640 <__errno>
669e6: 7458 moveq #88,%d2
669e8: 2040 moveal %d0,%a0
669ea: 70ff moveq #-1,%d0
669ec: 2082 movel %d2,%a0@
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
669ee: 242e fff0 movel %fp@(-16),%d2
669f2: 262e fff4 movel %fp@(-12),%d3
669f6: 4e5e unlk %fp
669f8: 4e75 rts
{
if ( !tp )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
669fa: 203c 21da e4ff movel #567993599,%d0
66a00: b090 cmpl %a0@,%d0
66a02: 64c2 bccs 669c6 <clock_settime+0x26>
*
* 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;
66a04: 2039 000a 14da movel a14da <_Thread_Dispatch_disable_level>,%d0
++level;
66a0a: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
66a0c: 23c0 000a 14da movel %d0,a14da <_Thread_Dispatch_disable_level>
Timestamp64_Control *_time,
Timestamp64_Control _seconds,
Timestamp64_Control _nanoseconds
)
{
*_time = _seconds * 1000000000L + _nanoseconds;
66a12: 2f3c 3b9a ca00 movel #1000000000,%sp@-
66a18: 42a7 clrl %sp@-
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
66a1a: 2628 0004 movel %a0@(4),%d3
66a1e: 5bc2 smi %d2
66a20: 49c2 extbl %d2
66a22: 2f10 movel %a0@,%sp@-
66a24: 5bc1 smi %d1
66a26: 49c1 extbl %d1
66a28: 2f01 movel %d1,%sp@-
66a2a: 4eb9 0009 03d4 jsr 903d4 <__muldi3>
66a30: 4fef 0010 lea %sp@(16),%sp
66a34: 204e moveal %fp,%a0
66a36: d283 addl %d3,%d1
66a38: d182 addxl %d2,%d0
66a3a: 2101 movel %d1,%a0@-
66a3c: 2100 movel %d0,%a0@-
&tod_as_timestamp,
tod_as_timespec->tv_sec,
tod_as_timespec->tv_nsec
);
_TOD_Set_with_timestamp( &tod_as_timestamp );
66a3e: 2f08 movel %a0,%sp@-
66a40: 4eb9 0006 7a74 jsr 67a74 <_TOD_Set_with_timestamp>
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
66a46: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
66a4c: 242e fff0 movel %fp@(-16),%d2
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
66a50: 588f addql #4,%sp
66a52: 4280 clrl %d0
}
66a54: 262e fff4 movel %fp@(-12),%d3
66a58: 4e5e unlk %fp <== NOT EXECUTED
0005d020 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
5d020: 4e56 ffd0 linkw %fp,#-48
5d024: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@
5d028: 262e 000c movel %fp@(12),%d3
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
5d02c: 4eb9 0005 cc40 jsr 5cc40 <getpid>
5d032: b0ae 0008 cmpl %fp@(8),%d0
5d036: 6600 0202 bnew 5d23a <killinfo+0x21a>
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed.
*/
if ( !sig )
5d03a: 4a83 tstl %d3
5d03c: 6700 0214 beqw 5d252 <killinfo+0x232>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5d040: 2003 movel %d3,%d0
5d042: 5380 subql #1,%d0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5d044: 721f moveq #31,%d1
5d046: b280 cmpl %d0,%d1
5d048: 6500 0208 bcsw 5d252 <killinfo+0x232>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
5d04c: 2203 movel %d3,%d1
5d04e: 2803 movel %d3,%d4
5d050: 7e01 moveq #1,%d7
5d052: e589 lsll #2,%d1
5d054: e98c lsll #4,%d4
5d056: 9881 subl %d1,%d4
5d058: 2044 moveal %d4,%a0
5d05a: d1fc 0006 1470 addal #398448,%a0
5d060: be90 cmpl %a0@,%d7
5d062: 6700 01c2 beqw 5d226 <killinfo+0x206>
/*
* 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 ) )
5d066: 7208 moveq #8,%d1
5d068: b283 cmpl %d3,%d1
5d06a: 6700 015c beqw 5d1c8 <killinfo+0x1a8>
5d06e: 1e3c 0004 moveb #4,%d7
5d072: be83 cmpl %d3,%d7
5d074: 6700 0152 beqw 5d1c8 <killinfo+0x1a8>
5d078: 123c 000b moveb #11,%d1
5d07c: b283 cmpl %d3,%d1
5d07e: 6700 0148 beqw 5d1c8 <killinfo+0x1a8>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
5d082: 7401 moveq #1,%d2
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
5d084: 7e01 moveq #1,%d7
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
5d086: 2d43 fff4 movel %d3,%fp@(-12)
5d08a: e1aa lsll %d0,%d2
siginfo->si_code = SI_USER;
5d08c: 2d47 fff8 movel %d7,%fp@(-8)
if ( !value ) {
5d090: 4aae 0010 tstl %fp@(16)
5d094: 6700 019c beqw 5d232 <killinfo+0x212>
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
5d098: 206e 0010 moveal %fp@(16),%a0
5d09c: 2d50 fffc movel %a0@,%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;
5d0a0: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
5d0a6: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
5d0a8: 23c0 0006 0fe6 movel %d0,60fe6 <_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 );
5d0ae: 4879 0005 f8b4 pea 5f8b4 <_POSIX_signals_Post_switch>
5d0b4: 4eb9 0004 7e3a jsr 47e3a <_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;
5d0ba: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
5d0c0: 588f addql #4,%sp
5d0c2: 2268 00fe moveal %a0@(254),%a1
5d0c6: 2029 00d0 movel %a1@(208),%d0
5d0ca: 4680 notl %d0
5d0cc: c082 andl %d2,%d0
5d0ce: 6600 00b8 bnew 5d188 <killinfo+0x168>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
5d0d2: 2079 0006 15f4 moveal 615f4 <_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 );
5d0d8: b1fc 0006 15f8 cmpal #398840,%a0
5d0de: 6724 beqs 5d104 <killinfo+0xe4>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
5d0e0: 2002 movel %d2,%d0
5d0e2: 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 ];
5d0e6: 2268 00fe moveal %a0@(254),%a1
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
5d0ea: 6600 009c bnew 5d188 <killinfo+0x168>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
5d0ee: 2029 00d0 movel %a1@(208),%d0
5d0f2: 4680 notl %d0
5d0f4: c082 andl %d2,%d0
5d0f6: 6600 0090 bnew 5d188 <killinfo+0x168>
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 ) {
5d0fa: 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 );
5d0fc: b1fc 0006 15f8 cmpal #398840,%a0
5d102: 66dc bnes 5d0e0 <killinfo+0xc0> <== NEVER TAKEN
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
5d104: 4285 clrl %d5
5d106: 1a39 0005 f6ec moveb 5f6ec <rtems_maximum_priority>,%d5
5d10c: 47f9 0006 0faa lea 60faa <_Objects_Information_table+0x8>,%a3
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
5d112: 91c8 subal %a0,%a0
interested_priority = PRIORITY_MAXIMUM + 1;
5d114: 5285 addql #1,%d5
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 ] )
5d116: 225b moveal %a3@+,%a1
5d118: 4a89 tstl %a1
5d11a: 6760 beqs 5d17c <killinfo+0x15c> <== NEVER TAKEN
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
5d11c: 2269 0004 moveal %a1@(4),%a1
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
5d120: 4286 clrl %d6
5d122: 3c29 000e movew %a1@(14),%d6
object_table = the_info->local_table;
5d126: 2469 0018 moveal %a1@(24),%a2
for ( index = 1 ; index <= maximum ; index++ ) {
5d12a: 4a86 tstl %d6
5d12c: 674e beqs 5d17c <killinfo+0x15c>
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
5d12e: 588a addql #4,%a2
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
5d130: 7001 moveq #1,%d0
the_thread = (Thread_Control *) object_table[ index ];
5d132: 225a moveal %a2@+,%a1
if ( !the_thread )
5d134: 4a89 tstl %a1
5d136: 673e beqs 5d176 <killinfo+0x156>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
5d138: 2229 0014 movel %a1@(20),%d1
5d13c: ba81 cmpl %d1,%d5
5d13e: 6536 bcss 5d176 <killinfo+0x156>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
5d140: 2869 00fe moveal %a1@(254),%a4
5d144: 2e2c 00d0 movel %a4@(208),%d7
5d148: 4687 notl %d7
5d14a: ce82 andl %d2,%d7
5d14c: 6728 beqs 5d176 <killinfo+0x156>
*
* 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 ) {
5d14e: ba81 cmpl %d1,%d5
5d150: 6220 bhis 5d172 <killinfo+0x152>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
5d152: 4a88 tstl %a0
5d154: 6720 beqs 5d176 <killinfo+0x156> <== NEVER TAKEN
5d156: 2e28 0010 movel %a0@(16),%d7
5d15a: 671a beqs 5d176 <killinfo+0x156> <== NEVER TAKEN
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
5d15c: 2869 0010 moveal %a1@(16),%a4
5d160: 4a8c tstl %a4
5d162: 670e beqs 5d172 <killinfo+0x152>
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
5d164: 0807 001c btst #28,%d7
5d168: 660c bnes 5d176 <killinfo+0x156>
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
5d16a: 2e0c movel %a4,%d7
5d16c: 0807 001c btst #28,%d7
5d170: 6704 beqs 5d176 <killinfo+0x156>
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
5d172: 2a01 movel %d1,%d5
5d174: 2049 moveal %a1,%a0
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
5d176: 5280 addql #1,%d0
5d178: b086 cmpl %d6,%d0
5d17a: 63b6 blss 5d132 <killinfo+0x112>
* + 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++) {
5d17c: b7fc 0006 0fb2 cmpal #397234,%a3
5d182: 6692 bnes 5d116 <killinfo+0xf6>
}
}
}
}
if ( interested ) {
5d184: 4a88 tstl %a0
5d186: 6716 beqs 5d19e <killinfo+0x17e>
/*
* 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 ) ) {
5d188: 486e fff4 pea %fp@(-12)
5d18c: 2f03 movel %d3,%sp@-
5d18e: 2f08 movel %a0,%sp@-
5d190: 4eb9 0005 d2a8 jsr 5d2a8 <_POSIX_signals_Unblock_thread>
5d196: 4fef 000c lea %sp@(12),%sp
5d19a: 4a00 tstb %d0
5d19c: 6618 bnes 5d1b6 <killinfo+0x196>
/*
* 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 );
5d19e: 2f02 movel %d2,%sp@-
5d1a0: 4eb9 0005 d288 jsr 5d288 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
5d1a6: 588f addql #4,%sp
5d1a8: 41f9 0006 1468 lea 61468 <_POSIX_signals_Vectors>,%a0
5d1ae: 7002 moveq #2,%d0
5d1b0: b0b0 4800 cmpl %a0@(00000000,%d4:l),%d0
5d1b4: 672e beqs 5d1e4 <killinfo+0x1c4>
/*
* 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 ) ) {
_Thread_Enable_dispatch();
5d1b6: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return 0;
5d1bc: 4280 clrl %d0
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d1be: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4
5d1c4: 4e5e unlk %fp
5d1c6: 4e75 rts
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
return pthread_kill( pthread_self(), sig );
5d1c8: 4eb9 0005 d4b0 jsr 5d4b0 <pthread_self>
5d1ce: 2f03 movel %d3,%sp@-
5d1d0: 2f00 movel %d0,%sp@-
5d1d2: 4eb9 0005 d3d4 jsr 5d3d4 <pthread_kill>
5d1d8: 508f addql #8,%sp
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d1da: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4
5d1e0: 4e5e unlk %fp
5d1e2: 4e75 rts
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
5d1e4: 4879 0006 15e8 pea 615e8 <_POSIX_signals_Inactive_siginfo>
5d1ea: 4eb9 0004 7fcc jsr 47fcc <_Chain_Get>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
5d1f0: 588f addql #4,%sp
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
5d1f2: 2040 moveal %d0,%a0
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
5d1f4: 4a80 tstl %d0
5d1f6: 6772 beqs 5d26a <killinfo+0x24a>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
5d1f8: 216e fff4 0008 movel %fp@(-12),%a0@(8)
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
5d1fe: 0684 0006 1660 addil #398944,%d4
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
5d204: 216e fff8 000c movel %fp@(-8),%a0@(12)
5d20a: 216e fffc 0010 movel %fp@(-4),%a0@(16)
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
5d210: 2f00 movel %d0,%sp@-
5d212: 2f04 movel %d4,%sp@-
5d214: 4eb9 0004 7f94 jsr 47f94 <_Chain_Append>
5d21a: 508f addql #8,%sp
/*
* 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 ) ) {
_Thread_Enable_dispatch();
5d21c: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return 0;
5d222: 4280 clrl %d0
5d224: 6098 bras 5d1be <killinfo+0x19e>
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
return 0;
5d226: 4280 clrl %d0
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d228: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4
5d22e: 4e5e unlk %fp
5d230: 4e75 rts
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
if ( !value ) {
siginfo->si_value.sival_int = 0;
5d232: 42ae fffc clrl %fp@(-4)
5d236: 6000 fe68 braw 5d0a0 <killinfo+0x80>
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
5d23a: 4eb9 0004 f024 jsr 4f024 <__errno>
5d240: 7603 moveq #3,%d3
5d242: 2040 moveal %d0,%a0
5d244: 70ff moveq #-1,%d0
5d246: 2083 movel %d3,%a0@
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d248: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4
5d24e: 4e5e unlk %fp
5d250: 4e75 rts
*/
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
5d252: 4eb9 0004 f024 jsr 4f024 <__errno>
5d258: 7416 moveq #22,%d2
5d25a: 2040 moveal %d0,%a0
5d25c: 70ff moveq #-1,%d0
5d25e: 2082 movel %d2,%a0@
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d260: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4
5d266: 4e5e unlk %fp
5d268: 4e75 rts
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_Thread_Enable_dispatch();
5d26a: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
5d270: 4eb9 0004 f024 jsr 4f024 <__errno>
5d276: 720b moveq #11,%d1
5d278: 2040 moveal %d0,%a0
5d27a: 70ff moveq #-1,%d0
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d27c: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
5d282: 2081 movel %d1,%a0@
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
5d284: 4e5e unlk %fp <== NOT EXECUTED
0004ba38 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
4ba38: 4e56 0000 linkw %fp,#0
4ba3c: 206e 0008 moveal %fp@(8),%a0
if ( !attr || !attr->is_initialized )
4ba40: 4a88 tstl %a0
4ba42: 6704 beqs 4ba48 <pthread_attr_setschedpolicy+0x10>
4ba44: 4a90 tstl %a0@
4ba46: 6606 bnes 4ba4e <pthread_attr_setschedpolicy+0x16>
return EINVAL;
4ba48: 7016 moveq #22,%d0
return 0;
default:
return ENOTSUP;
}
}
4ba4a: 4e5e unlk %fp
4ba4c: 4e75 rts
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
4ba4e: 7004 moveq #4,%d0
4ba50: b0ae 000c cmpl %fp@(12),%d0
4ba54: 651e bcss 4ba74 <pthread_attr_setschedpolicy+0x3c>
4ba56: 222e 000c movel %fp@(12),%d1
4ba5a: 103c 0001 moveb #1,%d0
4ba5e: e3a8 lsll %d1,%d0
4ba60: 7217 moveq #23,%d1
4ba62: c081 andl %d1,%d0
4ba64: 670e beqs 4ba74 <pthread_attr_setschedpolicy+0x3c><== NEVER TAKEN
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
4ba66: 202e 000c movel %fp@(12),%d0
return 0;
default:
return ENOTSUP;
}
}
4ba6a: 4e5e unlk %fp
switch ( policy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
4ba6c: 2140 0014 movel %d0,%a0@(20)
return 0;
4ba70: 4280 clrl %d0
default:
return ENOTSUP;
}
}
4ba72: 4e75 rts
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
4ba74: 203c 0000 0086 movel #134,%d0
}
}
4ba7a: 4e5e unlk %fp
...
0004badc <pthread_attr_setstack>:
int pthread_attr_setstack(
pthread_attr_t *attr,
void *stackaddr,
size_t stacksize
)
{
4badc: 4e56 0000 linkw %fp,#0
4bae0: 206e 0008 moveal %fp@(8),%a0
if ( !attr || !attr->is_initialized )
4bae4: 4a88 tstl %a0
4bae6: 6704 beqs 4baec <pthread_attr_setstack+0x10>
4bae8: 4a90 tstl %a0@
4baea: 6606 bnes 4baf2 <pthread_attr_setstack+0x16>
return EINVAL;
4baec: 7016 moveq #22,%d0
else
attr->stacksize = stacksize;
attr->stackaddr = stackaddr;
return 0;
}
4baee: 4e5e unlk %fp
4baf0: 4e75 rts
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
4baf2: 2039 0006 764e movel 6764e <rtems_minimum_stack_size>,%d0
4baf8: d080 addl %d0,%d0
4bafa: b0ae 0010 cmpl %fp@(16),%d0
4bafe: 6310 blss 4bb10 <pthread_attr_setstack+0x34>
attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
else
attr->stacksize = stacksize;
4bb00: 2140 0008 movel %d0,%a0@(8)
attr->stackaddr = stackaddr;
return 0;
4bb04: 4280 clrl %d0
if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
else
attr->stacksize = stacksize;
attr->stackaddr = stackaddr;
4bb06: 216e 000c 0004 movel %fp@(12),%a0@(4)
return 0;
}
4bb0c: 4e5e unlk %fp
4bb0e: 4e75 rts
return EINVAL;
if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
else
attr->stacksize = stacksize;
4bb10: 202e 0010 movel %fp@(16),%d0
attr->stackaddr = stackaddr;
4bb14: 216e 000c 0004 movel %fp@(12),%a0@(4)
return EINVAL;
if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
else
attr->stacksize = stacksize;
4bb1a: 2140 0008 movel %d0,%a0@(8)
attr->stackaddr = stackaddr;
return 0;
4bb1e: 4280 clrl %d0
4bb20: 60ea bras 4bb0c <pthread_attr_setstack+0x30>
...
000475d8 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
475d8: 4e56 fff0 linkw %fp,#-16
475dc: 2f0a movel %a2,%sp@-
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
475de: 4aae 0008 tstl %fp@(8)
475e2: 6706 beqs 475ea <pthread_barrier_init+0x12>
return EINVAL;
if ( count == 0 )
475e4: 4aae 0010 tstl %fp@(16)
475e8: 660a bnes 475f4 <pthread_barrier_init+0x1c>
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
return 0;
}
475ea: 246e ffec moveal %fp@(-20),%a2
switch ( the_attr->process_shared ) {
case PTHREAD_PROCESS_PRIVATE: /* only supported values */
break;
case PTHREAD_PROCESS_SHARED:
default:
return EINVAL;
475ee: 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;
}
475f0: 4e5e unlk %fp
475f2: 4e75 rts
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
475f4: 206e 000c moveal %fp@(12),%a0
475f8: 4a88 tstl %a0
475fa: 6778 beqs 47674 <pthread_barrier_init+0x9c>
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
475fc: 4a90 tstl %a0@
475fe: 67ea beqs 475ea <pthread_barrier_init+0x12>
return EINVAL;
switch ( the_attr->process_shared ) {
47600: 4aa8 0004 tstl %a0@(4)
47604: 66e4 bnes 475ea <pthread_barrier_init+0x12> <== 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;
47606: 2039 0006 24da movel 624da <_Thread_Dispatch_disable_level>,%d0
++level;
4760c: 5280 addql #1,%d0
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
the_attributes.maximum_count = count;
4760e: 222e 0010 movel %fp@(16),%d1
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
47612: 42ae fff0 clrl %fp@(-16)
the_attributes.maximum_count = count;
47616: 2d41 fff4 movel %d1,%fp@(-12)
_Thread_Dispatch_disable_level = level;
4761a: 23c0 0006 24da movel %d0,624da <_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 *)
47620: 4879 0006 27a4 pea 627a4 <_POSIX_Barrier_Information>
47626: 4eb9 0004 9a64 jsr 49a64 <_Objects_Allocate>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
4762c: 588f addql #4,%sp
4762e: 2440 moveal %d0,%a2
47630: 4a80 tstl %d0
47632: 675a beqs 4768e <pthread_barrier_init+0xb6>
_Thread_Enable_dispatch();
return EAGAIN;
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
47634: 486e fff0 pea %fp@(-16)
47638: 486a 0010 pea %a2@(16)
4763c: 4eb9 0004 8fc8 jsr 48fc8 <_CORE_barrier_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
47642: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47646: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47648: 2079 0006 27bc moveal 627bc <_POSIX_Barrier_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
4764e: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47654: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
47658: 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;
4765c: 42aa 000c clrl %a2@(12)
47660: 2080 movel %d0,%a0@
_Thread_Enable_dispatch();
47662: 4eb9 0004 ac78 jsr 4ac78 <_Thread_Enable_dispatch>
return 0;
}
47668: 246e ffec moveal %fp@(-20),%a2
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
4766c: 508f addql #8,%sp
return 0;
4766e: 4280 clrl %d0
}
47670: 4e5e unlk %fp
47672: 4e75 rts
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
47674: 45ee fff8 lea %fp@(-8),%a2
47678: 2f0a movel %a2,%sp@-
4767a: 4eb9 0004 7514 jsr 47514 <pthread_barrierattr_init>
47680: 588f addql #4,%sp
the_attr = &my_attr;
47682: 204a moveal %a2,%a0
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
47684: 4a90 tstl %a0@
47686: 6700 ff62 beqw 475ea <pthread_barrier_init+0x12>
4768a: 6000 ff74 braw 47600 <pthread_barrier_init+0x28>
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
_Thread_Enable_dispatch();
4768e: 4eb9 0004 ac78 jsr 4ac78 <_Thread_Enable_dispatch>
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47694: 246e ffec moveal %fp@(-20),%a2
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
_Thread_Enable_dispatch();
return EAGAIN;
47698: 700b moveq #11,%d0
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
_Thread_Enable_dispatch();
return 0;
}
4769a: 4e5e unlk %fp
...
00047054 <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
47054: 4e56 0000 linkw %fp,#0
47058: 2f03 movel %d3,%sp@-
4705a: 262e 000c movel %fp@(12),%d3
4705e: 2f02 movel %d2,%sp@-
47060: 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 )
47064: 6754 beqs 470ba <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;
47066: 2039 0006 1ee0 movel 61ee0 <_Thread_Dispatch_disable_level>,%d0
++level;
4706c: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
4706e: 23c0 0006 1ee0 movel %d0,61ee0 <_Thread_Dispatch_disable_level>
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
47074: 4878 0010 pea 10 <INVALID_OPERATION>
47078: 4eb9 0004 b820 jsr 4b820 <_Workspace_Allocate>
if ( handler ) {
4707e: 588f addql #4,%sp
47080: 4a80 tstl %d0
47082: 6726 beqs 470aa <pthread_cleanup_push+0x56> <== NEVER TAKEN
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
47084: 2079 0006 2326 moveal 62326 <_Per_CPU_Information+0xe>,%a0
handler_stack = &thread_support->Cancellation_Handlers;
4708a: 2228 00fe movel %a0@(254),%d1
handler->routine = routine;
4708e: 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;
47090: 0681 0000 00e4 addil #228,%d1
handler->routine = routine;
47096: 2142 0008 movel %d2,%a0@(8)
handler->arg = arg;
4709a: 2143 000c movel %d3,%a0@(12)
_Chain_Append( handler_stack, &handler->Node );
4709e: 2f00 movel %d0,%sp@-
470a0: 2f01 movel %d1,%sp@-
470a2: 4eb9 0004 8ae0 jsr 48ae0 <_Chain_Append>
470a8: 508f addql #8,%sp
}
_Thread_Enable_dispatch();
}
470aa: 242e fff8 movel %fp@(-8),%d2
470ae: 262e fffc movel %fp@(-4),%d3
470b2: 4e5e unlk %fp
handler->routine = routine;
handler->arg = arg;
_Chain_Append( handler_stack, &handler->Node );
}
_Thread_Enable_dispatch();
470b4: 4ef9 0004 a79c jmp 4a79c <_Thread_Enable_dispatch>
}
470ba: 242e fff8 movel %fp@(-8),%d2
470be: 262e fffc movel %fp@(-4),%d3
470c2: 4e5e unlk %fp
...
00047f34 <pthread_cond_init>:
*/
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
47f34: 4e56 0000 linkw %fp,#0
47f38: 202e 000c movel %fp@(12),%d0
47f3c: 2f0b movel %a3,%sp@-
47f3e: 2f0a movel %a2,%sp@-
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
else the_attr = &_POSIX_Condition_variables_Default_attributes;
47f40: 45f9 0006 0fe6 lea 60fe6 <_POSIX_Condition_variables_Default_attributes>,%a2
)
{
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
47f46: 4a80 tstl %d0
47f48: 6702 beqs 47f4c <pthread_cond_init+0x18>
47f4a: 2440 moveal %d0,%a2
else the_attr = &_POSIX_Condition_variables_Default_attributes;
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
47f4c: 7001 moveq #1,%d0
47f4e: b0aa 0004 cmpl %a2@(4),%d0
47f52: 6704 beqs 47f58 <pthread_cond_init+0x24> <== NEVER TAKEN
return EINVAL;
if ( !the_attr->is_initialized )
47f54: 4a92 tstl %a2@
47f56: 660e bnes 47f66 <pthread_cond_init+0x32>
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47f58: 246e fff8 moveal %fp@(-8),%a2
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
return EINVAL;
47f5c: 7016 moveq #22,%d0
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47f5e: 266e fffc moveal %fp@(-4),%a3
47f62: 4e5e unlk %fp
47f64: 4e75 rts
*
* 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;
47f66: 2039 0006 37b6 movel 637b6 <_Thread_Dispatch_disable_level>,%d0
++level;
47f6c: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
47f6e: 23c0 0006 37b6 movel %d0,637b6 <_Thread_Dispatch_disable_level>
*/
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
47f74: 4879 0006 3b0c pea 63b0c <_POSIX_Condition_variables_Information>
47f7a: 4eb9 0004 aabc jsr 4aabc <_Objects_Allocate>
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
47f80: 588f addql #4,%sp
47f82: 2640 moveal %d0,%a3
47f84: 4a80 tstl %d0
47f86: 6758 beqs 47fe0 <pthread_cond_init+0xac>
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
47f88: 276a 0004 0010 movel %a2@(4),%a3@(16)
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
47f8e: 42ab 0014 clrl %a3@(20)
_Thread_queue_Initialize(
47f92: 4878 0074 pea 74 <DBL_MANT_DIG+0x3f>
47f96: 2f3c 1000 0800 movel #268437504,%sp@-
47f9c: 42a7 clrl %sp@-
47f9e: 486b 0018 pea %a3@(24)
47fa2: 4eb9 0004 c50c jsr 4c50c <_Thread_queue_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
47fa8: 202b 0008 movel %a3@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47fac: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47fae: 2079 0006 3b24 moveal 63b24 <_POSIX_Condition_variables_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47fb4: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47fba: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4)
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
47fbe: 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;
47fc2: 42ab 000c clrl %a3@(12)
47fc6: 2080 movel %d0,%a0@
_Thread_Enable_dispatch();
47fc8: 4eb9 0004 bcd0 jsr 4bcd0 <_Thread_Enable_dispatch>
return 0;
}
47fce: 246e fff8 moveal %fp@(-8),%a2
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
return 0;
47fd2: 4fef 0010 lea %sp@(16),%sp
47fd6: 4280 clrl %d0
}
47fd8: 266e fffc moveal %fp@(-4),%a3
47fdc: 4e5e unlk %fp
47fde: 4e75 rts
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
_Thread_Enable_dispatch();
47fe0: 4eb9 0004 bcd0 jsr 4bcd0 <_Thread_Enable_dispatch>
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47fe6: 246e fff8 moveal %fp@(-8),%a2
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
47fea: 700c moveq #12,%d0
*cond = the_cond->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47fec: 266e fffc moveal %fp@(-4),%a3
47ff0: 4e5e unlk %fp <== NOT EXECUTED
00047d98 <pthread_condattr_destroy>:
*/
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
47d98: 4e56 0000 linkw %fp,#0
47d9c: 206e 0008 moveal %fp@(8),%a0
if ( !attr || attr->is_initialized == false )
47da0: 4a88 tstl %a0
47da2: 6704 beqs 47da8 <pthread_condattr_destroy+0x10>
47da4: 4a90 tstl %a0@
47da6: 6606 bnes 47dae <pthread_condattr_destroy+0x16> <== ALWAYS TAKEN
return EINVAL;
47da8: 7016 moveq #22,%d0
attr->is_initialized = false;
return 0;
}
47daa: 4e5e unlk %fp
47dac: 4e75 rts
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
attr->is_initialized = false;
return 0;
47dae: 4280 clrl %d0
}
47db0: 4e5e unlk %fp
)
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
attr->is_initialized = false;
47db2: 4290 clrl %a0@
return 0;
}
...
000474a8 <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
474a8: 4e56 ffc0 linkw %fp,#-64
474ac: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@
474b0: 246e 000c moveal %fp@(12),%a2
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
474b4: 4aae 0010 tstl %fp@(16)
474b8: 6700 014c beqw 47606 <pthread_create+0x15e>
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
474bc: 4a8a tstl %a2
474be: 6700 0154 beqw 47614 <pthread_create+0x16c>
if ( !the_attr->is_initialized )
474c2: 4a92 tstl %a2@
474c4: 660e bnes 474d4 <pthread_create+0x2c>
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
break;
default:
return EINVAL;
474c6: 7416 moveq #22,%d2
*/
*thread = the_thread->Object.id;
_RTEMS_Unlock_allocator();
return 0;
}
474c8: 2002 movel %d2,%d0
474ca: 4cee 3c1c ffc0 moveml %fp@(-64),%d2-%d4/%a2-%a5
474d0: 4e5e unlk %fp
474d2: 4e75 rts
* stack space if it is allowed to allocate it itself.
*
* NOTE: If the user provides the stack we will let it drop below
* twice the minimum.
*/
if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) )
474d4: 4aaa 0004 tstl %a2@(4)
474d8: 670c beqs 474e6 <pthread_create+0x3e>
474da: 2039 0006 092e movel 6092e <rtems_minimum_stack_size>,%d0
474e0: b0aa 0008 cmpl %a2@(8),%d0
474e4: 62e0 bhis 474c6 <pthread_create+0x1e>
* If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
* inherits scheduling attributes from the creating thread. If it is
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
474e6: 202a 0010 movel %a2@(16),%d0
474ea: 7201 moveq #1,%d1
474ec: b280 cmpl %d0,%d1
474ee: 6700 0134 beqw 47624 <pthread_create+0x17c>
474f2: 123c 0002 moveb #2,%d1
474f6: b280 cmpl %d0,%d1
474f8: 66cc bnes 474c6 <pthread_create+0x1e>
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
474fa: 47ee ffe4 lea %fp@(-28),%a3
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
474fe: 262a 0014 movel %a2@(20),%d3
schedparam = the_attr->schedparam;
47502: 26aa 0018 movel %a2@(24),%a3@
47506: 2d6a 001c ffe8 movel %a2@(28),%fp@(-24)
4750c: 2d6a 0020 ffec movel %a2@(32),%fp@(-20)
47512: 2d6a 0024 fff0 movel %a2@(36),%fp@(-16)
47518: 2d6a 0028 fff4 movel %a2@(40),%fp@(-12)
4751e: 2d6a 002c fff8 movel %a2@(44),%fp@(-8)
47524: 2d6a 0030 fffc movel %a2@(48),%fp@(-4)
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
return ENOTSUP;
4752a: 243c 0000 0086 movel #134,%d2
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
47530: 4aaa 000c tstl %a2@(12)
47534: 6692 bnes 474c8 <pthread_create+0x20>
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
47536: 2f2e ffe4 movel %fp@(-28),%sp@-
4753a: 4eb9 0004 d998 jsr 4d998 <_POSIX_Priority_Is_valid>
47540: 588f addql #4,%sp
47542: 4a00 tstb %d0
47544: 6780 beqs 474c6 <pthread_create+0x1e> <== NEVER TAKEN
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
47546: 486e ffe0 pea %fp@(-32)
4754a: 486e ffdc pea %fp@(-36)
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
return EINVAL;
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
4754e: 286e ffe4 moveal %fp@(-28),%a4
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
47552: 2f0b movel %a3,%sp@-
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
47554: 1839 0006 092c moveb 6092c <rtems_maximum_priority>,%d4
4755a: 2f03 movel %d3,%sp@-
4755c: 4eb9 0004 d9bc jsr 4d9bc <_POSIX_Thread_Translate_sched_param>
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
47562: 4fef 0010 lea %sp@(16),%sp
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
47566: 2400 movel %d0,%d2
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
47568: 6600 ff5e bnew 474c8 <pthread_create+0x20>
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
4756c: 2f39 0006 229a movel 6229a <_RTEMS_Allocator_Mutex>,%sp@-
47572: 4eb9 0004 9094 jsr 49094 <_API_Mutex_Lock>
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
47578: 4879 0006 2384 pea 62384 <_POSIX_Threads_Information>
4757e: 4eb9 0004 9bd0 jsr 49bd0 <_Objects_Allocate>
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
47584: 508f addql #8,%sp
47586: 2a40 moveal %d0,%a5
47588: 4a80 tstl %d0
4758a: 6700 013c beqw 476c8 <pthread_create+0x220>
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
4758e: 222a 0008 movel %a2@(8),%d1
47592: 42a7 clrl %sp@-
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
47594: 2039 0006 092e movel 6092e <rtems_minimum_stack_size>,%d0
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
4759a: 42a7 clrl %sp@-
4759c: 2f2e ffe0 movel %fp@(-32),%sp@-
475a0: 2f2e ffdc movel %fp@(-36),%sp@-
475a4: 4878 0001 pea 1 <ADD>
475a8: 0284 0000 00ff andil #255,%d4
475ae: d080 addl %d0,%d0
475b0: 988c subl %a4,%d4
475b2: 2f04 movel %d4,%sp@-
475b4: 4878 0001 pea 1 <ADD>
475b8: b280 cmpl %d0,%d1
475ba: 6302 blss 475be <pthread_create+0x116>
475bc: 2001 movel %d1,%d0
475be: 2f00 movel %d0,%sp@-
475c0: 2f2a 0004 movel %a2@(4),%sp@-
475c4: 2f0d movel %a5,%sp@-
475c6: 4879 0006 2384 pea 62384 <_POSIX_Threads_Information>
475cc: 4eb9 0004 aea0 jsr 4aea0 <_Thread_Initialize>
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
475d2: 4fef 002c lea %sp@(44),%sp
475d6: 4a00 tstb %d0
475d8: 667e bnes 47658 <pthread_create+0x1b0>
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
475da: 2f0d movel %a5,%sp@-
475dc: 4879 0006 2384 pea 62384 <_POSIX_Threads_Information>
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
return EAGAIN;
475e2: 740b moveq #11,%d2
475e4: 4eb9 0004 9f48 jsr 49f48 <_Objects_Free>
name /* posix threads don't have a name */
);
if ( !status ) {
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
475ea: 2f39 0006 229a movel 6229a <_RTEMS_Allocator_Mutex>,%sp@-
475f0: 4eb9 0004 90f4 jsr 490f4 <_API_Mutex_Unlock>
475f6: 4fef 000c lea %sp@(12),%sp
*/
*thread = the_thread->Object.id;
_RTEMS_Unlock_allocator();
return 0;
}
475fa: 2002 movel %d2,%d0
475fc: 4cee 3c1c ffc0 moveml %fp@(-64),%d2-%d4/%a2-%a5
47602: 4e5e unlk %fp
47604: 4e75 rts
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
return EFAULT;
47606: 740e moveq #14,%d2
*/
*thread = the_thread->Object.id;
_RTEMS_Unlock_allocator();
return 0;
}
47608: 2002 movel %d2,%d0
4760a: 4cee 3c1c ffc0 moveml %fp@(-64),%d2-%d4/%a2-%a5
47610: 4e5e unlk %fp
47612: 4e75 rts
int rc;
if ( !start_routine )
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
47614: 45f9 0005 fa76 lea 5fa76 <_POSIX_Threads_Default_attributes>,%a2
if ( !the_attr->is_initialized )
4761a: 4a92 tstl %a2@
4761c: 6700 fea8 beqw 474c6 <pthread_create+0x1e>
47620: 6000 feb2 braw 474d4 <pthread_create+0x2c>
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
47624: 2079 0006 265e moveal 6265e <_Per_CPU_Information+0xe>,%a0
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
4762a: 47ee ffe4 lea %fp@(-28),%a3
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
4762e: 2268 00fe moveal %a0@(254),%a1
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
47632: 41e9 0088 lea %a1@(136),%a0
47636: 2698 movel %a0@+,%a3@
47638: 2d58 ffe8 movel %a0@+,%fp@(-24)
4763c: 2d58 ffec movel %a0@+,%fp@(-20)
47640: 2d58 fff0 movel %a0@+,%fp@(-16)
47644: 2d58 fff4 movel %a0@+,%fp@(-12)
47648: 2d58 fff8 movel %a0@+,%fp@(-8)
4764c: 2d50 fffc movel %a0@,%fp@(-4)
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
schedpolicy = api->schedpolicy;
47650: 2629 0084 movel %a1@(132),%d3
schedparam = api->schedparam;
break;
47654: 6000 fed4 braw 4752a <pthread_create+0x82>
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
47658: 286d 00fe moveal %a5@(254),%a4
api->Attributes = *the_attr;
4765c: 4878 0040 pea 40 <DBL_MANT_DIG+0xb>
47660: 283c 0005 069c movel #329372,%d4
47666: 2044 moveal %d4,%a0
47668: 2f0a movel %a2,%sp@-
4766a: 2f0c movel %a4,%sp@-
4766c: 4e90 jsr %a0@
api->detachstate = the_attr->detachstate;
4766e: 296a 003c 0040 movel %a2@(60),%a4@(64)
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
47674: 2044 moveal %d4,%a0
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
47676: 2943 0084 movel %d3,%a4@(132)
api->schedparam = schedparam;
4767a: 4878 001c pea 1c <OPER2+0x8>
4767e: 2f0b movel %a3,%sp@-
47680: 486c 0088 pea %a4@(136)
47684: 4e90 jsr %a0@
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
47686: 42a7 clrl %sp@-
47688: 2f2e 0014 movel %fp@(20),%sp@-
4768c: 2f2e 0010 movel %fp@(16),%sp@-
47690: 4878 0001 pea 1 <ADD>
47694: 2f0d movel %a5,%sp@-
47696: 4eb9 0004 b858 jsr 4b858 <_Thread_Start>
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
4769c: 4fef 002c lea %sp@(44),%sp
476a0: 7004 moveq #4,%d0
476a2: b083 cmpl %d3,%d0
476a4: 6740 beqs 476e6 <pthread_create+0x23e>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
476a6: 206e 0008 moveal %fp@(8),%a0
476aa: 20ad 0008 movel %a5@(8),%a0@
_RTEMS_Unlock_allocator();
476ae: 2f39 0006 229a movel 6229a <_RTEMS_Allocator_Mutex>,%sp@-
476b4: 4eb9 0004 90f4 jsr 490f4 <_API_Mutex_Unlock>
476ba: 588f addql #4,%sp
return 0;
}
476bc: 2002 movel %d2,%d0
476be: 4cee 3c1c ffc0 moveml %fp@(-64),%d2-%d4/%a2-%a5
476c4: 4e5e unlk %fp
476c6: 4e75 rts
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
_RTEMS_Unlock_allocator();
476c8: 2f39 0006 229a movel 6229a <_RTEMS_Allocator_Mutex>,%sp@-
return EAGAIN;
476ce: 143c 000b moveb #11,%d2
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
_RTEMS_Unlock_allocator();
476d2: 4eb9 0004 90f4 jsr 490f4 <_API_Mutex_Unlock>
476d8: 588f addql #4,%sp
*/
*thread = the_thread->Object.id;
_RTEMS_Unlock_allocator();
return 0;
}
476da: 2002 movel %d2,%d0
476dc: 4cee 3c1c ffc0 moveml %fp@(-64),%d2-%d4/%a2-%a5
476e2: 4e5e unlk %fp
476e4: 4e75 rts
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
_Watchdog_Insert_ticks(
476e6: 486c 0090 pea %a4@(144)
476ea: 4eb9 0004 b8f4 jsr 4b8f4 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
476f0: 2940 00b4 movel %d0,%a4@(180)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
476f4: 486c 00a8 pea %a4@(168)
476f8: 4879 0006 22b2 pea 622b2 <_Watchdog_Ticks_chain>
476fe: 4eb9 0004 bb54 jsr 4bb54 <_Watchdog_Insert>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
47704: 206e 0008 moveal %fp@(8),%a0
47708: 4fef 000c lea %sp@(12),%sp
4770c: 20ad 0008 movel %a5@(8),%a0@
_RTEMS_Unlock_allocator();
47710: 2f39 0006 229a movel 6229a <_RTEMS_Allocator_Mutex>,%sp@-
47716: 4eb9 0004 90f4 jsr 490f4 <_API_Mutex_Unlock>
4771c: 588f addql #4,%sp
4771e: 609c bras 476bc <pthread_create+0x214>
0004ec18 <pthread_exit>:
}
void pthread_exit(
void *value_ptr
)
{
4ec18: 4e56 0000 linkw %fp,#0
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
4ec1c: 2f2e 0008 movel %fp@(8),%sp@-
4ec20: 2f39 0006 142e movel 6142e <_Per_CPU_Information+0xe>,%sp@-
4ec26: 4eb9 0004 eaf0 jsr 4eaf0 <_POSIX_Thread_Exit>
4ec2c: 508f addql #8,%sp <== NOT EXECUTED
}
4ec2e: 4e5e unlk %fp <== NOT EXECUTED
...
0005d3d4 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
5d3d4: 4e56 fff0 linkw %fp,#-16
5d3d8: 48d7 040c moveml %d2-%d3/%a2,%sp@
5d3dc: 242e 000c movel %fp@(12),%d2
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
5d3e0: 6700 009e beqw 5d480 <pthread_kill+0xac>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
5d3e4: 2602 movel %d2,%d3
5d3e6: 5383 subql #1,%d3
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
5d3e8: 701f moveq #31,%d0
5d3ea: b083 cmpl %d3,%d0
5d3ec: 6500 0092 bcsw 5d480 <pthread_kill+0xac>
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
5d3f0: 486e fffc pea %fp@(-4)
5d3f4: 2f2e 0008 movel %fp@(8),%sp@-
5d3f8: 4eb9 0004 9cf0 jsr 49cf0 <_Thread_Get>
switch ( location ) {
5d3fe: 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 );
5d400: 2440 moveal %d0,%a2
switch ( location ) {
5d402: 4aae fffc tstl %fp@(-4)
5d406: 6600 0090 bnew 5d498 <pthread_kill+0xc4>
5d40a: 4879 0005 f8b4 pea 5f8b4 <_POSIX_signals_Post_switch>
5d410: 4eb9 0004 7e3a jsr 47e3a <_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 ];
5d416: 206a 00fe moveal %a2@(254),%a0
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
5d41a: 2002 movel %d2,%d0
5d41c: 2202 movel %d2,%d1
5d41e: 588f addql #4,%sp
5d420: e588 lsll #2,%d0
5d422: e989 lsll #4,%d1
5d424: 9280 subl %d0,%d1
5d426: 0681 0006 1470 addil #398448,%d1
5d42c: 7001 moveq #1,%d0
5d42e: 2241 moveal %d1,%a1
5d430: b091 cmpl %a1@,%d0
5d432: 6728 beqs 5d45c <pthread_kill+0x88>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
5d434: 7001 moveq #1,%d0
5d436: e7a8 lsll %d3,%d0
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
5d438: 81a8 00d4 orl %d0,%a0@(212)
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
5d43c: 42a7 clrl %sp@-
5d43e: 2f02 movel %d2,%sp@-
5d440: 2f0a movel %a2,%sp@-
5d442: 4eb9 0005 d2a8 jsr 5d2a8 <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
5d448: 4fef 000c lea %sp@(12),%sp
5d44c: 4ab9 0006 1428 tstl 61428 <_Per_CPU_Information+0x8>
5d452: 6708 beqs 5d45c <pthread_kill+0x88>
5d454: b5f9 0006 142e cmpal 6142e <_Per_CPU_Information+0xe>,%a2
5d45a: 6712 beqs 5d46e <pthread_kill+0x9a>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
_Thread_Enable_dispatch();
5d45c: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return 0;
5d462: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
}
5d464: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
5d46a: 4e5e unlk %fp
5d46c: 4e75 rts
api->signals_pending |= signo_to_mask( sig );
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
5d46e: 7001 moveq #1,%d0
5d470: 13c0 0006 142c moveb %d0,6142c <_Per_CPU_Information+0xc>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
_Thread_Enable_dispatch();
5d476: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return 0;
5d47c: 4280 clrl %d0
5d47e: 60e4 bras 5d464 <pthread_kill+0x90>
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
5d480: 4eb9 0004 f024 jsr 4f024 <__errno>
5d486: 7416 moveq #22,%d2
5d488: 2040 moveal %d0,%a0
5d48a: 70ff moveq #-1,%d0
5d48c: 2082 movel %d2,%a0@
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
}
5d48e: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2
5d494: 4e5e unlk %fp
5d496: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
5d498: 4eb9 0004 f024 jsr 4f024 <__errno> <== NOT EXECUTED
5d49e: 7203 moveq #3,%d1 <== NOT EXECUTED
5d4a0: 2040 moveal %d0,%a0 <== NOT EXECUTED
5d4a2: 70ff moveq #-1,%d0 <== NOT EXECUTED
}
5d4a4: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 <== NOT EXECUTED
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
5d4aa: 2081 movel %d1,%a0@ <== NOT EXECUTED
}
5d4ac: 4e5e unlk %fp <== NOT EXECUTED
000493dc <pthread_mutex_setprioceiling>:
int pthread_mutex_setprioceiling(
pthread_mutex_t *mutex,
int prioceiling,
int *old_ceiling
)
{
493dc: 4e56 fffc linkw %fp,#-4
493e0: 2f02 movel %d2,%sp@-
register POSIX_Mutex_Control *the_mutex;
Objects_Locations location;
Priority_Control the_priority;
if ( !old_ceiling )
493e2: 4aae 0010 tstl %fp@(16)
493e6: 6710 beqs 493f8 <pthread_mutex_setprioceiling+0x1c>
return EINVAL;
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
493e8: 2f2e 000c movel %fp@(12),%sp@-
493ec: 4eb9 0004 964c jsr 4964c <_POSIX_Priority_Is_valid>
493f2: 588f addql #4,%sp
493f4: 4a00 tstb %d0
493f6: 660a bnes 49402 <pthread_mutex_setprioceiling+0x26>
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
493f8: 242e fff8 movel %fp@(-8),%d2
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
493fc: 7016 moveq #22,%d0
}
493fe: 4e5e unlk %fp
49400: 4e75 rts
/*
* Must acquire the mutex before we can change it's ceiling.
* POSIX says block until we acquire it.
*/
(void) pthread_mutex_lock( mutex );
49402: 2f2e 0008 movel %fp@(8),%sp@-
49406: 1439 0006 47bc moveb 647bc <rtems_maximum_priority>,%d2
4940c: 4eb9 0004 9358 jsr 49358 <pthread_mutex_lock>
* operations.
*
* NOTE: This makes it easier to get 100% binary coverage since the
* bad Id case is handled by the switch.
*/
the_mutex = _POSIX_Mutex_Get( mutex, &location );
49412: 486e fffc pea %fp@(-4)
49416: 2f2e 0008 movel %fp@(8),%sp@-
4941a: 4eb9 0004 90f4 jsr 490f4 <_POSIX_Mutex_Get>
switch ( location ) {
49420: 4fef 000c lea %sp@(12),%sp
49424: 4aae fffc tstl %fp@(-4)
49428: 66ce bnes 493f8 <pthread_mutex_setprioceiling+0x1c><== NEVER TAKEN
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{
return (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
4942a: 4281 clrl %d1
4942c: 1239 0006 47bc moveb 647bc <rtems_maximum_priority>,%d1
49432: 2040 moveal %d0,%a0
49434: 92a8 005e subl %a0@(94),%d1
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
49438: 0282 0000 00ff andil #255,%d2
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{
return (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
4943e: 206e 0010 moveal %fp@(16),%a0
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
49442: 94ae 000c subl %fp@(12),%d2
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
Priority_Control priority
)
{
return (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
49446: 2081 movel %d1,%a0@
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
49448: 2040 moveal %d0,%a0
4944a: 2142 005e movel %d2,%a0@(94)
);
the_mutex->Mutex.Attributes.priority_ceiling = the_priority;
/*
* We are required to unlock the mutex before we return.
*/
_CORE_mutex_Surrender(
4944e: 42a7 clrl %sp@-
49450: 2f28 0008 movel %a0@(8),%sp@-
49454: 4868 0014 pea %a0@(20)
49458: 4eb9 0004 b51c jsr 4b51c <_CORE_mutex_Surrender>
&the_mutex->Mutex,
the_mutex->Object.id,
NULL
);
_Thread_Enable_dispatch();
4945e: 4eb9 0004 cf78 jsr 4cf78 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
49464: 242e fff8 movel %fp@(-8),%d2
_CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
NULL
);
_Thread_Enable_dispatch();
49468: 4fef 000c lea %sp@(12),%sp
return 0;
4946c: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
4946e: 4e5e unlk %fp
...
00049474 <pthread_mutex_timedlock>:
*/
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
49474: 4e56 fffc linkw %fp,#-4
49478: 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 );
4947a: 486e fffc pea %fp@(-4)
4947e: 2f2e 000c movel %fp@(12),%sp@-
49482: 4eb9 0004 9578 jsr 49578 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
49488: 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 );
4948a: 2400 movel %d0,%d2
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
4948c: 7003 moveq #3,%d0
4948e: b082 cmpl %d2,%d0
49490: 6722 beqs 494b4 <pthread_mutex_timedlock+0x40>
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
49492: 2f2e fffc movel %fp@(-4),%sp@-
49496: 42a7 clrl %sp@-
49498: 2f2e 0008 movel %fp@(8),%sp@-
4949c: 4eb9 0004 9370 jsr 49370 <_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) ) {
494a2: 4fef 000c lea %sp@(12),%sp
494a6: 7210 moveq #16,%d1
494a8: b280 cmpl %d0,%d1
494aa: 6726 beqs 494d2 <pthread_mutex_timedlock+0x5e>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
494ac: 242e fff8 movel %fp@(-8),%d2
494b0: 4e5e unlk %fp
494b2: 4e75 rts
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
494b4: 2f2e fffc movel %fp@(-4),%sp@-
494b8: 4878 0001 pea 1 <ADD>
494bc: 2f2e 0008 movel %fp@(8),%sp@-
494c0: 4eb9 0004 9370 jsr 49370 <_POSIX_Mutex_Lock_support>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
494c6: 242e fff8 movel %fp@(-8),%d2
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
494ca: 4fef 000c lea %sp@(12),%sp
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
494ce: 4e5e unlk %fp
494d0: 4e75 rts
* 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) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
494d2: 4a82 tstl %d2
494d4: 660a bnes 494e0 <pthread_mutex_timedlock+0x6c> <== ALWAYS TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
494d6: 242e fff8 movel %fp@(-8),%d2 <== NOT EXECUTED
* 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;
494da: 7016 moveq #22,%d0 <== NOT EXECUTED
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
494dc: 4e5e unlk %fp <== NOT EXECUTED
494de: 4e75 rts <== NOT EXECUTED
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
494e0: 5382 subql #1,%d2
494e2: 7201 moveq #1,%d1
494e4: b282 cmpl %d2,%d1
494e6: 65c4 bcss 494ac <pthread_mutex_timedlock+0x38> <== NEVER TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return lock_status;
}
494e8: 242e fff8 movel %fp@(-8),%d2
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
494ec: 7074 moveq #116,%d0
}
return lock_status;
}
494ee: 4e5e unlk %fp
...
00048fdc <pthread_mutexattr_setprioceiling>:
int pthread_mutexattr_setprioceiling(
pthread_mutexattr_t *attr,
int prioceiling
)
{
48fdc: 4e56 0000 linkw %fp,#0
48fe0: 2f0a movel %a2,%sp@-
48fe2: 246e 0008 moveal %fp@(8),%a2
if ( !attr || !attr->is_initialized )
48fe6: 4a8a tstl %a2
48fe8: 6704 beqs 48fee <pthread_mutexattr_setprioceiling+0x12>
48fea: 4a92 tstl %a2@
48fec: 660a bnes 48ff8 <pthread_mutexattr_setprioceiling+0x1c>
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
return EINVAL;
attr->prio_ceiling = prioceiling;
return 0;
}
48fee: 246e fffc moveal %fp@(-4),%a2
pthread_mutexattr_t *attr,
int prioceiling
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
48ff2: 7016 moveq #22,%d0
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
return EINVAL;
attr->prio_ceiling = prioceiling;
return 0;
}
48ff4: 4e5e unlk %fp
48ff6: 4e75 rts
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
48ff8: 2f2e 000c movel %fp@(12),%sp@-
48ffc: 4eb9 0004 964c jsr 4964c <_POSIX_Priority_Is_valid>
49002: 588f addql #4,%sp
49004: 4a00 tstb %d0
49006: 67e6 beqs 48fee <pthread_mutexattr_setprioceiling+0x12><== NEVER TAKEN
return EINVAL;
attr->prio_ceiling = prioceiling;
49008: 202e 000c movel %fp@(12),%d0
4900c: 2540 0008 movel %d0,%a2@(8)
return 0;
}
49010: 246e fffc moveal %fp@(-4),%a2
if ( !_POSIX_Priority_Is_valid( prioceiling ) )
return EINVAL;
attr->prio_ceiling = prioceiling;
return 0;
49014: 4280 clrl %d0
}
49016: 4e5e unlk %fp
...
00049048 <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
49048: 4e56 0000 linkw %fp,#0
4904c: 206e 0008 moveal %fp@(8),%a0
if ( !attr || !attr->is_initialized )
49050: 4a88 tstl %a0
49052: 6704 beqs 49058 <pthread_mutexattr_setpshared+0x10>
49054: 4a90 tstl %a0@
49056: 6606 bnes 4905e <pthread_mutexattr_setpshared+0x16>
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
49058: 7016 moveq #22,%d0
}
}
4905a: 4e5e unlk %fp
4905c: 4e75 rts
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
4905e: 7001 moveq #1,%d0
49060: b0ae 000c cmpl %fp@(12),%d0
49064: 65f2 bcss 49058 <pthread_mutexattr_setpshared+0x10><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
49066: 202e 000c movel %fp@(12),%d0
return 0;
default:
return EINVAL;
}
}
4906a: 4e5e unlk %fp
return EINVAL;
switch ( pshared ) {
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
4906c: 2140 0004 movel %d0,%a0@(4)
return 0;
49070: 4280 clrl %d0 <== NOT EXECUTED
default:
return EINVAL;
}
}
00046e44 <pthread_mutexattr_settype>:
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
46e44: 4e56 0000 linkw %fp,#0
46e48: 206e 0008 moveal %fp@(8),%a0
if ( !attr || !attr->is_initialized )
46e4c: 4a88 tstl %a0
46e4e: 6704 beqs 46e54 <pthread_mutexattr_settype+0x10>
46e50: 4a90 tstl %a0@
46e52: 6606 bnes 46e5a <pthread_mutexattr_settype+0x16> <== ALWAYS TAKEN
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
return 0;
default:
return EINVAL;
46e54: 7016 moveq #22,%d0
}
}
46e56: 4e5e unlk %fp
46e58: 4e75 rts
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( type ) {
46e5a: 7003 moveq #3,%d0
46e5c: b0ae 000c cmpl %fp@(12),%d0
46e60: 65f2 bcss 46e54 <pthread_mutexattr_settype+0x10>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
46e62: 202e 000c movel %fp@(12),%d0
return 0;
default:
return EINVAL;
}
}
46e66: 4e5e unlk %fp
switch ( type ) {
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
46e68: 2140 0010 movel %d0,%a0@(16)
return 0;
46e6c: 4280 clrl %d0 <== NOT EXECUTED
default:
return EINVAL;
}
}
00047c74 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
47c74: 4e56 fff0 linkw %fp,#-16
47c78: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
47c7c: 246e 0008 moveal %fp@(8),%a2
if ( !once_control || !init_routine )
47c80: 4a8a tstl %a2
47c82: 6754 beqs 47cd8 <pthread_once+0x64>
47c84: 4aae 000c tstl %fp@(12)
47c88: 674e beqs 47cd8 <pthread_once+0x64>
return EINVAL;
if ( !once_control->init_executed ) {
47c8a: 4aaa 0004 tstl %a2@(4)
47c8e: 670c beqs 47c9c <pthread_once+0x28>
once_control->init_executed = true;
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
}
return 0;
47c90: 4280 clrl %d0
}
47c92: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
47c98: 4e5e unlk %fp
47c9a: 4e75 rts
if ( !once_control || !init_routine )
return EINVAL;
if ( !once_control->init_executed ) {
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
47c9c: 240e movel %fp,%d2
47c9e: 5982 subql #4,%d2
47ca0: 47f9 0004 89a4 lea 489a4 <rtems_task_mode>,%a3
47ca6: 2f02 movel %d2,%sp@-
47ca8: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb>
47cac: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb>
47cb0: 4e93 jsr %a3@
if ( !once_control->init_executed ) {
47cb2: 4fef 000c lea %sp@(12),%sp
47cb6: 4aaa 0004 tstl %a2@(4)
47cba: 6728 beqs 47ce4 <pthread_once+0x70> <== ALWAYS TAKEN
once_control->is_initialized = true;
once_control->init_executed = true;
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
47cbc: 2f02 movel %d2,%sp@- <== NOT EXECUTED
47cbe: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb> <== NOT EXECUTED
47cc2: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED
47cc6: 4e93 jsr %a3@ <== NOT EXECUTED
47cc8: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED
}
return 0;
47ccc: 4280 clrl %d0 <== NOT EXECUTED
}
47cce: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
47cd4: 4e5e unlk %fp
47cd6: 4e75 rts
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
if ( !once_control || !init_routine )
return EINVAL;
47cd8: 7016 moveq #22,%d0
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
}
return 0;
}
47cda: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
47ce0: 4e5e unlk %fp
47ce2: 4e75 rts
if ( !once_control->init_executed ) {
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
if ( !once_control->init_executed ) {
once_control->is_initialized = true;
47ce4: 7001 moveq #1,%d0
47ce6: 2480 movel %d0,%a2@
once_control->init_executed = true;
47ce8: 7001 moveq #1,%d0
(*init_routine)();
47cea: 206e 000c moveal %fp@(12),%a0
if ( !once_control->init_executed ) {
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
if ( !once_control->init_executed ) {
once_control->is_initialized = true;
once_control->init_executed = true;
47cee: 2540 0004 movel %d0,%a2@(4)
(*init_routine)();
47cf2: 4e90 jsr %a0@
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
47cf4: 2f02 movel %d2,%sp@-
47cf6: 4878 0100 pea 100 <DBL_MANT_DIG+0xcb>
47cfa: 2f2e fffc movel %fp@(-4),%sp@-
47cfe: 4e93 jsr %a3@
47d00: 4fef 000c lea %sp@(12),%sp
}
return 0;
47d04: 4280 clrl %d0
47d06: 60c6 bras 47cce <pthread_once+0x5a>
00047a44 <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
47a44: 4e56 fff4 linkw %fp,#-12
47a48: 2f0a movel %a2,%sp@-
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
47a4a: 4aae 0008 tstl %fp@(8)
47a4e: 670c beqs 47a5c <pthread_rwlock_init+0x18>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
47a50: 206e 000c moveal %fp@(12),%a0
47a54: 4a88 tstl %a0
47a56: 677a beqs 47ad2 <pthread_rwlock_init+0x8e>
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
47a58: 4a90 tstl %a0@
47a5a: 660a bnes 47a66 <pthread_rwlock_init+0x22> <== ALWAYS TAKEN
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47a5c: 246e fff0 moveal %fp@(-16),%a2
switch ( the_attr->process_shared ) {
case PTHREAD_PROCESS_PRIVATE: /* only supported values */
break;
case PTHREAD_PROCESS_SHARED:
default:
return EINVAL;
47a60: 7016 moveq #22,%d0
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47a62: 4e5e unlk %fp
47a64: 4e75 rts
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
return EINVAL;
switch ( the_attr->process_shared ) {
47a66: 4aa8 0004 tstl %a0@(4)
47a6a: 66f0 bnes 47a5c <pthread_rwlock_init+0x18> <== 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;
47a6c: 2039 0006 5a90 movel 65a90 <_Thread_Dispatch_disable_level>,%d0
++level;
47a72: 5280 addql #1,%d0
*/
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes(
CORE_RWLock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
47a74: 42ae fff4 clrl %fp@(-12)
_Thread_Dispatch_disable_level = level;
47a78: 23c0 0006 5a90 movel %d0,65a90 <_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 *)
47a7e: 4879 0006 5bfe pea 65bfe <_POSIX_RWLock_Information>
47a84: 4eb9 0004 a7bc jsr 4a7bc <_Objects_Allocate>
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
47a8a: 588f addql #4,%sp
47a8c: 2440 moveal %d0,%a2
47a8e: 4a80 tstl %d0
47a90: 675a beqs 47aec <pthread_rwlock_init+0xa8>
_Thread_Enable_dispatch();
return EAGAIN;
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
47a92: 486e fff4 pea %fp@(-12)
47a96: 486a 0010 pea %a2@(16)
47a9a: 4eb9 0004 a11c jsr 4a11c <_CORE_RWLock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
47aa0: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47aa4: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47aa6: 2079 0006 5c16 moveal 65c16 <_POSIX_RWLock_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47aac: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47ab2: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
47ab6: 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;
47aba: 42aa 000c clrl %a2@(12)
47abe: 2080 movel %d0,%a0@
_Thread_Enable_dispatch();
47ac0: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
return 0;
}
47ac6: 246e fff0 moveal %fp@(-16),%a2
0
);
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
47aca: 508f addql #8,%sp
return 0;
47acc: 4280 clrl %d0
}
47ace: 4e5e unlk %fp
47ad0: 4e75 rts
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
47ad2: 45ee fff8 lea %fp@(-8),%a2
47ad6: 2f0a movel %a2,%sp@-
47ad8: 4eb9 0004 8208 jsr 48208 <pthread_rwlockattr_init>
47ade: 588f addql #4,%sp
the_attr = &default_attr;
47ae0: 204a moveal %a2,%a0
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
47ae2: 4a90 tstl %a0@
47ae4: 6700 ff76 beqw 47a5c <pthread_rwlock_init+0x18>
47ae8: 6000 ff7c braw 47a66 <pthread_rwlock_init+0x22>
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
_Thread_Enable_dispatch();
47aec: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47af2: 246e fff0 moveal %fp@(-16),%a2
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
_Thread_Enable_dispatch();
return EAGAIN;
47af6: 700b moveq #11,%d0
*rwlock = the_rwlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47af8: 4e5e unlk %fp <== NOT EXECUTED
00048290 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
48290: 4e56 ffec linkw %fp,#-20
48294: 48d7 040c moveml %d2-%d3/%a2,%sp@
48298: 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 )
4829c: 4a8a tstl %a2
4829e: 6700 0082 beqw 48322 <pthread_rwlock_timedrdlock+0x92>
*
* 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 );
482a2: 486e fffc pea %fp@(-4)
482a6: 2f2e 000c movel %fp@(12),%sp@-
482aa: 4eb9 0004 e8f8 jsr 4e8f8 <_POSIX_Absolute_timeout_to_ticks>
482b0: 486e fff8 pea %fp@(-8)
482b4: 2400 movel %d0,%d2
482b6: 2f12 movel %a2@,%sp@-
482b8: 4879 0006 3e6e pea 63e6e <_POSIX_RWLock_Information>
482be: 4eb9 0004 b114 jsr 4b114 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
482c4: 4fef 0014 lea %sp@(20),%sp
482c8: 4aae fff8 tstl %fp@(-8)
482cc: 6654 bnes 48322 <pthread_rwlock_timedrdlock+0x92>
* 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 )
482ce: 7203 moveq #3,%d1
482d0: b282 cmpl %d2,%d1
482d2: 57c3 seq %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
482d4: 42a7 clrl %sp@-
482d6: 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 )
482da: 4483 negl %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
482dc: 4281 clrl %d1
482de: 1203 moveb %d3,%d1
482e0: 2040 moveal %d0,%a0
482e2: 2f01 movel %d1,%sp@-
482e4: 2f12 movel %a2@,%sp@-
482e6: 4868 0010 pea %a0@(16)
482ea: 4eb9 0004 a30c jsr 4a30c <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
482f0: 4eb9 0004 be30 jsr 4be30 <_Thread_Enable_dispatch>
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
482f6: 2079 0006 4182 moveal 64182 <_Per_CPU_Information+0xe>,%a0
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
482fc: 4fef 0014 lea %sp@(20),%sp
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
48300: 2028 0034 movel %a0@(52),%d0
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
48304: 4a03 tstb %d3
48306: 6606 bnes 4830e <pthread_rwlock_timedrdlock+0x7e>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
48308: 7202 moveq #2,%d1
4830a: b280 cmpl %d0,%d1
4830c: 6720 beqs 4832e <pthread_rwlock_timedrdlock+0x9e>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
4830e: 2f00 movel %d0,%sp@-
48310: 4eb9 0004 8400 jsr 48400 <_POSIX_RWLock_Translate_core_RWLock_return_code>
48316: 588f addql #4,%sp
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
48318: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
4831e: 4e5e unlk %fp
48320: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
48322: 7016 moveq #22,%d0
}
48324: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
4832a: 4e5e unlk %fp
4832c: 4e75 rts
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
4832e: 4a82 tstl %d2
48330: 67f0 beqs 48322 <pthread_rwlock_timedrdlock+0x92><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
48332: 5382 subql #1,%d2
48334: 123c 0001 moveb #1,%d1
48338: b282 cmpl %d2,%d1
4833a: 65d2 bcss 4830e <pthread_rwlock_timedrdlock+0x7e><== NEVER TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
4833c: 7074 moveq #116,%d0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
4833e: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
48344: 4e5e unlk %fp <== NOT EXECUTED
00048348 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
48348: 4e56 ffec linkw %fp,#-20
4834c: 48d7 040c moveml %d2-%d3/%a2,%sp@
48350: 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 )
48354: 4a8a tstl %a2
48356: 6700 0082 beqw 483da <pthread_rwlock_timedwrlock+0x92>
*
* 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 );
4835a: 486e fffc pea %fp@(-4)
4835e: 2f2e 000c movel %fp@(12),%sp@-
48362: 4eb9 0004 e8f8 jsr 4e8f8 <_POSIX_Absolute_timeout_to_ticks>
48368: 486e fff8 pea %fp@(-8)
4836c: 2400 movel %d0,%d2
4836e: 2f12 movel %a2@,%sp@-
48370: 4879 0006 3e6e pea 63e6e <_POSIX_RWLock_Information>
48376: 4eb9 0004 b114 jsr 4b114 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
4837c: 4fef 0014 lea %sp@(20),%sp
48380: 4aae fff8 tstl %fp@(-8)
48384: 6654 bnes 483da <pthread_rwlock_timedwrlock+0x92>
* 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 )
48386: 7203 moveq #3,%d1
48388: b282 cmpl %d2,%d1
4838a: 57c3 seq %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
4838c: 42a7 clrl %sp@-
4838e: 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 )
48392: 4483 negl %d3
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
48394: 4281 clrl %d1
48396: 1203 moveb %d3,%d1
48398: 2040 moveal %d0,%a0
4839a: 2f01 movel %d1,%sp@-
4839c: 2f12 movel %a2@,%sp@-
4839e: 4868 0010 pea %a0@(16)
483a2: 4eb9 0004 a3cc jsr 4a3cc <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
483a8: 4eb9 0004 be30 jsr 4be30 <_Thread_Enable_dispatch>
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
483ae: 2079 0006 4182 moveal 64182 <_Per_CPU_Information+0xe>,%a0
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
483b4: 4fef 0014 lea %sp@(20),%sp
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
483b8: 2028 0034 movel %a0@(52),%d0
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
483bc: 4a03 tstb %d3
483be: 6606 bnes 483c6 <pthread_rwlock_timedwrlock+0x7e>
483c0: 7202 moveq #2,%d1
483c2: b280 cmpl %d0,%d1
483c4: 6720 beqs 483e6 <pthread_rwlock_timedwrlock+0x9e>
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
483c6: 2f00 movel %d0,%sp@-
483c8: 4eb9 0004 8400 jsr 48400 <_POSIX_RWLock_Translate_core_RWLock_return_code>
483ce: 588f addql #4,%sp
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
483d0: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
483d6: 4e5e unlk %fp
483d8: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return EINVAL;
483da: 7016 moveq #22,%d0
}
483dc: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
483e2: 4e5e unlk %fp
483e4: 4e75 rts
);
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
483e6: 4a82 tstl %d2
483e8: 67f0 beqs 483da <pthread_rwlock_timedwrlock+0x92><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
483ea: 5382 subql #1,%d2
483ec: 123c 0001 moveb #1,%d1
483f0: b282 cmpl %d2,%d1
483f2: 65d2 bcss 483c6 <pthread_rwlock_timedwrlock+0x7e><== NEVER TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
483f4: 7074 moveq #116,%d0
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
483f6: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2
483fc: 4e5e unlk %fp <== NOT EXECUTED
00048c3c <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
48c3c: 4e56 0000 linkw %fp,#0
48c40: 206e 0008 moveal %fp@(8),%a0
if ( !attr )
48c44: 4a88 tstl %a0
48c46: 6704 beqs 48c4c <pthread_rwlockattr_setpshared+0x10>
return EINVAL;
if ( !attr->is_initialized )
48c48: 4a90 tstl %a0@
48c4a: 6606 bnes 48c52 <pthread_rwlockattr_setpshared+0x16>
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
48c4c: 7016 moveq #22,%d0
}
}
48c4e: 4e5e unlk %fp
48c50: 4e75 rts
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
48c52: 7001 moveq #1,%d0
48c54: b0ae 000c cmpl %fp@(12),%d0
48c58: 65f2 bcss 48c4c <pthread_rwlockattr_setpshared+0x10><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
48c5a: 202e 000c movel %fp@(12),%d0
return 0;
default:
return EINVAL;
}
}
48c5e: 4e5e unlk %fp
return EINVAL;
switch ( pshared ) {
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
48c60: 2140 0004 movel %d0,%a0@(4)
return 0;
48c64: 4280 clrl %d0 <== NOT EXECUTED
default:
return EINVAL;
}
}
00049ecc <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
49ecc: 4e56 ffe4 linkw %fp,#-28
49ed0: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@
49ed4: 262e 0010 movel %fp@(16),%d3
int rc;
/*
* Check all the parameters
*/
if ( !param )
49ed8: 6700 00bc beqw 49f96 <pthread_setschedparam+0xca>
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
49edc: 486e fff8 pea %fp@(-8)
49ee0: 486e fff4 pea %fp@(-12)
49ee4: 2f03 movel %d3,%sp@-
49ee6: 2f2e 000c movel %fp@(12),%sp@-
49eea: 4eb9 0004 fc38 jsr 4fc38 <_POSIX_Thread_Translate_sched_param>
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
49ef0: 4fef 0010 lea %sp@(16),%sp
* Check all the parameters
*/
if ( !param )
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
49ef4: 2400 movel %d0,%d2
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
49ef6: 670c beqs 49f04 <pthread_setschedparam+0x38>
case OBJECTS_ERROR:
break;
}
return ESRCH;
}
49ef8: 2002 movel %d2,%d0
49efa: 4cee 0c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a3
49f00: 4e5e unlk %fp
49f02: 4e75 rts
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
49f04: 486e fffc pea %fp@(-4)
49f08: 2f2e 0008 movel %fp@(8),%sp@-
49f0c: 4eb9 0004 cf98 jsr 4cf98 <_Thread_Get>
switch ( location ) {
49f12: 508f addql #8,%sp
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
49f14: 2440 moveal %d0,%a2
switch ( location ) {
49f16: 4aae fffc tstl %fp@(-4)
49f1a: 6600 0088 bnew 49fa4 <pthread_setschedparam+0xd8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
49f1e: 266a 00fe moveal %a2@(254),%a3
if ( api->schedpolicy == SCHED_SPORADIC )
49f22: 7004 moveq #4,%d0
49f24: b0ab 0084 cmpl %a3@(132),%d0
49f28: 6700 00bc beqw 49fe6 <pthread_setschedparam+0x11a>
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
49f2c: 41eb 0088 lea %a3@(136),%a0
49f30: 2243 moveal %d3,%a1
49f32: 20d9 movel %a1@+,%a0@+
49f34: 20d9 movel %a1@+,%a0@+
49f36: 20d9 movel %a1@+,%a0@+
49f38: 20d9 movel %a1@+,%a0@+
49f3a: 20d9 movel %a1@+,%a0@+
49f3c: 20d9 movel %a1@+,%a0@+
49f3e: 2091 movel %a1@,%a0@
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
49f40: 206e 000c moveal %fp@(12),%a0
49f44: 2748 0084 movel %a0,%a3@(132)
api->schedparam = *param;
the_thread->budget_algorithm = budget_algorithm;
49f48: 256e fff4 0076 movel %fp@(-12),%a2@(118)
the_thread->budget_callout = budget_callout;
49f4e: 256e fff8 007a movel %fp@(-8),%a2@(122)
switch ( api->schedpolicy ) {
49f54: 4a88 tstl %a0
49f56: 6d2c blts 49f84 <pthread_setschedparam+0xb8> <== NEVER TAKEN
49f58: 7002 moveq #2,%d0
49f5a: b088 cmpl %a0,%d0
49f5c: 6c54 bges 49fb2 <pthread_setschedparam+0xe6>
49f5e: 103c 0004 moveb #4,%d0
49f62: b088 cmpl %a0,%d0
49f64: 661e bnes 49f84 <pthread_setschedparam+0xb8> <== NEVER TAKEN
true
);
break;
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
49f66: 276b 0088 00a4 movel %a3@(136),%a3@(164)
_Watchdog_Remove( &api->Sporadic_timer );
49f6c: 486b 00a8 pea %a3@(168)
49f70: 4eb9 0004 df24 jsr 4df24 <_Watchdog_Remove>
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
49f76: 2f0a movel %a2,%sp@-
49f78: 42a7 clrl %sp@-
49f7a: 4eb9 0004 9d7c jsr 49d7c <_POSIX_Threads_Sporadic_budget_TSR>
break;
49f80: 4fef 000c lea %sp@(12),%sp
}
_Thread_Enable_dispatch();
49f84: 4eb9 0004 cf78 jsr 4cf78 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return ESRCH;
}
49f8a: 2002 movel %d2,%d0
49f8c: 4cee 0c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a3
49f92: 4e5e unlk %fp
49f94: 4e75 rts
/*
* Check all the parameters
*/
if ( !param )
return EINVAL;
49f96: 7416 moveq #22,%d2
case OBJECTS_ERROR:
break;
}
return ESRCH;
}
49f98: 2002 movel %d2,%d0
49f9a: 4cee 0c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a3
49fa0: 4e5e unlk %fp
49fa2: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
49fa4: 7403 moveq #3,%d2
}
49fa6: 2002 movel %d2,%d0
49fa8: 4cee 0c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a3
49fae: 4e5e unlk %fp
49fb0: 4e75 rts
49fb2: 4280 clrl %d0
49fb4: 1039 0006 47bc moveb 647bc <rtems_maximum_priority>,%d0
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
49fba: 41f9 0006 60be lea 660be <_Thread_Ticks_per_timeslice>,%a0
49fc0: 90ab 0088 subl %a3@(136),%d0
49fc4: 2550 0072 movel %a0@,%a2@(114)
the_thread->real_priority =
49fc8: 2540 0018 movel %d0,%a2@(24)
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
49fcc: 4878 0001 pea 1 <ADD>
49fd0: 2f00 movel %d0,%sp@-
49fd2: 2f0a movel %a2,%sp@-
49fd4: 4eb9 0004 ca94 jsr 4ca94 <_Thread_Change_priority>
the_thread,
the_thread->real_priority,
true
);
break;
49fda: 4fef 000c lea %sp@(12),%sp
_Watchdog_Remove( &api->Sporadic_timer );
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
break;
}
_Thread_Enable_dispatch();
49fde: 4eb9 0004 cf78 jsr 4cf78 <_Thread_Enable_dispatch>
49fe4: 60a4 bras 49f8a <pthread_setschedparam+0xbe>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
49fe6: 486b 00a8 pea %a3@(168)
49fea: 4eb9 0004 df24 jsr 4df24 <_Watchdog_Remove>
49ff0: 588f addql #4,%sp
49ff2: 6000 ff38 braw 49f2c <pthread_setschedparam+0x60>
...
0004dcec <pthread_sigmask>:
int pthread_sigmask(
int how,
const sigset_t *set,
sigset_t *oset
)
{
4dcec: 4e56 0000 linkw %fp,#0
4dcf0: 202e 0008 movel %fp@(8),%d0
4dcf4: 2f0a movel %a2,%sp@-
4dcf6: 246e 000c moveal %fp@(12),%a2
4dcfa: 226e 0010 moveal %fp@(16),%a1
POSIX_API_Control *api;
if ( !set && !oset )
4dcfe: 4a8a tstl %a2
4dd00: 6700 00a2 beqw 4dda4 <pthread_sigmask+0xb8>
rtems_set_errno_and_return_minus_one( EINVAL );
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
4dd04: 2079 0006 320e moveal 6320e <_Per_CPU_Information+0xe>,%a0
4dd0a: 2068 00fe moveal %a0@(254),%a0
if ( oset )
4dd0e: 4a89 tstl %a1
4dd10: 6704 beqs 4dd16 <pthread_sigmask+0x2a>
*oset = api->signals_blocked;
4dd12: 22a8 00d0 movel %a0@(208),%a1@
if ( !set )
return 0;
switch ( how ) {
4dd16: 7201 moveq #1,%d1
4dd18: b280 cmpl %d0,%d1
4dd1a: 676c beqs 4dd88 <pthread_sigmask+0x9c>
4dd1c: 123c 0002 moveb #2,%d1
4dd20: b280 cmpl %d0,%d1
4dd22: 6730 beqs 4dd54 <pthread_sigmask+0x68>
4dd24: 4a80 tstl %d0
4dd26: 664a bnes 4dd72 <pthread_sigmask+0x86>
break;
case SIG_UNBLOCK:
api->signals_blocked &= ~*set;
break;
case SIG_SETMASK:
api->signals_blocked = *set;
4dd28: 2152 00d0 movel %a2@,%a0@(208)
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending) ) {
4dd2c: 2039 0006 343c movel 6343c <_POSIX_signals_Pending>,%d0
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
4dd32: 2228 00d0 movel %a0@(208),%d1
4dd36: 4681 notl %d1
(api->signals_pending | _POSIX_signals_Pending) ) {
4dd38: 80a8 00d4 orl %a0@(212),%d0
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
4dd3c: c081 andl %d1,%d0
4dd3e: 660a bnes 4dd4a <pthread_sigmask+0x5e> <== NEVER TAKEN
(api->signals_pending | _POSIX_signals_Pending) ) {
_Thread_Dispatch();
}
return 0;
4dd40: 4280 clrl %d0
}
4dd42: 246e fffc moveal %fp@(-4),%a2
4dd46: 4e5e unlk %fp
4dd48: 4e75 rts
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending) ) {
_Thread_Dispatch();
4dd4a: 4eb9 0004 aa68 jsr 4aa68 <_Thread_Dispatch>
}
return 0;
4dd50: 4280 clrl %d0
4dd52: 60ee bras 4dd42 <pthread_sigmask+0x56>
switch ( how ) {
case SIG_BLOCK:
api->signals_blocked |= *set;
break;
case SIG_UNBLOCK:
api->signals_blocked &= ~*set;
4dd54: 2012 movel %a2@,%d0
4dd56: 4680 notl %d0
4dd58: c1a8 00d0 andl %d0,%a0@(208)
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending) ) {
4dd5c: 2039 0006 343c movel 6343c <_POSIX_signals_Pending>,%d0
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
4dd62: 2228 00d0 movel %a0@(208),%d1
4dd66: 4681 notl %d1
(api->signals_pending | _POSIX_signals_Pending) ) {
4dd68: 80a8 00d4 orl %a0@(212),%d0
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
4dd6c: c081 andl %d1,%d0
4dd6e: 67d0 beqs 4dd40 <pthread_sigmask+0x54>
4dd70: 60d8 bras 4dd4a <pthread_sigmask+0x5e>
break;
case SIG_SETMASK:
api->signals_blocked = *set;
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
4dd72: 4eb9 0005 0090 jsr 50090 <__errno>
(api->signals_pending | _POSIX_signals_Pending) ) {
_Thread_Dispatch();
}
return 0;
}
4dd78: 246e fffc moveal %fp@(-4),%a2
break;
case SIG_SETMASK:
api->signals_blocked = *set;
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
4dd7c: 2040 moveal %d0,%a0
4dd7e: 7216 moveq #22,%d1
4dd80: 70ff moveq #-1,%d0
(api->signals_pending | _POSIX_signals_Pending) ) {
_Thread_Dispatch();
}
return 0;
}
4dd82: 4e5e unlk %fp
break;
case SIG_SETMASK:
api->signals_blocked = *set;
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
4dd84: 2081 movel %d1,%a0@
(api->signals_pending | _POSIX_signals_Pending) ) {
_Thread_Dispatch();
}
return 0;
}
4dd86: 4e75 rts
if ( !set )
return 0;
switch ( how ) {
case SIG_BLOCK:
api->signals_blocked |= *set;
4dd88: 2012 movel %a2@,%d0
4dd8a: 81a8 00d0 orl %d0,%a0@(208)
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending) ) {
4dd8e: 2039 0006 343c movel 6343c <_POSIX_signals_Pending>,%d0
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
4dd94: 2228 00d0 movel %a0@(208),%d1
4dd98: 4681 notl %d1
(api->signals_pending | _POSIX_signals_Pending) ) {
4dd9a: 80a8 00d4 orl %a0@(212),%d0
/* XXX are there critical section problems here? */
/* XXX evaluate the new set */
if ( ~api->signals_blocked &
4dd9e: c081 andl %d1,%d0
4dda0: 679e beqs 4dd40 <pthread_sigmask+0x54> <== ALWAYS TAKEN
4dda2: 60a6 bras 4dd4a <pthread_sigmask+0x5e> <== NOT EXECUTED
sigset_t *oset
)
{
POSIX_API_Control *api;
if ( !set && !oset )
4dda4: 4a89 tstl %a1
4dda6: 67ca beqs 4dd72 <pthread_sigmask+0x86>
rtems_set_errno_and_return_minus_one( EINVAL );
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
4dda8: 2079 0006 320e moveal 6320e <_Per_CPU_Information+0xe>,%a0
if ( ~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending) ) {
_Thread_Dispatch();
}
return 0;
4ddae: 4280 clrl %d0
rtems_set_errno_and_return_minus_one( EINVAL );
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
if ( oset )
*oset = api->signals_blocked;
4ddb0: 2068 00fe moveal %a0@(254),%a0
4ddb4: 22a8 00d0 movel %a0@(208),%a1@
4ddb8: 6088 bras 4dd42 <pthread_sigmask+0x56>
...
00047afc <pthread_spin_init>:
int pthread_spin_init(
pthread_spinlock_t *spinlock,
int pshared
)
{
47afc: 4e56 fffc linkw %fp,#-4
47b00: 2f0a movel %a2,%sp@-
POSIX_Spinlock_Control *the_spinlock;
CORE_spinlock_Attributes attributes;
if ( !spinlock )
47b02: 4aae 0008 tstl %fp@(8)
47b06: 676a beqs 47b72 <pthread_spin_init+0x76>
return EINVAL;
switch ( pshared ) {
47b08: 4aae 000c tstl %fp@(12)
47b0c: 6664 bnes 47b72 <pthread_spin_init+0x76>
*
* 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;
47b0e: 2039 0006 5a90 movel 65a90 <_Thread_Dispatch_disable_level>,%d0
++level;
47b14: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
47b16: 23c0 0006 5a90 movel %d0,65a90 <_Thread_Dispatch_disable_level>
* This function allocates a spinlock control block from
* the inactive chain of free spinlock control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Allocate( void )
{
return (POSIX_Spinlock_Control *)
47b1c: 4879 0006 5c72 pea 65c72 <_POSIX_Spinlock_Information>
47b22: 4eb9 0004 a7bc jsr 4a7bc <_Objects_Allocate>
_Thread_Disable_dispatch(); /* prevents deletion */
the_spinlock = _POSIX_Spinlock_Allocate();
if ( !the_spinlock ) {
47b28: 588f addql #4,%sp
47b2a: 2440 moveal %d0,%a2
47b2c: 4a80 tstl %d0
47b2e: 674c beqs 47b7c <pthread_spin_init+0x80> <== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE void _CORE_spinlock_Initialize_attributes(
CORE_spinlock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
47b30: 204e moveal %fp,%a0
47b32: 42a0 clrl %a0@-
return EAGAIN;
}
_CORE_spinlock_Initialize_attributes( &attributes );
_CORE_spinlock_Initialize( &the_spinlock->Spinlock, &attributes );
47b34: 2f08 movel %a0,%sp@-
47b36: 486a 0010 pea %a2@(16)
47b3a: 4eb9 0004 a1f4 jsr 4a1f4 <_CORE_spinlock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
47b40: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47b44: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47b46: 2079 0006 5c8a moveal 65c8a <_POSIX_Spinlock_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
uint32_t name
)
{
_Objects_Set_local_object(
47b4c: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47b52: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
_Objects_Open_u32( &_POSIX_Spinlock_Information, &the_spinlock->Object, 0 );
*spinlock = the_spinlock->Object.id;
47b56: 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;
47b5a: 42aa 000c clrl %a2@(12)
47b5e: 2080 movel %d0,%a0@
_Thread_Enable_dispatch();
47b60: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
return 0;
}
47b66: 246e fff8 moveal %fp@(-8),%a2
_Objects_Open_u32( &_POSIX_Spinlock_Information, &the_spinlock->Object, 0 );
*spinlock = the_spinlock->Object.id;
_Thread_Enable_dispatch();
47b6a: 508f addql #8,%sp
return 0;
47b6c: 4280 clrl %d0
}
47b6e: 4e5e unlk %fp
47b70: 4e75 rts
47b72: 246e fff8 moveal %fp@(-8),%a2
switch ( pshared ) {
case PTHREAD_PROCESS_PRIVATE: /* only supported values */
break;
case PTHREAD_PROCESS_SHARED:
default:
return EINVAL;
47b76: 7016 moveq #22,%d0
*spinlock = the_spinlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47b78: 4e5e unlk %fp
47b7a: 4e75 rts
_Thread_Disable_dispatch(); /* prevents deletion */
the_spinlock = _POSIX_Spinlock_Allocate();
if ( !the_spinlock ) {
_Thread_Enable_dispatch();
47b7c: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
*spinlock = the_spinlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47b82: 246e fff8 moveal %fp@(-8),%a2
the_spinlock = _POSIX_Spinlock_Allocate();
if ( !the_spinlock ) {
_Thread_Enable_dispatch();
return EAGAIN;
47b86: 700b moveq #11,%d0
*spinlock = the_spinlock->Object.id;
_Thread_Enable_dispatch();
return 0;
}
47b88: 4e5e unlk %fp <== NOT EXECUTED
00047900 <pthread_testcancel>:
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
47900: 4e56 0000 linkw %fp,#0
* 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() )
47904: 4ab9 0006 2320 tstl 62320 <_Per_CPU_Information+0x8>
4790a: 663c bnes 47948 <pthread_testcancel+0x48> <== NEVER TAKEN
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
4790c: 2079 0006 2326 moveal 62326 <_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;
47912: 2039 0006 1ee0 movel 61ee0 <_Thread_Dispatch_disable_level>,%d0
++level;
47918: 5280 addql #1,%d0
4791a: 2068 00fe moveal %a0@(254),%a0
_Thread_Dispatch_disable_level = level;
4791e: 23c0 0006 1ee0 movel %d0,61ee0 <_Thread_Dispatch_disable_level>
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
47924: 4aa8 00d8 tstl %a0@(216)
47928: 6622 bnes 4794c <pthread_testcancel+0x4c> <== NEVER TAKEN
4792a: 4aa8 00e0 tstl %a0@(224)
4792e: 671c beqs 4794c <pthread_testcancel+0x4c>
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
47930: 4eb9 0004 a79c jsr 4a79c <_Thread_Enable_dispatch>
if ( cancel )
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
47936: 4878 ffff pea ffffffff <LESS>
4793a: 2f39 0006 2326 movel 62326 <_Per_CPU_Information+0xe>,%sp@-
47940: 4eb9 0004 d504 jsr 4d504 <_POSIX_Thread_Exit>
47946: 508f addql #8,%sp <== NOT EXECUTED
}
47948: 4e5e unlk %fp <== NOT EXECUTED
4794a: 4e75 rts <== NOT EXECUTED
4794c: 4e5e unlk %fp
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
4794e: 4ef9 0004 a79c jmp 4a79c <_Thread_Enable_dispatch>
00047dbe <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
47dbe: 4e56 ffc4 linkw %fp,#-60
47dc2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%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);
47dc6: 4879 0006 35ac pea 635ac <aio_request_queue>
47dcc: 47f9 0004 8868 lea 48868 <pthread_mutex_lock>,%a3
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
47dd2: 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);
47dd6: 4e93 jsr %a3@
if (result != 0) {
47dd8: 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);
47dda: 2400 movel %d0,%d2
if (result != 0) {
47ddc: 6600 00b8 bnew 47e96 <rtems_aio_enqueue+0xd8>
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);
47de0: 49f9 0004 91cc lea 491cc <pthread_self>,%a4
47de6: 4e94 jsr %a4@
47de8: 486e ffe4 pea %fp@(-28)
47dec: 486e ffe0 pea %fp@(-32)
47df0: 2f00 movel %d0,%sp@-
47df2: 4eb9 0004 8d40 jsr 48d40 <pthread_getschedparam>
req->caller_thread = pthread_self ();
47df8: 4e94 jsr %a4@
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
47dfa: 206a 0014 moveal %a2@(20),%a0
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
47dfe: 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 ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
47e02: 222e ffe4 movel %fp@(-28),%d1
47e06: 92a8 0014 subl %a0@(20),%d1
req->policy = policy;
47e0a: 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 ();
47e10: 2540 0010 movel %d0,%a2@(16)
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
47e14: 7077 moveq #119,%d0
/* _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;
47e16: 2541 000c movel %d1,%a2@(12)
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
47e1a: 2140 0030 movel %d0,%a0@(48)
req->aiocbp->return_value = 0;
47e1e: 42a8 0034 clrl %a0@(52)
if ((aio_request_queue.idle_threads == 0) &&
47e22: 4ab9 0006 3614 tstl 63614 <aio_request_queue+0x68>
47e28: 660a bnes 47e34 <rtems_aio_enqueue+0x76> <== NEVER TAKEN
47e2a: 7204 moveq #4,%d1
47e2c: b2b9 0006 3610 cmpl 63610 <aio_request_queue+0x64>,%d1
47e32: 6c78 bges 47eac <rtems_aio_enqueue+0xee>
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,
47e34: 42a7 clrl %sp@-
47e36: 2f10 movel %a0@,%sp@-
47e38: 4bf9 0004 7c32 lea 47c32 <rtems_aio_search_fd>,%a5
47e3e: 4879 0006 35f4 pea 635f4 <aio_request_queue+0x48>
47e44: 4e95 jsr %a5@
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
47e46: 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,
47e4a: 2840 moveal %d0,%a4
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
47e4c: 4a80 tstl %d0
47e4e: 6700 00de beqw 47f2e <rtems_aio_enqueue+0x170>
{
pthread_mutex_lock (&r_chain->mutex);
47e52: 260c movel %a4,%d3
47e54: 0683 0000 001c addil #28,%d3
rtems_aio_insert_prio (&r_chain->perfd, req);
pthread_cond_signal (&r_chain->cond);
pthread_mutex_unlock (&r_chain->mutex);
47e5a: 4bf9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a5
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
{
pthread_mutex_lock (&r_chain->mutex);
47e60: 2f03 movel %d3,%sp@-
47e62: 4e93 jsr %a3@
rtems_aio_insert_prio (&r_chain->perfd, req);
47e64: 2f0a movel %a2,%sp@-
47e66: 486c 0008 pea %a4@(8)
47e6a: 4eba fbf8 jsr %pc@(47a64 <rtems_aio_insert_prio>)
pthread_cond_signal (&r_chain->cond);
47e6e: 486c 0020 pea %a4@(32)
47e72: 4eb9 0004 8400 jsr 48400 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
47e78: 2f03 movel %d3,%sp@-
47e7a: 4e95 jsr %a5@
47e7c: 4fef 0014 lea %sp@(20),%sp
if (aio_request_queue.idle_threads > 0)
pthread_cond_signal (&aio_request_queue.new_req);
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
47e80: 4879 0006 35ac pea 635ac <aio_request_queue>
47e86: 4e95 jsr %a5@
47e88: 588f addql #4,%sp
return 0;
}
47e8a: 2002 movel %d2,%d0
47e8c: 4cee 3c0c ffc4 moveml %fp@(-60),%d2-%d3/%a2-%a5
47e92: 4e5e unlk %fp
47e94: 4e75 rts
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
if (result != 0) {
free (req);
47e96: 2f0a movel %a2,%sp@- <== NOT EXECUTED
47e98: 4eb9 0004 35f8 jsr 435f8 <free> <== NOT EXECUTED
47e9e: 588f addql #4,%sp <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
return 0;
}
47ea0: 2002 movel %d2,%d0 <== NOT EXECUTED
47ea2: 4cee 3c0c ffc4 moveml %fp@(-60),%d2-%d3/%a2-%a5 <== NOT EXECUTED
47ea8: 4e5e unlk %fp <== NOT EXECUTED
47eaa: 4e75 rts <== NOT EXECUTED
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
47eac: 4878 0001 pea 1 <ADD>
47eb0: 2f10 movel %a0@,%sp@-
47eb2: 4879 0006 35f4 pea 635f4 <aio_request_queue+0x48>
47eb8: 4eb9 0004 7c32 jsr 47c32 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
47ebe: 4fef 000c lea %sp@(12),%sp
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);
47ec2: 2840 moveal %d0,%a4
if (r_chain->new_fd == 1) {
47ec4: 7001 moveq #1,%d0
47ec6: b0ac 0018 cmpl %a4@(24),%d0
47eca: 6686 bnes 47e52 <rtems_aio_enqueue+0x94>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
47ecc: 2f0a movel %a2,%sp@-
47ece: 486c 0008 pea %a4@(8)
47ed2: 4eb9 0004 a534 jsr 4a534 <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
47ed8: 42ac 0018 clrl %a4@(24)
pthread_mutex_init (&r_chain->mutex, NULL);
47edc: 42a7 clrl %sp@-
47ede: 486c 001c pea %a4@(28)
47ee2: 4eb9 0004 8734 jsr 48734 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
47ee8: 42a7 clrl %sp@-
47eea: 486c 0020 pea %a4@(32)
47eee: 4eb9 0004 8340 jsr 48340 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
47ef4: 2f0c movel %a4,%sp@-
47ef6: 487a f8ac pea %pc@(477a4 <rtems_aio_handle>)
47efa: 4879 0006 35b4 pea 635b4 <aio_request_queue+0x8>
47f00: 486e ffdc pea %fp@(-36)
47f04: 4eb9 0004 8ac8 jsr 48ac8 <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
47f0a: 4fef 0028 lea %sp@(40),%sp
47f0e: 4a80 tstl %d0
47f10: 6600 00bc bnew 47fce <rtems_aio_enqueue+0x210>
if (aio_request_queue.idle_threads > 0)
pthread_cond_signal (&aio_request_queue.new_req);
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
47f14: 4879 0006 35ac pea 635ac <aio_request_queue>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
47f1a: 52b9 0006 3610 addql #1,63610 <aio_request_queue+0x64>
47f20: 4bf9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a5
if (aio_request_queue.idle_threads > 0)
pthread_cond_signal (&aio_request_queue.new_req);
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
47f26: 4e95 jsr %a5@
47f28: 588f addql #4,%sp
47f2a: 6000 ff5e braw 47e8a <rtems_aio_enqueue+0xcc>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
47f2e: 4878 0001 pea 1 <ADD>
47f32: 206a 0014 moveal %a2@(20),%a0
47f36: 2f10 movel %a0@,%sp@-
47f38: 4879 0006 3600 pea 63600 <aio_request_queue+0x54>
47f3e: 4e95 jsr %a5@
if (r_chain->new_fd == 1) {
47f40: 4fef 000c lea %sp@(12),%sp
47f44: 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);
47f46: 2640 moveal %d0,%a3
if (r_chain->new_fd == 1) {
47f48: b2ab 0018 cmpl %a3@(24),%d1
47f4c: 674a beqs 47f98 <rtems_aio_enqueue+0x1da>
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
pthread_cond_init (&r_chain->cond, NULL);
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
47f4e: 2f0a movel %a2,%sp@-
47f50: 486b 0008 pea %a3@(8)
47f54: 4eba fb0e jsr %pc@(47a64 <rtems_aio_insert_prio>)
47f58: 508f addql #8,%sp
if (aio_request_queue.idle_threads > 0)
47f5a: 4ab9 0006 3614 tstl 63614 <aio_request_queue+0x68>
47f60: 6f22 bles 47f84 <rtems_aio_enqueue+0x1c6> <== ALWAYS TAKEN
pthread_cond_signal (&aio_request_queue.new_req);
47f62: 4879 0006 35b0 pea 635b0 <aio_request_queue+0x4> <== NOT EXECUTED
47f68: 4bf9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a5 <== NOT EXECUTED
47f6e: 4eb9 0004 8400 jsr 48400 <pthread_cond_signal> <== NOT EXECUTED
47f74: 588f addql #4,%sp <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
47f76: 4879 0006 35ac pea 635ac <aio_request_queue> <== NOT EXECUTED
47f7c: 4e95 jsr %a5@ <== NOT EXECUTED
47f7e: 588f addql #4,%sp <== NOT EXECUTED
47f80: 6000 ff08 braw 47e8a <rtems_aio_enqueue+0xcc> <== NOT EXECUTED
47f84: 4879 0006 35ac pea 635ac <aio_request_queue>
47f8a: 4bf9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a5
47f90: 4e95 jsr %a5@
47f92: 588f addql #4,%sp
47f94: 6000 fef4 braw 47e8a <rtems_aio_enqueue+0xcc>
47f98: 2f0a movel %a2,%sp@-
47f9a: 486b 0008 pea %a3@(8)
47f9e: 4eb9 0004 a534 jsr 4a534 <_Chain_Insert>
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
47fa4: 42ab 0018 clrl %a3@(24)
pthread_mutex_init (&r_chain->mutex, NULL);
47fa8: 42a7 clrl %sp@-
47faa: 486b 001c pea %a3@(28)
47fae: 4eb9 0004 8734 jsr 48734 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
47fb4: 42a7 clrl %sp@-
47fb6: 486b 0020 pea %a3@(32)
47fba: 4eb9 0004 8340 jsr 48340 <pthread_cond_init>
47fc0: 4fef 0018 lea %sp@(24),%sp
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
if (aio_request_queue.idle_threads > 0)
47fc4: 4ab9 0006 3614 tstl 63614 <aio_request_queue+0x68>
47fca: 6e96 bgts 47f62 <rtems_aio_enqueue+0x1a4> <== NEVER TAKEN
47fcc: 60b6 bras 47f84 <rtems_aio_enqueue+0x1c6>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
pthread_mutex_unlock (&aio_request_queue.mutex);
47fce: 4879 0006 35ac pea 635ac <aio_request_queue> <== NOT EXECUTED
47fd4: 2400 movel %d0,%d2 <== NOT EXECUTED
47fd6: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock> <== NOT EXECUTED
47fdc: 588f addql #4,%sp <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
return 0;
}
47fde: 2002 movel %d2,%d0 <== NOT EXECUTED
47fe0: 4cee 3c0c ffc4 moveml %fp@(-60),%d2-%d3/%a2-%a5 <== NOT EXECUTED
47fe6: 4e5e unlk %fp <== NOT EXECUTED
...
000477a4 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
477a4: 4e56 ffac linkw %fp,#-84
477a8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
rtems_aio_request_chain *r_chain = arg;
477ac: 246e 0008 moveal %fp@(8),%a2
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);
477b0: 260e movel %fp,%d3
477b2: 240a movel %a2,%d2
477b4: 280e movel %fp,%d4
477b6: 49f9 0004 8868 lea 48868 <pthread_mutex_lock>,%a4
477bc: 0682 0000 001c addil #28,%d2
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
477c2: 47f9 0004 8904 lea 48904 <pthread_mutex_unlock>,%a3
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
477c8: 2a3c 0004 818c movel #295308,%d5
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);
477ce: 0683 ffff ffe4 addil #-28,%d3
477d4: 0684 ffff ffd8 addil #-40,%d4
/* 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);
477da: 2f02 movel %d2,%sp@-
477dc: 4e94 jsr %a4@
if (result != 0)
477de: 588f addql #4,%sp
477e0: 4a80 tstl %d0
477e2: 6600 009a bnew 4787e <rtems_aio_handle+0xda>
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
477e6: 200a movel %a2,%d0
477e8: 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;
477ee: 2a6a 0008 moveal %a2@(8),%a5
/* 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)) {
477f2: b08d cmpl %a5,%d0
477f4: 6700 00f0 beqw 478e6 <rtems_aio_handle+0x142>
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);
477f8: 2c3c 0004 91cc movel #299468,%d6
477fe: 2046 moveal %d6,%a0
47800: 4e90 jsr %a0@
47802: 2f03 movel %d3,%sp@-
47804: 2f04 movel %d4,%sp@-
47806: 2f00 movel %d0,%sp@-
47808: 4eb9 0004 8d40 jsr 48d40 <pthread_getschedparam>
param.sched_priority = req->priority;
4780e: 2d6d 000c ffe4 movel %a5@(12),%fp@(-28)
pthread_setschedparam (pthread_self(), req->policy, ¶m);
47814: 2246 moveal %d6,%a1
47816: 2e2d 0008 movel %a5@(8),%d7
4781a: 4e91 jsr %a1@
4781c: 2f03 movel %d3,%sp@-
4781e: 2f07 movel %d7,%sp@-
47820: 2f00 movel %d0,%sp@-
47822: 4eb9 0004 91e0 jsr 491e0 <pthread_setschedparam>
47828: 2f0d movel %a5,%sp@-
4782a: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
47830: 2f02 movel %d2,%sp@-
47832: 4e93 jsr %a3@
switch (req->aiocbp->aio_lio_opcode) {
47834: 206d 0014 moveal %a5@(20),%a0
47838: 4fef 0020 lea %sp@(32),%sp
4783c: 7202 moveq #2,%d1
4783e: 2028 002c movel %a0@(44),%d0
47842: b280 cmpl %d0,%d1
47844: 6700 0082 beqw 478c8 <rtems_aio_handle+0x124>
47848: 123c 0003 moveb #3,%d1
4784c: b280 cmpl %d0,%d1
4784e: 676c beqs 478bc <rtems_aio_handle+0x118> <== NEVER TAKEN
47850: 123c 0001 moveb #1,%d1
47854: b280 cmpl %d0,%d1
47856: 6732 beqs 4788a <rtems_aio_handle+0xe6> <== ALWAYS TAKEN
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
47858: 70ff moveq #-1,%d0 <== NOT EXECUTED
4785a: 2140 0034 movel %d0,%a0@(52) <== NOT EXECUTED
req->aiocbp->error_code = errno;
4785e: 2d48 ffd4 movel %a0,%fp@(-44) <== NOT EXECUTED
47862: 4eb9 0005 15f8 jsr 515f8 <__errno> <== NOT EXECUTED
47868: 206e ffd4 moveal %fp@(-44),%a0 <== NOT EXECUTED
4786c: 2240 moveal %d0,%a1 <== NOT EXECUTED
4786e: 2151 0030 movel %a1@,%a0@(48) <== NOT EXECUTED
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
47872: 2f02 movel %d2,%sp@- <== NOT EXECUTED
47874: 4e94 jsr %a4@ <== NOT EXECUTED
if (result != 0)
47876: 588f addql #4,%sp <== NOT EXECUTED
47878: 4a80 tstl %d0 <== NOT EXECUTED
4787a: 6700 ff6a beqw 477e6 <rtems_aio_handle+0x42> <== NOT EXECUTED
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
4787e: 4280 clrl %d0 <== NOT EXECUTED
47880: 4cee 3cfc ffac moveml %fp@(-84),%d2-%d7/%a2-%a5 <== NOT EXECUTED
47886: 4e5e unlk %fp <== NOT EXECUTED
47888: 4e75 rts <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
4788a: 2f28 0008 movel %a0@(8),%sp@-
4788e: 2f28 0004 movel %a0@(4),%sp@-
47892: 2f28 0010 movel %a0@(16),%sp@-
47896: 2f28 000c movel %a0@(12),%sp@-
4789a: 2f10 movel %a0@,%sp@-
4789c: 4eb9 0005 1f90 jsr 51f90 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
478a2: 4fef 0014 lea %sp@(20),%sp
478a6: 206d 0014 moveal %a5@(20),%a0
break;
default:
result = -1;
}
if (result == -1) {
478aa: 72ff moveq #-1,%d1
478ac: b280 cmpl %d0,%d1
478ae: 67a8 beqs 47858 <rtems_aio_handle+0xb4> <== NEVER TAKEN
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
478b0: 2140 0034 movel %d0,%a0@(52)
req->aiocbp->error_code = 0;
478b4: 42a8 0030 clrl %a0@(48)
478b8: 6000 ff20 braw 477da <rtems_aio_handle+0x36>
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
478bc: 2f10 movel %a0@,%sp@- <== NOT EXECUTED
478be: 4eb9 0004 e390 jsr 4e390 <fsync> <== NOT EXECUTED
break;
478c4: 588f addql #4,%sp <== NOT EXECUTED
478c6: 60de bras 478a6 <rtems_aio_handle+0x102> <== NOT EXECUTED
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
478c8: 2f28 0008 movel %a0@(8),%sp@-
478cc: 2f28 0004 movel %a0@(4),%sp@-
478d0: 2f28 0010 movel %a0@(16),%sp@-
478d4: 2f28 000c movel %a0@(12),%sp@-
478d8: 2f10 movel %a0@,%sp@-
478da: 4eb9 0005 2054 jsr 52054 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
478e0: 4fef 0014 lea %sp@(20),%sp
478e4: 60c0 bras 478a6 <rtems_aio_handle+0x102>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
478e6: 2f02 movel %d2,%sp@-
478e8: 4e93 jsr %a3@
pthread_mutex_lock (&aio_request_queue.mutex);
478ea: 4879 0006 35ac pea 635ac <aio_request_queue>
478f0: 4eb9 0004 8868 jsr 48868 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
478f6: 508f addql #8,%sp
478f8: bbea 0008 cmpal %a2@(8),%a5
478fc: 670e beqs 4790c <rtems_aio_handle+0x168> <== ALWAYS TAKEN
}
}
/* 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);
478fe: 4879 0006 35ac pea 635ac <aio_request_queue> <== NOT EXECUTED
47904: 4e93 jsr %a3@ <== NOT EXECUTED
47906: 588f addql #4,%sp <== NOT EXECUTED
47908: 6000 fed0 braw 477da <rtems_aio_handle+0x36> <== NOT EXECUTED
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
4790c: 486e ffdc pea %fp@(-36)
47910: 2045 moveal %d5,%a0
47912: 4878 0001 pea 1 <ADD>
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
47916: 2c0a movel %a2,%d6
47918: 0686 0000 0020 addil #32,%d6
4791e: 2e3c 0004 8480 movel #296064,%d7
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
47924: 4e90 jsr %a0@
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
47926: 486e ffdc pea %fp@(-36)
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
4792a: 56ae ffdc addql #3,%fp@(-36)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
4792e: 2247 moveal %d7,%a1
47930: 4879 0006 35ac pea 635ac <aio_request_queue>
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
47936: 42ae ffe0 clrl %fp@(-32)
result = pthread_cond_timedwait (&r_chain->cond,
4793a: 2f06 movel %d6,%sp@-
4793c: 4e91 jsr %a1@
&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) {
4793e: 4fef 0014 lea %sp@(20),%sp
47942: 7274 moveq #116,%d1
47944: b280 cmpl %d0,%d1
47946: 66b6 bnes 478fe <rtems_aio_handle+0x15a> <== NEVER TAKEN
47948: 2f0a movel %a2,%sp@-
4794a: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
47950: 2f02 movel %d2,%sp@-
47952: 4eb9 0004 85cc jsr 485cc <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
47958: 2f06 movel %d6,%sp@-
4795a: 4eb9 0004 8258 jsr 48258 <pthread_cond_destroy>
free (r_chain);
47960: 2f0a movel %a2,%sp@-
47962: 4eb9 0004 35f8 jsr 435f8 <free>
47968: 2479 0006 3600 moveal 63600 <aio_request_queue+0x54>,%a2
/* 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)) {
4796e: 4fef 0010 lea %sp@(16),%sp
47972: b5fc 0006 3604 cmpal #407044,%a2
47978: 675a beqs 479d4 <rtems_aio_handle+0x230> <== NEVER TAKEN
}
}
/* 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;
4797a: 53b9 0006 3614 subql #1,63614 <aio_request_queue+0x68>
++aio_request_queue.active_threads;
47980: 52b9 0006 3610 addql #1,63610 <aio_request_queue+0x64>
47986: 2f0a movel %a2,%sp@-
47988: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
4798e: 2079 0006 35f4 moveal 635f4 <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 &&
47994: 588f addql #4,%sp
47996: 202a 0014 movel %a2@(20),%d0
4799a: b0a8 0014 cmpl %a0@(20),%d0
4799e: 6f10 bles 479b0 <rtems_aio_handle+0x20c> <== NEVER TAKEN
479a0: b1fc 0006 35f8 cmpal #407032,%a0
479a6: 6708 beqs 479b0 <rtems_aio_handle+0x20c> <== NEVER TAKEN
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
479a8: 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 &&
479aa: b0a8 0014 cmpl %a0@(20),%d0
479ae: 6ef0 bgts 479a0 <rtems_aio_handle+0x1fc>
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
479b0: 2f0a movel %a2,%sp@-
479b2: 2f28 0004 movel %a0@(4),%sp@-
479b6: 240a movel %a2,%d2
479b8: 0682 0000 001c addil #28,%d2
479be: 4eb9 0004 a534 jsr 4a534 <_Chain_Insert>
479c4: 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);
479c6: 4879 0006 35ac pea 635ac <aio_request_queue>
479cc: 4e93 jsr %a3@
479ce: 588f addql #4,%sp
479d0: 6000 fe08 braw 477da <rtems_aio_handle+0x36>
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;
clock_gettime (CLOCK_REALTIME, &timeout);
479d4: 486e ffdc pea %fp@(-36)
/* 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;
479d8: 52b9 0006 3614 addql #1,63614 <aio_request_queue+0x68>
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
479de: 2045 moveal %d5,%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;
479e0: 53b9 0006 3610 subql #1,63610 <aio_request_queue+0x64>
clock_gettime (CLOCK_REALTIME, &timeout);
479e6: 4878 0001 pea 1 <ADD>
479ea: 4e90 jsr %a0@
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
479ec: 486e ffdc pea %fp@(-36)
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
479f0: 56ae ffdc addql #3,%fp@(-36)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
479f4: 2247 moveal %d7,%a1
479f6: 4879 0006 35ac pea 635ac <aio_request_queue>
479fc: 4879 0006 35b0 pea 635b0 <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;
47a02: 42ae ffe0 clrl %fp@(-32)
result = pthread_cond_timedwait (&aio_request_queue.new_req,
47a06: 4e91 jsr %a1@
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
47a08: 4fef 0014 lea %sp@(20),%sp
47a0c: 7274 moveq #116,%d1
47a0e: b280 cmpl %d0,%d1
47a10: 6732 beqs 47a44 <rtems_aio_handle+0x2a0> <== ALWAYS TAKEN
47a12: 2479 0006 3600 moveal 63600 <aio_request_queue+0x54>,%a2 <== NOT EXECUTED
}
}
/* 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;
47a18: 53b9 0006 3614 subql #1,63614 <aio_request_queue+0x68> <== NOT EXECUTED
++aio_request_queue.active_threads;
47a1e: 52b9 0006 3610 addql #1,63610 <aio_request_queue+0x64> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
47a24: 2f0a movel %a2,%sp@- <== NOT EXECUTED
47a26: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract> <== NOT EXECUTED
47a2c: 2079 0006 35f4 moveal 635f4 <aio_request_queue+0x48>,%a0 <== NOT EXECUTED
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 &&
47a32: 588f addql #4,%sp <== NOT EXECUTED
47a34: 202a 0014 movel %a2@(20),%d0 <== NOT EXECUTED
47a38: b0a8 0014 cmpl %a0@(20),%d0 <== NOT EXECUTED
47a3c: 6e00 ff62 bgtw 479a0 <rtems_aio_handle+0x1fc> <== NOT EXECUTED
47a40: 6000 ff6e braw 479b0 <rtems_aio_handle+0x20c> <== NOT EXECUTED
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
pthread_mutex_unlock (&aio_request_queue.mutex);
47a44: 4879 0006 35ac pea 635ac <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;
47a4a: 53b9 0006 3614 subql #1,63614 <aio_request_queue+0x68>
pthread_mutex_unlock (&aio_request_queue.mutex);
47a50: 4eb9 0004 8904 jsr 48904 <pthread_mutex_unlock>
47a56: 588f addql #4,%sp
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
47a58: 4280 clrl %d0
47a5a: 4cee 3cfc ffac moveml %fp@(-84),%d2-%d7/%a2-%a5
47a60: 4e5e unlk %fp <== NOT EXECUTED
00047ab4 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
47ab4: 4e56 0000 linkw %fp,#0
47ab8: 2f02 movel %d2,%sp@-
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
47aba: 4879 0006 35b4 pea 635b4 <aio_request_queue+0x8>
47ac0: 4eb9 0004 8a70 jsr 48a70 <pthread_attr_init>
if (result != 0)
47ac6: 588f addql #4,%sp
int
rtems_aio_init (void)
{
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
47ac8: 2400 movel %d0,%d2
if (result != 0)
47aca: 670a beqs 47ad6 <rtems_aio_init+0x22> <== ALWAYS TAKEN
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
return result;
}
47acc: 2002 movel %d2,%d0 <== NOT EXECUTED
47ace: 242e fffc movel %fp@(-4),%d2 <== NOT EXECUTED
47ad2: 4e5e unlk %fp <== NOT EXECUTED
47ad4: 4e75 rts <== NOT EXECUTED
result = pthread_attr_init (&aio_request_queue.attr);
if (result != 0)
return result;
result =
47ad6: 42a7 clrl %sp@-
47ad8: 4879 0006 35b4 pea 635b4 <aio_request_queue+0x8>
47ade: 4eb9 0004 8a9c jsr 48a9c <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
47ae4: 508f addql #8,%sp
47ae6: 4a80 tstl %d0
47ae8: 6600 0122 bnew 47c0c <rtems_aio_init+0x158>
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
47aec: 42a7 clrl %sp@-
47aee: 4879 0006 35ac pea 635ac <aio_request_queue>
47af4: 4eb9 0004 8734 jsr 48734 <pthread_mutex_init>
if (result != 0)
47afa: 508f addql #8,%sp
47afc: 4a80 tstl %d0
47afe: 6600 00e4 bnew 47be4 <rtems_aio_init+0x130>
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
47b02: 42a7 clrl %sp@-
47b04: 4879 0006 35b0 pea 635b0 <aio_request_queue+0x4>
47b0a: 4eb9 0004 8340 jsr 48340 <pthread_cond_init>
if (result != 0) {
47b10: 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);
47b12: 2400 movel %d0,%d2
if (result != 0) {
47b14: 665e bnes 47b74 <rtems_aio_init+0xc0> <== NEVER TAKEN
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
47b16: 42b9 0006 35f8 clrl 635f8 <aio_request_queue+0x4c>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
47b1c: 203c 0006 35f8 movel #407032,%d0
47b22: 23c0 0006 35f4 movel %d0,635f4 <aio_request_queue+0x48>
head->previous = NULL;
tail->previous = head;
47b28: 203c 0006 35f4 movel #407028,%d0
47b2e: 23c0 0006 35fc movel %d0,635fc <aio_request_queue+0x50>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
47b34: 203c 0006 3604 movel #407044,%d0
47b3a: 23c0 0006 3600 movel %d0,63600 <aio_request_queue+0x54>
head->previous = NULL;
tail->previous = head;
47b40: 203c 0006 3600 movel #407040,%d0
47b46: 23c0 0006 3608 movel %d0,63608 <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;
47b4c: 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;
47b52: 42b9 0006 3604 clrl 63604 <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;
47b58: 42b9 0006 3610 clrl 63610 <aio_request_queue+0x64>
aio_request_queue.idle_threads = 0;
47b5e: 42b9 0006 3614 clrl 63614 <aio_request_queue+0x68>
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
47b64: 23c0 0006 360c movel %d0,6360c <aio_request_queue+0x60>
return result;
}
47b6a: 2002 movel %d2,%d0
47b6c: 242e fffc movel %fp@(-4),%d2
47b70: 4e5e unlk %fp
47b72: 4e75 rts
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
if (result != 0) {
pthread_mutex_destroy (&aio_request_queue.mutex);
47b74: 4879 0006 35ac pea 635ac <aio_request_queue> <== NOT EXECUTED
47b7a: 4eb9 0004 85cc jsr 485cc <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
47b80: 4879 0006 35b4 pea 635b4 <aio_request_queue+0x8> <== NOT EXECUTED
47b86: 4eb9 0004 8a50 jsr 48a50 <pthread_attr_destroy> <== NOT EXECUTED
47b8c: 508f addql #8,%sp <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
47b8e: 203c 0006 35f8 movel #407032,%d0 <== NOT EXECUTED
47b94: 23c0 0006 35f4 movel %d0,635f4 <aio_request_queue+0x48> <== NOT EXECUTED
head->previous = NULL;
tail->previous = head;
47b9a: 203c 0006 35f4 movel #407028,%d0 <== NOT EXECUTED
47ba0: 23c0 0006 35fc movel %d0,635fc <aio_request_queue+0x50> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
47ba6: 203c 0006 3604 movel #407044,%d0 <== NOT EXECUTED
47bac: 23c0 0006 3600 movel %d0,63600 <aio_request_queue+0x54> <== NOT EXECUTED
head->previous = NULL;
tail->previous = head;
47bb2: 203c 0006 3600 movel #407040,%d0 <== NOT EXECUTED
47bb8: 23c0 0006 3608 movel %d0,63608 <aio_request_queue+0x5c> <== NOT EXECUTED
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;
47bbe: 203c 0000 b00b movel #45067,%d0 <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
47bc4: 42b9 0006 35f8 clrl 635f8 <aio_request_queue+0x4c> <== NOT EXECUTED
47bca: 42b9 0006 3604 clrl 63604 <aio_request_queue+0x58> <== NOT EXECUTED
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
47bd0: 42b9 0006 3610 clrl 63610 <aio_request_queue+0x64> <== NOT EXECUTED
aio_request_queue.idle_threads = 0;
47bd6: 42b9 0006 3614 clrl 63614 <aio_request_queue+0x68> <== NOT EXECUTED
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
47bdc: 23c0 0006 360c movel %d0,6360c <aio_request_queue+0x60> <== NOT EXECUTED
47be2: 6086 bras 47b6a <rtems_aio_init+0xb6> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
47be4: 4879 0006 35b4 pea 635b4 <aio_request_queue+0x8> <== NOT EXECUTED
47bea: 4eb9 0004 8a50 jsr 48a50 <pthread_attr_destroy> <== NOT EXECUTED
47bf0: 588f addql #4,%sp <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
47bf2: 42a7 clrl %sp@- <== NOT EXECUTED
47bf4: 4879 0006 35b0 pea 635b0 <aio_request_queue+0x4> <== NOT EXECUTED
47bfa: 4eb9 0004 8340 jsr 48340 <pthread_cond_init> <== NOT EXECUTED
if (result != 0) {
47c00: 508f addql #8,%sp <== NOT EXECUTED
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);
47c02: 2400 movel %d0,%d2 <== NOT EXECUTED
if (result != 0) {
47c04: 6700 ff10 beqw 47b16 <rtems_aio_init+0x62> <== NOT EXECUTED
47c08: 6000 ff6a braw 47b74 <rtems_aio_init+0xc0> <== NOT EXECUTED
result =
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
47c0c: 4879 0006 35b4 pea 635b4 <aio_request_queue+0x8> <== NOT EXECUTED
47c12: 4eb9 0004 8a50 jsr 48a50 <pthread_attr_destroy> <== NOT EXECUTED
47c18: 588f addql #4,%sp <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
47c1a: 42a7 clrl %sp@- <== NOT EXECUTED
47c1c: 4879 0006 35ac pea 635ac <aio_request_queue> <== NOT EXECUTED
47c22: 4eb9 0004 8734 jsr 48734 <pthread_mutex_init> <== NOT EXECUTED
if (result != 0)
47c28: 508f addql #8,%sp <== NOT EXECUTED
47c2a: 4a80 tstl %d0 <== NOT EXECUTED
47c2c: 6700 fed4 beqw 47b02 <rtems_aio_init+0x4e> <== NOT EXECUTED
47c30: 60b2 bras 47be4 <rtems_aio_init+0x130> <== NOT EXECUTED
00047a64 <rtems_aio_insert_prio>:
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
47a64: 4e56 fff4 linkw %fp,#-12
47a68: 202e 0008 movel %fp@(8),%d0
47a6c: 48d7 1c00 moveml %a2-%a4,%sp@
47a70: 2440 moveal %d0,%a2
47a72: 266e 000c moveal %fp@(12),%a3
47a76: 205a moveal %a2@+,%a0
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
47a78: b5c8 cmpal %a0,%a2
47a7a: 672c beqs 47aa8 <rtems_aio_insert_prio+0x44> <== NEVER TAKEN
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 &&
47a7c: 286b 0014 moveal %a3@(20),%a4
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
47a80: 2268 0014 moveal %a0@(20),%a1
while (req->aiocbp->aio_reqprio > prio &&
47a84: 202c 0014 movel %a4@(20),%d0
47a88: b0a9 0014 cmpl %a1@(20),%d0
47a8c: 6f10 bles 47a9e <rtems_aio_insert_prio+0x3a> <== ALWAYS TAKEN
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
47a8e: 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;
47a90: 2268 0014 moveal %a0@(20),%a1 <== 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 &&
47a94: b0a9 0014 cmpl %a1@(20),%d0 <== NOT EXECUTED
47a98: 6f04 bles 47a9e <rtems_aio_insert_prio+0x3a> <== NOT EXECUTED
47a9a: b1ca cmpal %a2,%a0 <== NOT EXECUTED
47a9c: 66f0 bnes 47a8e <rtems_aio_insert_prio+0x2a> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
47a9e: 2d4b 000c movel %a3,%fp@(12)
47aa2: 2d68 0004 0008 movel %a0@(4),%fp@(8)
}
rtems_chain_insert (node->previous, &req->next_prio);
}
}
47aa8: 4cd7 1c00 moveml %sp@,%a2-%a4
47aac: 4e5e unlk %fp
47aae: 4ef9 0004 a534 jmp 4a534 <_Chain_Insert>
00047d02 <rtems_aio_remove_fd>:
* Output parameters:
* NONE
*/
void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain)
{
47d02: 4e56 fff0 linkw %fp,#-16
47d06: 206e 0008 moveal %fp@(8),%a0
47d0a: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_tail( the_chain ));
47d0e: 2408 movel %a0,%d2
47d10: 0682 0000 000c addil #12,%d2
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
47d16: 2468 0008 moveal %a0@(8),%a2
rtems_chain_control *chain;
rtems_chain_node *node;
chain = &r_chain->perfd;
node = rtems_chain_first (chain);
while (!rtems_chain_is_tail (chain, node))
47d1a: b48a cmpl %a2,%d2
47d1c: 6732 beqs 47d50 <rtems_aio_remove_fd+0x4e> <== NEVER TAKEN
47d1e: 49f9 0004 a4d0 lea 4a4d0 <_Chain_Extract>,%a4
47d24: 47f9 0004 35f8 lea 435f8 <free>,%a3
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
47d2a: 2f0a movel %a2,%sp@-
47d2c: 4e94 jsr %a4@
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
47d2e: 2012 movel %a2@,%d0
while (!rtems_chain_is_tail (chain, node))
{
rtems_chain_extract (node);
rtems_aio_request *req = (rtems_aio_request *) node;
node = rtems_chain_next (node);
req->aiocbp->error_code = ECANCELED;
47d30: 223c 0000 008c movel #140,%d1
47d36: 206a 0014 moveal %a2@(20),%a0
47d3a: 2141 0030 movel %d1,%a0@(48)
req->aiocbp->return_value = -1;
47d3e: 72ff moveq #-1,%d1
47d40: 2141 0034 movel %d1,%a0@(52)
free (req);
47d44: 2f0a movel %a2,%sp@-
while (!rtems_chain_is_tail (chain, node))
{
rtems_chain_extract (node);
rtems_aio_request *req = (rtems_aio_request *) node;
node = rtems_chain_next (node);
47d46: 2440 moveal %d0,%a2
req->aiocbp->error_code = ECANCELED;
req->aiocbp->return_value = -1;
free (req);
47d48: 4e93 jsr %a3@
rtems_chain_control *chain;
rtems_chain_node *node;
chain = &r_chain->perfd;
node = rtems_chain_first (chain);
while (!rtems_chain_is_tail (chain, node))
47d4a: 508f addql #8,%sp
47d4c: b48a cmpl %a2,%d2
47d4e: 66da bnes 47d2a <rtems_aio_remove_fd+0x28>
node = rtems_chain_next (node);
req->aiocbp->error_code = ECANCELED;
req->aiocbp->return_value = -1;
free (req);
}
}
47d50: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
47d56: 4e5e unlk %fp <== NOT EXECUTED
00047d5a <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)
{
47d5a: 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;
47d5e: 206e 0008 moveal %fp@(8),%a0
47d62: 2f0a movel %a2,%sp@-
47d64: 202e 000c movel %fp@(12),%d0
47d68: 2458 moveal %a0@+,%a2
if (rtems_chain_is_empty (chain))
47d6a: b1ca cmpal %a2,%a0
47d6c: 6716 beqs 47d84 <rtems_aio_remove_req+0x2a>
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) {
47d6e: b0aa 0014 cmpl %a2@(20),%d0
47d72: 671a beqs 47d8e <rtems_aio_remove_req+0x34> <== ALWAYS TAKEN
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
47d74: 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) {
47d76: b5c8 cmpal %a0,%a2 <== NOT EXECUTED
47d78: 66f4 bnes 47d6e <rtems_aio_remove_req+0x14> <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
47d7a: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
47d7e: 7001 moveq #1,%d0 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
47d80: 4e5e unlk %fp <== NOT EXECUTED
47d82: 4e75 rts <== NOT EXECUTED
47d84: 246e fffc moveal %fp@(-4),%a2
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
return AIO_ALLDONE;
47d88: 7002 moveq #2,%d0
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
47d8a: 4e5e unlk %fp
47d8c: 4e75 rts
47d8e: 2f0a movel %a2,%sp@-
47d90: 4eb9 0004 a4d0 jsr 4a4d0 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
47d96: 206a 0014 moveal %a2@(20),%a0
47d9a: 203c 0000 008c movel #140,%d0
47da0: 2140 0030 movel %d0,%a0@(48)
current->aiocbp->return_value = -1;
47da4: 70ff moveq #-1,%d0
47da6: 2140 0034 movel %d0,%a0@(52)
free (current);
47daa: 2f0a movel %a2,%sp@-
47dac: 4eb9 0004 35f8 jsr 435f8 <free>
}
return AIO_CANCELED;
}
47db2: 246e fffc moveal %fp@(-4),%a2
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
47db6: 508f addql #8,%sp
47db8: 4280 clrl %d0
}
47dba: 4e5e unlk %fp <== NOT EXECUTED
00047ee0 <rtems_chain_append_with_notification>:
rtems_chain_control *chain,
rtems_chain_node *node,
rtems_id task,
rtems_event_set events
)
{
47ee0: 4e56 0000 linkw %fp,#0
47ee4: 2f03 movel %d3,%sp@-
47ee6: 262e 0014 movel %fp@(20),%d3
47eea: 2f02 movel %d2,%sp@-
RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check(
rtems_chain_control *chain,
rtems_chain_node *node
)
{
return _Chain_Append_with_empty_check( chain, node );
47eec: 2f2e 000c movel %fp@(12),%sp@-
47ef0: 2f2e 0008 movel %fp@(8),%sp@-
47ef4: 242e 0010 movel %fp@(16),%d2
47ef8: 4eb9 0004 84f0 jsr 484f0 <_Chain_Append_with_empty_check>
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_append_with_empty_check( chain, node );
if ( was_empty ) {
47efe: 508f addql #8,%sp
47f00: 4a00 tstb %d0
47f02: 660e bnes 47f12 <rtems_chain_append_with_notification+0x32>
sc = rtems_event_send( task, events );
}
return sc;
}
47f04: 242e fff8 movel %fp@(-8),%d2
47f08: 4280 clrl %d0
47f0a: 262e fffc movel %fp@(-4),%d3
47f0e: 4e5e unlk %fp
47f10: 4e75 rts
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_append_with_empty_check( chain, node );
if ( was_empty ) {
sc = rtems_event_send( task, events );
47f12: 2d43 000c movel %d3,%fp@(12)
}
return sc;
}
47f16: 262e fffc movel %fp@(-4),%d3
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_append_with_empty_check( chain, node );
if ( was_empty ) {
sc = rtems_event_send( task, events );
47f1a: 2d42 0008 movel %d2,%fp@(8)
}
return sc;
}
47f1e: 242e fff8 movel %fp@(-8),%d2
47f22: 4e5e unlk %fp
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_append_with_empty_check( chain, node );
if ( was_empty ) {
sc = rtems_event_send( task, events );
47f24: 4ef9 0004 73ac jmp 473ac <rtems_event_send>
...
00047f2c <rtems_chain_get_with_notification>:
rtems_chain_control *chain,
rtems_id task,
rtems_event_set events,
rtems_chain_node **node
)
{
47f2c: 4e56 0000 linkw %fp,#0
47f30: 2f03 movel %d3,%sp@-
47f32: 262e 0010 movel %fp@(16),%d3
47f36: 2f02 movel %d2,%sp@-
RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check(
rtems_chain_control *chain,
rtems_chain_node **node
)
{
return _Chain_Get_with_empty_check( chain, node );
47f38: 2f2e 0014 movel %fp@(20),%sp@-
47f3c: 2f2e 0008 movel %fp@(8),%sp@-
47f40: 242e 000c movel %fp@(12),%d2
47f44: 4eb9 0004 8568 jsr 48568 <_Chain_Get_with_empty_check>
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool is_empty = rtems_chain_get_with_empty_check( chain, node );
if ( is_empty ) {
47f4a: 508f addql #8,%sp
47f4c: 4a00 tstb %d0
47f4e: 660e bnes 47f5e <rtems_chain_get_with_notification+0x32>
sc = rtems_event_send( task, events );
}
return sc;
}
47f50: 242e fff8 movel %fp@(-8),%d2
47f54: 4280 clrl %d0
47f56: 262e fffc movel %fp@(-4),%d3
47f5a: 4e5e unlk %fp
47f5c: 4e75 rts
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool is_empty = rtems_chain_get_with_empty_check( chain, node );
if ( is_empty ) {
sc = rtems_event_send( task, events );
47f5e: 2d43 000c movel %d3,%fp@(12)
}
return sc;
}
47f62: 262e fffc movel %fp@(-4),%d3
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool is_empty = rtems_chain_get_with_empty_check( chain, node );
if ( is_empty ) {
sc = rtems_event_send( task, events );
47f66: 2d42 0008 movel %d2,%fp@(8)
}
return sc;
}
47f6a: 242e fff8 movel %fp@(-8),%d2
47f6e: 4e5e unlk %fp
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool is_empty = rtems_chain_get_with_empty_check( chain, node );
if ( is_empty ) {
sc = rtems_event_send( task, events );
47f70: 4ef9 0004 73ac jmp 473ac <rtems_event_send>
...
00047f78 <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
47f78: 4e56 ffe0 linkw %fp,#-32
47f7c: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
47f80: 2c0e movel %fp,%d6
47f82: 45f9 0004 85b4 lea 485b4 <_Chain_Get>,%a2
47f88: 5986 subql #4,%d6
47f8a: 47f9 0004 7200 lea 47200 <rtems_event_receive>,%a3
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
47f90: 262e 0008 movel %fp@(8),%d3
47f94: 2a2e 000c movel %fp@(12),%d5
47f98: 282e 0010 movel %fp@(16),%d4
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
47f9c: 2f03 movel %d3,%sp@-
47f9e: 4e92 jsr %a2@
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
47fa0: 588f addql #4,%sp
47fa2: 2400 movel %d0,%d2
47fa4: 6622 bnes 47fc8 <rtems_chain_get_with_wait+0x50>
) {
rtems_event_set out;
sc = rtems_event_receive(
47fa6: 2f06 movel %d6,%sp@-
47fa8: 2f04 movel %d4,%sp@-
47faa: 42a7 clrl %sp@-
47fac: 2f05 movel %d5,%sp@-
47fae: 4e93 jsr %a3@
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
47fb0: 4fef 0010 lea %sp@(16),%sp
47fb4: 4a80 tstl %d0
47fb6: 67e4 beqs 47f9c <rtems_chain_get_with_wait+0x24> <== NEVER TAKEN
timeout,
&out
);
}
*node_ptr = node;
47fb8: 206e 0014 moveal %fp@(20),%a0
47fbc: 2082 movel %d2,%a0@
return sc;
}
47fbe: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3
47fc4: 4e5e unlk %fp
47fc6: 4e75 rts
timeout,
&out
);
}
*node_ptr = node;
47fc8: 206e 0014 moveal %fp@(20),%a0
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
47fcc: 4280 clrl %d0
timeout,
&out
);
}
*node_ptr = node;
47fce: 2082 movel %d2,%a0@
return sc;
}
47fd0: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3
47fd6: 4e5e unlk %fp
...
00047fdc <rtems_chain_prepend_with_notification>:
rtems_chain_control *chain,
rtems_chain_node *node,
rtems_id task,
rtems_event_set events
)
{
47fdc: 4e56 0000 linkw %fp,#0
47fe0: 2f03 movel %d3,%sp@-
47fe2: 262e 0014 movel %fp@(20),%d3
47fe6: 2f02 movel %d2,%sp@-
RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check(
rtems_chain_control *chain,
rtems_chain_node *node
)
{
return _Chain_Prepend_with_empty_check( chain, node );
47fe8: 2f2e 000c movel %fp@(12),%sp@-
47fec: 2f2e 0008 movel %fp@(8),%sp@-
47ff0: 242e 0010 movel %fp@(16),%d2
47ff4: 4eb9 0004 8688 jsr 48688 <_Chain_Prepend_with_empty_check>
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_prepend_with_empty_check( chain, node );
if (was_empty) {
47ffa: 508f addql #8,%sp
47ffc: 4a00 tstb %d0
47ffe: 660e bnes 4800e <rtems_chain_prepend_with_notification+0x32>
sc = rtems_event_send( task, events );
}
return sc;
}
48000: 242e fff8 movel %fp@(-8),%d2
48004: 4280 clrl %d0
48006: 262e fffc movel %fp@(-4),%d3
4800a: 4e5e unlk %fp
4800c: 4e75 rts
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_prepend_with_empty_check( chain, node );
if (was_empty) {
sc = rtems_event_send( task, events );
4800e: 2d43 000c movel %d3,%fp@(12)
}
return sc;
}
48012: 262e fffc movel %fp@(-4),%d3
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_prepend_with_empty_check( chain, node );
if (was_empty) {
sc = rtems_event_send( task, events );
48016: 2d42 0008 movel %d2,%fp@(8)
}
return sc;
}
4801a: 242e fff8 movel %fp@(-8),%d2
4801e: 4e5e unlk %fp
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool was_empty = rtems_chain_prepend_with_empty_check( chain, node );
if (was_empty) {
sc = rtems_event_send( task, events );
48020: 4ef9 0004 73ac jmp 473ac <rtems_event_send>
...
000511a4 <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
511a4: 4e56 0000 linkw %fp,#0
511a8: 206e 0014 moveal %fp@(20),%a0
511ac: 2f0a movel %a2,%sp@-
rtems_status_code sc;
if ( event_out != NULL ) {
511ae: 4a88 tstl %a0
511b0: 671e beqs 511d0 <rtems_event_system_receive+0x2c><== NEVER TAKEN
Thread_Control *executing = _Thread_Executing;
511b2: 2479 0006 5a02 moveal 65a02 <_Per_CPU_Information+0xe>,%a2
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
511b8: 226a 00fa moveal %a2@(250),%a1
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
511bc: 4aae 0008 tstl %fp@(8)
511c0: 6618 bnes 511da <rtems_event_system_receive+0x36><== ALWAYS TAKEN
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
511c2: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
_Thread_Enable_dispatch();
sc = executing->Wait.return_code;
} else {
*event_out = event->pending_events;
sc = RTEMS_SUCCESSFUL;
511c6: 4280 clrl %d0 <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
511c8: 4e5e unlk %fp <== NOT EXECUTED
);
_Thread_Enable_dispatch();
sc = executing->Wait.return_code;
} else {
*event_out = event->pending_events;
511ca: 20a9 0004 movel %a1@(4),%a0@ <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
511ce: 4e75 rts <== NOT EXECUTED
511d0: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
} else {
*event_out = event->pending_events;
sc = RTEMS_SUCCESSFUL;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
511d4: 7009 moveq #9,%d0 <== NOT EXECUTED
}
return sc;
}
511d6: 4e5e unlk %fp <== NOT EXECUTED
511d8: 4e75 rts <== NOT EXECUTED
*
* 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;
511da: 2039 0006 55ba movel 655ba <_Thread_Dispatch_disable_level>,%d0
++level;
511e0: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
511e2: 23c0 0006 55ba movel %d0,655ba <_Thread_Dispatch_disable_level>
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
_Thread_Disable_dispatch();
_Event_Seize(
511e8: 2f3c 0004 0000 movel #262144,%sp@-
511ee: 4879 0006 5ddc pea 65ddc <_System_event_Sync_state>
511f4: 4869 0004 pea %a1@(4)
511f8: 2f0a movel %a2,%sp@-
511fa: 2f08 movel %a0,%sp@-
511fc: 2f2e 0010 movel %fp@(16),%sp@-
51200: 2f2e 000c movel %fp@(12),%sp@-
51204: 2f2e 0008 movel %fp@(8),%sp@-
51208: 4eb9 0004 861c jsr 4861c <_Event_Seize>
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
5120e: 4fef 0020 lea %sp@(32),%sp
51212: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
sc = executing->Wait.return_code;
51218: 202a 0034 movel %a2@(52),%d0
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
5121c: 246e fffc moveal %fp@(-4),%a2
51220: 4e5e unlk %fp <== NOT EXECUTED
00047670 <rtems_event_system_send>:
rtems_status_code rtems_event_system_send(
rtems_id id,
rtems_event_set event_in
)
{
47670: 4e56 fffc linkw %fp,#-4
rtems_status_code sc;
Thread_Control *thread;
Objects_Locations location;
RTEMS_API_Control *api;
thread = _Thread_Get( id, &location );
47674: 486e fffc pea %fp@(-4)
47678: 2f2e 0008 movel %fp@(8),%sp@-
4767c: 4eb9 0004 9cf0 jsr 49cf0 <_Thread_Get>
switch ( location ) {
47682: 508f addql #8,%sp
47684: 4aae fffc tstl %fp@(-4)
47688: 6632 bnes 476bc <rtems_event_system_send+0x4c> <== NEVER TAKEN
case OBJECTS_LOCAL:
api = thread->API_Extensions[ THREAD_API_RTEMS ];
_Event_Surrender(
4768a: 2040 moveal %d0,%a0
4768c: 2f3c 0004 0000 movel #262144,%sp@-
47692: 4879 0006 1808 pea 61808 <_System_event_Sync_state>
47698: 2228 00fa movel %a0@(250),%d1
4769c: 5881 addql #4,%d1
4769e: 2f01 movel %d1,%sp@-
476a0: 2f2e 000c movel %fp@(12),%sp@-
476a4: 2f00 movel %d0,%sp@-
476a6: 4eb9 0004 6fa8 jsr 46fa8 <_Event_Surrender>
event_in,
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
476ac: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
sc = RTEMS_SUCCESSFUL;
break;
476b2: 4fef 0014 lea %sp@(20),%sp
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
sc = RTEMS_SUCCESSFUL;
476b6: 4280 clrl %d0
sc = RTEMS_INVALID_ID;
break;
}
return sc;
}
476b8: 4e5e unlk %fp
476ba: 4e75 rts
case OBJECTS_REMOTE:
sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
break;
#endif
default:
sc = RTEMS_INVALID_ID;
476bc: 7004 moveq #4,%d0 <== NOT EXECUTED
break;
}
return sc;
}
476be: 4e5e unlk %fp <== NOT EXECUTED
...
0004d87c <rtems_extension_delete>:
#include <rtems/extension.h>
rtems_status_code rtems_extension_delete(
rtems_id id
)
{
4d87c: 4e56 fffc linkw %fp,#-4
4d880: 2f0a movel %a2,%sp@-
RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Extension_Control *)
4d882: 486e fffc pea %fp@(-4)
4d886: 2f2e 0008 movel %fp@(8),%sp@-
4d88a: 4879 0006 f6c6 pea 6f6c6 <_Extension_Information>
4d890: 4eb9 0004 ec10 jsr 4ec10 <_Objects_Get>
Extension_Control *the_extension;
Objects_Locations location;
the_extension = _Extension_Get( id, &location );
switch ( location ) {
4d896: 4fef 000c lea %sp@(12),%sp
4d89a: 2440 moveal %d0,%a2
4d89c: 4aae fffc tstl %fp@(-4)
4d8a0: 663a bnes 4d8dc <rtems_extension_delete+0x60> <== NEVER TAKEN
case OBJECTS_LOCAL:
_User_extensions_Remove_set( &the_extension->Extension );
4d8a2: 486a 0010 pea %a2@(16)
4d8a6: 4eb9 0005 0720 jsr 50720 <_User_extensions_Remove_set>
_Objects_Close( &_Extension_Information, &the_extension->Object );
4d8ac: 2f0a movel %a2,%sp@-
4d8ae: 4879 0006 f6c6 pea 6f6c6 <_Extension_Information>
4d8b4: 4eb9 0004 e7a8 jsr 4e7a8 <_Objects_Close>
RTEMS_INLINE_ROUTINE void _Extension_Free (
Extension_Control *the_extension
)
{
_Objects_Free( &_Extension_Information, &the_extension->Object );
4d8ba: 2f0a movel %a2,%sp@-
4d8bc: 4879 0006 f6c6 pea 6f6c6 <_Extension_Information>
4d8c2: 4eb9 0004 ea90 jsr 4ea90 <_Objects_Free>
_Extension_Free( the_extension );
_Thread_Enable_dispatch();
4d8c8: 4eb9 0004 fa3c jsr 4fa3c <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4d8ce: 246e fff8 moveal %fp@(-8),%a2
switch ( location ) {
case OBJECTS_LOCAL:
_User_extensions_Remove_set( &the_extension->Extension );
_Objects_Close( &_Extension_Information, &the_extension->Object );
_Extension_Free( the_extension );
_Thread_Enable_dispatch();
4d8d2: 4fef 0014 lea %sp@(20),%sp
return RTEMS_SUCCESSFUL;
4d8d6: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4d8d8: 4e5e unlk %fp
4d8da: 4e75 rts
4d8dc: 246e fff8 moveal %fp@(-8),%a2
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
4d8e0: 7004 moveq #4,%d0
}
4d8e2: 4e5e unlk %fp
...
000494e0 <rtems_io_register_driver>:
rtems_status_code rtems_io_register_driver(
rtems_device_major_number major,
const rtems_driver_address_table *driver_table,
rtems_device_major_number *registered_major
)
{
494e0: 4e56 0000 linkw %fp,#0
494e4: 226e 000c moveal %fp@(12),%a1
494e8: 2f0a movel %a2,%sp@-
494ea: 206e 0010 moveal %fp@(16),%a0
494ee: 2f02 movel %d2,%sp@-
494f0: 242e 0008 movel %fp@(8),%d2
rtems_device_major_number major_limit = _IO_Number_of_drivers;
494f4: 2039 0006 5e1e movel 65e1e <_IO_Number_of_drivers>,%d0
if ( rtems_interrupt_is_in_progress() )
494fa: 4ab9 0006 59fc tstl 659fc <_Per_CPU_Information+0x8>
49500: 670e beqs 49510 <rtems_io_register_driver+0x30>
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49502: 242e fff8 movel %fp@(-8),%d2
)
{
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
49506: 7012 moveq #18,%d0
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49508: 246e fffc moveal %fp@(-4),%a2
4950c: 4e5e unlk %fp
4950e: 4e75 rts
rtems_device_major_number major_limit = _IO_Number_of_drivers;
if ( rtems_interrupt_is_in_progress() )
return RTEMS_CALLED_FROM_ISR;
if ( registered_major == NULL )
49510: 4a88 tstl %a0
49512: 6722 beqs 49536 <rtems_io_register_driver+0x56>
return RTEMS_INVALID_ADDRESS;
/* Set it to an invalid value */
*registered_major = major_limit;
49514: 2080 movel %d0,%a0@
if ( driver_table == NULL )
49516: 4a89 tstl %a1
49518: 671c beqs 49536 <rtems_io_register_driver+0x56>
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
4951a: 4a91 tstl %a1@
4951c: 6712 beqs 49530 <rtems_io_register_driver+0x50>
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
4951e: b480 cmpl %d0,%d2
49520: 6522 bcss 49544 <rtems_io_register_driver+0x64>
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49522: 242e fff8 movel %fp@(-8),%d2
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
49526: 700a moveq #10,%d0
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49528: 246e fffc moveal %fp@(-4),%a2
4952c: 4e5e unlk %fp
4952e: 4e75 rts
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
49530: 4aa9 0004 tstl %a1@(4)
49534: 66e8 bnes 4951e <rtems_io_register_driver+0x3e>
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49536: 242e fff8 movel %fp@(-8),%d2
if ( driver_table == NULL )
return RTEMS_INVALID_ADDRESS;
if ( rtems_io_is_empty_table( driver_table ) )
return RTEMS_INVALID_ADDRESS;
4953a: 7009 moveq #9,%d0
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
4953c: 246e fffc moveal %fp@(-4),%a2
49540: 4e5e unlk %fp
49542: 4e75 rts
*
* 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;
49544: 2039 0006 55ba movel 655ba <_Thread_Dispatch_disable_level>,%d0
++level;
4954a: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
4954c: 23c0 0006 55ba movel %d0,655ba <_Thread_Dispatch_disable_level>
if ( major >= major_limit )
return RTEMS_INVALID_NUMBER;
_Thread_Disable_dispatch();
if ( major == 0 ) {
49552: 4a82 tstl %d2
49554: 676a beqs 495c0 <rtems_io_register_driver+0xe0>
_Thread_Enable_dispatch();
return sc;
}
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
49556: 2202 movel %d2,%d1
49558: 2002 movel %d2,%d0
4955a: e789 lsll #3,%d1
4955c: eb88 lsll #5,%d0
4955e: 2479 0006 5e22 moveal 65e22 <_IO_Driver_address_table>,%a2
49564: 9081 subl %d1,%d0
49566: d5c0 addal %d0,%a2
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
49568: 4a92 tstl %a2@
4956a: 6714 beqs 49580 <rtems_io_register_driver+0xa0>
major = *registered_major;
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
4956c: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49572: 242e fff8 movel %fp@(-8),%d2
} else {
rtems_driver_address_table *const table = _IO_Driver_address_table + major;
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
49576: 700c moveq #12,%d0
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
49578: 246e fffc moveal %fp@(-4),%a2
4957c: 4e5e unlk %fp
4957e: 4e75 rts
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
49580: 4aaa 0004 tstl %a2@(4)
49584: 66e6 bnes 4956c <rtems_io_register_driver+0x8c>
49586: 2239 0006 5e22 movel 65e22 <_IO_Driver_address_table>,%d1
if ( !rtems_io_is_empty_table( table ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
*registered_major = major;
4958c: 2082 movel %d2,%a0@
}
_IO_Driver_address_table [major] = *driver_table;
4958e: 2041 moveal %d1,%a0
49590: d1c0 addal %d0,%a0
49592: 20d9 movel %a1@+,%a0@+
49594: 20d9 movel %a1@+,%a0@+
49596: 20d9 movel %a1@+,%a0@+
49598: 20d9 movel %a1@+,%a0@+
4959a: 20d9 movel %a1@+,%a0@+
4959c: 2091 movel %a1@,%a0@
_Thread_Enable_dispatch();
4959e: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
}
495a4: 246e fffc moveal %fp@(-4),%a2
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
495a8: 2d42 0008 movel %d2,%fp@(8)
}
495ac: 242e fff8 movel %fp@(-8),%d2
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
495b0: 42ae 0010 clrl %fp@(16)
495b4: 42ae 000c clrl %fp@(12)
}
495b8: 4e5e unlk %fp
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
495ba: 4ef9 0005 15d4 jmp 515d4 <rtems_io_initialize>
static rtems_status_code rtems_io_obtain_major_number(
rtems_device_major_number *major
)
{
rtems_device_major_number n = _IO_Number_of_drivers;
495c0: 2039 0006 5e1e movel 65e1e <_IO_Number_of_drivers>,%d0
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
495c6: 6770 beqs 49638 <rtems_io_register_driver+0x158> <== NEVER TAKEN
495c8: 2239 0006 5e22 movel 65e22 <_IO_Driver_address_table>,%d1
495ce: 2441 moveal %d1,%a2
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
495d0: 4a92 tstl %a2@
495d2: 6720 beqs 495f4 <rtems_io_register_driver+0x114>
rtems_device_major_number n = _IO_Number_of_drivers;
rtems_device_major_number m = 0;
/* major is error checked by caller */
for ( m = 0; m < n; ++m ) {
495d4: 5282 addql #1,%d2
495d6: 45ea 0018 lea %a2@(24),%a2
495da: b082 cmpl %d2,%d0
495dc: 66f2 bnes 495d0 <rtems_io_register_driver+0xf0>
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
495de: 2082 movel %d2,%a0@
if ( major == 0 ) {
rtems_status_code sc = rtems_io_obtain_major_number( registered_major );
if ( sc != RTEMS_SUCCESSFUL ) {
_Thread_Enable_dispatch();
495e0: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
495e6: 7005 moveq #5,%d0
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
}
495e8: 242e fff8 movel %fp@(-8),%d2
495ec: 246e fffc moveal %fp@(-4),%a2
495f0: 4e5e unlk %fp
495f2: 4e75 rts
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table
)
{
return table->initialization_entry == NULL && table->open_entry == NULL;
495f4: 4aaa 0004 tstl %a2@(4)
495f8: 66da bnes 495d4 <rtems_io_register_driver+0xf4>
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
495fa: 2082 movel %d2,%a0@
if ( m != n )
495fc: b480 cmpl %d0,%d2
495fe: 67e0 beqs 495e0 <rtems_io_register_driver+0x100> <== NEVER TAKEN
49600: 7018 moveq #24,%d0
49602: 4c02 0800 mulsl %d2,%d0
}
*registered_major = major;
}
_IO_Driver_address_table [major] = *driver_table;
49606: 2041 moveal %d1,%a0
49608: d1c0 addal %d0,%a0
4960a: 20d9 movel %a1@+,%a0@+
4960c: 20d9 movel %a1@+,%a0@+
4960e: 20d9 movel %a1@+,%a0@+
49610: 20d9 movel %a1@+,%a0@+
49612: 20d9 movel %a1@+,%a0@+
49614: 2091 movel %a1@,%a0@
_Thread_Enable_dispatch();
49616: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
return rtems_io_initialize( major, 0, NULL );
}
4961c: 246e fffc moveal %fp@(-4),%a2
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
49620: 2d42 0008 movel %d2,%fp@(8)
}
49624: 242e fff8 movel %fp@(-8),%d2
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
49628: 42ae 0010 clrl %fp@(16)
4962c: 42ae 000c clrl %fp@(12)
}
49630: 4e5e unlk %fp
_IO_Driver_address_table [major] = *driver_table;
_Thread_Enable_dispatch();
return rtems_io_initialize( major, 0, NULL );
49632: 4ef9 0005 15d4 jmp 515d4 <rtems_io_initialize>
if ( rtems_io_is_empty_table( table ) )
break;
}
/* Assigns invalid value in case of failure */
*major = m;
49638: 4290 clrl %a0@ <== NOT EXECUTED
if ( major == 0 ) {
rtems_status_code sc = rtems_io_obtain_major_number( registered_major );
if ( sc != RTEMS_SUCCESSFUL ) {
_Thread_Enable_dispatch();
4963a: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch> <== NOT EXECUTED
*major = m;
if ( m != n )
return RTEMS_SUCCESSFUL;
return RTEMS_TOO_MANY;
49640: 7005 moveq #5,%d0 <== NOT EXECUTED
49642: 60a4 bras 495e8 <rtems_io_register_driver+0x108> <== NOT EXECUTED
0004a26c <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)
{
4a26c: 4e56 fff0 linkw %fp,#-16
4a270: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
4a274: 266e 0008 moveal %fp@(8),%a3
4a278: 49f9 0006 3a46 lea 63a46 <_Objects_Information_table+0x4>,%a4
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
4a27e: 4a8b tstl %a3
4a280: 6738 beqs 4a2ba <rtems_iterate_over_all_threads+0x4e><== 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 ];
4a282: 205c moveal %a4@+,%a0
4a284: 2468 0004 moveal %a0@(4),%a2
if ( !information )
4a288: 4a8a tstl %a2
4a28a: 6726 beqs 4a2b2 <rtems_iterate_over_all_threads+0x46>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4a28c: 4a6a 000e tstw %a2@(14)
4a290: 6720 beqs 4a2b2 <rtems_iterate_over_all_threads+0x46>
4a292: 7401 moveq #1,%d2
the_thread = (Thread_Control *)information->local_table[ i ];
4a294: 206a 0018 moveal %a2@(24),%a0
4a298: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4a29c: 5282 addql #1,%d2
the_thread = (Thread_Control *)information->local_table[ i ];
if ( !the_thread )
4a29e: 4a80 tstl %d0
4a2a0: 6706 beqs 4a2a8 <rtems_iterate_over_all_threads+0x3c><== NEVER TAKEN
continue;
(*routine)(the_thread);
4a2a2: 2f00 movel %d0,%sp@-
4a2a4: 4e93 jsr %a3@
4a2a6: 588f addql #4,%sp
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
4a2a8: 4280 clrl %d0
4a2aa: 302a 000e movew %a2@(14),%d0
4a2ae: b480 cmpl %d0,%d2
4a2b0: 63e2 blss 4a294 <rtems_iterate_over_all_threads+0x28>
Objects_Information *information;
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
4a2b2: b9fc 0006 3a52 cmpal #408146,%a4
4a2b8: 66c8 bnes 4a282 <rtems_iterate_over_all_threads+0x16>
(*routine)(the_thread);
}
}
}
4a2ba: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4
4a2c0: 4e5e unlk %fp <== NOT EXECUTED
00048dac <rtems_object_get_class_information>:
rtems_status_code rtems_object_get_class_information(
int the_api,
int the_class,
rtems_object_api_class_information *info
)
{
48dac: 4e56 0000 linkw %fp,#0
48db0: 2f0a movel %a2,%sp@-
48db2: 246e 0010 moveal %fp@(16),%a2
48db6: 2f02 movel %d2,%sp@-
int i;
/*
* Validate parameters and look up information structure.
*/
if ( !info )
48db8: 4a8a tstl %a2
48dba: 6768 beqs 48e24 <rtems_object_get_class_information+0x78>
return RTEMS_INVALID_ADDRESS;
obj_info = _Objects_Get_information( the_api, the_class );
48dbc: 3f2e 000e movew %fp@(14),%sp@-
48dc0: 4267 clrw %sp@-
48dc2: 2f2e 0008 movel %fp@(8),%sp@-
48dc6: 4eb9 0004 acac jsr 4acac <_Objects_Get_information>
if ( !obj_info )
48dcc: 508f addql #8,%sp
* Validate parameters and look up information structure.
*/
if ( !info )
return RTEMS_INVALID_ADDRESS;
obj_info = _Objects_Get_information( the_api, the_class );
48dce: 2040 moveal %d0,%a0
if ( !obj_info )
48dd0: 4a80 tstl %d0
48dd2: 675e beqs 48e32 <rtems_object_get_class_information+0x86>
return RTEMS_INVALID_NUMBER;
/*
* Return information about this object class to the user.
*/
info->minimum_id = obj_info->minimum_id;
48dd4: 24a8 0006 movel %a0@(6),%a2@
info->maximum_id = obj_info->maximum_id;
info->auto_extend = obj_info->auto_extend;
info->maximum = obj_info->maximum;
48dd8: 4282 clrl %d2
/*
* Return information about this object class to the user.
*/
info->minimum_id = obj_info->minimum_id;
info->maximum_id = obj_info->maximum_id;
48dda: 2568 000a 0004 movel %a0@(10),%a2@(4)
info->auto_extend = obj_info->auto_extend;
info->maximum = obj_info->maximum;
48de0: 3428 000e movew %a0@(14),%d2
/*
* Return information about this object class to the user.
*/
info->minimum_id = obj_info->minimum_id;
info->maximum_id = obj_info->maximum_id;
info->auto_extend = obj_info->auto_extend;
48de4: 1568 0010 000c moveb %a0@(16),%a2@(12)
info->maximum = obj_info->maximum;
48dea: 2542 0008 movel %d2,%a2@(8)
for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
48dee: 6750 beqs 48e40 <rtems_object_get_class_information+0x94><== NEVER TAKEN
48df0: 2068 0018 moveal %a0@(24),%a0
48df4: 7201 moveq #1,%d1
48df6: 7001 moveq #1,%d0
48df8: 93c9 subal %a1,%a1
48dfa: 5280 addql #1,%d0
if ( !obj_info->local_table[i] )
48dfc: 4ab0 1c00 tstl %a0@(00000000,%d1:l:4)
48e00: 6718 beqs 48e1a <rtems_object_get_class_information+0x6e>
info->minimum_id = obj_info->minimum_id;
info->maximum_id = obj_info->maximum_id;
info->auto_extend = obj_info->auto_extend;
info->maximum = obj_info->maximum;
for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
48e02: 2200 movel %d0,%d1
48e04: b082 cmpl %d2,%d0
48e06: 63f2 blss 48dfa <rtems_object_get_class_information+0x4e><== ALWAYS TAKEN
if ( !obj_info->local_table[i] )
unallocated++;
info->unallocated = unallocated;
48e08: 2549 000e movel %a1,%a2@(14)
return RTEMS_SUCCESSFUL;
48e0c: 4280 clrl %d0
}
48e0e: 242e fff8 movel %fp@(-8),%d2
48e12: 246e fffc moveal %fp@(-4),%a2
48e16: 4e5e unlk %fp
48e18: 4e75 rts
info->auto_extend = obj_info->auto_extend;
info->maximum = obj_info->maximum;
for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
if ( !obj_info->local_table[i] )
unallocated++;
48e1a: 5289 addql #1,%a1
info->minimum_id = obj_info->minimum_id;
info->maximum_id = obj_info->maximum_id;
info->auto_extend = obj_info->auto_extend;
info->maximum = obj_info->maximum;
for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
48e1c: 2200 movel %d0,%d1
48e1e: b082 cmpl %d2,%d0
48e20: 63d8 blss 48dfa <rtems_object_get_class_information+0x4e><== NEVER TAKEN
48e22: 60e4 bras 48e08 <rtems_object_get_class_information+0x5c>
unallocated++;
info->unallocated = unallocated;
return RTEMS_SUCCESSFUL;
}
48e24: 242e fff8 movel %fp@(-8),%d2
/*
* Validate parameters and look up information structure.
*/
if ( !info )
return RTEMS_INVALID_ADDRESS;
48e28: 7009 moveq #9,%d0
unallocated++;
info->unallocated = unallocated;
return RTEMS_SUCCESSFUL;
}
48e2a: 246e fffc moveal %fp@(-4),%a2
48e2e: 4e5e unlk %fp
48e30: 4e75 rts
48e32: 242e fff8 movel %fp@(-8),%d2
if ( !info )
return RTEMS_INVALID_ADDRESS;
obj_info = _Objects_Get_information( the_api, the_class );
if ( !obj_info )
return RTEMS_INVALID_NUMBER;
48e36: 700a moveq #10,%d0
unallocated++;
info->unallocated = unallocated;
return RTEMS_SUCCESSFUL;
}
48e38: 246e fffc moveal %fp@(-4),%a2
48e3c: 4e5e unlk %fp
48e3e: 4e75 rts
info->minimum_id = obj_info->minimum_id;
info->maximum_id = obj_info->maximum_id;
info->auto_extend = obj_info->auto_extend;
info->maximum = obj_info->maximum;
for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
48e40: 93c9 subal %a1,%a1 <== NOT EXECUTED
if ( !obj_info->local_table[i] )
unallocated++;
info->unallocated = unallocated;
return RTEMS_SUCCESSFUL;
48e42: 4280 clrl %d0 <== NOT EXECUTED
for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
if ( !obj_info->local_table[i] )
unallocated++;
info->unallocated = unallocated;
48e44: 2549 000e movel %a1,%a2@(14) <== NOT EXECUTED
48e48: 60c4 bras 48e0e <rtems_object_get_class_information+0x62><== NOT EXECUTED
...
0004724c <rtems_object_set_name>:
*/
rtems_status_code rtems_object_set_name(
rtems_id id,
const char *name
)
{
4724c: 4e56 fffc linkw %fp,#-4
47250: 2f03 movel %d3,%sp@-
47252: 2f02 movel %d2,%sp@-
Objects_Information *information;
Objects_Locations location;
Objects_Control *the_object;
Objects_Id tmpId;
if ( !name )
47254: 4aae 000c tstl %fp@(12)
47258: 677c beqs 472d6 <rtems_object_set_name+0x8a>
return RTEMS_INVALID_ADDRESS;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
4725a: 4aae 0008 tstl %fp@(8)
4725e: 6656 bnes 472b6 <rtems_object_set_name+0x6a>
47260: 2079 0006 1cc6 moveal 61cc6 <_Per_CPU_Information+0xe>,%a0
47266: 2628 0008 movel %a0@(8),%d3
information = _Objects_Get_information_id( tmpId );
4726a: 2f03 movel %d3,%sp@-
4726c: 4eb9 0004 8edc jsr 48edc <_Objects_Get_information_id>
if ( !information )
47272: 588f addql #4,%sp
if ( !name )
return RTEMS_INVALID_ADDRESS;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
information = _Objects_Get_information_id( tmpId );
47274: 2400 movel %d0,%d2
if ( !information )
47276: 6750 beqs 472c8 <rtems_object_set_name+0x7c> <== NEVER TAKEN
return RTEMS_INVALID_ID;
the_object = _Objects_Get( information, tmpId, &location );
47278: 486e fffc pea %fp@(-4)
4727c: 2f03 movel %d3,%sp@-
4727e: 2f00 movel %d0,%sp@-
47280: 4eb9 0004 90dc jsr 490dc <_Objects_Get>
switch ( location ) {
47286: 4fef 000c lea %sp@(12),%sp
4728a: 4aae fffc tstl %fp@(-4)
4728e: 6638 bnes 472c8 <rtems_object_set_name+0x7c>
case OBJECTS_LOCAL:
_Objects_Set_name( information, the_object, name );
47290: 2f2e 000c movel %fp@(12),%sp@-
47294: 2f00 movel %d0,%sp@-
47296: 2f02 movel %d2,%sp@-
47298: 4eb9 0004 9260 jsr 49260 <_Objects_Set_name>
_Thread_Enable_dispatch();
4729e: 4eb9 0004 9ee8 jsr 49ee8 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
472a4: 242e fff4 movel %fp@(-12),%d2
the_object = _Objects_Get( information, tmpId, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_Objects_Set_name( information, the_object, name );
_Thread_Enable_dispatch();
472a8: 4fef 000c lea %sp@(12),%sp
return RTEMS_SUCCESSFUL;
472ac: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
472ae: 262e fff8 movel %fp@(-8),%d3
472b2: 4e5e unlk %fp
472b4: 4e75 rts
Objects_Id tmpId;
if ( !name )
return RTEMS_INVALID_ADDRESS;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
472b6: 262e 0008 movel %fp@(8),%d3
information = _Objects_Get_information_id( tmpId );
472ba: 2f03 movel %d3,%sp@-
472bc: 4eb9 0004 8edc jsr 48edc <_Objects_Get_information_id>
if ( !information )
472c2: 588f addql #4,%sp
if ( !name )
return RTEMS_INVALID_ADDRESS;
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
information = _Objects_Get_information_id( tmpId );
472c4: 2400 movel %d0,%d2
if ( !information )
472c6: 66b0 bnes 47278 <rtems_object_set_name+0x2c>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
472c8: 242e fff4 movel %fp@(-12),%d2
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
472cc: 7004 moveq #4,%d0
}
472ce: 262e fff8 movel %fp@(-8),%d3
472d2: 4e5e unlk %fp
472d4: 4e75 rts
472d6: 242e fff4 movel %fp@(-12),%d2
Objects_Locations location;
Objects_Control *the_object;
Objects_Id tmpId;
if ( !name )
return RTEMS_INVALID_ADDRESS;
472da: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
472dc: 262e fff8 movel %fp@(-8),%d3
472e0: 4e5e unlk %fp <== NOT EXECUTED
000488bc <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
488bc: 4e56 0000 linkw %fp,#0
488c0: 2f0a movel %a2,%sp@-
488c2: 2f02 movel %d2,%sp@-
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
488c4: 4aae 0008 tstl %fp@(8)
488c8: 660e bnes 488d8 <rtems_partition_create+0x1c>
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
488ca: 242e fff8 movel %fp@(-8),%d2
)
{
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
488ce: 7003 moveq #3,%d0
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
488d0: 246e fffc moveal %fp@(-4),%a2
488d4: 4e5e unlk %fp
488d6: 4e75 rts
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !starting_address )
488d8: 4aae 000c tstl %fp@(12)
488dc: 671a beqs 488f8 <rtems_partition_create+0x3c>
return RTEMS_INVALID_ADDRESS;
if ( !id )
488de: 4aae 001c tstl %fp@(28)
488e2: 6714 beqs 488f8 <rtems_partition_create+0x3c> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
488e4: 4aae 0010 tstl %fp@(16)
488e8: 661c bnes 48906 <rtems_partition_create+0x4a>
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
488ea: 242e fff8 movel %fp@(-8),%d2
if ( !id )
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
488ee: 7008 moveq #8,%d0
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
488f0: 246e fffc moveal %fp@(-4),%a2
488f4: 4e5e unlk %fp
488f6: 4e75 rts
488f8: 242e fff8 movel %fp@(-8),%d2
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
488fc: 7009 moveq #9,%d0
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
488fe: 246e fffc moveal %fp@(-4),%a2
48902: 4e5e unlk %fp
48904: 4e75 rts
return RTEMS_INVALID_ADDRESS;
if ( !id )
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
48906: 4aae 0014 tstl %fp@(20)
4890a: 67de beqs 488ea <rtems_partition_create+0x2e>
4890c: 202e 0014 movel %fp@(20),%d0
48910: b0ae 0010 cmpl %fp@(16),%d0
48914: 62d4 bhis 488ea <rtems_partition_create+0x2e>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
48916: 7003 moveq #3,%d0
48918: c0ae 0014 andl %fp@(20),%d0
4891c: 66cc bnes 488ea <rtems_partition_create+0x2e>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
4891e: 103c 0003 moveb #3,%d0
48922: c0ae 000c andl %fp@(12),%d0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
48926: 66d0 bnes 488f8 <rtems_partition_create+0x3c>
*
* 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;
48928: 2039 0006 5a90 movel 65a90 <_Thread_Dispatch_disable_level>,%d0
++level;
4892e: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
48930: 23c0 0006 5a90 movel %d0,65a90 <_Thread_Dispatch_disable_level>
* This function allocates a partition control block from
* the inactive chain of free partition control blocks.
*/
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
{
return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
48936: 4879 0006 5910 pea 65910 <_Partition_Information>
4893c: 4eb9 0004 a7bc jsr 4a7bc <_Objects_Allocate>
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
48942: 588f addql #4,%sp
48944: 2440 moveal %d0,%a2
48946: 4a80 tstl %d0
48948: 6776 beqs 489c0 <rtems_partition_create+0x104>
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
4894a: 242e 0010 movel %fp@(16),%d2
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
4894e: 2002 movel %d2,%d0
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
48950: 2542 0014 movel %d2,%a2@(20)
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
48954: 242e 0014 movel %fp@(20),%d2
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
48958: 222e 000c movel %fp@(12),%d1
the_partition->length = length;
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
4895c: 256e 0018 001c movel %fp@(24),%a2@(28)
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
48962: 2541 0010 movel %d1,%a2@(16)
the_partition->length = length;
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
48966: 4c42 0000 remul %d2,%d0,%d0
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
4896a: 2542 0018 movel %d2,%a2@(24)
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
4896e: 42aa 0020 clrl %a2@(32)
_Chain_Initialize( &the_partition->Memory, starting_address,
48972: 2f02 movel %d2,%sp@-
48974: 2f00 movel %d0,%sp@-
48976: 2f2e 000c movel %fp@(12),%sp@-
4897a: 486a 0024 pea %a2@(36)
4897e: 4eb9 0004 9cf8 jsr 49cf8 <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
48984: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
48988: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
4898a: 2079 0006 5928 moveal 65928 <_Partition_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
48990: 0281 0000 ffff andil #65535,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
48996: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
4899a: 206e 0008 moveal %fp@(8),%a0
4899e: 2548 000c movel %a0,%a2@(12)
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
489a2: 206e 001c moveal %fp@(28),%a0
489a6: 2080 movel %d0,%a0@
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
489a8: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
}
489ae: 242e fff8 movel %fp@(-8),%d2
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
489b2: 4fef 0010 lea %sp@(16),%sp
489b6: 4280 clrl %d0
}
489b8: 246e fffc moveal %fp@(-4),%a2
489bc: 4e5e unlk %fp
489be: 4e75 rts
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
_Thread_Enable_dispatch();
489c0: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
489c6: 242e fff8 movel %fp@(-8),%d2
the_partition = _Partition_Allocate();
if ( !the_partition ) {
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
489ca: 7005 moveq #5,%d0
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
489cc: 246e fffc moveal %fp@(-4),%a2
489d0: 4e5e unlk %fp <== NOT EXECUTED
000551d0 <rtems_partition_return_buffer>:
rtems_status_code rtems_partition_return_buffer(
rtems_id id,
void *buffer
)
{
551d0: 4e56 fff8 linkw %fp,#-8
551d4: 2f02 movel %d2,%sp@-
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Partition_Control *)
551d6: 486e fffc pea %fp@(-4)
551da: 2f2e 0008 movel %fp@(8),%sp@-
551de: 4879 0007 d8ea pea 7d8ea <_Partition_Information>
551e4: 4eb9 0005 a5b4 jsr 5a5b4 <_Objects_Get>
register Partition_Control *the_partition;
Objects_Locations location;
the_partition = _Partition_Get( id, &location );
switch ( location ) {
551ea: 4fef 000c lea %sp@(12),%sp
551ee: 4aae fffc tstl %fp@(-4)
551f2: 6660 bnes 55254 <rtems_partition_return_buffer+0x84>
)
{
void *starting;
void *ending;
starting = the_partition->starting_address;
551f4: 2040 moveal %d0,%a0
551f6: 2228 0010 movel %a0@(16),%d1
ending = _Addresses_Add_offset( starting, the_partition->length );
551fa: 2068 0014 moveal %a0@(20),%a0
const void *address,
const void *base,
const void *limit
)
{
return (address >= base && address <= limit);
551fe: b2ae 000c cmpl %fp@(12),%d1
55202: 625a bhis 5525e <rtems_partition_return_buffer+0x8e>
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
55204: 41f0 1800 lea %a0@(00000000,%d1:l),%a0
const void *address,
const void *base,
const void *limit
)
{
return (address >= base && address <= limit);
55208: b1ee 000c cmpal %fp@(12),%a0
5520c: 6550 bcss 5525e <rtems_partition_return_buffer+0x8e><== NEVER TAKEN
RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract (
const void *left,
const void *right
)
{
return (int32_t) ((const char *) left - (const char *) right);
5520e: 242e 000c movel %fp@(12),%d2
offset = (uint32_t) _Addresses_Subtract(
the_buffer,
the_partition->starting_address
);
return ((offset % the_partition->buffer_size) == 0);
55212: 2040 moveal %d0,%a0
55214: 9481 subl %d1,%d2
55216: 2202 movel %d2,%d1
55218: 41e8 0018 lea %a0@(24),%a0
5521c: 4c50 1002 remul %a0@,%d2,%d1
starting = the_partition->starting_address;
ending = _Addresses_Add_offset( starting, the_partition->length );
return (
_Addresses_Is_in_range( the_buffer, starting, ending ) &&
55220: 4a82 tstl %d2
55222: 663a bnes 5525e <rtems_partition_return_buffer+0x8e>
RTEMS_INLINE_ROUTINE void _Partition_Free_buffer (
Partition_Control *the_partition,
Chain_Node *the_buffer
)
{
_Chain_Append( &the_partition->Memory, the_buffer );
55224: 2f2e 000c movel %fp@(12),%sp@-
55228: 2240 moveal %d0,%a1
5522a: 4869 0024 pea %a1@(36)
5522e: 2d40 fff8 movel %d0,%fp@(-8)
55232: 4eb9 0005 87ac jsr 587ac <_Chain_Append>
case OBJECTS_LOCAL:
if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
_Partition_Free_buffer( the_partition, buffer );
the_partition->number_of_used_blocks -= 1;
55238: 202e fff8 movel %fp@(-8),%d0
5523c: 2040 moveal %d0,%a0
5523e: 53a8 0020 subql #1,%a0@(32)
_Thread_Enable_dispatch();
55242: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
55248: 242e fff4 movel %fp@(-12),%d2
case OBJECTS_LOCAL:
if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) {
_Partition_Free_buffer( the_partition, buffer );
the_partition->number_of_used_blocks -= 1;
_Thread_Enable_dispatch();
5524c: 508f addql #8,%sp
return RTEMS_SUCCESSFUL;
5524e: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
55250: 4e5e unlk %fp
55252: 4e75 rts
55254: 242e fff4 movel %fp@(-12),%d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
55258: 7004 moveq #4,%d0
}
5525a: 4e5e unlk %fp
5525c: 4e75 rts
_Partition_Free_buffer( the_partition, buffer );
the_partition->number_of_used_blocks -= 1;
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
5525e: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
55264: 242e fff4 movel %fp@(-12),%d2
the_partition->number_of_used_blocks -= 1;
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
return RTEMS_INVALID_ADDRESS;
55268: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
5526a: 4e5e unlk %fp
...
00054640 <rtems_port_external_to_internal>:
rtems_status_code rtems_port_external_to_internal(
rtems_id id,
void *external,
void **internal
)
{
54640: 4e56 fffc linkw %fp,#-4
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !internal )
54644: 4aae 0010 tstl %fp@(16)
54648: 6748 beqs 54692 <rtems_port_external_to_internal+0x52>
RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Dual_ported_memory_Control *)
5464a: 486e fffc pea %fp@(-4)
5464e: 2f2e 0008 movel %fp@(8),%sp@-
54652: 4879 0007 d8b0 pea 7d8b0 <_Dual_ported_memory_Information>
54658: 4eb9 0005 a5b4 jsr 5a5b4 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_port = _Dual_ported_memory_Get( id, &location );
switch ( location ) {
5465e: 4fef 000c lea %sp@(12),%sp
54662: 4aae fffc tstl %fp@(-4)
54666: 6624 bnes 5468c <rtems_port_external_to_internal+0x4c>
RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract (
const void *left,
const void *right
)
{
return (int32_t) ((const char *) left - (const char *) right);
54668: 222e 000c movel %fp@(12),%d1
5466c: 2040 moveal %d0,%a0
5466e: 92a8 0014 subl %a0@(20),%d1
case OBJECTS_LOCAL:
ending = _Addresses_Subtract( external, the_port->external_base );
if ( ending > the_port->length )
54672: b2a8 0018 cmpl %a0@(24),%d1
54676: 6320 blss 54698 <rtems_port_external_to_internal+0x58>
*internal = external;
54678: 206e 0010 moveal %fp@(16),%a0
5467c: 20ae 000c movel %fp@(12),%a0@
else
*internal = _Addresses_Add_offset( the_port->internal_base,
ending );
_Thread_Enable_dispatch();
54680: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
54686: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
54688: 4e5e unlk %fp
5468a: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
5468c: 7004 moveq #4,%d0
}
5468e: 4e5e unlk %fp
54690: 4e75 rts
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !internal )
return RTEMS_INVALID_ADDRESS;
54692: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
54694: 4e5e unlk %fp
54696: 4e75 rts
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
54698: 2040 moveal %d0,%a0
5469a: d2a8 0010 addl %a0@(16),%d1
5469e: 206e 0010 moveal %fp@(16),%a0
546a2: 2081 movel %d1,%a0@
if ( ending > the_port->length )
*internal = external;
else
*internal = _Addresses_Add_offset( the_port->internal_base,
ending );
_Thread_Enable_dispatch();
546a4: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
546aa: 4280 clrl %d0
546ac: 60da bras 54688 <rtems_port_external_to_internal+0x48>
...
000546d8 <rtems_port_internal_to_external>:
rtems_status_code rtems_port_internal_to_external(
rtems_id id,
void *internal,
void **external
)
{
546d8: 4e56 fffc linkw %fp,#-4
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !external )
546dc: 4aae 0010 tstl %fp@(16)
546e0: 6748 beqs 5472a <rtems_port_internal_to_external+0x52>
546e2: 486e fffc pea %fp@(-4)
546e6: 2f2e 0008 movel %fp@(8),%sp@-
546ea: 4879 0007 d8b0 pea 7d8b0 <_Dual_ported_memory_Information>
546f0: 4eb9 0005 a5b4 jsr 5a5b4 <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_port = _Dual_ported_memory_Get( id, &location );
switch ( location ) {
546f6: 4fef 000c lea %sp@(12),%sp
546fa: 4aae fffc tstl %fp@(-4)
546fe: 6624 bnes 54724 <rtems_port_internal_to_external+0x4c>
RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract (
const void *left,
const void *right
)
{
return (int32_t) ((const char *) left - (const char *) right);
54700: 222e 000c movel %fp@(12),%d1
54704: 2040 moveal %d0,%a0
54706: 92a8 0010 subl %a0@(16),%d1
case OBJECTS_LOCAL:
ending = _Addresses_Subtract( internal, the_port->internal_base );
if ( ending > the_port->length )
5470a: b2a8 0018 cmpl %a0@(24),%d1
5470e: 6320 blss 54730 <rtems_port_internal_to_external+0x58>
*external = internal;
54710: 206e 0010 moveal %fp@(16),%a0
54714: 20ae 000c movel %fp@(12),%a0@
else
*external = _Addresses_Add_offset( the_port->external_base,
ending );
_Thread_Enable_dispatch();
54718: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
5471e: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
54720: 4e5e unlk %fp
54722: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
54724: 7004 moveq #4,%d0
}
54726: 4e5e unlk %fp
54728: 4e75 rts
register Dual_ported_memory_Control *the_port;
Objects_Locations location;
uint32_t ending;
if ( !external )
return RTEMS_INVALID_ADDRESS;
5472a: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
5472c: 4e5e unlk %fp
5472e: 4e75 rts
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
54730: 2040 moveal %d0,%a0
54732: d2a8 0014 addl %a0@(20),%d1
54736: 206e 0010 moveal %fp@(16),%a0
5473a: 2081 movel %d1,%a0@
if ( ending > the_port->length )
*external = internal;
else
*external = _Addresses_Add_offset( the_port->external_base,
ending );
_Thread_Enable_dispatch();
5473c: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
54742: 4280 clrl %d0
54744: 60da bras 54720 <rtems_port_internal_to_external+0x48>
...
000748e4 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
748e4: 4e56 fff8 linkw %fp,#-8
748e8: 2f03 movel %d3,%sp@-
748ea: 2f02 movel %d2,%sp@-
748ec: 486e fffc pea %fp@(-4)
748f0: 2f2e 0008 movel %fp@(8),%sp@-
748f4: 4879 000a 1e9c pea a1e9c <_Rate_monotonic_Information>
748fa: 4eb9 0004 8c58 jsr 48c58 <_Objects_Get>
rtems_rate_monotonic_period_states local_state;
ISR_Level level;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
74900: 4fef 000c lea %sp@(12),%sp
74904: 4aae fffc tstl %fp@(-4)
74908: 6624 bnes 7492e <rtems_rate_monotonic_period+0x4a>
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
7490a: 2279 000a 1922 moveal a1922 <_Per_CPU_Information+0xe>,%a1
74910: 2040 moveal %d0,%a0
74912: b3e8 0040 cmpal %a0@(64),%a1
74916: 6726 beqs 7493e <rtems_rate_monotonic_period+0x5a>
_Thread_Enable_dispatch();
74918: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
7491e: 7417 moveq #23,%d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
74920: 2002 movel %d2,%d0
74922: 242e fff0 movel %fp@(-16),%d2
74926: 262e fff4 movel %fp@(-12),%d3
7492a: 4e5e unlk %fp
7492c: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
7492e: 7404 moveq #4,%d2
}
74930: 2002 movel %d2,%d0
74932: 242e fff0 movel %fp@(-16),%d2
74936: 262e fff4 movel %fp@(-12),%d3
7493a: 4e5e unlk %fp
7493c: 4e75 rts
if ( !_Thread_Is_executing( the_period->owner ) ) {
_Thread_Enable_dispatch();
return RTEMS_NOT_OWNER_OF_RESOURCE;
}
if ( length == RTEMS_PERIOD_STATUS ) {
7493e: 4aae 000c tstl %fp@(12)
74942: 6700 008a beqw 749ce <rtems_rate_monotonic_period+0xea>
}
_Thread_Enable_dispatch();
return( return_value );
}
_ISR_Disable( level );
74946: 223c 0000 0700 movel #1792,%d1
7494c: 40c2 movew %sr,%d2
7494e: 8282 orl %d2,%d1
74950: 46c1 movew %d1,%sr
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
74952: 2040 moveal %d0,%a0
74954: 2228 0038 movel %a0@(56),%d1
74958: 6700 00a8 beqw 74a02 <rtems_rate_monotonic_period+0x11e>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
7495c: 7602 moveq #2,%d3
7495e: b681 cmpl %d1,%d3
74960: 6700 010e beqw 74a70 <rtems_rate_monotonic_period+0x18c>
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
74964: 7604 moveq #4,%d3
74966: b681 cmpl %d1,%d3
74968: 66c4 bnes 7492e <rtems_rate_monotonic_period+0x4a><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
7496a: 2f00 movel %d0,%sp@-
7496c: 2d40 fff8 movel %d0,%fp@(-8)
74970: 4eba fe08 jsr %pc@(7477a <_Rate_monotonic_Update_statistics>)
_ISR_Enable( level );
74974: 46c2 movew %d2,%sr
the_period->state = RATE_MONOTONIC_ACTIVE;
74976: 7202 moveq #2,%d1
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;
74978: 7406 moveq #6,%d2
*/
_Rate_monotonic_Update_statistics( the_period );
_ISR_Enable( level );
the_period->state = RATE_MONOTONIC_ACTIVE;
7497a: 202e fff8 movel %fp@(-8),%d0
7497e: 2040 moveal %d0,%a0
the_period->next_length = length;
74980: 226e 000c moveal %fp@(12),%a1
*/
_Rate_monotonic_Update_statistics( the_period );
_ISR_Enable( level );
the_period->state = RATE_MONOTONIC_ACTIVE;
74984: 2141 0038 movel %d1,%a0@(56)
the_period->next_length = length;
74988: 2149 003c movel %a1,%a0@(60)
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
7498c: 2149 001c movel %a1,%a0@(28)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
74990: 4868 0010 pea %a0@(16)
74994: 4879 000a 1576 pea a1576 <_Watchdog_Ticks_chain>
7499a: 4eb9 0004 a614 jsr 4a614 <_Watchdog_Insert>
749a0: 202e fff8 movel %fp@(-8),%d0
749a4: 2040 moveal %d0,%a0
749a6: 2f28 003c movel %a0@(60),%sp@-
749aa: 2f28 0040 movel %a0@(64),%sp@-
749ae: 2079 0009 c790 moveal 9c790 <_Scheduler+0x34>,%a0
749b4: 4e90 jsr %a0@
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
749b6: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
749bc: 262e fff4 movel %fp@(-12),%d3
749c0: 2002 movel %d2,%d0
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();
749c2: 4fef 0014 lea %sp@(20),%sp
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
749c6: 242e fff0 movel %fp@(-16),%d2
749ca: 4e5e unlk %fp
749cc: 4e75 rts
_Thread_Enable_dispatch();
return RTEMS_NOT_OWNER_OF_RESOURCE;
}
if ( length == RTEMS_PERIOD_STATUS ) {
switch ( the_period->state ) {
749ce: 2040 moveal %d0,%a0
749d0: 7204 moveq #4,%d1
749d2: 2028 0038 movel %a0@(56),%d0
749d6: b280 cmpl %d0,%d1
749d8: 651e bcss 749f8 <rtems_rate_monotonic_period+0x114><== NEVER TAKEN
749da: 41f9 0009 af36 lea 9af36 <CSWTCH.24>,%a0
749e0: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
749e4: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
749ea: 2002 movel %d2,%d0
749ec: 242e fff0 movel %fp@(-16),%d2
749f0: 262e fff4 movel %fp@(-12),%d3
749f4: 4e5e unlk %fp
749f6: 4e75 rts
_Thread_Enable_dispatch();
return RTEMS_NOT_OWNER_OF_RESOURCE;
}
if ( length == RTEMS_PERIOD_STATUS ) {
switch ( the_period->state ) {
749f8: 4282 clrl %d2 <== NOT EXECUTED
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
749fa: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch> <== NOT EXECUTED
74a00: 60e8 bras 749ea <rtems_rate_monotonic_period+0x106><== NOT EXECUTED
return( return_value );
}
_ISR_Disable( level );
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
_ISR_Enable( level );
74a02: 46c2 movew %d2,%sr
the_period->next_length = length;
74a04: 226e 000c moveal %fp@(12),%a1
NULL
);
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
74a08: 4282 clrl %d2
_ISR_Disable( level );
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
_ISR_Enable( level );
the_period->next_length = length;
74a0a: 2149 003c movel %a1,%a0@(60)
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
74a0e: 2f00 movel %d0,%sp@-
74a10: 2d40 fff8 movel %d0,%fp@(-8)
74a14: 4eb9 0007 4844 jsr 74844 <_Rate_monotonic_Initiate_statistics>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
74a1a: 202e fff8 movel %fp@(-8),%d0
74a1e: 43f9 0007 4b08 lea 74b08 <_Rate_monotonic_Timeout>,%a1
74a24: 2040 moveal %d0,%a0
the_period->state = RATE_MONOTONIC_ACTIVE;
74a26: 7202 moveq #2,%d1
74a28: 2149 002c movel %a1,%a0@(44)
the_watchdog->id = id;
74a2c: 262e 0008 movel %fp@(8),%d3
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
74a30: 226e 000c moveal %fp@(12),%a1
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
the_watchdog->id = id;
74a34: 2143 0030 movel %d3,%a0@(48)
74a38: 2141 0038 movel %d1,%a0@(56)
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
74a3c: 42a8 0018 clrl %a0@(24)
the_watchdog->routine = routine;
the_watchdog->id = id;
the_watchdog->user_data = user_data;
74a40: 42a8 0034 clrl %a0@(52)
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
74a44: 2149 001c movel %a1,%a0@(28)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
74a48: 4868 0010 pea %a0@(16)
74a4c: 4879 000a 1576 pea a1576 <_Watchdog_Ticks_chain>
74a52: 4eb9 0004 a614 jsr 4a614 <_Watchdog_Insert>
id,
NULL
);
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
74a58: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
74a5e: 262e fff4 movel %fp@(-12),%d3
74a62: 2002 movel %d2,%d0
id,
NULL
);
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
74a64: 4fef 000c lea %sp@(12),%sp
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
74a68: 242e fff0 movel %fp@(-16),%d2
74a6c: 4e5e unlk %fp
74a6e: 4e75 rts
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
74a70: 2f00 movel %d0,%sp@-
74a72: 2d40 fff8 movel %d0,%fp@(-8)
74a76: 4eba fd02 jsr %pc@(7477a <_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;
74a7a: 202e fff8 movel %fp@(-8),%d0
74a7e: 7201 moveq #1,%d1
74a80: 2040 moveal %d0,%a0
the_period->next_length = length;
74a82: 226e 000c moveal %fp@(12),%a1
/*
* 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;
74a86: 2141 0038 movel %d1,%a0@(56)
the_period->next_length = length;
74a8a: 2149 003c movel %a1,%a0@(60)
_ISR_Enable( level );
74a8e: 46c2 movew %d2,%sr
_Thread_Executing->Wait.id = the_period->Object.id;
74a90: 2079 000a 1922 moveal a1922 <_Per_CPU_Information+0xe>,%a0
74a96: 2240 moveal %d0,%a1
74a98: 5089 addql #8,%a1
74a9a: 2151 0020 movel %a1@,%a0@(32)
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
74a9e: 4878 4000 pea 4000 <D_MAX_EXP+0x3801>
74aa2: 2d40 fff8 movel %d0,%fp@(-8)
74aa6: 2f08 movel %a0,%sp@-
74aa8: 4eb9 0004 a2a4 jsr 4a2a4 <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
74aae: 223c 0000 0700 movel #1792,%d1
74ab4: 40c2 movew %sr,%d2
74ab6: 8282 orl %d2,%d1
74ab8: 46c1 movew %d1,%sr
local_state = the_period->state;
74aba: 202e fff8 movel %fp@(-8),%d0
74abe: 2040 moveal %d0,%a0
74ac0: 2228 0038 movel %a0@(56),%d1
the_period->state = RATE_MONOTONIC_ACTIVE;
74ac4: 2143 0038 movel %d3,%a0@(56)
_ISR_Enable( level );
74ac8: 46c2 movew %d2,%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 )
74aca: 7003 moveq #3,%d0
74acc: 4fef 000c lea %sp@(12),%sp
74ad0: b081 cmpl %d1,%d0
74ad2: 6716 beqs 74aea <rtems_rate_monotonic_period+0x206>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
_Thread_Enable_dispatch();
74ad4: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
74ada: 4282 clrl %d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
74adc: 2002 movel %d2,%d0
74ade: 242e fff0 movel %fp@(-16),%d2
74ae2: 262e fff4 movel %fp@(-12),%d3
74ae6: 4e5e unlk %fp
74ae8: 4e75 rts
/*
* 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 )
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
74aea: 4878 4000 pea 4000 <D_MAX_EXP+0x3801>
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
74aee: 4282 clrl %d2
/*
* 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 )
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
74af0: 2f39 000a 1922 movel a1922 <_Per_CPU_Information+0xe>,%sp@-
74af6: 4eb9 0004 9574 jsr 49574 <_Thread_Clear_state>
74afc: 508f addql #8,%sp
_Thread_Enable_dispatch();
74afe: 4eb9 0004 9974 jsr 49974 <_Thread_Enable_dispatch>
74b04: 60d6 bras 74adc <rtems_rate_monotonic_period+0x1f8>
...
00067350 <rtems_rate_monotonic_report_statistics_with_plugin>:
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
67350: 4e56 ff78 linkw %fp,#-136
67354: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@
67358: 242e 0008 movel %fp@(8),%d2
6735c: 246e 000c moveal %fp@(12),%a2
rtems_id id;
rtems_rate_monotonic_period_statistics the_stats;
rtems_rate_monotonic_period_status the_status;
char name[5];
if ( !print )
67360: 4a8a tstl %a2
67362: 6700 0082 beqw 673e6 <rtems_rate_monotonic_report_statistics_with_plugin+0x96>
return;
(*print)( context, "Period information by period\n" );
67366: 4879 0009 862e pea 9862e <_TOD_Days_per_month+0x68>
6736c: 2f02 movel %d2,%sp@-
6736e: 4e92 jsr %a2@
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
67370: 4879 0009 864c pea 9864c <_TOD_Days_per_month+0x86>
67376: 2f02 movel %d2,%sp@-
67378: 4e92 jsr %a2@
(*print)( context, "--- Wall times are in seconds ---\n" );
6737a: 4879 0009 866e pea 9866e <_TOD_Days_per_month+0xa8>
67380: 2f02 movel %d2,%sp@-
67382: 4e92 jsr %a2@
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
67384: 4879 0009 8691 pea 98691 <_TOD_Days_per_month+0xcb>
6738a: 2f02 movel %d2,%sp@-
6738c: 4e92 jsr %a2@
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
6738e: 4fef 001c lea %sp@(28),%sp
67392: 2ebc 0009 86dc movel #624348,%sp@
67398: 2f02 movel %d2,%sp@-
6739a: 4e92 jsr %a2@
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
6739c: 2e39 000a 1ea2 movel a1ea2 <_Rate_monotonic_Information+0x6>,%d7
673a2: 508f addql #8,%sp
673a4: beb9 000a 1ea6 cmpl a1ea6 <_Rate_monotonic_Information+0xa>,%d7
673aa: 623a bhis 673e6 <rtems_rate_monotonic_report_statistics_with_plugin+0x96><== NEVER TAKEN
673ac: 260e movel %fp,%d3
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
673ae: 2a0e movel %fp,%d5
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
673b0: 280e movel %fp,%d4
673b2: 0683 ffff ffc8 addil #-56,%d3
673b8: 47f9 0007 43f8 lea 743f8 <rtems_rate_monotonic_get_statistics>,%a3
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
673be: 0685 ffff ffb0 addil #-80,%d5
673c4: 4bf9 0007 45a4 lea 745a4 <rtems_rate_monotonic_get_status>,%a5
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
673ca: 0684 ffff ffa3 addil #-93,%d4
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
673d0: 2f03 movel %d3,%sp@-
673d2: 2f07 movel %d7,%sp@-
673d4: 4e93 jsr %a3@
if ( status != RTEMS_SUCCESSFUL )
673d6: 508f addql #8,%sp
673d8: 4a80 tstl %d0
673da: 6714 beqs 673f0 <rtems_rate_monotonic_report_statistics_with_plugin+0xa0>
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
673dc: 5287 addql #1,%d7
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
673de: beb9 000a 1ea6 cmpl a1ea6 <_Rate_monotonic_Information+0xa>,%d7
673e4: 63ea blss 673d0 <rtems_rate_monotonic_report_statistics_with_plugin+0x80>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
673e6: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5
673ec: 4e5e unlk %fp
673ee: 4e75 rts
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
673f0: 2f05 movel %d5,%sp@-
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
673f2: 49f9 0006 800c lea 6800c <_Timespec_Divide_by_integer>,%a4
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
673f8: 2f07 movel %d7,%sp@-
673fa: 4e95 jsr %a5@
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
673fc: 2f04 movel %d4,%sp@-
673fe: 4878 0005 pea 5 <COMPARE>
67402: 2f2e ffb0 movel %fp@(-80),%sp@-
67406: 4eb9 0004 ef4c jsr 4ef4c <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
6740c: 2f2e ffcc movel %fp@(-52),%sp@-
67410: 2f2e ffc8 movel %fp@(-56),%sp@-
67414: 2f04 movel %d4,%sp@-
67416: 2f07 movel %d7,%sp@-
67418: 4879 0009 8728 pea 98728 <_TOD_Days_per_month+0x162>
6741e: 2f02 movel %d2,%sp@-
67420: 4e92 jsr %a2@
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
67422: 202e ffc8 movel %fp@(-56),%d0
67426: 4fef 002c lea %sp@(44),%sp
6742a: 6618 bnes 67444 <rtems_rate_monotonic_report_statistics_with_plugin+0xf4>
(*print)( context, "\n" );
6742c: 4879 0009 341f pea 9341f <_CPU_m68k_BFFFO_table+0x382>
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
67432: 5287 addql #1,%d7
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
67434: 2f02 movel %d2,%sp@-
67436: 4e92 jsr %a2@
continue;
67438: 508f addql #8,%sp
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
6743a: beb9 000a 1ea6 cmpl a1ea6 <_Rate_monotonic_Information+0xa>,%d7
67440: 638e blss 673d0 <rtems_rate_monotonic_report_statistics_with_plugin+0x80><== ALWAYS TAKEN
67442: 60a2 bras 673e6 <rtems_rate_monotonic_report_statistics_with_plugin+0x96><== NOT EXECUTED
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
67444: 486e ffa8 pea %fp@(-88)
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
67448: 5287 addql #1,%d7
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
6744a: 2f00 movel %d0,%sp@-
6744c: 486e ffe0 pea %fp@(-32)
67450: 4e94 jsr %a4@
(*print)( context,
67452: 202e ffac movel %fp@(-84),%d0
67456: 223c 0000 03e8 movel #1000,%d1
6745c: 4c41 0800 remsl %d1,%d0,%d0
67460: 2c2e ffdc movel %fp@(-36),%d6
67464: 2f00 movel %d0,%sp@-
67466: 2001 movel %d1,%d0
67468: 2f2e ffa8 movel %fp@(-88),%sp@-
6746c: 4c40 6806 remsl %d0,%d6,%d6
67470: 202e ffd4 movel %fp@(-44),%d0
67474: 2246 moveal %d6,%a1
67476: 223c 0000 03e8 movel #1000,%d1
6747c: 2f09 movel %a1,%sp@-
6747e: 2f2e ffd8 movel %fp@(-40),%sp@-
67482: 4c41 0800 remsl %d1,%d0,%d0
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
67486: 2c3c 0000 03e8 movel #1000,%d6
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
(*print)( context,
6748c: 2f00 movel %d0,%sp@-
6748e: 2f2e ffd0 movel %fp@(-48),%sp@-
67492: 4879 0009 873f pea 9873f <_TOD_Days_per_month+0x179>
67498: 2f02 movel %d2,%sp@-
6749a: 4e92 jsr %a2@
struct timespec wall_average;
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
6749c: 4fef 002c lea %sp@(44),%sp
674a0: 486e ffa8 pea %fp@(-88)
674a4: 2f2e ffc8 movel %fp@(-56),%sp@-
674a8: 486e fff8 pea %fp@(-8)
674ac: 4e94 jsr %a4@
(*print)( context,
674ae: 202e ffac movel %fp@(-84),%d0
674b2: 4c46 0800 remsl %d6,%d0,%d0
674b6: 222e fff4 movel %fp@(-12),%d1
674ba: 2f00 movel %d0,%sp@-
674bc: 2f2e ffa8 movel %fp@(-88),%sp@-
674c0: 4c46 1801 remsl %d6,%d1,%d1
674c4: 202e ffec movel %fp@(-20),%d0
674c8: 2241 moveal %d1,%a1
674ca: 2f09 movel %a1,%sp@-
674cc: 2f2e fff0 movel %fp@(-16),%sp@-
674d0: 4c46 0800 remsl %d6,%d0,%d0
674d4: 2f00 movel %d0,%sp@-
674d6: 2f2e ffe8 movel %fp@(-24),%sp@-
674da: 4879 0009 875e pea 9875e <_TOD_Days_per_month+0x198>
674e0: 2f02 movel %d2,%sp@-
674e2: 4e92 jsr %a2@
674e4: 4fef 002c lea %sp@(44),%sp
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
674e8: beb9 000a 1ea6 cmpl a1ea6 <_Rate_monotonic_Information+0xa>,%d7
674ee: 6300 fee0 blsw 673d0 <rtems_rate_monotonic_report_statistics_with_plugin+0x80>
674f2: 6000 fef2 braw 673e6 <rtems_rate_monotonic_report_statistics_with_plugin+0x96><== NOT EXECUTED
00067510 <rtems_rate_monotonic_reset_all_statistics>:
/*
* rtems_rate_monotonic_reset_all_statistics
*/
void rtems_rate_monotonic_reset_all_statistics( void )
{
67510: 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;
67514: 2039 000a 14da movel a14da <_Thread_Dispatch_disable_level>,%d0
++level;
6751a: 5280 addql #1,%d0
6751c: 2f0a movel %a2,%sp@-
_Thread_Dispatch_disable_level = level;
6751e: 23c0 000a 14da movel %d0,a14da <_Thread_Dispatch_disable_level>
67524: 2f02 movel %d2,%sp@-
/*
* Cycle through all possible ids and try to reset each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
67526: 2439 000a 1ea2 movel a1ea2 <_Rate_monotonic_Information+0x6>,%d2
6752c: 45f9 0006 755c lea 6755c <rtems_rate_monotonic_reset_statistics>,%a2
67532: b4b9 000a 1ea6 cmpl a1ea6 <_Rate_monotonic_Information+0xa>,%d2
67538: 6210 bhis 6754a <rtems_rate_monotonic_reset_all_statistics+0x3a><== NEVER TAKEN
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
(void) rtems_rate_monotonic_reset_statistics( id );
6753a: 2f02 movel %d2,%sp@-
* Cycle through all possible ids and try to reset each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
6753c: 5282 addql #1,%d2
(void) rtems_rate_monotonic_reset_statistics( id );
6753e: 4e92 jsr %a2@
/*
* Cycle through all possible ids and try to reset each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
67540: 588f addql #4,%sp
67542: b4b9 000a 1ea6 cmpl a1ea6 <_Rate_monotonic_Information+0xa>,%d2
67548: 63f0 blss 6753a <rtems_rate_monotonic_reset_all_statistics+0x2a>
/*
* Done so exit thread dispatching disabled critical section.
*/
_Thread_Enable_dispatch();
}
6754a: 242e fff8 movel %fp@(-8),%d2
6754e: 246e fffc moveal %fp@(-4),%a2
67552: 4e5e unlk %fp
}
/*
* Done so exit thread dispatching disabled critical section.
*/
_Thread_Enable_dispatch();
67554: 4ef9 0004 9974 jmp 49974 <_Thread_Enable_dispatch>
...
00048736 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
48736: 4e56 ffec linkw %fp,#-20
4873a: 202e 000c movel %fp@(12),%d0
4873e: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@
48742: 266e 0008 moveal %fp@(8),%a3
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
48746: 2400 movel %d0,%d2
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;
48748: 262b 002e movel %a3@(46),%d3
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
4874c: 4c43 2001 remul %d3,%d1,%d2
if (excess > 0) {
48750: 4a81 tstl %d1
48752: 664a bnes 4879e <rtems_rbheap_allocate+0x68> <== NEVER TAKEN
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) {
48754: 2600 movel %d0,%d3
48756: 6716 beqs 4876e <rtems_rbheap_allocate+0x38>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
48758: 204b moveal %a3,%a0
4875a: 2458 moveal %a0@+,%a2
{
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) {
4875c: b1ca cmpal %a2,%a0
4875e: 670e beqs 4876e <rtems_rbheap_allocate+0x38>
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
48760: 242a 001c movel %a2@(28),%d2
48764: b682 cmpl %d2,%d3
48766: 6312 blss 4877a <rtems_rbheap_allocate+0x44>
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
48768: 2452 moveal %a2@,%a2
{
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) {
4876a: b5c8 cmpal %a0,%a2
4876c: 66f2 bnes 48760 <rtems_rbheap_allocate+0x2a> <== NEVER TAKEN
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
4876e: 4280 clrl %d0
}
}
}
return ptr;
}
48770: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
48776: 4e5e unlk %fp
48778: 4e75 rts
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
4877a: b483 cmpl %d3,%d2
4877c: 6236 bhis 487b4 <rtems_rbheap_allocate+0x7e>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
4877e: 2252 moveal %a2@,%a1
previous = the_node->previous;
48780: 206a 0004 moveal %a2@(4),%a0
ptr = (void *) new_chunk->begin;
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
48784: 202a 0018 movel %a2@(24),%d0
next->previous = previous;
48788: 2348 0004 movel %a0,%a1@(4)
previous->next = next;
4878c: 2089 movel %a1,%a0@
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
4878e: 42aa 0004 clrl %a2@(4)
48792: 4292 clrl %a2@
}
}
}
return ptr;
}
48794: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
4879a: 4e5e unlk %fp
4879c: 4e75 rts
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
if (excess > 0) {
value += alignment - excess;
4879e: d680 addl %d0,%d3 <== NOT EXECUTED
487a0: 9681 subl %d1,%d3 <== 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) {
487a2: 4a80 tstl %d0 <== NOT EXECUTED
487a4: 67c8 beqs 4876e <rtems_rbheap_allocate+0x38> <== NOT EXECUTED
487a6: b680 cmpl %d0,%d3 <== NOT EXECUTED
487a8: 65c4 bcss 4876e <rtems_rbheap_allocate+0x38> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
487aa: 204b moveal %a3,%a0 <== NOT EXECUTED
487ac: 2458 moveal %a0@+,%a2 <== NOT EXECUTED
{
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) {
487ae: b1ca cmpal %a2,%a0 <== NOT EXECUTED
487b0: 66ae bnes 48760 <rtems_rbheap_allocate+0x2a> <== NOT EXECUTED
487b2: 60ba bras 4876e <rtems_rbheap_allocate+0x38> <== NOT EXECUTED
if (free_chunk != NULL) {
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
487b4: 2f0b movel %a3,%sp@-
487b6: 4eba fd5c jsr %pc@(48514 <get_chunk>)
if (new_chunk != NULL) {
487ba: 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);
487bc: 2840 moveal %d0,%a4
if (new_chunk != NULL) {
487be: 4a80 tstl %d0
487c0: 67ac beqs 4876e <rtems_rbheap_allocate+0x38> <== NEVER TAKEN
uintptr_t new_free_size = free_size - aligned_size;
487c2: 9483 subl %d3,%d2
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
487c4: 2002 movel %d2,%d0
487c6: d0aa 0018 addl %a2@(24),%d0
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
487ca: 2542 001c movel %d2,%a2@(28)
new_chunk->begin = free_chunk->begin + new_free_size;
487ce: 2940 0018 movel %d0,%a4@(24)
new_chunk->size = aligned_size;
487d2: 2943 001c movel %d3,%a4@(28)
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
487d6: 42ac 0004 clrl %a4@(4)
487da: 4294 clrl %a4@
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
487dc: 486c 0008 pea %a4@(8)
487e0: 486b 0018 pea %a3@(24)
487e4: 4eb9 0004 a140 jsr 4a140 <_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;
487ea: 202c 0018 movel %a4@(24),%d0
487ee: 508f addql #8,%sp
}
}
}
return ptr;
}
487f0: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4
487f6: 4e5e unlk %fp <== NOT EXECUTED
000488fa <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
488fa: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED
488fe: 2f0b movel %a3,%sp@- <== NOT EXECUTED
48900: 2f0a movel %a2,%sp@- <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
48902: 4878 0020 pea 20 <OPER2+0xc> <== NOT EXECUTED
{
/* Do nothing */
}
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
48906: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
4890a: 4eb9 0004 3b84 jsr 43b84 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
48910: 588f addql #4,%sp <== NOT EXECUTED
48912: 4a80 tstl %d0 <== NOT EXECUTED
48914: 6718 beqs 4892e <rtems_rbheap_extend_descriptors_with_malloc+0x34><== NOT EXECUTED
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
48916: 206a 000c moveal %a2@(12),%a0 <== 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);
4891a: 2240 moveal %d0,%a1 <== NOT EXECUTED
4891c: 47ea 000c lea %a2@(12),%a3 <== NOT EXECUTED
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
48920: 2540 000c movel %d0,%a2@(12) <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
48924: 234b 0004 movel %a3,%a1@(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;
48928: 2288 movel %a0,%a1@ <== NOT EXECUTED
before_node->previous = the_node;
4892a: 2140 0004 movel %d0,%a0@(4) <== NOT EXECUTED
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
4892e: 246e fff8 moveal %fp@(-8),%a2 <== NOT EXECUTED
48932: 266e fffc moveal %fp@(-4),%a3 <== NOT EXECUTED
48936: 4e5e unlk %fp <== NOT EXECUTED
...
000487fa <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
487fa: 4e56 ffc4 linkw %fp,#-60
487fe: 202e 000c movel %fp@(12),%d0
48802: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@
48806: 2a6e 0008 moveal %fp@(8),%a5
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
4880a: 4a80 tstl %d0
4880c: 6700 00cc beqw 488da <rtems_rbheap_free+0xe0>
#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 };
48810: 49ee ffe8 lea %fp@(-24),%a4
{
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;
48814: 47ed 0018 lea %a5@(24),%a3
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
48818: 246d 001c moveal %a5@(28),%a2
#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 };
4881c: 42ae ffe0 clrl %fp@(-32)
48820: 42ae ffe4 clrl %fp@(-28)
48824: 4294 clrl %a4@
48826: 42ae ffec clrl %fp@(-20)
4882a: 42ae fff0 clrl %fp@(-16)
4882e: 42ae fff4 clrl %fp@(-12)
48832: 42ae fffc clrl %fp@(-4)
48836: 2d40 fff8 movel %d0,%fp@(-8)
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
4883a: 4a8a tstl %a2
4883c: 6700 00a8 beqw 488e6 <rtems_rbheap_free+0xec>
48840: 4282 clrl %d2
compare_result = the_rbtree->compare_function(the_node, iter_node);
48842: 2f0a movel %a2,%sp@-
48844: 206b 0010 moveal %a3@(16),%a0
48848: 2f0c movel %a4,%sp@-
4884a: 4e90 jsr %a0@
if ( _RBTree_Is_equal( compare_result ) ) {
4884c: 508f addql #8,%sp
4884e: 4a80 tstl %d0
48850: 6608 bnes 4885a <rtems_rbheap_free+0x60>
found = iter_node;
if ( the_rbtree->is_unique )
48852: 240a movel %a2,%d2
48854: 4a2b 0014 tstb %a3@(20)
48858: 6612 bnes 4886c <rtems_rbheap_free+0x72> <== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
4885a: 4a80 tstl %d0
4885c: 5ec0 sgt %d0
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
4885e: 7201 moveq #1,%d1
RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater(
int compare_result
)
{
return compare_result > 0;
48860: 49c0 extbl %d0
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
48862: 9280 subl %d0,%d1
48864: 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) {
48868: 4a8a tstl %a2
4886a: 66d6 bnes 48842 <rtems_rbheap_free+0x48>
return rtems_rbheap_chunk_of_node(
4886c: 2442 moveal %d2,%a2
4886e: 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) {
48870: 70f8 moveq #-8,%d0
48872: b08a cmpl %a2,%d0
48874: 6770 beqs 488e6 <rtems_rbheap_free+0xec>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
48876: 4a92 tstl %a2@
48878: 670c beqs 48886 <rtems_rbheap_free+0x8c>
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;
4887a: 700e moveq #14,%d0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
4887c: 4cee 3c1c ffc4 moveml %fp@(-60),%d2-%d4/%a2-%a5
48882: 4e5e unlk %fp
48884: 4e75 rts
48886: 4aaa 0004 tstl %a2@(4)
4888a: 66ee bnes 4887a <rtems_rbheap_free+0x80> <== NEVER TAKEN
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
4888c: 42a7 clrl %sp@-
4888e: 283c 0004 a3c0 movel #304064,%d4
48894: 2f02 movel %d2,%sp@-
48896: 2044 moveal %d4,%a0
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);
48898: 49fa fcf6 lea %pc@(48590 <check_and_merge>),%a4
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
4889c: 4e90 jsr %a0@
4889e: 4878 0001 pea 1 <ADD>
488a2: 2044 moveal %d4,%a0
488a4: 2600 movel %d0,%d3
488a6: 2f02 movel %d2,%sp@-
488a8: 4e90 jsr %a0@
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);
488aa: 5180 subql #8,%d0
488ac: 2f00 movel %d0,%sp@-
488ae: 2f0a movel %a2,%sp@-
488b0: 2f0b movel %a3,%sp@-
488b2: 2f0d movel %a5,%sp@-
488b4: 4e94 jsr %a4@
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
488b6: 2055 moveal %a5@,%a0
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
488b8: 4fef 0020 lea %sp@(32),%sp
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
488bc: 254d 0004 movel %a5,%a2@(4)
before_node = after_node->next;
after_node->next = the_node;
488c0: 2a8a movel %a2,%a5@
the_node->next = before_node;
before_node->previous = the_node;
488c2: 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;
488c6: 2488 movel %a0,%a2@
488c8: 2043 moveal %d3,%a0
488ca: 4868 fff8 pea %a0@(-8)
488ce: 2f0a movel %a2,%sp@-
488d0: 2f0b movel %a3,%sp@-
488d2: 2f0d movel %a5,%sp@-
488d4: 4e94 jsr %a4@
488d6: 4fef 0010 lea %sp@(16),%sp
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
488da: 4280 clrl %d0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
488dc: 4cee 3c1c ffc4 moveml %fp@(-60),%d2-%d4/%a2-%a5
488e2: 4e5e unlk %fp
488e4: 4e75 rts
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
}
} else {
sc = RTEMS_INVALID_ID;
488e6: 7004 moveq #4,%d0
}
}
return sc;
}
488e8: 4cee 3c1c ffc4 moveml %fp@(-60),%d2-%d4/%a2-%a5
488ee: 4e5e unlk %fp <== NOT EXECUTED
0004860a <rtems_rbheap_initialize>:
uintptr_t area_size,
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
4860a: 4e56 fff0 linkw %fp,#-16
4860e: 202e 0014 movel %fp@(20),%d0
48612: 48d7 041c moveml %d2-%d4/%a2,%sp@
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (alignment > 0) {
48616: 4a80 tstl %d0
48618: 660c bnes 48626 <rtems_rbheap_initialize+0x1c>
}
} else {
sc = RTEMS_INVALID_ADDRESS;
}
} else {
sc = RTEMS_INVALID_NUMBER;
4861a: 700a moveq #10,%d0
}
return sc;
}
4861c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
48622: 4e5e unlk %fp
48624: 4e75 rts
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
48626: 262e 000c movel %fp@(12),%d3
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (alignment > 0) {
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
4862a: 242e 000c movel %fp@(12),%d2
4862e: d4ae 0010 addl %fp@(16),%d2
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
48632: 4c40 3001 remul %d0,%d1,%d3
if (excess > 0) {
48636: 4a81 tstl %d1
48638: 6600 00c2 bnew 486fc <rtems_rbheap_initialize+0xf2>
return value;
}
static uintptr_t align_down(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
4863c: 2602 movel %d2,%d3
return value - excess;
4863e: 2802 movel %d2,%d4
return value;
}
static uintptr_t align_down(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
48640: 4c40 3001 remul %d0,%d1,%d3
return value - excess;
48644: 9881 subl %d1,%d4
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
48646: b4ae 000c cmpl %fp@(12),%d2
4864a: 6300 00b6 blsw 48702 <rtems_rbheap_initialize+0xf8>
4864e: 262e 000c movel %fp@(12),%d3
48652: b684 cmpl %d4,%d3
48654: 6400 00ac bccw 48702 <rtems_rbheap_initialize+0xf8>
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 );
48658: 206e 0008 moveal %fp@(8),%a0
4865c: 2448 moveal %a0,%a2
4865e: 45ea 0010 lea %a2@(16),%a2
48662: 226e 0008 moveal %fp@(8),%a1
48666: 5889 addql #4,%a1
48668: 2089 movel %a1,%a0@
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
4866a: 2248 moveal %a0,%a1
4866c: 43e9 000c lea %a1@(12),%a1
Chain_Node *tail = _Chain_Tail( the_chain );
48670: 214a 000c movel %a2,%a0@(12)
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
48674: 45fa fe86 lea %pc@(484fc <chunk_compare>),%a2
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
48678: 2149 0014 movel %a1,%a0@(20)
rtems_chain_initialize_empty(free_chain);
rtems_chain_initialize_empty(&control->spare_descriptor_chain);
rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);
control->alignment = alignment;
control->handler_arg = handler_arg;
4867c: 43ee 001c lea %fp@(28),%a1
48680: 214a 0028 movel %a2,%a0@(40)
control->extend_descriptors = extend_descriptors;
48684: 45ee 0018 lea %fp@(24),%a2
rtems_chain_initialize_empty(free_chain);
rtems_chain_initialize_empty(&control->spare_descriptor_chain);
rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);
control->alignment = alignment;
control->handler_arg = handler_arg;
48688: 2151 0036 movel %a1@,%a0@(54)
control->extend_descriptors = extend_descriptors;
4868c: 2152 0032 movel %a2@,%a0@(50)
the_rbtree->is_unique = is_unique;
48690: 7201 moveq #1,%d1
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
48692: 42a8 0004 clrl %a0@(4)
48696: 1141 002c moveb %d1,%a0@(44)
tail->previous = head;
4869a: 2148 0008 movel %a0,%a0@(8)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
4869e: 42a8 0010 clrl %a0@(16)
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
486a2: 42a8 0018 clrl %a0@(24)
the_rbtree->root = NULL;
486a6: 42a8 001c clrl %a0@(28)
the_rbtree->first[0] = NULL;
486aa: 42a8 0020 clrl %a0@(32)
the_rbtree->first[1] = NULL;
486ae: 42a8 0024 clrl %a0@(36)
rtems_rbheap_chunk *first = NULL;
rtems_chain_initialize_empty(free_chain);
rtems_chain_initialize_empty(&control->spare_descriptor_chain);
rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);
control->alignment = alignment;
486b2: 2140 002e movel %d0,%a0@(46)
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
486b6: 2f08 movel %a0,%sp@-
486b8: 4eba fe5a jsr %pc@(48514 <get_chunk>)
if (first != NULL) {
486bc: 588f addql #4,%sp
rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);
control->alignment = alignment;
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
486be: 2040 moveal %d0,%a0
if (first != NULL) {
486c0: 4a80 tstl %d0
486c2: 6766 beqs 4872a <rtems_rbheap_initialize+0x120>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
486c4: 246e 0008 moveal %fp@(8),%a2
first->begin = aligned_begin;
first->size = aligned_end - aligned_begin;
486c8: 9883 subl %d3,%d4
486ca: 2252 moveal %a2@,%a1
486cc: 2144 001c movel %d4,%a0@(28)
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
if (first != NULL) {
first->begin = aligned_begin;
486d0: 2143 0018 movel %d3,%a0@(24)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
486d4: 214a 0004 movel %a2,%a0@(4)
before_node = after_node->next;
after_node->next = the_node;
486d8: 2480 movel %d0,%a2@
the_node->next = before_node;
before_node->previous = the_node;
486da: 2340 0004 movel %d0,%a1@(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;
486de: 2089 movel %a1,%a0@
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
486e0: 4868 0008 pea %a0@(8)
486e4: 486a 0018 pea %a2@(24)
486e8: 4eb9 0004 a140 jsr 4a140 <_RBTree_Insert_unprotected>
486ee: 508f addql #8,%sp
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
486f0: 4280 clrl %d0
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
486f2: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
486f8: 4e5e unlk %fp
486fa: 4e75 rts
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
486fc: b4ae 000c cmpl %fp@(12),%d2
48700: 620c bhis 4870e <rtems_rbheap_initialize+0x104>
insert_into_tree(chunk_tree, first);
} else {
sc = RTEMS_NO_MEMORY;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
48702: 7009 moveq #9,%d0
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
48704: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
4870a: 4e5e unlk %fp
4870c: 4e75 rts
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
if (excess > 0) {
value += alignment - excess;
4870e: 262e 000c movel %fp@(12),%d3
48712: d680 addl %d0,%d3
48714: 9681 subl %d1,%d3
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
48716: b6ae 000c cmpl %fp@(12),%d3
4871a: 65e6 bcss 48702 <rtems_rbheap_initialize+0xf8> <== NEVER TAKEN
return value;
}
static uintptr_t align_down(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
4871c: 2802 movel %d2,%d4
4871e: 4c40 4001 remul %d0,%d1,%d4
return value - excess;
48722: 2802 movel %d2,%d4
48724: 9881 subl %d1,%d4
48726: 6000 ff2a braw 48652 <rtems_rbheap_initialize+0x48>
first->begin = aligned_begin;
first->size = aligned_end - aligned_begin;
add_to_chain(free_chain, first);
insert_into_tree(chunk_tree, first);
} else {
sc = RTEMS_NO_MEMORY;
4872a: 701a moveq #26,%d0
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
4872c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2
48732: 4e5e unlk %fp <== NOT EXECUTED
00055e80 <rtems_region_extend>:
rtems_status_code rtems_region_extend(
rtems_id id,
void *starting_address,
uintptr_t length
)
{
55e80: 4e56 fffc linkw %fp,#-4
55e84: 2f0a movel %a2,%sp@-
55e86: 2f02 movel %d2,%sp@-
uintptr_t amount_extended;
Objects_Locations location;
rtems_status_code return_status;
Region_Control *the_region;
if ( !starting_address )
55e88: 4aae 000c tstl %fp@(12)
55e8c: 6700 0082 beqw 55f10 <rtems_region_extend+0x90>
return RTEMS_INVALID_ADDRESS;
_RTEMS_Lock_allocator(); /* to prevent deletion */
55e90: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
55e96: 4eb9 0005 8718 jsr 58718 <_API_Mutex_Lock>
RTEMS_INLINE_ROUTINE Region_Control *_Region_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Region_Control *)
55e9c: 486e fffc pea %fp@(-4)
55ea0: 2f2e 0008 movel %fp@(8),%sp@-
55ea4: 4879 0007 d95e pea 7d95e <_Region_Information>
55eaa: 4eb9 0005 a574 jsr 5a574 <_Objects_Get_no_protection>
the_region = _Region_Get( id, &location );
switch ( location ) {
55eb0: 4fef 0010 lea %sp@(16),%sp
55eb4: 2440 moveal %d0,%a2
55eb6: 4aae fffc tstl %fp@(-4)
55eba: 6642 bnes 55efe <rtems_region_extend+0x7e>
case OBJECTS_LOCAL:
amount_extended = _Heap_Extend(
55ebc: 42a7 clrl %sp@-
55ebe: 2f2e 0010 movel %fp@(16),%sp@-
55ec2: 2f2e 000c movel %fp@(12),%sp@-
55ec6: 486a 0068 pea %a2@(104)
55eca: 4eb9 0005 95b0 jsr 595b0 <_Heap_Extend>
starting_address,
length,
0
);
if ( amount_extended > 0 ) {
55ed0: 4fef 0010 lea %sp@(16),%sp
55ed4: 4a80 tstl %d0
55ed6: 6748 beqs 55f20 <rtems_region_extend+0xa0>
the_region->length += amount_extended;
55ed8: d1aa 0054 addl %d0,%a2@(84)
the_region->maximum_segment_size += amount_extended;
return_status = RTEMS_SUCCESSFUL;
55edc: 4282 clrl %d2
0
);
if ( amount_extended > 0 ) {
the_region->length += amount_extended;
the_region->maximum_segment_size += amount_extended;
55ede: d1aa 005c addl %d0,%a2@(92)
default:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
55ee2: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
55ee8: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
55eee: 588f addql #4,%sp
return return_status;
}
55ef0: 2002 movel %d2,%d0
55ef2: 242e fff4 movel %fp@(-12),%d2
55ef6: 246e fff8 moveal %fp@(-8),%a2
55efa: 4e5e unlk %fp
55efc: 4e75 rts
default:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
55efe: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
break;
#endif
case OBJECTS_ERROR:
default:
return_status = RTEMS_INVALID_ID;
55f04: 7404 moveq #4,%d2
break;
}
_RTEMS_Unlock_allocator();
55f06: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
55f0c: 588f addql #4,%sp
55f0e: 60e0 bras 55ef0 <rtems_region_extend+0x70>
Objects_Locations location;
rtems_status_code return_status;
Region_Control *the_region;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
55f10: 7409 moveq #9,%d2
break;
}
_RTEMS_Unlock_allocator();
return return_status;
}
55f12: 2002 movel %d2,%d0
55f14: 242e fff4 movel %fp@(-12),%d2
55f18: 246e fff8 moveal %fp@(-8),%a2
55f1c: 4e5e unlk %fp
55f1e: 4e75 rts
default:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
55f20: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
if ( amount_extended > 0 ) {
the_region->length += amount_extended;
the_region->maximum_segment_size += amount_extended;
return_status = RTEMS_SUCCESSFUL;
} else {
return_status = RTEMS_INVALID_ADDRESS;
55f26: 7409 moveq #9,%d2
default:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
55f28: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
55f2e: 588f addql #4,%sp
55f30: 60be bras 55ef0 <rtems_region_extend+0x70>
...
00055fcc <rtems_region_get_information>:
rtems_status_code rtems_region_get_information(
rtems_id id,
Heap_Information_block *the_info
)
{
55fcc: 4e56 fffc linkw %fp,#-4
55fd0: 2f02 movel %d2,%sp@-
Objects_Locations location;
rtems_status_code return_status;
register Region_Control *the_region;
if ( !the_info )
55fd2: 4aae 000c tstl %fp@(12)
55fd6: 6768 beqs 56040 <rtems_region_get_information+0x74><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
_RTEMS_Lock_allocator();
55fd8: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
55fde: 4eb9 0005 8718 jsr 58718 <_API_Mutex_Lock>
55fe4: 486e fffc pea %fp@(-4)
55fe8: 2f2e 0008 movel %fp@(8),%sp@-
55fec: 4879 0007 d95e pea 7d95e <_Region_Information>
55ff2: 4eb9 0005 a574 jsr 5a574 <_Objects_Get_no_protection>
the_region = _Region_Get( id, &location );
switch ( location ) {
55ff8: 4fef 0010 lea %sp@(16),%sp
55ffc: 4aae fffc tstl %fp@(-4)
56000: 662c bnes 5602e <rtems_region_get_information+0x62>
case OBJECTS_LOCAL:
_Heap_Get_information( &the_region->Memory, the_info );
56002: 2f2e 000c movel %fp@(12),%sp@-
56006: 2040 moveal %d0,%a0
56008: 4868 0068 pea %a0@(104)
return_status = RTEMS_SUCCESSFUL;
5600c: 4282 clrl %d2
the_region = _Region_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
_Heap_Get_information( &the_region->Memory, the_info );
5600e: 4eb9 0005 9a18 jsr 59a18 <_Heap_Get_information>
return_status = RTEMS_SUCCESSFUL;
break;
56014: 508f addql #8,%sp
default:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
56016: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
5601c: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
56022: 588f addql #4,%sp
return return_status;
}
56024: 2002 movel %d2,%d0
56026: 242e fff8 movel %fp@(-8),%d2
5602a: 4e5e unlk %fp
5602c: 4e75 rts
default:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
5602e: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
break;
#endif
case OBJECTS_ERROR:
default:
return_status = RTEMS_INVALID_ID;
56034: 7404 moveq #4,%d2
break;
}
_RTEMS_Unlock_allocator();
56036: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
5603c: 588f addql #4,%sp
5603e: 60e4 bras 56024 <rtems_region_get_information+0x58>
Objects_Locations location;
rtems_status_code return_status;
register Region_Control *the_region;
if ( !the_info )
return RTEMS_INVALID_ADDRESS;
56040: 7409 moveq #9,%d2
break;
}
_RTEMS_Unlock_allocator();
return return_status;
}
56042: 2002 movel %d2,%d0
56044: 242e fff8 movel %fp@(-8),%d2
56048: 4e5e unlk %fp <== NOT EXECUTED
000561bc <rtems_region_get_segment_size>:
rtems_status_code rtems_region_get_segment_size(
rtems_id id,
void *segment,
uintptr_t *size
)
{
561bc: 4e56 fff8 linkw %fp,#-8
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
register Region_Control *the_region;
if ( !segment )
561c0: 4aae 000c tstl %fp@(12)
561c4: 6768 beqs 5622e <rtems_region_get_segment_size+0x72>
return RTEMS_INVALID_ADDRESS;
if ( !size )
561c6: 4aae 0010 tstl %fp@(16)
561ca: 6762 beqs 5622e <rtems_region_get_segment_size+0x72>
return RTEMS_INVALID_ADDRESS;
_RTEMS_Lock_allocator();
561cc: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
561d2: 4eb9 0005 8718 jsr 58718 <_API_Mutex_Lock>
561d8: 486e fffc pea %fp@(-4)
561dc: 2f2e 0008 movel %fp@(8),%sp@-
561e0: 4879 0007 d95e pea 7d95e <_Region_Information>
561e6: 4eb9 0005 a574 jsr 5a574 <_Objects_Get_no_protection>
the_region = _Region_Get( id, &location );
switch ( location ) {
561ec: 222e fffc movel %fp@(-4),%d1
561f0: 4fef 0010 lea %sp@(16),%sp
561f4: 663e bnes 56234 <rtems_region_get_segment_size+0x78>
case OBJECTS_LOCAL:
if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) )
561f6: 2f2e 0010 movel %fp@(16),%sp@-
561fa: 2040 moveal %d0,%a0
561fc: 2f2e 000c movel %fp@(12),%sp@-
56200: 4868 0068 pea %a0@(104)
56204: 4eb9 0005 9f50 jsr 59f50 <_Heap_Size_of_alloc_area>
5620a: 4fef 000c lea %sp@(12),%sp
5620e: 4a00 tstb %d0
56210: 675c beqs 5626e <rtems_region_get_segment_size+0xb2><== NEVER TAKEN
void *segment,
uintptr_t *size
)
{
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
56212: 4280 clrl %d0
case OBJECTS_ERROR:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
56214: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
5621a: 2d40 fff8 movel %d0,%fp@(-8)
5621e: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
56224: 202e fff8 movel %fp@(-8),%d0
56228: 588f addql #4,%sp
return return_status;
}
5622a: 4e5e unlk %fp
5622c: 4e75 rts
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
register Region_Control *the_region;
if ( !segment )
return RTEMS_INVALID_ADDRESS;
5622e: 7009 moveq #9,%d0
break;
}
_RTEMS_Unlock_allocator();
return return_status;
}
56230: 4e5e unlk %fp
56232: 4e75 rts
return RTEMS_INVALID_ADDRESS;
_RTEMS_Lock_allocator();
the_region = _Region_Get( id, &location );
switch ( location ) {
56234: 7001 moveq #1,%d0
56236: b081 cmpl %d1,%d0
56238: 671a beqs 56254 <rtems_region_get_segment_size+0x98><== ALWAYS TAKEN
void *segment,
uintptr_t *size
)
{
Objects_Locations location;
rtems_status_code return_status = RTEMS_SUCCESSFUL;
5623a: 4200 clrb %d0 <== NOT EXECUTED
case OBJECTS_ERROR:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
5623c: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED
56242: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED
56246: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock> <== NOT EXECUTED
5624c: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED
56250: 588f addql #4,%sp <== NOT EXECUTED
56252: 60d6 bras 5622a <rtems_region_get_segment_size+0x6e><== NOT EXECUTED
case OBJECTS_REMOTE: /* this error cannot be returned */
break;
#endif
case OBJECTS_ERROR:
return_status = RTEMS_INVALID_ID;
56254: 7004 moveq #4,%d0
break;
}
_RTEMS_Unlock_allocator();
56256: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@-
5625c: 2d40 fff8 movel %d0,%fp@(-8)
56260: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock>
56266: 202e fff8 movel %fp@(-8),%d0
5626a: 588f addql #4,%sp
5626c: 60bc bras 5622a <rtems_region_get_segment_size+0x6e>
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;
5626e: 7009 moveq #9,%d0 <== NOT EXECUTED
case OBJECTS_ERROR:
return_status = RTEMS_INVALID_ID;
break;
}
_RTEMS_Unlock_allocator();
56270: 2f39 0007 daee movel 7daee <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED
56276: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED
5627a: 4eb9 0005 8778 jsr 58778 <_API_Mutex_Unlock> <== NOT EXECUTED
56280: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED
56284: 588f addql #4,%sp <== NOT EXECUTED
56286: 60a2 bras 5622a <rtems_region_get_segment_size+0x6e><== NOT EXECUTED
00047194 <rtems_semaphore_create>:
uint32_t count,
rtems_attribute attribute_set,
rtems_task_priority priority_ceiling,
rtems_id *id
)
{
47194: 4e56 ffe8 linkw %fp,#-24
47198: 2f0a movel %a2,%sp@-
4719a: 2f02 movel %d2,%sp@-
register Semaphore_Control *the_semaphore;
CORE_mutex_Attributes the_mutex_attr;
CORE_semaphore_Attributes the_semaphore_attr;
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
4719c: 4aae 0008 tstl %fp@(8)
471a0: 660e bnes 471b0 <rtems_semaphore_create+0x1c>
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
471a2: 242e ffe0 movel %fp@(-32),%d2
CORE_mutex_Attributes the_mutex_attr;
CORE_semaphore_Attributes the_semaphore_attr;
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
471a6: 7003 moveq #3,%d0
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
471a8: 246e ffe4 moveal %fp@(-28),%a2
471ac: 4e5e unlk %fp
471ae: 4e75 rts
CORE_mutex_Status mutex_status;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
471b0: 4aae 0018 tstl %fp@(24)
471b4: 6726 beqs 471dc <rtems_semaphore_create+0x48>
* id - semaphore id
* RTEMS_SUCCESSFUL - if successful
* error code - if unsuccessful
*/
rtems_status_code rtems_semaphore_create(
471b6: 202e 0010 movel %fp@(16),%d0
471ba: 0280 0000 00c0 andil #192,%d0
return RTEMS_NOT_DEFINED;
} else
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
471c0: 6728 beqs 471ea <rtems_semaphore_create+0x56>
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore(
rtems_attribute attribute_set
)
{
return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE);
471c2: 7230 moveq #48,%d1
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
471c4: 7410 moveq #16,%d2
471c6: c2ae 0010 andl %fp@(16),%d1
471ca: b481 cmpl %d1,%d2
471cc: 673a beqs 47208 <rtems_semaphore_create+0x74>
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
471ce: 700b moveq #11,%d0
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
471d0: 242e ffe0 movel %fp@(-32),%d2
471d4: 246e ffe4 moveal %fp@(-28),%a2
471d8: 4e5e unlk %fp
471da: 4e75 rts
471dc: 242e ffe0 movel %fp@(-32),%d2
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !id )
return RTEMS_INVALID_ADDRESS;
471e0: 7009 moveq #9,%d0
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
471e2: 246e ffe4 moveal %fp@(-28),%a2
471e6: 4e5e unlk %fp
471e8: 4e75 rts
*/
RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore(
rtems_attribute attribute_set
)
{
return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE);
471ea: 7430 moveq #48,%d2
471ec: c4ae 0010 andl %fp@(16),%d2
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
_Attributes_Is_priority_ceiling( attribute_set ) )
return RTEMS_NOT_DEFINED;
if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) )
471f0: 672a beqs 4721c <rtems_semaphore_create+0x88>
471f2: 7001 moveq #1,%d0
471f4: b0ae 000c cmpl %fp@(12),%d0
471f8: 6422 bccs 4721c <rtems_semaphore_create+0x88>
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
471fa: 242e ffe0 movel %fp@(-32),%d2
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
_Attributes_Is_priority_ceiling( attribute_set ) )
return RTEMS_NOT_DEFINED;
if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) )
return RTEMS_INVALID_NUMBER;
471fe: 700a moveq #10,%d0
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
47200: 246e ffe4 moveal %fp@(-28),%a2
47204: 4e5e unlk %fp
47206: 4e75 rts
#endif
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
47208: 222e 0010 movel %fp@(16),%d1
4720c: 44c1 movew %d1,%ccr
4720e: 66be bnes 471ce <rtems_semaphore_create+0x3a>
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
}
if ( _Attributes_Is_inherit_priority( attribute_set ) &&
47210: 0c80 0000 00c0 cmpil #192,%d0
47216: 66da bnes 471f2 <rtems_semaphore_create+0x5e>
if ( _Attributes_Is_inherit_priority( attribute_set ) ||
_Attributes_Is_priority_ceiling( attribute_set ) ) {
if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) &&
_Attributes_Is_priority( attribute_set ) ) )
return RTEMS_NOT_DEFINED;
47218: 700b moveq #11,%d0
4721a: 60b4 bras 471d0 <rtems_semaphore_create+0x3c>
*
* 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;
4721c: 2039 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d0
++level;
47222: 5280 addql #1,%d0
_Thread_Dispatch_disable_level = level;
47224: 23c0 0006 0fe6 movel %d0,60fe6 <_Thread_Dispatch_disable_level>
* This function allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.
*/
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
{
return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
4722a: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
47230: 4eb9 0004 8a3c jsr 48a3c <_Objects_Allocate>
_Thread_Disable_dispatch(); /* prevents deletion */
the_semaphore = _Semaphore_Allocate();
if ( !the_semaphore ) {
47236: 588f addql #4,%sp
47238: 2440 moveal %d0,%a2
4723a: 4a80 tstl %d0
4723c: 6700 00e2 beqw 47320 <rtems_semaphore_create+0x18c>
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_semaphore->attribute_set = attribute_set;
47240: 222e 0010 movel %fp@(16),%d1
47244: 2541 0010 movel %d1,%a2@(16)
/*
* Initialize it as a counting semaphore.
*/
if ( _Attributes_Is_counting_semaphore( attribute_set ) ) {
47248: 4a82 tstl %d2
4724a: 6668 bnes 472b4 <rtems_semaphore_create+0x120>
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
_CORE_semaphore_Initialize(
4724c: 2f2e 000c movel %fp@(12),%sp@-
*/
if ( _Attributes_Is_counting_semaphore( attribute_set ) ) {
/*
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
47250: 74ff moveq #-1,%d2
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
_CORE_semaphore_Initialize(
47252: 486e ffea pea %fp@(-22)
47256: 486a 0014 pea %a2@(20)
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
if ( _Attributes_Is_priority( attribute_set ) )
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
4725a: 44c1 movew %d1,%ccr
4725c: 56c0 sne %d0
*/
if ( _Attributes_Is_counting_semaphore( attribute_set ) ) {
/*
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
4725e: 2d42 ffea movel %d2,%fp@(-22)
if ( _Attributes_Is_priority( attribute_set ) )
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
47262: 49c0 extbl %d0
47264: 5280 addql #1,%d0
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
47266: 42ae fff2 clrl %fp@(-14)
* This effectively disables limit checking.
*/
the_semaphore_attr.maximum_count = 0xFFFFFFFF;
if ( _Attributes_Is_priority( attribute_set ) )
the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY;
4726a: 2d40 ffee movel %d0,%fp@(-18)
/*
* The following are just to make Purify happy.
*/
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM;
4726e: 42ae fffc clrl %fp@(-4)
_CORE_semaphore_Initialize(
47272: 4eb9 0004 83fc jsr 483fc <_CORE_semaphore_Initialize>
47278: 4fef 000c lea %sp@(12),%sp
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
4727c: 202a 0008 movel %a2@(8),%d0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
47280: 2200 movel %d0,%d1
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47282: 2079 0006 0f2c moveal 60f2c <_Semaphore_Information+0x18>,%a0
Objects_Information *information,
Objects_Control *the_object,
Objects_Name name
)
{
_Objects_Set_local_object(
47288: 0281 0000 ffff andil #65535,%d1
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
4728e: 242e 0008 movel %fp@(8),%d2
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
47292: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4)
&_Semaphore_Information,
&the_semaphore->Object,
(Objects_Name) name
);
*id = the_semaphore->Object.id;
47296: 206e 0018 moveal %fp@(24),%a0
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
4729a: 2542 000c movel %d2,%a2@(12)
4729e: 2080 movel %d0,%a0@
the_semaphore->Object.id,
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
472a0: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
}
472a6: 242e ffe0 movel %fp@(-32),%d2
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
472aa: 4280 clrl %d0
}
472ac: 246e ffe4 moveal %fp@(-28),%a2
472b0: 4e5e unlk %fp
472b2: 4e75 rts
/*
* It is either simple binary semaphore or a more powerful mutex
* style binary semaphore. This is the mutex style.
*/
if ( _Attributes_Is_priority( attribute_set ) )
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
472b4: 202e 0010 movel %fp@(16),%d0
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
472b8: 7210 moveq #16,%d1
/*
* It is either simple binary semaphore or a more powerful mutex
* style binary semaphore. This is the mutex style.
*/
if ( _Attributes_Is_priority( attribute_set ) )
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
472ba: 44c0 movew %d0,%ccr
472bc: 56c0 sne %d0
472be: 49c0 extbl %d0
472c0: 5280 addql #1,%d0
472c2: 2d40 fff8 movel %d0,%fp@(-8)
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
472c6: b282 cmpl %d2,%d1
472c8: 676a beqs 47334 <rtems_semaphore_create+0x1a0>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
the_mutex_attr.only_owner_release = true;
}
}
} else /* must be simple binary semaphore */ {
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS;
472ca: 7202 moveq #2,%d1
the_mutex_attr.only_owner_release = false;
472cc: 4202 clrb %d2
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
the_mutex_attr.only_owner_release = true;
}
}
} else /* must be simple binary semaphore */ {
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS;
472ce: 2d41 fff2 movel %d1,%fp@(-14)
the_mutex_attr.only_owner_release = false;
472d2: 1d42 fff6 moveb %d2,%fp@(-10)
}
mutex_status = _CORE_mutex_Initialize(
472d6: 7001 moveq #1,%d0
472d8: b0ae 000c cmpl %fp@(12),%d0
472dc: 57c0 seq %d0
472de: 49c0 extbl %d0
472e0: 4480 negl %d0
472e2: 2f00 movel %d0,%sp@-
472e4: 486e fff2 pea %fp@(-14)
472e8: 486a 0014 pea %a2@(20)
472ec: 4eb9 0004 807c jsr 4807c <_CORE_mutex_Initialize>
&the_semaphore->Core_control.mutex,
&the_mutex_attr,
(count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED
);
if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) {
472f2: 4fef 000c lea %sp@(12),%sp
472f6: 7206 moveq #6,%d1
472f8: b280 cmpl %d0,%d1
472fa: 6680 bnes 4727c <rtems_semaphore_create+0xe8>
*/
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
472fc: 2f0a movel %a2,%sp@-
472fe: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
47304: 4eb9 0004 8db4 jsr 48db4 <_Objects_Free>
_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
4730a: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
47310: 242e ffe0 movel %fp@(-32),%d2
(count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED
);
if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) {
_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
47314: 508f addql #8,%sp
return RTEMS_INVALID_PRIORITY;
47316: 7013 moveq #19,%d0
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
47318: 246e ffe4 moveal %fp@(-28),%a2
4731c: 4e5e unlk %fp
4731e: 4e75 rts
_Thread_Disable_dispatch(); /* prevents deletion */
the_semaphore = _Semaphore_Allocate();
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
47320: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
47326: 242e ffe0 movel %fp@(-32),%d2
the_semaphore = _Semaphore_Allocate();
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
4732a: 7005 moveq #5,%d0
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
4732c: 246e ffe4 moveal %fp@(-28),%a2
47330: 4e5e unlk %fp
47332: 4e75 rts
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
the_mutex_attr.priority_ceiling = priority_ceiling;
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
47334: 42ae fff2 clrl %fp@(-14)
the_mutex_attr.only_owner_release = false;
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
47338: 7001 moveq #1,%d0
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
the_mutex_attr.priority_ceiling = priority_ceiling;
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.only_owner_release = false;
4733a: 4202 clrb %d2
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY;
else
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO;
if ( _Attributes_Is_binary_semaphore( attribute_set ) ) {
the_mutex_attr.priority_ceiling = priority_ceiling;
4733c: 2d6e 0014 fffc movel %fp@(20),%fp@(-4)
the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES;
the_mutex_attr.only_owner_release = false;
47342: 1d42 fff6 moveb %d2,%fp@(-10)
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
47346: b0ae fff8 cmpl %fp@(-8),%d0
4734a: 668a bnes 472d6 <rtems_semaphore_create+0x142>
if ( _Attributes_Is_inherit_priority( attribute_set ) ) {
4734c: 222e 0010 movel %fp@(16),%d1
47350: 0801 0006 btst #6,%d1
47354: 670e beqs 47364 <rtems_semaphore_create+0x1d0>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
47356: 7402 moveq #2,%d2
47358: 2d42 fff8 movel %d2,%fp@(-8)
the_mutex_attr.only_owner_release = true;
4735c: 1d40 fff6 moveb %d0,%fp@(-10)
47360: 6000 ff74 braw 472d6 <rtems_semaphore_create+0x142>
} else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) {
47364: 222e 0010 movel %fp@(16),%d1
47368: 4a01 tstb %d1
4736a: 6c00 ff6a bgew 472d6 <rtems_semaphore_create+0x142>
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
4736e: 7403 moveq #3,%d2
the_mutex_attr.only_owner_release = true;
47370: 7001 moveq #1,%d0
if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) {
if ( _Attributes_Is_inherit_priority( attribute_set ) ) {
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
the_mutex_attr.only_owner_release = true;
} else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) {
the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
47372: 2d42 fff8 movel %d2,%fp@(-8)
the_mutex_attr.only_owner_release = true;
47376: 1d40 fff6 moveb %d0,%fp@(-10)
4737a: 6000 ff5a braw 472d6 <rtems_semaphore_create+0x142>
...
00047380 <rtems_semaphore_delete>:
#endif
rtems_status_code rtems_semaphore_delete(
rtems_id id
)
{
47380: 4e56 fffc linkw %fp,#-4
47384: 2f0a movel %a2,%sp@-
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Semaphore_Control *)
47386: 486e fffc pea %fp@(-4)
4738a: 2f2e 0008 movel %fp@(8),%sp@-
4738e: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
47394: 4eb9 0004 8f34 jsr 48f34 <_Objects_Get>
register Semaphore_Control *the_semaphore;
Objects_Locations location;
the_semaphore = _Semaphore_Get( id, &location );
switch ( location ) {
4739a: 4fef 000c lea %sp@(12),%sp
4739e: 2440 moveal %d0,%a2
473a0: 4aae fffc tstl %fp@(-4)
473a4: 6624 bnes 473ca <rtems_semaphore_delete+0x4a>
473a6: 7030 moveq #48,%d0
473a8: c0aa 0010 andl %a2@(16),%d0
case OBJECTS_LOCAL:
if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
473ac: 6726 beqs 473d4 <rtems_semaphore_delete+0x54>
if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) &&
473ae: 4aaa 0062 tstl %a2@(98)
473b2: 6664 bnes 47418 <rtems_semaphore_delete+0x98>
473b4: 7220 moveq #32,%d1
473b6: b280 cmpl %d0,%d1
473b8: 675e beqs 47418 <rtems_semaphore_delete+0x98>
!_Attributes_Is_simple_binary_semaphore(
the_semaphore->attribute_set ) ) {
_Thread_Enable_dispatch();
473ba: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
473c0: 246e fff8 moveal %fp@(-8),%a2
if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) &&
!_Attributes_Is_simple_binary_semaphore(
the_semaphore->attribute_set ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
473c4: 700c moveq #12,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
473c6: 4e5e unlk %fp
473c8: 4e75 rts
473ca: 246e fff8 moveal %fp@(-8),%a2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
473ce: 7004 moveq #4,%d0
}
473d0: 4e5e unlk %fp
473d2: 4e75 rts
&the_semaphore->Core_control.mutex,
SEMAPHORE_MP_OBJECT_WAS_DELETED,
CORE_MUTEX_WAS_DELETED
);
} else {
_CORE_semaphore_Flush(
473d4: 4878 0002 pea 2 <DOUBLE_FLOAT>
473d8: 42a7 clrl %sp@-
473da: 486a 0014 pea %a2@(20)
473de: 4eb9 0004 83f0 jsr 483f0 <_CORE_semaphore_Flush>
473e4: 4fef 000c lea %sp@(12),%sp
SEMAPHORE_MP_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_WAS_DELETED
);
}
_Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
473e8: 2f0a movel %a2,%sp@-
473ea: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
473f0: 4eb9 0004 8acc jsr 48acc <_Objects_Close>
*/
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
473f6: 2f0a movel %a2,%sp@-
473f8: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
473fe: 4eb9 0004 8db4 jsr 48db4 <_Objects_Free>
0, /* Not used */
0 /* Not used */
);
}
#endif
_Thread_Enable_dispatch();
47404: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
4740a: 4fef 0010 lea %sp@(16),%sp
return RTEMS_SUCCESSFUL;
4740e: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
47410: 246e fff8 moveal %fp@(-8),%a2
47414: 4e5e unlk %fp
47416: 4e75 rts
!_Attributes_Is_simple_binary_semaphore(
the_semaphore->attribute_set ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
_CORE_mutex_Flush(
47418: 4878 0004 pea 4 <CONTEXT_ARG>
4741c: 42a7 clrl %sp@-
4741e: 486a 0014 pea %a2@(20)
47422: 4eb9 0004 8070 jsr 48070 <_CORE_mutex_Flush>
47428: 4fef 000c lea %sp@(12),%sp
SEMAPHORE_MP_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_WAS_DELETED
);
}
_Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
4742c: 2f0a movel %a2,%sp@-
4742e: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
47434: 4eb9 0004 8acc jsr 48acc <_Objects_Close>
4743a: 2f0a movel %a2,%sp@-
4743c: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
47442: 4eb9 0004 8db4 jsr 48db4 <_Objects_Free>
0, /* Not used */
0 /* Not used */
);
}
#endif
_Thread_Enable_dispatch();
47448: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
4744e: 4fef 0010 lea %sp@(16),%sp
return RTEMS_SUCCESSFUL;
47452: 4280 clrl %d0
47454: 60ba bras 47410 <rtems_semaphore_delete+0x90>
...
000510f8 <rtems_semaphore_flush>:
#endif
rtems_status_code rtems_semaphore_flush(
rtems_id id
)
{
510f8: 4e56 fffc linkw %fp,#-4
510fc: 486e fffc pea %fp@(-4)
51100: 2f2e 0008 movel %fp@(8),%sp@-
51104: 4879 0006 54e8 pea 654e8 <_Semaphore_Information>
5110a: 4eb9 0004 a898 jsr 4a898 <_Objects_Get>
register Semaphore_Control *the_semaphore;
Objects_Locations location;
the_semaphore = _Semaphore_Get( id, &location );
switch ( location ) {
51110: 4fef 000c lea %sp@(12),%sp
51114: 4aae fffc tstl %fp@(-4)
51118: 662a bnes 51144 <rtems_semaphore_flush+0x4c>
5111a: 7230 moveq #48,%d1
5111c: 2040 moveal %d0,%a0
5111e: c2a8 0010 andl %a0@(16),%d1
case OBJECTS_LOCAL:
if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
51122: 6726 beqs 5114a <rtems_semaphore_flush+0x52>
_CORE_mutex_Flush(
51124: 4878 0001 pea 1 <ADD>
51128: 42a7 clrl %sp@-
5112a: 4868 0014 pea %a0@(20)
5112e: 4eb9 0004 99d4 jsr 499d4 <_CORE_mutex_Flush>
51134: 4fef 000c lea %sp@(12),%sp
&the_semaphore->Core_control.semaphore,
SEND_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT
);
}
_Thread_Enable_dispatch();
51138: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
5113e: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
51140: 4e5e unlk %fp
51142: 4e75 rts
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
51144: 7004 moveq #4,%d0
}
51146: 4e5e unlk %fp
51148: 4e75 rts
&the_semaphore->Core_control.mutex,
SEND_OBJECT_WAS_DELETED,
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT
);
} else {
_CORE_semaphore_Flush(
5114a: 4878 0001 pea 1 <ADD>
5114e: 2040 moveal %d0,%a0
51150: 42a7 clrl %sp@-
51152: 4868 0014 pea %a0@(20)
51156: 4eb9 0004 9d54 jsr 49d54 <_CORE_semaphore_Flush>
5115c: 4fef 000c lea %sp@(12),%sp
&the_semaphore->Core_control.semaphore,
SEND_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT
);
}
_Thread_Enable_dispatch();
51160: 4eb9 0004 b63c jsr 4b63c <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
51166: 4280 clrl %d0
51168: 60d6 bras 51140 <rtems_semaphore_flush+0x48>
...
00047458 <rtems_semaphore_obtain>:
rtems_status_code rtems_semaphore_obtain(
rtems_id id,
rtems_option option_set,
rtems_interval timeout
)
{
47458: 4e56 fff8 linkw %fp,#-8
4745c: 2f02 movel %d2,%sp@-
Objects_Id id,
Objects_Locations *location,
ISR_Level *level
)
{
return (Semaphore_Control *)
4745e: 486e fffc pea %fp@(-4)
47462: 486e fff8 pea %fp@(-8)
47466: 2f2e 0008 movel %fp@(8),%sp@-
4746a: 4879 0006 0f14 pea 60f14 <_Semaphore_Information>
47470: 4eb9 0004 8ecc jsr 48ecc <_Objects_Get_isr_disable>
register Semaphore_Control *the_semaphore;
Objects_Locations location;
ISR_Level level;
the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level );
switch ( location ) {
47476: 4fef 0010 lea %sp@(16),%sp
4747a: 4aae fff8 tstl %fp@(-8)
4747e: 6650 bnes 474d0 <rtems_semaphore_obtain+0x78>
47480: 7230 moveq #48,%d1
47482: 2040 moveal %d0,%a0
47484: c2a8 0010 andl %a0@(16),%d1
case OBJECTS_LOCAL:
if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
47488: 6650 bnes 474da <rtems_semaphore_obtain+0x82>
return _Semaphore_Translate_core_mutex_return_code(
_Thread_Executing->Wait.return_code );
}
/* must be a counting semaphore */
_CORE_semaphore_Seize_isr_disable(
4748a: 222e 000c movel %fp@(12),%d1
4748e: 0801 0000 btst #0,%d1
47492: 6700 00a6 beqw 4753a <rtems_semaphore_obtain+0xe2>
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( the_semaphore->count != 0 ) {
47496: 2240 moveal %d0,%a1
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
47498: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( the_semaphore->count != 0 ) {
4749e: 2229 005c movel %a1@(92),%d1
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
474a2: 42a8 0034 clrl %a0@(52)
if ( the_semaphore->count != 0 ) {
474a6: 4a81 tstl %d1
474a8: 666e bnes 47518 <rtems_semaphore_obtain+0xc0>
_ISR_Enable( *level_p );
return;
}
if ( !wait ) {
_ISR_Enable( *level_p );
474aa: 202e fffc movel %fp@(-4),%d0
474ae: 46c0 movew %d0,%sr
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT;
474b0: 7001 moveq #1,%d0
474b2: 2140 0034 movel %d0,%a0@(52)
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
&level
);
return _Semaphore_Translate_core_semaphore_return_code(
_Thread_Executing->Wait.return_code );
474b6: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
id,
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
&level
);
return _Semaphore_Translate_core_semaphore_return_code(
474bc: 2f28 0034 movel %a0@(52),%sp@-
474c0: 4eb9 0004 765a jsr 4765a <_Semaphore_Translate_core_semaphore_return_code>
474c6: 588f addql #4,%sp
break;
}
return RTEMS_INVALID_ID;
}
474c8: 242e fff4 movel %fp@(-12),%d2
474cc: 4e5e unlk %fp
474ce: 4e75 rts
474d0: 242e fff4 movel %fp@(-12),%d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
474d4: 7004 moveq #4,%d0
}
474d6: 4e5e unlk %fp
474d8: 4e75 rts
the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level );
switch ( location ) {
case OBJECTS_LOCAL:
if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
_CORE_mutex_Seize(
474da: 2f2e fffc movel %fp@(-4),%sp@-
474de: 7401 moveq #1,%d2
474e0: 222e 000c movel %fp@(12),%d1
474e4: 4681 notl %d1
474e6: 2f2e 0010 movel %fp@(16),%sp@-
474ea: c481 andl %d1,%d2
474ec: 2f02 movel %d2,%sp@-
474ee: 2f2e 0008 movel %fp@(8),%sp@-
474f2: 4868 0014 pea %a0@(20)
474f6: 4eb9 0004 8204 jsr 48204 <_CORE_mutex_Seize>
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
level
);
return _Semaphore_Translate_core_mutex_return_code(
_Thread_Executing->Wait.return_code );
474fc: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
id,
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
level
);
return _Semaphore_Translate_core_mutex_return_code(
47502: 2f28 0034 movel %a0@(52),%sp@-
47506: 4eb9 0004 7644 jsr 47644 <_Semaphore_Translate_core_mutex_return_code>
break;
}
return RTEMS_INVALID_ID;
}
4750c: 242e fff4 movel %fp@(-12),%d2
id,
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
level
);
return _Semaphore_Translate_core_mutex_return_code(
47510: 4fef 0018 lea %sp@(24),%sp
break;
}
return RTEMS_INVALID_ID;
}
47514: 4e5e unlk %fp
47516: 4e75 rts
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( the_semaphore->count != 0 ) {
the_semaphore->count -= 1;
47518: 5381 subql #1,%d1
4751a: 2040 moveal %d0,%a0
4751c: 2141 005c movel %d1,%a0@(92)
_ISR_Enable( *level_p );
47520: 202e fffc movel %fp@(-4),%d0
47524: 46c0 movew %d0,%sr
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
&level
);
return _Semaphore_Translate_core_semaphore_return_code(
_Thread_Executing->Wait.return_code );
47526: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
id,
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
&level
);
return _Semaphore_Translate_core_semaphore_return_code(
4752c: 2f28 0034 movel %a0@(52),%sp@-
47530: 4eb9 0004 765a jsr 4765a <_Semaphore_Translate_core_semaphore_return_code>
47536: 588f addql #4,%sp
47538: 608e bras 474c8 <rtems_semaphore_obtain+0x70>
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( the_semaphore->count != 0 ) {
4753a: 2240 moveal %d0,%a1
{
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
4753c: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( the_semaphore->count != 0 ) {
47542: 2229 005c movel %a1@(92),%d1
Thread_Control *executing;
/* disabled when you get here */
executing = _Thread_Executing;
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
47546: 42a8 0034 clrl %a0@(52)
if ( the_semaphore->count != 0 ) {
4754a: 4a81 tstl %d1
4754c: 66ca bnes 47518 <rtems_semaphore_obtain+0xc0>
*
* 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;
4754e: 2239 0006 0fe6 movel 60fe6 <_Thread_Dispatch_disable_level>,%d1
++level;
47554: 5281 addql #1,%d1
_Thread_Dispatch_disable_level = level;
47556: 23c1 0006 0fe6 movel %d1,60fe6 <_Thread_Dispatch_disable_level>
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;
4755c: 7201 moveq #1,%d1
4755e: 2240 moveal %d0,%a1
return;
}
_Thread_Disable_dispatch();
_Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue );
executing->Wait.queue = &the_semaphore->Wait_queue;
47560: 0680 0000 0014 addil #20,%d0
47566: 2341 0044 movel %d1,%a1@(68)
executing->Wait.id = id;
4756a: 222e 0008 movel %fp@(8),%d1
return;
}
_Thread_Disable_dispatch();
_Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue );
executing->Wait.queue = &the_semaphore->Wait_queue;
4756e: 2140 0044 movel %d0,%a0@(68)
executing->Wait.id = id;
47572: 2141 0020 movel %d1,%a0@(32)
_ISR_Enable( *level_p );
47576: 222e fffc movel %fp@(-4),%d1
4757a: 46c1 movew %d1,%sr
_Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout );
4757c: 4879 0004 a5b0 pea 4a5b0 <_Thread_queue_Timeout>
47582: 2f2e 0010 movel %fp@(16),%sp@-
47586: 2f00 movel %d0,%sp@-
47588: 4eb9 0004 a1e0 jsr 4a1e0 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
4758e: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
_Thread_Executing->Wait.return_code );
47594: 2079 0006 142e moveal 6142e <_Per_CPU_Information+0xe>,%a0
4759a: 4fef 000c lea %sp@(12),%sp
id,
((_Options_Is_no_wait( option_set )) ? false : true),
timeout,
&level
);
return _Semaphore_Translate_core_semaphore_return_code(
4759e: 2f28 0034 movel %a0@(52),%sp@-
475a2: 4eb9 0004 765a jsr 4765a <_Semaphore_Translate_core_semaphore_return_code>
475a8: 588f addql #4,%sp
475aa: 6000 ff1c braw 474c8 <rtems_semaphore_obtain+0x70>
...
00047bb8 <rtems_shutdown_executive>:
void rtems_shutdown_executive(
uint32_t result
)
{
if ( _System_state_Is_up( _System_state_Get() ) ) {
47bb8: 7003 moveq #3,%d0
*/
void rtems_shutdown_executive(
uint32_t result
)
{
47bba: 4e56 0000 linkw %fp,#0
if ( _System_state_Is_up( _System_state_Get() ) ) {
47bbe: b0b9 0006 141a cmpl 6141a <_System_state_Current>,%d0
47bc4: 6710 beqs 47bd6 <rtems_shutdown_executive+0x1e>
****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ******
****** AND THEN TO BOOT_CARD() ******
*******************************************************************
*******************************************************************/
}
_Internal_error_Occurred(
47bc6: 4878 0014 pea 14 <OPER2>
47bca: 4878 0001 pea 1 <ADD>
47bce: 42a7 clrl %sp@-
47bd0: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred>
if ( _System_state_Is_up( _System_state_Get() ) ) {
#if defined(RTEMS_SMP)
_SMP_Request_other_cores_to_shutdown();
#endif
_Per_CPU_Information[0].idle->Wait.return_code = result;
47bd6: 2079 0006 1436 moveal 61436 <_Per_CPU_Information+0x16>,%a0
47bdc: 103c 0004 moveb #4,%d0
47be0: 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 );
47be6: 4879 0006 0fb2 pea 60fb2 <_Thread_BSP_context>
47bec: 23c0 0006 141a movel %d0,6141a <_System_state_Current>
47bf2: 4eb9 0004 ad42 jsr 4ad42 <_CPU_Context_Restart_self>
47bf8: 588f addql #4,%sp <== NOT EXECUTED
****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ******
****** AND THEN TO BOOT_CARD() ******
*******************************************************************
*******************************************************************/
}
_Internal_error_Occurred(
47bfa: 4878 0014 pea 14 <OPER2> <== NOT EXECUTED
47bfe: 4878 0001 pea 1 <ADD> <== NOT EXECUTED
47c02: 42a7 clrl %sp@- <== NOT EXECUTED
47c04: 4eb9 0004 8974 jsr 48974 <_Internal_error_Occurred> <== NOT EXECUTED
...
00056988 <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
56988: 4e56 fffc linkw %fp,#-4
5698c: 2f02 movel %d2,%sp@-
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
5698e: 4aae 000c tstl %fp@(12)
56992: 660a bnes 5699e <rtems_signal_send+0x16>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
56994: 242e fff8 movel %fp@(-8),%d2
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
56998: 700a moveq #10,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
5699a: 4e5e unlk %fp
5699c: 4e75 rts
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
5699e: 486e fffc pea %fp@(-4)
569a2: 2f2e 0008 movel %fp@(8),%sp@-
569a6: 4eb9 0005 b370 jsr 5b370 <_Thread_Get>
switch ( location ) {
569ac: 508f addql #8,%sp
569ae: 4aae fffc tstl %fp@(-4)
569b2: 6648 bnes 569fc <rtems_signal_send+0x74>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
569b4: 2240 moveal %d0,%a1
569b6: 2069 00fa moveal %a1@(250),%a0
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
569ba: 4aa8 000a tstl %a0@(10)
569be: 6746 beqs 56a06 <rtems_signal_send+0x7e>
if ( asr->is_enabled ) {
569c0: 4a28 0008 tstb %a0@(8)
569c4: 6762 beqs 56a28 <rtems_signal_send+0xa0>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
569c6: 223c 0000 0700 movel #1792,%d1
569cc: 40c2 movew %sr,%d2
569ce: 8282 orl %d2,%d1
569d0: 46c1 movew %d1,%sr
*signal_set |= signals;
569d2: 222e 000c movel %fp@(12),%d1
569d6: 83a8 0012 orl %d1,%a0@(18)
_ISR_Enable( _level );
569da: 46c2 movew %d2,%sr
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
569dc: 4ab9 0007 deb4 tstl 7deb4 <_Per_CPU_Information+0x8>
569e2: 6708 beqs 569ec <rtems_signal_send+0x64>
569e4: b0b9 0007 deba cmpl 7deba <_Per_CPU_Information+0xe>,%d0
569ea: 672a beqs 56a16 <rtems_signal_send+0x8e> <== ALWAYS TAKEN
_Thread_Dispatch_necessary = true;
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
569ec: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
569f2: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
569f4: 242e fff8 movel %fp@(-8),%d2
569f8: 4e5e unlk %fp
569fa: 4e75 rts
569fc: 242e fff8 movel %fp@(-8),%d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
56a00: 7004 moveq #4,%d0
}
56a02: 4e5e unlk %fp
56a04: 4e75 rts
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
56a06: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
56a0c: 242e fff8 movel %fp@(-8),%d2
}
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
return RTEMS_NOT_DEFINED;
56a10: 700b moveq #11,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
56a12: 4e5e unlk %fp
56a14: 4e75 rts
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
if ( asr->is_enabled ) {
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
56a16: 7001 moveq #1,%d0
56a18: 13c0 0007 deb8 moveb %d0,7deb8 <_Per_CPU_Information+0xc>
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
56a1e: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
56a24: 4280 clrl %d0
56a26: 60cc bras 569f4 <rtems_signal_send+0x6c>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
56a28: 203c 0000 0700 movel #1792,%d0
56a2e: 40c1 movew %sr,%d1
56a30: 8081 orl %d1,%d0
56a32: 46c0 movew %d0,%sr
*signal_set |= signals;
56a34: 202e 000c movel %fp@(12),%d0
56a38: 81a8 0016 orl %d0,%a0@(22)
_ISR_Enable( _level );
56a3c: 46c1 movew %d1,%sr
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
56a3e: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
56a44: 4280 clrl %d0
56a46: 60ac bras 569f4 <rtems_signal_send+0x6c>
00051224 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
51224: 4e56 ffe4 linkw %fp,#-28
51228: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@
5122c: 2a2e 0008 movel %fp@(8),%d5
51230: 242e 000c movel %fp@(12),%d2
51234: 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 )
51238: 4a8c tstl %a4
5123a: 6700 0148 beqw 51384 <rtems_task_mode+0x160>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
5123e: 2479 0006 5a02 moveal 65a02 <_Per_CPU_Information+0xe>,%a2
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
51244: 4a2a 0070 tstb %a2@(112)
51248: 57c3 seq %d3
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
5124a: 266a 00fa moveal %a2@(250),%a3
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
5124e: 49c3 extbl %d3
51250: 0283 0000 0100 andil #256,%d3
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
51256: 4aaa 0076 tstl %a2@(118)
5125a: 6600 00cc bnew 51328 <rtems_task_mode+0x104>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
5125e: 4a2b 0008 tstb %a3@(8)
51262: 57c4 seq %d4
old_mode |= _ISR_Get_level();
51264: 4eb9 0004 c754 jsr 4c754 <_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;
5126a: 49c4 extbl %d4
5126c: 0284 0000 0400 andil #1024,%d4
51272: 8084 orl %d4,%d0
old_mode |= _ISR_Get_level();
51274: 8083 orl %d3,%d0
51276: 2880 movel %d0,%a4@
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
51278: 0802 0008 btst #8,%d2
5127c: 670e beqs 5128c <rtems_task_mode+0x68>
5127e: 2005 movel %d5,%d0
51280: 7201 moveq #1,%d1
51282: e088 lsrl #8,%d0
51284: b380 eorl %d1,%d0
51286: c081 andl %d1,%d0
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
51288: 1540 0070 moveb %d0,%a2@(112)
if ( mask & RTEMS_TIMESLICE_MASK ) {
5128c: 0802 0009 btst #9,%d2
51290: 6718 beqs 512aa <rtems_task_mode+0x86>
if ( _Modes_Is_timeslice(mode_set) ) {
51292: 0805 0009 btst #9,%d5
51296: 6700 00f8 beqw 51390 <rtems_task_mode+0x16c>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
5129a: 7001 moveq #1,%d0
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
5129c: 41f9 0006 5572 lea 65572 <_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;
512a2: 2540 0076 movel %d0,%a2@(118)
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
512a6: 2550 0072 movel %a0@,%a2@(114)
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
512aa: 7007 moveq #7,%d0
512ac: c082 andl %d2,%d0
512ae: 6712 beqs 512c2 <rtems_task_mode+0x9e>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
512b0: 40c0 movew %sr,%d0
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
512b2: 7207 moveq #7,%d1
512b4: c285 andl %d5,%d1
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
512b6: 0280 0000 f8ff andil #63743,%d0
512bc: e189 lsll #8,%d1
512be: 8081 orl %d1,%d0
512c0: 46c0 movew %d0,%sr
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
512c2: 0802 000a btst #10,%d2
512c6: 6752 beqs 5131a <rtems_task_mode+0xf6>
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
512c8: 700a moveq #10,%d0
512ca: e0ad lsrl %d0,%d5
512cc: 7201 moveq #1,%d1
if ( is_asr_enabled != asr->is_enabled ) {
512ce: 4280 clrl %d0
512d0: 102b 0008 moveb %a3@(8),%d0
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
512d4: b385 eorl %d1,%d5
512d6: ca81 andl %d1,%d5
if ( is_asr_enabled != asr->is_enabled ) {
512d8: ba80 cmpl %d0,%d5
512da: 673e beqs 5131a <rtems_task_mode+0xf6>
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
512dc: 203c 0000 0700 movel #1792,%d0
asr->is_enabled = is_asr_enabled;
512e2: 1745 0008 moveb %d5,%a3@(8)
512e6: 40c1 movew %sr,%d1
512e8: 8081 orl %d1,%d0
512ea: 46c0 movew %d0,%sr
_signals = information->signals_pending;
512ec: 202b 0016 movel %a3@(22),%d0
information->signals_pending = information->signals_posted;
512f0: 276b 0012 0016 movel %a3@(18),%a3@(22)
information->signals_posted = _signals;
512f6: 2740 0012 movel %d0,%a3@(18)
_ISR_Enable( _level );
512fa: 46c1 movew %d1,%sr
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
512fc: 4aab 0012 tstl %a3@(18)
51300: 56c0 sne %d0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
51302: 7203 moveq #3,%d1
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
asr->is_enabled = is_asr_enabled;
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
51304: 4480 negl %d0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
51306: b2b9 0006 59ee cmpl 659ee <_System_state_Current>,%d1
5130c: 6744 beqs 51352 <rtems_task_mode+0x12e> <== ALWAYS TAKEN
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
5130e: 4280 clrl %d0
}
51310: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
51316: 4e5e unlk %fp
51318: 4e75 rts
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
5131a: 7203 moveq #3,%d1
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
5131c: 4200 clrb %d0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
5131e: b2b9 0006 59ee cmpl 659ee <_System_state_Current>,%d1
51324: 66e8 bnes 5130e <rtems_task_mode+0xea>
51326: 602a bras 51352 <rtems_task_mode+0x12e>
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;
51328: 4a2b 0008 tstb %a3@(8)
5132c: 57c4 seq %d4
old_mode |= _ISR_Get_level();
5132e: 4eb9 0004 c754 jsr 4c754 <_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;
51334: 49c4 extbl %d4
51336: 0284 0000 0400 andil #1024,%d4
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
5133c: 08c3 0009 bset #9,%d3
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
51340: 8084 orl %d4,%d0
old_mode |= _ISR_Get_level();
51342: 8083 orl %d3,%d0
51344: 2880 movel %d0,%a4@
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
51346: 0802 0008 btst #8,%d2
5134a: 6700 ff40 beqw 5128c <rtems_task_mode+0x68>
5134e: 6000 ff2e braw 5127e <rtems_task_mode+0x5a>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
51352: 2079 0006 5a02 moveal 65a02 <_Per_CPU_Information+0xe>,%a0
if ( are_signals_pending ||
51358: 4a00 tstb %d0
5135a: 660e bnes 5136a <rtems_task_mode+0x146>
5135c: b1f9 0006 5a06 cmpal 65a06 <_Per_CPU_Information+0x12>,%a0
51362: 67aa beqs 5130e <rtems_task_mode+0xea>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
51364: 4a28 0070 tstb %a0@(112)
51368: 67a4 beqs 5130e <rtems_task_mode+0xea> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
5136a: 7001 moveq #1,%d0
5136c: 13c0 0006 5a00 moveb %d0,65a00 <_Per_CPU_Information+0xc>
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
51372: 4eb9 0004 b4a8 jsr 4b4a8 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
}
51378: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
5137e: 4280 clrl %d0
}
51380: 4e5e unlk %fp
51382: 4e75 rts
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
51384: 7009 moveq #9,%d0
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
}
51386: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4
5138c: 4e5e unlk %fp
5138e: 4e75 rts
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
51390: 7007 moveq #7,%d0
51392: c082 andl %d2,%d0
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
51394: 42aa 0076 clrl %a2@(118)
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
51398: 4a80 tstl %d0
5139a: 6700 ff26 beqw 512c2 <rtems_task_mode+0x9e>
5139e: 6000 ff10 braw 512b0 <rtems_task_mode+0x8c>
...
0004b91c <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
4b91c: 4e56 fffc linkw %fp,#-4
4b920: 2f02 movel %d2,%sp@-
4b922: 242e 000c movel %fp@(12),%d2
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
4b926: 670c beqs 4b934 <rtems_task_set_priority+0x18>
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 ) );
4b928: 4280 clrl %d0
4b92a: 1039 0006 37fc moveb 637fc <rtems_maximum_priority>,%d0
*/
RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{
return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
4b930: b082 cmpl %d2,%d0
4b932: 656e bcss 4b9a2 <rtems_task_set_priority+0x86>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
4b934: 4aae 0010 tstl %fp@(16)
4b938: 6754 beqs 4b98e <rtems_task_set_priority+0x72>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
4b93a: 486e fffc pea %fp@(-4)
4b93e: 2f2e 0008 movel %fp@(8),%sp@-
4b942: 4eb9 0004 de78 jsr 4de78 <_Thread_Get>
switch ( location ) {
4b948: 508f addql #8,%sp
4b94a: 4aae fffc tstl %fp@(-4)
4b94e: 6648 bnes 4b998 <rtems_task_set_priority+0x7c>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
4b950: 206e 0010 moveal %fp@(16),%a0
4b954: 2240 moveal %d0,%a1
4b956: 20a9 0014 movel %a1@(20),%a0@
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
4b95a: 4a82 tstl %d2
4b95c: 6720 beqs 4b97e <rtems_task_set_priority+0x62>
the_thread->real_priority = new_priority;
4b95e: 2342 0018 movel %d2,%a1@(24)
if ( the_thread->resource_count == 0 ||
4b962: 4aa9 001c tstl %a1@(28)
4b966: 6706 beqs 4b96e <rtems_task_set_priority+0x52>
4b968: b4a9 0014 cmpl %a1@(20),%d2
4b96c: 6410 bccs 4b97e <rtems_task_set_priority+0x62> <== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
4b96e: 42a7 clrl %sp@-
4b970: 2f02 movel %d2,%sp@-
4b972: 2f00 movel %d0,%sp@-
4b974: 4eb9 0004 d974 jsr 4d974 <_Thread_Change_priority>
4b97a: 4fef 000c lea %sp@(12),%sp
}
_Thread_Enable_dispatch();
4b97e: 4eb9 0004 de58 jsr 4de58 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4b984: 242e fff8 movel %fp@(-8),%d2
if ( the_thread->resource_count == 0 ||
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
}
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
4b988: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4b98a: 4e5e unlk %fp
4b98c: 4e75 rts
4b98e: 242e fff8 movel %fp@(-8),%d2
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
4b992: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4b994: 4e5e unlk %fp
4b996: 4e75 rts
4b998: 242e fff8 movel %fp@(-8),%d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
4b99c: 7004 moveq #4,%d0
}
4b99e: 4e5e unlk %fp
4b9a0: 4e75 rts
4b9a2: 242e fff8 movel %fp@(-8),%d2
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;
4b9a6: 7013 moveq #19,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4b9a8: 4e5e unlk %fp <== NOT EXECUTED
00047990 <rtems_task_start>:
rtems_status_code rtems_task_start(
rtems_id id,
rtems_task_entry entry_point,
rtems_task_argument argument
)
{
47990: 4e56 fffc linkw %fp,#-4
register Thread_Control *the_thread;
Objects_Locations location;
if ( entry_point == NULL )
47994: 4aae 000c tstl %fp@(12)
47998: 6744 beqs 479de <rtems_task_start+0x4e> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
4799a: 486e fffc pea %fp@(-4)
4799e: 2f2e 0008 movel %fp@(8),%sp@-
479a2: 4eb9 0004 9cf0 jsr 49cf0 <_Thread_Get>
switch ( location ) {
479a8: 508f addql #8,%sp
479aa: 4aae fffc tstl %fp@(-4)
479ae: 6628 bnes 479d8 <rtems_task_start+0x48>
case OBJECTS_LOCAL:
if ( _Thread_Start(
479b0: 2f2e 0010 movel %fp@(16),%sp@-
479b4: 42a7 clrl %sp@-
479b6: 2f2e 000c movel %fp@(12),%sp@-
479ba: 42a7 clrl %sp@-
479bc: 2f00 movel %d0,%sp@-
479be: 4eb9 0004 a744 jsr 4a744 <_Thread_Start>
479c4: 4fef 0014 lea %sp@(20),%sp
479c8: 4a00 tstb %d0
479ca: 6618 bnes 479e4 <rtems_task_start+0x54>
the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
479cc: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return RTEMS_INCORRECT_STATE;
479d2: 700e moveq #14,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
479d4: 4e5e unlk %fp
479d6: 4e75 rts
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
479d8: 7004 moveq #4,%d0
}
479da: 4e5e unlk %fp
479dc: 4e75 rts
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( entry_point == NULL )
return RTEMS_INVALID_ADDRESS;
479de: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
479e0: 4e5e unlk %fp
479e2: 4e75 rts
switch ( location ) {
case OBJECTS_LOCAL:
if ( _Thread_Start(
the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
_Thread_Enable_dispatch();
479e4: 4eb9 0004 9cd0 jsr 49cd0 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
479ea: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
479ec: 4e5e unlk %fp <== NOT EXECUTED
00045558 <rtems_task_variable_delete>:
rtems_status_code rtems_task_variable_delete(
rtems_id tid,
void **ptr
)
{
45558: 4e56 fffc linkw %fp,#-4
4555c: 2f02 movel %d2,%sp@-
4555e: 242e 000c movel %fp@(12),%d2
Thread_Control *the_thread;
Objects_Locations location;
rtems_task_variable_t *tvp, *prev;
if ( !ptr )
45562: 6740 beqs 455a4 <rtems_task_variable_delete+0x4c>
return RTEMS_INVALID_ADDRESS;
prev = NULL;
the_thread = _Thread_Get (tid, &location);
45564: 486e fffc pea %fp@(-4)
45568: 2f2e 0008 movel %fp@(8),%sp@-
4556c: 4eb9 0004 7360 jsr 47360 <_Thread_Get>
switch (location) {
45572: 508f addql #8,%sp
45574: 4aae fffc tstl %fp@(-4)
45578: 6620 bnes 4559a <rtems_task_variable_delete+0x42>
case OBJECTS_LOCAL:
tvp = the_thread->task_variables;
4557a: 2040 moveal %d0,%a0
4557c: 2268 0106 moveal %a0@(262),%a1
while (tvp) {
45580: 4a89 tstl %a1
45582: 672a beqs 455ae <rtems_task_variable_delete+0x56>
if (tvp->ptr == ptr) {
45584: b4a9 0004 cmpl %a1@(4),%d2
45588: 6752 beqs 455dc <rtems_task_variable_delete+0x84>
_RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
prev = tvp;
tvp = (rtems_task_variable_t *)tvp->next;
4558a: 2051 moveal %a1@,%a0
the_thread = _Thread_Get (tid, &location);
switch (location) {
case OBJECTS_LOCAL:
tvp = the_thread->task_variables;
while (tvp) {
4558c: 4a88 tstl %a0
4558e: 671e beqs 455ae <rtems_task_variable_delete+0x56><== NEVER TAKEN
if (tvp->ptr == ptr) {
45590: b4a8 0004 cmpl %a0@(4),%d2
45594: 6728 beqs 455be <rtems_task_variable_delete+0x66>
45596: 2248 moveal %a0,%a1
45598: 60f0 bras 4558a <rtems_task_variable_delete+0x32>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4559a: 242e fff8 movel %fp@(-8),%d2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
4559e: 7004 moveq #4,%d0
}
455a0: 4e5e unlk %fp
455a2: 4e75 rts
455a4: 242e fff8 movel %fp@(-8),%d2
Thread_Control *the_thread;
Objects_Locations location;
rtems_task_variable_t *tvp, *prev;
if ( !ptr )
return RTEMS_INVALID_ADDRESS;
455a8: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
455aa: 4e5e unlk %fp
455ac: 4e75 rts
return RTEMS_SUCCESSFUL;
}
prev = tvp;
tvp = (rtems_task_variable_t *)tvp->next;
}
_Thread_Enable_dispatch();
455ae: 4eb9 0004 7340 jsr 47340 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
455b4: 242e fff8 movel %fp@(-8),%d2
}
prev = tvp;
tvp = (rtems_task_variable_t *)tvp->next;
}
_Thread_Enable_dispatch();
return RTEMS_INVALID_ADDRESS;
455b8: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
455ba: 4e5e unlk %fp
455bc: 4e75 rts
case OBJECTS_LOCAL:
tvp = the_thread->task_variables;
while (tvp) {
if (tvp->ptr == ptr) {
if (prev)
prev->next = tvp->next;
455be: 2290 movel %a0@,%a1@
else
the_thread->task_variables = (rtems_task_variable_t *)tvp->next;
_RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp );
455c0: 2f08 movel %a0,%sp@-
455c2: 2f00 movel %d0,%sp@-
455c4: 4eb9 0004 5678 jsr 45678 <_RTEMS_Tasks_Invoke_task_variable_dtor>
_Thread_Enable_dispatch();
455ca: 4eb9 0004 7340 jsr 47340 <_Thread_Enable_dispatch>
455d0: 508f addql #8,%sp
return RTEMS_SUCCESSFUL;
455d2: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
455d4: 242e fff8 movel %fp@(-8),%d2
455d8: 4e5e unlk %fp
455da: 4e75 rts
while (tvp) {
if (tvp->ptr == ptr) {
if (prev)
prev->next = tvp->next;
else
the_thread->task_variables = (rtems_task_variable_t *)tvp->next;
455dc: 2040 moveal %d0,%a0
455de: 2151 0106 movel %a1@,%a0@(262)
455e2: 2049 moveal %a1,%a0
_RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp );
455e4: 2f08 movel %a0,%sp@-
455e6: 2f00 movel %d0,%sp@-
455e8: 4eb9 0004 5678 jsr 45678 <_RTEMS_Tasks_Invoke_task_variable_dtor>
_Thread_Enable_dispatch();
455ee: 4eb9 0004 7340 jsr 47340 <_Thread_Enable_dispatch>
455f4: 508f addql #8,%sp
return RTEMS_SUCCESSFUL;
455f6: 4280 clrl %d0
455f8: 60da bras 455d4 <rtems_task_variable_delete+0x7c>
...
000455fc <rtems_task_variable_get>:
rtems_status_code rtems_task_variable_get(
rtems_id tid,
void **ptr,
void **result
)
{
455fc: 4e56 fffc linkw %fp,#-4
45600: 2f02 movel %d2,%sp@-
45602: 242e 000c movel %fp@(12),%d2
Thread_Control *the_thread;
Objects_Locations location;
rtems_task_variable_t *tvp;
if ( !ptr )
45606: 6742 beqs 4564a <rtems_task_variable_get+0x4e>
return RTEMS_INVALID_ADDRESS;
if ( !result )
45608: 4aae 0010 tstl %fp@(16)
4560c: 673c beqs 4564a <rtems_task_variable_get+0x4e>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get (tid, &location);
4560e: 486e fffc pea %fp@(-4)
45612: 2f2e 0008 movel %fp@(8),%sp@-
45616: 4eb9 0004 7360 jsr 47360 <_Thread_Get>
switch (location) {
4561c: 508f addql #8,%sp
4561e: 4aae fffc tstl %fp@(-4)
45622: 6630 bnes 45654 <rtems_task_variable_get+0x58>
case OBJECTS_LOCAL:
/*
* Figure out if the variable is in this task's list.
*/
tvp = the_thread->task_variables;
45624: 2240 moveal %d0,%a1
45626: 2069 0106 moveal %a1@(262),%a0
while (tvp) {
4562a: 4a88 tstl %a0
4562c: 670c beqs 4563a <rtems_task_variable_get+0x3e>
if (tvp->ptr == ptr) {
4562e: b4a8 0004 cmpl %a0@(4),%d2
45632: 672a beqs 4565e <rtems_task_variable_get+0x62>
*/
*result = tvp->tval;
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
tvp = (rtems_task_variable_t *)tvp->next;
45634: 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) {
45636: 4a88 tstl %a0
45638: 66f4 bnes 4562e <rtems_task_variable_get+0x32> <== ALWAYS TAKEN
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
tvp = (rtems_task_variable_t *)tvp->next;
}
_Thread_Enable_dispatch();
4563a: 4eb9 0004 7340 jsr 47340 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
45640: 242e fff8 movel %fp@(-8),%d2
return RTEMS_SUCCESSFUL;
}
tvp = (rtems_task_variable_t *)tvp->next;
}
_Thread_Enable_dispatch();
return RTEMS_INVALID_ADDRESS;
45644: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
45646: 4e5e unlk %fp
45648: 4e75 rts
4564a: 242e fff8 movel %fp@(-8),%d2
Thread_Control *the_thread;
Objects_Locations location;
rtems_task_variable_t *tvp;
if ( !ptr )
return RTEMS_INVALID_ADDRESS;
4564e: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
45650: 4e5e unlk %fp
45652: 4e75 rts
45654: 242e fff8 movel %fp@(-8),%d2
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
45658: 7004 moveq #4,%d0
}
4565a: 4e5e unlk %fp
4565c: 4e75 rts
if (tvp->ptr == ptr) {
/*
* Should this return the current (i.e not the
* saved) value if `tid' is the current task?
*/
*result = tvp->tval;
4565e: 226e 0010 moveal %fp@(16),%a1
45662: 22a8 000c movel %a0@(12),%a1@
_Thread_Enable_dispatch();
45666: 4eb9 0004 7340 jsr 47340 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
4566c: 242e fff8 movel %fp@(-8),%d2
* Should this return the current (i.e not the
* saved) value if `tid' is the current task?
*/
*result = tvp->tval;
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
45670: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
45672: 4e5e unlk %fp
...
000573b8 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
573b8: 4e56 fffc linkw %fp,#-4
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
573bc: 486e fffc pea %fp@(-4)
573c0: 2f2e 0008 movel %fp@(8),%sp@-
573c4: 4879 0007 e2d6 pea 7e2d6 <_Timer_Information>
573ca: 4eb9 0005 a5b4 jsr 5a5b4 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
573d0: 4fef 000c lea %sp@(12),%sp
573d4: 4aae fffc tstl %fp@(-4)
573d8: 6622 bnes 573fc <rtems_timer_cancel+0x44>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
573da: 7204 moveq #4,%d1
573dc: 2040 moveal %d0,%a0
573de: b2a8 0038 cmpl %a0@(56),%d1
573e2: 670c beqs 573f0 <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
573e4: 4868 0010 pea %a0@(16)
573e8: 4eb9 0005 c2d0 jsr 5c2d0 <_Watchdog_Remove>
573ee: 588f addql #4,%sp
_Thread_Enable_dispatch();
573f0: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
573f6: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
573f8: 4e5e unlk %fp
573fa: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
573fc: 7004 moveq #4,%d0
}
573fe: 4e5e unlk %fp
...
000577b4 <rtems_timer_reset>:
*/
rtems_status_code rtems_timer_reset(
rtems_id id
)
{
577b4: 4e56 fff0 linkw %fp,#-16
577b8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@
577bc: 486e fffc pea %fp@(-4)
577c0: 2f2e 0008 movel %fp@(8),%sp@-
577c4: 4879 0007 e2d6 pea 7e2d6 <_Timer_Information>
577ca: 4eb9 0005 a5b4 jsr 5a5b4 <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
rtems_status_code status = RTEMS_SUCCESSFUL;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
577d0: 4fef 000c lea %sp@(12),%sp
577d4: 2440 moveal %d0,%a2
577d6: 4aae fffc tstl %fp@(-4)
577da: 6620 bnes 577fc <rtems_timer_reset+0x48>
case OBJECTS_LOCAL:
if ( the_timer->the_class == TIMER_INTERVAL ) {
577dc: 202a 0038 movel %a2@(56),%d0
577e0: 6728 beqs 5780a <rtems_timer_reset+0x56>
_Watchdog_Remove( &the_timer->Ticker );
_Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker );
} else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) {
577e2: 7201 moveq #1,%d1
577e4: b280 cmpl %d0,%d1
577e6: 674a beqs 57832 <rtems_timer_reset+0x7e>
/*
* 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;
577e8: 740b moveq #11,%d2
}
_Thread_Enable_dispatch();
577ea: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
577f0: 2002 movel %d2,%d0
577f2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
577f8: 4e5e unlk %fp
577fa: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
577fc: 7404 moveq #4,%d2
}
577fe: 2002 movel %d2,%d0
57800: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3
57806: 4e5e unlk %fp
57808: 4e75 rts
the_timer = _Timer_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( the_timer->the_class == TIMER_INTERVAL ) {
_Watchdog_Remove( &the_timer->Ticker );
5780a: 45ea 0010 lea %a2@(16),%a2
rtems_id id
)
{
Timer_Control *the_timer;
Objects_Locations location;
rtems_status_code status = RTEMS_SUCCESSFUL;
5780e: 4282 clrl %d2
the_timer = _Timer_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
if ( the_timer->the_class == TIMER_INTERVAL ) {
_Watchdog_Remove( &the_timer->Ticker );
57810: 2f0a movel %a2,%sp@-
57812: 4eb9 0005 c2d0 jsr 5c2d0 <_Watchdog_Remove>
_Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker );
57818: 2f0a movel %a2,%sp@-
5781a: 4879 0007 db06 pea 7db06 <_Watchdog_Ticks_chain>
57820: 4eb9 0005 c1a0 jsr 5c1a0 <_Watchdog_Insert>
57826: 4fef 000c lea %sp@(12),%sp
* TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We
* can only reset active interval timers.
*/
status = RTEMS_NOT_DEFINED;
}
_Thread_Enable_dispatch();
5782a: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
57830: 60be bras 577f0 <rtems_timer_reset+0x3c>
if ( !timer_server ) {
_Thread_Enable_dispatch();
return RTEMS_INCORRECT_STATE;
}
#endif
_Watchdog_Remove( &the_timer->Ticker );
57832: 486a 0010 pea %a2@(16)
rtems_id id
)
{
Timer_Control *the_timer;
Objects_Locations location;
rtems_status_code status = RTEMS_SUCCESSFUL;
57836: 4282 clrl %d2
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;
57838: 2679 0007 e310 moveal 7e310 <_Timer_server>,%a3
if ( !timer_server ) {
_Thread_Enable_dispatch();
return RTEMS_INCORRECT_STATE;
}
#endif
_Watchdog_Remove( &the_timer->Ticker );
5783e: 4eb9 0005 c2d0 jsr 5c2d0 <_Watchdog_Remove>
(*timer_server->schedule_operation)( timer_server, the_timer );
57844: 2f0a movel %a2,%sp@-
57846: 2f0b movel %a3,%sp@-
57848: 206b 0004 moveal %a3@(4),%a0
5784c: 4e90 jsr %a0@
5784e: 4fef 000c lea %sp@(12),%sp
* TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We
* can only reset active interval timers.
*/
status = RTEMS_NOT_DEFINED;
}
_Thread_Enable_dispatch();
57852: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
57858: 6096 bras 577f0 <rtems_timer_reset+0x3c>
...
00057954 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
57954: 4e56 ffec linkw %fp,#-20
57958: 48d7 1c04 moveml %d2/%a2-%a4,%sp@
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
5795c: 2479 0007 e310 moveal 7e310 <_Timer_server>,%a2
if ( !timer_server )
57962: 4a8a tstl %a2
57964: 6736 beqs 5799c <rtems_timer_server_fire_when+0x48>
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
57966: 4a39 0007 da20 tstb 7da20 <_TOD+0x14>
5796c: 660c bnes 5797a <rtems_timer_server_fire_when+0x26><== ALWAYS TAKEN
return RTEMS_NOT_DEFINED;
5796e: 700b moveq #11,%d0 <== NOT EXECUTED
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
57970: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 <== NOT EXECUTED
57976: 4e5e unlk %fp <== NOT EXECUTED
57978: 4e75 rts <== NOT EXECUTED
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
5797a: 4aae 0010 tstl %fp@(16)
5797e: 6728 beqs 579a8 <rtems_timer_server_fire_when+0x54>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
57980: 2f2e 000c movel %fp@(12),%sp@-
57984: 4eb9 0005 44b4 jsr 544b4 <_TOD_Validate>
5798a: 588f addql #4,%sp
5798c: 4a00 tstb %d0
5798e: 6624 bnes 579b4 <rtems_timer_server_fire_when+0x60>
return RTEMS_INVALID_CLOCK;
57990: 7014 moveq #20,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
57992: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4
57998: 4e5e unlk %fp
5799a: 4e75 rts
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
5799c: 700e moveq #14,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
5799e: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4
579a4: 4e5e unlk %fp
579a6: 4e75 rts
if ( !_TOD.is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
579a8: 7009 moveq #9,%d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
579aa: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4
579b0: 4e5e unlk %fp
579b2: 4e75 rts
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
579b4: 2f2e 000c movel %fp@(12),%sp@-
579b8: 47f9 0006 d424 lea 6d424 <__divdi3>,%a3
579be: 4eb9 0005 4410 jsr 54410 <_TOD_To_seconds>
579c4: 2400 movel %d0,%d2
579c6: 2f3c 3b9a ca00 movel #1000000000,%sp@-
579cc: 42a7 clrl %sp@-
579ce: 2f39 0007 da10 movel 7da10 <_TOD+0x4>,%sp@-
579d4: 2f39 0007 da0c movel 7da0c <_TOD>,%sp@-
579da: 4e93 jsr %a3@
if ( seconds <= _TOD_Seconds_since_epoch() )
579dc: 4fef 0014 lea %sp@(20),%sp
579e0: b282 cmpl %d2,%d1
579e2: 64ac bccs 57990 <rtems_timer_server_fire_when+0x3c>
579e4: 486e fffc pea %fp@(-4)
579e8: 2f2e 0008 movel %fp@(8),%sp@-
579ec: 4879 0007 e2d6 pea 7e2d6 <_Timer_Information>
579f2: 4eb9 0005 a5b4 jsr 5a5b4 <_Objects_Get>
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
579f8: 4fef 000c lea %sp@(12),%sp
579fc: 2840 moveal %d0,%a4
579fe: 4aae fffc tstl %fp@(-4)
57a02: 666a bnes 57a6e <rtems_timer_server_fire_when+0x11a>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
57a04: 486c 0010 pea %a4@(16)
57a08: 4eb9 0005 c2d0 jsr 5c2d0 <_Watchdog_Remove>
the_watchdog->routine = routine;
the_watchdog->id = id;
the_watchdog->user_data = user_data;
57a0e: 296e 0014 0034 movel %fp@(20),%a4@(52)
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
57a14: 7003 moveq #3,%d0
57a16: 2940 0038 movel %d0,%a4@(56)
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
57a1a: 202e 0010 movel %fp@(16),%d0
57a1e: 2940 002c movel %d0,%a4@(44)
the_watchdog->id = id;
57a22: 202e 0008 movel %fp@(8),%d0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
57a26: 42ac 0018 clrl %a4@(24)
the_watchdog->routine = routine;
the_watchdog->id = id;
57a2a: 2940 0030 movel %d0,%a4@(48)
57a2e: 2f3c 3b9a ca00 movel #1000000000,%sp@-
57a34: 42a7 clrl %sp@-
57a36: 2f39 0007 da10 movel 7da10 <_TOD+0x4>,%sp@-
57a3c: 2f39 0007 da0c movel 7da0c <_TOD>,%sp@-
57a42: 4e93 jsr %a3@
57a44: 4fef 0010 lea %sp@(16),%sp
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
57a48: 9481 subl %d1,%d2
57a4a: 2942 001c movel %d2,%a4@(28)
(*timer_server->schedule_operation)( timer_server, the_timer );
57a4e: 2f0c movel %a4,%sp@-
57a50: 2f0a movel %a2,%sp@-
57a52: 206a 0004 moveal %a2@(4),%a0
57a56: 4e90 jsr %a0@
_Thread_Enable_dispatch();
57a58: 4eb9 0005 b350 jsr 5b350 <_Thread_Enable_dispatch>
57a5e: 4fef 000c lea %sp@(12),%sp
return RTEMS_SUCCESSFUL;
57a62: 4280 clrl %d0
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
57a64: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4
57a6a: 4e5e unlk %fp
57a6c: 4e75 rts
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
57a6e: 7004 moveq #4,%d0
}
57a70: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4
57a76: 4e5e unlk %fp
...
00047e8c <rtems_workspace_greedy_free>:
void rtems_workspace_greedy_free( void *opaque )
{
47e8c: 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;
47e90: 2239 0006 2972 movel 62972 <_Thread_Dispatch_disable_level>,%d1
++level;
47e96: 5281 addql #1,%d1
47e98: 202e 0008 movel %fp@(8),%d0
_Thread_Dispatch_disable_level = level;
47e9c: 23c1 0006 2972 movel %d1,62972 <_Thread_Dispatch_disable_level>
_Thread_Disable_dispatch();
_Heap_Greedy_free( &_Workspace_Area, opaque );
47ea2: 2f00 movel %d0,%sp@-
47ea4: 4879 0006 2982 pea 62982 <_Workspace_Area>
47eaa: 4eb9 0004 8b84 jsr 48b84 <_Heap_Greedy_free>
_Thread_Enable_dispatch();
47eb0: 508f addql #8,%sp
}
47eb2: 4e5e unlk %fp
void rtems_workspace_greedy_free( void *opaque )
{
_Thread_Disable_dispatch();
_Heap_Greedy_free( &_Workspace_Area, opaque );
_Thread_Enable_dispatch();
47eb4: 4ef9 0004 a264 jmp 4a264 <_Thread_Enable_dispatch>
...
00047d1c <sched_get_priority_max>:
int sched_get_priority_max(
int policy
)
{
switch ( policy ) {
47d1c: 7004 moveq #4,%d0
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
47d1e: 4e56 0000 linkw %fp,#0
47d22: 222e 0008 movel %fp@(8),%d1
switch ( policy ) {
47d26: b081 cmpl %d1,%d0
47d28: 6412 bccs 47d3c <sched_get_priority_max+0x20>
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
47d2a: 4eb9 0004 fe7c jsr 4fe7c <__errno>
47d30: 7216 moveq #22,%d1
47d32: 2040 moveal %d0,%a0
47d34: 70ff moveq #-1,%d0
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
}
47d36: 4e5e unlk %fp
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
47d38: 2081 movel %d1,%a0@
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
}
47d3a: 4e75 rts
int sched_get_priority_max(
int policy
)
{
switch ( policy ) {
47d3c: 103c 0001 moveb #1,%d0
47d40: e3a8 lsll %d1,%d0
47d42: 7217 moveq #23,%d1
47d44: c081 andl %d1,%d0
47d46: 67e2 beqs 47d2a <sched_get_priority_max+0xe> <== NEVER TAKEN
default:
rtems_set_errno_and_return_minus_one( EINVAL );
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
47d48: 4280 clrl %d0
47d4a: 1039 0006 092c moveb 6092c <rtems_maximum_priority>,%d0
}
47d50: 4e5e unlk %fp
default:
rtems_set_errno_and_return_minus_one( EINVAL );
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
47d52: 5380 subql #1,%d0
}
...
00047d58 <sched_get_priority_min>:
*/
int sched_get_priority_min(
int policy
)
{
switch ( policy ) {
47d58: 7004 moveq #4,%d0
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_min(
int policy
)
{
47d5a: 4e56 0000 linkw %fp,#0
47d5e: 222e 0008 movel %fp@(8),%d1
switch ( policy ) {
47d62: b081 cmpl %d1,%d0
47d64: 6412 bccs 47d78 <sched_get_priority_min+0x20>
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
47d66: 4eb9 0004 fe7c jsr 4fe7c <__errno>
47d6c: 7216 moveq #22,%d1
47d6e: 2040 moveal %d0,%a0
47d70: 70ff moveq #-1,%d0
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
47d72: 4e5e unlk %fp
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
47d74: 2081 movel %d1,%a0@
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
}
47d76: 4e75 rts
*/
int sched_get_priority_min(
int policy
)
{
switch ( policy ) {
47d78: 103c 0001 moveb #1,%d0
47d7c: e3a8 lsll %d1,%d0
47d7e: 7217 moveq #23,%d1
47d80: c081 andl %d1,%d0
47d82: 67e2 beqs 47d66 <sched_get_priority_min+0xe> <== NEVER TAKEN
default:
rtems_set_errno_and_return_minus_one( EINVAL );
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
47d84: 7001 moveq #1,%d0
}
47d86: 4e5e unlk %fp
...
00047d8c <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
47d8c: 4e56 0000 linkw %fp,#0
47d90: 2f02 movel %d2,%sp@-
47d92: 242e 000c movel %fp@(12),%d2
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
47d96: 4aae 0008 tstl %fp@(8)
47d9a: 661e bnes 47dba <sched_rr_get_interval+0x2e> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( ESRCH );
if ( !interval )
47d9c: 4a82 tstl %d2
47d9e: 673c beqs 47ddc <sched_rr_get_interval+0x50>
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
47da0: 2f02 movel %d2,%sp@-
47da2: 2f39 0006 21ce movel 621ce <_Thread_Ticks_per_timeslice>,%sp@-
47da8: 4eb9 0004 b8b8 jsr 4b8b8 <_Timespec_From_ticks>
return 0;
}
47dae: 242e fffc movel %fp@(-4),%d2
if ( !interval )
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
return 0;
47db2: 508f addql #8,%sp
47db4: 4280 clrl %d0
}
47db6: 4e5e unlk %fp
47db8: 4e75 rts
{
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
47dba: 4eb9 0004 37e0 jsr 437e0 <getpid>
47dc0: b0ae 0008 cmpl %fp@(8),%d0
47dc4: 67d6 beqs 47d9c <sched_rr_get_interval+0x10>
rtems_set_errno_and_return_minus_one( ESRCH );
47dc6: 4eb9 0004 fe7c jsr 4fe7c <__errno>
47dcc: 7403 moveq #3,%d2
47dce: 2040 moveal %d0,%a0
47dd0: 70ff moveq #-1,%d0
47dd2: 2082 movel %d2,%a0@
if ( !interval )
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
return 0;
}
47dd4: 242e fffc movel %fp@(-4),%d2
47dd8: 4e5e unlk %fp
47dda: 4e75 rts
if ( pid && pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
if ( !interval )
rtems_set_errno_and_return_minus_one( EINVAL );
47ddc: 4eb9 0004 fe7c jsr 4fe7c <__errno>
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
return 0;
}
47de2: 242e fffc movel %fp@(-4),%d2
if ( pid && pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
if ( !interval )
rtems_set_errno_and_return_minus_one( EINVAL );
47de6: 2040 moveal %d0,%a0
47de8: 7216 moveq #22,%d1
47dea: 70ff moveq #-1,%d0
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
return 0;
}
47dec: 4e5e unlk %fp
if ( pid && pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
if ( !interval )
rtems_set_errno_and_return_minus_one( EINVAL );
47dee: 2081 movel %d1,%a0@
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
return 0;
}
...
00048228 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
48228: 4e56 ffe0 linkw %fp,#-32
*
* 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;
4822c: 2039 0006 5a90 movel 65a90 <_Thread_Dispatch_disable_level>,%d0
++level;
48232: 5280 addql #1,%d0
48234: 48d7 041c moveml %d2-%d4/%a2,%sp@
48238: 262e 000c movel %fp@(12),%d3
_Thread_Dispatch_disable_level = level;
4823c: 23c0 0006 5a90 movel %d0,65a90 <_Thread_Dispatch_disable_level>
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
48242: 2803 movel %d3,%d4
48244: 0284 0000 0200 andil #512,%d4
4824a: 6600 0094 bnew 482e0 <sem_open+0xb8>
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
4824e: 95ca subal %a2,%a2
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
48250: 486e fffc pea %fp@(-4)
48254: 486e fff0 pea %fp@(-16)
48258: 2f2e 0008 movel %fp@(8),%sp@-
4825c: 4879 0006 5cac pea 65cac <_POSIX_Semaphore_Information>
48262: 4eb9 0004 7b8c jsr 47b8c <_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 ) {
48268: 4fef 0010 lea %sp@(16),%sp
4826c: 2400 movel %d0,%d2
4826e: 6726 beqs 48296 <sem_open+0x6e>
/*
* 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) ) ) {
48270: 7002 moveq #2,%d0
48272: b082 cmpl %d2,%d0
48274: 6604 bnes 4827a <sem_open+0x52>
48276: 4a84 tstl %d4
48278: 666e bnes 482e8 <sem_open+0xc0>
_Thread_Enable_dispatch();
4827a: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
48280: 4eb9 0005 1060 jsr 51060 <__errno>
48286: 2040 moveal %d0,%a0
48288: 70ff moveq #-1,%d0
4828a: 2082 movel %d2,%a0@
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
#endif
}
4828c: 4cee 041c ffe0 moveml %fp@(-32),%d2-%d4/%a2
48292: 4e5e unlk %fp
48294: 4e75 rts
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
48296: 0283 0000 0a00 andil #2560,%d3
4829c: 0c83 0000 0a00 cmpil #2560,%d3
482a2: 6778 beqs 4831c <sem_open+0xf4>
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
482a4: 486e fff8 pea %fp@(-8)
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;
_Thread_Enable_dispatch();
482a8: 45f9 0004 bab0 lea 4bab0 <_Thread_Enable_dispatch>,%a2
482ae: 2f2e fff0 movel %fp@(-16),%sp@-
482b2: 4879 0006 5cac pea 65cac <_POSIX_Semaphore_Information>
482b8: 4eb9 0004 acb4 jsr 4acb4 <_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;
482be: 2040 moveal %d0,%a0
482c0: 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 );
482c4: 2d40 fff4 movel %d0,%fp@(-12)
the_semaphore->open_count += 1;
_Thread_Enable_dispatch();
482c8: 4e92 jsr %a2@
_Thread_Enable_dispatch();
482ca: 4e92 jsr %a2@
goto return_id;
482cc: 4fef 000c lea %sp@(12),%sp
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;
482d0: 202e fff4 movel %fp@(-12),%d0
482d4: 5080 addql #8,%d0
#endif
}
482d6: 4cee 041c ffe0 moveml %fp@(-32),%d2-%d4/%a2
482dc: 4e5e unlk %fp
482de: 4e75 rts
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
482e0: 246e 0014 moveal %fp@(20),%a2
482e4: 6000 ff6a braw 48250 <sem_open+0x28>
/*
* 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(
482e8: 486e fff4 pea %fp@(-12)
482ec: 2f0a movel %a2,%sp@-
482ee: 42a7 clrl %sp@-
482f0: 2f2e fffc movel %fp@(-4),%sp@-
482f4: 2f2e 0008 movel %fp@(8),%sp@-
482f8: 4eb9 0004 ea10 jsr 4ea10 <_POSIX_Semaphore_Create_support>
482fe: 2400 movel %d0,%d2
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
48300: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
if ( status == -1 )
48306: 4fef 0014 lea %sp@(20),%sp
4830a: 70ff moveq #-1,%d0
4830c: b082 cmpl %d2,%d0
4830e: 66c0 bnes 482d0 <sem_open+0xa8> <== ALWAYS TAKEN
return SEM_FAILED;
48310: 70ff moveq #-1,%d0 <== NOT EXECUTED
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
#endif
}
48312: 4cee 041c ffe0 moveml %fp@(-32),%d2-%d4/%a2 <== NOT EXECUTED
48318: 4e5e unlk %fp <== NOT EXECUTED
4831a: 4e75 rts <== NOT EXECUTED
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
4831c: 4eb9 0004 bab0 jsr 4bab0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
48322: 4eb9 0005 1060 jsr 51060 <__errno>
48328: 7211 moveq #17,%d1
4832a: 2040 moveal %d0,%a0
4832c: 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
}
4832e: 4cee 041c ffe0 moveml %fp@(-32),%d2-%d4/%a2
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
48334: 2081 movel %d1,%a0@
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
#endif
}
48336: 4e5e unlk %fp
...
0004a250 <sem_timedwait>:
int sem_timedwait(
sem_t *sem,
const struct timespec *abstime
)
{
4a250: 4e56 fffc linkw %fp,#-4
*
* 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 );
4a254: 486e fffc pea %fp@(-4)
4a258: 2f2e 000c movel %fp@(12),%sp@-
4a25c: 4eb9 0004 f924 jsr 4f924 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
4a262: 508f addql #8,%sp
4a264: 7203 moveq #3,%d1
4a266: b280 cmpl %d0,%d1
4a268: 6718 beqs 4a282 <sem_timedwait+0x32> <== ALWAYS TAKEN
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
4a26a: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED
4a26e: 42a7 clrl %sp@- <== NOT EXECUTED
4a270: 2f2e 0008 movel %fp@(8),%sp@- <== NOT EXECUTED
4a274: 4eb9 0005 0598 jsr 50598 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED
4a27a: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED
lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}
return lock_status;
}
4a27e: 4e5e unlk %fp <== NOT EXECUTED
4a280: 4e75 rts <== NOT EXECUTED
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
4a282: 2f2e fffc movel %fp@(-4),%sp@-
4a286: 4878 0001 pea 1 <ADD>
4a28a: 2f2e 0008 movel %fp@(8),%sp@-
4a28e: 4eb9 0005 0598 jsr 50598 <_POSIX_Semaphore_Wait_support>
4a294: 4fef 000c lea %sp@(12),%sp
lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}
return lock_status;
}
4a298: 4e5e unlk %fp <== NOT EXECUTED
00047acc <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
47acc: 4e56 fff4 linkw %fp,#-12
47ad0: 226e 0010 moveal %fp@(16),%a1
47ad4: 48d7 040c moveml %d2-%d3/%a2,%sp@
47ad8: 242e 0008 movel %fp@(8),%d2
47adc: 246e 000c moveal %fp@(12),%a2
ISR_Level level;
if ( oact )
47ae0: 4a89 tstl %a1
47ae2: 6718 beqs 47afc <sigaction+0x30>
*oact = _POSIX_signals_Vectors[ sig ];
47ae4: 2202 movel %d2,%d1
47ae6: 2002 movel %d2,%d0
47ae8: e989 lsll #4,%d1
47aea: e588 lsll #2,%d0
47aec: 2041 moveal %d1,%a0
47aee: 91c0 subal %d0,%a0
47af0: d1fc 0006 3248 addal #406088,%a0
47af6: 22d8 movel %a0@+,%a1@+
47af8: 22d8 movel %a0@+,%a1@+
47afa: 2290 movel %a0@,%a1@
if ( !sig )
47afc: 4a82 tstl %d2
47afe: 6700 0088 beqw 47b88 <sigaction+0xbc>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
47b02: 2002 movel %d2,%d0
47b04: 5380 subql #1,%d0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
47b06: 721f moveq #31,%d1
47b08: b280 cmpl %d0,%d1
47b0a: 657c bcss 47b88 <sigaction+0xbc>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
47b0c: 7009 moveq #9,%d0
47b0e: b082 cmpl %d2,%d0
47b10: 6776 beqs 47b88 <sigaction+0xbc>
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
47b12: 4a8a tstl %a2
47b14: 6766 beqs 47b7c <sigaction+0xb0> <== 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 );
47b16: 203c 0000 0700 movel #1792,%d0
47b1c: 40c3 movew %sr,%d3
47b1e: 8083 orl %d3,%d0
47b20: 46c0 movew %d0,%sr
if ( act->sa_handler == SIG_DFL ) {
47b22: 4aaa 0008 tstl %a2@(8)
47b26: 6730 beqs 47b58 <sigaction+0x8c>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
47b28: 2f02 movel %d2,%sp@-
47b2a: 4eb9 0004 d634 jsr 4d634 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
47b30: 588f addql #4,%sp
47b32: 2002 movel %d2,%d0
47b34: 224a moveal %a2,%a1
47b36: e98a lsll #4,%d2
47b38: e588 lsll #2,%d0
47b3a: 2042 moveal %d2,%a0
47b3c: 91c0 subal %d0,%a0
47b3e: d1fc 0006 3248 addal #406088,%a0
47b44: 20d9 movel %a1@+,%a0@+
47b46: 20d9 movel %a1@+,%a0@+
47b48: 2091 movel %a1@,%a0@
}
_ISR_Enable( level );
47b4a: 46c3 movew %d3,%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;
47b4c: 4280 clrl %d0
}
47b4e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
47b54: 4e5e unlk %fp
47b56: 4e75 rts
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
47b58: 2002 movel %d2,%d0
47b5a: e98a lsll #4,%d2
47b5c: e588 lsll #2,%d0
47b5e: 9480 subl %d0,%d2
47b60: 2242 moveal %d2,%a1
47b62: 2042 moveal %d2,%a0
47b64: d3fc 0006 0896 addal #395414,%a1
47b6a: d1fc 0006 3248 addal #406088,%a0
47b70: 20d9 movel %a1@+,%a0@+
47b72: 20d9 movel %a1@+,%a0@+
47b74: 2091 movel %a1@,%a0@
} else {
_POSIX_signals_Clear_process_signals( sig );
_POSIX_signals_Vectors[ sig ] = *act;
}
_ISR_Enable( level );
47b76: 46c3 movew %d3,%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;
47b78: 4280 clrl %d0
47b7a: 60d2 bras 47b4e <sigaction+0x82>
47b7c: 4280 clrl %d0 <== NOT EXECUTED
}
47b7e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 <== NOT EXECUTED
47b84: 4e5e unlk %fp <== NOT EXECUTED
47b86: 4e75 rts <== NOT EXECUTED
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
rtems_set_errno_and_return_minus_one( EINVAL );
47b88: 4eb9 0005 0090 jsr 50090 <__errno>
47b8e: 7216 moveq #22,%d1
47b90: 2040 moveal %d0,%a0
47b92: 70ff moveq #-1,%d0
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
}
47b94: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
rtems_set_errno_and_return_minus_one( EINVAL );
47b9a: 2081 movel %d1,%a0@
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
}
47b9c: 4e5e unlk %fp <== NOT EXECUTED
0004a41c <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
4a41c: 4e56 0000 linkw %fp,#0
4a420: 2f0a movel %a2,%sp@-
4a422: 246e 000c moveal %fp@(12),%a2
int status;
status = sigtimedwait( set, NULL, NULL );
4a426: 42a7 clrl %sp@-
4a428: 42a7 clrl %sp@-
4a42a: 2f2e 0008 movel %fp@(8),%sp@-
4a42e: 4eb9 0004 a208 jsr 4a208 <sigtimedwait>
if ( status != -1 ) {
4a434: 4fef 000c lea %sp@(12),%sp
4a438: 72ff moveq #-1,%d1
4a43a: b280 cmpl %d0,%d1
4a43c: 6710 beqs 4a44e <sigwait+0x32>
if ( sig )
4a43e: 4a8a tstl %a2
4a440: 671e beqs 4a460 <sigwait+0x44> <== NEVER TAKEN
*sig = status;
4a442: 2480 movel %d0,%a2@
return 0;
}
return errno;
}
4a444: 246e fffc moveal %fp@(-4),%a2
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
4a448: 4280 clrl %d0
}
return errno;
}
4a44a: 4e5e unlk %fp
4a44c: 4e75 rts
if ( sig )
*sig = status;
return 0;
}
return errno;
4a44e: 4eb9 0005 2650 jsr 52650 <__errno>
}
4a454: 246e fffc moveal %fp@(-4),%a2
if ( sig )
*sig = status;
return 0;
}
return errno;
4a458: 2040 moveal %d0,%a0
}
4a45a: 4e5e unlk %fp
if ( sig )
*sig = status;
return 0;
}
return errno;
4a45c: 2010 movel %a0@,%d0
}
4a45e: 4e75 rts
4a460: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
*sig = status;
return 0;
4a464: 4280 clrl %d0 <== NOT EXECUTED
}
return errno;
}
4a466: 4e5e unlk %fp <== NOT EXECUTED
...
00046cd8 <sysconf>:
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
46cd8: 7002 moveq #2,%d0
*/
long sysconf(
int name
)
{
46cda: 4e56 0000 linkw %fp,#0
46cde: 222e 0008 movel %fp@(8),%d1
46ce2: 2f02 movel %d2,%sp@-
if ( name == _SC_CLK_TCK )
46ce4: b081 cmpl %d1,%d0
46ce6: 6732 beqs 46d1a <sysconf+0x42>
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
46ce8: 7004 moveq #4,%d0
46cea: b081 cmpl %d1,%d0
46cec: 6744 beqs 46d32 <sysconf+0x5a>
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
46cee: 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 )
46cf4: 7433 moveq #51,%d2
46cf6: b481 cmpl %d1,%d2
46cf8: 6718 beqs 46d12 <sysconf+0x3a>
return 1024;
if ( name == _SC_PAGESIZE )
46cfa: 143c 0008 moveb #8,%d2
return PAGE_SIZE;
46cfe: 303c 1000 movew #4096,%d0
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
46d02: b481 cmpl %d1,%d2
46d04: 670c beqs 46d12 <sysconf+0x3a>
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
46d06: 143c 004f moveb #79,%d2
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
46d0a: 303c 0020 movew #32,%d0
return 1024;
if ( name == _SC_PAGESIZE )
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
46d0e: b481 cmpl %d1,%d2
46d10: 662e bnes 46d40 <sysconf+0x68> <== ALWAYS TAKEN
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
46d12: 242e fffc movel %fp@(-4),%d2
46d16: 4e5e unlk %fp
46d18: 4e75 rts
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
46d1a: 41f9 0005 dd28 lea 5dd28 <Configuration+0xc>,%a0
46d20: 203c 000f 4240 movel #1000000,%d0
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
46d26: 242e fffc movel %fp@(-4),%d2
46d2a: 4e5e unlk %fp
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
46d2c: 4c50 0000 remul %a0@,%d0,%d0
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
46d30: 4e75 rts
46d32: 242e fffc movel %fp@(-4),%d2
46d36: 4e5e unlk %fp
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
46d38: 2039 0005 fab4 movel 5fab4 <rtems_libio_number_iops>,%d0
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
46d3e: 4e75 rts
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
46d40: 4eb9 0004 f314 jsr 4f314 <__errno>
}
46d46: 242e fffc movel %fp@(-4),%d2
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
46d4a: 2040 moveal %d0,%a0
46d4c: 7216 moveq #22,%d1
46d4e: 70ff moveq #-1,%d0
}
46d50: 4e5e unlk %fp
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
46d52: 2081 movel %d1,%a0@
}
...
00047066 <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
47066: 4e56 ffe8 linkw %fp,#-24
4706a: 48d7 041c moveml %d2-%d4/%a2,%sp@
4706e: 242e 0008 movel %fp@(8),%d2
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
47072: 4ab9 0006 2fdc tstl 62fdc <_POSIX_signals_Ualarm_timer+0x1c>
47078: 6700 0086 beqw 47100 <ualarm+0x9a>
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
4707c: 4879 0006 2fc0 pea 62fc0 <_POSIX_signals_Ualarm_timer>
47082: 4eb9 0004 afa8 jsr 4afa8 <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
47088: 588f addql #4,%sp
4708a: 7201 moveq #1,%d1
4708c: 5580 subql #2,%d0
4708e: b280 cmpl %d0,%d1
47090: 6400 0098 bccw 4712a <ualarm+0xc4>
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
47094: 4283 clrl %d3 <== NOT EXECUTED
/*
* 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 ) {
47096: 4a82 tstl %d2 <== NOT EXECUTED
47098: 660c bnes 470a6 <ualarm+0x40> <== NOT EXECUTED
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
}
return remaining;
}
4709a: 2003 movel %d3,%d0
4709c: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2
470a2: 4e5e unlk %fp
470a4: 4e75 rts
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
470a6: 280e movel %fp,%d4
* 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;
470a8: 223c 000f 4240 movel #1000000,%d1
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
470ae: 5184 subql #8,%d4
470b0: 45f9 0004 abc8 lea 4abc8 <_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;
470b6: 4c41 2000 remul %d1,%d0,%d2
470ba: 4c41 2002 remul %d1,%d2,%d2
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
470be: 223c 0000 03e8 movel #1000,%d1
470c4: 4c00 1800 mulsl %d0,%d1
ticks = _Timespec_To_ticks( &tp );
470c8: 2f04 movel %d4,%sp@-
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
470ca: 2d41 fffc movel %d1,%fp@(-4)
* 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;
470ce: 2d42 fff8 movel %d2,%fp@(-8)
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
470d2: 4e92 jsr %a2@
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
470d4: 2f04 movel %d4,%sp@-
470d6: 4e92 jsr %a2@
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
470d8: 4879 0006 2fc0 pea 62fc0 <_POSIX_signals_Ualarm_timer>
470de: 4879 0006 2862 pea 62862 <_Watchdog_Ticks_chain>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
470e4: 23c0 0006 2fcc movel %d0,62fcc <_POSIX_signals_Ualarm_timer+0xc>
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
470ea: 4eb9 0004 ae78 jsr 4ae78 <_Watchdog_Insert>
470f0: 4fef 0010 lea %sp@(16),%sp
}
return remaining;
}
470f4: 2003 movel %d3,%d0
470f6: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2
470fc: 4e5e unlk %fp
470fe: 4e75 rts
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
47100: 42b9 0006 2fc8 clrl 62fc8 <_POSIX_signals_Ualarm_timer+0x8>
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
47106: 4283 clrl %d3
the_watchdog->routine = routine;
47108: 203c 0004 7024 movel #290852,%d0
the_watchdog->id = id;
4710e: 42b9 0006 2fe0 clrl 62fe0 <_POSIX_signals_Ualarm_timer+0x20>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
47114: 23c0 0006 2fdc movel %d0,62fdc <_POSIX_signals_Ualarm_timer+0x1c>
the_watchdog->id = id;
the_watchdog->user_data = user_data;
4711a: 42b9 0006 2fe4 clrl 62fe4 <_POSIX_signals_Ualarm_timer+0x24>
/*
* 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 ) {
47120: 4a82 tstl %d2
47122: 6700 ff76 beqw 4709a <ualarm+0x34>
47126: 6000 ff7e braw 470a6 <ualarm+0x40>
* 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);
4712a: 2039 0006 2fd4 movel 62fd4 <_POSIX_signals_Ualarm_timer+0x14>,%d0
47130: d0b9 0006 2fcc addl 62fcc <_POSIX_signals_Ualarm_timer+0xc>,%d0
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
47136: 486e fff8 pea %fp@(-8)
4713a: 90b9 0006 2fd8 subl 62fd8 <_POSIX_signals_Ualarm_timer+0x18>,%d0
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
47140: 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 );
47146: 2f00 movel %d0,%sp@-
47148: 4eb9 0004 ab8c jsr 4ab8c <_Timespec_From_ticks>
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
4714e: 202e fff8 movel %fp@(-8),%d0
47152: 4c04 0800 mulsl %d4,%d0
remaining += tp.tv_nsec / 1000;
47156: 283c 0000 03e8 movel #1000,%d4
4715c: 508f addql #8,%sp
4715e: 262e fffc movel %fp@(-4),%d3
47162: 4c44 3803 remsl %d4,%d3,%d3
47166: d680 addl %d0,%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 ) {
47168: 4a82 tstl %d2
4716a: 6700 ff2e beqw 4709a <ualarm+0x34>
4716e: 6000 ff36 braw 470a6 <ualarm+0x40> <== NOT EXECUTED
...