diff options
Diffstat (limited to 'src/occ_gpe1')
-rw-r--r-- | src/occ_gpe1/gpe1_main.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/occ_gpe1/gpe1_main.c b/src/occ_gpe1/gpe1_main.c index a7a3ff5..e35720d 100644 --- a/src/occ_gpe1/gpe1_main.c +++ b/src/occ_gpe1/gpe1_main.c @@ -31,25 +31,38 @@ #include "pk.h" #include "ipc_api.h" +#include "gpe_export.h" #define KERNEL_STACK_SIZE 256 uint8_t G_kernel_stack[KERNEL_STACK_SIZE]; +//Point to the GPE shared structure +#define GPE_SHARED_DATA_ADDR 0xFFFB3C00 +#define GPE_SHARED_DATA_SIZE 256 + +gpe_shared_data_t * G_gpe_shared_data = (gpe_shared_data_t*) GPE_SHARED_DATA_ADDR; // The main function is called by the boot code (after initializing some // registers) int main(int argc, char **argv) { int rc; + uint32_t l_timebase = G_gpe_shared_data->nest_freq_div; + + // Don't initialize with a 0 + if (!l_timebase) + { + l_timebase = PPE_TIMEBASE_HZ; + } // initializes kernel data (stack, threads, timebase, timers, etc.) pk_initialize((PkAddress)G_kernel_stack, KERNEL_STACK_SIZE, PK_TIMEBASE_CONTINUES, - PPE_TIMEBASE_HZ); + l_timebase); - PK_TRACE("Kernel init completed"); + PK_TRACE("Kernel init completed, timebase is %d Hz", l_timebase); // Disable IPC's and register the IPC interrupt handler rc = ipc_init(); |