make vfs & filesystems use failable copying
[minix3.git] / kernel / arch / i386 / include / arch_smp.h
blob3a013a98297c8fa1f3c7f10d7af3104cedd70c3a
1 #ifndef __SMP_X86_H__
2 #define __SMP_X86_H__
4 #include "arch_proto.h" /* K_STACK_SIZE */
6 #define MAX_NR_INTERRUPT_ENTRIES 128
8 #ifndef __ASSEMBLY__
10 /* returns the current cpu id */
11 #define cpuid (((u32_t *)(((u32_t)get_stack_frame() + (K_STACK_SIZE - 1)) \
12 & ~(K_STACK_SIZE - 1)))[-1])
13 /*
14 * in case apic or smp is disabled in boot monitor, we need to finish single cpu
15 * boot using the legacy PIC
17 #define smp_single_cpu_fallback() do { \
18 tss_init(0, get_k_stack_top(0)); \
19 bsp_cpu_id = 0; \
20 ncpus = 1; \
21 bsp_finish_booting(); \
22 } while(0)
24 extern unsigned char cpuid2apicid[CONFIG_MAX_CPUS];
26 #define barrier() do { mfence(); } while(0)
28 #endif
30 #endif /* __SMP_X86_H__ */