62c666566e
- kernel detects CPUs by searching ACPI tables for local apic nodes - each CPU has its own TSS that points to its own stack. All cpus boot on the same boot stack (in sequence) but switch to its private stack as soon as they can. - final booting code in main() placed in bsp_finish_booting() which is executed only after the BSP switches to its final stack - apic functions to send startup interrupts - assembler functions to handle CPU features not needed for single cpu mode like memory barries, HT detection etc. - new files kernel/smp.[ch], kernel/arch/i386/arch_smp.c and kernel/arch/i386/include/arch_smp.h - 16-bit trampoline code for the APs. It is executed by each AP after receiving startup IPIs it brings up the CPUs to 32bit mode and let them spin in an infinite loop so they don't do any damage. - implementation of kernel spinlock - CONFIG_SMP and CONFIG_MAX_CPUS set by the build system
73 lines
2.2 KiB
C
73 lines
2.2 KiB
C
#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
|
|
/*
|
|
* compile in the nmi watchdog by default. It is not enabled until watchdog=1
|
|
* (non-zero) is set in monitor
|
|
*/
|
|
#define CONFIG_WATCHDOG
|
|
|
|
#ifndef CONFIG_MAX_CPUS
|
|
#define CONFIG_MAX_CPUS 1
|
|
#endif
|
|
|
|
/* OXPCIe952 PCIe with 2 UARTs in-kernel support */
|
|
#define CONFIG_OXPCIE 0
|
|
|
|
/* This is the master header for the kernel. It includes some other files
|
|
* and defines the principal constants.
|
|
*/
|
|
#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */
|
|
#define _MINIX 1 /* tell headers to include MINIX stuff */
|
|
#define _SYSTEM 1 /* tell headers that this is the kernel */
|
|
|
|
/*
|
|
* we need the defines above in assembly files to configure the kernel
|
|
* correctly. However we don't need the rest
|
|
*/
|
|
#ifndef __ASSEMBLY__
|
|
|
|
/* The following are so basic, all the *.c files get them automatically. */
|
|
#include <minix/config.h> /* global configuration, MUST be first */
|
|
#include <ansi.h> /* C style: ANSI or K&R, MUST be second */
|
|
#include <sys/types.h> /* general system types */
|
|
#include <minix/const.h> /* MINIX specific constants */
|
|
#include <minix/type.h> /* MINIX specific types, e.g. message */
|
|
#include <minix/ipc.h> /* MINIX run-time system */
|
|
#include <minix/sysutil.h> /* MINIX utility library functions */
|
|
#include <timers.h> /* watchdog timer management */
|
|
#include <errno.h> /* return codes and error numbers */
|
|
#include <sys/param.h>
|
|
|
|
/* Important kernel header files. */
|
|
#include "config.h" /* configuration, MUST be first */
|
|
#include "const.h" /* constants, MUST be second */
|
|
#include "type.h" /* type definitions, MUST be third */
|
|
#include "proto.h" /* function prototypes */
|
|
#include "glo.h" /* global variables */
|
|
#include "ipc.h" /* IPC constants */
|
|
#include "profile.h" /* system profiling */
|
|
#include "perf.h" /* performance-related definitions */
|
|
#include "debug.h" /* debugging, MUST be last kernel header */
|
|
#include "cpulocals.h"
|
|
|
|
#ifndef CONFIG_SMP
|
|
/* We only support 1 cpu now */
|
|
#define CONFIG_MAX_CPUS 1
|
|
#define cpuid 0
|
|
|
|
#else
|
|
|
|
#include "smp.h"
|
|
|
|
#endif
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* KERNEL_H */
|