pru: Perform message encoding on pru0 to free space on pru1

Copy the parameters of calls to console_sendf() on pru1 to pru0 and
then call that function on pru0.  Although copying the parameters is a
"hack", the code size reduction is notable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2021-05-03 00:15:49 -04:00
parent 5c10001bc5
commit 92e1481a52
3 changed files with 66 additions and 37 deletions

View File

@@ -23,16 +23,12 @@
#define ALT_PRU_PTR(ptr) ((typeof(ptr))((uint32_t)(ptr) ^ 0x2000))
// Layout of shared memory
struct shared_response_buffer {
uint32_t count;
uint8_t data[MESSAGE_MAX];
};
struct shared_mem {
uint32_t signal;
void *next_encoder_args;
uint32_t next_encoder;
const struct command_parser *next_command;
uint32_t next_command_args[16];
uint32_t send_push_pos, send_pop_pos;
struct shared_response_buffer send_data[4];
const struct command_parser *command_index;
uint32_t command_index_size;
const struct command_parser *shutdown_handler;