zephyr/arch/x86/core/Makefile

30 lines
902 B
Makefile
Raw Normal View History

ccflags-y += -I$(srctree)/kernel/include
asflags-y += -I$(srctree)/kernel/include
ifeq ($(COMPILER)$(CONFIG_X86_IAMCU),clang)
# We rely on GAS for assembling, so don't use the integrated assembler
KBUILD_AFLAGS += -no-integrated-as
endif
x86: remove dynamically generated IRQ and exception code We are interested in supporting some XIP x86 platforms which are unable to fetch CPU instructions from system RAM. This requires refactoring our dynamic IRQ/exc code which currently synthesizes assembly language instructions to create IRQ stubs on-the-fly. Instead, a new approach is taken. Given that the configuration at build time specifies the number of required stubs, use this to generate a build time a set of tiny stub functions which simply push a 'stub id' and then call common dynamic interrupt code. The handler function and handler argument is saved in a table keyed by this stub id. CONFIG_EOI_HANDLER_SUPPORTED removed, the code hasn't been conditionally compiled for some time and in all cases we call _loapic_eoi() when finished with an interrupt. Some other out-of-date verbiage in comments related to supporting non-APIC removed. Previously, when dynamic exceptions were created a pointer would be passed in by the caller reserving ram for the stub code. Since this is no longer feasible, two new Kconfig options have been added. CONFIG_NUM_DYNAMIC_EXC_STUBS and CONFIG_NUM_DYNAMIC_EXC_NO_ERR_STUBS control how many stubs are created for exceptions that push an error code, and no error code, respectively. SW Interrupts are no longer triggered by "int <vector>" hard-coded assembly instructions. Instead this is done by sending a self-directed inter-processor interrupt from the LOAPIC, using a new API loapic_int_vect_trigger(). In this way we get rid of dynamically generated code in irq_test_common.h. All interrupts call _loapic_eoi() when finished, since this is now the right thing to do for all IRQs, including SW interrupts. _irq_handler_set() for x86 no longer requires the old function pointer to be supplied. Change-Id: I78993d3d00dd153c9051c518b417cce8d3acee9e Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2015-10-20 05:10:53 +08:00
# To create dynamic stubs we need to do a .rept on the total number of
# stubs divided by a constant, this prevents GAS from thinking the '/'
# character starts a comment
KBUILD_AFLAGS += -Wa,--divide
obj-y += cpuhalt.o \
msr.o irq_manage.o \
sys_fatal_error_handler.o \
crt0.o cache_s.o cache.o excstub.o \
intstub.o swap.o thread.o
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
obj-$(CONFIG_FP_SHARING) += float.o
obj-$(CONFIG_GDT_DYNAMIC) += gdt.o
obj-$(CONFIG_REBOOT_RST_CNT) += reboot_rst_cnt.o
obj-$(CONFIG_DEBUG_INFO) += debug/
obj-$(CONFIG_REBOOT_RST_CNT) += reboot_rst_cnt.o
# Last since we declare default exception handlers here
obj-y += fatal.o