diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2005-11-08 21:38:01 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-09 19:24:04 -0500 |
commit | 8882a4da1c932c9f311c9f739e6719adea3e25d9 (patch) | |
tree | 1cf5e23780468d35305cde874f31c6223693908f /include/asm-ppc64 | |
parent | 584224e4095d8abcf2bef38efacc291be9a44c20 (diff) |
[PATCH] powerpc: Move various ppc64 files with no ppc32 equivalent to powerpc
This patch moves a bunch of files from arch/ppc64 and
include/asm-ppc64 which have no equivalents in ppc32 code into
arch/powerpc and include/asm-powerpc. The file affected are:
abs_addr.h
compat.h
lppaca.h
paca.h
tce.h
cpu_setup_power4.S
ioctl32.c
firmware.c
pacaData.c
The only changes apart from the move and corresponding Makefile
changes are:
- #ifndef/#define in includes updated to _ASM_POWERPC_ form
- trailing whitespace removed
- comments giving full paths removed
- pacaData.c renamed paca.c to remove studlyCaps
- Misplaced { moved in lppaca.h
Built and booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64), built
for 32-bit powermac (ARCH=powerpc).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64')
-rw-r--r-- | include/asm-ppc64/abs_addr.h | 73 | ||||
-rw-r--r-- | include/asm-ppc64/compat.h | 205 | ||||
-rw-r--r-- | include/asm-ppc64/lppaca.h | 132 | ||||
-rw-r--r-- | include/asm-ppc64/paca.h | 121 | ||||
-rw-r--r-- | include/asm-ppc64/tce.h | 64 |
5 files changed, 0 insertions, 595 deletions
diff --git a/include/asm-ppc64/abs_addr.h b/include/asm-ppc64/abs_addr.h deleted file mode 100644 index dc3fc3fefef2..000000000000 --- a/include/asm-ppc64/abs_addr.h +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | #ifndef _ABS_ADDR_H | ||
2 | #define _ABS_ADDR_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | /* | ||
7 | * c 2001 PPC 64 Team, IBM Corp | ||
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 | #include <asm/types.h> | ||
16 | #include <asm/page.h> | ||
17 | #include <asm/prom.h> | ||
18 | #include <asm/lmb.h> | ||
19 | #include <asm/firmware.h> | ||
20 | |||
21 | struct mschunks_map { | ||
22 | unsigned long num_chunks; | ||
23 | unsigned long chunk_size; | ||
24 | unsigned long chunk_shift; | ||
25 | unsigned long chunk_mask; | ||
26 | u32 *mapping; | ||
27 | }; | ||
28 | |||
29 | extern struct mschunks_map mschunks_map; | ||
30 | |||
31 | /* Chunks are 256 KB */ | ||
32 | #define MSCHUNKS_CHUNK_SHIFT (18) | ||
33 | #define MSCHUNKS_CHUNK_SIZE (1UL << MSCHUNKS_CHUNK_SHIFT) | ||
34 | #define MSCHUNKS_OFFSET_MASK (MSCHUNKS_CHUNK_SIZE - 1) | ||
35 | |||
36 | static inline unsigned long chunk_to_addr(unsigned long chunk) | ||
37 | { | ||
38 | return chunk << MSCHUNKS_CHUNK_SHIFT; | ||
39 | } | ||
40 | |||
41 | static inline unsigned long addr_to_chunk(unsigned long addr) | ||
42 | { | ||
43 | return addr >> MSCHUNKS_CHUNK_SHIFT; | ||
44 | } | ||
45 | |||
46 | static inline unsigned long phys_to_abs(unsigned long pa) | ||
47 | { | ||
48 | unsigned long chunk; | ||
49 | |||
50 | /* This is a no-op on non-iSeries */ | ||
51 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) | ||
52 | return pa; | ||
53 | |||
54 | chunk = addr_to_chunk(pa); | ||
55 | |||
56 | if (chunk < mschunks_map.num_chunks) | ||
57 | chunk = mschunks_map.mapping[chunk]; | ||
58 | |||
59 | return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK); | ||
60 | } | ||
61 | |||
62 | /* Convenience macros */ | ||
63 | #define virt_to_abs(va) phys_to_abs(__pa(va)) | ||
64 | #define abs_to_virt(aa) __va(aa) | ||
65 | |||
66 | /* | ||
67 | * Converts Virtual Address to Real Address for | ||
68 | * Legacy iSeries Hypervisor calls | ||
69 | */ | ||
70 | #define iseries_hv_addr(virtaddr) \ | ||
71 | (0x8000000000000000 | virt_to_abs(virtaddr)) | ||
72 | |||
73 | #endif /* _ABS_ADDR_H */ | ||
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h deleted file mode 100644 index 6ec62cd2d1d1..000000000000 --- a/include/asm-ppc64/compat.h +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | #ifndef _ASM_PPC64_COMPAT_H | ||
2 | #define _ASM_PPC64_COMPAT_H | ||
3 | /* | ||
4 | * Architecture specific compatibility types | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | #include <linux/sched.h> | ||
8 | |||
9 | #define COMPAT_USER_HZ 100 | ||
10 | |||
11 | typedef u32 compat_size_t; | ||
12 | typedef s32 compat_ssize_t; | ||
13 | typedef s32 compat_time_t; | ||
14 | typedef s32 compat_clock_t; | ||
15 | typedef s32 compat_pid_t; | ||
16 | typedef u32 __compat_uid_t; | ||
17 | typedef u32 __compat_gid_t; | ||
18 | typedef u32 __compat_uid32_t; | ||
19 | typedef u32 __compat_gid32_t; | ||
20 | typedef u32 compat_mode_t; | ||
21 | typedef u32 compat_ino_t; | ||
22 | typedef u32 compat_dev_t; | ||
23 | typedef s32 compat_off_t; | ||
24 | typedef s64 compat_loff_t; | ||
25 | typedef s16 compat_nlink_t; | ||
26 | typedef u16 compat_ipc_pid_t; | ||
27 | typedef s32 compat_daddr_t; | ||
28 | typedef u32 compat_caddr_t; | ||
29 | typedef __kernel_fsid_t compat_fsid_t; | ||
30 | typedef s32 compat_key_t; | ||
31 | typedef s32 compat_timer_t; | ||
32 | |||
33 | typedef s32 compat_int_t; | ||
34 | typedef s32 compat_long_t; | ||
35 | typedef u32 compat_uint_t; | ||
36 | typedef u32 compat_ulong_t; | ||
37 | |||
38 | struct compat_timespec { | ||
39 | compat_time_t tv_sec; | ||
40 | s32 tv_nsec; | ||
41 | }; | ||
42 | |||
43 | struct compat_timeval { | ||
44 | compat_time_t tv_sec; | ||
45 | s32 tv_usec; | ||
46 | }; | ||
47 | |||
48 | struct compat_stat { | ||
49 | compat_dev_t st_dev; | ||
50 | compat_ino_t st_ino; | ||
51 | compat_mode_t st_mode; | ||
52 | compat_nlink_t st_nlink; | ||
53 | __compat_uid32_t st_uid; | ||
54 | __compat_gid32_t st_gid; | ||
55 | compat_dev_t st_rdev; | ||
56 | compat_off_t st_size; | ||
57 | compat_off_t st_blksize; | ||
58 | compat_off_t st_blocks; | ||
59 | compat_time_t st_atime; | ||
60 | u32 st_atime_nsec; | ||
61 | compat_time_t st_mtime; | ||
62 | u32 st_mtime_nsec; | ||
63 | compat_time_t st_ctime; | ||
64 | u32 st_ctime_nsec; | ||
65 | u32 __unused4[2]; | ||
66 | }; | ||
67 | |||
68 | struct compat_flock { | ||
69 | short l_type; | ||
70 | short l_whence; | ||
71 | compat_off_t l_start; | ||
72 | compat_off_t l_len; | ||
73 | compat_pid_t l_pid; | ||
74 | }; | ||
75 | |||
76 | #define F_GETLK64 12 /* using 'struct flock64' */ | ||
77 | #define F_SETLK64 13 | ||
78 | #define F_SETLKW64 14 | ||
79 | |||
80 | struct compat_flock64 { | ||
81 | short l_type; | ||
82 | short l_whence; | ||
83 | compat_loff_t l_start; | ||
84 | compat_loff_t l_len; | ||
85 | compat_pid_t l_pid; | ||
86 | }; | ||
87 | |||
88 | struct compat_statfs { | ||
89 | int f_type; | ||
90 | int f_bsize; | ||
91 | int f_blocks; | ||
92 | int f_bfree; | ||
93 | int f_bavail; | ||
94 | int f_files; | ||
95 | int f_ffree; | ||
96 | compat_fsid_t f_fsid; | ||
97 | int f_namelen; /* SunOS ignores this field. */ | ||
98 | int f_frsize; | ||
99 | int f_spare[5]; | ||
100 | }; | ||
101 | |||
102 | #define COMPAT_RLIM_OLD_INFINITY 0x7fffffff | ||
103 | #define COMPAT_RLIM_INFINITY 0xffffffff | ||
104 | |||
105 | typedef u32 compat_old_sigset_t; | ||
106 | |||
107 | #define _COMPAT_NSIG 64 | ||
108 | #define _COMPAT_NSIG_BPW 32 | ||
109 | |||
110 | typedef u32 compat_sigset_word; | ||
111 | |||
112 | #define COMPAT_OFF_T_MAX 0x7fffffff | ||
113 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | ||
114 | |||
115 | /* | ||
116 | * A pointer passed in from user mode. This should not | ||
117 | * be used for syscall parameters, just declare them | ||
118 | * as pointers because the syscall entry code will have | ||
119 | * appropriately comverted them already. | ||
120 | */ | ||
121 | typedef u32 compat_uptr_t; | ||
122 | |||
123 | static inline void __user *compat_ptr(compat_uptr_t uptr) | ||
124 | { | ||
125 | return (void __user *)(unsigned long)uptr; | ||
126 | } | ||
127 | |||
128 | static inline void __user *compat_alloc_user_space(long len) | ||
129 | { | ||
130 | struct pt_regs *regs = current->thread.regs; | ||
131 | unsigned long usp = regs->gpr[1]; | ||
132 | |||
133 | /* | ||
134 | * We cant access below the stack pointer in the 32bit ABI and | ||
135 | * can access 288 bytes in the 64bit ABI | ||
136 | */ | ||
137 | if (!(test_thread_flag(TIF_32BIT))) | ||
138 | usp -= 288; | ||
139 | |||
140 | return (void __user *) (usp - len); | ||
141 | } | ||
142 | |||
143 | /* | ||
144 | * ipc64_perm is actually 32/64bit clean but since the compat layer refers to | ||
145 | * it we may as well define it. | ||
146 | */ | ||
147 | struct compat_ipc64_perm { | ||
148 | compat_key_t key; | ||
149 | __compat_uid_t uid; | ||
150 | __compat_gid_t gid; | ||
151 | __compat_uid_t cuid; | ||
152 | __compat_gid_t cgid; | ||
153 | compat_mode_t mode; | ||
154 | unsigned int seq; | ||
155 | unsigned int __pad2; | ||
156 | unsigned long __unused1; /* yes they really are 64bit pads */ | ||
157 | unsigned long __unused2; | ||
158 | }; | ||
159 | |||
160 | struct compat_semid64_ds { | ||
161 | struct compat_ipc64_perm sem_perm; | ||
162 | unsigned int __unused1; | ||
163 | compat_time_t sem_otime; | ||
164 | unsigned int __unused2; | ||
165 | compat_time_t sem_ctime; | ||
166 | compat_ulong_t sem_nsems; | ||
167 | compat_ulong_t __unused3; | ||
168 | compat_ulong_t __unused4; | ||
169 | }; | ||
170 | |||
171 | struct compat_msqid64_ds { | ||
172 | struct compat_ipc64_perm msg_perm; | ||
173 | unsigned int __unused1; | ||
174 | compat_time_t msg_stime; | ||
175 | unsigned int __unused2; | ||
176 | compat_time_t msg_rtime; | ||
177 | unsigned int __unused3; | ||
178 | compat_time_t msg_ctime; | ||
179 | compat_ulong_t msg_cbytes; | ||
180 | compat_ulong_t msg_qnum; | ||
181 | compat_ulong_t msg_qbytes; | ||
182 | compat_pid_t msg_lspid; | ||
183 | compat_pid_t msg_lrpid; | ||
184 | compat_ulong_t __unused4; | ||
185 | compat_ulong_t __unused5; | ||
186 | }; | ||
187 | |||
188 | struct compat_shmid64_ds { | ||
189 | struct compat_ipc64_perm shm_perm; | ||
190 | unsigned int __unused1; | ||
191 | compat_time_t shm_atime; | ||
192 | unsigned int __unused2; | ||
193 | compat_time_t shm_dtime; | ||
194 | unsigned int __unused3; | ||
195 | compat_time_t shm_ctime; | ||
196 | unsigned int __unused4; | ||
197 | compat_size_t shm_segsz; | ||
198 | compat_pid_t shm_cpid; | ||
199 | compat_pid_t shm_lpid; | ||
200 | compat_ulong_t shm_nattch; | ||
201 | compat_ulong_t __unused5; | ||
202 | compat_ulong_t __unused6; | ||
203 | }; | ||
204 | |||
205 | #endif /* _ASM_PPC64_COMPAT_H */ | ||
diff --git a/include/asm-ppc64/lppaca.h b/include/asm-ppc64/lppaca.h deleted file mode 100644 index 9e2a6c0649a0..000000000000 --- a/include/asm-ppc64/lppaca.h +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * lppaca.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ASM_LPPACA_H | ||
20 | #define _ASM_LPPACA_H | ||
21 | |||
22 | //============================================================================= | ||
23 | // | ||
24 | // This control block contains the data that is shared between the | ||
25 | // hypervisor (PLIC) and the OS. | ||
26 | // | ||
27 | // | ||
28 | //---------------------------------------------------------------------------- | ||
29 | #include <asm/types.h> | ||
30 | |||
31 | struct lppaca | ||
32 | { | ||
33 | //============================================================================= | ||
34 | // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data | ||
35 | // NOTE: The xDynXyz fields are fields that will be dynamically changed by | ||
36 | // PLIC when preparing to bring a processor online or when dispatching a | ||
37 | // virtual processor! | ||
38 | //============================================================================= | ||
39 | u32 desc; // Eye catcher 0xD397D781 x00-x03 | ||
40 | u16 size; // Size of this struct x04-x05 | ||
41 | u16 reserved1; // Reserved x06-x07 | ||
42 | u16 reserved2:14; // Reserved x08-x09 | ||
43 | u8 shared_proc:1; // Shared processor indicator ... | ||
44 | u8 secondary_thread:1; // Secondary thread indicator ... | ||
45 | volatile u8 dyn_proc_status:8; // Dynamic Status of this proc x0A-x0A | ||
46 | u8 secondary_thread_count; // Secondary thread count x0B-x0B | ||
47 | volatile u16 dyn_hv_phys_proc_index;// Dynamic HV Physical Proc Index0C-x0D | ||
48 | volatile u16 dyn_hv_log_proc_index;// Dynamic HV Logical Proc Indexx0E-x0F | ||
49 | u32 decr_val; // Value for Decr programming x10-x13 | ||
50 | u32 pmc_val; // Value for PMC regs x14-x17 | ||
51 | volatile u32 dyn_hw_node_id; // Dynamic Hardware Node id x18-x1B | ||
52 | volatile u32 dyn_hw_proc_id; // Dynamic Hardware Proc Id x1C-x1F | ||
53 | volatile u32 dyn_pir; // Dynamic ProcIdReg value x20-x23 | ||
54 | u32 dsei_data; // DSEI data x24-x27 | ||
55 | u64 sprg3; // SPRG3 value x28-x2F | ||
56 | u8 reserved3[80]; // Reserved x30-x7F | ||
57 | |||
58 | //============================================================================= | ||
59 | // CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data | ||
60 | //============================================================================= | ||
61 | // This Dword contains a byte for each type of interrupt that can occur. | ||
62 | // The IPI is a count while the others are just a binary 1 or 0. | ||
63 | union { | ||
64 | u64 any_int; | ||
65 | struct { | ||
66 | u16 reserved; // Reserved - cleared by #mpasmbl | ||
67 | u8 xirr_int; // Indicates xXirrValue is valid or Immed IO | ||
68 | u8 ipi_cnt; // IPI Count | ||
69 | u8 decr_int; // DECR interrupt occurred | ||
70 | u8 pdc_int; // PDC interrupt occurred | ||
71 | u8 quantum_int; // Interrupt quantum reached | ||
72 | u8 old_plic_deferred_ext_int; // Old PLIC has a deferred XIRR pending | ||
73 | } fields; | ||
74 | } int_dword; | ||
75 | |||
76 | // Whenever any fields in this Dword are set then PLIC will defer the | ||
77 | // processing of external interrupts. Note that PLIC will store the | ||
78 | // XIRR directly into the xXirrValue field so that another XIRR will | ||
79 | // not be presented until this one clears. The layout of the low | ||
80 | // 4-bytes of this Dword is upto SLIC - PLIC just checks whether the | ||
81 | // entire Dword is zero or not. A non-zero value in the low order | ||
82 | // 2-bytes will result in SLIC being granted the highest thread | ||
83 | // priority upon return. A 0 will return to SLIC as medium priority. | ||
84 | u64 plic_defer_ints_area; // Entire Dword | ||
85 | |||
86 | // Used to pass the real SRR0/1 from PLIC to SLIC as well as to | ||
87 | // pass the target SRR0/1 from SLIC to PLIC on a SetAsrAndRfid. | ||
88 | u64 saved_srr0; // Saved SRR0 x10-x17 | ||
89 | u64 saved_srr1; // Saved SRR1 x18-x1F | ||
90 | |||
91 | // Used to pass parms from the OS to PLIC for SetAsrAndRfid | ||
92 | u64 saved_gpr3; // Saved GPR3 x20-x27 | ||
93 | u64 saved_gpr4; // Saved GPR4 x28-x2F | ||
94 | u64 saved_gpr5; // Saved GPR5 x30-x37 | ||
95 | |||
96 | u8 reserved4; // Reserved x38-x38 | ||
97 | u8 cpuctls_task_attrs; // Task attributes for cpuctls x39-x39 | ||
98 | u8 fpregs_in_use; // FP regs in use x3A-x3A | ||
99 | u8 pmcregs_in_use; // PMC regs in use x3B-x3B | ||
100 | volatile u32 saved_decr; // Saved Decr Value x3C-x3F | ||
101 | volatile u64 emulated_time_base;// Emulated TB for this thread x40-x47 | ||
102 | volatile u64 cur_plic_latency; // Unaccounted PLIC latency x48-x4F | ||
103 | u64 tot_plic_latency; // Accumulated PLIC latency x50-x57 | ||
104 | u64 wait_state_cycles; // Wait cycles for this proc x58-x5F | ||
105 | u64 end_of_quantum; // TB at end of quantum x60-x67 | ||
106 | u64 pdc_saved_sprg1; // Saved SPRG1 for PMC int x68-x6F | ||
107 | u64 pdc_saved_srr0; // Saved SRR0 for PMC int x70-x77 | ||
108 | volatile u32 virtual_decr; // Virtual DECR for shared procsx78-x7B | ||
109 | u16 slb_count; // # of SLBs to maintain x7C-x7D | ||
110 | u8 idle; // Indicate OS is idle x7E | ||
111 | u8 vmxregs_in_use; // VMX registers in use x7F | ||
112 | |||
113 | |||
114 | //============================================================================= | ||
115 | // CACHE_LINE_3 0x0100 - 0x007F: This line is shared with other processors | ||
116 | //============================================================================= | ||
117 | // This is the yield_count. An "odd" value (low bit on) means that | ||
118 | // the processor is yielded (either because of an OS yield or a PLIC | ||
119 | // preempt). An even value implies that the processor is currently | ||
120 | // executing. | ||
121 | // NOTE: This value will ALWAYS be zero for dedicated processors and | ||
122 | // will NEVER be zero for shared processors (ie, initialized to a 1). | ||
123 | volatile u32 yield_count; // PLIC increments each dispatchx00-x03 | ||
124 | u8 reserved6[124]; // Reserved x04-x7F | ||
125 | |||
126 | //============================================================================= | ||
127 | // CACHE_LINE_4-5 0x0100 - 0x01FF Contains PMC interrupt data | ||
128 | //============================================================================= | ||
129 | u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF | ||
130 | }; | ||
131 | |||
132 | #endif /* _ASM_LPPACA_H */ | ||
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h deleted file mode 100644 index bccacd6aa93a..000000000000 --- a/include/asm-ppc64/paca.h +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | #ifndef _PPC64_PACA_H | ||
2 | #define _PPC64_PACA_H | ||
3 | |||
4 | /* | ||
5 | * include/asm-ppc64/paca.h | ||
6 | * | ||
7 | * This control block defines the PACA which defines the processor | ||
8 | * specific data for each logical processor on the system. | ||
9 | * There are some pointers defined that are utilized by PLIC. | ||
10 | * | ||
11 | * C 2001 PPC 64 Team, IBM Corp | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version | ||
16 | * 2 of the License, or (at your option) any later version. | ||
17 | */ | ||
18 | |||
19 | #include <linux/config.h> | ||
20 | #include <asm/types.h> | ||
21 | #include <asm/lppaca.h> | ||
22 | #include <asm/iseries/it_lp_reg_save.h> | ||
23 | #include <asm/mmu.h> | ||
24 | |||
25 | register struct paca_struct *local_paca asm("r13"); | ||
26 | #define get_paca() local_paca | ||
27 | |||
28 | struct task_struct; | ||
29 | |||
30 | /* | ||
31 | * Defines the layout of the paca. | ||
32 | * | ||
33 | * This structure is not directly accessed by firmware or the service | ||
34 | * processor except for the first two pointers that point to the | ||
35 | * lppaca area and the ItLpRegSave area for this CPU. Both the | ||
36 | * lppaca and ItLpRegSave objects are currently contained within the | ||
37 | * PACA but they do not need to be. | ||
38 | */ | ||
39 | struct paca_struct { | ||
40 | /* | ||
41 | * Because hw_cpu_id, unlike other paca fields, is accessed | ||
42 | * routinely from other CPUs (from the IRQ code), we stick to | ||
43 | * read-only (after boot) fields in the first cacheline to | ||
44 | * avoid cacheline bouncing. | ||
45 | */ | ||
46 | |||
47 | /* | ||
48 | * MAGIC: These first two pointers can't be moved - they're | ||
49 | * accessed by the firmware | ||
50 | */ | ||
51 | struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ | ||
52 | struct ItLpRegSave *reg_save_ptr; /* Pointer to LpRegSave for PLIC */ | ||
53 | |||
54 | /* | ||
55 | * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c | ||
56 | * load lock_token and paca_index with a single lwz | ||
57 | * instruction. They must travel together and be properly | ||
58 | * aligned. | ||
59 | */ | ||
60 | u16 lock_token; /* Constant 0x8000, used in locks */ | ||
61 | u16 paca_index; /* Logical processor number */ | ||
62 | |||
63 | u32 default_decr; /* Default decrementer value */ | ||
64 | u64 kernel_toc; /* Kernel TOC address */ | ||
65 | u64 stab_real; /* Absolute address of segment table */ | ||
66 | u64 stab_addr; /* Virtual address of segment table */ | ||
67 | void *emergency_sp; /* pointer to emergency stack */ | ||
68 | s16 hw_cpu_id; /* Physical processor number */ | ||
69 | u8 cpu_start; /* At startup, processor spins until */ | ||
70 | /* this becomes non-zero. */ | ||
71 | |||
72 | /* | ||
73 | * Now, starting in cacheline 2, the exception save areas | ||
74 | */ | ||
75 | /* used for most interrupts/exceptions */ | ||
76 | u64 exgen[10] __attribute__((aligned(0x80))); | ||
77 | u64 exmc[10]; /* used for machine checks */ | ||
78 | u64 exslb[10]; /* used for SLB/segment table misses | ||
79 | * on the linear mapping */ | ||
80 | #ifdef CONFIG_PPC_64K_PAGES | ||
81 | pgd_t *pgdir; | ||
82 | #endif /* CONFIG_PPC_64K_PAGES */ | ||
83 | |||
84 | mm_context_t context; | ||
85 | u16 slb_cache[SLB_CACHE_ENTRIES]; | ||
86 | u16 slb_cache_ptr; | ||
87 | |||
88 | /* | ||
89 | * then miscellaneous read-write fields | ||
90 | */ | ||
91 | struct task_struct *__current; /* Pointer to current */ | ||
92 | u64 kstack; /* Saved Kernel stack addr */ | ||
93 | u64 stab_rr; /* stab/slb round-robin counter */ | ||
94 | u64 next_jiffy_update_tb; /* TB value for next jiffy update */ | ||
95 | u64 saved_r1; /* r1 save for RTAS calls */ | ||
96 | u64 saved_msr; /* MSR saved here by enter_rtas */ | ||
97 | u8 proc_enabled; /* irq soft-enable flag */ | ||
98 | |||
99 | /* not yet used */ | ||
100 | u64 exdsi[8]; /* used for linear mapping hash table misses */ | ||
101 | |||
102 | /* | ||
103 | * iSeries structure which the hypervisor knows about - | ||
104 | * this structure should not cross a page boundary. | ||
105 | * The vpa_init/register_vpa call is now known to fail if the | ||
106 | * lppaca structure crosses a page boundary. | ||
107 | * The lppaca is also used on POWER5 pSeries boxes. | ||
108 | * The lppaca is 640 bytes long, and cannot readily change | ||
109 | * since the hypervisor knows its layout, so a 1kB | ||
110 | * alignment will suffice to ensure that it doesn't | ||
111 | * cross a page boundary. | ||
112 | */ | ||
113 | struct lppaca lppaca __attribute__((__aligned__(0x400))); | ||
114 | #ifdef CONFIG_PPC_ISERIES | ||
115 | struct ItLpRegSave reg_save; | ||
116 | #endif | ||
117 | }; | ||
118 | |||
119 | extern struct paca_struct paca[]; | ||
120 | |||
121 | #endif /* _PPC64_PACA_H */ | ||
diff --git a/include/asm-ppc64/tce.h b/include/asm-ppc64/tce.h deleted file mode 100644 index d40b6b42ab35..000000000000 --- a/include/asm-ppc64/tce.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation | ||
3 | * Rewrite, cleanup: | ||
4 | * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef _ASM_TCE_H | ||
22 | #define _ASM_TCE_H | ||
23 | |||
24 | /* | ||
25 | * Tces come in two formats, one for the virtual bus and a different | ||
26 | * format for PCI | ||
27 | */ | ||
28 | #define TCE_VB 0 | ||
29 | #define TCE_PCI 1 | ||
30 | |||
31 | /* TCE page size is 4096 bytes (1 << 12) */ | ||
32 | |||
33 | #define TCE_SHIFT 12 | ||
34 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) | ||
35 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) | ||
36 | |||
37 | |||
38 | /* tce_entry | ||
39 | * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's | ||
40 | * abstracted so layout is irrelevant. | ||
41 | */ | ||
42 | union tce_entry { | ||
43 | unsigned long te_word; | ||
44 | struct { | ||
45 | unsigned int tb_cacheBits :6; /* Cache hash bits - not used */ | ||
46 | unsigned int tb_rsvd :6; | ||
47 | unsigned long tb_rpn :40; /* Real page number */ | ||
48 | unsigned int tb_valid :1; /* Tce is valid (vb only) */ | ||
49 | unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */ | ||
50 | unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */ | ||
51 | unsigned int tb_pciwr :1; /* Write allowed (pci only) */ | ||
52 | unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */ | ||
53 | } te_bits; | ||
54 | #define te_cacheBits te_bits.tb_cacheBits | ||
55 | #define te_rpn te_bits.tb_rpn | ||
56 | #define te_valid te_bits.tb_valid | ||
57 | #define te_allio te_bits.tb_allio | ||
58 | #define te_lpindex te_bits.tb_lpindex | ||
59 | #define te_pciwr te_bits.tb_pciwr | ||
60 | #define te_rdwr te_bits.tb_rdwr | ||
61 | }; | ||
62 | |||
63 | |||
64 | #endif | ||