source: rtems/cpukit/libcsupport/include/rtems/assoc.h @ cd225515

4.104.114.95
Last change on this file since cd225515 was cd225515, checked in by Joel Sherrill <joel.sherrill@…>, on 12/21/07 at 15:22:40

2007-12-21 Joel Sherrill <joel.sherrill@…>

PR 1268/cpukit

  • libcsupport/include/rtems/assoc.h: There is no rtems_assoc_ptr_by_value method.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/**
2 * @file rtems/assoc.h
3 */
4
5/*
6 *
7 *  Rtems associativity routines.  Mainly used to convert a value from
8 *  one space to another (eg: our errno's to host errno's and v.v)
9 *
10 *
11 *  $Id$
12 */
13
14#ifndef _RTEMS_RTEMS_ASSOC_H
15#define _RTEMS_RTEMS_ASSOC_H
16
17typedef struct {
18    const char  *name;
19    uint32_t     local_value;
20    uint32_t     remote_value;
21} rtems_assoc_t;
22
23/*
24 * Flag/marker for optional default value in each table
25 */
26
27#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
28
29const rtems_assoc_t *rtems_assoc_ptr_by_name(
30  const rtems_assoc_t *,
31  const char *
32);
33
34const rtems_assoc_t *rtems_assoc_ptr_by_remote(
35  const rtems_assoc_t *,
36  uint32_t
37);
38
39uint32_t rtems_assoc_remote_by_local(
40  const rtems_assoc_t *,
41  uint32_t
42);
43
44uint32_t rtems_assoc_local_by_remote(
45  const rtems_assoc_t *,
46  uint32_t
47);
48
49uint32_t rtems_assoc_remote_by_name(
50  const rtems_assoc_t *,
51  const char *
52);
53uint32_t rtems_assoc_local_by_name(
54  const rtems_assoc_t *,
55  const char *
56);
57
58const char *rtems_assoc_name_by_local(
59  const rtems_assoc_t *,
60  uint32_t
61);
62
63const char *rtems_assoc_name_by_remote(
64  const rtems_assoc_t *,
65  uint32_t
66);
67
68uint32_t rtems_assoc_remote_by_local_bitfield(
69  const rtems_assoc_t *,
70  uint32_t
71);
72
73char *rtems_assoc_name_by_local_bitfield(
74  const rtems_assoc_t *,
75  uint32_t  ,
76  char *
77);
78
79char *rtems_assoc_name_by_remote_bitfield(
80  const rtems_assoc_t *,
81  uint32_t  ,
82  char *
83);
84
85uint32_t     rtems_assoc_local_by_remote_bitfield(
86  const rtems_assoc_t *,
87  uint32_t
88);
89
90#if defined(INSIDE_ASSOC)
91
92#define rtems_assoc_is_default(_ap) \
93  ((_ap)->name && !strcmp((_ap)->name, RTEMS_ASSOC_DEFAULT_NAME))
94
95/*
96 * what to return if a value is not found
97 * this is not reentrant, but it really shouldn't be invoked anyway
98 */
99
100const char *rtems_assoc_name_bad(
101  uint32_t   bad_value
102);
103
104const rtems_assoc_t *rtems_assoc_ptr_by_local(
105  const rtems_assoc_t *ap,
106  uint32_t             local_value
107);
108
109#endif
110
111#endif /* ! _INCLUDE_ASSOC_H */
Note: See TracBrowser for help on using the repository browser.