File: /usr/src/linux/include/asm-ppc/cputable.h
1 /*
2 * BK Id: SCCS/s.cputable.h 1.3 08/19/01 22:31:46 paulus
3 */
4 /*
5 * include/asm-ppc/cputable.h
6 *
7 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15 #ifndef __ASM_PPC_CPUTABLE_H
16 #define __ASM_PPC_CPUTABLE_H
17
18 /* Exposed to userland CPU features */
19 #define PPC_FEATURE_32 0x80000000
20 #define PPC_FEATURE_64 0x40000000
21 #define PPC_FEATURE_601_INSTR 0x20000000
22 #define PPC_FEATURE_HAS_ALTIVEC 0x10000000
23 #define PPC_FEATURE_HAS_FPU 0x08000000
24 #define PPC_FEATURE_HAS_MMU 0x04000000
25 #define PPC_FEATURE_HAS_4xxMAC 0x02000000
26 #define PPC_FEATURE_UNIFIED_CACHE 0x01000000
27
28 #ifdef __KERNEL__
29
30 #ifndef __ASSEMBLY__
31
32 /* This structure can grow, it's real size is used by head.S code
33 * via the mkdefs mecanism.
34 */
35 struct cpu_spec {
36 /* CPU is matched via (PVR & pvr_mask) == pvr_value */
37 unsigned int pvr_mask;
38 unsigned int pvr_value;
39
40 char *cpu_name;
41 unsigned int cpu_features; /* Kernel features */
42 unsigned int cpu_user_features; /* Userland features */
43
44 /* cache line sizes */
45 unsigned int icache_bsize;
46 unsigned int dcache_bsize;
47
48 /* this is called to initialize various CPU bits like L1 cache,
49 * BHT, SPD, etc... from head.S before branching to identify_machine
50 */
51 void (*cpu_setup)(int cpu_nr);
52 };
53
54 extern struct cpu_spec cpu_specs[];
55 extern struct cpu_spec *cur_cpu_spec[];
56
57 #endif /* __ASSEMBLY__ */
58
59 /* CPU kernel features */
60 #define CPU_FTR_SPLIT_ID_CACHE 0x00000001
61 #define CPU_FTR_L2CR 0x00000002
62 #define CPU_FTR_SPEC7450 0x00000004
63 #define CPU_FTR_ALTIVEC 0x00000008
64 #define CPU_FTR_TAU 0x00000010
65 #define CPU_FTR_CAN_DOZE 0x00000020
66 #define CPU_FTR_USE_TB 0x00000040
67 #define CPU_FTR_604_PERF_MON 0x00000080
68 #define CPU_FTR_601 0x00000100
69 #define CPU_FTR_HPTE_TABLE 0x00000200
70
71 #ifdef __ASSEMBLY__
72
73 #define BEGIN_FTR_SECTION 98:
74
75 #define END_FTR_SECTION(msk, val) \
76 99: \
77 .section __ftr_fixup,"a"; \
78 .align 2; \
79 .long msk; \
80 .long val; \
81 .long 98b; \
82 .long 99b; \
83 .previous
84
85 #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk))
86 #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0)
87
88 #endif /* __ASSEMBLY__ */
89
90 #endif /* __ASM_PPC_CPUTABLE_H */
91 #endif /* __KERNEL__ */
92
93