summaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-08-03 14:40:16 +1000
committerPaul Mackerras <paulus@samba.org>2005-08-29 10:53:35 +1000
commit8d15a3e55f49678b0900dcf5c1cddb322a129325 (patch)
treec86205bde42833c25bf2f3b51f8b67f9d4e52a22 /include/asm-ppc64
parent1ababe11480d59d75be806804c71fa55d203a5a6 (diff)
downloadtalos-obmc-linux-8d15a3e55f49678b0900dcf5c1cddb322a129325.tar.gz
talos-obmc-linux-8d15a3e55f49678b0900dcf5c1cddb322a129325.zip
[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')
-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 @@
#define FW_FEATURE_MULTITCE (1UL<<19)
#define FW_FEATURE_SPLPAR (1UL<<20)
+enum {
+ FW_FEATURE_PSERIES = FW_FEATURE_PFT | FW_FEATURE_TCE |
+ FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY |
+ FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM |
+ FW_FEATURE_PERF | FW_FEATURE_DUMP | FW_FEATURE_INTERRUPT |
+ FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ |
+ FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
+ FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE |
+ FW_FEATURE_SPLPAR,
+ FW_FEATURE_POSSIBLE =
+#ifdef CONFIG_PPC_PSERIES
+ FW_FEATURE_PSERIES |
+#endif
+ 0,
+};
+
/* This is used to identify firmware features which are available
* to the kernel.
*/
@@ -52,15 +68,17 @@ extern unsigned long ppc64_firmware_features;
static inline unsigned long firmware_has_feature(unsigned long feature)
{
- return ppc64_firmware_features & feature;
+ return ppc64_firmware_features & feature & FW_FEATURE_POSSIBLE;
}
+#ifdef CONFIG_PPC_PSERIES
typedef struct {
unsigned long val;
char * name;
} firmware_feature_t;
extern firmware_feature_t firmware_features_table[];
+#endif
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
OpenPOWER on IntegriCloud