source: rtems/cpukit/score/src/threadget.c @ 8af72be

4.104.114.84.95
Last change on this file since 8af72be was 8af72be, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/23/03 at 21:45:00

2003-11-23 Ralf Corsepius <corsepiu@…>

PR 525/rtems

  • include/rtems/system.h: Use RTEMS_INLINES instead of USE_INLINES.
  • include/rtems/score/chain.h: Ditto.
  • include/rtems/score/thread.h: Ditto.
  • src/chain.c: Ditto.
  • src/coremutexseize.c: Ditto.
  • src/threadget.c: Ditto.
  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[05df0a8]1/*
2 *  Thread Handler
3 *
4 *
[08311cc3]5 *  COPYRIGHT (c) 1989-1999.
[05df0a8]6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in found in the file LICENSE in this distribution or at
[dd687d97]10 *  http://www.rtems.com/license/LICENSE.
[05df0a8]11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/score/apiext.h>
17#include <rtems/score/context.h>
18#include <rtems/score/interr.h>
19#include <rtems/score/isr.h>
20#include <rtems/score/object.h>
21#include <rtems/score/priority.h>
22#include <rtems/score/states.h>
23#include <rtems/score/sysstate.h>
24#include <rtems/score/thread.h>
25#include <rtems/score/threadq.h>
26#include <rtems/score/userext.h>
27#include <rtems/score/wkspace.h>
28
29/*PAGE
30 *
31 *  _Thread_Get
32 *
33 *  NOTE:  If we are not using static inlines, this must be a real
34 *         subroutine call.
35 *
36 *  NOTE:  XXX... This routine may be able to be optimized.
37 */
38
[8af72be]39#ifndef RTEMS_INLINES
[05df0a8]40
41Thread_Control *_Thread_Get (
42  Objects_Id           id,
43  Objects_Locations   *location
44)
45{
[ef9505a9]46  unsigned32           the_api;
47  unsigned32           the_class;
[05df0a8]48  Objects_Information *information;
[ef9505a9]49  Thread_Control      *tp = (Thread_Control *) 0;
[05df0a8]50 
51  if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
52    _Thread_Disable_dispatch();
53    *location = OBJECTS_LOCAL;
[ef9505a9]54    tp = _Thread_Executing;
55    goto done;
[05df0a8]56  }
57 
[ef9505a9]58  the_api = _Objects_Get_API( id );
59  if ( the_api && the_api > OBJECTS_APIS_LAST ) {
60    *location = OBJECTS_ERROR;
61    goto done;
62  }
63 
[05df0a8]64  the_class = _Objects_Get_class( id );
[ef9505a9]65  if ( the_class != 1 ) {       /* threads are always first class :) */
[05df0a8]66    *location = OBJECTS_ERROR;
[ef9505a9]67    goto done;
68  }
[05df0a8]69 
[ef9505a9]70  information = _Objects_Information_table[ the_api ][ the_class ];
[05df0a8]71 
[ef9505a9]72  if ( !information ) {
[05df0a8]73    *location = OBJECTS_ERROR;
[ef9505a9]74    goto done;
[05df0a8]75  }
76 
[ef9505a9]77  tp = (Thread_Control *) _Objects_Get( information, id, location );
78 
79done:
80  return tp;
[05df0a8]81}
82
83#endif
Note: See TracBrowser for help on using the repository browser.