ia64/linux-2.6.18-xen.hg

view arch/mips/kernel/irq-rm9000.c @ 452:c7ed6fe5dca0

kexec: dont initialise regions in reserve_memory()

There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 28 10:55:18 2008 +0000 (2008-02-28)
parents 831230e53067
children
line source
1 /*
2 * Copyright (C) 2003 Ralf Baechle
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * Handler for RM9000 extended interrupts. These are a non-standard
10 * feature so we handle them separately from standard interrupts.
11 */
12 #include <linux/init.h>
13 #include <linux/interrupt.h>
14 #include <linux/kernel.h>
15 #include <linux/module.h>
17 #include <asm/irq_cpu.h>
18 #include <asm/mipsregs.h>
19 #include <asm/system.h>
21 static int irq_base;
23 static inline void unmask_rm9k_irq(unsigned int irq)
24 {
25 set_c0_intcontrol(0x1000 << (irq - irq_base));
26 }
28 static inline void mask_rm9k_irq(unsigned int irq)
29 {
30 clear_c0_intcontrol(0x1000 << (irq - irq_base));
31 }
33 static inline void rm9k_cpu_irq_enable(unsigned int irq)
34 {
35 unsigned long flags;
37 local_irq_save(flags);
38 unmask_rm9k_irq(irq);
39 local_irq_restore(flags);
40 }
42 static void rm9k_cpu_irq_disable(unsigned int irq)
43 {
44 unsigned long flags;
46 local_irq_save(flags);
47 mask_rm9k_irq(irq);
48 local_irq_restore(flags);
49 }
51 static unsigned int rm9k_cpu_irq_startup(unsigned int irq)
52 {
53 rm9k_cpu_irq_enable(irq);
55 return 0;
56 }
58 #define rm9k_cpu_irq_shutdown rm9k_cpu_irq_disable
60 /*
61 * Performance counter interrupts are global on all processors.
62 */
63 static void local_rm9k_perfcounter_irq_startup(void *args)
64 {
65 unsigned int irq = (unsigned int) args;
67 rm9k_cpu_irq_enable(irq);
68 }
70 static unsigned int rm9k_perfcounter_irq_startup(unsigned int irq)
71 {
72 on_each_cpu(local_rm9k_perfcounter_irq_startup, (void *) irq, 0, 1);
74 return 0;
75 }
77 static void local_rm9k_perfcounter_irq_shutdown(void *args)
78 {
79 unsigned int irq = (unsigned int) args;
80 unsigned long flags;
82 local_irq_save(flags);
83 mask_rm9k_irq(irq);
84 local_irq_restore(flags);
85 }
87 static void rm9k_perfcounter_irq_shutdown(unsigned int irq)
88 {
89 on_each_cpu(local_rm9k_perfcounter_irq_shutdown, (void *) irq, 0, 1);
90 }
93 /*
94 * While we ack the interrupt interrupts are disabled and thus we don't need
95 * to deal with concurrency issues. Same for rm9k_cpu_irq_end.
96 */
97 static void rm9k_cpu_irq_ack(unsigned int irq)
98 {
99 mask_rm9k_irq(irq);
100 }
102 static void rm9k_cpu_irq_end(unsigned int irq)
103 {
104 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
105 unmask_rm9k_irq(irq);
106 }
108 static struct irq_chip rm9k_irq_controller = {
109 .typename = "RM9000",
110 .startup = rm9k_cpu_irq_startup,
111 .shutdown = rm9k_cpu_irq_shutdown,
112 .enable = rm9k_cpu_irq_enable,
113 .disable = rm9k_cpu_irq_disable,
114 .ack = rm9k_cpu_irq_ack,
115 .end = rm9k_cpu_irq_end,
116 };
118 static struct irq_chip rm9k_perfcounter_irq = {
119 .typename = "RM9000",
120 .startup = rm9k_perfcounter_irq_startup,
121 .shutdown = rm9k_perfcounter_irq_shutdown,
122 .enable = rm9k_cpu_irq_enable,
123 .disable = rm9k_cpu_irq_disable,
124 .ack = rm9k_cpu_irq_ack,
125 .end = rm9k_cpu_irq_end,
126 };
128 unsigned int rm9000_perfcount_irq;
130 EXPORT_SYMBOL(rm9000_perfcount_irq);
132 void __init rm9k_cpu_irq_init(int base)
133 {
134 int i;
136 clear_c0_intcontrol(0x0000f000); /* Mask all */
138 for (i = base; i < base + 4; i++) {
139 irq_desc[i].status = IRQ_DISABLED;
140 irq_desc[i].action = NULL;
141 irq_desc[i].depth = 1;
142 irq_desc[i].chip = &rm9k_irq_controller;
143 }
145 rm9000_perfcount_irq = base + 1;
146 irq_desc[rm9000_perfcount_irq].chip = &rm9k_perfcounter_irq;
148 irq_base = base;
149 }