aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/firmware.h
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-08-03 00:40:16 -0400
committerPaul Mackerras <paulus@samba.org>2005-08-28 20:53:35 -0400
commit8d15a3e55f49678b0900dcf5c1cddb322a129325 (patch)
treec86205bde42833c25bf2f3b51f8b67f9d4e52a22 /include/asm-ppc64/firmware.h
parent1ababe11480d59d75be806804c71fa55d203a5a6 (diff)
[PATCH] ppc64: make firmware_has_feature() stronger
Make firmware_has_feature() evaluate at compile time for the non pSeries case and tidy up code where possible. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64/firmware.h')
-rw-r--r--include/asm-ppc64/firmware.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/asm-ppc64/firmware.h b/include/asm-ppc64/firmware.h
index 5bb5bf46bb4a..e3725f3c8ea6 100644
--- a/include/asm-ppc64/firmware.h
+++ b/include/asm-ppc64/firmware.h
@@ -45,6 +45,22 @@
45#define FW_FEATURE_MULTITCE (1UL<<19) 45#define FW_FEATURE_MULTITCE (1UL<<19)
46#define FW_FEATURE_SPLPAR (1UL<<20) 46#define FW_FEATURE_SPLPAR (1UL<<20)
47 47
48enum {
49 FW_FEATURE_PSERIES = FW_FEATURE_PFT | FW_FEATURE_TCE |
50 FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY |
51 FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM |
52 FW_FEATURE_PERF | FW_FEATURE_DUMP | FW_FEATURE_INTERRUPT |
53 FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ |
54 FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
55 FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE |
56 FW_FEATURE_SPLPAR,
57 FW_FEATURE_POSSIBLE =
58#ifdef CONFIG_PPC_PSERIES
59 FW_FEATURE_PSERIES |
60#endif
61 0,
62};
63
48/* This is used to identify firmware features which are available 64/* This is used to identify firmware features which are available
49 * to the kernel. 65 * to the kernel.
50 */ 66 */
@@ -52,15 +68,17 @@ extern unsigned long ppc64_firmware_features;
52 68
53static inline unsigned long firmware_has_feature(unsigned long feature) 69static inline unsigned long firmware_has_feature(unsigned long feature)
54{ 70{
55 return ppc64_firmware_features & feature; 71 return ppc64_firmware_features & feature & FW_FEATURE_POSSIBLE;
56} 72}
57 73
74#ifdef CONFIG_PPC_PSERIES
58typedef struct { 75typedef struct {
59 unsigned long val; 76 unsigned long val;
60 char * name; 77 char * name;
61} firmware_feature_t; 78} firmware_feature_t;
62 79
63extern firmware_feature_t firmware_features_table[]; 80extern firmware_feature_t firmware_features_table[];
81#endif
64 82
65#endif /* __ASSEMBLY__ */ 83#endif /* __ASSEMBLY__ */
66#endif /* __KERNEL__ */ 84#endif /* __KERNEL__ */