40
40
#define NUM_CPU 4
41
41
42
42
#define CDCACM_BUFFER_SIZE 256
43
+ #define SHARED_BUFFER_SIZE 64
43
44
44
45
struct cdc_ring_buffer
45
46
{
@@ -62,6 +63,30 @@ struct cdc_acm_shared_data {
62
63
int device_open ;
63
64
};
64
65
66
+ struct shared_ring_buffer
67
+ {
68
+ /** Ring buffer data */
69
+ volatile uint8_t data [SHARED_BUFFER_SIZE ];
70
+ /** Ring buffer head index, modified by producer */
71
+ volatile int head ;
72
+ /** Ring buffer tail index, modified by consumer */
73
+ volatile int tail ;
74
+
75
+ /** Buffer status
76
+ * 0 - locked by X86 core
77
+ * 1 - locked by arc core
78
+ * 2 - available to be taken by any core
79
+ **/
80
+ volatile int flag ;
81
+ };
82
+
83
+ struct ipm_shared_data
84
+ {
85
+ struct shared_ring_buffer * quark_buffer ;
86
+ struct shared_ring_buffer * arc_buffer ;
87
+ };
88
+
89
+
65
90
/**
66
91
* LMT / ARC global shared structure. This structure lies in the beginning of
67
92
* the RAM.
@@ -109,6 +134,18 @@ struct platform_shared_block_ {
109
134
* The ARC core counts on QRK to find valid pointers in place.
110
135
*/
111
136
struct cdc_acm_shared_data * cdc_acm_buffers ;
137
+
138
+ struct cdc_acm_shared_data cdc_acm_buffers_obj ;
139
+
140
+ struct cdc_ring_buffer cdc_acm_shared_rx_buffer ;
141
+ struct cdc_ring_buffer cdc_acm_shared_tx_buffer ;
142
+
143
+ struct ipm_shared_data * ipm_shared_data_ptr ;
144
+
145
+ struct ipm_shared_data ipm_shared_data_obj ;
146
+
147
+ struct shared_ring_buffer quark_to_ARC ;
148
+ struct shared_ring_buffer ARC_to_quark ;
112
149
};
113
150
114
151
#define RAM_START 0xA8000000
0 commit comments