source: rtems/cpukit/rtems/src/rtemsobjectgetapiclassname.c @ 08c3066

4.115
Last change on this file since 08c3066 was 08c3066, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/18/10 at 03:03:22

Remove RTEMS_ITRON_API conditional blocks.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 *  RTEMS Object Helper -- Obtain Name of API
3 *
4 *  COPYRIGHT (c) 1989-2008.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/score/object.h>
20#include <rtems/rtems/object.h>
21
22#include <rtems/assoc.h>
23
24rtems_assoc_t rtems_object_api_internal_assoc[] = {
25  { "Thread",                  OBJECTS_INTERNAL_THREADS, 0},
26  { "Mutex",                   OBJECTS_INTERNAL_MUTEXES, 0},
27};
28
29rtems_assoc_t rtems_object_api_classic_assoc[] = {
30  { "Task",                    OBJECTS_RTEMS_TASKS, 0},
31  { "Timer",                   OBJECTS_RTEMS_TIMERS, 0},
32  { "Semaphore",               OBJECTS_RTEMS_SEMAPHORES, 0},
33  { "Message Queue",           OBJECTS_RTEMS_MESSAGE_QUEUES, 0},
34  { "Partition",               OBJECTS_RTEMS_PARTITIONS, 0},
35  { "Region",                  OBJECTS_RTEMS_REGIONS, 0},
36  { "Port",                    OBJECTS_RTEMS_PORTS, 0},
37  { "Period",                  OBJECTS_RTEMS_PERIODS, 0},
38  { "Extension",               OBJECTS_RTEMS_EXTENSIONS, 0},
39  { "Barrier",                 OBJECTS_RTEMS_BARRIERS, 0},
40};
41
42#ifdef RTEMS_POSIX_API
43rtems_assoc_t rtems_object_api_posix_assoc[] = {
44  { "Thread",                  OBJECTS_POSIX_THREADS, 0},
45  { "Key",                     OBJECTS_POSIX_KEYS, 0},
46  { "Interrupt",               OBJECTS_POSIX_INTERRUPTS, 0},
47  { "Queued fd",               OBJECTS_POSIX_MESSAGE_QUEUE_FDS, 0},
48  { "Message Queue",           OBJECTS_POSIX_MESSAGE_QUEUES, 0},
49  { "Mutex",                   OBJECTS_POSIX_MUTEXES, 0},
50  { "Semaphore",               OBJECTS_POSIX_SEMAPHORES, 0},
51  { "Condition Variable",      OBJECTS_POSIX_CONDITION_VARIABLES, 0},
52  { "Timer",                   OBJECTS_POSIX_TIMERS, 0},
53  { "Barrier",                 OBJECTS_POSIX_BARRIERS, 0},
54  { "Spinlock",                OBJECTS_POSIX_SPINLOCKS, 0},
55  { "RWLock",                  OBJECTS_POSIX_RWLOCKS, 0},
56};
57#endif
58
59const char *rtems_object_get_api_class_name(
60  int the_api,
61  int the_class
62)
63{
64  const rtems_assoc_t *api_assoc;
65  const rtems_assoc_t *class_assoc;
66
67  if ( the_api == OBJECTS_INTERNAL_API )
68    api_assoc = rtems_object_api_internal_assoc;
69  else if ( the_api == OBJECTS_CLASSIC_API )
70    api_assoc = rtems_object_api_classic_assoc;
71#ifdef RTEMS_POSIX_API
72  else if ( the_api == OBJECTS_POSIX_API )
73    api_assoc = rtems_object_api_posix_assoc;
74#endif
75  else
76    return "BAD API";
77  class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
78  if ( class_assoc )
79    return class_assoc->name;
80  return "BAD CLASS";
81}
Note: See TracBrowser for help on using the repository browser.