4040#define NUM_CPU 4
4141
4242#define CDCACM_BUFFER_SIZE 256
43+ #define SHARED_BUFFER_SIZE 64
4344
4445struct cdc_ring_buffer
4546{
@@ -62,6 +63,30 @@ struct cdc_acm_shared_data {
6263 int device_open ;
6364};
6465
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+
6590/**
6691 * LMT / ARC global shared structure. This structure lies in the beginning of
6792 * the RAM.
@@ -109,6 +134,18 @@ struct platform_shared_block_ {
109134 * The ARC core counts on QRK to find valid pointers in place.
110135 */
111136 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 ;
112149};
113150
114151#define RAM_START 0xA8000000
0 commit comments