]> Zhao Yanbai Git Server - minix.git/commit
SMP - Cpu local variables
authorTomas Hruby <tom@minix3.org>
Wed, 15 Sep 2010 14:09:46 +0000 (14:09 +0000)
committerTomas Hruby <tom@minix3.org>
Wed, 15 Sep 2010 14:09:46 +0000 (14:09 +0000)
commit13a0d5fa5e95db451f990c057bf28fe130e93874
tree68631b83ca506e6184435efd68a2ca589cf160ab
parent2a2a19e542c7e1968e69939c7a413fd27cd344b7
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
17 files changed:
include/arch/i386/archtypes.h
kernel/Makefile
kernel/arch/i386/arch_do_vmctl.c
kernel/arch/i386/arch_system.c
kernel/arch/i386/exception.c
kernel/arch/i386/include/arch_proto.h
kernel/arch/i386/klib.S
kernel/arch/i386/memory.c
kernel/clock.c
kernel/cpulocals.c [new file with mode: 0644]
kernel/cpulocals.h [new file with mode: 0644]
kernel/glo.h
kernel/kernel.h
kernel/main.c
kernel/proc.c
kernel/profile.c
kernel/system/do_update.c