Commit 12ba4f85 authored by Damien George's avatar Damien George
Browse files

leon: Include datapool module in leon-for-tests component.

parent cf23c9e3
......@@ -50,6 +50,7 @@ SRC_C = \
$(LEON_COMMON)/modrtemsqueue.c \
$(LEON_COMMON)/modrtemstimer.c \
$(LEON_COMMON)/modmem.c \
$(LEON_COMMON)/moddatapool.c \
SRC_S = \
$(LEON_COMMON)/gchelper.s \
......
......@@ -23,12 +23,16 @@ rtems_task mp_manager_task(rtems_task_argument unused);
rtems_task mp_worker_task(rtems_task_argument unused);
#include <rtems/confdefs.h>
#include "leon-common/moddatapool.h"
#define MICROPY_RTEMS_TASK_ATTRIBUTES (RTEMS_APPLICATION_TASK | RTEMS_FLOATING_POINT)
#define MICROPY_RTEMS_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 3)
#define MICROPY_RTEMS_HEAP_SIZE (48 * 1024)
#define MICROPY_RTEMS_NUM_TASKS (10)
#define DATAPOOL_HEAP_SIZE (4 * 1024)
static uint8_t datapool_heap[DATAPOOL_HEAP_SIZE];
/******************************************************************************/
// RTEMS initialisation task
// this task runs at highest priority and is non-preemptive
......@@ -51,6 +55,9 @@ rtems_task Init(rtems_task_argument ignored) {
// initialise the timer subsystem
_Timer_Manager_initialization(2);
// bring up the datapool
datapool_init(datapool_heap, DATAPOOL_HEAP_SIZE);
// start the manager task to do the rest of the work
rtems_name task_name = rtems_build_name('M', 'P', 'M', 'A');
rtems_id task_id;
......
......@@ -76,10 +76,12 @@
extern const struct _mp_obj_module_t mp_module_time;
extern const struct _mp_obj_module_t mp_module_rtems;
extern const struct _mp_obj_module_t mp_module_mem;
extern const struct _mp_obj_module_t mp_module_datapool;
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&mp_module_time) }, \
{ MP_ROM_QSTR(MP_QSTR_rtems), MP_ROM_PTR(&mp_module_rtems) }, \
{ MP_ROM_QSTR(MP_QSTR_mem), MP_ROM_PTR(&mp_module_mem) }, \
{ MP_ROM_QSTR(MP_QSTR_datapool), MP_ROM_PTR(&mp_module_datapool) }, \
// definitions specific to SPARC
#define MP_ENDIANNESS_BIG (1)
......@@ -130,6 +132,10 @@ typedef long mp_off_t;
#define MP_STATE_MEM(x) (MP_STATE_PTR->mem.x)
#define MP_STATE_PORT MP_STATE_VM
// Root pointers
#define MICROPY_PORT_ROOT_POINTERS \
mp_map_t datapool_index; \
// Hook for the VM
#define MICROPY_VM_HOOK_COUNT (1)
#define MICROPY_VM_HOOK_INIT uint vm_hook_count = MICROPY_VM_HOOK_COUNT;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment