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 _INCLUDE_ASSOC_H |
---|
15 | #define _INCLUDE_ASSOC_H |
---|
16 | |
---|
17 | typedef 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 | |
---|
29 | const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *); |
---|
30 | const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, uint32_t ); |
---|
31 | const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, uint32_t ); |
---|
32 | |
---|
33 | uint32_t rtems_assoc_remote_by_local(const rtems_assoc_t *, uint32_t ); |
---|
34 | uint32_t rtems_assoc_local_by_remote(const rtems_assoc_t *, uint32_t ); |
---|
35 | uint32_t rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *); |
---|
36 | uint32_t rtems_assoc_local_by_name(const rtems_assoc_t *, const char *); |
---|
37 | const char *rtems_assoc_name_by_local(const rtems_assoc_t *, uint32_t ); |
---|
38 | const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, uint32_t ); |
---|
39 | |
---|
40 | uint32_t rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, uint32_t ); |
---|
41 | char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, uint32_t , char *); |
---|
42 | char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, uint32_t , char *); |
---|
43 | uint32_t rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, uint32_t ); |
---|
44 | |
---|
45 | |
---|
46 | #endif /* ! _INCLUDE_ASSOC_H */ |
---|