diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-19 08:48:38 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-27 11:12:52 -0400 |
commit | 57844a8f8e29802f37ad9a0f94eb11d6ae358603 (patch) | |
tree | 2d5214218e0436ef0f6fc23818871a8689c2f514 /arch/x86/kernel/x86_init.c | |
parent | 4152f93508b184a85a975810b2cc3dc5c597cf57 (diff) |
x86: Add x86_init infrastructure
The upcoming Moorestown support brings the embedded world to x86. The
setup code of x86 has already a couple of hooks which are either
x86_quirks or paravirt ops. Some of those setup hooks are pretty
convoluted like the timer setup and the tsc calibration code. But
there are other places which could do with a cleanup.
Instead of having inline functions/macros which are modified at
compile time I decided to introduce x86_init ops which are
unconditional in the code and make it clear that they can be changed
either during compile time or in the early boot process. The function
pointers are initialized by default functions which can be noops so
that the pointer can be called unconditionally in the most cases. This
also allows us to remove 32bit/64bit, paravirt and other #ifdeffery.
paravirt guests are just a hardware platform in the setup code, so we
should treat them as such and not hide all behind multiple layers of
indirection and compile time dependencies.
It's more obvious that x86_init.timers.timer_init() is a function
pointer than the late_time_init = choose_time_init() obscurity. It's
also way simpler to grep for x86_init.timers.timer_init and find all
the places which modify that function pointer instead of analyzing
weak functions, macros and paravirt indirections.
Note. This is not a general paravirt_ops replacement. It just will
move setup related hooks which are potentially useful for other
platform setup purposes as well out of the paravirt domain.
Add the base infrastructure without any functionality.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/x86_init.c')
-rw-r--r-- | arch/x86/kernel/x86_init.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c new file mode 100644 index 000000000000..82d510c9c996 --- /dev/null +++ b/arch/x86/kernel/x86_init.c | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Thomas Gleixner <tglx@linutronix.de> | ||
3 | * | ||
4 | * For licencing details see kernel-base/COPYING | ||
5 | */ | ||
6 | #include <linux/init.h> | ||
7 | |||
8 | #include <asm/x86_init.h> | ||
9 | |||
10 | void __cpuinit x86_init_noop(void) { } | ||
11 | |||
12 | /* | ||
13 | * The platform setup functions are preset with the default functions | ||
14 | * for standard PC hardware. | ||
15 | */ | ||
16 | struct __initdata x86_init_ops x86_init = { | ||
17 | }; | ||