diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-05-19 09:13:40 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-05-27 18:09:30 -0400 |
commit | 213060a4d6991a95d0b9344406d195be3464accf (patch) | |
tree | b74ead50ae0ae8ca2cfc20df5ad2e5d04a90432d /arch/ia64 | |
parent | 4df8d22bbbb16ccfa4e10cc068135183c9e5e006 (diff) |
[IA64] pvops: paravirtualize NR_IRQS
Make NR_IRQ overridable by each pv instances.
Pv instance may need each own number of irqs so that
NR_IRQS should be the maximum number of nr_irqs each
pv instances need.
Cc: Jes Sorensen <jes@sgi.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/Makefile | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/Makefile | 33 | ||||
-rw-r--r-- | arch/ia64/kernel/nr-irqs.c | 24 |
3 files changed, 63 insertions, 0 deletions
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 88f1a55c6c94..3b9c8cadfd34 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -99,3 +99,9 @@ define archhelp | |||
99 | echo ' boot - Build vmlinux and bootloader for Ski simulator' | 99 | echo ' boot - Build vmlinux and bootloader for Ski simulator' |
100 | echo '* unwcheck - Check vmlinux for invalid unwind info' | 100 | echo '* unwcheck - Check vmlinux for invalid unwind info' |
101 | endef | 101 | endef |
102 | |||
103 | archprepare: make_nr_irqs_h FORCE | ||
104 | PHONY += make_nr_irqs_h FORCE | ||
105 | |||
106 | make_nr_irqs_h: FORCE | ||
107 | $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h | ||
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index cea91f17d44b..87fea11aecb7 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile | |||
@@ -73,6 +73,39 @@ $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE | |||
73 | # Note: kbuild does not track this dependency due to usage of .incbin | 73 | # Note: kbuild does not track this dependency due to usage of .incbin |
74 | $(obj)/gate-data.o: $(obj)/gate.so | 74 | $(obj)/gate-data.o: $(obj)/gate.so |
75 | 75 | ||
76 | # Calculate NR_IRQ = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...) based on config | ||
77 | define sed-y | ||
78 | "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" | ||
79 | endef | ||
80 | quiet_cmd_nr_irqs = GEN $@ | ||
81 | define cmd_nr_irqs | ||
82 | (set -e; \ | ||
83 | echo "#ifndef __ASM_NR_IRQS_H__"; \ | ||
84 | echo "#define __ASM_NR_IRQS_H__"; \ | ||
85 | echo "/*"; \ | ||
86 | echo " * DO NOT MODIFY."; \ | ||
87 | echo " *"; \ | ||
88 | echo " * This file was generated by Kbuild"; \ | ||
89 | echo " *"; \ | ||
90 | echo " */"; \ | ||
91 | echo ""; \ | ||
92 | sed -ne $(sed-y) $<; \ | ||
93 | echo ""; \ | ||
94 | echo "#endif" ) > $@ | ||
95 | endef | ||
96 | |||
97 | # We use internal kbuild rules to avoid the "is up to date" message from make | ||
98 | arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr-irqs.c \ | ||
99 | $(wildcard $(srctree)/include/asm-ia64/*/irq.h) | ||
100 | $(Q)mkdir -p $(dir $@) | ||
101 | $(call if_changed_dep,cc_s_c) | ||
102 | |||
103 | include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s | ||
104 | $(Q)mkdir -p $(dir $@) | ||
105 | $(call cmd,nr_irqs) | ||
106 | |||
107 | clean-files += $(objtree)/include/asm-ia64/nr-irqs.h | ||
108 | |||
76 | # | 109 | # |
77 | # native ivt.S and entry.S | 110 | # native ivt.S and entry.S |
78 | # | 111 | # |
diff --git a/arch/ia64/kernel/nr-irqs.c b/arch/ia64/kernel/nr-irqs.c new file mode 100644 index 000000000000..1ae049181e83 --- /dev/null +++ b/arch/ia64/kernel/nr-irqs.c | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * calculate | ||
3 | * NR_IRQS = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, FOO_NR_IRQS...) | ||
4 | * depending on config. | ||
5 | * This must be calculated before processing asm-offset.c. | ||
6 | */ | ||
7 | |||
8 | #define ASM_OFFSETS_C 1 | ||
9 | |||
10 | #include <linux/kbuild.h> | ||
11 | #include <linux/threads.h> | ||
12 | #include <asm-ia64/native/irq.h> | ||
13 | |||
14 | void foo(void) | ||
15 | { | ||
16 | union paravirt_nr_irqs_max { | ||
17 | char ia64_native_nr_irqs[IA64_NATIVE_NR_IRQS]; | ||
18 | #ifdef CONFIG_XEN | ||
19 | char xen_nr_irqs[XEN_NR_IRQS]; | ||
20 | #endif | ||
21 | }; | ||
22 | |||
23 | DEFINE(NR_IRQS, sizeof (union paravirt_nr_irqs_max)); | ||
24 | } | ||