diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-05-19 09:13:42 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-05-27 18:10:41 -0400 |
commit | 33b39e84209b0308b572dce017df7ee9b63f086c (patch) | |
tree | e27bb8c44aa70b3172c9be846960baf7dbe98bd4 /include/asm-ia64 | |
parent | e51835d58a5abdf82211f36f500f666ca7ef9aee (diff) |
[IA64] pvops: add hooks, pv_iosapic_ops, to paravirtualize iosapic.
add hooks to paravirtualize iosapic which is a real hardware resource.
On virtualized environment it may be replaced something virtualized
friendly.
Define pv_iosapic_ops and add the hooks.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include/asm-ia64')
-rw-r--r-- | include/asm-ia64/iosapic.h | 18 | ||||
-rw-r--r-- | include/asm-ia64/paravirt.h | 40 |
2 files changed, 56 insertions, 2 deletions
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index a3a4288daae8..b9c102e15f22 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h | |||
@@ -55,13 +55,27 @@ | |||
55 | 55 | ||
56 | #define NR_IOSAPICS 256 | 56 | #define NR_IOSAPICS 256 |
57 | 57 | ||
58 | static inline unsigned int __iosapic_read(char __iomem *iosapic, unsigned int reg) | 58 | #ifdef CONFIG_PARAVIRT_GUEST |
59 | #include <asm/paravirt.h> | ||
60 | #else | ||
61 | #define iosapic_pcat_compat_init ia64_native_iosapic_pcat_compat_init | ||
62 | #define __iosapic_read __ia64_native_iosapic_read | ||
63 | #define __iosapic_write __ia64_native_iosapic_write | ||
64 | #define iosapic_get_irq_chip ia64_native_iosapic_get_irq_chip | ||
65 | #endif | ||
66 | |||
67 | extern void __init ia64_native_iosapic_pcat_compat_init(void); | ||
68 | extern struct irq_chip *ia64_native_iosapic_get_irq_chip(unsigned long trigger); | ||
69 | |||
70 | static inline unsigned int | ||
71 | __ia64_native_iosapic_read(char __iomem *iosapic, unsigned int reg) | ||
59 | { | 72 | { |
60 | writel(reg, iosapic + IOSAPIC_REG_SELECT); | 73 | writel(reg, iosapic + IOSAPIC_REG_SELECT); |
61 | return readl(iosapic + IOSAPIC_WINDOW); | 74 | return readl(iosapic + IOSAPIC_WINDOW); |
62 | } | 75 | } |
63 | 76 | ||
64 | static inline void __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | 77 | static inline void |
78 | __ia64_native_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | ||
65 | { | 79 | { |
66 | writel(reg, iosapic + IOSAPIC_REG_SELECT); | 80 | writel(reg, iosapic + IOSAPIC_REG_SELECT); |
67 | writel(val, iosapic + IOSAPIC_WINDOW); | 81 | writel(val, iosapic + IOSAPIC_WINDOW); |
diff --git a/include/asm-ia64/paravirt.h b/include/asm-ia64/paravirt.h index 84d74c32eb98..3a40f624e86e 100644 --- a/include/asm-ia64/paravirt.h +++ b/include/asm-ia64/paravirt.h | |||
@@ -112,6 +112,46 @@ static inline void paravirt_post_smp_prepare_boot_cpu(void) | |||
112 | pv_init_ops.post_smp_prepare_boot_cpu(); | 112 | pv_init_ops.post_smp_prepare_boot_cpu(); |
113 | } | 113 | } |
114 | 114 | ||
115 | /****************************************************************************** | ||
116 | * replacement of iosapic operations. | ||
117 | */ | ||
118 | |||
119 | struct pv_iosapic_ops { | ||
120 | void (*pcat_compat_init)(void); | ||
121 | |||
122 | struct irq_chip *(*get_irq_chip)(unsigned long trigger); | ||
123 | |||
124 | unsigned int (*__read)(char __iomem *iosapic, unsigned int reg); | ||
125 | void (*__write)(char __iomem *iosapic, unsigned int reg, u32 val); | ||
126 | }; | ||
127 | |||
128 | extern struct pv_iosapic_ops pv_iosapic_ops; | ||
129 | |||
130 | static inline void | ||
131 | iosapic_pcat_compat_init(void) | ||
132 | { | ||
133 | if (pv_iosapic_ops.pcat_compat_init) | ||
134 | pv_iosapic_ops.pcat_compat_init(); | ||
135 | } | ||
136 | |||
137 | static inline struct irq_chip* | ||
138 | iosapic_get_irq_chip(unsigned long trigger) | ||
139 | { | ||
140 | return pv_iosapic_ops.get_irq_chip(trigger); | ||
141 | } | ||
142 | |||
143 | static inline unsigned int | ||
144 | __iosapic_read(char __iomem *iosapic, unsigned int reg) | ||
145 | { | ||
146 | return pv_iosapic_ops.__read(iosapic, reg); | ||
147 | } | ||
148 | |||
149 | static inline void | ||
150 | __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | ||
151 | { | ||
152 | return pv_iosapic_ops.__write(iosapic, reg, val); | ||
153 | } | ||
154 | |||
115 | #endif /* !__ASSEMBLY__ */ | 155 | #endif /* !__ASSEMBLY__ */ |
116 | 156 | ||
117 | #else | 157 | #else |