Skip to contentSkip to conversation

linux/x86: put trap initialization code/data into cpuinit space

PATCH New Jan Beulich 1 participant 1 message Mar 13, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/x86: put trap initialization code/data into cpuinit space

As usual, written and tested on 2.6.25-rc5 and made apply to the 2.6.18 tree without further testing.

arch/i386/kernel/traps-xen.c +2 -2
Index: head-2008-03-06/arch/i386/kernel/traps-xen.c
===================================================================
@@ -1180,7 +1180,7 @@ asmlinkage void math_emulate(long arg)
  * NB. All these are "trap gates" (i.e. events_mask isn't set) except
  * for those that specify <dpl>|4 in the second field.
  */
-static trap_info_t trap_table[] = {
+static trap_info_t __cpuinitdata trap_table[] = {
 	{  0, 0, __KERNEL_CS, (unsigned long)divide_error		},
 	{  1, 0|4, __KERNEL_CS, (unsigned long)debug			},
 	{  3, 3|4, __KERNEL_CS, (unsigned long)int3			},
@@ -1236,7 +1236,7 @@ void __init trap_init(void)
 	cpu_init();
 }
 
-void smp_trap_init(trap_info_t *trap_ctxt)
+void __cpuinit smp_trap_init(trap_info_t *trap_ctxt)
 {
 	const trap_info_t *t = trap_table;
 
arch/x86_64/kernel/traps-xen.c +2 -2
Index: head-2008-03-06/arch/x86_64/kernel/traps-xen.c
===================================================================
@@ -1195,7 +1195,7 @@ EXPORT_SYMBOL_GPL(math_state_restore);
  * NB. All these are "interrupt gates" (i.e. events_mask is set) because we
  * specify <dpl>|4 in the second field.
  */
-static trap_info_t trap_table[] = {
+static trap_info_t __cpuinitdata trap_table[] = {
         {  0, 0|4, __KERNEL_CS, (unsigned long)divide_error               },
         {  1, 0|4, __KERNEL_CS, (unsigned long)debug                      },
         {  3, 3|4, __KERNEL_CS, (unsigned long)int3                       },
@@ -1236,7 +1236,7 @@ void __init trap_init(void)
 	cpu_init();
 }
 
-void smp_trap_init(trap_info_t *trap_ctxt)
+void __cpuinit smp_trap_init(trap_info_t *trap_ctxt)
 {
 	const trap_info_t *t = trap_table;