Changeset 3a4ae6c in rtems for cpukit/score/src/threadq.c


Ignore:
Timestamp:
Sep 11, 1995, 7:35:39 PM (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ced11f99
Parents:
5072b07
Message:

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadq.c

    r5072b07 r3a4ae6c  
    1515
    1616#include <rtems/system.h>
    17 #include <rtems/chain.h>
    18 #include <rtems/isr.h>
    19 #include <rtems/object.h>
    20 #include <rtems/states.h>
    21 #include <rtems/thread.h>
    22 #include <rtems/threadq.h>
    23 #include <rtems/tqdata.h>
     17#include <rtems/core/chain.h>
     18#include <rtems/core/isr.h>
     19#include <rtems/core/object.h>
     20#include <rtems/core/states.h>
     21#include <rtems/core/thread.h>
     22#include <rtems/core/threadq.h>
     23#include <rtems/core/tqdata.h>
     24
     25#include <rtems/rtems/status.h>
    2426
    2527/*PAGE
     
    3032 *
    3133 *  Input parameters:
    32  *    the_thread_queue - pointer to a threadq header
    33  *    the_class        - class of the object to which this belongs
    34  *    discipline       - queueing discipline
    35  *    state            - state of waiting threads
     34 *    the_thread_queue      - pointer to a threadq header
     35 *    the_class             - class of the object to which this belongs
     36 *    discipline            - queueing discipline
     37 *    state                 - state of waiting threads
     38 *    proxy_extract_callout - MP specific callout
     39 *    timeout_status        - return on a timeout
    3640 *
    3741 *  Output parameters: NONE
     
    4347  Thread_queue_Disciplines      the_discipline,
    4448  States_Control                state,
    45   Thread_queue_Extract_callout  proxy_extract_callout
     49  Thread_queue_Extract_callout  proxy_extract_callout,
     50  unsigned32                    timeout_status
    4651)
    4752{
     
    5055  _Thread_queue_Extract_table[ the_class ] = proxy_extract_callout;
    5156
    52   the_thread_queue->state      = state;
    53   the_thread_queue->discipline = the_discipline;
     57  the_thread_queue->state          = state;
     58  the_thread_queue->discipline     = the_discipline;
     59  the_thread_queue->timeout_status = timeout_status;
    5460
    5561  switch ( the_discipline ) {
     
    8692void _Thread_queue_Enqueue(
    8793  Thread_queue_Control *the_thread_queue,
    88   rtems_interval     timeout
     94  Watchdog_Interval     timeout
    8995)
    9096{
     
    9399  the_thread = _Thread_Executing;
    94100
    95   if ( _Thread_MP_Is_receive( the_thread ) )
     101  if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet )
    96102    the_thread = _Thread_MP_Allocate_proxy( the_thread_queue->state );
    97103  else
     
    129135 *
    130136 *  This routine removes a thread from the specified threadq.  If the
    131  *  threadq discipline is RTEMS_FIFO, it unblocks a thread, and cancels its
     137 *  threadq discipline is FIFO, it unblocks a thread, and cancels its
    132138 *  timeout timer.  Priority discipline is processed elsewhere.
    133139 *
     
    140146 *  INTERRUPT LATENCY:
    141147 *    check sync
    142  *    RTEMS_FIFO
    143148 */
    144149
     
    201206         _States_Is_locally_blocked( state ) ) {
    202207
    203       the_class = rtems_get_class( the_thread->Wait.id );
     208      the_class = _Objects_Get_class( the_thread->Wait.id );
    204209
    205210      proxy_extract_callout = _Thread_queue_Extract_table[ the_class ];
     
    253258 *
    254259 *  Input parameters:
    255  *    the_thread_queue - pointer to threadq to be flushed
     260 *    the_thread_queue       - pointer to threadq to be flushed
     261 *    remote_extract_callout - pointer to routine which extracts a remote thread
     262 *    status                 - status to return to the thread
    256263 *
    257264 *  Output parameters:  NONE
     
    260267void _Thread_queue_Flush(
    261268  Thread_queue_Control       *the_thread_queue,
    262   Thread_queue_Flush_callout  remote_extract_callout
     269  Thread_queue_Flush_callout  remote_extract_callout,
     270  unsigned32                  status
    263271)
    264272{
     
    267275  while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) {
    268276    if ( _Objects_Is_local_id( the_thread->Object.id ) )
    269       the_thread->Wait.return_code = RTEMS_OBJECT_WAS_DELETED;
     277      the_thread->Wait.return_code = status;
    270278    else
    271279      ( *remote_extract_callout )( the_thread );
     
    335343      break;
    336344    case OBJECTS_LOCAL:
    337       the_thread->Wait.return_code = RTEMS_TIMEOUT;
     345      the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
    338346      _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
    339347      _Thread_Unnest_dispatch();
     
    363371  Thread_queue_Control *the_thread_queue,
    364372  Thread_Control       *the_thread,
    365   rtems_interval            timeout
     373  Watchdog_Interval    timeout
    366374)
    367375{
     
    377385    );
    378386
    379     if ( timeout != RTEMS_NO_TIMEOUT )
     387    if ( timeout != WATCHDOG_NO_TIMEOUT )
    380388      _Watchdog_Activate( &the_thread->Timer );
    381389
     
    413421 *  INTERRUPT LATENCY:
    414422 *    check sync
    415  *    RTEMS_FIFO
     423 *    FIFO
    416424 */
    417425
     
    542550  Thread_queue_Control *the_thread_queue,
    543551  Thread_Control       *the_thread,
    544   rtems_interval     timeout
     552  Watchdog_Interval     timeout
    545553)
    546554{
     
    568576
    569577restart_forward_search:
    570   search_priority = RTEMS_MINIMUM_PRIORITY - 1;
     578  search_priority = PRIORITY_MINIMUM - 1;
    571579  _ISR_Disable( level );
    572580  search_thread = (Thread_Control *) header->first;
     
    596604
    597605  the_thread_queue->sync = FALSE;
    598   if ( timeout != RTEMS_NO_TIMEOUT )
     606  if ( timeout != WATCHDOG_NO_TIMEOUT )
    599607    _Watchdog_Activate( &the_thread->Timer );
    600608
     
    614622
    615623restart_reverse_search:
    616   search_priority     = RTEMS_MAXIMUM_PRIORITY + 1;
     624  search_priority     = PRIORITY_MAXIMUM + 1;
    617625
    618626  _ISR_Disable( level );
     
    642650
    643651  the_thread_queue->sync = FALSE;
    644   if ( timeout != RTEMS_NO_TIMEOUT )
     652  if ( timeout != WATCHDOG_NO_TIMEOUT )
    645653    _Watchdog_Activate( &the_thread->Timer );
    646654
     
    689697 *  _Thread_queue_Dequeue_priority
    690698 *
    691  *  This routine removes a thread from the specified RTEMS_PRIORITY based
     699 *  This routine removes a thread from the specified PRIORITY based
    692700 *  threadq, unblocks it, and cancels its timeout timer.
    693701 *
Note: See TracChangeset for help on using the changeset viewer.