diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-08-03 00:35:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:35 -0400 |
commit | 1ababe11480d59d75be806804c71fa55d203a5a6 (patch) | |
tree | c9c8e21945479daa3ae8784588648b9c9bb5206f /include/asm-ppc64 | |
parent | 7a6af5e38054d8e658a4b1b703902331a845de1a (diff) |
[PATCH] ppc64: create firmware_has_feature()
Create the firmware_has_feature() inline and move the firmware feature
stuff into its own header file.
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/cputable.h | 47 | ||||
-rw-r--r-- | include/asm-ppc64/firmware.h | 67 |
2 files changed, 70 insertions, 44 deletions
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h index d55698a60e75..ae6cf3830108 100644 --- a/include/asm-ppc64/cputable.h +++ b/include/asm-ppc64/cputable.h | |||
@@ -66,44 +66,6 @@ static inline unsigned long cpu_has_feature(unsigned long feature) | |||
66 | return cur_cpu_spec->cpu_features & feature; | 66 | return cur_cpu_spec->cpu_features & feature; |
67 | } | 67 | } |
68 | 68 | ||
69 | |||
70 | /* This is used to identify firmware features which are available | ||
71 | * to the kernel. | ||
72 | */ | ||
73 | extern unsigned long ppc64_firmware_features; | ||
74 | |||
75 | /* firmware feature bitmask values */ | ||
76 | #define FIRMWARE_MAX_FEATURES 63 | ||
77 | |||
78 | #define FW_FEATURE_PFT (1UL<<0) | ||
79 | #define FW_FEATURE_TCE (1UL<<1) | ||
80 | #define FW_FEATURE_SPRG0 (1UL<<2) | ||
81 | #define FW_FEATURE_DABR (1UL<<3) | ||
82 | #define FW_FEATURE_COPY (1UL<<4) | ||
83 | #define FW_FEATURE_ASR (1UL<<5) | ||
84 | #define FW_FEATURE_DEBUG (1UL<<6) | ||
85 | #define FW_FEATURE_TERM (1UL<<7) | ||
86 | #define FW_FEATURE_PERF (1UL<<8) | ||
87 | #define FW_FEATURE_DUMP (1UL<<9) | ||
88 | #define FW_FEATURE_INTERRUPT (1UL<<10) | ||
89 | #define FW_FEATURE_MIGRATE (1UL<<11) | ||
90 | #define FW_FEATURE_PERFMON (1UL<<12) | ||
91 | #define FW_FEATURE_CRQ (1UL<<13) | ||
92 | #define FW_FEATURE_VIO (1UL<<14) | ||
93 | #define FW_FEATURE_RDMA (1UL<<15) | ||
94 | #define FW_FEATURE_LLAN (1UL<<16) | ||
95 | #define FW_FEATURE_BULK (1UL<<17) | ||
96 | #define FW_FEATURE_XDABR (1UL<<18) | ||
97 | #define FW_FEATURE_MULTITCE (1UL<<19) | ||
98 | #define FW_FEATURE_SPLPAR (1UL<<20) | ||
99 | |||
100 | typedef struct { | ||
101 | unsigned long val; | ||
102 | char * name; | ||
103 | } firmware_feature_t; | ||
104 | |||
105 | extern firmware_feature_t firmware_features_table[]; | ||
106 | |||
107 | #endif /* __ASSEMBLY__ */ | 69 | #endif /* __ASSEMBLY__ */ |
108 | 70 | ||
109 | /* CPU kernel features */ | 71 | /* CPU kernel features */ |
@@ -140,10 +102,8 @@ extern firmware_feature_t firmware_features_table[]; | |||
140 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) | 102 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) |
141 | #define CPU_FTR_CTRL ASM_CONST(0x0000100000000000) | 103 | #define CPU_FTR_CTRL ASM_CONST(0x0000100000000000) |
142 | 104 | ||
143 | /* Platform firmware features */ | ||
144 | #define FW_FTR_ ASM_CONST(0x0000000000000001) | ||
145 | |||
146 | #ifndef __ASSEMBLY__ | 105 | #ifndef __ASSEMBLY__ |
106 | |||
147 | #define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \ | 107 | #define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \ |
148 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU) | 108 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU) |
149 | 109 | ||
@@ -156,10 +116,9 @@ extern firmware_feature_t firmware_features_table[]; | |||
156 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE) | 116 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE) |
157 | #else | 117 | #else |
158 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE) | 118 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE) |
159 | #endif | 119 | #endif /* CONFIG_PPC_ISERIES */ |
160 | 120 | ||
161 | #define COMMON_PPC64_FW (0) | 121 | #endif /* __ASSEMBLY */ |
162 | #endif | ||
163 | 122 | ||
164 | #ifdef __ASSEMBLY__ | 123 | #ifdef __ASSEMBLY__ |
165 | 124 | ||
diff --git a/include/asm-ppc64/firmware.h b/include/asm-ppc64/firmware.h new file mode 100644 index 000000000000..5bb5bf46bb4a --- /dev/null +++ b/include/asm-ppc64/firmware.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * include/asm-ppc64/firmware.h | ||
3 | * | ||
4 | * Extracted from include/asm-ppc64/cputable.h | ||
5 | * | ||
6 | * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) | ||
7 | * | ||
8 | * Modifications for ppc64: | ||
9 | * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version | ||
14 | * 2 of the License, or (at your option) any later version. | ||
15 | */ | ||
16 | #ifndef __ASM_PPC_FIRMWARE_H | ||
17 | #define __ASM_PPC_FIRMWARE_H | ||
18 | |||
19 | #ifdef __KERNEL__ | ||
20 | |||
21 | #ifndef __ASSEMBLY__ | ||
22 | |||
23 | /* firmware feature bitmask values */ | ||
24 | #define FIRMWARE_MAX_FEATURES 63 | ||
25 | |||
26 | #define FW_FEATURE_PFT (1UL<<0) | ||
27 | #define FW_FEATURE_TCE (1UL<<1) | ||
28 | #define FW_FEATURE_SPRG0 (1UL<<2) | ||
29 | #define FW_FEATURE_DABR (1UL<<3) | ||
30 | #define FW_FEATURE_COPY (1UL<<4) | ||
31 | #define FW_FEATURE_ASR (1UL<<5) | ||
32 | #define FW_FEATURE_DEBUG (1UL<<6) | ||
33 | #define FW_FEATURE_TERM (1UL<<7) | ||
34 | #define FW_FEATURE_PERF (1UL<<8) | ||
35 | #define FW_FEATURE_DUMP (1UL<<9) | ||
36 | #define FW_FEATURE_INTERRUPT (1UL<<10) | ||
37 | #define FW_FEATURE_MIGRATE (1UL<<11) | ||
38 | #define FW_FEATURE_PERFMON (1UL<<12) | ||
39 | #define FW_FEATURE_CRQ (1UL<<13) | ||
40 | #define FW_FEATURE_VIO (1UL<<14) | ||
41 | #define FW_FEATURE_RDMA (1UL<<15) | ||
42 | #define FW_FEATURE_LLAN (1UL<<16) | ||
43 | #define FW_FEATURE_BULK (1UL<<17) | ||
44 | #define FW_FEATURE_XDABR (1UL<<18) | ||
45 | #define FW_FEATURE_MULTITCE (1UL<<19) | ||
46 | #define FW_FEATURE_SPLPAR (1UL<<20) | ||
47 | |||
48 | /* This is used to identify firmware features which are available | ||
49 | * to the kernel. | ||
50 | */ | ||
51 | extern unsigned long ppc64_firmware_features; | ||
52 | |||
53 | static inline unsigned long firmware_has_feature(unsigned long feature) | ||
54 | { | ||
55 | return ppc64_firmware_features & feature; | ||
56 | } | ||
57 | |||
58 | typedef struct { | ||
59 | unsigned long val; | ||
60 | char * name; | ||
61 | } firmware_feature_t; | ||
62 | |||
63 | extern firmware_feature_t firmware_features_table[]; | ||
64 | |||
65 | #endif /* __ASSEMBLY__ */ | ||
66 | #endif /* __KERNEL__ */ | ||
67 | #endif /* __ASM_PPC_FIRMWARE_H */ | ||