RTEMS: cpukit/include/rtems/assoc.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
assoc.h
Go to the documentation of this file.
1
10#ifndef _RTEMS_RTEMS_ASSOC_H
11#define _RTEMS_RTEMS_ASSOC_H
12
13#include <stddef.h>
14#include <stdint.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
31 typedef struct {
32 const char *name;
33 uint32_t local_value;
34 uint32_t remote_value;
35} rtems_assoc_t;
36
37/*
38 * Flag/marker for optional default value in each table
39 */
40
41#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
42
46const rtems_assoc_t *rtems_assoc_ptr_by_name(
47 const rtems_assoc_t *,
48 const char *
49);
50
54const rtems_assoc_t *rtems_assoc_ptr_by_remote(
55 const rtems_assoc_t *,
56 uint32_t
57);
58
59uint32_t rtems_assoc_remote_by_local(
60 const rtems_assoc_t *,
61 uint32_t
62);
63
67uint32_t rtems_assoc_local_by_remote(
68 const rtems_assoc_t *,
69 uint32_t
70);
71
75uint32_t rtems_assoc_remote_by_name(
76 const rtems_assoc_t *,
77 const char *
78);
79
83uint32_t rtems_assoc_local_by_name(
84 const rtems_assoc_t *,
85 const char *
86);
87
91const char *rtems_assoc_name_by_local(
92 const rtems_assoc_t *,
93 uint32_t
94);
95
99const char *rtems_assoc_name_by_remote(
100 const rtems_assoc_t *,
101 uint32_t
102);
103
107uint32_t rtems_assoc_remote_by_local_bitfield(
108 const rtems_assoc_t *,
109 uint32_t
110);
111
115char *rtems_assoc_name_by_local_bitfield(
116 const rtems_assoc_t *,
117 uint32_t ,
118 char *
119);
120
124char *rtems_assoc_name_by_remote_bitfield(
125 const rtems_assoc_t *,
126 uint32_t ,
127 char *
128);
129
130uint32_t rtems_assoc_local_by_remote_bitfield(
131 const rtems_assoc_t *,
132 uint32_t
133);
134
138const rtems_assoc_t *rtems_assoc_ptr_by_local(
139 const rtems_assoc_t *ap,
140 uint32_t local_value
141);
142
143#if defined(INSIDE_ASSOC)
144
145#define rtems_assoc_is_default(_ap) \
146 ((_ap)->name && !strcmp((_ap)->name, RTEMS_ASSOC_DEFAULT_NAME))
147
154const char *rtems_assoc_name_bad(
155 uint32_t bad_value
156);
157#endif
158
159 typedef struct {
160 uint32_t bits;
161 const char *name;
162} rtems_assoc_32_pair;
163
179size_t rtems_assoc_32_to_string(
180 uint32_t value,
181 char *buffer,
182 size_t buffer_size,
183 const rtems_assoc_32_pair *pairs,
184 size_t pair_count,
185 const char *separator,
186 const char *fallback
187);
188
199size_t rtems_assoc_thread_states_to_string(
200 uint32_t states,
201 char *buffer,
202 size_t buffer_size
203);
204
207#ifdef __cplusplus
208}
209#endif
210
211#endif /* ! _RTEMS_RTEMS_ASSOC_H */
rtems_assoc_name_by_local_bitfield
char * rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, uint32_t, char *)
RTEMS Associate Name by Local Bitfield.
Definition: assocnamebylocalbitfield.c:19
rtems_assoc_local_by_remote
uint32_t rtems_assoc_local_by_remote(const rtems_assoc_t *, uint32_t)
RTEMS Associate Local by Remote.
Definition: assoclocalbyremote.c:19
rtems_assoc_name_by_remote_bitfield
char * rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, uint32_t, char *)
RTEMS Associate Name by Remote Bitfield.
Definition: assocnamebyremotebitfield.c:20
rtems_assoc_local_by_name
uint32_t rtems_assoc_local_by_name(const rtems_assoc_t *, const char *)
RTEMS Associate Local by Name.
Definition: assoclocalbyname.c:29
rtems_assoc_name_by_remote
const char * rtems_assoc_name_by_remote(const rtems_assoc_t *, uint32_t)
RTEMS Associate Name by Remote.
Definition: assocnamebyremote.c:20
rtems_assoc_thread_states_to_string
size_t rtems_assoc_thread_states_to_string(uint32_t states, char *buffer, size_t buffer_size)
Converts the specified thread states into a text representation.
Definition: assocthreadstatestostring.c:42
rtems_assoc_remote_by_local_bitfield
uint32_t rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, uint32_t)
RTEMS Assoc Routines.
Definition: assocremotebylocalbitfield.c:30
rtems_assoc_ptr_by_remote
const rtems_assoc_t * rtems_assoc_ptr_by_remote(const rtems_assoc_t *, uint32_t)
RTEMS Associate Pointer by Remote.
Definition: assocptrbyremote.c:19
rtems_assoc_ptr_by_name
const rtems_assoc_t * rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *)
RTEMS Associate Pointer by Name.
Definition: assocptrbyname.c:20
rtems_assoc_32_to_string
size_t rtems_assoc_32_to_string(uint32_t value, char *buffer, size_t buffer_size, const rtems_assoc_32_pair *pairs, size_t pair_count, const char *separator, const char *fallback)
Converts the specified value into a text representation.
Definition: assoc32tostring.c:27
rtems_assoc_ptr_by_local
const rtems_assoc_t * rtems_assoc_ptr_by_local(const rtems_assoc_t *ap, uint32_t local_value)
RTEMS Associate Pointer by Local.
Definition: assocptrbylocal.c:19
rtems_assoc_name_by_local
const char * rtems_assoc_name_by_local(const rtems_assoc_t *, uint32_t)
RTEMS Associate Name by Local.
Definition: assocnamebylocal.c:19
rtems_assoc_remote_by_name
uint32_t rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *)
RTEMS Associate Remote by Name.
Definition: assocremotebyname.c:19
rtems_assoc_32_pair
Definition: assoc.h:159
rtems_assoc_t
Definition: assoc.h:31