diff --git a/os/common/ports/SIMIA32/chcore.h b/os/common/ports/SIMIA32/chcore.h index e80419332..14591681a 100644 --- a/os/common/ports/SIMIA32/chcore.h +++ b/os/common/ports/SIMIA32/chcore.h @@ -243,6 +243,16 @@ struct port_context { #define PORT_WORKING_AREA(s, n) \ stkalign_t s[THD_WORKING_AREA_SIZE(n) / sizeof (stkalign_t)] +/** + * @brief Priority level verification macro. + */ +#define PORT_IRQ_IS_VALID_PRIORITY(n) false + +/** + * @brief Priority level verification macro. + */ +#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) false + /** * @brief IRQ prologue code. * @details This macro must be inserted at the start of all IRQ handlers @@ -321,7 +331,9 @@ extern "C" { /** * @brief Port-related initialization code. */ -static inline void port_init(void) { +static inline void port_init(os_instance_t *oip) { + + (void)oip; port_irq_sts = (syssts_t)0; port_isr_context_flag = false; diff --git a/os/hal/ports/simulator/posix/hal_lld.c b/os/hal/ports/simulator/posix/hal_lld.c index 0015f5b24..cf3423484 100755 --- a/os/hal/ports/simulator/posix/hal_lld.c +++ b/os/hal/ports/simulator/posix/hal_lld.c @@ -93,10 +93,10 @@ void _sim_check_for_interrupts(void) { } if (int_occurred) { - _dbg_check_lock(); + __dbg_check_lock(); if (chSchIsPreemptionRequired()) - chSchDoReschedule(); - _dbg_check_unlock(); + chSchDoPreemption(); + __dbg_check_unlock(); } } diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c index 5c35a4e84..e58d1fdf8 100644 --- a/os/rt/src/chsys.c +++ b/os/rt/src/chsys.c @@ -86,16 +86,19 @@ void chSysInit(void) { /* Initializing default OS instance.*/ { -#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE) +#if CH_DBG_ENABLE_STACK_CHECK == TRUE extern stkalign_t __main_thread_stack_base__, __main_thread_stack_end__; #endif static const os_instance_config_t default_cfg = { .name = "c0", -#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || (CH_CFG_USE_DYNAMIC == TRUE) +#if CH_DBG_ENABLE_STACK_CHECK == TRUE .mainthread_base = &__main_thread_stack_base__, .mainthread_end = &__main_thread_stack_end__, +#elif CH_CFG_USE_DYNAMIC == TRUE + .mainthread_base = NULL, + .mainthread_end = NULL, #endif #if CH_CFG_NO_IDLE_THREAD == FALSE .idlethread_base = THD_WORKING_AREA_BASE(ch_idle_thread_wa),