Skip to content

shared memory structure changes for CODK-M #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions system/libarc32_arduino101/framework/include/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#define NUM_CPU 4

#define CDCACM_BUFFER_SIZE 256
#define SHARED_BUFFER_SIZE 64

struct cdc_ring_buffer
{
Expand All @@ -62,6 +63,30 @@ struct cdc_acm_shared_data {
int device_open;
};

struct shared_ring_buffer
{
/** Ring buffer data */
volatile uint8_t data[SHARED_BUFFER_SIZE];
/** Ring buffer head index, modified by producer */
volatile int head;
/** Ring buffer tail index, modified by consumer */
volatile int tail;

/** Buffer status
* 0 - locked by X86 core
* 1 - locked by arc core
* 2 - available to be taken by any core
**/
volatile int flag;
};

struct ipm_shared_data
{
struct shared_ring_buffer *quark_buffer;
struct shared_ring_buffer *arc_buffer;
};


/**
* LMT / ARC global shared structure. This structure lies in the beginning of
* the RAM.
Expand Down Expand Up @@ -109,6 +134,18 @@ struct platform_shared_block_ {
* The ARC core counts on QRK to find valid pointers in place.
*/
struct cdc_acm_shared_data * cdc_acm_buffers;

struct cdc_acm_shared_data cdc_acm_buffers_obj;

struct cdc_ring_buffer cdc_acm_shared_rx_buffer;
struct cdc_ring_buffer cdc_acm_shared_tx_buffer;

struct ipm_shared_data *ipm_shared_data_ptr;

struct ipm_shared_data ipm_shared_data_obj;

struct shared_ring_buffer quark_to_ARC;
struct shared_ring_buffer ARC_to_quark;
};

#define RAM_START 0xA8000000
Expand Down