#define IRQ8_VECTOR 0x70 /* no need to move IRQ8-15 */
/* Hardware interrupt numbers. */
-#ifndef CONFIG_APIC
+#ifndef USE_APIC
#define NR_IRQ_VECTORS 16
#else
#define NR_IRQ_VECTORS 64
PROGRAMS+= ahci ext2
.endif
-# acpi is not compiled with ack or if MKEMBED
-.if ${COMPILER_TYPE} == "gnu" && ${MKEMBED} != "yes"
+# acpi is not compiled with ack
+.if ${COMPILER_TYPE} == "gnu" && ${MKACPI} != "no"
PROGRAMS+= acpi
.endif
CPPFLAGS+= -DUSE_WATCHDOG
.endif
+.if ${USE_ACPI} != "no"
+SRCS+= acpi.c
+CPPFLAGS+= -DUSE_ACPI
+.endif
+
+.if ${USE_APIC} != "no"
+SRCS+= apic.c apic_asm.S
+CPPFLAGS+= -DUSE_APIC
+.endif
+
# These come last, so the profiling buffer is at the end of the data segment
SRCS+= profile.c do_sprofile.c
oxpcie.c \
protect.c \
arch_system.c \
- apic.c \
- apic_asm.S \
- pre_init.c \
- acpi.c
+ pre_init.c
.ifdef CONFIG_SMP
SRCS += arch_smp.c trampoline.S
};
#endif
-#ifdef CONFIG_APIC_DEBUG
+#ifdef APIC_DEBUG
PRIVATE void lapic_set_dummy_handlers(void)
{
char * handler;
return;
}
-#ifdef CONFIG_APIC_DEBUG
+#ifdef APIC_DEBUG
if (is_bsp)
printf("APIC debugging is enabled\n");
lapic_set_dummy_handlers();
#endif /* CONFIG_SMP */
-#ifdef CONFIG_APIC_DEBUG
+#ifdef APIC_DEBUG
.data
lapic_intr_dummy_handler_msg:
LABEL(lapic_intr_dummy_handles_end)
-#endif /* CONFIG_APIC_DEBUG */
+#endif /* APIC_DEBUG */
#endif
-#define CONFIG_APIC_DEBUG
+#define APIC_DEBUG
-#ifdef CONFIG_APIC_DEBUG
+#ifdef APIC_DEBUG
#define LAPIC_INTR_DUMMY_HANDLER_SIZE 32
EXTERN char lapic_intr_dummy_handles_end;
#endif
-#endif /* CONFIG_APIC_DEBUG */
+#endif /* APIC_DEBUG */
#endif /* __APIC_ASM_H__ */
#include "profile.h"
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
#include "apic.h"
#endif
#include "spinlock.h"
PUBLIC int init_local_timer(unsigned freq)
{
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
/* if we know the address, lapic is enabled and we should use it */
if (lapic_addr) {
unsigned cpu = cpuid;
PUBLIC void stop_local_timer(void)
{
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
if (lapic_addr) {
lapic_stop_timer();
apic_eoi();
PUBLIC void restart_local_timer(void)
{
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
if (lapic_addr) {
lapic_restart_timer();
}
PUBLIC int register_local_timer_handler(const irq_handler_t handler)
{
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
if (lapic_addr) {
/* Using APIC, it is configured in apic_idt_init() */
BOOT_VERBOSE(printf("Using LAPIC timer as tick source\n"));
#include "glo.h"
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
#include "apic.h"
#endif
+#ifdef USE_ACPI
#include "acpi.h"
+#endif
PRIVATE int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */
PUBLIC void arch_init(void)
{
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
/*
* this is setting kernel segments to cover most of the phys memory. The
* value is high enough to reach local APIC nad IOAPICs before paging is
ser_init();
#endif
+#ifdef USE_ACPI
acpi_init();
+#endif
-#if defined(CONFIG_APIC) && !defined(CONFIG_SMP)
+#if defined(USE_APIC) && !defined(CONFIG_SMP)
if (config_no_apic) {
BOOT_VERBOSE(printf("APIC disabled, using legacy PIC\n"));
}
TOGGLECASE('8', VF_SCHEDULING)
TOGGLECASE('9', VF_PICKPROC)
#endif
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
case 'I':
dump_apic_irq_state();
break;
* configurations. ACPI would be another option, however we don't support it
* either
*/
-#if defined(CONFIG_APIC)
+#if defined(USE_APIC)
#include "arch/i386/apic.h"
#define hw_intr_mask(irq) ioapic_mask_irq(irq)
#include "kernel/proto.h"
#include "kernel/debug.h"
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
#include "apic.h"
#ifdef USE_WATCHDOG
#include "kernel/watchdog.h"
static char *ser_var = NULL;
if(first) {
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
if(lapic_addr)
freeidx++;
if (ioapic_enabled)
first = 0;
}
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
/* map the local APIC if enabled */
if (index == 0) {
if (!lapic_addr)
PUBLIC int arch_phys_map_reply(const int index, const vir_bytes addr)
{
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
/* if local APIC is enabled */
if (index == 0 && lapic_addr) {
lapic_addr_vaddr = addr;
if (newmap(caller, caller, ep_data.mem_map) != OK)
panic("arch_enable_paging: newmap failed");
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
/* start using the virtual addresses */
/* if local APIC is enabled */
* the maximum needed by any given driver. The number of interrupt hooks may
* be incremented on systems with many device drivers.
*/
-#ifndef CONFIG_APIC
+#ifndef USE_APIC
#define NR_IRQ_HOOKS 16 /* number of interrupt hooks */
#else
#define NR_IRQ_HOOKS 64 /* number of interrupt hooks */
EXTERN int verboseflags;
#endif
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
EXTERN int config_no_apic; /* optionaly turn off apic */
EXTERN int config_apic_timer_x; /* apic timer slowdown factor */
#endif
#ifndef KERNEL_H
#define KERNEL_H
-/* APIC is turned on by default */
-#ifndef CONFIG_APIC
-#define CONFIG_APIC
-#endif
/* boot verbose */
#define CONFIG_BOOT_VERBOSE
if (value) serial_debug_baud = atoi(value);
}
-#ifdef CONFIG_APIC
+#ifdef USE_APIC
value = env_get("no_apic");
if(value)
config_no_apic = atoi(value);
MKYP
#MINIX-specific vars
_MKVARS.yes+= \
- MKWATCHDOG
+ MKWATCHDOG MKACPI MKAPIC
.for var in ${_MKVARS.yes}
${var}?= yes
.endfor
# MINIX
.if ${MKEMBED} == "yes"
MKWATCHDOG:= no
+MKACPI:= no
+MKAPIC:= no
.endif
#
# variable is set to "no".
#
.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP \
-USE_WATCHDOG
+USE_WATCHDOG USE_ACPI USE_APIC
.if (${${var:S/USE_/MK/}} == "no")
${var}:= no
.else