dol: fix shm_t contain the shm-buffers
[jump.git] / minidol / shared.h
1 /* shared.h
2  * NOTE: shared between Host and Epiphany */
3 #ifndef _SHARED_H_
4 #define _SHARED_H_
5
6 #ifndef PACKED
7 #define PACKED __attribute__((packed))
8 #endif
9
10 #include <stdint.h>
11
12 #define NUM_CORES 16
13
14 typedef struct {
15         volatile uint32_t rp;
16         volatile uint32_t wp;
17         volatile uint32_t size;
18         char     buf[];
19 } PACKED hwbuf_t;
20
21 typedef struct {
22         uint32_t rp;
23         uint32_t wp;
24         uint32_t size;
25         char     buf[8];
26 } PACKED buf0_t;
27
28 typedef struct {
29         uint32_t rp;
30         uint32_t wp;
31         uint32_t size;
32         char     buf[32];
33 } PACKED buf1_t;
34
35 typedef struct {
36         uint32_t counters[2];
37 } PACKED coredata_t;
38
39 typedef struct {
40         int32_t    states[NUM_CORES];
41         coredata_t cores[NUM_CORES];
42         buf0_t     buf0;
43         buf1_t     buf1;
44 } PACKED shm_t;
45
46 #endif /* _SHARED_H_ */