Renames ridiculous sys_getcpuid call (XCC)
[akaros.git] / kern / include / ros / bcq_struct.h
1 /* Copyright (c) 2010 The Regents of the University of California
2  * Barret Rhoden <brho@cs.berkeley.edu>
3  * See LICENSE for details.
4  *
5  * Struct for the BCQ.  Needs to be in its own file so glibc doesn't try to
6  * include any of the atomics needed for the actual BCQ operations.  */
7
8 #ifndef ROS_INC_BCQ_STRUCT_H
9 #define ROS_INC_BCQ_STRUCT_H
10
11 #include <ros/common.h>
12
13 struct bcq_header {
14         uint32_t prod_idx;              /* next to be produced in */
15         uint32_t cons_pub_idx;  /* last completely consumed */
16         uint32_t cons_pvt_idx;  /* last a consumer has dibs on */
17 };
18
19 #define DEFINE_BCQ_TYPES(__name, __elem_t, __num_elems)                        \
20                                                                                \
21 /* Wrapper, per element, with the consumption bool */                          \
22 struct __name##_bcq_wrap {                                                     \
23         __elem_t elem;                                                             \
24         bool rdy_for_cons;      /* elem is ready for consumption */                    \
25 };                                                                             \
26                                                                                \
27 /* The actual BC queue */                                                      \
28 struct __name##_bcq {                                                          \
29         struct bcq_header hdr;                                                     \
30         struct __name##_bcq_wrap wraps[__num_elems];                               \
31 };                                                                             
32                                                                                
33 #endif /* !ROS_INC_BCQ_STRUCT_H */