SMP - Cpu local variables
- most global variables carry information which is specific to the local CPU and each CPU must have its own copy - cpu local variable must be declared in cpulocal.h between DECLARE_CPULOCAL_START and DECLARE_CPULOCAL_END markers using DECLARE_CPULOCAL macro - to access the cpu local data the provided macros must be used get_cpu_var(cpu, name) get_cpu_var_ptr(cpu, name) get_cpulocal_var(name) get_cpulocal_var_ptr(name) - using this macros makes future changes in the implementation possible - switching to ELF will make the declaration of cpu local data much simpler, e.g. CPULOCAL int blah; anywhere in the kernel source code
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
#define KERNEL_H
|
||||
|
||||
/* APIC is turned on by default */
|
||||
#ifndef CONFIG_APIC
|
||||
#define CONFIG_APIC
|
||||
#endif
|
||||
/* boot verbose */
|
||||
#define CONFIG_BOOT_VERBOSE
|
||||
/*
|
||||
@@ -52,6 +54,7 @@
|
||||
#include "profile.h" /* system profiling */
|
||||
#include "perf.h" /* performance-related definitions */
|
||||
#include "debug.h" /* debugging, MUST be last kernel header */
|
||||
#include "cpulocals.h"
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user