Commit 8cc99271 authored by Carolina Pinto dos Santos Serra's avatar Carolina Pinto dos Santos Serra

Merge branch '62-rtems_interrupt_catch-doesn-t-exist-in-arm' into 'dev'

Resolve "rtems_interrupt_catch doesn't exist in ARM"

Closes #62

See merge request AIR/air-dev!26
parents f4bb4617 9ce54822
......@@ -153,6 +153,7 @@ void core_context_setup_partition(core_context_t *context, pmk_partition_t *part
if ((partition->permissions & AIR_PERMISSION_FPU_CONTROL) != 0) {
context->vfp_context->fpexc = (ARM_VFP_FPEXC_ENABLE);
arm_enable_fpu();
//context->vfp_context->fpscr &=0xFFF8FFFF;
} else {
context->vfp_context->fpexc = 0;
......
......@@ -339,6 +339,8 @@ __FORCE_INLINE static void arm_disable_fpu(void) {
__FORCE_INLINE static void arm_enable_fpu(void) {
air_u32_t reg = 0;
__asm__ volatile (
"ldr %0, =(0xF <<20)\n"
"mcr p15, 0, %0, c1, c0, 2\n"
"vmrs %0, FPEXC\n"
"orr %0, #(1 << 30U)\n"
"vmsr FPEXC, %0\n"
......
......@@ -86,7 +86,7 @@ air_uptr_t * arm_isr_handler(arm_interrupt_stack_frame_t *frame, pmk_core_ctrl_t
#ifdef PMK_DEBUG_ISR
if (core->partition != NULL) {
printk(" ISR :: Switching to Partition %d\n\n", core->partition->id);
printk(" ISR :: Switching to Partition %d \n\n", core->partition->id);
} else {
printk(" ISR :: Switching to Partition IDLE\n\n");
}
......
......@@ -6,16 +6,42 @@ ${makoutils.cfileHeader("init.c", "Partition Initialization")}
#include <air.h>
#include <rtems.h>
#include <rtems/irq-extension.h>
%if 'imaspex' in partition.libraries:
#include <imaspex.h>
%endif
%if os_configuration.arch == "arm":
#include <rtems/score/armv4.h>
#include <libcpu/arm-cp15.h>
%endif
/**
* @brief Partition entry point
*/
extern int ${partition.entry_point}() __attribute__ ((weak));
/**
* @brief Install the HM handler
*/
%if os_configuration.arch == "arm":
void hm_handler_install(void *handler){
arm_cp15_set_exception_handler(ARM_EXCEPTION_DATA_ABORT, &_ARMV4_Exception_data_abort);
_ARMV4_Exception_data_abort_set_handler(handler);
arm_cp15_set_exception_handler(ARM_EXCEPTION_PREF_ABORT, &_ARMV4_Exception_prefetch_abort);
_ARMV4_Exception_prefetch_abort_set_handler(handler);
arm_cp15_set_exception_handler(ARM_EXCEPTION_UNDEF, &_ARMV4_Exception_prefetch_abort);
_ARMV4_Exception_prefetch_abort_set_handler(handler);
}
%else:
void hm_handler_install(void *handler){
rtems_isr_entry isr_ignored;
rtems_interrupt_catch(
(rtems_isr_entry)handler,
AIR_IRQ_HM_EVENT,
&isr_ignored);
}
%endif
%if partition.iop is not None:
/**
* @brief IOP initialization
......@@ -54,11 +80,7 @@ static void hm_isr_handler(void) {
rtems_task Init(rtems_task_argument ignored) {
/* register HM ISR handler */
rtems_isr_entry isr_ignored;
rtems_interrupt_catch(
(rtems_isr_entry)hm_isr_handler,
AIR_IRQ_HM_EVENT,
&isr_ignored);
hm_handler_install(hm_isr_handler);
%if 'imaspex' in partition.libraries:
/* initialize IMASPEX */
......
......@@ -76,8 +76,10 @@ CPPFLAGS+=${'\\'}
-I../common/${'\\'}
-B../common/${'\\'}
-DRTEMS5${'\\'}
-B$(AIR_POS)/rtems5/rtems5/cpukit/score/cpu/arm/include/${'\\'}
${template.LibraryIncludes(partition.libraries)}\
# build LD falgs
LDFLAGS += -Wl,--gc-sections -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar
......
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