Skip to contentSkip to conversation

x86: move interrupts[] to .rodata/.init.data

PATCH In review Jan Beulich 2 participants 2 messages Dec 13, 2007 – Dec 17, 2007 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: move interrupts[] to .rodata/.init.data

The array is never written, and on 64-bits it's not even being used past initial boot.

 arch/x86/kernel/entry_32.S  |    2 +-
 arch/x86/kernel/i8259_64.c  |    2 +-
 include/asm-x86/hw_irq_32.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/entry_32.S +1 -1
@@ -583,7 +583,7 @@ END(syscall_badsys)
  * Build the entry stubs and pointer table with
  * some assembler magic.
  */
-.data
+.section .rodata,"a"
 ENTRY(interrupt)
 .text
 
arch/x86/kernel/i8259_64.c +1 -1
@@ -76,7 +76,7 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BU
 	IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
 
 /* for the irq vectors */
-static void (*interrupt[NR_VECTORS - FIRST_EXTERNAL_VECTOR])(void) = {
+static void (*__initdata interrupt[NR_VECTORS - FIRST_EXTERNAL_VECTOR])(void) = {
 					  IRQLIST_16(0x2), IRQLIST_16(0x3),
 	IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
 	IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
include/asm-x86/hw_irq_32.h +1 -1
@@ -26,7 +26,7 @@
  * Interrupt entry/exit code at both C and assembly level
  */
 
-extern void (*interrupt[NR_IRQS])(void);
+extern void (*const interrupt[NR_IRQS])(void);
 
 #ifdef CONFIG_SMP
 fastcall void reschedule_interrupt(void);
#1 lore raw
Quoted 2 lines · Jan Beulich

The array is never written, and on 64-bits it's not even being used past initial boot.

thanks - applied your patch to x86.git, queued up for v2.6.25.

Ingo