source: rtems/cpukit/score/src/objectgetnoprotection.c @ 7fa97181

Last change on this file since 7fa97181 was a6eef8b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:52:48

2003-09-04 Joel Sherrill <joel@…>

  • apiext.c, chain.c, coremsg.c, coremsgbroadcast.c, coremsgclose.c, coremsgflush.c, coremsgflushsupp.c, coremsgflushwait.c, coremsginsert.c, coremsgseize.c, coremsgsubmit.c, coremutex.c, coremutexflush.c, coremutexseize.c, coremutexsurrender.c, coresem.c, coresemflush.c, coresemseize.c, coresemsurrender.c, coretod.c, coretodset.c, coretodtickle.c, coretodtoseconds.c, coretodvalidate.c, heap.c, heapallocate.c, heapextend.c, heapfree.c, heapgetinfo.c, heapsizeofuserarea.c, heapwalk.c, interr.c, isr.c, mpci.c, object.c, objectallocate.c, objectallocatebyindex.c, objectclearname.c, objectcomparenameraw.c, objectcomparenamestring.c, objectcopynameraw.c, objectcopynamestring.c, objectextendinformation.c, objectfree.c, objectget.c, objectgetbyindex.c, objectgetisr.c, objectgetnext.c, objectgetnoprotection.c, objectinitializeinformation.c, objectmp.c, objectnametoid.c, objectshrinkinformation.c, thread.c, threadchangepriority.c, threadclearstate.c, threadclose.c, threadcreateidle.c, threaddelayended.c, threaddispatch.c, threadevaluatemode.c, threadget.c, threadhandler.c, threadidlebody.c, threadinitialize.c, threadloadenv.c, threadmp.c, threadq.c, threadqdequeue.c, threadqdequeuefifo.c, threadqdequeuepriority.c, threadqenqueue.c, threadqenqueuefifo.c, threadqenqueuepriority.c, threadqextract.c, threadqextractfifo.c, threadqextractpriority.c, threadqextractwithproxy.c, threadqfirst.c, threadqfirstfifo.c, threadqfirstpriority.c, threadqflush.c, threadqtimeout.c, threadready.c, threadreset.c, threadresettimeslice.c, threadrestart.c, threadresume.c, threadrotatequeue.c, threadsetpriority.c, threadsetstate.c, threadsettransient.c, threadstackallocate.c, threadstackfree.c, threadstart.c, threadstartmultitasking.c, threadsuspend.c, threadtickletimeslice.c, threadyieldprocessor.c, userext.c, watchdog.c, watchdogadjust.c, watchdoginsert.c, watchdogremove.c, watchdogtickle.c, wkspace.c: URL for license changed.
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 *  Object Handler -- Object Get
3 *
4 *
5 *  COPYRIGHT (c) 1989-2002.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/score/address.h>
17#include <rtems/score/chain.h>
18#include <rtems/score/object.h>
19#if defined(RTEMS_MULTIPROCESSING)
20#include <rtems/score/objectmp.h>
21#endif
22#include <rtems/score/thread.h>
23#include <rtems/score/wkspace.h>
24#include <rtems/score/sysstate.h>
25#include <rtems/score/isr.h>
26
27/*PAGE
28 *
29 * _Objects_Get_no_protection
30 *
31 * This routine sets the object pointer for the given
32 * object id based on the given object information structure.
33 *
34 * Input parameters:
35 *   information - pointer to entry in table for this class
36 *   id          - object id to search for
37 *   location    - address of where to store the location
38 *
39 * Output parameters:
40 *   returns  - address of object if local
41 *   location - one of the following:
42 *                  OBJECTS_ERROR  - invalid object ID
43 *                  OBJECTS_REMOTE - remote object
44 *                  OBJECTS_LOCAL  - local object
45 */
46
47Objects_Control *_Objects_Get_no_protection(
48  Objects_Information *information,
49  Objects_Id           id,
50  Objects_Locations   *location
51)
52{
53  Objects_Control *the_object;
54  unsigned32       index;
55
56#if defined(RTEMS_MULTIPROCESSING)
57  index = id - information->minimum_id + 1;
58#else
59  /* index = _Objects_Get_index( id ); */
60  index = id & 0x0000ffff;
61  /* This should work but doesn't always :( */
62  /* index = (unsigned16) id; */
63#endif
64
65   if ( information->maximum >= index ) {
66    if ( (the_object = information->local_table[ index ]) != NULL ) {
67      *location = OBJECTS_LOCAL;
68      return the_object;
69    }
70    *location = OBJECTS_ERROR;
71    return NULL;
72  }
73  *location = OBJECTS_ERROR;
74
75/*
76 *  Not supported for multiprocessing
77 */
78#if 0 && defined(RTEMS_MULTIPROCESSING)
79  _Objects_MP_Is_remote( information, id, location, &the_object );
80  return the_object;
81#endif
82  return NULL;
83}
Note: See TracBrowser for help on using the repository browser.