[platform][armemu] add support for a fake armemu cpu
For the moment fix it as a armv7-a cpu with no mmu and no thumb.
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#define CACHE_LINE 32
|
||||
#elif ARM_CPU_ARM1136
|
||||
#define CACHE_LINE 32
|
||||
#elif ARM_CPU_ARMEMU
|
||||
#define CACHE_LINE 32
|
||||
#elif ARM_CPU_CORTEX_A7
|
||||
#define CACHE_LINE 64 /* XXX L1 icache is 32 bytes */
|
||||
#elif ARM_CPU_CORTEX_A8
|
||||
|
||||
@@ -151,6 +151,16 @@ GLOBAL_DEFINES += \
|
||||
ARM_CPU_ARM1136=1
|
||||
HANDLED_CORE := true
|
||||
endif
|
||||
ifeq ($(ARM_CPU),armemu)
|
||||
# flavor of emulated cpu by the armemu project
|
||||
GLOBAL_DEFINES += \
|
||||
ARM_WITH_CP15=1 \
|
||||
ARM_ISA_ARMv7=1 \
|
||||
ARM_ISA_ARMv7A=1 \
|
||||
ARM_WITH_CACHE=1
|
||||
HANDLED_CORE := true
|
||||
ENABLE_THUMB := false # armemu doesn't currently support thumb properly
|
||||
endif
|
||||
|
||||
ifneq ($(HANDLED_CORE),true)
|
||||
$(error $(LOCAL_DIR)/rules.mk doesnt have logic for arm core $(ARM_CPU))
|
||||
|
||||
@@ -90,5 +90,8 @@ endif
|
||||
ifeq ($(ARM_CPU),arm1176jzf-s)
|
||||
ARCH_arm_COMPILEFLAGS += -mcpu=$(ARM_CPU)
|
||||
endif
|
||||
ifeq ($(ARM_CPU),armemu)
|
||||
ARCH_arm_COMPILEFLAGS += -march=armv7-a
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -52,12 +52,8 @@ status_t mask_interrupt(unsigned int vector)
|
||||
|
||||
// dprintf("%s: vector %d\n", __PRETTY_FUNCTION__, vector);
|
||||
|
||||
enter_critical_section();
|
||||
|
||||
*REG32(PIC_MASK_LATCH) = 1 << vector;
|
||||
|
||||
exit_critical_section();
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -68,12 +64,8 @@ status_t unmask_interrupt(unsigned int vector)
|
||||
|
||||
// dprintf("%s: vector %d\n", __PRETTY_FUNCTION__, vector);
|
||||
|
||||
enter_critical_section();
|
||||
|
||||
*REG32(PIC_UNMASK_LATCH) = 1 << vector;
|
||||
|
||||
exit_critical_section();
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -113,11 +105,7 @@ void register_int_handler(unsigned int vector, int_handler handler, void *arg)
|
||||
if (vector >= PIC_MAX_INT)
|
||||
panic("register_int_handler: vector out of range %d\n", vector);
|
||||
|
||||
enter_critical_section();
|
||||
|
||||
int_handler_table[vector].handler = handler;
|
||||
int_handler_table[vector].arg = arg;
|
||||
|
||||
exit_critical_section();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,10 @@ LOCAL_DIR := $(GET_LOCAL_DIR)
|
||||
MODULE := $(LOCAL_DIR)
|
||||
|
||||
ARCH := arm
|
||||
ARM_CPU := arm1136j-s
|
||||
ARM_CPU := armemu
|
||||
CPU := generic
|
||||
|
||||
# emulater doesn't support thumb properly
|
||||
ENABLE_THUMB := false
|
||||
WITH_KERNEL_VM := 0
|
||||
|
||||
GLOBAL_INCLUDES += \
|
||||
$(LOCAL_DIR)/include
|
||||
|
||||
@@ -33,8 +33,6 @@ static platform_timer_callback t_callback;
|
||||
|
||||
status_t platform_set_periodic_timer(platform_timer_callback callback, void *arg, lk_time_t interval)
|
||||
{
|
||||
enter_critical_section();
|
||||
|
||||
t_callback = callback;
|
||||
|
||||
*REG(PIT_CLEAR) = 1;
|
||||
@@ -43,8 +41,6 @@ status_t platform_set_periodic_timer(platform_timer_callback callback, void *arg
|
||||
|
||||
unmask_interrupt(INT_PIT);
|
||||
|
||||
exit_critical_section();
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@ MODULES += \
|
||||
lib/gfxconsole \
|
||||
lib/text \
|
||||
lib/tga \
|
||||
lib/evlog \
|
||||
lib/debugcommands \
|
||||
app/tests \
|
||||
app/shell
|
||||
lib/evlog
|
||||
|
||||
GLOBAL_DEFINES += \
|
||||
WITH_KERNEL_EVLOG=1
|
||||
@@ -28,3 +25,5 @@ GLOBAL_DEFINES += \
|
||||
|
||||
#EXTRA_BUILDDEPS += $(BUILDDIR)/armemu.conf
|
||||
#GENERATED += $(BUILDDIR)/armemu.conf
|
||||
|
||||
include project/virtual/test.mk
|
||||
|
||||
Reference in New Issue
Block a user