diff options
Diffstat (limited to 'include/asm-sh64')
98 files changed, 0 insertions, 5986 deletions
diff --git a/include/asm-sh64/Kbuild b/include/asm-sh64/Kbuild deleted file mode 100644 index c68e1680da01..000000000000 --- a/include/asm-sh64/Kbuild +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
diff --git a/include/asm-sh64/a.out.h b/include/asm-sh64/a.out.h deleted file mode 100644 index 237ee4e5b72a..000000000000 --- a/include/asm-sh64/a.out.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_A_OUT_H | ||
2 | #define __ASM_SH64_A_OUT_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/a.out.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | struct exec | ||
16 | { | ||
17 | unsigned long a_info; /* Use macros N_MAGIC, etc for access */ | ||
18 | unsigned a_text; /* length of text, in bytes */ | ||
19 | unsigned a_data; /* length of data, in bytes */ | ||
20 | unsigned a_bss; /* length of uninitialized data area for file, in bytes */ | ||
21 | unsigned a_syms; /* length of symbol table data in file, in bytes */ | ||
22 | unsigned a_entry; /* start address */ | ||
23 | unsigned a_trsize; /* length of relocation info for text, in bytes */ | ||
24 | unsigned a_drsize; /* length of relocation info for data, in bytes */ | ||
25 | }; | ||
26 | |||
27 | #define N_TRSIZE(a) ((a).a_trsize) | ||
28 | #define N_DRSIZE(a) ((a).a_drsize) | ||
29 | #define N_SYMSIZE(a) ((a).a_syms) | ||
30 | |||
31 | #ifdef __KERNEL__ | ||
32 | |||
33 | #define STACK_TOP TASK_SIZE | ||
34 | #define STACK_TOP_MAX STACK_TOP | ||
35 | |||
36 | #endif | ||
37 | |||
38 | #endif /* __ASM_SH64_A_OUT_H */ | ||
diff --git a/include/asm-sh64/atomic.h b/include/asm-sh64/atomic.h deleted file mode 100644 index 28f2ea9b567b..000000000000 --- a/include/asm-sh64/atomic.h +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_ATOMIC_H | ||
2 | #define __ASM_SH64_ATOMIC_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/atomic.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * Atomic operations that C can't guarantee us. Useful for | ||
18 | * resource counting etc.. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | typedef struct { volatile int counter; } atomic_t; | ||
23 | |||
24 | #define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) | ||
25 | |||
26 | #define atomic_read(v) ((v)->counter) | ||
27 | #define atomic_set(v,i) ((v)->counter = (i)) | ||
28 | |||
29 | #include <asm/system.h> | ||
30 | |||
31 | /* | ||
32 | * To get proper branch prediction for the main line, we must branch | ||
33 | * forward to code at the end of this object's .text section, then | ||
34 | * branch back to restart the operation. | ||
35 | */ | ||
36 | |||
37 | static __inline__ void atomic_add(int i, atomic_t * v) | ||
38 | { | ||
39 | unsigned long flags; | ||
40 | |||
41 | local_irq_save(flags); | ||
42 | *(long *)v += i; | ||
43 | local_irq_restore(flags); | ||
44 | } | ||
45 | |||
46 | static __inline__ void atomic_sub(int i, atomic_t *v) | ||
47 | { | ||
48 | unsigned long flags; | ||
49 | |||
50 | local_irq_save(flags); | ||
51 | *(long *)v -= i; | ||
52 | local_irq_restore(flags); | ||
53 | } | ||
54 | |||
55 | static __inline__ int atomic_add_return(int i, atomic_t * v) | ||
56 | { | ||
57 | unsigned long temp, flags; | ||
58 | |||
59 | local_irq_save(flags); | ||
60 | temp = *(long *)v; | ||
61 | temp += i; | ||
62 | *(long *)v = temp; | ||
63 | local_irq_restore(flags); | ||
64 | |||
65 | return temp; | ||
66 | } | ||
67 | |||
68 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) | ||
69 | |||
70 | static __inline__ int atomic_sub_return(int i, atomic_t * v) | ||
71 | { | ||
72 | unsigned long temp, flags; | ||
73 | |||
74 | local_irq_save(flags); | ||
75 | temp = *(long *)v; | ||
76 | temp -= i; | ||
77 | *(long *)v = temp; | ||
78 | local_irq_restore(flags); | ||
79 | |||
80 | return temp; | ||
81 | } | ||
82 | |||
83 | #define atomic_dec_return(v) atomic_sub_return(1,(v)) | ||
84 | #define atomic_inc_return(v) atomic_add_return(1,(v)) | ||
85 | |||
86 | /* | ||
87 | * atomic_inc_and_test - increment and test | ||
88 | * @v: pointer of type atomic_t | ||
89 | * | ||
90 | * Atomically increments @v by 1 | ||
91 | * and returns true if the result is zero, or false for all | ||
92 | * other cases. | ||
93 | */ | ||
94 | #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) | ||
95 | |||
96 | #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) | ||
97 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) | ||
98 | |||
99 | #define atomic_inc(v) atomic_add(1,(v)) | ||
100 | #define atomic_dec(v) atomic_sub(1,(v)) | ||
101 | |||
102 | static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | ||
103 | { | ||
104 | int ret; | ||
105 | unsigned long flags; | ||
106 | |||
107 | local_irq_save(flags); | ||
108 | ret = v->counter; | ||
109 | if (likely(ret == old)) | ||
110 | v->counter = new; | ||
111 | local_irq_restore(flags); | ||
112 | |||
113 | return ret; | ||
114 | } | ||
115 | |||
116 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
117 | |||
118 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | ||
119 | { | ||
120 | int ret; | ||
121 | unsigned long flags; | ||
122 | |||
123 | local_irq_save(flags); | ||
124 | ret = v->counter; | ||
125 | if (ret != u) | ||
126 | v->counter += a; | ||
127 | local_irq_restore(flags); | ||
128 | |||
129 | return ret != u; | ||
130 | } | ||
131 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
132 | |||
133 | static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v) | ||
134 | { | ||
135 | unsigned long flags; | ||
136 | |||
137 | local_irq_save(flags); | ||
138 | *(long *)v &= ~mask; | ||
139 | local_irq_restore(flags); | ||
140 | } | ||
141 | |||
142 | static __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v) | ||
143 | { | ||
144 | unsigned long flags; | ||
145 | |||
146 | local_irq_save(flags); | ||
147 | *(long *)v |= mask; | ||
148 | local_irq_restore(flags); | ||
149 | } | ||
150 | |||
151 | /* Atomic operations are already serializing on SH */ | ||
152 | #define smp_mb__before_atomic_dec() barrier() | ||
153 | #define smp_mb__after_atomic_dec() barrier() | ||
154 | #define smp_mb__before_atomic_inc() barrier() | ||
155 | #define smp_mb__after_atomic_inc() barrier() | ||
156 | |||
157 | #include <asm-generic/atomic.h> | ||
158 | #endif /* __ASM_SH64_ATOMIC_H */ | ||
diff --git a/include/asm-sh64/auxvec.h b/include/asm-sh64/auxvec.h deleted file mode 100644 index 1ad5a44bdc76..000000000000 --- a/include/asm-sh64/auxvec.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_AUXVEC_H | ||
2 | #define __ASM_SH64_AUXVEC_H | ||
3 | |||
4 | #endif /* __ASM_SH64_AUXVEC_H */ | ||
diff --git a/include/asm-sh64/bitops.h b/include/asm-sh64/bitops.h deleted file mode 100644 index 600c59efb4c2..000000000000 --- a/include/asm-sh64/bitops.h +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_BITOPS_H | ||
2 | #define __ASM_SH64_BITOPS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/bitops.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | */ | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | |||
17 | #ifndef _LINUX_BITOPS_H | ||
18 | #error only <linux/bitops.h> can be included directly | ||
19 | #endif | ||
20 | |||
21 | #include <linux/compiler.h> | ||
22 | #include <asm/system.h> | ||
23 | /* For __swab32 */ | ||
24 | #include <asm/byteorder.h> | ||
25 | |||
26 | static __inline__ void set_bit(int nr, volatile void * addr) | ||
27 | { | ||
28 | int mask; | ||
29 | volatile unsigned int *a = addr; | ||
30 | unsigned long flags; | ||
31 | |||
32 | a += nr >> 5; | ||
33 | mask = 1 << (nr & 0x1f); | ||
34 | local_irq_save(flags); | ||
35 | *a |= mask; | ||
36 | local_irq_restore(flags); | ||
37 | } | ||
38 | |||
39 | /* | ||
40 | * clear_bit() doesn't provide any barrier for the compiler. | ||
41 | */ | ||
42 | #define smp_mb__before_clear_bit() barrier() | ||
43 | #define smp_mb__after_clear_bit() barrier() | ||
44 | static inline void clear_bit(int nr, volatile unsigned long *a) | ||
45 | { | ||
46 | int mask; | ||
47 | unsigned long flags; | ||
48 | |||
49 | a += nr >> 5; | ||
50 | mask = 1 << (nr & 0x1f); | ||
51 | local_irq_save(flags); | ||
52 | *a &= ~mask; | ||
53 | local_irq_restore(flags); | ||
54 | } | ||
55 | |||
56 | static __inline__ void change_bit(int nr, volatile void * addr) | ||
57 | { | ||
58 | int mask; | ||
59 | volatile unsigned int *a = addr; | ||
60 | unsigned long flags; | ||
61 | |||
62 | a += nr >> 5; | ||
63 | mask = 1 << (nr & 0x1f); | ||
64 | local_irq_save(flags); | ||
65 | *a ^= mask; | ||
66 | local_irq_restore(flags); | ||
67 | } | ||
68 | |||
69 | static __inline__ int test_and_set_bit(int nr, volatile void * addr) | ||
70 | { | ||
71 | int mask, retval; | ||
72 | volatile unsigned int *a = addr; | ||
73 | unsigned long flags; | ||
74 | |||
75 | a += nr >> 5; | ||
76 | mask = 1 << (nr & 0x1f); | ||
77 | local_irq_save(flags); | ||
78 | retval = (mask & *a) != 0; | ||
79 | *a |= mask; | ||
80 | local_irq_restore(flags); | ||
81 | |||
82 | return retval; | ||
83 | } | ||
84 | |||
85 | static __inline__ int test_and_clear_bit(int nr, volatile void * addr) | ||
86 | { | ||
87 | int mask, retval; | ||
88 | volatile unsigned int *a = addr; | ||
89 | unsigned long flags; | ||
90 | |||
91 | a += nr >> 5; | ||
92 | mask = 1 << (nr & 0x1f); | ||
93 | local_irq_save(flags); | ||
94 | retval = (mask & *a) != 0; | ||
95 | *a &= ~mask; | ||
96 | local_irq_restore(flags); | ||
97 | |||
98 | return retval; | ||
99 | } | ||
100 | |||
101 | static __inline__ int test_and_change_bit(int nr, volatile void * addr) | ||
102 | { | ||
103 | int mask, retval; | ||
104 | volatile unsigned int *a = addr; | ||
105 | unsigned long flags; | ||
106 | |||
107 | a += nr >> 5; | ||
108 | mask = 1 << (nr & 0x1f); | ||
109 | local_irq_save(flags); | ||
110 | retval = (mask & *a) != 0; | ||
111 | *a ^= mask; | ||
112 | local_irq_restore(flags); | ||
113 | |||
114 | return retval; | ||
115 | } | ||
116 | |||
117 | #include <asm-generic/bitops/non-atomic.h> | ||
118 | |||
119 | static __inline__ unsigned long ffz(unsigned long word) | ||
120 | { | ||
121 | unsigned long result, __d2, __d3; | ||
122 | |||
123 | __asm__("gettr tr0, %2\n\t" | ||
124 | "pta $+32, tr0\n\t" | ||
125 | "andi %1, 1, %3\n\t" | ||
126 | "beq %3, r63, tr0\n\t" | ||
127 | "pta $+4, tr0\n" | ||
128 | "0:\n\t" | ||
129 | "shlri.l %1, 1, %1\n\t" | ||
130 | "addi %0, 1, %0\n\t" | ||
131 | "andi %1, 1, %3\n\t" | ||
132 | "beqi %3, 1, tr0\n" | ||
133 | "1:\n\t" | ||
134 | "ptabs %2, tr0\n\t" | ||
135 | : "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3) | ||
136 | : "0" (0L), "1" (word)); | ||
137 | |||
138 | return result; | ||
139 | } | ||
140 | |||
141 | #include <asm-generic/bitops/__ffs.h> | ||
142 | #include <asm-generic/bitops/find.h> | ||
143 | #include <asm-generic/bitops/hweight.h> | ||
144 | #include <asm-generic/bitops/lock.h> | ||
145 | #include <asm-generic/bitops/sched.h> | ||
146 | #include <asm-generic/bitops/ffs.h> | ||
147 | #include <asm-generic/bitops/ext2-non-atomic.h> | ||
148 | #include <asm-generic/bitops/ext2-atomic.h> | ||
149 | #include <asm-generic/bitops/minix.h> | ||
150 | #include <asm-generic/bitops/fls.h> | ||
151 | #include <asm-generic/bitops/fls64.h> | ||
152 | |||
153 | #endif /* __KERNEL__ */ | ||
154 | |||
155 | #endif /* __ASM_SH64_BITOPS_H */ | ||
diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h deleted file mode 100644 index f3a9c9248ef4..000000000000 --- a/include/asm-sh64/bug.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_BUG_H | ||
2 | #define __ASM_SH64_BUG_H | ||
3 | |||
4 | #ifdef CONFIG_BUG | ||
5 | /* | ||
6 | * Tell the user there is some problem, then force a segfault (in process | ||
7 | * context) or a panic (interrupt context). | ||
8 | */ | ||
9 | #define BUG() do { \ | ||
10 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | ||
11 | *(volatile int *)0 = 0; \ | ||
12 | } while (0) | ||
13 | |||
14 | #define HAVE_ARCH_BUG | ||
15 | #endif | ||
16 | |||
17 | #include <asm-generic/bug.h> | ||
18 | |||
19 | #endif /* __ASM_SH64_BUG_H */ | ||
diff --git a/include/asm-sh64/bugs.h b/include/asm-sh64/bugs.h deleted file mode 100644 index 05554aaea672..000000000000 --- a/include/asm-sh64/bugs.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_BUGS_H | ||
2 | #define __ASM_SH64_BUGS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/bugs.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * This is included by init/main.c to check for architecture-dependent bugs. | ||
18 | * | ||
19 | * Needs: | ||
20 | * void check_bugs(void); | ||
21 | */ | ||
22 | |||
23 | /* | ||
24 | * I don't know of any Super-H bugs yet. | ||
25 | */ | ||
26 | |||
27 | #include <asm/processor.h> | ||
28 | |||
29 | static void __init check_bugs(void) | ||
30 | { | ||
31 | extern char *get_cpu_subtype(void); | ||
32 | extern unsigned long loops_per_jiffy; | ||
33 | |||
34 | cpu_data->loops_per_jiffy = loops_per_jiffy; | ||
35 | |||
36 | printk("CPU: %s\n", get_cpu_subtype()); | ||
37 | } | ||
38 | #endif /* __ASM_SH64_BUGS_H */ | ||
diff --git a/include/asm-sh64/byteorder.h b/include/asm-sh64/byteorder.h deleted file mode 100644 index 7419d78820ee..000000000000 --- a/include/asm-sh64/byteorder.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_BYTEORDER_H | ||
2 | #define __ASM_SH64_BYTEORDER_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/byteorder.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <asm/types.h> | ||
16 | |||
17 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) | ||
18 | { | ||
19 | __asm__("byterev %0, %0\n\t" | ||
20 | "shari %0, 32, %0" | ||
21 | : "=r" (x) | ||
22 | : "0" (x)); | ||
23 | return x; | ||
24 | } | ||
25 | |||
26 | static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) | ||
27 | { | ||
28 | __asm__("byterev %0, %0\n\t" | ||
29 | "shari %0, 48, %0" | ||
30 | : "=r" (x) | ||
31 | : "0" (x)); | ||
32 | return x; | ||
33 | } | ||
34 | |||
35 | #define __arch__swab32(x) ___arch__swab32(x) | ||
36 | #define __arch__swab16(x) ___arch__swab16(x) | ||
37 | |||
38 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
39 | # define __BYTEORDER_HAS_U64__ | ||
40 | # define __SWAB_64_THRU_32__ | ||
41 | #endif | ||
42 | |||
43 | #ifdef __LITTLE_ENDIAN__ | ||
44 | #include <linux/byteorder/little_endian.h> | ||
45 | #else | ||
46 | #include <linux/byteorder/big_endian.h> | ||
47 | #endif | ||
48 | |||
49 | #endif /* __ASM_SH64_BYTEORDER_H */ | ||
diff --git a/include/asm-sh64/cache.h b/include/asm-sh64/cache.h deleted file mode 100644 index a4f36f0036e1..000000000000 --- a/include/asm-sh64/cache.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_CACHE_H | ||
2 | #define __ASM_SH64_CACHE_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/cache.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003, 2004 Paul Mundt | ||
13 | * | ||
14 | */ | ||
15 | #include <asm/cacheflush.h> | ||
16 | |||
17 | #define L1_CACHE_SHIFT 5 | ||
18 | /* bytes per L1 cache line */ | ||
19 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | ||
20 | #define L1_CACHE_ALIGN_MASK (~(L1_CACHE_BYTES - 1)) | ||
21 | #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES - 1)) & L1_CACHE_ALIGN_MASK) | ||
22 | #define L1_CACHE_SIZE_BYTES (L1_CACHE_BYTES << 10) | ||
23 | |||
24 | #ifdef MODULE | ||
25 | #define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES))) | ||
26 | #else | ||
27 | #define __cacheline_aligned \ | ||
28 | __attribute__((__aligned__(L1_CACHE_BYTES), \ | ||
29 | __section__(".data.cacheline_aligned"))) | ||
30 | #endif | ||
31 | |||
32 | /* | ||
33 | * Control Registers. | ||
34 | */ | ||
35 | #define ICCR_BASE 0x01600000 /* Instruction Cache Control Register */ | ||
36 | #define ICCR_REG0 0 /* Register 0 offset */ | ||
37 | #define ICCR_REG1 1 /* Register 1 offset */ | ||
38 | #define ICCR0 ICCR_BASE+ICCR_REG0 | ||
39 | #define ICCR1 ICCR_BASE+ICCR_REG1 | ||
40 | |||
41 | #define ICCR0_OFF 0x0 /* Set ICACHE off */ | ||
42 | #define ICCR0_ON 0x1 /* Set ICACHE on */ | ||
43 | #define ICCR0_ICI 0x2 /* Invalidate all in IC */ | ||
44 | |||
45 | #define ICCR1_NOLOCK 0x0 /* Set No Locking */ | ||
46 | |||
47 | #define OCCR_BASE 0x01E00000 /* Operand Cache Control Register */ | ||
48 | #define OCCR_REG0 0 /* Register 0 offset */ | ||
49 | #define OCCR_REG1 1 /* Register 1 offset */ | ||
50 | #define OCCR0 OCCR_BASE+OCCR_REG0 | ||
51 | #define OCCR1 OCCR_BASE+OCCR_REG1 | ||
52 | |||
53 | #define OCCR0_OFF 0x0 /* Set OCACHE off */ | ||
54 | #define OCCR0_ON 0x1 /* Set OCACHE on */ | ||
55 | #define OCCR0_OCI 0x2 /* Invalidate all in OC */ | ||
56 | #define OCCR0_WT 0x4 /* Set OCACHE in WT Mode */ | ||
57 | #define OCCR0_WB 0x0 /* Set OCACHE in WB Mode */ | ||
58 | |||
59 | #define OCCR1_NOLOCK 0x0 /* Set No Locking */ | ||
60 | |||
61 | |||
62 | /* | ||
63 | * SH-5 | ||
64 | * A bit of description here, for neff=32. | ||
65 | * | ||
66 | * |<--- tag (19 bits) --->| | ||
67 | * +-----------------------------+-----------------+------+----------+------+ | ||
68 | * | | | ways |set index |offset| | ||
69 | * +-----------------------------+-----------------+------+----------+------+ | ||
70 | * ^ 2 bits 8 bits 5 bits | ||
71 | * +- Bit 31 | ||
72 | * | ||
73 | * Cacheline size is based on offset: 5 bits = 32 bytes per line | ||
74 | * A cache line is identified by a tag + set but OCACHETAG/ICACHETAG | ||
75 | * have a broader space for registers. These are outlined by | ||
76 | * CACHE_?C_*_STEP below. | ||
77 | * | ||
78 | */ | ||
79 | |||
80 | /* Valid and Dirty bits */ | ||
81 | #define SH_CACHE_VALID (1LL<<0) | ||
82 | #define SH_CACHE_UPDATED (1LL<<57) | ||
83 | |||
84 | /* Cache flags */ | ||
85 | #define SH_CACHE_MODE_WT (1LL<<0) | ||
86 | #define SH_CACHE_MODE_WB (1LL<<1) | ||
87 | |||
88 | #ifndef __ASSEMBLY__ | ||
89 | |||
90 | /* | ||
91 | * Cache information structure. | ||
92 | * | ||
93 | * Defined for both I and D cache, per-processor. | ||
94 | */ | ||
95 | struct cache_info { | ||
96 | unsigned int ways; | ||
97 | unsigned int sets; | ||
98 | unsigned int linesz; | ||
99 | |||
100 | unsigned int way_shift; | ||
101 | unsigned int entry_shift; | ||
102 | unsigned int set_shift; | ||
103 | unsigned int way_step_shift; | ||
104 | unsigned int asid_shift; | ||
105 | |||
106 | unsigned int way_ofs; | ||
107 | |||
108 | unsigned int asid_mask; | ||
109 | unsigned int idx_mask; | ||
110 | unsigned int epn_mask; | ||
111 | |||
112 | unsigned long flags; | ||
113 | }; | ||
114 | |||
115 | #endif /* __ASSEMBLY__ */ | ||
116 | |||
117 | /* Instruction cache */ | ||
118 | #define CACHE_IC_ADDRESS_ARRAY 0x01000000 | ||
119 | |||
120 | /* Operand Cache */ | ||
121 | #define CACHE_OC_ADDRESS_ARRAY 0x01800000 | ||
122 | |||
123 | /* These declarations relate to cache 'synonyms' in the operand cache. A | ||
124 | 'synonym' occurs where effective address bits overlap between those used for | ||
125 | indexing the cache sets and those passed to the MMU for translation. In the | ||
126 | case of SH5-101 & SH5-103, only bit 12 is affected for 4k pages. */ | ||
127 | |||
128 | #define CACHE_OC_N_SYNBITS 1 /* Number of synonym bits */ | ||
129 | #define CACHE_OC_SYN_SHIFT 12 | ||
130 | /* Mask to select synonym bit(s) */ | ||
131 | #define CACHE_OC_SYN_MASK (((1UL<<CACHE_OC_N_SYNBITS)-1)<<CACHE_OC_SYN_SHIFT) | ||
132 | |||
133 | |||
134 | /* | ||
135 | * Instruction cache can't be invalidated based on physical addresses. | ||
136 | * No Instruction Cache defines required, then. | ||
137 | */ | ||
138 | |||
139 | #endif /* __ASM_SH64_CACHE_H */ | ||
diff --git a/include/asm-sh64/cacheflush.h b/include/asm-sh64/cacheflush.h deleted file mode 100644 index 1e53a47bdc97..000000000000 --- a/include/asm-sh64/cacheflush.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_CACHEFLUSH_H | ||
2 | #define __ASM_SH64_CACHEFLUSH_H | ||
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | |||
6 | #include <asm/page.h> | ||
7 | |||
8 | struct vm_area_struct; | ||
9 | struct page; | ||
10 | struct mm_struct; | ||
11 | |||
12 | extern void flush_cache_all(void); | ||
13 | extern void flush_cache_mm(struct mm_struct *mm); | ||
14 | extern void flush_cache_sigtramp(unsigned long start, unsigned long end); | ||
15 | extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, | ||
16 | unsigned long end); | ||
17 | extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); | ||
18 | extern void flush_dcache_page(struct page *pg); | ||
19 | extern void flush_icache_range(unsigned long start, unsigned long end); | ||
20 | extern void flush_icache_user_range(struct vm_area_struct *vma, | ||
21 | struct page *page, unsigned long addr, | ||
22 | int len); | ||
23 | |||
24 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) | ||
25 | |||
26 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | ||
27 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | ||
28 | |||
29 | #define flush_cache_vmap(start, end) flush_cache_all() | ||
30 | #define flush_cache_vunmap(start, end) flush_cache_all() | ||
31 | |||
32 | #define flush_icache_page(vma, page) do { } while (0) | ||
33 | |||
34 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | ||
35 | do { \ | ||
36 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ | ||
37 | memcpy(dst, src, len); \ | ||
38 | flush_icache_user_range(vma, page, vaddr, len); \ | ||
39 | } while (0) | ||
40 | |||
41 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | ||
42 | do { \ | ||
43 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ | ||
44 | memcpy(dst, src, len); \ | ||
45 | } while (0) | ||
46 | |||
47 | #endif /* __ASSEMBLY__ */ | ||
48 | |||
49 | #endif /* __ASM_SH64_CACHEFLUSH_H */ | ||
50 | |||
diff --git a/include/asm-sh64/cayman.h b/include/asm-sh64/cayman.h deleted file mode 100644 index 7b6b96844842..000000000000 --- a/include/asm-sh64/cayman.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * include/asm-sh64/cayman.h | ||
7 | * | ||
8 | * Cayman definitions | ||
9 | * | ||
10 | * Global defintions for the SH5 Cayman board | ||
11 | * | ||
12 | * Copyright (C) 2002 Stuart Menefy | ||
13 | */ | ||
14 | |||
15 | |||
16 | /* Setup for the SMSC FDC37C935 / LAN91C100FD */ | ||
17 | #define SMSC_IRQ IRQ_IRL1 | ||
18 | |||
19 | /* Setup for PCI Bus 2, which transmits interrupts via the EPLD */ | ||
20 | #define PCI2_IRQ IRQ_IRL3 | ||
diff --git a/include/asm-sh64/checksum.h b/include/asm-sh64/checksum.h deleted file mode 100644 index ba594ccb42e5..000000000000 --- a/include/asm-sh64/checksum.h +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_CHECKSUM_H | ||
2 | #define __ASM_SH64_CHECKSUM_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/checksum.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <asm/registers.h> | ||
16 | |||
17 | /* | ||
18 | * computes the checksum of a memory block at buff, length len, | ||
19 | * and adds in "sum" (32-bit) | ||
20 | * | ||
21 | * returns a 32-bit number suitable for feeding into itself | ||
22 | * or csum_tcpudp_magic | ||
23 | * | ||
24 | * this function must be called with even lengths, except | ||
25 | * for the last fragment, which may be odd | ||
26 | * | ||
27 | * it's best to have buff aligned on a 32-bit boundary | ||
28 | */ | ||
29 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); | ||
30 | |||
31 | /* | ||
32 | * Note: when you get a NULL pointer exception here this means someone | ||
33 | * passed in an incorrect kernel address to one of these functions. | ||
34 | * | ||
35 | * If you use these functions directly please don't forget the | ||
36 | * access_ok(). | ||
37 | */ | ||
38 | |||
39 | |||
40 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, | ||
41 | __wsum sum); | ||
42 | |||
43 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, | ||
44 | int len, __wsum sum, int *err_ptr); | ||
45 | |||
46 | static inline __sum16 csum_fold(__wsum csum) | ||
47 | { | ||
48 | u32 sum = (__force u32)csum; | ||
49 | sum = (sum & 0xffff) + (sum >> 16); | ||
50 | sum = (sum & 0xffff) + (sum >> 16); | ||
51 | return (__force __sum16)~sum; | ||
52 | } | ||
53 | |||
54 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); | ||
55 | |||
56 | __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, | ||
57 | unsigned short len, unsigned short proto, | ||
58 | __wsum sum); | ||
59 | |||
60 | /* | ||
61 | * computes the checksum of the TCP/UDP pseudo-header | ||
62 | * returns a 16-bit checksum, already complemented | ||
63 | */ | ||
64 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, | ||
65 | unsigned short len, | ||
66 | unsigned short proto, | ||
67 | __wsum sum) | ||
68 | { | ||
69 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * this routine is used for miscellaneous IP-like checksums, mainly | ||
74 | * in icmp.c | ||
75 | */ | ||
76 | static inline __sum16 ip_compute_csum(const void *buff, int len) | ||
77 | { | ||
78 | return csum_fold(csum_partial(buff, len, 0)); | ||
79 | } | ||
80 | |||
81 | #endif /* __ASM_SH64_CHECKSUM_H */ | ||
82 | |||
diff --git a/include/asm-sh64/cpumask.h b/include/asm-sh64/cpumask.h deleted file mode 100644 index b7b105dbedaf..000000000000 --- a/include/asm-sh64/cpumask.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_CPUMASK_H | ||
2 | #define __ASM_SH64_CPUMASK_H | ||
3 | |||
4 | #include <asm-generic/cpumask.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_CPUMASK_H */ | ||
diff --git a/include/asm-sh64/cputime.h b/include/asm-sh64/cputime.h deleted file mode 100644 index 0fd89da2aa86..000000000000 --- a/include/asm-sh64/cputime.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __SH64_CPUTIME_H | ||
2 | #define __SH64_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* __SH64_CPUTIME_H */ | ||
diff --git a/include/asm-sh64/current.h b/include/asm-sh64/current.h deleted file mode 100644 index 261224339d6f..000000000000 --- a/include/asm-sh64/current.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_CURRENT_H | ||
2 | #define __ASM_SH64_CURRENT_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/current.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/thread_info.h> | ||
17 | |||
18 | struct task_struct; | ||
19 | |||
20 | static __inline__ struct task_struct * get_current(void) | ||
21 | { | ||
22 | return current_thread_info()->task; | ||
23 | } | ||
24 | |||
25 | #define current get_current() | ||
26 | |||
27 | #endif /* __ASM_SH64_CURRENT_H */ | ||
28 | |||
diff --git a/include/asm-sh64/delay.h b/include/asm-sh64/delay.h deleted file mode 100644 index 6ae31301a16a..000000000000 --- a/include/asm-sh64/delay.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_DELAY_H | ||
2 | #define __ASM_SH64_DELAY_H | ||
3 | |||
4 | extern void __delay(int loops); | ||
5 | extern void __udelay(unsigned long long usecs, unsigned long lpj); | ||
6 | extern void __ndelay(unsigned long long nsecs, unsigned long lpj); | ||
7 | extern void udelay(unsigned long usecs); | ||
8 | extern void ndelay(unsigned long nsecs); | ||
9 | |||
10 | #endif /* __ASM_SH64_DELAY_H */ | ||
11 | |||
diff --git a/include/asm-sh64/device.h b/include/asm-sh64/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/include/asm-sh64/device.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sh64/div64.h b/include/asm-sh64/div64.h deleted file mode 100644 index f75869565e2e..000000000000 --- a/include/asm-sh64/div64.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_DIV64_H | ||
2 | #define __ASM_SH64_DIV64_H | ||
3 | |||
4 | #include <asm-generic/div64.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_DIV64_H */ | ||
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h deleted file mode 100644 index 18f8dd642ac5..000000000000 --- a/include/asm-sh64/dma-mapping.h +++ /dev/null | |||
@@ -1,194 +0,0 @@ | |||
1 | #ifndef __ASM_SH_DMA_MAPPING_H | ||
2 | #define __ASM_SH_DMA_MAPPING_H | ||
3 | |||
4 | #include <linux/mm.h> | ||
5 | #include <linux/scatterlist.h> | ||
6 | #include <asm/io.h> | ||
7 | |||
8 | struct pci_dev; | ||
9 | extern void *consistent_alloc(struct pci_dev *hwdev, size_t size, | ||
10 | dma_addr_t *dma_handle); | ||
11 | extern void consistent_free(struct pci_dev *hwdev, size_t size, | ||
12 | void *vaddr, dma_addr_t dma_handle); | ||
13 | |||
14 | #define dma_supported(dev, mask) (1) | ||
15 | |||
16 | static inline int dma_set_mask(struct device *dev, u64 mask) | ||
17 | { | ||
18 | if (!dev->dma_mask || !dma_supported(dev, mask)) | ||
19 | return -EIO; | ||
20 | |||
21 | *dev->dma_mask = mask; | ||
22 | |||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | ||
27 | dma_addr_t *dma_handle, gfp_t flag) | ||
28 | { | ||
29 | return consistent_alloc(NULL, size, dma_handle); | ||
30 | } | ||
31 | |||
32 | static inline void dma_free_coherent(struct device *dev, size_t size, | ||
33 | void *vaddr, dma_addr_t dma_handle) | ||
34 | { | ||
35 | consistent_free(NULL, size, vaddr, dma_handle); | ||
36 | } | ||
37 | |||
38 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
39 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
40 | #define dma_is_consistent(d, h) (1) | ||
41 | |||
42 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
43 | enum dma_data_direction dir) | ||
44 | { | ||
45 | unsigned long start = (unsigned long) vaddr; | ||
46 | unsigned long s = start & L1_CACHE_ALIGN_MASK; | ||
47 | unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; | ||
48 | |||
49 | for (; s <= e; s += L1_CACHE_BYTES) | ||
50 | asm volatile ("ocbp %0, 0" : : "r" (s)); | ||
51 | } | ||
52 | |||
53 | static inline dma_addr_t dma_map_single(struct device *dev, | ||
54 | void *ptr, size_t size, | ||
55 | enum dma_data_direction dir) | ||
56 | { | ||
57 | #if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) | ||
58 | if (dev->bus == &pci_bus_type) | ||
59 | return virt_to_phys(ptr); | ||
60 | #endif | ||
61 | dma_cache_sync(dev, ptr, size, dir); | ||
62 | |||
63 | return virt_to_phys(ptr); | ||
64 | } | ||
65 | |||
66 | #define dma_unmap_single(dev, addr, size, dir) do { } while (0) | ||
67 | |||
68 | static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | ||
69 | int nents, enum dma_data_direction dir) | ||
70 | { | ||
71 | int i; | ||
72 | |||
73 | for (i = 0; i < nents; i++) { | ||
74 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | ||
75 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); | ||
76 | #endif | ||
77 | sg[i].dma_address = sg_phys(&sg[i]); | ||
78 | } | ||
79 | |||
80 | return nents; | ||
81 | } | ||
82 | |||
83 | #define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) | ||
84 | |||
85 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | ||
86 | unsigned long offset, size_t size, | ||
87 | enum dma_data_direction dir) | ||
88 | { | ||
89 | return dma_map_single(dev, page_address(page) + offset, size, dir); | ||
90 | } | ||
91 | |||
92 | static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address, | ||
93 | size_t size, enum dma_data_direction dir) | ||
94 | { | ||
95 | dma_unmap_single(dev, dma_address, size, dir); | ||
96 | } | ||
97 | |||
98 | static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle, | ||
99 | size_t size, enum dma_data_direction dir) | ||
100 | { | ||
101 | #if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) | ||
102 | if (dev->bus == &pci_bus_type) | ||
103 | return; | ||
104 | #endif | ||
105 | dma_cache_sync(dev, phys_to_virt(dma_handle), size, dir); | ||
106 | } | ||
107 | |||
108 | static inline void dma_sync_single_range(struct device *dev, | ||
109 | dma_addr_t dma_handle, | ||
110 | unsigned long offset, size_t size, | ||
111 | enum dma_data_direction dir) | ||
112 | { | ||
113 | #if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) | ||
114 | if (dev->bus == &pci_bus_type) | ||
115 | return; | ||
116 | #endif | ||
117 | dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir); | ||
118 | } | ||
119 | |||
120 | static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | ||
121 | int nelems, enum dma_data_direction dir) | ||
122 | { | ||
123 | int i; | ||
124 | |||
125 | for (i = 0; i < nelems; i++) { | ||
126 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | ||
127 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); | ||
128 | #endif | ||
129 | sg[i].dma_address = sg_phys(&sg[i]); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | static inline void dma_sync_single_for_cpu(struct device *dev, | ||
134 | dma_addr_t dma_handle, size_t size, | ||
135 | enum dma_data_direction dir) | ||
136 | { | ||
137 | dma_sync_single(dev, dma_handle, size, dir); | ||
138 | } | ||
139 | |||
140 | static inline void dma_sync_single_for_device(struct device *dev, | ||
141 | dma_addr_t dma_handle, size_t size, | ||
142 | enum dma_data_direction dir) | ||
143 | { | ||
144 | dma_sync_single(dev, dma_handle, size, dir); | ||
145 | } | ||
146 | |||
147 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
148 | dma_addr_t dma_handle, | ||
149 | unsigned long offset, | ||
150 | size_t size, | ||
151 | enum dma_data_direction direction) | ||
152 | { | ||
153 | dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction); | ||
154 | } | ||
155 | |||
156 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
157 | dma_addr_t dma_handle, | ||
158 | unsigned long offset, | ||
159 | size_t size, | ||
160 | enum dma_data_direction direction) | ||
161 | { | ||
162 | dma_sync_single_for_device(dev, dma_handle+offset, size, direction); | ||
163 | } | ||
164 | |||
165 | static inline void dma_sync_sg_for_cpu(struct device *dev, | ||
166 | struct scatterlist *sg, int nelems, | ||
167 | enum dma_data_direction dir) | ||
168 | { | ||
169 | dma_sync_sg(dev, sg, nelems, dir); | ||
170 | } | ||
171 | |||
172 | static inline void dma_sync_sg_for_device(struct device *dev, | ||
173 | struct scatterlist *sg, int nelems, | ||
174 | enum dma_data_direction dir) | ||
175 | { | ||
176 | dma_sync_sg(dev, sg, nelems, dir); | ||
177 | } | ||
178 | |||
179 | static inline int dma_get_cache_alignment(void) | ||
180 | { | ||
181 | /* | ||
182 | * Each processor family will define its own L1_CACHE_SHIFT, | ||
183 | * L1_CACHE_BYTES wraps to this, so this is always safe. | ||
184 | */ | ||
185 | return L1_CACHE_BYTES; | ||
186 | } | ||
187 | |||
188 | static inline int dma_mapping_error(dma_addr_t dma_addr) | ||
189 | { | ||
190 | return dma_addr == 0; | ||
191 | } | ||
192 | |||
193 | #endif /* __ASM_SH_DMA_MAPPING_H */ | ||
194 | |||
diff --git a/include/asm-sh64/dma.h b/include/asm-sh64/dma.h deleted file mode 100644 index e701f39470a2..000000000000 --- a/include/asm-sh64/dma.h +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_DMA_H | ||
2 | #define __ASM_SH64_DMA_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/dma.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/mm.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <asm/pgtable.h> | ||
19 | |||
20 | #define MAX_DMA_CHANNELS 4 | ||
21 | |||
22 | /* | ||
23 | * SH5 can DMA in any memory area. | ||
24 | * | ||
25 | * The static definition is dodgy because it should limit | ||
26 | * the highest DMA-able address based on the actual | ||
27 | * Physical memory available. This is actually performed | ||
28 | * at run time in defining the memory allowed to DMA_ZONE. | ||
29 | */ | ||
30 | #define MAX_DMA_ADDRESS ~(NPHYS_MASK) | ||
31 | |||
32 | #define DMA_MODE_READ 0 | ||
33 | #define DMA_MODE_WRITE 1 | ||
34 | |||
35 | #ifdef CONFIG_PCI | ||
36 | extern int isa_dma_bridge_buggy; | ||
37 | #else | ||
38 | #define isa_dma_bridge_buggy (0) | ||
39 | #endif | ||
40 | |||
41 | #endif /* __ASM_SH64_DMA_H */ | ||
diff --git a/include/asm-sh64/elf.h b/include/asm-sh64/elf.h deleted file mode 100644 index f994286e1998..000000000000 --- a/include/asm-sh64/elf.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_ELF_H | ||
2 | #define __ASM_SH64_ELF_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/elf.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * ELF register definitions.. | ||
17 | */ | ||
18 | |||
19 | #include <asm/ptrace.h> | ||
20 | #include <asm/user.h> | ||
21 | #include <asm/byteorder.h> | ||
22 | |||
23 | typedef unsigned long elf_greg_t; | ||
24 | |||
25 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) | ||
26 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
27 | |||
28 | typedef struct user_fpu_struct elf_fpregset_t; | ||
29 | |||
30 | /* | ||
31 | * This is used to ensure we don't load something for the wrong architecture. | ||
32 | */ | ||
33 | #define elf_check_arch(x) ( (x)->e_machine == EM_SH ) | ||
34 | |||
35 | /* | ||
36 | * These are used to set parameters in the core dumps. | ||
37 | */ | ||
38 | #define ELF_CLASS ELFCLASS32 | ||
39 | #ifdef __LITTLE_ENDIAN__ | ||
40 | #define ELF_DATA ELFDATA2LSB | ||
41 | #else | ||
42 | #define ELF_DATA ELFDATA2MSB | ||
43 | #endif | ||
44 | #define ELF_ARCH EM_SH | ||
45 | |||
46 | #define USE_ELF_CORE_DUMP | ||
47 | #define ELF_EXEC_PAGESIZE 4096 | ||
48 | |||
49 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | ||
50 | use of this is to invoke "./ld.so someprog" to test out a new version of | ||
51 | the loader. We need to make sure that it is out of the way of the program | ||
52 | that it will "exec", and that there is sufficient room for the brk. */ | ||
53 | |||
54 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) | ||
55 | |||
56 | #define R_SH_DIR32 1 | ||
57 | #define R_SH_REL32 2 | ||
58 | #define R_SH_IMM_LOW16 246 | ||
59 | #define R_SH_IMM_LOW16_PCREL 247 | ||
60 | #define R_SH_IMM_MEDLOW16 248 | ||
61 | #define R_SH_IMM_MEDLOW16_PCREL 249 | ||
62 | |||
63 | #define ELF_CORE_COPY_REGS(_dest,_regs) \ | ||
64 | memcpy((char *) &_dest, (char *) _regs, \ | ||
65 | sizeof(struct pt_regs)); | ||
66 | |||
67 | /* This yields a mask that user programs can use to figure out what | ||
68 | instruction set this CPU supports. This could be done in user space, | ||
69 | but it's not easy, and we've already done it here. */ | ||
70 | |||
71 | #define ELF_HWCAP (0) | ||
72 | |||
73 | /* This yields a string that ld.so will use to load implementation | ||
74 | specific libraries for optimization. This is more specific in | ||
75 | intent than poking at uname or /proc/cpuinfo. | ||
76 | |||
77 | For the moment, we have only optimizations for the Intel generations, | ||
78 | but that could change... */ | ||
79 | |||
80 | #define ELF_PLATFORM (NULL) | ||
81 | |||
82 | #define ELF_PLAT_INIT(_r, load_addr) \ | ||
83 | do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \ | ||
84 | _r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \ | ||
85 | _r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \ | ||
86 | _r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; _r->regs[15]=0; \ | ||
87 | _r->regs[16]=0; _r->regs[17]=0; _r->regs[18]=0; _r->regs[19]=0; \ | ||
88 | _r->regs[20]=0; _r->regs[21]=0; _r->regs[22]=0; _r->regs[23]=0; \ | ||
89 | _r->regs[24]=0; _r->regs[25]=0; _r->regs[26]=0; _r->regs[27]=0; \ | ||
90 | _r->regs[28]=0; _r->regs[29]=0; _r->regs[30]=0; _r->regs[31]=0; \ | ||
91 | _r->regs[32]=0; _r->regs[33]=0; _r->regs[34]=0; _r->regs[35]=0; \ | ||
92 | _r->regs[36]=0; _r->regs[37]=0; _r->regs[38]=0; _r->regs[39]=0; \ | ||
93 | _r->regs[40]=0; _r->regs[41]=0; _r->regs[42]=0; _r->regs[43]=0; \ | ||
94 | _r->regs[44]=0; _r->regs[45]=0; _r->regs[46]=0; _r->regs[47]=0; \ | ||
95 | _r->regs[48]=0; _r->regs[49]=0; _r->regs[50]=0; _r->regs[51]=0; \ | ||
96 | _r->regs[52]=0; _r->regs[53]=0; _r->regs[54]=0; _r->regs[55]=0; \ | ||
97 | _r->regs[56]=0; _r->regs[57]=0; _r->regs[58]=0; _r->regs[59]=0; \ | ||
98 | _r->regs[60]=0; _r->regs[61]=0; _r->regs[62]=0; \ | ||
99 | _r->tregs[0]=0; _r->tregs[1]=0; _r->tregs[2]=0; _r->tregs[3]=0; \ | ||
100 | _r->tregs[4]=0; _r->tregs[5]=0; _r->tregs[6]=0; _r->tregs[7]=0; \ | ||
101 | _r->sr = SR_FD | SR_MMU; } while (0) | ||
102 | |||
103 | #ifdef __KERNEL__ | ||
104 | #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) | ||
105 | #endif | ||
106 | |||
107 | #endif /* __ASM_SH64_ELF_H */ | ||
diff --git a/include/asm-sh64/emergency-restart.h b/include/asm-sh64/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/include/asm-sh64/emergency-restart.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-sh64/errno.h b/include/asm-sh64/errno.h deleted file mode 100644 index 57b46d4bdd41..000000000000 --- a/include/asm-sh64/errno.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_ERRNO_H | ||
2 | #define __ASM_SH64_ERRNO_H | ||
3 | |||
4 | #include <asm-generic/errno.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_ERRNO_H */ | ||
diff --git a/include/asm-sh64/fb.h b/include/asm-sh64/fb.h deleted file mode 100644 index d92e99cd8c8a..000000000000 --- a/include/asm-sh64/fb.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef _ASM_FB_H_ | ||
2 | #define _ASM_FB_H_ | ||
3 | |||
4 | #include <linux/fb.h> | ||
5 | #include <linux/fs.h> | ||
6 | #include <asm/page.h> | ||
7 | |||
8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
9 | unsigned long off) | ||
10 | { | ||
11 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
12 | } | ||
13 | |||
14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-sh64/fcntl.h b/include/asm-sh64/fcntl.h deleted file mode 100644 index 744dd79b9d5d..000000000000 --- a/include/asm-sh64/fcntl.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-sh/fcntl.h> | ||
diff --git a/include/asm-sh64/futex.h b/include/asm-sh64/futex.h deleted file mode 100644 index 6a332a9f099c..000000000000 --- a/include/asm-sh64/futex.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_FUTEX_H | ||
2 | #define _ASM_FUTEX_H | ||
3 | |||
4 | #include <asm-generic/futex.h> | ||
5 | |||
6 | #endif | ||
diff --git a/include/asm-sh64/gpio.h b/include/asm-sh64/gpio.h deleted file mode 100644 index 6bc5a13d8415..000000000000 --- a/include/asm-sh64/gpio.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_GPIO_H | ||
2 | #define __ASM_SH64_GPIO_H | ||
3 | |||
4 | /* | ||
5 | * This is just a stub, so that every arch using sh-sci has a gpio.h | ||
6 | */ | ||
7 | |||
8 | #endif /* __ASM_SH64_GPIO_H */ | ||
diff --git a/include/asm-sh64/hardirq.h b/include/asm-sh64/hardirq.h deleted file mode 100644 index 555fd7a35108..000000000000 --- a/include/asm-sh64/hardirq.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_HARDIRQ_H | ||
2 | #define __ASM_SH64_HARDIRQ_H | ||
3 | |||
4 | #include <linux/threads.h> | ||
5 | #include <linux/irq.h> | ||
6 | |||
7 | /* entry.S is sensitive to the offsets of these fields */ | ||
8 | typedef struct { | ||
9 | unsigned int __softirq_pending; | ||
10 | } ____cacheline_aligned irq_cpustat_t; | ||
11 | |||
12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | ||
13 | |||
14 | /* arch/sh64/kernel/irq.c */ | ||
15 | extern void ack_bad_irq(unsigned int irq); | ||
16 | |||
17 | #endif /* __ASM_SH64_HARDIRQ_H */ | ||
18 | |||
diff --git a/include/asm-sh64/hardware.h b/include/asm-sh64/hardware.h deleted file mode 100644 index 931c1ad80847..000000000000 --- a/include/asm-sh64/hardware.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_HARDWARE_H | ||
2 | #define __ASM_SH64_HARDWARE_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/hardware.h | ||
10 | * | ||
11 | * Copyright (C) 2002 Stuart Menefy | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | * Defitions of the locations of registers in the physical address space. | ||
15 | */ | ||
16 | |||
17 | #define PHYS_PERIPHERAL_BLOCK 0x09000000 | ||
18 | #define PHYS_DMAC_BLOCK 0x0e000000 | ||
19 | #define PHYS_PCI_BLOCK 0x60000000 | ||
20 | #define PHYS_EMI_BLOCK 0xff000000 | ||
21 | |||
22 | #endif /* __ASM_SH64_HARDWARE_H */ | ||
diff --git a/include/asm-sh64/hw_irq.h b/include/asm-sh64/hw_irq.h deleted file mode 100644 index ebb39089b0ac..000000000000 --- a/include/asm-sh64/hw_irq.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_HW_IRQ_H | ||
2 | #define __ASM_SH64_HW_IRQ_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/hw_irq.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #endif /* __ASM_SH64_HW_IRQ_H */ | ||
diff --git a/include/asm-sh64/ide.h b/include/asm-sh64/ide.h deleted file mode 100644 index b6e31e8b9410..000000000000 --- a/include/asm-sh64/ide.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-sh64/ide.h | ||
3 | * | ||
4 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
5 | * | ||
6 | * sh64 version by Richard Curnow & Paul Mundt | ||
7 | */ | ||
8 | |||
9 | /* | ||
10 | * This file contains the sh64 architecture specific IDE code. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_SH64_IDE_H | ||
14 | #define __ASM_SH64_IDE_H | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | |||
19 | /* Without this, the initialisation of PCI IDE cards end up calling | ||
20 | * ide_init_hwif_ports, which won't work. */ | ||
21 | #ifdef CONFIG_BLK_DEV_IDEPCI | ||
22 | #define ide_default_io_ctl(base) (0) | ||
23 | #endif | ||
24 | |||
25 | #include <asm-generic/ide_iops.h> | ||
26 | |||
27 | #endif /* __KERNEL__ */ | ||
28 | |||
29 | #endif /* __ASM_SH64_IDE_H */ | ||
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h deleted file mode 100644 index 7bd7314d38c2..000000000000 --- a/include/asm-sh64/io.h +++ /dev/null | |||
@@ -1,196 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_IO_H | ||
2 | #define __ASM_SH64_IO_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/io.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * Convention: | ||
18 | * read{b,w,l}/write{b,w,l} are for PCI, | ||
19 | * while in{b,w,l}/out{b,w,l} are for ISA | ||
20 | * These may (will) be platform specific function. | ||
21 | * | ||
22 | * In addition, we have | ||
23 | * ctrl_in{b,w,l}/ctrl_out{b,w,l} for SuperH specific I/O. | ||
24 | * which are processor specific. Address should be the result of | ||
25 | * onchip_remap(); | ||
26 | */ | ||
27 | |||
28 | #include <linux/compiler.h> | ||
29 | #include <asm/cache.h> | ||
30 | #include <asm/system.h> | ||
31 | #include <asm/page.h> | ||
32 | #include <asm-generic/iomap.h> | ||
33 | |||
34 | /* | ||
35 | * Nothing overly special here.. instead of doing the same thing | ||
36 | * over and over again, we just define a set of sh64_in/out functions | ||
37 | * with an implicit size. The traditional read{b,w,l}/write{b,w,l} | ||
38 | * mess is wrapped to this, as are the SH-specific ctrl_in/out routines. | ||
39 | */ | ||
40 | static inline unsigned char sh64_in8(const volatile void __iomem *addr) | ||
41 | { | ||
42 | return *(volatile unsigned char __force *)addr; | ||
43 | } | ||
44 | |||
45 | static inline unsigned short sh64_in16(const volatile void __iomem *addr) | ||
46 | { | ||
47 | return *(volatile unsigned short __force *)addr; | ||
48 | } | ||
49 | |||
50 | static inline unsigned int sh64_in32(const volatile void __iomem *addr) | ||
51 | { | ||
52 | return *(volatile unsigned int __force *)addr; | ||
53 | } | ||
54 | |||
55 | static inline unsigned long long sh64_in64(const volatile void __iomem *addr) | ||
56 | { | ||
57 | return *(volatile unsigned long long __force *)addr; | ||
58 | } | ||
59 | |||
60 | static inline void sh64_out8(unsigned char b, volatile void __iomem *addr) | ||
61 | { | ||
62 | *(volatile unsigned char __force *)addr = b; | ||
63 | wmb(); | ||
64 | } | ||
65 | |||
66 | static inline void sh64_out16(unsigned short b, volatile void __iomem *addr) | ||
67 | { | ||
68 | *(volatile unsigned short __force *)addr = b; | ||
69 | wmb(); | ||
70 | } | ||
71 | |||
72 | static inline void sh64_out32(unsigned int b, volatile void __iomem *addr) | ||
73 | { | ||
74 | *(volatile unsigned int __force *)addr = b; | ||
75 | wmb(); | ||
76 | } | ||
77 | |||
78 | static inline void sh64_out64(unsigned long long b, volatile void __iomem *addr) | ||
79 | { | ||
80 | *(volatile unsigned long long __force *)addr = b; | ||
81 | wmb(); | ||
82 | } | ||
83 | |||
84 | #define readb(addr) sh64_in8(addr) | ||
85 | #define readw(addr) sh64_in16(addr) | ||
86 | #define readl(addr) sh64_in32(addr) | ||
87 | #define readb_relaxed(addr) sh64_in8(addr) | ||
88 | #define readw_relaxed(addr) sh64_in16(addr) | ||
89 | #define readl_relaxed(addr) sh64_in32(addr) | ||
90 | |||
91 | #define writeb(b, addr) sh64_out8(b, addr) | ||
92 | #define writew(b, addr) sh64_out16(b, addr) | ||
93 | #define writel(b, addr) sh64_out32(b, addr) | ||
94 | |||
95 | #define ctrl_inb(addr) sh64_in8(ioport_map(addr, 1)) | ||
96 | #define ctrl_inw(addr) sh64_in16(ioport_map(addr, 2)) | ||
97 | #define ctrl_inl(addr) sh64_in32(ioport_map(addr, 4)) | ||
98 | |||
99 | #define ctrl_outb(b, addr) sh64_out8(b, ioport_map(addr, 1)) | ||
100 | #define ctrl_outw(b, addr) sh64_out16(b, ioport_map(addr, 2)) | ||
101 | #define ctrl_outl(b, addr) sh64_out32(b, ioport_map(addr, 4)) | ||
102 | |||
103 | #define ioread8(addr) sh64_in8(addr) | ||
104 | #define ioread16(addr) sh64_in16(addr) | ||
105 | #define ioread32(addr) sh64_in32(addr) | ||
106 | #define iowrite8(b, addr) sh64_out8(b, addr) | ||
107 | #define iowrite16(b, addr) sh64_out16(b, addr) | ||
108 | #define iowrite32(b, addr) sh64_out32(b, addr) | ||
109 | |||
110 | #define inb(addr) ctrl_inb(addr) | ||
111 | #define inw(addr) ctrl_inw(addr) | ||
112 | #define inl(addr) ctrl_inl(addr) | ||
113 | #define outb(b, addr) ctrl_outb(b, addr) | ||
114 | #define outw(b, addr) ctrl_outw(b, addr) | ||
115 | #define outl(b, addr) ctrl_outl(b, addr) | ||
116 | |||
117 | void outsw(unsigned long port, const void *addr, unsigned long count); | ||
118 | void insw(unsigned long port, void *addr, unsigned long count); | ||
119 | void outsl(unsigned long port, const void *addr, unsigned long count); | ||
120 | void insl(unsigned long port, void *addr, unsigned long count); | ||
121 | |||
122 | #define inb_p(addr) inb(addr) | ||
123 | #define inw_p(addr) inw(addr) | ||
124 | #define inl_p(addr) inl(addr) | ||
125 | #define outb_p(x,addr) outb(x,addr) | ||
126 | #define outw_p(x,addr) outw(x,addr) | ||
127 | #define outl_p(x,addr) outl(x,addr) | ||
128 | |||
129 | #define __raw_readb readb | ||
130 | #define __raw_readw readw | ||
131 | #define __raw_readl readl | ||
132 | #define __raw_writeb writeb | ||
133 | #define __raw_writew writew | ||
134 | #define __raw_writel writel | ||
135 | |||
136 | void memcpy_toio(void __iomem *to, const void *from, long count); | ||
137 | void memcpy_fromio(void *to, void __iomem *from, long count); | ||
138 | |||
139 | #define mmiowb() | ||
140 | |||
141 | #ifdef __KERNEL__ | ||
142 | |||
143 | #ifdef CONFIG_SH_CAYMAN | ||
144 | extern unsigned long smsc_superio_virt; | ||
145 | #endif | ||
146 | #ifdef CONFIG_PCI | ||
147 | extern unsigned long pciio_virt; | ||
148 | #endif | ||
149 | |||
150 | #define IO_SPACE_LIMIT 0xffffffff | ||
151 | |||
152 | /* | ||
153 | * Change virtual addresses to physical addresses and vv. | ||
154 | * These are trivial on the 1:1 Linux/SuperH mapping | ||
155 | */ | ||
156 | static inline unsigned long virt_to_phys(volatile void * address) | ||
157 | { | ||
158 | return __pa(address); | ||
159 | } | ||
160 | |||
161 | static inline void * phys_to_virt(unsigned long address) | ||
162 | { | ||
163 | return __va(address); | ||
164 | } | ||
165 | |||
166 | extern void * __ioremap(unsigned long phys_addr, unsigned long size, | ||
167 | unsigned long flags); | ||
168 | |||
169 | static inline void * ioremap(unsigned long phys_addr, unsigned long size) | ||
170 | { | ||
171 | return __ioremap(phys_addr, size, 1); | ||
172 | } | ||
173 | |||
174 | static inline void * ioremap_nocache (unsigned long phys_addr, unsigned long size) | ||
175 | { | ||
176 | return __ioremap(phys_addr, size, 0); | ||
177 | } | ||
178 | |||
179 | extern void iounmap(void *addr); | ||
180 | |||
181 | unsigned long onchip_remap(unsigned long addr, unsigned long size, const char* name); | ||
182 | extern void onchip_unmap(unsigned long vaddr); | ||
183 | |||
184 | /* | ||
185 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | ||
186 | * access | ||
187 | */ | ||
188 | #define xlate_dev_mem_ptr(p) __va(p) | ||
189 | |||
190 | /* | ||
191 | * Convert a virtual cached pointer to an uncached pointer | ||
192 | */ | ||
193 | #define xlate_dev_kmem_ptr(p) p | ||
194 | |||
195 | #endif /* __KERNEL__ */ | ||
196 | #endif /* __ASM_SH64_IO_H */ | ||
diff --git a/include/asm-sh64/ioctl.h b/include/asm-sh64/ioctl.h deleted file mode 100644 index b279fe06dfe5..000000000000 --- a/include/asm-sh64/ioctl.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/ioctl.h> | ||
diff --git a/include/asm-sh64/ioctls.h b/include/asm-sh64/ioctls.h deleted file mode 100644 index 6b0c04f63c57..000000000000 --- a/include/asm-sh64/ioctls.h +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_IOCTLS_H | ||
2 | #define __ASM_SH64_IOCTLS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/ioctls.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2004 Richard Curnow | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <asm/ioctl.h> | ||
17 | |||
18 | #define FIOCLEX 0x6601 /* _IO('f', 1) */ | ||
19 | #define FIONCLEX 0x6602 /* _IO('f', 2) */ | ||
20 | #define FIOASYNC 0x4004667d /* _IOW('f', 125, int) */ | ||
21 | #define FIONBIO 0x4004667e /* _IOW('f', 126, int) */ | ||
22 | #define FIONREAD 0x8004667f /* _IOW('f', 127, int) */ | ||
23 | #define TIOCINQ FIONREAD | ||
24 | #define FIOQSIZE 0x80086680 /* _IOR('f', 128, loff_t) */ | ||
25 | |||
26 | #define TCGETS 0x5401 | ||
27 | #define TCSETS 0x5402 | ||
28 | #define TCSETSW 0x5403 | ||
29 | #define TCSETSF 0x5404 | ||
30 | |||
31 | #define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */ | ||
32 | #define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */ | ||
33 | #define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */ | ||
34 | #define TCSETAF 0x4012741c /* _IOW('t', 28, struct termio) */ | ||
35 | |||
36 | #define TCSBRK 0x741d /* _IO('t', 29) */ | ||
37 | #define TCXONC 0x741e /* _IO('t', 30) */ | ||
38 | #define TCFLSH 0x741f /* _IO('t', 31) */ | ||
39 | |||
40 | #define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */ | ||
41 | #define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */ | ||
42 | #define TIOCSTART 0x746e /* _IO('t', 110) start output, like ^Q */ | ||
43 | #define TIOCSTOP 0x746f /* _IO('t', 111) stop output, like ^S */ | ||
44 | #define TIOCOUTQ 0x80047473 /* _IOR('t', 115, int) output queue size */ | ||
45 | |||
46 | #define TIOCSPGRP 0x40047476 /* _IOW('t', 118, int) */ | ||
47 | #define TIOCGPGRP 0x80047477 /* _IOR('t', 119, int) */ | ||
48 | |||
49 | #define TIOCEXCL 0x540c /* _IO('T', 12) */ | ||
50 | #define TIOCNXCL 0x540d /* _IO('T', 13) */ | ||
51 | #define TIOCSCTTY 0x540e /* _IO('T', 14) */ | ||
52 | |||
53 | #define TIOCSTI 0x40015412 /* _IOW('T', 18, char) 0x5412 */ | ||
54 | #define TIOCMGET 0x80045415 /* _IOR('T', 21, unsigned int) 0x5415 */ | ||
55 | #define TIOCMBIS 0x40045416 /* _IOW('T', 22, unsigned int) 0x5416 */ | ||
56 | #define TIOCMBIC 0x40045417 /* _IOW('T', 23, unsigned int) 0x5417 */ | ||
57 | #define TIOCMSET 0x40045418 /* _IOW('T', 24, unsigned int) 0x5418 */ | ||
58 | |||
59 | #define TIOCM_LE 0x001 | ||
60 | #define TIOCM_DTR 0x002 | ||
61 | #define TIOCM_RTS 0x004 | ||
62 | #define TIOCM_ST 0x008 | ||
63 | #define TIOCM_SR 0x010 | ||
64 | #define TIOCM_CTS 0x020 | ||
65 | #define TIOCM_CAR 0x040 | ||
66 | #define TIOCM_RNG 0x080 | ||
67 | #define TIOCM_DSR 0x100 | ||
68 | #define TIOCM_CD TIOCM_CAR | ||
69 | #define TIOCM_RI TIOCM_RNG | ||
70 | |||
71 | #define TIOCGSOFTCAR 0x80045419 /* _IOR('T', 25, unsigned int) 0x5419 */ | ||
72 | #define TIOCSSOFTCAR 0x4004541a /* _IOW('T', 26, unsigned int) 0x541A */ | ||
73 | #define TIOCLINUX 0x4004541c /* _IOW('T', 28, char) 0x541C */ | ||
74 | #define TIOCCONS 0x541d /* _IO('T', 29) */ | ||
75 | #define TIOCGSERIAL 0x803c541e /* _IOR('T', 30, struct serial_struct) 0x541E */ | ||
76 | #define TIOCSSERIAL 0x403c541f /* _IOW('T', 31, struct serial_struct) 0x541F */ | ||
77 | #define TIOCPKT 0x40045420 /* _IOW('T', 32, int) 0x5420 */ | ||
78 | |||
79 | #define TIOCPKT_DATA 0 | ||
80 | #define TIOCPKT_FLUSHREAD 1 | ||
81 | #define TIOCPKT_FLUSHWRITE 2 | ||
82 | #define TIOCPKT_STOP 4 | ||
83 | #define TIOCPKT_START 8 | ||
84 | #define TIOCPKT_NOSTOP 16 | ||
85 | #define TIOCPKT_DOSTOP 32 | ||
86 | |||
87 | |||
88 | #define TIOCNOTTY 0x5422 /* _IO('T', 34) */ | ||
89 | #define TIOCSETD 0x40045423 /* _IOW('T', 35, int) 0x5423 */ | ||
90 | #define TIOCGETD 0x80045424 /* _IOR('T', 36, int) 0x5424 */ | ||
91 | #define TCSBRKP 0x40045424 /* _IOW('T', 37, int) 0x5425 */ /* Needed for POSIX tcsendbreak() */ | ||
92 | #define TIOCTTYGSTRUCT 0x8c105426 /* _IOR('T', 38, struct tty_struct) 0x5426 */ /* For debugging only */ | ||
93 | #define TIOCSBRK 0x5427 /* _IO('T', 39) */ /* BSD compatibility */ | ||
94 | #define TIOCCBRK 0x5428 /* _IO('T', 40) */ /* BSD compatibility */ | ||
95 | #define TIOCGSID 0x80045429 /* _IOR('T', 41, pid_t) 0x5429 */ /* Return the session ID of FD */ | ||
96 | #define TIOCGPTN 0x80045430 /* _IOR('T',0x30, unsigned int) 0x5430 Get Pty Number (of pty-mux device) */ | ||
97 | #define TIOCSPTLCK 0x40045431 /* _IOW('T',0x31, int) Lock/unlock Pty */ | ||
98 | |||
99 | #define TIOCSERCONFIG 0x5453 /* _IO('T', 83) */ | ||
100 | #define TIOCSERGWILD 0x80045454 /* _IOR('T', 84, int) 0x5454 */ | ||
101 | #define TIOCSERSWILD 0x40045455 /* _IOW('T', 85, int) 0x5455 */ | ||
102 | #define TIOCGLCKTRMIOS 0x5456 | ||
103 | #define TIOCSLCKTRMIOS 0x5457 | ||
104 | #define TIOCSERGSTRUCT 0x80d85458 /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */ | ||
105 | #define TIOCSERGETLSR 0x80045459 /* _IOR('T', 89, unsigned int) 0x5459 */ /* Get line status register */ | ||
106 | |||
107 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
108 | #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
109 | |||
110 | #define TIOCSERGETMULTI 0x80a8545a /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */ | ||
111 | #define TIOCSERSETMULTI 0x40a8545b /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */ | ||
112 | |||
113 | #define TIOCMIWAIT 0x545c /* _IO('T', 92) wait for a change on serial input line(s) */ | ||
114 | #define TIOCGICOUNT 0x545d /* read serial port inline interrupt counts */ | ||
115 | |||
116 | #endif /* __ASM_SH64_IOCTLS_H */ | ||
diff --git a/include/asm-sh64/ipcbuf.h b/include/asm-sh64/ipcbuf.h deleted file mode 100644 index c441e35299c0..000000000000 --- a/include/asm-sh64/ipcbuf.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_IPCBUF_H__ | ||
2 | #define __ASM_SH64_IPCBUF_H__ | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/ipcbuf.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * The ipc64_perm structure for i386 architecture. | ||
17 | * Note extra padding because this structure is passed back and forth | ||
18 | * between kernel and user space. | ||
19 | * | ||
20 | * Pad space is left for: | ||
21 | * - 32-bit mode_t and seq | ||
22 | * - 2 miscellaneous 32-bit values | ||
23 | */ | ||
24 | |||
25 | struct ipc64_perm | ||
26 | { | ||
27 | __kernel_key_t key; | ||
28 | __kernel_uid32_t uid; | ||
29 | __kernel_gid32_t gid; | ||
30 | __kernel_uid32_t cuid; | ||
31 | __kernel_gid32_t cgid; | ||
32 | __kernel_mode_t mode; | ||
33 | unsigned short __pad1; | ||
34 | unsigned short seq; | ||
35 | unsigned short __pad2; | ||
36 | unsigned long __unused1; | ||
37 | unsigned long __unused2; | ||
38 | }; | ||
39 | |||
40 | #endif /* __ASM_SH64_IPCBUF_H__ */ | ||
diff --git a/include/asm-sh64/irq.h b/include/asm-sh64/irq.h deleted file mode 100644 index 5c9e6a873aeb..000000000000 --- a/include/asm-sh64/irq.h +++ /dev/null | |||
@@ -1,144 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_IRQ_H | ||
2 | #define __ASM_SH64_IRQ_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/irq.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | |||
16 | /* | ||
17 | * Encoded IRQs are not considered worth to be supported. | ||
18 | * Main reason is that there's no per-encoded-interrupt | ||
19 | * enable/disable mechanism (as there was in SH3/4). | ||
20 | * An all enabled/all disabled is worth only if there's | ||
21 | * a cascaded IC to disable/enable/ack on. Until such | ||
22 | * IC is available there's no such support. | ||
23 | * | ||
24 | * Presumably Encoded IRQs may use extra IRQs beyond 64, | ||
25 | * below. Some logic must be added to cope with IRQ_IRL? | ||
26 | * in an exclusive way. | ||
27 | * | ||
28 | * Priorities are set at Platform level, when IRQ_IRL0-3 | ||
29 | * are set to 0 Encoding is allowed. Otherwise it's not | ||
30 | * allowed. | ||
31 | */ | ||
32 | |||
33 | /* Independent IRQs */ | ||
34 | #define IRQ_IRL0 0 | ||
35 | #define IRQ_IRL1 1 | ||
36 | #define IRQ_IRL2 2 | ||
37 | #define IRQ_IRL3 3 | ||
38 | |||
39 | #define IRQ_INTA 4 | ||
40 | #define IRQ_INTB 5 | ||
41 | #define IRQ_INTC 6 | ||
42 | #define IRQ_INTD 7 | ||
43 | |||
44 | #define IRQ_SERR 12 | ||
45 | #define IRQ_ERR 13 | ||
46 | #define IRQ_PWR3 14 | ||
47 | #define IRQ_PWR2 15 | ||
48 | #define IRQ_PWR1 16 | ||
49 | #define IRQ_PWR0 17 | ||
50 | |||
51 | #define IRQ_DMTE0 18 | ||
52 | #define IRQ_DMTE1 19 | ||
53 | #define IRQ_DMTE2 20 | ||
54 | #define IRQ_DMTE3 21 | ||
55 | #define IRQ_DAERR 22 | ||
56 | |||
57 | #define IRQ_TUNI0 32 | ||
58 | #define IRQ_TUNI1 33 | ||
59 | #define IRQ_TUNI2 34 | ||
60 | #define IRQ_TICPI2 35 | ||
61 | |||
62 | #define IRQ_ATI 36 | ||
63 | #define IRQ_PRI 37 | ||
64 | #define IRQ_CUI 38 | ||
65 | |||
66 | #define IRQ_ERI 39 | ||
67 | #define IRQ_RXI 40 | ||
68 | #define IRQ_BRI 41 | ||
69 | #define IRQ_TXI 42 | ||
70 | |||
71 | #define IRQ_ITI 63 | ||
72 | |||
73 | #define NR_INTC_IRQS 64 | ||
74 | |||
75 | #ifdef CONFIG_SH_CAYMAN | ||
76 | #define NR_EXT_IRQS 32 | ||
77 | #define START_EXT_IRQS 64 | ||
78 | |||
79 | /* PCI bus 2 uses encoded external interrupts on the Cayman board */ | ||
80 | #define IRQ_P2INTA (START_EXT_IRQS + (3*8) + 0) | ||
81 | #define IRQ_P2INTB (START_EXT_IRQS + (3*8) + 1) | ||
82 | #define IRQ_P2INTC (START_EXT_IRQS + (3*8) + 2) | ||
83 | #define IRQ_P2INTD (START_EXT_IRQS + (3*8) + 3) | ||
84 | |||
85 | #define I8042_KBD_IRQ (START_EXT_IRQS + 2) | ||
86 | #define I8042_AUX_IRQ (START_EXT_IRQS + 6) | ||
87 | |||
88 | #define IRQ_CFCARD (START_EXT_IRQS + 7) | ||
89 | #define IRQ_PCMCIA (0) | ||
90 | |||
91 | #else | ||
92 | #define NR_EXT_IRQS 0 | ||
93 | #endif | ||
94 | |||
95 | #define NR_IRQS (NR_INTC_IRQS+NR_EXT_IRQS) | ||
96 | |||
97 | |||
98 | /* Default IRQs, fixed */ | ||
99 | #define TIMER_IRQ IRQ_TUNI0 | ||
100 | #define RTC_IRQ IRQ_CUI | ||
101 | |||
102 | /* Default Priorities, Platform may choose differently */ | ||
103 | #define NO_PRIORITY 0 /* Disabled */ | ||
104 | #define TIMER_PRIORITY 2 | ||
105 | #define RTC_PRIORITY TIMER_PRIORITY | ||
106 | #define SCIF_PRIORITY 3 | ||
107 | #define INTD_PRIORITY 3 | ||
108 | #define IRL3_PRIORITY 4 | ||
109 | #define INTC_PRIORITY 6 | ||
110 | #define IRL2_PRIORITY 7 | ||
111 | #define INTB_PRIORITY 9 | ||
112 | #define IRL1_PRIORITY 10 | ||
113 | #define INTA_PRIORITY 12 | ||
114 | #define IRL0_PRIORITY 13 | ||
115 | #define TOP_PRIORITY 15 | ||
116 | |||
117 | extern int intc_evt_to_irq[(0xE20/0x20)+1]; | ||
118 | int intc_irq_describe(char* p, int irq); | ||
119 | |||
120 | #define irq_canonicalize(irq) (irq) | ||
121 | |||
122 | #ifdef CONFIG_SH_CAYMAN | ||
123 | int cayman_irq_demux(int evt); | ||
124 | int cayman_irq_describe(char* p, int irq); | ||
125 | #define irq_demux(x) cayman_irq_demux(x) | ||
126 | #define irq_describe(p, x) cayman_irq_describe(p, x) | ||
127 | #else | ||
128 | #define irq_demux(x) (intc_evt_to_irq[x]) | ||
129 | #define irq_describe(p, x) intc_irq_describe(p, x) | ||
130 | #endif | ||
131 | |||
132 | /* | ||
133 | * Function for "on chip support modules". | ||
134 | */ | ||
135 | |||
136 | /* | ||
137 | * SH-5 supports Priority based interrupts only. | ||
138 | * Interrupt priorities are defined at platform level. | ||
139 | */ | ||
140 | #define set_ipr_data(a, b, c, d) | ||
141 | #define make_ipr_irq(a) | ||
142 | #define make_imask_irq(a) | ||
143 | |||
144 | #endif /* __ASM_SH64_IRQ_H */ | ||
diff --git a/include/asm-sh64/irq_regs.h b/include/asm-sh64/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/include/asm-sh64/irq_regs.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/include/asm-sh64/kdebug.h b/include/asm-sh64/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/include/asm-sh64/kdebug.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kdebug.h> | ||
diff --git a/include/asm-sh64/keyboard.h b/include/asm-sh64/keyboard.h deleted file mode 100644 index 0b01c3beb2f8..000000000000 --- a/include/asm-sh64/keyboard.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-shmedia/keyboard.h | ||
3 | * | ||
4 | * Copied from i386 version: | ||
5 | * Created 3 Nov 1996 by Geert Uytterhoeven | ||
6 | */ | ||
7 | |||
8 | /* | ||
9 | * This file contains the i386 architecture specific keyboard definitions | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_SH64_KEYBOARD_H | ||
13 | #define __ASM_SH64_KEYBOARD_H | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/ioport.h> | ||
19 | #include <asm/io.h> | ||
20 | |||
21 | #ifdef CONFIG_SH_CAYMAN | ||
22 | #define KEYBOARD_IRQ (START_EXT_IRQS + 2) /* SMSC SuperIO IRQ 1 */ | ||
23 | #endif | ||
24 | #define DISABLE_KBD_DURING_INTERRUPTS 0 | ||
25 | |||
26 | extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode); | ||
27 | extern int pckbd_getkeycode(unsigned int scancode); | ||
28 | extern int pckbd_translate(unsigned char scancode, unsigned char *keycode, | ||
29 | char raw_mode); | ||
30 | extern char pckbd_unexpected_up(unsigned char keycode); | ||
31 | extern void pckbd_leds(unsigned char leds); | ||
32 | extern void pckbd_init_hw(void); | ||
33 | |||
34 | #define kbd_setkeycode pckbd_setkeycode | ||
35 | #define kbd_getkeycode pckbd_getkeycode | ||
36 | #define kbd_translate pckbd_translate | ||
37 | #define kbd_unexpected_up pckbd_unexpected_up | ||
38 | #define kbd_leds pckbd_leds | ||
39 | #define kbd_init_hw pckbd_init_hw | ||
40 | |||
41 | /* resource allocation */ | ||
42 | #define kbd_request_region() | ||
43 | #define kbd_request_irq(handler) request_irq(KEYBOARD_IRQ, handler, 0, \ | ||
44 | "keyboard", NULL) | ||
45 | |||
46 | /* How to access the keyboard macros on this platform. */ | ||
47 | #define kbd_read_input() inb(KBD_DATA_REG) | ||
48 | #define kbd_read_status() inb(KBD_STATUS_REG) | ||
49 | #define kbd_write_output(val) outb(val, KBD_DATA_REG) | ||
50 | #define kbd_write_command(val) outb(val, KBD_CNTL_REG) | ||
51 | |||
52 | /* Some stoneage hardware needs delays after some operations. */ | ||
53 | #define kbd_pause() do { } while(0) | ||
54 | |||
55 | /* | ||
56 | * Machine specific bits for the PS/2 driver | ||
57 | */ | ||
58 | |||
59 | #ifdef CONFIG_SH_CAYMAN | ||
60 | #define AUX_IRQ (START_EXT_IRQS + 6) /* SMSC SuperIO IRQ12 */ | ||
61 | #endif | ||
62 | |||
63 | #define aux_request_irq(hand, dev_id) \ | ||
64 | request_irq(AUX_IRQ, hand, IRQF_SHARED, "PS2 Mouse", dev_id) | ||
65 | |||
66 | #define aux_free_irq(dev_id) free_irq(AUX_IRQ, dev_id) | ||
67 | |||
68 | #endif /* __KERNEL__ */ | ||
69 | #endif /* __ASM_SH64_KEYBOARD_H */ | ||
70 | |||
diff --git a/include/asm-sh64/kmap_types.h b/include/asm-sh64/kmap_types.h deleted file mode 100644 index 2ae7c7587919..000000000000 --- a/include/asm-sh64/kmap_types.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_KMAP_TYPES_H | ||
2 | #define __ASM_SH64_KMAP_TYPES_H | ||
3 | |||
4 | #include <asm-sh/kmap_types.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_KMAP_TYPES_H */ | ||
7 | |||
diff --git a/include/asm-sh64/linkage.h b/include/asm-sh64/linkage.h deleted file mode 100644 index 1dd0e84a228d..000000000000 --- a/include/asm-sh64/linkage.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_LINKAGE_H | ||
2 | #define __ASM_SH64_LINKAGE_H | ||
3 | |||
4 | #include <asm-sh/linkage.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_LINKAGE_H */ | ||
7 | |||
diff --git a/include/asm-sh64/local.h b/include/asm-sh64/local.h deleted file mode 100644 index d9bd95dd36e2..000000000000 --- a/include/asm-sh64/local.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_LOCAL_H | ||
2 | #define __ASM_SH64_LOCAL_H | ||
3 | |||
4 | #include <asm-generic/local.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_LOCAL_H */ | ||
7 | |||
diff --git a/include/asm-sh64/mc146818rtc.h b/include/asm-sh64/mc146818rtc.h deleted file mode 100644 index 6cd3aec68dbe..000000000000 --- a/include/asm-sh64/mc146818rtc.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-sh64/mc146818rtc.h | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | /* For now, an empty place-holder to get IDE to compile. */ | ||
7 | |||
diff --git a/include/asm-sh64/mman.h b/include/asm-sh64/mman.h deleted file mode 100644 index a9be6d885c3e..000000000000 --- a/include/asm-sh64/mman.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_MMAN_H | ||
2 | #define __ASM_SH64_MMAN_H | ||
3 | |||
4 | #include <asm-sh/mman.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_MMAN_H */ | ||
diff --git a/include/asm-sh64/mmu.h b/include/asm-sh64/mmu.h deleted file mode 100644 index ccd36d26615a..000000000000 --- a/include/asm-sh64/mmu.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __MMU_H | ||
2 | #define __MMU_H | ||
3 | |||
4 | /* Default "unsigned long" context */ | ||
5 | typedef unsigned long mm_context_t; | ||
6 | |||
7 | #endif | ||
diff --git a/include/asm-sh64/mmu_context.h b/include/asm-sh64/mmu_context.h deleted file mode 100644 index 507bf72bb8e1..000000000000 --- a/include/asm-sh64/mmu_context.h +++ /dev/null | |||
@@ -1,208 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_MMU_CONTEXT_H | ||
2 | #define __ASM_SH64_MMU_CONTEXT_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/mmu_context.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | * ASID handling idea taken from MIPS implementation. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | |||
20 | /* | ||
21 | * Cache of MMU context last used. | ||
22 | * | ||
23 | * The MMU "context" consists of two things: | ||
24 | * (a) TLB cache version (or cycle, top 24 bits of mmu_context_cache) | ||
25 | * (b) ASID (Address Space IDentifier, bottom 8 bits of mmu_context_cache) | ||
26 | */ | ||
27 | extern unsigned long mmu_context_cache; | ||
28 | |||
29 | #include <asm/page.h> | ||
30 | #include <asm-generic/mm_hooks.h> | ||
31 | |||
32 | /* Current mm's pgd */ | ||
33 | extern pgd_t *mmu_pdtp_cache; | ||
34 | |||
35 | #define SR_ASID_MASK 0xffffffffff00ffffULL | ||
36 | #define SR_ASID_SHIFT 16 | ||
37 | |||
38 | #define MMU_CONTEXT_ASID_MASK 0x000000ff | ||
39 | #define MMU_CONTEXT_VERSION_MASK 0xffffff00 | ||
40 | #define MMU_CONTEXT_FIRST_VERSION 0x00000100 | ||
41 | #define NO_CONTEXT 0 | ||
42 | |||
43 | /* ASID is 8-bit value, so it can't be 0x100 */ | ||
44 | #define MMU_NO_ASID 0x100 | ||
45 | |||
46 | |||
47 | /* | ||
48 | * Virtual Page Number mask | ||
49 | */ | ||
50 | #define MMU_VPN_MASK 0xfffff000 | ||
51 | |||
52 | static inline void | ||
53 | get_new_mmu_context(struct mm_struct *mm) | ||
54 | { | ||
55 | extern void flush_tlb_all(void); | ||
56 | extern void flush_cache_all(void); | ||
57 | |||
58 | unsigned long mc = ++mmu_context_cache; | ||
59 | |||
60 | if (!(mc & MMU_CONTEXT_ASID_MASK)) { | ||
61 | /* We exhaust ASID of this version. | ||
62 | Flush all TLB and start new cycle. */ | ||
63 | flush_tlb_all(); | ||
64 | /* We have to flush all caches as ASIDs are | ||
65 | used in cache */ | ||
66 | flush_cache_all(); | ||
67 | /* Fix version if needed. | ||
68 | Note that we avoid version #0/asid #0 to distingush NO_CONTEXT. */ | ||
69 | if (!mc) | ||
70 | mmu_context_cache = mc = MMU_CONTEXT_FIRST_VERSION; | ||
71 | } | ||
72 | mm->context = mc; | ||
73 | } | ||
74 | |||
75 | /* | ||
76 | * Get MMU context if needed. | ||
77 | */ | ||
78 | static __inline__ void | ||
79 | get_mmu_context(struct mm_struct *mm) | ||
80 | { | ||
81 | if (mm) { | ||
82 | unsigned long mc = mmu_context_cache; | ||
83 | /* Check if we have old version of context. | ||
84 | If it's old, we need to get new context with new version. */ | ||
85 | if ((mm->context ^ mc) & MMU_CONTEXT_VERSION_MASK) | ||
86 | get_new_mmu_context(mm); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | /* | ||
91 | * Initialize the context related info for a new mm_struct | ||
92 | * instance. | ||
93 | */ | ||
94 | static inline int init_new_context(struct task_struct *tsk, | ||
95 | struct mm_struct *mm) | ||
96 | { | ||
97 | mm->context = NO_CONTEXT; | ||
98 | |||
99 | return 0; | ||
100 | } | ||
101 | |||
102 | /* | ||
103 | * Destroy context related info for an mm_struct that is about | ||
104 | * to be put to rest. | ||
105 | */ | ||
106 | static inline void destroy_context(struct mm_struct *mm) | ||
107 | { | ||
108 | extern void flush_tlb_mm(struct mm_struct *mm); | ||
109 | |||
110 | /* Well, at least free TLB entries */ | ||
111 | flush_tlb_mm(mm); | ||
112 | } | ||
113 | |||
114 | #endif /* __ASSEMBLY__ */ | ||
115 | |||
116 | /* Common defines */ | ||
117 | #define TLB_STEP 0x00000010 | ||
118 | #define TLB_PTEH 0x00000000 | ||
119 | #define TLB_PTEL 0x00000008 | ||
120 | |||
121 | /* PTEH defines */ | ||
122 | #define PTEH_ASID_SHIFT 2 | ||
123 | #define PTEH_VALID 0x0000000000000001 | ||
124 | #define PTEH_SHARED 0x0000000000000002 | ||
125 | #define PTEH_MATCH_ASID 0x00000000000003ff | ||
126 | |||
127 | #ifndef __ASSEMBLY__ | ||
128 | /* This has to be a common function because the next location to fill | ||
129 | * information is shared. */ | ||
130 | extern void __do_tlb_refill(unsigned long address, unsigned long long is_text_not_data, pte_t *pte); | ||
131 | |||
132 | /* Profiling counter. */ | ||
133 | #ifdef CONFIG_SH64_PROC_TLB | ||
134 | extern unsigned long long calls_to_do_fast_page_fault; | ||
135 | #endif | ||
136 | |||
137 | static inline unsigned long get_asid(void) | ||
138 | { | ||
139 | unsigned long long sr; | ||
140 | |||
141 | asm volatile ("getcon " __SR ", %0\n\t" | ||
142 | : "=r" (sr)); | ||
143 | |||
144 | sr = (sr >> SR_ASID_SHIFT) & MMU_CONTEXT_ASID_MASK; | ||
145 | return (unsigned long) sr; | ||
146 | } | ||
147 | |||
148 | /* Set ASID into SR */ | ||
149 | static inline void set_asid(unsigned long asid) | ||
150 | { | ||
151 | unsigned long long sr, pc; | ||
152 | |||
153 | asm volatile ("getcon " __SR ", %0" : "=r" (sr)); | ||
154 | |||
155 | sr = (sr & SR_ASID_MASK) | (asid << SR_ASID_SHIFT); | ||
156 | |||
157 | /* | ||
158 | * It is possible that this function may be inlined and so to avoid | ||
159 | * the assembler reporting duplicate symbols we make use of the gas trick | ||
160 | * of generating symbols using numerics and forward reference. | ||
161 | */ | ||
162 | asm volatile ("movi 1, %1\n\t" | ||
163 | "shlli %1, 28, %1\n\t" | ||
164 | "or %0, %1, %1\n\t" | ||
165 | "putcon %1, " __SR "\n\t" | ||
166 | "putcon %0, " __SSR "\n\t" | ||
167 | "movi 1f, %1\n\t" | ||
168 | "ori %1, 1 , %1\n\t" | ||
169 | "putcon %1, " __SPC "\n\t" | ||
170 | "rte\n" | ||
171 | "1:\n\t" | ||
172 | : "=r" (sr), "=r" (pc) : "0" (sr)); | ||
173 | } | ||
174 | |||
175 | /* | ||
176 | * After we have set current->mm to a new value, this activates | ||
177 | * the context for the new mm so we see the new mappings. | ||
178 | */ | ||
179 | static __inline__ void activate_context(struct mm_struct *mm) | ||
180 | { | ||
181 | get_mmu_context(mm); | ||
182 | set_asid(mm->context & MMU_CONTEXT_ASID_MASK); | ||
183 | } | ||
184 | |||
185 | |||
186 | static __inline__ void switch_mm(struct mm_struct *prev, | ||
187 | struct mm_struct *next, | ||
188 | struct task_struct *tsk) | ||
189 | { | ||
190 | if (prev != next) { | ||
191 | mmu_pdtp_cache = next->pgd; | ||
192 | activate_context(next); | ||
193 | } | ||
194 | } | ||
195 | |||
196 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
197 | |||
198 | #define activate_mm(prev, next) \ | ||
199 | switch_mm((prev),(next),NULL) | ||
200 | |||
201 | static inline void | ||
202 | enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
203 | { | ||
204 | } | ||
205 | |||
206 | #endif /* __ASSEMBLY__ */ | ||
207 | |||
208 | #endif /* __ASM_SH64_MMU_CONTEXT_H */ | ||
diff --git a/include/asm-sh64/module.h b/include/asm-sh64/module.h deleted file mode 100644 index c313650d3d93..000000000000 --- a/include/asm-sh64/module.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_MODULE_H | ||
2 | #define __ASM_SH64_MODULE_H | ||
3 | /* | ||
4 | * This file contains the SH architecture specific module code. | ||
5 | */ | ||
6 | |||
7 | struct mod_arch_specific { | ||
8 | /* empty */ | ||
9 | }; | ||
10 | |||
11 | #define Elf_Shdr Elf32_Shdr | ||
12 | #define Elf_Sym Elf32_Sym | ||
13 | #define Elf_Ehdr Elf32_Ehdr | ||
14 | |||
15 | #define module_map(x) vmalloc(x) | ||
16 | #define module_unmap(x) vfree(x) | ||
17 | #define module_arch_init(x) (0) | ||
18 | #define arch_init_modules(x) do { } while (0) | ||
19 | |||
20 | #endif /* __ASM_SH64_MODULE_H */ | ||
diff --git a/include/asm-sh64/msgbuf.h b/include/asm-sh64/msgbuf.h deleted file mode 100644 index cf0494ce0ba8..000000000000 --- a/include/asm-sh64/msgbuf.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_MSGBUF_H | ||
2 | #define __ASM_SH64_MSGBUF_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/msgbuf.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * The msqid64_ds structure for i386 architecture. | ||
17 | * Note extra padding because this structure is passed back and forth | ||
18 | * between kernel and user space. | ||
19 | * | ||
20 | * Pad space is left for: | ||
21 | * - 64-bit time_t to solve y2038 problem | ||
22 | * - 2 miscellaneous 32-bit values | ||
23 | */ | ||
24 | |||
25 | struct msqid64_ds { | ||
26 | struct ipc64_perm msg_perm; | ||
27 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
28 | unsigned long __unused1; | ||
29 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
30 | unsigned long __unused2; | ||
31 | __kernel_time_t msg_ctime; /* last change time */ | ||
32 | unsigned long __unused3; | ||
33 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
34 | unsigned long msg_qnum; /* number of messages in queue */ | ||
35 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
36 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
37 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
38 | unsigned long __unused4; | ||
39 | unsigned long __unused5; | ||
40 | }; | ||
41 | |||
42 | #endif /* __ASM_SH64_MSGBUF_H */ | ||
diff --git a/include/asm-sh64/mutex.h b/include/asm-sh64/mutex.h deleted file mode 100644 index 458c1f7fbc18..000000000000 --- a/include/asm-sh64/mutex.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | /* | ||
2 | * Pull in the generic implementation for the mutex fastpath. | ||
3 | * | ||
4 | * TODO: implement optimized primitives instead, or leave the generic | ||
5 | * implementation in place, or pick the atomic_xchg() based generic | ||
6 | * implementation. (see asm-generic/mutex-xchg.h for details) | ||
7 | */ | ||
8 | |||
9 | #include <asm-generic/mutex-dec.h> | ||
diff --git a/include/asm-sh64/namei.h b/include/asm-sh64/namei.h deleted file mode 100644 index 99d759a805ce..000000000000 --- a/include/asm-sh64/namei.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_NAMEI_H | ||
2 | #define __ASM_SH64_NAMEI_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/namei.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | * Included from linux/fs/namei.c | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | /* This dummy routine maybe changed to something useful | ||
18 | * for /usr/gnemul/ emulation stuff. | ||
19 | * Look at asm-sparc/namei.h for details. | ||
20 | */ | ||
21 | |||
22 | #define __emul_prefix() NULL | ||
23 | |||
24 | #endif /* __ASM_SH64_NAMEI_H */ | ||
diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h deleted file mode 100644 index 472089aefc60..000000000000 --- a/include/asm-sh64/page.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PAGE_H | ||
2 | #define __ASM_SH64_PAGE_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/page.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003, 2004 Paul Mundt | ||
13 | * | ||
14 | * benedict.gaster@superh.com 19th, 24th July 2002. | ||
15 | * | ||
16 | * Modified to take account of enabling for D-CACHE support. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | |||
21 | /* PAGE_SHIFT determines the page size */ | ||
22 | #define PAGE_SHIFT 12 | ||
23 | #ifdef __ASSEMBLY__ | ||
24 | #define PAGE_SIZE 4096 | ||
25 | #else | ||
26 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | ||
27 | #endif | ||
28 | #define PAGE_MASK (~(PAGE_SIZE-1)) | ||
29 | #define PTE_MASK PAGE_MASK | ||
30 | |||
31 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | ||
32 | #define HPAGE_SHIFT 16 | ||
33 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) | ||
34 | #define HPAGE_SHIFT 20 | ||
35 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB) | ||
36 | #define HPAGE_SHIFT 29 | ||
37 | #endif | ||
38 | |||
39 | #ifdef CONFIG_HUGETLB_PAGE | ||
40 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) | ||
41 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) | ||
42 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) | ||
43 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
44 | #endif | ||
45 | |||
46 | #ifdef __KERNEL__ | ||
47 | #ifndef __ASSEMBLY__ | ||
48 | |||
49 | extern struct page *mem_map; | ||
50 | extern void sh64_page_clear(void *page); | ||
51 | extern void sh64_page_copy(void *from, void *to); | ||
52 | |||
53 | #define clear_page(page) sh64_page_clear(page) | ||
54 | #define copy_page(to,from) sh64_page_copy(from, to) | ||
55 | |||
56 | #if defined(CONFIG_DCACHE_DISABLED) | ||
57 | |||
58 | #define clear_user_page(page, vaddr, pg) clear_page(page) | ||
59 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | ||
60 | |||
61 | #else | ||
62 | |||
63 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); | ||
64 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); | ||
65 | |||
66 | #endif /* defined(CONFIG_DCACHE_DISABLED) */ | ||
67 | |||
68 | /* | ||
69 | * These are used to make use of C type-checking.. | ||
70 | */ | ||
71 | typedef struct { unsigned long long pte; } pte_t; | ||
72 | typedef struct { unsigned long pmd; } pmd_t; | ||
73 | typedef struct { unsigned long pgd; } pgd_t; | ||
74 | typedef struct { unsigned long pgprot; } pgprot_t; | ||
75 | |||
76 | #define pte_val(x) ((x).pte) | ||
77 | #define pmd_val(x) ((x).pmd) | ||
78 | #define pgd_val(x) ((x).pgd) | ||
79 | #define pgprot_val(x) ((x).pgprot) | ||
80 | |||
81 | #define __pte(x) ((pte_t) { (x) } ) | ||
82 | #define __pmd(x) ((pmd_t) { (x) } ) | ||
83 | #define __pgd(x) ((pgd_t) { (x) } ) | ||
84 | #define __pgprot(x) ((pgprot_t) { (x) } ) | ||
85 | |||
86 | #endif /* !__ASSEMBLY__ */ | ||
87 | |||
88 | /* to align the pointer to the (next) page boundary */ | ||
89 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
90 | |||
91 | /* | ||
92 | * Kconfig defined. | ||
93 | */ | ||
94 | #define __MEMORY_START (CONFIG_MEMORY_START) | ||
95 | #define PAGE_OFFSET (CONFIG_CACHED_MEMORY_OFFSET) | ||
96 | |||
97 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) | ||
98 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) | ||
99 | #define MAP_NR(addr) ((__pa(addr)-__MEMORY_START) >> PAGE_SHIFT) | ||
100 | #define VALID_PAGE(page) ((page - mem_map) < max_mapnr) | ||
101 | |||
102 | #define phys_to_page(phys) (mem_map + (((phys) - __MEMORY_START) >> PAGE_SHIFT)) | ||
103 | #define page_to_phys(page) (((page - mem_map) << PAGE_SHIFT) + __MEMORY_START) | ||
104 | |||
105 | /* PFN start number, because of __MEMORY_START */ | ||
106 | #define PFN_START (__MEMORY_START >> PAGE_SHIFT) | ||
107 | #define ARCH_PFN_OFFSET (PFN_START) | ||
108 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | ||
109 | #define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr) | ||
110 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | ||
111 | |||
112 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | ||
113 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | ||
114 | |||
115 | #include <asm-generic/memory_model.h> | ||
116 | #include <asm-generic/page.h> | ||
117 | |||
118 | #endif /* __KERNEL__ */ | ||
119 | #endif /* __ASM_SH64_PAGE_H */ | ||
diff --git a/include/asm-sh64/param.h b/include/asm-sh64/param.h deleted file mode 100644 index f409adb41540..000000000000 --- a/include/asm-sh64/param.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * include/asm-sh64/param.h | ||
7 | * | ||
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
9 | * Copyright (C) 2003 Paul Mundt | ||
10 | * | ||
11 | */ | ||
12 | #ifndef __ASM_SH64_PARAM_H | ||
13 | #define __ASM_SH64_PARAM_H | ||
14 | |||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | # ifdef CONFIG_SH_WDT | ||
18 | # define HZ 1000 /* Needed for high-res WOVF */ | ||
19 | # else | ||
20 | # define HZ 100 | ||
21 | # endif | ||
22 | # define USER_HZ 100 /* User interfaces are in "ticks" */ | ||
23 | # define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ | ||
24 | #endif | ||
25 | |||
26 | #ifndef HZ | ||
27 | #define HZ 100 | ||
28 | #endif | ||
29 | |||
30 | #define EXEC_PAGESIZE 4096 | ||
31 | |||
32 | #ifndef NGROUPS | ||
33 | #define NGROUPS 32 | ||
34 | #endif | ||
35 | |||
36 | #ifndef NOGROUP | ||
37 | #define NOGROUP (-1) | ||
38 | #endif | ||
39 | |||
40 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
41 | |||
42 | #endif /* __ASM_SH64_PARAM_H */ | ||
diff --git a/include/asm-sh64/pci.h b/include/asm-sh64/pci.h deleted file mode 100644 index 18055dbbb4b5..000000000000 --- a/include/asm-sh64/pci.h +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PCI_H | ||
2 | #define __ASM_SH64_PCI_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/dma-mapping.h> | ||
7 | |||
8 | /* Can be used to override the logic in pci_scan_bus for skipping | ||
9 | already-configured bus numbers - to be used for buggy BIOSes | ||
10 | or architectures with incomplete PCI setup by the loader */ | ||
11 | |||
12 | #define pcibios_assign_all_busses() 1 | ||
13 | |||
14 | /* | ||
15 | * These are currently the correct values for the STM overdrive board | ||
16 | * We need some way of setting this on a board specific way, it will | ||
17 | * not be the same on other boards I think | ||
18 | */ | ||
19 | #if defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) | ||
20 | #define PCIBIOS_MIN_IO 0x2000 | ||
21 | #define PCIBIOS_MIN_MEM 0x40000000 | ||
22 | #endif | ||
23 | |||
24 | extern void pcibios_set_master(struct pci_dev *dev); | ||
25 | |||
26 | /* | ||
27 | * Set penalize isa irq function | ||
28 | */ | ||
29 | static inline void pcibios_penalize_isa_irq(int irq, int active) | ||
30 | { | ||
31 | /* We don't do dynamic PCI IRQ allocation */ | ||
32 | } | ||
33 | |||
34 | /* Dynamic DMA mapping stuff. | ||
35 | * SuperH has everything mapped statically like x86. | ||
36 | */ | ||
37 | |||
38 | /* The PCI address space does equal the physical memory | ||
39 | * address space. The networking and block device layers use | ||
40 | * this boolean for bounce buffer decisions. | ||
41 | */ | ||
42 | #define PCI_DMA_BUS_IS_PHYS (1) | ||
43 | |||
44 | #include <linux/types.h> | ||
45 | #include <linux/slab.h> | ||
46 | #include <asm/scatterlist.h> | ||
47 | #include <linux/string.h> | ||
48 | #include <asm/io.h> | ||
49 | |||
50 | /* pci_unmap_{single,page} being a nop depends upon the | ||
51 | * configuration. | ||
52 | */ | ||
53 | #ifdef CONFIG_SH_PCIDMA_NONCOHERENT | ||
54 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | ||
55 | dma_addr_t ADDR_NAME; | ||
56 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | ||
57 | __u32 LEN_NAME; | ||
58 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | ||
59 | ((PTR)->ADDR_NAME) | ||
60 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
61 | (((PTR)->ADDR_NAME) = (VAL)) | ||
62 | #define pci_unmap_len(PTR, LEN_NAME) \ | ||
63 | ((PTR)->LEN_NAME) | ||
64 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
65 | (((PTR)->LEN_NAME) = (VAL)) | ||
66 | #else | ||
67 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
68 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
69 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
70 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
71 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
72 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
73 | #endif | ||
74 | |||
75 | #ifdef CONFIG_PCI | ||
76 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
77 | enum pci_dma_burst_strategy *strat, | ||
78 | unsigned long *strategy_parameter) | ||
79 | { | ||
80 | *strat = PCI_DMA_BURST_INFINITY; | ||
81 | *strategy_parameter = ~0UL; | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | /* Board-specific fixup routines. */ | ||
86 | extern void pcibios_fixup(void); | ||
87 | extern void pcibios_fixup_irqs(void); | ||
88 | |||
89 | #ifdef CONFIG_PCI_AUTO | ||
90 | extern int pciauto_assign_resources(int busno, struct pci_channel *hose); | ||
91 | #endif | ||
92 | |||
93 | #endif /* __KERNEL__ */ | ||
94 | |||
95 | /* generic pci stuff */ | ||
96 | #include <asm-generic/pci.h> | ||
97 | |||
98 | /* generic DMA-mapping stuff */ | ||
99 | #include <asm-generic/pci-dma-compat.h> | ||
100 | |||
101 | #endif /* __ASM_SH64_PCI_H */ | ||
102 | |||
diff --git a/include/asm-sh64/percpu.h b/include/asm-sh64/percpu.h deleted file mode 100644 index a01d16cd0e8c..000000000000 --- a/include/asm-sh64/percpu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PERCPU | ||
2 | #define __ASM_SH64_PERCPU | ||
3 | |||
4 | #include <asm-generic/percpu.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_PERCPU */ | ||
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h deleted file mode 100644 index 6eccab770a6d..000000000000 --- a/include/asm-sh64/pgalloc.h +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PGALLOC_H | ||
2 | #define __ASM_SH64_PGALLOC_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/pgalloc.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003, 2004 Paul Mundt | ||
13 | * Copyright (C) 2003, 2004 Richard Curnow | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/mm.h> | ||
18 | #include <linux/quicklist.h> | ||
19 | #include <asm/page.h> | ||
20 | |||
21 | static inline void pgd_init(unsigned long page) | ||
22 | { | ||
23 | unsigned long *pgd = (unsigned long *)page; | ||
24 | extern pte_t empty_bad_pte_table[PTRS_PER_PTE]; | ||
25 | int i; | ||
26 | |||
27 | for (i = 0; i < USER_PTRS_PER_PGD; i++) | ||
28 | pgd[i] = (unsigned long)empty_bad_pte_table; | ||
29 | } | ||
30 | |||
31 | /* | ||
32 | * Allocate and free page tables. The xxx_kernel() versions are | ||
33 | * used to allocate a kernel page table - this turns on ASN bits | ||
34 | * if any. | ||
35 | */ | ||
36 | |||
37 | static inline pgd_t *get_pgd_slow(void) | ||
38 | { | ||
39 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); | ||
40 | pgd_t *ret = kmalloc(pgd_size, GFP_KERNEL); | ||
41 | return ret; | ||
42 | } | ||
43 | |||
44 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | ||
45 | { | ||
46 | return quicklist_alloc(0, GFP_KERNEL, NULL); | ||
47 | } | ||
48 | |||
49 | static inline void pgd_free(pgd_t *pgd) | ||
50 | { | ||
51 | quicklist_free(0, NULL, pgd); | ||
52 | } | ||
53 | |||
54 | static inline struct page *pte_alloc_one(struct mm_struct *mm, | ||
55 | unsigned long address) | ||
56 | { | ||
57 | void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); | ||
58 | return pg ? virt_to_page(pg) : NULL; | ||
59 | } | ||
60 | |||
61 | static inline void pte_free_kernel(pte_t *pte) | ||
62 | { | ||
63 | quicklist_free(0, NULL, pte); | ||
64 | } | ||
65 | |||
66 | static inline void pte_free(struct page *pte) | ||
67 | { | ||
68 | quicklist_free_page(0, NULL, pte); | ||
69 | } | ||
70 | |||
71 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | ||
72 | unsigned long address) | ||
73 | { | ||
74 | return quicklist_alloc(0, GFP_KERNEL, NULL); | ||
75 | } | ||
76 | |||
77 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | ||
78 | |||
79 | /* | ||
80 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | ||
81 | * inside the pgd, so has no extra memory associated with it. | ||
82 | */ | ||
83 | |||
84 | #if defined(CONFIG_SH64_PGTABLE_2_LEVEL) | ||
85 | |||
86 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | ||
87 | #define pmd_free(x) do { } while (0) | ||
88 | #define pgd_populate(mm, pmd, pte) BUG() | ||
89 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | ||
90 | #define __pmd_free_tlb(tlb,pmd) do { } while (0) | ||
91 | |||
92 | #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) | ||
93 | |||
94 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | ||
95 | { | ||
96 | return quicklist_alloc(0, GFP_KERNEL, NULL); | ||
97 | } | ||
98 | |||
99 | static inline void pmd_free(pmd_t *pmd) | ||
100 | { | ||
101 | quicklist_free(0, NULL, pmd); | ||
102 | } | ||
103 | |||
104 | #define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) | ||
105 | #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) | ||
106 | |||
107 | #else | ||
108 | #error "No defined page table size" | ||
109 | #endif | ||
110 | |||
111 | #define pmd_populate_kernel(mm, pmd, pte) \ | ||
112 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) | ||
113 | |||
114 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | ||
115 | struct page *pte) | ||
116 | { | ||
117 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte))); | ||
118 | } | ||
119 | |||
120 | static inline void check_pgt_cache(void) | ||
121 | { | ||
122 | quicklist_trim(0, NULL, 25, 16); | ||
123 | } | ||
124 | |||
125 | #endif /* __ASM_SH64_PGALLOC_H */ | ||
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h deleted file mode 100644 index 3488fe32e436..000000000000 --- a/include/asm-sh64/pgtable.h +++ /dev/null | |||
@@ -1,496 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PGTABLE_H | ||
2 | #define __ASM_SH64_PGTABLE_H | ||
3 | |||
4 | #include <asm-generic/4level-fixup.h> | ||
5 | |||
6 | /* | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | * | ||
11 | * include/asm-sh64/pgtable.h | ||
12 | * | ||
13 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
14 | * Copyright (C) 2003, 2004 Paul Mundt | ||
15 | * Copyright (C) 2003, 2004 Richard Curnow | ||
16 | * | ||
17 | * This file contains the functions and defines necessary to modify and use | ||
18 | * the SuperH page table tree. | ||
19 | */ | ||
20 | |||
21 | #ifndef __ASSEMBLY__ | ||
22 | #include <asm/processor.h> | ||
23 | #include <asm/page.h> | ||
24 | #include <linux/threads.h> | ||
25 | |||
26 | struct vm_area_struct; | ||
27 | |||
28 | extern void paging_init(void); | ||
29 | |||
30 | /* We provide our own get_unmapped_area to avoid cache synonym issue */ | ||
31 | #define HAVE_ARCH_UNMAPPED_AREA | ||
32 | |||
33 | /* | ||
34 | * Basically we have the same two-level (which is the logical three level | ||
35 | * Linux page table layout folded) page tables as the i386. | ||
36 | */ | ||
37 | |||
38 | /* | ||
39 | * ZERO_PAGE is a global shared page that is always zero: used | ||
40 | * for zero-mapped memory areas etc.. | ||
41 | */ | ||
42 | extern unsigned char empty_zero_page[PAGE_SIZE]; | ||
43 | #define ZERO_PAGE(vaddr) (mem_map + MAP_NR(empty_zero_page)) | ||
44 | |||
45 | #endif /* !__ASSEMBLY__ */ | ||
46 | |||
47 | /* | ||
48 | * NEFF and NPHYS related defines. | ||
49 | * FIXME : These need to be model-dependent. For now this is OK, SH5-101 and SH5-103 | ||
50 | * implement 32 bits effective and 32 bits physical. But future implementations may | ||
51 | * extend beyond this. | ||
52 | */ | ||
53 | #define NEFF 32 | ||
54 | #define NEFF_SIGN (1LL << (NEFF - 1)) | ||
55 | #define NEFF_MASK (-1LL << NEFF) | ||
56 | |||
57 | #define NPHYS 32 | ||
58 | #define NPHYS_SIGN (1LL << (NPHYS - 1)) | ||
59 | #define NPHYS_MASK (-1LL << NPHYS) | ||
60 | |||
61 | /* Typically 2-level is sufficient up to 32 bits of virtual address space, beyond | ||
62 | that 3-level would be appropriate. */ | ||
63 | #if defined(CONFIG_SH64_PGTABLE_2_LEVEL) | ||
64 | /* For 4k pages, this contains 512 entries, i.e. 9 bits worth of address. */ | ||
65 | #define PTRS_PER_PTE ((1<<PAGE_SHIFT)/sizeof(unsigned long long)) | ||
66 | #define PTE_MAGNITUDE 3 /* sizeof(unsigned long long) magnit. */ | ||
67 | #define PTE_SHIFT PAGE_SHIFT | ||
68 | #define PTE_BITS (PAGE_SHIFT - PTE_MAGNITUDE) | ||
69 | |||
70 | /* top level: PMD. */ | ||
71 | #define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS) | ||
72 | #define PGD_BITS (NEFF - PGDIR_SHIFT) | ||
73 | #define PTRS_PER_PGD (1<<PGD_BITS) | ||
74 | |||
75 | /* middle level: PMD. This doesn't do anything for the 2-level case. */ | ||
76 | #define PTRS_PER_PMD (1) | ||
77 | |||
78 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | ||
79 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | ||
80 | #define PMD_SHIFT PGDIR_SHIFT | ||
81 | #define PMD_SIZE PGDIR_SIZE | ||
82 | #define PMD_MASK PGDIR_MASK | ||
83 | |||
84 | #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) | ||
85 | /* | ||
86 | * three-level asymmetric paging structure: PGD is top level. | ||
87 | * The asymmetry comes from 32-bit pointers and 64-bit PTEs. | ||
88 | */ | ||
89 | /* bottom level: PTE. It's 9 bits = 512 pointers */ | ||
90 | #define PTRS_PER_PTE ((1<<PAGE_SHIFT)/sizeof(unsigned long long)) | ||
91 | #define PTE_MAGNITUDE 3 /* sizeof(unsigned long long) magnit. */ | ||
92 | #define PTE_SHIFT PAGE_SHIFT | ||
93 | #define PTE_BITS (PAGE_SHIFT - PTE_MAGNITUDE) | ||
94 | |||
95 | /* middle level: PMD. It's 10 bits = 1024 pointers */ | ||
96 | #define PTRS_PER_PMD ((1<<PAGE_SHIFT)/sizeof(unsigned long long *)) | ||
97 | #define PMD_MAGNITUDE 2 /* sizeof(unsigned long long *) magnit. */ | ||
98 | #define PMD_SHIFT (PTE_SHIFT + PTE_BITS) | ||
99 | #define PMD_BITS (PAGE_SHIFT - PMD_MAGNITUDE) | ||
100 | |||
101 | /* top level: PMD. It's 1 bit = 2 pointers */ | ||
102 | #define PGDIR_SHIFT (PMD_SHIFT + PMD_BITS) | ||
103 | #define PGD_BITS (NEFF - PGDIR_SHIFT) | ||
104 | #define PTRS_PER_PGD (1<<PGD_BITS) | ||
105 | |||
106 | #define PMD_SIZE (1UL << PMD_SHIFT) | ||
107 | #define PMD_MASK (~(PMD_SIZE-1)) | ||
108 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | ||
109 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | ||
110 | |||
111 | #else | ||
112 | #error "No defined number of page table levels" | ||
113 | #endif | ||
114 | |||
115 | /* | ||
116 | * Error outputs. | ||
117 | */ | ||
118 | #define pte_ERROR(e) \ | ||
119 | printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e)) | ||
120 | #define pmd_ERROR(e) \ | ||
121 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) | ||
122 | #define pgd_ERROR(e) \ | ||
123 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | ||
124 | |||
125 | /* | ||
126 | * Table setting routines. Used within arch/mm only. | ||
127 | */ | ||
128 | #define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval) | ||
129 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) | ||
130 | |||
131 | static __inline__ void set_pte(pte_t *pteptr, pte_t pteval) | ||
132 | { | ||
133 | unsigned long long x = ((unsigned long long) pteval.pte); | ||
134 | unsigned long long *xp = (unsigned long long *) pteptr; | ||
135 | /* | ||
136 | * Sign-extend based on NPHYS. | ||
137 | */ | ||
138 | *(xp) = (x & NPHYS_SIGN) ? (x | NPHYS_MASK) : x; | ||
139 | } | ||
140 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | ||
141 | |||
142 | static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep) | ||
143 | { | ||
144 | pmd_val(*pmdp) = (unsigned long) ptep; | ||
145 | } | ||
146 | |||
147 | /* | ||
148 | * PGD defines. Top level. | ||
149 | */ | ||
150 | |||
151 | /* To find an entry in a generic PGD. */ | ||
152 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | ||
153 | #define __pgd_offset(address) pgd_index(address) | ||
154 | #define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) | ||
155 | |||
156 | /* To find an entry in a kernel PGD. */ | ||
157 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | ||
158 | |||
159 | /* | ||
160 | * PGD level access routines. | ||
161 | * | ||
162 | * Note1: | ||
163 | * There's no need to use physical addresses since the tree walk is all | ||
164 | * in performed in software, until the PTE translation. | ||
165 | * | ||
166 | * Note 2: | ||
167 | * A PGD entry can be uninitialized (_PGD_UNUSED), generically bad, | ||
168 | * clear (_PGD_EMPTY), present. When present, lower 3 nibbles contain | ||
169 | * _KERNPG_TABLE. Being a kernel virtual pointer also bit 31 must | ||
170 | * be 1. Assuming an arbitrary clear value of bit 31 set to 0 and | ||
171 | * lower 3 nibbles set to 0xFFF (_PGD_EMPTY) any other value is a | ||
172 | * bad pgd that must be notified via printk(). | ||
173 | * | ||
174 | */ | ||
175 | #define _PGD_EMPTY 0x0 | ||
176 | |||
177 | #if defined(CONFIG_SH64_PGTABLE_2_LEVEL) | ||
178 | static inline int pgd_none(pgd_t pgd) { return 0; } | ||
179 | static inline int pgd_bad(pgd_t pgd) { return 0; } | ||
180 | #define pgd_present(pgd) ((pgd_val(pgd) & _PAGE_PRESENT) ? 1 : 0) | ||
181 | #define pgd_clear(xx) do { } while(0) | ||
182 | |||
183 | #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) | ||
184 | #define pgd_present(pgd_entry) (1) | ||
185 | #define pgd_none(pgd_entry) (pgd_val((pgd_entry)) == _PGD_EMPTY) | ||
186 | /* TODO: Think later about what a useful definition of 'bad' would be now. */ | ||
187 | #define pgd_bad(pgd_entry) (0) | ||
188 | #define pgd_clear(pgd_entry_p) (set_pgd((pgd_entry_p), __pgd(_PGD_EMPTY))) | ||
189 | |||
190 | #endif | ||
191 | |||
192 | |||
193 | #define pgd_page_vaddr(pgd_entry) ((unsigned long) (pgd_val(pgd_entry) & PAGE_MASK)) | ||
194 | #define pgd_page(pgd) (virt_to_page(pgd_val(pgd))) | ||
195 | |||
196 | |||
197 | /* | ||
198 | * PMD defines. Middle level. | ||
199 | */ | ||
200 | |||
201 | /* PGD to PMD dereferencing */ | ||
202 | #if defined(CONFIG_SH64_PGTABLE_2_LEVEL) | ||
203 | static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) | ||
204 | { | ||
205 | return (pmd_t *) dir; | ||
206 | } | ||
207 | #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) | ||
208 | #define __pmd_offset(address) \ | ||
209 | (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | ||
210 | #define pmd_offset(dir, addr) \ | ||
211 | ((pmd_t *) ((pgd_val(*(dir))) & PAGE_MASK) + __pmd_offset((addr))) | ||
212 | #endif | ||
213 | |||
214 | /* | ||
215 | * PMD level access routines. Same notes as above. | ||
216 | */ | ||
217 | #define _PMD_EMPTY 0x0 | ||
218 | /* Either the PMD is empty or present, it's not paged out */ | ||
219 | #define pmd_present(pmd_entry) (pmd_val(pmd_entry) & _PAGE_PRESENT) | ||
220 | #define pmd_clear(pmd_entry_p) (set_pmd((pmd_entry_p), __pmd(_PMD_EMPTY))) | ||
221 | #define pmd_none(pmd_entry) (pmd_val((pmd_entry)) == _PMD_EMPTY) | ||
222 | #define pmd_bad(pmd_entry) ((pmd_val(pmd_entry) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | ||
223 | |||
224 | #define pmd_page_vaddr(pmd_entry) \ | ||
225 | ((unsigned long) __va(pmd_val(pmd_entry) & PAGE_MASK)) | ||
226 | |||
227 | #define pmd_page(pmd) \ | ||
228 | (virt_to_page(pmd_val(pmd))) | ||
229 | |||
230 | /* PMD to PTE dereferencing */ | ||
231 | #define pte_index(address) \ | ||
232 | ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | ||
233 | |||
234 | #define pte_offset_kernel(dir, addr) \ | ||
235 | ((pte_t *) ((pmd_val(*(dir))) & PAGE_MASK) + pte_index((addr))) | ||
236 | |||
237 | #define pte_offset_map(dir,addr) pte_offset_kernel(dir, addr) | ||
238 | #define pte_offset_map_nested(dir,addr) pte_offset_kernel(dir, addr) | ||
239 | #define pte_unmap(pte) do { } while (0) | ||
240 | #define pte_unmap_nested(pte) do { } while (0) | ||
241 | |||
242 | /* Round it up ! */ | ||
243 | #define USER_PTRS_PER_PGD ((TASK_SIZE+PGDIR_SIZE-1)/PGDIR_SIZE) | ||
244 | #define FIRST_USER_ADDRESS 0 | ||
245 | |||
246 | #ifndef __ASSEMBLY__ | ||
247 | #define VMALLOC_END 0xff000000 | ||
248 | #define VMALLOC_START 0xf0000000 | ||
249 | #define VMALLOC_VMADDR(x) ((unsigned long)(x)) | ||
250 | |||
251 | #define IOBASE_VADDR 0xff000000 | ||
252 | #define IOBASE_END 0xffffffff | ||
253 | |||
254 | /* | ||
255 | * PTEL coherent flags. | ||
256 | * See Chapter 17 ST50 CPU Core Volume 1, Architecture. | ||
257 | */ | ||
258 | /* The bits that are required in the SH-5 TLB are placed in the h/w-defined | ||
259 | positions, to avoid expensive bit shuffling on every refill. The remaining | ||
260 | bits are used for s/w purposes and masked out on each refill. | ||
261 | |||
262 | Note, the PTE slots are used to hold data of type swp_entry_t when a page is | ||
263 | swapped out. Only the _PAGE_PRESENT flag is significant when the page is | ||
264 | swapped out, and it must be placed so that it doesn't overlap either the | ||
265 | type or offset fields of swp_entry_t. For x86, offset is at [31:8] and type | ||
266 | at [6:1], with _PAGE_PRESENT at bit 0 for both pte_t and swp_entry_t. This | ||
267 | scheme doesn't map to SH-5 because bit [0] controls cacheability. So bit | ||
268 | [2] is used for _PAGE_PRESENT and the type field of swp_entry_t is split | ||
269 | into 2 pieces. That is handled by SWP_ENTRY and SWP_TYPE below. */ | ||
270 | #define _PAGE_WT 0x001 /* CB0: if cacheable, 1->write-thru, 0->write-back */ | ||
271 | #define _PAGE_DEVICE 0x001 /* CB0: if uncacheable, 1->device (i.e. no write-combining or reordering at bus level) */ | ||
272 | #define _PAGE_CACHABLE 0x002 /* CB1: uncachable/cachable */ | ||
273 | #define _PAGE_PRESENT 0x004 /* software: page referenced */ | ||
274 | #define _PAGE_FILE 0x004 /* software: only when !present */ | ||
275 | #define _PAGE_SIZE0 0x008 /* SZ0-bit : size of page */ | ||
276 | #define _PAGE_SIZE1 0x010 /* SZ1-bit : size of page */ | ||
277 | #define _PAGE_SHARED 0x020 /* software: reflects PTEH's SH */ | ||
278 | #define _PAGE_READ 0x040 /* PR0-bit : read access allowed */ | ||
279 | #define _PAGE_EXECUTE 0x080 /* PR1-bit : execute access allowed */ | ||
280 | #define _PAGE_WRITE 0x100 /* PR2-bit : write access allowed */ | ||
281 | #define _PAGE_USER 0x200 /* PR3-bit : user space access allowed */ | ||
282 | #define _PAGE_DIRTY 0x400 /* software: page accessed in write */ | ||
283 | #define _PAGE_ACCESSED 0x800 /* software: page referenced */ | ||
284 | |||
285 | /* Mask which drops software flags */ | ||
286 | #define _PAGE_FLAGS_HARDWARE_MASK 0xfffffffffffff3dbLL | ||
287 | |||
288 | /* | ||
289 | * HugeTLB support | ||
290 | */ | ||
291 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | ||
292 | #define _PAGE_SZHUGE (_PAGE_SIZE0) | ||
293 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) | ||
294 | #define _PAGE_SZHUGE (_PAGE_SIZE1) | ||
295 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB) | ||
296 | #define _PAGE_SZHUGE (_PAGE_SIZE0 | _PAGE_SIZE1) | ||
297 | #endif | ||
298 | |||
299 | /* | ||
300 | * Default flags for a Kernel page. | ||
301 | * This is fundametally also SHARED because the main use of this define | ||
302 | * (other than for PGD/PMD entries) is for the VMALLOC pool which is | ||
303 | * contextless. | ||
304 | * | ||
305 | * _PAGE_EXECUTE is required for modules | ||
306 | * | ||
307 | */ | ||
308 | #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | ||
309 | _PAGE_EXECUTE | \ | ||
310 | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_DIRTY | \ | ||
311 | _PAGE_SHARED) | ||
312 | |||
313 | /* Default flags for a User page */ | ||
314 | #define _PAGE_TABLE (_KERNPG_TABLE | _PAGE_USER) | ||
315 | |||
316 | #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | ||
317 | |||
318 | #define PAGE_NONE __pgprot(_PAGE_CACHABLE | _PAGE_ACCESSED) | ||
319 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ | ||
320 | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_USER | \ | ||
321 | _PAGE_SHARED) | ||
322 | /* We need to include PAGE_EXECUTE in PAGE_COPY because it is the default | ||
323 | * protection mode for the stack. */ | ||
324 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_CACHABLE | \ | ||
325 | _PAGE_ACCESSED | _PAGE_USER | _PAGE_EXECUTE) | ||
326 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_CACHABLE | \ | ||
327 | _PAGE_ACCESSED | _PAGE_USER) | ||
328 | #define PAGE_KERNEL __pgprot(_KERNPG_TABLE) | ||
329 | |||
330 | |||
331 | /* | ||
332 | * In ST50 we have full permissions (Read/Write/Execute/Shared). | ||
333 | * Just match'em all. These are for mmap(), therefore all at least | ||
334 | * User/Cachable/Present/Accessed. No point in making Fault on Write. | ||
335 | */ | ||
336 | #define __MMAP_COMMON (_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED) | ||
337 | /* sxwr */ | ||
338 | #define __P000 __pgprot(__MMAP_COMMON) | ||
339 | #define __P001 __pgprot(__MMAP_COMMON | _PAGE_READ) | ||
340 | #define __P010 __pgprot(__MMAP_COMMON) | ||
341 | #define __P011 __pgprot(__MMAP_COMMON | _PAGE_READ) | ||
342 | #define __P100 __pgprot(__MMAP_COMMON | _PAGE_EXECUTE) | ||
343 | #define __P101 __pgprot(__MMAP_COMMON | _PAGE_EXECUTE | _PAGE_READ) | ||
344 | #define __P110 __pgprot(__MMAP_COMMON | _PAGE_EXECUTE) | ||
345 | #define __P111 __pgprot(__MMAP_COMMON | _PAGE_EXECUTE | _PAGE_READ) | ||
346 | |||
347 | #define __S000 __pgprot(__MMAP_COMMON | _PAGE_SHARED) | ||
348 | #define __S001 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_READ) | ||
349 | #define __S010 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_WRITE) | ||
350 | #define __S011 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_READ | _PAGE_WRITE) | ||
351 | #define __S100 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_EXECUTE) | ||
352 | #define __S101 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_EXECUTE | _PAGE_READ) | ||
353 | #define __S110 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_EXECUTE | _PAGE_WRITE) | ||
354 | #define __S111 __pgprot(__MMAP_COMMON | _PAGE_SHARED | _PAGE_EXECUTE | _PAGE_READ | _PAGE_WRITE) | ||
355 | |||
356 | /* Make it a device mapping for maximum safety (e.g. for mapping device | ||
357 | registers into user-space via /dev/map). */ | ||
358 | #define pgprot_noncached(x) __pgprot(((x).pgprot & ~(_PAGE_CACHABLE)) | _PAGE_DEVICE) | ||
359 | #define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE) | ||
360 | |||
361 | /* | ||
362 | * Handling allocation failures during page table setup. | ||
363 | */ | ||
364 | extern void __handle_bad_pmd_kernel(pmd_t * pmd); | ||
365 | #define __handle_bad_pmd(x) __handle_bad_pmd_kernel(x) | ||
366 | |||
367 | /* | ||
368 | * PTE level access routines. | ||
369 | * | ||
370 | * Note1: | ||
371 | * It's the tree walk leaf. This is physical address to be stored. | ||
372 | * | ||
373 | * Note 2: | ||
374 | * Regarding the choice of _PTE_EMPTY: | ||
375 | |||
376 | We must choose a bit pattern that cannot be valid, whether or not the page | ||
377 | is present. bit[2]==1 => present, bit[2]==0 => swapped out. If swapped | ||
378 | out, bits [31:8], [6:3], [1:0] are under swapper control, so only bit[7] is | ||
379 | left for us to select. If we force bit[7]==0 when swapped out, we could use | ||
380 | the combination bit[7,2]=2'b10 to indicate an empty PTE. Alternatively, if | ||
381 | we force bit[7]==1 when swapped out, we can use all zeroes to indicate | ||
382 | empty. This is convenient, because the page tables get cleared to zero | ||
383 | when they are allocated. | ||
384 | |||
385 | */ | ||
386 | #define _PTE_EMPTY 0x0 | ||
387 | #define pte_present(x) (pte_val(x) & _PAGE_PRESENT) | ||
388 | #define pte_clear(mm,addr,xp) (set_pte_at(mm, addr, xp, __pte(_PTE_EMPTY))) | ||
389 | #define pte_none(x) (pte_val(x) == _PTE_EMPTY) | ||
390 | |||
391 | /* | ||
392 | * Some definitions to translate between mem_map, PTEs, and page | ||
393 | * addresses: | ||
394 | */ | ||
395 | |||
396 | /* | ||
397 | * Given a PTE, return the index of the mem_map[] entry corresponding | ||
398 | * to the page frame the PTE. Get the absolute physical address, make | ||
399 | * a relative physical address and translate it to an index. | ||
400 | */ | ||
401 | #define pte_pagenr(x) (((unsigned long) (pte_val(x)) - \ | ||
402 | __MEMORY_START) >> PAGE_SHIFT) | ||
403 | |||
404 | /* | ||
405 | * Given a PTE, return the "struct page *". | ||
406 | */ | ||
407 | #define pte_page(x) (mem_map + pte_pagenr(x)) | ||
408 | |||
409 | /* | ||
410 | * Return number of (down rounded) MB corresponding to x pages. | ||
411 | */ | ||
412 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) | ||
413 | |||
414 | |||
415 | /* | ||
416 | * The following have defined behavior only work if pte_present() is true. | ||
417 | */ | ||
418 | static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; } | ||
419 | static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } | ||
420 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | ||
421 | static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } | ||
422 | |||
423 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } | ||
424 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | ||
425 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } | ||
426 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } | ||
427 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | ||
428 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | ||
429 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | ||
430 | |||
431 | |||
432 | /* | ||
433 | * Conversion functions: convert a page and protection to a page entry. | ||
434 | * | ||
435 | * extern pte_t mk_pte(struct page *page, pgprot_t pgprot) | ||
436 | */ | ||
437 | #define mk_pte(page,pgprot) \ | ||
438 | ({ \ | ||
439 | pte_t __pte; \ | ||
440 | \ | ||
441 | set_pte(&__pte, __pte((((page)-mem_map) << PAGE_SHIFT) | \ | ||
442 | __MEMORY_START | pgprot_val((pgprot)))); \ | ||
443 | __pte; \ | ||
444 | }) | ||
445 | |||
446 | /* | ||
447 | * This takes a (absolute) physical page address that is used | ||
448 | * by the remapping functions | ||
449 | */ | ||
450 | #define mk_pte_phys(physpage, pgprot) \ | ||
451 | ({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; }) | ||
452 | |||
453 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | ||
454 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } | ||
455 | |||
456 | typedef pte_t *pte_addr_t; | ||
457 | #define pgtable_cache_init() do { } while (0) | ||
458 | |||
459 | extern void update_mmu_cache(struct vm_area_struct * vma, | ||
460 | unsigned long address, pte_t pte); | ||
461 | |||
462 | /* Encode and decode a swap entry */ | ||
463 | #define __swp_type(x) (((x).val & 3) + (((x).val >> 1) & 0x3c)) | ||
464 | #define __swp_offset(x) ((x).val >> 8) | ||
465 | #define __swp_entry(type, offset) ((swp_entry_t) { ((offset << 8) + ((type & 0x3c) << 1) + (type & 3)) }) | ||
466 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | ||
467 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | ||
468 | |||
469 | /* Encode and decode a nonlinear file mapping entry */ | ||
470 | #define PTE_FILE_MAX_BITS 29 | ||
471 | #define pte_to_pgoff(pte) (pte_val(pte)) | ||
472 | #define pgoff_to_pte(off) ((pte_t) { (off) | _PAGE_FILE }) | ||
473 | |||
474 | /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ | ||
475 | #define PageSkip(page) (0) | ||
476 | #define kern_addr_valid(addr) (1) | ||
477 | |||
478 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | ||
479 | remap_pfn_range(vma, vaddr, pfn, size, prot) | ||
480 | |||
481 | #endif /* !__ASSEMBLY__ */ | ||
482 | |||
483 | /* | ||
484 | * No page table caches to initialise | ||
485 | */ | ||
486 | #define pgtable_cache_init() do { } while (0) | ||
487 | |||
488 | #define pte_pfn(x) (((unsigned long)((x).pte)) >> PAGE_SHIFT) | ||
489 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | ||
490 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | ||
491 | |||
492 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | ||
493 | |||
494 | #include <asm-generic/pgtable.h> | ||
495 | |||
496 | #endif /* __ASM_SH64_PGTABLE_H */ | ||
diff --git a/include/asm-sh64/platform.h b/include/asm-sh64/platform.h deleted file mode 100644 index bd0d9c405a80..000000000000 --- a/include/asm-sh64/platform.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PLATFORM_H | ||
2 | #define __ASM_SH64_PLATFORM_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/platform.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | * benedict.gaster@superh.com: 3rd May 2002 | ||
14 | * Added support for ramdisk, removing statically linked romfs at the same time. | ||
15 | */ | ||
16 | |||
17 | #include <linux/ioport.h> | ||
18 | #include <asm/irq.h> | ||
19 | |||
20 | |||
21 | /* | ||
22 | * Platform definition structure. | ||
23 | */ | ||
24 | struct sh64_platform { | ||
25 | unsigned int readonly_rootfs; | ||
26 | unsigned int ramdisk_flags; | ||
27 | unsigned int initial_root_dev; | ||
28 | unsigned int loader_type; | ||
29 | unsigned int initrd_start; | ||
30 | unsigned int initrd_size; | ||
31 | unsigned int fpu_flags; | ||
32 | unsigned int io_res_count; | ||
33 | unsigned int kram_res_count; | ||
34 | unsigned int xram_res_count; | ||
35 | unsigned int rom_res_count; | ||
36 | struct resource *io_res_p; | ||
37 | struct resource *kram_res_p; | ||
38 | struct resource *xram_res_p; | ||
39 | struct resource *rom_res_p; | ||
40 | }; | ||
41 | |||
42 | extern struct sh64_platform platform_parms; | ||
43 | |||
44 | extern unsigned long long memory_start, memory_end; | ||
45 | |||
46 | extern unsigned long long fpu_in_use; | ||
47 | |||
48 | extern int platform_int_priority[NR_INTC_IRQS]; | ||
49 | |||
50 | #define FPU_FLAGS (platform_parms.fpu_flags) | ||
51 | #define STANDARD_IO_RESOURCES (platform_parms.io_res_count) | ||
52 | #define STANDARD_KRAM_RESOURCES (platform_parms.kram_res_count) | ||
53 | #define STANDARD_XRAM_RESOURCES (platform_parms.xram_res_count) | ||
54 | #define STANDARD_ROM_RESOURCES (platform_parms.rom_res_count) | ||
55 | |||
56 | /* | ||
57 | * Kernel Memory description, Respectively: | ||
58 | * code = last but one memory descriptor | ||
59 | * data = last memory descriptor | ||
60 | */ | ||
61 | #define code_resource (platform_parms.kram_res_p[STANDARD_KRAM_RESOURCES - 2]) | ||
62 | #define data_resource (platform_parms.kram_res_p[STANDARD_KRAM_RESOURCES - 1]) | ||
63 | |||
64 | #endif /* __ASM_SH64_PLATFORM_H */ | ||
diff --git a/include/asm-sh64/poll.h b/include/asm-sh64/poll.h deleted file mode 100644 index ca2950267c53..000000000000 --- a/include/asm-sh64/poll.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_POLL_H | ||
2 | #define __ASM_SH64_POLL_H | ||
3 | |||
4 | #include <asm-generic/poll.h> | ||
5 | |||
6 | #undef POLLREMOVE | ||
7 | |||
8 | #endif /* __ASM_SH64_POLL_H */ | ||
diff --git a/include/asm-sh64/posix_types.h b/include/asm-sh64/posix_types.h deleted file mode 100644 index 0620317a6f0f..000000000000 --- a/include/asm-sh64/posix_types.h +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_POSIX_TYPES_H | ||
2 | #define __ASM_SH64_POSIX_TYPES_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/posix_types.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | * This file is generally used by user-level software, so you need to | ||
15 | * be a little careful about namespace pollution etc. Also, we cannot | ||
16 | * assume GCC is being used. | ||
17 | */ | ||
18 | |||
19 | typedef unsigned long __kernel_ino_t; | ||
20 | typedef unsigned short __kernel_mode_t; | ||
21 | typedef unsigned short __kernel_nlink_t; | ||
22 | typedef long __kernel_off_t; | ||
23 | typedef int __kernel_pid_t; | ||
24 | typedef unsigned short __kernel_ipc_pid_t; | ||
25 | typedef unsigned short __kernel_uid_t; | ||
26 | typedef unsigned short __kernel_gid_t; | ||
27 | typedef long unsigned int __kernel_size_t; | ||
28 | typedef int __kernel_ssize_t; | ||
29 | typedef int __kernel_ptrdiff_t; | ||
30 | typedef long __kernel_time_t; | ||
31 | typedef long __kernel_suseconds_t; | ||
32 | typedef long __kernel_clock_t; | ||
33 | typedef int __kernel_timer_t; | ||
34 | typedef int __kernel_clockid_t; | ||
35 | typedef int __kernel_daddr_t; | ||
36 | typedef char * __kernel_caddr_t; | ||
37 | typedef unsigned short __kernel_uid16_t; | ||
38 | typedef unsigned short __kernel_gid16_t; | ||
39 | typedef unsigned int __kernel_uid32_t; | ||
40 | typedef unsigned int __kernel_gid32_t; | ||
41 | |||
42 | typedef unsigned short __kernel_old_uid_t; | ||
43 | typedef unsigned short __kernel_old_gid_t; | ||
44 | typedef unsigned short __kernel_old_dev_t; | ||
45 | |||
46 | #ifdef __GNUC__ | ||
47 | typedef long long __kernel_loff_t; | ||
48 | #endif | ||
49 | |||
50 | typedef struct { | ||
51 | #if defined(__KERNEL__) || defined(__USE_ALL) | ||
52 | int val[2]; | ||
53 | #else /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | ||
54 | int __val[2]; | ||
55 | #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | ||
56 | } __kernel_fsid_t; | ||
57 | |||
58 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | ||
59 | |||
60 | #undef __FD_SET | ||
61 | static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
62 | { | ||
63 | unsigned long __tmp = __fd / __NFDBITS; | ||
64 | unsigned long __rem = __fd % __NFDBITS; | ||
65 | __fdsetp->fds_bits[__tmp] |= (1UL<<__rem); | ||
66 | } | ||
67 | |||
68 | #undef __FD_CLR | ||
69 | static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
70 | { | ||
71 | unsigned long __tmp = __fd / __NFDBITS; | ||
72 | unsigned long __rem = __fd % __NFDBITS; | ||
73 | __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem); | ||
74 | } | ||
75 | |||
76 | |||
77 | #undef __FD_ISSET | ||
78 | static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p) | ||
79 | { | ||
80 | unsigned long __tmp = __fd / __NFDBITS; | ||
81 | unsigned long __rem = __fd % __NFDBITS; | ||
82 | return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0; | ||
83 | } | ||
84 | |||
85 | /* | ||
86 | * This will unroll the loop for the normal constant case (8 ints, | ||
87 | * for a 256-bit fd_set) | ||
88 | */ | ||
89 | #undef __FD_ZERO | ||
90 | static __inline__ void __FD_ZERO(__kernel_fd_set *__p) | ||
91 | { | ||
92 | unsigned long *__tmp = __p->fds_bits; | ||
93 | int __i; | ||
94 | |||
95 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
96 | switch (__FDSET_LONGS) { | ||
97 | case 16: | ||
98 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
99 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
100 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
101 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
102 | __tmp[ 8] = 0; __tmp[ 9] = 0; | ||
103 | __tmp[10] = 0; __tmp[11] = 0; | ||
104 | __tmp[12] = 0; __tmp[13] = 0; | ||
105 | __tmp[14] = 0; __tmp[15] = 0; | ||
106 | return; | ||
107 | |||
108 | case 8: | ||
109 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
110 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
111 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
112 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
113 | return; | ||
114 | |||
115 | case 4: | ||
116 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
117 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
118 | return; | ||
119 | } | ||
120 | } | ||
121 | __i = __FDSET_LONGS; | ||
122 | while (__i) { | ||
123 | __i--; | ||
124 | *__tmp = 0; | ||
125 | __tmp++; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | ||
130 | |||
131 | #endif /* __ASM_SH64_POSIX_TYPES_H */ | ||
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h deleted file mode 100644 index eb2bee4b47b9..000000000000 --- a/include/asm-sh64/processor.h +++ /dev/null | |||
@@ -1,287 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PROCESSOR_H | ||
2 | #define __ASM_SH64_PROCESSOR_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/processor.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * Copyright (C) 2004 Richard Curnow | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <asm/page.h> | ||
18 | |||
19 | #ifndef __ASSEMBLY__ | ||
20 | |||
21 | #include <asm/types.h> | ||
22 | #include <asm/cache.h> | ||
23 | #include <asm/registers.h> | ||
24 | #include <linux/threads.h> | ||
25 | #include <linux/compiler.h> | ||
26 | |||
27 | /* | ||
28 | * Default implementation of macro that returns current | ||
29 | * instruction pointer ("program counter"). | ||
30 | */ | ||
31 | #define current_text_addr() ({ \ | ||
32 | void *pc; \ | ||
33 | unsigned long long __dummy = 0; \ | ||
34 | __asm__("gettr tr0, %1\n\t" \ | ||
35 | "pta 4, tr0\n\t" \ | ||
36 | "gettr tr0, %0\n\t" \ | ||
37 | "ptabs %1, tr0\n\t" \ | ||
38 | :"=r" (pc), "=r" (__dummy) \ | ||
39 | : "1" (__dummy)); \ | ||
40 | pc; }) | ||
41 | |||
42 | /* | ||
43 | * CPU type and hardware bug flags. Kept separately for each CPU. | ||
44 | */ | ||
45 | enum cpu_type { | ||
46 | CPU_SH5_101, | ||
47 | CPU_SH5_103, | ||
48 | CPU_SH_NONE | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * TLB information structure | ||
53 | * | ||
54 | * Defined for both I and D tlb, per-processor. | ||
55 | */ | ||
56 | struct tlb_info { | ||
57 | unsigned long long next; | ||
58 | unsigned long long first; | ||
59 | unsigned long long last; | ||
60 | |||
61 | unsigned int entries; | ||
62 | unsigned int step; | ||
63 | |||
64 | unsigned long flags; | ||
65 | }; | ||
66 | |||
67 | struct sh_cpuinfo { | ||
68 | enum cpu_type type; | ||
69 | unsigned long loops_per_jiffy; | ||
70 | |||
71 | char hard_math; | ||
72 | |||
73 | unsigned long *pgd_quick; | ||
74 | unsigned long *pmd_quick; | ||
75 | unsigned long *pte_quick; | ||
76 | unsigned long pgtable_cache_sz; | ||
77 | unsigned int cpu_clock, master_clock, bus_clock, module_clock; | ||
78 | |||
79 | /* Cache info */ | ||
80 | struct cache_info icache; | ||
81 | struct cache_info dcache; | ||
82 | |||
83 | /* TLB info */ | ||
84 | struct tlb_info itlb; | ||
85 | struct tlb_info dtlb; | ||
86 | }; | ||
87 | |||
88 | extern struct sh_cpuinfo boot_cpu_data; | ||
89 | |||
90 | #define cpu_data (&boot_cpu_data) | ||
91 | #define current_cpu_data boot_cpu_data | ||
92 | |||
93 | #endif | ||
94 | |||
95 | /* | ||
96 | * User space process size: 2GB - 4k. | ||
97 | */ | ||
98 | #define TASK_SIZE 0x7ffff000UL | ||
99 | |||
100 | /* This decides where the kernel will search for a free chunk of vm | ||
101 | * space during mmap's. | ||
102 | */ | ||
103 | #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) | ||
104 | |||
105 | /* | ||
106 | * Bit of SR register | ||
107 | * | ||
108 | * FD-bit: | ||
109 | * When it's set, it means the processor doesn't have right to use FPU, | ||
110 | * and it results exception when the floating operation is executed. | ||
111 | * | ||
112 | * IMASK-bit: | ||
113 | * Interrupt level mask | ||
114 | * | ||
115 | * STEP-bit: | ||
116 | * Single step bit | ||
117 | * | ||
118 | */ | ||
119 | #define SR_FD 0x00008000 | ||
120 | |||
121 | #if defined(CONFIG_SH64_SR_WATCH) | ||
122 | #define SR_MMU 0x84000000 | ||
123 | #else | ||
124 | #define SR_MMU 0x80000000 | ||
125 | #endif | ||
126 | |||
127 | #define SR_IMASK 0x000000f0 | ||
128 | #define SR_SSTEP 0x08000000 | ||
129 | |||
130 | #ifndef __ASSEMBLY__ | ||
131 | |||
132 | /* | ||
133 | * FPU structure and data : require 8-byte alignment as we need to access it | ||
134 | with fld.p, fst.p | ||
135 | */ | ||
136 | |||
137 | struct sh_fpu_hard_struct { | ||
138 | unsigned long fp_regs[64]; | ||
139 | unsigned int fpscr; | ||
140 | /* long status; * software status information */ | ||
141 | }; | ||
142 | |||
143 | #if 0 | ||
144 | /* Dummy fpu emulator */ | ||
145 | struct sh_fpu_soft_struct { | ||
146 | unsigned long long fp_regs[32]; | ||
147 | unsigned int fpscr; | ||
148 | unsigned char lookahead; | ||
149 | unsigned long entry_pc; | ||
150 | }; | ||
151 | #endif | ||
152 | |||
153 | union sh_fpu_union { | ||
154 | struct sh_fpu_hard_struct hard; | ||
155 | /* 'hard' itself only produces 32 bit alignment, yet we need | ||
156 | to access it using 64 bit load/store as well. */ | ||
157 | unsigned long long alignment_dummy; | ||
158 | }; | ||
159 | |||
160 | struct thread_struct { | ||
161 | unsigned long sp; | ||
162 | unsigned long pc; | ||
163 | /* This stores the address of the pt_regs built during a context | ||
164 | switch, or of the register save area built for a kernel mode | ||
165 | exception. It is used for backtracing the stack of a sleeping task | ||
166 | or one that traps in kernel mode. */ | ||
167 | struct pt_regs *kregs; | ||
168 | /* This stores the address of the pt_regs constructed on entry from | ||
169 | user mode. It is a fixed value over the lifetime of a process, or | ||
170 | NULL for a kernel thread. */ | ||
171 | struct pt_regs *uregs; | ||
172 | |||
173 | unsigned long trap_no, error_code; | ||
174 | unsigned long address; | ||
175 | /* Hardware debugging registers may come here */ | ||
176 | |||
177 | /* floating point info */ | ||
178 | union sh_fpu_union fpu; | ||
179 | }; | ||
180 | |||
181 | #define INIT_MMAP \ | ||
182 | { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } | ||
183 | |||
184 | extern struct pt_regs fake_swapper_regs; | ||
185 | |||
186 | #define INIT_THREAD { \ | ||
187 | .sp = sizeof(init_stack) + \ | ||
188 | (long) &init_stack, \ | ||
189 | .pc = 0, \ | ||
190 | .kregs = &fake_swapper_regs, \ | ||
191 | .uregs = NULL, \ | ||
192 | .trap_no = 0, \ | ||
193 | .error_code = 0, \ | ||
194 | .address = 0, \ | ||
195 | .fpu = { { { 0, } }, } \ | ||
196 | } | ||
197 | |||
198 | /* | ||
199 | * Do necessary setup to start up a newly executed thread. | ||
200 | */ | ||
201 | #define SR_USER (SR_MMU | SR_FD) | ||
202 | |||
203 | #define start_thread(regs, new_pc, new_sp) \ | ||
204 | set_fs(USER_DS); \ | ||
205 | regs->sr = SR_USER; /* User mode. */ \ | ||
206 | regs->pc = new_pc - 4; /* Compensate syscall exit */ \ | ||
207 | regs->pc |= 1; /* Set SHmedia ! */ \ | ||
208 | regs->regs[18] = 0; \ | ||
209 | regs->regs[15] = new_sp | ||
210 | |||
211 | /* Forward declaration, a strange C thing */ | ||
212 | struct task_struct; | ||
213 | struct mm_struct; | ||
214 | |||
215 | /* Free all resources held by a thread. */ | ||
216 | extern void release_thread(struct task_struct *); | ||
217 | /* | ||
218 | * create a kernel thread without removing it from tasklists | ||
219 | */ | ||
220 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | ||
221 | |||
222 | |||
223 | /* Copy and release all segment info associated with a VM */ | ||
224 | #define copy_segments(p, mm) do { } while (0) | ||
225 | #define release_segments(mm) do { } while (0) | ||
226 | #define forget_segments() do { } while (0) | ||
227 | #define prepare_to_copy(tsk) do { } while (0) | ||
228 | /* | ||
229 | * FPU lazy state save handling. | ||
230 | */ | ||
231 | |||
232 | static inline void release_fpu(void) | ||
233 | { | ||
234 | unsigned long long __dummy; | ||
235 | |||
236 | /* Set FD flag in SR */ | ||
237 | __asm__ __volatile__("getcon " __SR ", %0\n\t" | ||
238 | "or %0, %1, %0\n\t" | ||
239 | "putcon %0, " __SR "\n\t" | ||
240 | : "=&r" (__dummy) | ||
241 | : "r" (SR_FD)); | ||
242 | } | ||
243 | |||
244 | static inline void grab_fpu(void) | ||
245 | { | ||
246 | unsigned long long __dummy; | ||
247 | |||
248 | /* Clear out FD flag in SR */ | ||
249 | __asm__ __volatile__("getcon " __SR ", %0\n\t" | ||
250 | "and %0, %1, %0\n\t" | ||
251 | "putcon %0, " __SR "\n\t" | ||
252 | : "=&r" (__dummy) | ||
253 | : "r" (~SR_FD)); | ||
254 | } | ||
255 | |||
256 | /* Round to nearest, no exceptions on inexact, overflow, underflow, | ||
257 | zero-divide, invalid. Configure option for whether to flush denorms to | ||
258 | zero, or except if a denorm is encountered. */ | ||
259 | #if defined(CONFIG_SH64_FPU_DENORM_FLUSH) | ||
260 | #define FPSCR_INIT 0x00040000 | ||
261 | #else | ||
262 | #define FPSCR_INIT 0x00000000 | ||
263 | #endif | ||
264 | |||
265 | /* Save the current FP regs */ | ||
266 | void fpsave(struct sh_fpu_hard_struct *fpregs); | ||
267 | |||
268 | /* Initialise the FP state of a task */ | ||
269 | void fpinit(struct sh_fpu_hard_struct *fpregs); | ||
270 | |||
271 | extern struct task_struct *last_task_used_math; | ||
272 | |||
273 | /* | ||
274 | * Return saved PC of a blocked thread. | ||
275 | */ | ||
276 | #define thread_saved_pc(tsk) (tsk->thread.pc) | ||
277 | |||
278 | extern unsigned long get_wchan(struct task_struct *p); | ||
279 | |||
280 | #define KSTK_EIP(tsk) ((tsk)->thread.pc) | ||
281 | #define KSTK_ESP(tsk) ((tsk)->thread.sp) | ||
282 | |||
283 | #define cpu_relax() barrier() | ||
284 | |||
285 | #endif /* __ASSEMBLY__ */ | ||
286 | #endif /* __ASM_SH64_PROCESSOR_H */ | ||
287 | |||
diff --git a/include/asm-sh64/ptrace.h b/include/asm-sh64/ptrace.h deleted file mode 100644 index c424f80e3ae0..000000000000 --- a/include/asm-sh64/ptrace.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_PTRACE_H | ||
2 | #define __ASM_SH64_PTRACE_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/ptrace.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * This struct defines the way the registers are stored on the | ||
17 | * kernel stack during a system call or other kernel entry. | ||
18 | */ | ||
19 | struct pt_regs { | ||
20 | unsigned long long pc; | ||
21 | unsigned long long sr; | ||
22 | unsigned long long syscall_nr; | ||
23 | unsigned long long regs[63]; | ||
24 | unsigned long long tregs[8]; | ||
25 | unsigned long long pad[2]; | ||
26 | }; | ||
27 | |||
28 | #ifdef __KERNEL__ | ||
29 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) | ||
30 | #define instruction_pointer(regs) ((regs)->pc) | ||
31 | #define profile_pc(regs) ((unsigned long)instruction_pointer(regs)) | ||
32 | extern void show_regs(struct pt_regs *); | ||
33 | #endif | ||
34 | |||
35 | #endif /* __ASM_SH64_PTRACE_H */ | ||
diff --git a/include/asm-sh64/registers.h b/include/asm-sh64/registers.h deleted file mode 100644 index 7eec666acf84..000000000000 --- a/include/asm-sh64/registers.h +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_REGISTERS_H | ||
2 | #define __ASM_SH64_REGISTERS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/registers.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2004 Richard Curnow | ||
13 | */ | ||
14 | |||
15 | #ifdef __ASSEMBLY__ | ||
16 | /* ===================================================================== | ||
17 | ** | ||
18 | ** Section 1: acts on assembly sources pre-processed by GPP ( <source.S>). | ||
19 | ** Assigns symbolic names to control & target registers. | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | * Define some useful aliases for control registers. | ||
24 | */ | ||
25 | #define SR cr0 | ||
26 | #define SSR cr1 | ||
27 | #define PSSR cr2 | ||
28 | /* cr3 UNDEFINED */ | ||
29 | #define INTEVT cr4 | ||
30 | #define EXPEVT cr5 | ||
31 | #define PEXPEVT cr6 | ||
32 | #define TRA cr7 | ||
33 | #define SPC cr8 | ||
34 | #define PSPC cr9 | ||
35 | #define RESVEC cr10 | ||
36 | #define VBR cr11 | ||
37 | /* cr12 UNDEFINED */ | ||
38 | #define TEA cr13 | ||
39 | /* cr14-cr15 UNDEFINED */ | ||
40 | #define DCR cr16 | ||
41 | #define KCR0 cr17 | ||
42 | #define KCR1 cr18 | ||
43 | /* cr19-cr31 UNDEFINED */ | ||
44 | /* cr32-cr61 RESERVED */ | ||
45 | #define CTC cr62 | ||
46 | #define USR cr63 | ||
47 | |||
48 | /* | ||
49 | * ABI dependent registers (general purpose set) | ||
50 | */ | ||
51 | #define RET r2 | ||
52 | #define ARG1 r2 | ||
53 | #define ARG2 r3 | ||
54 | #define ARG3 r4 | ||
55 | #define ARG4 r5 | ||
56 | #define ARG5 r6 | ||
57 | #define ARG6 r7 | ||
58 | #define SP r15 | ||
59 | #define LINK r18 | ||
60 | #define ZERO r63 | ||
61 | |||
62 | /* | ||
63 | * Status register defines: used only by assembly sources (and | ||
64 | * syntax independednt) | ||
65 | */ | ||
66 | #define SR_RESET_VAL 0x0000000050008000 | ||
67 | #define SR_HARMLESS 0x00000000500080f0 /* Write ignores for most */ | ||
68 | #define SR_ENABLE_FPU 0xffffffffffff7fff /* AND with this */ | ||
69 | |||
70 | #if defined (CONFIG_SH64_SR_WATCH) | ||
71 | #define SR_ENABLE_MMU 0x0000000084000000 /* OR with this */ | ||
72 | #else | ||
73 | #define SR_ENABLE_MMU 0x0000000080000000 /* OR with this */ | ||
74 | #endif | ||
75 | |||
76 | #define SR_UNBLOCK_EXC 0xffffffffefffffff /* AND with this */ | ||
77 | #define SR_BLOCK_EXC 0x0000000010000000 /* OR with this */ | ||
78 | |||
79 | #else /* Not __ASSEMBLY__ syntax */ | ||
80 | |||
81 | /* | ||
82 | ** Stringify reg. name | ||
83 | */ | ||
84 | #define __str(x) #x | ||
85 | |||
86 | /* Stringify control register names for use in inline assembly */ | ||
87 | #define __SR __str(SR) | ||
88 | #define __SSR __str(SSR) | ||
89 | #define __PSSR __str(PSSR) | ||
90 | #define __INTEVT __str(INTEVT) | ||
91 | #define __EXPEVT __str(EXPEVT) | ||
92 | #define __PEXPEVT __str(PEXPEVT) | ||
93 | #define __TRA __str(TRA) | ||
94 | #define __SPC __str(SPC) | ||
95 | #define __PSPC __str(PSPC) | ||
96 | #define __RESVEC __str(RESVEC) | ||
97 | #define __VBR __str(VBR) | ||
98 | #define __TEA __str(TEA) | ||
99 | #define __DCR __str(DCR) | ||
100 | #define __KCR0 __str(KCR0) | ||
101 | #define __KCR1 __str(KCR1) | ||
102 | #define __CTC __str(CTC) | ||
103 | #define __USR __str(USR) | ||
104 | |||
105 | #endif /* __ASSEMBLY__ */ | ||
106 | #endif /* __ASM_SH64_REGISTERS_H */ | ||
diff --git a/include/asm-sh64/resource.h b/include/asm-sh64/resource.h deleted file mode 100644 index 8ff93944ae66..000000000000 --- a/include/asm-sh64/resource.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_RESOURCE_H | ||
2 | #define __ASM_SH64_RESOURCE_H | ||
3 | |||
4 | #include <asm-sh/resource.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_RESOURCE_H */ | ||
diff --git a/include/asm-sh64/scatterlist.h b/include/asm-sh64/scatterlist.h deleted file mode 100644 index 7f729bbfce43..000000000000 --- a/include/asm-sh64/scatterlist.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * include/asm-sh64/scatterlist.h | ||
7 | * | ||
8 | * Copyright (C) 2003 Paul Mundt | ||
9 | * | ||
10 | */ | ||
11 | #ifndef __ASM_SH64_SCATTERLIST_H | ||
12 | #define __ASM_SH64_SCATTERLIST_H | ||
13 | |||
14 | #include <asm/types.h> | ||
15 | |||
16 | struct scatterlist { | ||
17 | #ifdef CONFIG_DEBUG_SG | ||
18 | unsigned long sg_magic; | ||
19 | #endif | ||
20 | unsigned long page_link; | ||
21 | unsigned int offset;/* for highmem, page offset */ | ||
22 | dma_addr_t dma_address; | ||
23 | unsigned int length; | ||
24 | }; | ||
25 | |||
26 | /* These macros should be used after a pci_map_sg call has been done | ||
27 | * to get bus addresses of each of the SG entries and their lengths. | ||
28 | * You should only work with the number of sg entries pci_map_sg | ||
29 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
30 | * is 0. | ||
31 | */ | ||
32 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
33 | #define sg_dma_len(sg) ((sg)->length) | ||
34 | |||
35 | #define ISA_DMA_THRESHOLD (0xffffffff) | ||
36 | |||
37 | #endif /* !__ASM_SH64_SCATTERLIST_H */ | ||
diff --git a/include/asm-sh64/sci.h b/include/asm-sh64/sci.h deleted file mode 100644 index 793c568b7820..000000000000 --- a/include/asm-sh64/sci.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-sh/sci.h> | ||
diff --git a/include/asm-sh64/sections.h b/include/asm-sh64/sections.h deleted file mode 100644 index 897f36bcdf85..000000000000 --- a/include/asm-sh64/sections.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SECTIONS_H | ||
2 | #define __ASM_SH64_SECTIONS_H | ||
3 | |||
4 | #include <asm-sh/sections.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_SECTIONS_H */ | ||
7 | |||
diff --git a/include/asm-sh64/segment.h b/include/asm-sh64/segment.h deleted file mode 100644 index 92ac001fc483..000000000000 --- a/include/asm-sh64/segment.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_SEGMENT_H | ||
2 | #define _ASM_SEGMENT_H | ||
3 | |||
4 | /* Only here because we have some old header files that expect it.. */ | ||
5 | |||
6 | #endif /* _ASM_SEGMENT_H */ | ||
diff --git a/include/asm-sh64/semaphore-helper.h b/include/asm-sh64/semaphore-helper.h deleted file mode 100644 index fcfafe263e86..000000000000 --- a/include/asm-sh64/semaphore-helper.h +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SEMAPHORE_HELPER_H | ||
2 | #define __ASM_SH64_SEMAPHORE_HELPER_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/semaphore-helper.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | #include <asm/errno.h> | ||
15 | |||
16 | /* | ||
17 | * SMP- and interrupt-safe semaphores helper functions. | ||
18 | * | ||
19 | * (C) Copyright 1996 Linus Torvalds | ||
20 | * (C) Copyright 1999 Andrea Arcangeli | ||
21 | */ | ||
22 | |||
23 | /* | ||
24 | * These two _must_ execute atomically wrt each other. | ||
25 | * | ||
26 | * This is trivially done with load_locked/store_cond, | ||
27 | * which we have. Let the rest of the losers suck eggs. | ||
28 | */ | ||
29 | static __inline__ void wake_one_more(struct semaphore * sem) | ||
30 | { | ||
31 | atomic_inc((atomic_t *)&sem->sleepers); | ||
32 | } | ||
33 | |||
34 | static __inline__ int waking_non_zero(struct semaphore *sem) | ||
35 | { | ||
36 | unsigned long flags; | ||
37 | int ret = 0; | ||
38 | |||
39 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
40 | if (sem->sleepers > 0) { | ||
41 | sem->sleepers--; | ||
42 | ret = 1; | ||
43 | } | ||
44 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
45 | return ret; | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * waking_non_zero_interruptible: | ||
50 | * 1 got the lock | ||
51 | * 0 go to sleep | ||
52 | * -EINTR interrupted | ||
53 | * | ||
54 | * We must undo the sem->count down_interruptible() increment while we are | ||
55 | * protected by the spinlock in order to make atomic this atomic_inc() with the | ||
56 | * atomic_read() in wake_one_more(), otherwise we can race. -arca | ||
57 | */ | ||
58 | static __inline__ int waking_non_zero_interruptible(struct semaphore *sem, | ||
59 | struct task_struct *tsk) | ||
60 | { | ||
61 | unsigned long flags; | ||
62 | int ret = 0; | ||
63 | |||
64 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
65 | if (sem->sleepers > 0) { | ||
66 | sem->sleepers--; | ||
67 | ret = 1; | ||
68 | } else if (signal_pending(tsk)) { | ||
69 | atomic_inc(&sem->count); | ||
70 | ret = -EINTR; | ||
71 | } | ||
72 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
73 | return ret; | ||
74 | } | ||
75 | |||
76 | /* | ||
77 | * waking_non_zero_trylock: | ||
78 | * 1 failed to lock | ||
79 | * 0 got the lock | ||
80 | * | ||
81 | * We must undo the sem->count down_trylock() increment while we are | ||
82 | * protected by the spinlock in order to make atomic this atomic_inc() with the | ||
83 | * atomic_read() in wake_one_more(), otherwise we can race. -arca | ||
84 | */ | ||
85 | static __inline__ int waking_non_zero_trylock(struct semaphore *sem) | ||
86 | { | ||
87 | unsigned long flags; | ||
88 | int ret = 1; | ||
89 | |||
90 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
91 | if (sem->sleepers <= 0) | ||
92 | atomic_inc(&sem->count); | ||
93 | else { | ||
94 | sem->sleepers--; | ||
95 | ret = 0; | ||
96 | } | ||
97 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
98 | return ret; | ||
99 | } | ||
100 | |||
101 | #endif /* __ASM_SH64_SEMAPHORE_HELPER_H */ | ||
diff --git a/include/asm-sh64/semaphore.h b/include/asm-sh64/semaphore.h deleted file mode 100644 index f027cc14b55b..000000000000 --- a/include/asm-sh64/semaphore.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SEMAPHORE_H | ||
2 | #define __ASM_SH64_SEMAPHORE_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/semaphore.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | * SMP- and interrupt-safe semaphores. | ||
14 | * | ||
15 | * (C) Copyright 1996 Linus Torvalds | ||
16 | * | ||
17 | * SuperH verison by Niibe Yutaka | ||
18 | * (Currently no asm implementation but generic C code...) | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #include <linux/linkage.h> | ||
23 | #include <linux/spinlock.h> | ||
24 | #include <linux/wait.h> | ||
25 | #include <linux/rwsem.h> | ||
26 | |||
27 | #include <asm/system.h> | ||
28 | #include <asm/atomic.h> | ||
29 | |||
30 | struct semaphore { | ||
31 | atomic_t count; | ||
32 | int sleepers; | ||
33 | wait_queue_head_t wait; | ||
34 | }; | ||
35 | |||
36 | #define __SEMAPHORE_INITIALIZER(name, n) \ | ||
37 | { \ | ||
38 | .count = ATOMIC_INIT(n), \ | ||
39 | .sleepers = 0, \ | ||
40 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | ||
41 | } | ||
42 | |||
43 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | ||
44 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | ||
45 | |||
46 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | ||
47 | |||
48 | static inline void sema_init (struct semaphore *sem, int val) | ||
49 | { | ||
50 | /* | ||
51 | * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); | ||
52 | * | ||
53 | * i'd rather use the more flexible initialization above, but sadly | ||
54 | * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well. | ||
55 | */ | ||
56 | atomic_set(&sem->count, val); | ||
57 | sem->sleepers = 0; | ||
58 | init_waitqueue_head(&sem->wait); | ||
59 | } | ||
60 | |||
61 | static inline void init_MUTEX (struct semaphore *sem) | ||
62 | { | ||
63 | sema_init(sem, 1); | ||
64 | } | ||
65 | |||
66 | static inline void init_MUTEX_LOCKED (struct semaphore *sem) | ||
67 | { | ||
68 | sema_init(sem, 0); | ||
69 | } | ||
70 | |||
71 | #if 0 | ||
72 | asmlinkage void __down_failed(void /* special register calling convention */); | ||
73 | asmlinkage int __down_failed_interruptible(void /* params in registers */); | ||
74 | asmlinkage int __down_failed_trylock(void /* params in registers */); | ||
75 | asmlinkage void __up_wakeup(void /* special register calling convention */); | ||
76 | #endif | ||
77 | |||
78 | asmlinkage void __down(struct semaphore * sem); | ||
79 | asmlinkage int __down_interruptible(struct semaphore * sem); | ||
80 | asmlinkage int __down_trylock(struct semaphore * sem); | ||
81 | asmlinkage void __up(struct semaphore * sem); | ||
82 | |||
83 | extern spinlock_t semaphore_wake_lock; | ||
84 | |||
85 | static inline void down(struct semaphore * sem) | ||
86 | { | ||
87 | if (atomic_dec_return(&sem->count) < 0) | ||
88 | __down(sem); | ||
89 | } | ||
90 | |||
91 | static inline int down_interruptible(struct semaphore * sem) | ||
92 | { | ||
93 | int ret = 0; | ||
94 | |||
95 | if (atomic_dec_return(&sem->count) < 0) | ||
96 | ret = __down_interruptible(sem); | ||
97 | return ret; | ||
98 | } | ||
99 | |||
100 | static inline int down_trylock(struct semaphore * sem) | ||
101 | { | ||
102 | int ret = 0; | ||
103 | |||
104 | if (atomic_dec_return(&sem->count) < 0) | ||
105 | ret = __down_trylock(sem); | ||
106 | return ret; | ||
107 | } | ||
108 | |||
109 | /* | ||
110 | * Note! This is subtle. We jump to wake people up only if | ||
111 | * the semaphore was negative (== somebody was waiting on it). | ||
112 | */ | ||
113 | static inline void up(struct semaphore * sem) | ||
114 | { | ||
115 | if (atomic_inc_return(&sem->count) <= 0) | ||
116 | __up(sem); | ||
117 | } | ||
118 | |||
119 | #endif /* __ASM_SH64_SEMAPHORE_H */ | ||
diff --git a/include/asm-sh64/sembuf.h b/include/asm-sh64/sembuf.h deleted file mode 100644 index ec4d9f143577..000000000000 --- a/include/asm-sh64/sembuf.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SEMBUF_H | ||
2 | #define __ASM_SH64_SEMBUF_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/sembuf.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * The semid64_ds structure for i386 architecture. | ||
17 | * Note extra padding because this structure is passed back and forth | ||
18 | * between kernel and user space. | ||
19 | * | ||
20 | * Pad space is left for: | ||
21 | * - 64-bit time_t to solve y2038 problem | ||
22 | * - 2 miscellaneous 32-bit values | ||
23 | */ | ||
24 | |||
25 | struct semid64_ds { | ||
26 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
27 | __kernel_time_t sem_otime; /* last semop time */ | ||
28 | unsigned long __unused1; | ||
29 | __kernel_time_t sem_ctime; /* last change time */ | ||
30 | unsigned long __unused2; | ||
31 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
32 | unsigned long __unused3; | ||
33 | unsigned long __unused4; | ||
34 | }; | ||
35 | |||
36 | #endif /* __ASM_SH64_SEMBUF_H */ | ||
diff --git a/include/asm-sh64/serial.h b/include/asm-sh64/serial.h deleted file mode 100644 index e8d7b3f2da57..000000000000 --- a/include/asm-sh64/serial.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh64/serial.h | ||
3 | * | ||
4 | * Configuration details for 8250, 16450, 16550, etc. serial ports | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASM_SERIAL_H | ||
8 | #define _ASM_SERIAL_H | ||
9 | |||
10 | /* | ||
11 | * This assumes you have a 1.8432 MHz clock for your UART. | ||
12 | * | ||
13 | * It'd be nice if someone built a serial card with a 24.576 MHz | ||
14 | * clock, since the 16550A is capable of handling a top speed of 1.5 | ||
15 | * megabits/second; but this requires the faster clock. | ||
16 | */ | ||
17 | #define BASE_BAUD ( 1843200 / 16 ) | ||
18 | |||
19 | #define RS_TABLE_SIZE 2 | ||
20 | |||
21 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) | ||
22 | |||
23 | #define SERIAL_PORT_DFNS \ | ||
24 | /* UART CLK PORT IRQ FLAGS */ \ | ||
25 | { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ | ||
26 | { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */ | ||
27 | |||
28 | /* XXX: This should be moved ino irq.h */ | ||
29 | #define irq_cannonicalize(x) (x) | ||
30 | |||
31 | #endif /* _ASM_SERIAL_H */ | ||
diff --git a/include/asm-sh64/setup.h b/include/asm-sh64/setup.h deleted file mode 100644 index 5b07b14c2927..000000000000 --- a/include/asm-sh64/setup.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SETUP_H | ||
2 | #define __ASM_SH64_SETUP_H | ||
3 | |||
4 | #define COMMAND_LINE_SIZE 256 | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | |||
8 | #define PARAM ((unsigned char *)empty_zero_page) | ||
9 | #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000)) | ||
10 | #define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004)) | ||
11 | #define ORIG_ROOT_DEV (*(unsigned long *) (PARAM+0x008)) | ||
12 | #define LOADER_TYPE (*(unsigned long *) (PARAM+0x00c)) | ||
13 | #define INITRD_START (*(unsigned long *) (PARAM+0x010)) | ||
14 | #define INITRD_SIZE (*(unsigned long *) (PARAM+0x014)) | ||
15 | |||
16 | #define COMMAND_LINE ((char *) (PARAM+256)) | ||
17 | #define COMMAND_LINE_SIZE 256 | ||
18 | |||
19 | #endif /* __KERNEL__ */ | ||
20 | |||
21 | #endif /* __ASM_SH64_SETUP_H */ | ||
22 | |||
diff --git a/include/asm-sh64/shmbuf.h b/include/asm-sh64/shmbuf.h deleted file mode 100644 index 022f3494dd64..000000000000 --- a/include/asm-sh64/shmbuf.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SHMBUF_H | ||
2 | #define __ASM_SH64_SHMBUF_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/shmbuf.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * The shmid64_ds structure for i386 architecture. | ||
17 | * Note extra padding because this structure is passed back and forth | ||
18 | * between kernel and user space. | ||
19 | * | ||
20 | * Pad space is left for: | ||
21 | * - 64-bit time_t to solve y2038 problem | ||
22 | * - 2 miscellaneous 32-bit values | ||
23 | */ | ||
24 | |||
25 | struct shmid64_ds { | ||
26 | struct ipc64_perm shm_perm; /* operation perms */ | ||
27 | size_t shm_segsz; /* size of segment (bytes) */ | ||
28 | __kernel_time_t shm_atime; /* last attach time */ | ||
29 | unsigned long __unused1; | ||
30 | __kernel_time_t shm_dtime; /* last detach time */ | ||
31 | unsigned long __unused2; | ||
32 | __kernel_time_t shm_ctime; /* last change time */ | ||
33 | unsigned long __unused3; | ||
34 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
35 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
36 | unsigned long shm_nattch; /* no. of current attaches */ | ||
37 | unsigned long __unused4; | ||
38 | unsigned long __unused5; | ||
39 | }; | ||
40 | |||
41 | struct shminfo64 { | ||
42 | unsigned long shmmax; | ||
43 | unsigned long shmmin; | ||
44 | unsigned long shmmni; | ||
45 | unsigned long shmseg; | ||
46 | unsigned long shmall; | ||
47 | unsigned long __unused1; | ||
48 | unsigned long __unused2; | ||
49 | unsigned long __unused3; | ||
50 | unsigned long __unused4; | ||
51 | }; | ||
52 | |||
53 | #endif /* __ASM_SH64_SHMBUF_H */ | ||
diff --git a/include/asm-sh64/shmparam.h b/include/asm-sh64/shmparam.h deleted file mode 100644 index 1bb820c833ee..000000000000 --- a/include/asm-sh64/shmparam.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SHMPARAM_H | ||
2 | #define __ASM_SH64_SHMPARAM_H | ||
3 | |||
4 | /* | ||
5 | * Set this to a sensible safe default, we'll work out the specifics for the | ||
6 | * align mask from the cache descriptor at run-time. | ||
7 | */ | ||
8 | #define SHMLBA 0x4000 | ||
9 | |||
10 | #define __ARCH_FORCE_SHMLBA | ||
11 | |||
12 | #endif /* __ASM_SH64_SHMPARAM_H */ | ||
diff --git a/include/asm-sh64/sigcontext.h b/include/asm-sh64/sigcontext.h deleted file mode 100644 index 6293509d8cc1..000000000000 --- a/include/asm-sh64/sigcontext.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SIGCONTEXT_H | ||
2 | #define __ASM_SH64_SIGCONTEXT_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/sigcontext.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | struct sigcontext { | ||
16 | unsigned long oldmask; | ||
17 | |||
18 | /* CPU registers */ | ||
19 | unsigned long long sc_regs[63]; | ||
20 | unsigned long long sc_tregs[8]; | ||
21 | unsigned long long sc_pc; | ||
22 | unsigned long long sc_sr; | ||
23 | |||
24 | /* FPU registers */ | ||
25 | unsigned long long sc_fpregs[32]; | ||
26 | unsigned int sc_fpscr; | ||
27 | unsigned int sc_fpvalid; | ||
28 | }; | ||
29 | |||
30 | #endif /* __ASM_SH64_SIGCONTEXT_H */ | ||
diff --git a/include/asm-sh64/siginfo.h b/include/asm-sh64/siginfo.h deleted file mode 100644 index 56ef1da534d7..000000000000 --- a/include/asm-sh64/siginfo.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SIGINFO_H | ||
2 | #define __ASM_SH64_SIGINFO_H | ||
3 | |||
4 | #include <asm-generic/siginfo.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_SIGINFO_H */ | ||
diff --git a/include/asm-sh64/signal.h b/include/asm-sh64/signal.h deleted file mode 100644 index 244e134730d9..000000000000 --- a/include/asm-sh64/signal.h +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SIGNAL_H | ||
2 | #define __ASM_SH64_SIGNAL_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/signal.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | |||
17 | /* Avoid too many header ordering problems. */ | ||
18 | struct siginfo; | ||
19 | |||
20 | #define _NSIG 64 | ||
21 | #define _NSIG_BPW 32 | ||
22 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
23 | |||
24 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
25 | |||
26 | typedef struct { | ||
27 | unsigned long sig[_NSIG_WORDS]; | ||
28 | } sigset_t; | ||
29 | |||
30 | #define SIGHUP 1 | ||
31 | #define SIGINT 2 | ||
32 | #define SIGQUIT 3 | ||
33 | #define SIGILL 4 | ||
34 | #define SIGTRAP 5 | ||
35 | #define SIGABRT 6 | ||
36 | #define SIGIOT 6 | ||
37 | #define SIGBUS 7 | ||
38 | #define SIGFPE 8 | ||
39 | #define SIGKILL 9 | ||
40 | #define SIGUSR1 10 | ||
41 | #define SIGSEGV 11 | ||
42 | #define SIGUSR2 12 | ||
43 | #define SIGPIPE 13 | ||
44 | #define SIGALRM 14 | ||
45 | #define SIGTERM 15 | ||
46 | #define SIGSTKFLT 16 | ||
47 | #define SIGCHLD 17 | ||
48 | #define SIGCONT 18 | ||
49 | #define SIGSTOP 19 | ||
50 | #define SIGTSTP 20 | ||
51 | #define SIGTTIN 21 | ||
52 | #define SIGTTOU 22 | ||
53 | #define SIGURG 23 | ||
54 | #define SIGXCPU 24 | ||
55 | #define SIGXFSZ 25 | ||
56 | #define SIGVTALRM 26 | ||
57 | #define SIGPROF 27 | ||
58 | #define SIGWINCH 28 | ||
59 | #define SIGIO 29 | ||
60 | #define SIGPOLL SIGIO | ||
61 | /* | ||
62 | #define SIGLOST 29 | ||
63 | */ | ||
64 | #define SIGPWR 30 | ||
65 | #define SIGSYS 31 | ||
66 | #define SIGUNUSED 31 | ||
67 | |||
68 | /* These should not be considered constants from userland. */ | ||
69 | #define SIGRTMIN 32 | ||
70 | #define SIGRTMAX (_NSIG-1) | ||
71 | |||
72 | /* | ||
73 | * SA_FLAGS values: | ||
74 | * | ||
75 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
76 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
77 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
78 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
79 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
80 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
81 | * | ||
82 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
83 | * Unix names RESETHAND and NODEFER respectively. | ||
84 | */ | ||
85 | #define SA_NOCLDSTOP 0x00000001 | ||
86 | #define SA_NOCLDWAIT 0x00000002 /* not supported yet */ | ||
87 | #define SA_SIGINFO 0x00000004 | ||
88 | #define SA_ONSTACK 0x08000000 | ||
89 | #define SA_RESTART 0x10000000 | ||
90 | #define SA_NODEFER 0x40000000 | ||
91 | #define SA_RESETHAND 0x80000000 | ||
92 | |||
93 | #define SA_NOMASK SA_NODEFER | ||
94 | #define SA_ONESHOT SA_RESETHAND | ||
95 | |||
96 | #define SA_RESTORER 0x04000000 | ||
97 | |||
98 | /* | ||
99 | * sigaltstack controls | ||
100 | */ | ||
101 | #define SS_ONSTACK 1 | ||
102 | #define SS_DISABLE 2 | ||
103 | |||
104 | #define MINSIGSTKSZ 2048 | ||
105 | #define SIGSTKSZ THREAD_SIZE | ||
106 | |||
107 | #include <asm-generic/signal.h> | ||
108 | |||
109 | #ifdef __KERNEL__ | ||
110 | struct old_sigaction { | ||
111 | __sighandler_t sa_handler; | ||
112 | old_sigset_t sa_mask; | ||
113 | unsigned long sa_flags; | ||
114 | void (*sa_restorer)(void); | ||
115 | }; | ||
116 | |||
117 | struct sigaction { | ||
118 | __sighandler_t sa_handler; | ||
119 | unsigned long sa_flags; | ||
120 | void (*sa_restorer)(void); | ||
121 | sigset_t sa_mask; /* mask last for extensibility */ | ||
122 | }; | ||
123 | |||
124 | struct k_sigaction { | ||
125 | struct sigaction sa; | ||
126 | }; | ||
127 | #else | ||
128 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
129 | |||
130 | struct sigaction { | ||
131 | union { | ||
132 | __sighandler_t _sa_handler; | ||
133 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
134 | } _u; | ||
135 | sigset_t sa_mask; | ||
136 | unsigned long sa_flags; | ||
137 | void (*sa_restorer)(void); | ||
138 | }; | ||
139 | |||
140 | #define sa_handler _u._sa_handler | ||
141 | #define sa_sigaction _u._sa_sigaction | ||
142 | |||
143 | #endif /* __KERNEL__ */ | ||
144 | |||
145 | typedef struct sigaltstack { | ||
146 | void *ss_sp; | ||
147 | int ss_flags; | ||
148 | size_t ss_size; | ||
149 | } stack_t; | ||
150 | |||
151 | #ifdef __KERNEL__ | ||
152 | #include <asm/sigcontext.h> | ||
153 | |||
154 | #define sigmask(sig) (1UL << ((sig) - 1)) | ||
155 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | ||
156 | |||
157 | #endif /* __KERNEL__ */ | ||
158 | |||
159 | #endif /* __ASM_SH64_SIGNAL_H */ | ||
diff --git a/include/asm-sh64/smp.h b/include/asm-sh64/smp.h deleted file mode 100644 index 4a4d0da39a84..000000000000 --- a/include/asm-sh64/smp.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SMP_H | ||
2 | #define __ASM_SH64_SMP_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/smp.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #endif /* __ASM_SH64_SMP_H */ | ||
diff --git a/include/asm-sh64/socket.h b/include/asm-sh64/socket.h deleted file mode 100644 index 1853f7246ab0..000000000000 --- a/include/asm-sh64/socket.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SOCKET_H | ||
2 | #define __ASM_SH64_SOCKET_H | ||
3 | |||
4 | #include <asm-sh/socket.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_SOCKET_H */ | ||
diff --git a/include/asm-sh64/sockios.h b/include/asm-sh64/sockios.h deleted file mode 100644 index 419e76f12f41..000000000000 --- a/include/asm-sh64/sockios.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SOCKIOS_H | ||
2 | #define __ASM_SH64_SOCKIOS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/sockios.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /* Socket-level I/O control calls. */ | ||
16 | #define FIOGETOWN _IOR('f', 123, int) | ||
17 | #define FIOSETOWN _IOW('f', 124, int) | ||
18 | |||
19 | #define SIOCATMARK _IOR('s', 7, int) | ||
20 | #define SIOCSPGRP _IOW('s', 8, pid_t) | ||
21 | #define SIOCGPGRP _IOR('s', 9, pid_t) | ||
22 | |||
23 | #define SIOCGSTAMP _IOR('s', 100, struct timeval) /* Get stamp (timeval) */ | ||
24 | #define SIOCGSTAMPNS _IOR('s', 101, struct timespec) /* Get stamp (timespec) */ | ||
25 | #endif /* __ASM_SH64_SOCKIOS_H */ | ||
diff --git a/include/asm-sh64/spinlock.h b/include/asm-sh64/spinlock.h deleted file mode 100644 index 296b0c9b24a2..000000000000 --- a/include/asm-sh64/spinlock.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SPINLOCK_H | ||
2 | #define __ASM_SH64_SPINLOCK_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/spinlock.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #error "No SMP on SH64" | ||
16 | |||
17 | #endif /* __ASM_SH64_SPINLOCK_H */ | ||
diff --git a/include/asm-sh64/stat.h b/include/asm-sh64/stat.h deleted file mode 100644 index 86f551b1987e..000000000000 --- a/include/asm-sh64/stat.h +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_STAT_H | ||
2 | #define __ASM_SH64_STAT_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/stat.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | struct __old_kernel_stat { | ||
16 | unsigned short st_dev; | ||
17 | unsigned short st_ino; | ||
18 | unsigned short st_mode; | ||
19 | unsigned short st_nlink; | ||
20 | unsigned short st_uid; | ||
21 | unsigned short st_gid; | ||
22 | unsigned short st_rdev; | ||
23 | unsigned long st_size; | ||
24 | unsigned long st_atime; | ||
25 | unsigned long st_mtime; | ||
26 | unsigned long st_ctime; | ||
27 | }; | ||
28 | |||
29 | struct stat { | ||
30 | unsigned short st_dev; | ||
31 | unsigned short __pad1; | ||
32 | unsigned long st_ino; | ||
33 | unsigned short st_mode; | ||
34 | unsigned short st_nlink; | ||
35 | unsigned short st_uid; | ||
36 | unsigned short st_gid; | ||
37 | unsigned short st_rdev; | ||
38 | unsigned short __pad2; | ||
39 | unsigned long st_size; | ||
40 | unsigned long st_blksize; | ||
41 | unsigned long st_blocks; | ||
42 | unsigned long st_atime; | ||
43 | unsigned long st_atime_nsec; | ||
44 | unsigned long st_mtime; | ||
45 | unsigned long st_mtime_nsec; | ||
46 | unsigned long st_ctime; | ||
47 | unsigned long st_ctime_nsec; | ||
48 | unsigned long __unused4; | ||
49 | unsigned long __unused5; | ||
50 | }; | ||
51 | |||
52 | /* This matches struct stat64 in glibc2.1, hence the absolutely | ||
53 | * insane amounts of padding around dev_t's. | ||
54 | */ | ||
55 | struct stat64 { | ||
56 | unsigned short st_dev; | ||
57 | unsigned char __pad0[10]; | ||
58 | |||
59 | unsigned long st_ino; | ||
60 | unsigned int st_mode; | ||
61 | unsigned int st_nlink; | ||
62 | |||
63 | unsigned long st_uid; | ||
64 | unsigned long st_gid; | ||
65 | |||
66 | unsigned short st_rdev; | ||
67 | unsigned char __pad3[10]; | ||
68 | |||
69 | long long st_size; | ||
70 | unsigned long st_blksize; | ||
71 | |||
72 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
73 | unsigned long __pad4; /* future possible st_blocks high bits */ | ||
74 | |||
75 | unsigned long st_atime; | ||
76 | unsigned long st_atime_nsec; | ||
77 | |||
78 | unsigned long st_mtime; | ||
79 | unsigned long st_mtime_nsec; | ||
80 | |||
81 | unsigned long st_ctime; | ||
82 | unsigned long st_ctime_nsec; /* will be high 32 bits of ctime someday */ | ||
83 | |||
84 | unsigned long __unused1; | ||
85 | unsigned long __unused2; | ||
86 | }; | ||
87 | |||
88 | #endif /* __ASM_SH64_STAT_H */ | ||
diff --git a/include/asm-sh64/statfs.h b/include/asm-sh64/statfs.h deleted file mode 100644 index 083fd79b2417..000000000000 --- a/include/asm-sh64/statfs.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_STATFS_H | ||
2 | #define __ASM_SH64_STATFS_H | ||
3 | |||
4 | #include <asm-generic/statfs.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_STATFS_H */ | ||
diff --git a/include/asm-sh64/string.h b/include/asm-sh64/string.h deleted file mode 100644 index 8a7357366ce8..000000000000 --- a/include/asm-sh64/string.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_STRING_H | ||
2 | #define __ASM_SH64_STRING_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/string.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | * Empty on purpose. ARCH SH64 ASM libs are out of the current project scope. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #define __HAVE_ARCH_MEMCPY | ||
18 | |||
19 | extern void *memcpy(void *dest, const void *src, size_t count); | ||
20 | |||
21 | #endif | ||
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h deleted file mode 100644 index be2a15ffcc55..000000000000 --- a/include/asm-sh64/system.h +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_SYSTEM_H | ||
2 | #define __ASM_SH64_SYSTEM_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/system.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * Copyright (C) 2004 Richard Curnow | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <asm/registers.h> | ||
18 | #include <asm/processor.h> | ||
19 | |||
20 | /* | ||
21 | * switch_to() should switch tasks to task nr n, first | ||
22 | */ | ||
23 | |||
24 | typedef struct { | ||
25 | unsigned long seg; | ||
26 | } mm_segment_t; | ||
27 | |||
28 | extern struct task_struct *sh64_switch_to(struct task_struct *prev, | ||
29 | struct thread_struct *prev_thread, | ||
30 | struct task_struct *next, | ||
31 | struct thread_struct *next_thread); | ||
32 | |||
33 | #define switch_to(prev,next,last) \ | ||
34 | do {\ | ||
35 | if (last_task_used_math != next) {\ | ||
36 | struct pt_regs *regs = next->thread.uregs;\ | ||
37 | if (regs) regs->sr |= SR_FD;\ | ||
38 | }\ | ||
39 | last = sh64_switch_to(prev, &prev->thread, next, &next->thread);\ | ||
40 | } while(0) | ||
41 | |||
42 | #define nop() __asm__ __volatile__ ("nop") | ||
43 | |||
44 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | ||
45 | |||
46 | extern void __xchg_called_with_bad_pointer(void); | ||
47 | |||
48 | #define mb() __asm__ __volatile__ ("synco": : :"memory") | ||
49 | #define rmb() mb() | ||
50 | #define wmb() __asm__ __volatile__ ("synco": : :"memory") | ||
51 | #define read_barrier_depends() do { } while (0) | ||
52 | |||
53 | #ifdef CONFIG_SMP | ||
54 | #define smp_mb() mb() | ||
55 | #define smp_rmb() rmb() | ||
56 | #define smp_wmb() wmb() | ||
57 | #define smp_read_barrier_depends() read_barrier_depends() | ||
58 | #else | ||
59 | #define smp_mb() barrier() | ||
60 | #define smp_rmb() barrier() | ||
61 | #define smp_wmb() barrier() | ||
62 | #define smp_read_barrier_depends() do { } while (0) | ||
63 | #endif /* CONFIG_SMP */ | ||
64 | |||
65 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) | ||
66 | |||
67 | /* Interrupt Control */ | ||
68 | #ifndef HARD_CLI | ||
69 | #define SR_MASK_L 0x000000f0L | ||
70 | #define SR_MASK_LL 0x00000000000000f0LL | ||
71 | #else | ||
72 | #define SR_MASK_L 0x10000000L | ||
73 | #define SR_MASK_LL 0x0000000010000000LL | ||
74 | #endif | ||
75 | |||
76 | static __inline__ void local_irq_enable(void) | ||
77 | { | ||
78 | /* cli/sti based on SR.BL */ | ||
79 | unsigned long long __dummy0, __dummy1=~SR_MASK_LL; | ||
80 | |||
81 | __asm__ __volatile__("getcon " __SR ", %0\n\t" | ||
82 | "and %0, %1, %0\n\t" | ||
83 | "putcon %0, " __SR "\n\t" | ||
84 | : "=&r" (__dummy0) | ||
85 | : "r" (__dummy1)); | ||
86 | } | ||
87 | |||
88 | static __inline__ void local_irq_disable(void) | ||
89 | { | ||
90 | /* cli/sti based on SR.BL */ | ||
91 | unsigned long long __dummy0, __dummy1=SR_MASK_LL; | ||
92 | __asm__ __volatile__("getcon " __SR ", %0\n\t" | ||
93 | "or %0, %1, %0\n\t" | ||
94 | "putcon %0, " __SR "\n\t" | ||
95 | : "=&r" (__dummy0) | ||
96 | : "r" (__dummy1)); | ||
97 | } | ||
98 | |||
99 | #define local_save_flags(x) \ | ||
100 | (__extension__ ({ unsigned long long __dummy=SR_MASK_LL; \ | ||
101 | __asm__ __volatile__( \ | ||
102 | "getcon " __SR ", %0\n\t" \ | ||
103 | "and %0, %1, %0" \ | ||
104 | : "=&r" (x) \ | ||
105 | : "r" (__dummy));})) | ||
106 | |||
107 | #define local_irq_save(x) \ | ||
108 | (__extension__ ({ unsigned long long __d2=SR_MASK_LL, __d1; \ | ||
109 | __asm__ __volatile__( \ | ||
110 | "getcon " __SR ", %1\n\t" \ | ||
111 | "or %1, r63, %0\n\t" \ | ||
112 | "or %1, %2, %1\n\t" \ | ||
113 | "putcon %1, " __SR "\n\t" \ | ||
114 | "and %0, %2, %0" \ | ||
115 | : "=&r" (x), "=&r" (__d1) \ | ||
116 | : "r" (__d2));})); | ||
117 | |||
118 | #define local_irq_restore(x) do { \ | ||
119 | if ( ((x) & SR_MASK_L) == 0 ) /* dropping to 0 ? */ \ | ||
120 | local_irq_enable(); /* yes...re-enable */ \ | ||
121 | } while (0) | ||
122 | |||
123 | #define irqs_disabled() \ | ||
124 | ({ \ | ||
125 | unsigned long flags; \ | ||
126 | local_save_flags(flags); \ | ||
127 | (flags != 0); \ | ||
128 | }) | ||
129 | |||
130 | static inline unsigned long xchg_u32(volatile int * m, unsigned long val) | ||
131 | { | ||
132 | unsigned long flags, retval; | ||
133 | |||
134 | local_irq_save(flags); | ||
135 | retval = *m; | ||
136 | *m = val; | ||
137 | local_irq_restore(flags); | ||
138 | return retval; | ||
139 | } | ||
140 | |||
141 | static inline unsigned long xchg_u8(volatile unsigned char * m, unsigned long val) | ||
142 | { | ||
143 | unsigned long flags, retval; | ||
144 | |||
145 | local_irq_save(flags); | ||
146 | retval = *m; | ||
147 | *m = val & 0xff; | ||
148 | local_irq_restore(flags); | ||
149 | return retval; | ||
150 | } | ||
151 | |||
152 | static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, int size) | ||
153 | { | ||
154 | switch (size) { | ||
155 | case 4: | ||
156 | return xchg_u32(ptr, x); | ||
157 | break; | ||
158 | case 1: | ||
159 | return xchg_u8(ptr, x); | ||
160 | break; | ||
161 | } | ||
162 | __xchg_called_with_bad_pointer(); | ||
163 | return x; | ||
164 | } | ||
165 | |||
166 | /* XXX | ||
167 | * disable hlt during certain critical i/o operations | ||
168 | */ | ||
169 | #define HAVE_DISABLE_HLT | ||
170 | void disable_hlt(void); | ||
171 | void enable_hlt(void); | ||
172 | |||
173 | |||
174 | #define smp_mb() barrier() | ||
175 | #define smp_rmb() barrier() | ||
176 | #define smp_wmb() barrier() | ||
177 | |||
178 | #ifdef CONFIG_SH_ALPHANUMERIC | ||
179 | /* This is only used for debugging. */ | ||
180 | extern void print_seg(char *file,int line); | ||
181 | #define PLS() print_seg(__FILE__,__LINE__) | ||
182 | #else /* CONFIG_SH_ALPHANUMERIC */ | ||
183 | #define PLS() | ||
184 | #endif /* CONFIG_SH_ALPHANUMERIC */ | ||
185 | |||
186 | #define PL() printk("@ <%s,%s:%d>\n",__FILE__,__FUNCTION__,__LINE__) | ||
187 | |||
188 | #define arch_align_stack(x) (x) | ||
189 | |||
190 | #endif /* __ASM_SH64_SYSTEM_H */ | ||
diff --git a/include/asm-sh64/termbits.h b/include/asm-sh64/termbits.h deleted file mode 100644 index 86bde5ec1414..000000000000 --- a/include/asm-sh64/termbits.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_TERMBITS_H | ||
2 | #define __ASM_SH64_TERMBITS_H | ||
3 | |||
4 | #include <asm-sh/termbits.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_TERMBITS_H */ | ||
diff --git a/include/asm-sh64/termios.h b/include/asm-sh64/termios.h deleted file mode 100644 index dc44e6ed3a7c..000000000000 --- a/include/asm-sh64/termios.h +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_TERMIOS_H | ||
2 | #define __ASM_SH64_TERMIOS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/termios.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <asm/termbits.h> | ||
16 | #include <asm/ioctls.h> | ||
17 | |||
18 | struct winsize { | ||
19 | unsigned short ws_row; | ||
20 | unsigned short ws_col; | ||
21 | unsigned short ws_xpixel; | ||
22 | unsigned short ws_ypixel; | ||
23 | }; | ||
24 | |||
25 | #define NCC 8 | ||
26 | struct termio { | ||
27 | unsigned short c_iflag; /* input mode flags */ | ||
28 | unsigned short c_oflag; /* output mode flags */ | ||
29 | unsigned short c_cflag; /* control mode flags */ | ||
30 | unsigned short c_lflag; /* local mode flags */ | ||
31 | unsigned char c_line; /* line discipline */ | ||
32 | unsigned char c_cc[NCC]; /* control characters */ | ||
33 | }; | ||
34 | |||
35 | /* modem lines */ | ||
36 | #define TIOCM_LE 0x001 | ||
37 | #define TIOCM_DTR 0x002 | ||
38 | #define TIOCM_RTS 0x004 | ||
39 | #define TIOCM_ST 0x008 | ||
40 | #define TIOCM_SR 0x010 | ||
41 | #define TIOCM_CTS 0x020 | ||
42 | #define TIOCM_CAR 0x040 | ||
43 | #define TIOCM_RNG 0x080 | ||
44 | #define TIOCM_DSR 0x100 | ||
45 | #define TIOCM_CD TIOCM_CAR | ||
46 | #define TIOCM_RI TIOCM_RNG | ||
47 | #define TIOCM_OUT1 0x2000 | ||
48 | #define TIOCM_OUT2 0x4000 | ||
49 | #define TIOCM_LOOP 0x8000 | ||
50 | |||
51 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
52 | |||
53 | #ifdef __KERNEL__ | ||
54 | |||
55 | /* intr=^C quit=^\ erase=del kill=^U | ||
56 | eof=^D vtime=\0 vmin=\1 sxtc=\0 | ||
57 | start=^Q stop=^S susp=^Z eol=\0 | ||
58 | reprint=^R discard=^U werase=^W lnext=^V | ||
59 | eol2=\0 | ||
60 | */ | ||
61 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" | ||
62 | |||
63 | /* | ||
64 | * Translate a "termio" structure into a "termios". Ugh. | ||
65 | */ | ||
66 | #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ | ||
67 | unsigned short __tmp; \ | ||
68 | get_user(__tmp,&(termio)->x); \ | ||
69 | *(unsigned short *) &(termios)->x = __tmp; \ | ||
70 | } | ||
71 | |||
72 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
73 | ({ \ | ||
74 | SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ | ||
75 | SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ | ||
76 | SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ | ||
77 | SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ | ||
78 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
79 | }) | ||
80 | |||
81 | /* | ||
82 | * Translate a "termios" structure into a "termio". Ugh. | ||
83 | */ | ||
84 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
85 | ({ \ | ||
86 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
87 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
88 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
89 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
90 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
91 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
92 | }) | ||
93 | |||
94 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
95 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
96 | |||
97 | #endif /* __KERNEL__ */ | ||
98 | |||
99 | #endif /* __ASM_SH64_TERMIOS_H */ | ||
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h deleted file mode 100644 index f6d5117c53af..000000000000 --- a/include/asm-sh64/thread_info.h +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_THREAD_INFO_H | ||
2 | #define __ASM_SH64_THREAD_INFO_H | ||
3 | |||
4 | /* | ||
5 | * SuperH 5 version | ||
6 | * Copyright (C) 2003 Paul Mundt | ||
7 | */ | ||
8 | |||
9 | #ifdef __KERNEL__ | ||
10 | |||
11 | #ifndef __ASSEMBLY__ | ||
12 | #include <asm/registers.h> | ||
13 | |||
14 | /* | ||
15 | * low level task data that entry.S needs immediate access to | ||
16 | * - this struct should fit entirely inside of one cache line | ||
17 | * - this struct shares the supervisor stack pages | ||
18 | * - if the contents of this structure are changed, the assembly constants must also be changed | ||
19 | */ | ||
20 | struct thread_info { | ||
21 | struct task_struct *task; /* main task structure */ | ||
22 | struct exec_domain *exec_domain; /* execution domain */ | ||
23 | unsigned long flags; /* low level flags */ | ||
24 | /* Put the 4 32-bit fields together to make asm offsetting easier. */ | ||
25 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | ||
26 | __u16 cpu; | ||
27 | |||
28 | mm_segment_t addr_limit; | ||
29 | struct restart_block restart_block; | ||
30 | |||
31 | __u8 supervisor_stack[0]; | ||
32 | }; | ||
33 | |||
34 | /* | ||
35 | * macros/functions for gaining access to the thread information structure | ||
36 | */ | ||
37 | #define INIT_THREAD_INFO(tsk) \ | ||
38 | { \ | ||
39 | .task = &tsk, \ | ||
40 | .exec_domain = &default_exec_domain, \ | ||
41 | .flags = 0, \ | ||
42 | .cpu = 0, \ | ||
43 | .preempt_count = 1, \ | ||
44 | .addr_limit = KERNEL_DS, \ | ||
45 | .restart_block = { \ | ||
46 | .fn = do_no_restart_syscall, \ | ||
47 | }, \ | ||
48 | } | ||
49 | |||
50 | #define init_thread_info (init_thread_union.thread_info) | ||
51 | #define init_stack (init_thread_union.stack) | ||
52 | |||
53 | /* how to get the thread information struct from C */ | ||
54 | static inline struct thread_info *current_thread_info(void) | ||
55 | { | ||
56 | struct thread_info *ti; | ||
57 | |||
58 | __asm__ __volatile__ ("getcon " __KCR0 ", %0\n\t" : "=r" (ti)); | ||
59 | |||
60 | return ti; | ||
61 | } | ||
62 | |||
63 | /* thread information allocation */ | ||
64 | |||
65 | |||
66 | |||
67 | #define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | ||
68 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
69 | |||
70 | #endif /* __ASSEMBLY__ */ | ||
71 | |||
72 | #define THREAD_SIZE 8192 | ||
73 | |||
74 | #define PREEMPT_ACTIVE 0x10000000 | ||
75 | |||
76 | /* thread information flags */ | ||
77 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | ||
78 | #define TIF_SIGPENDING 2 /* signal pending */ | ||
79 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | ||
80 | #define TIF_MEMDIE 4 | ||
81 | #define TIF_RESTORE_SIGMASK 5 /* Restore signal mask in do_signal */ | ||
82 | |||
83 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | ||
84 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | ||
85 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | ||
86 | #define _TIF_MEMDIE (1 << TIF_MEMDIE) | ||
87 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
88 | |||
89 | #endif /* __KERNEL__ */ | ||
90 | |||
91 | #endif /* __ASM_SH64_THREAD_INFO_H */ | ||
diff --git a/include/asm-sh64/timex.h b/include/asm-sh64/timex.h deleted file mode 100644 index 163e2b62fe27..000000000000 --- a/include/asm-sh64/timex.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_TIMEX_H | ||
2 | #define __ASM_SH64_TIMEX_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/timex.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 Paul Mundt | ||
13 | * | ||
14 | * sh-5 architecture timex specifications | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
19 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ | ||
20 | |||
21 | typedef unsigned long cycles_t; | ||
22 | |||
23 | static __inline__ cycles_t get_cycles (void) | ||
24 | { | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | #define vxtime_lock() do {} while (0) | ||
29 | #define vxtime_unlock() do {} while (0) | ||
30 | |||
31 | #endif /* __ASM_SH64_TIMEX_H */ | ||
diff --git a/include/asm-sh64/tlb.h b/include/asm-sh64/tlb.h deleted file mode 100644 index 4979408bd88c..000000000000 --- a/include/asm-sh64/tlb.h +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh64/tlb.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | */ | ||
11 | #ifndef __ASM_SH64_TLB_H | ||
12 | #define __ASM_SH64_TLB_H | ||
13 | |||
14 | /* | ||
15 | * Note! These are mostly unused, we just need the xTLB_LAST_VAR_UNRESTRICTED | ||
16 | * for head.S! Once this limitation is gone, we can clean the rest of this up. | ||
17 | */ | ||
18 | |||
19 | /* ITLB defines */ | ||
20 | #define ITLB_FIXED 0x00000000 /* First fixed ITLB, see head.S */ | ||
21 | #define ITLB_LAST_VAR_UNRESTRICTED 0x000003F0 /* Last ITLB */ | ||
22 | |||
23 | /* DTLB defines */ | ||
24 | #define DTLB_FIXED 0x00800000 /* First fixed DTLB, see head.S */ | ||
25 | #define DTLB_LAST_VAR_UNRESTRICTED 0x008003F0 /* Last DTLB */ | ||
26 | |||
27 | #ifndef __ASSEMBLY__ | ||
28 | |||
29 | /** | ||
30 | * for_each_dtlb_entry | ||
31 | * | ||
32 | * @tlb: TLB entry | ||
33 | * | ||
34 | * Iterate over free (non-wired) DTLB entries | ||
35 | */ | ||
36 | #define for_each_dtlb_entry(tlb) \ | ||
37 | for (tlb = cpu_data->dtlb.first; \ | ||
38 | tlb <= cpu_data->dtlb.last; \ | ||
39 | tlb += cpu_data->dtlb.step) | ||
40 | |||
41 | /** | ||
42 | * for_each_itlb_entry | ||
43 | * | ||
44 | * @tlb: TLB entry | ||
45 | * | ||
46 | * Iterate over free (non-wired) ITLB entries | ||
47 | */ | ||
48 | #define for_each_itlb_entry(tlb) \ | ||
49 | for (tlb = cpu_data->itlb.first; \ | ||
50 | tlb <= cpu_data->itlb.last; \ | ||
51 | tlb += cpu_data->itlb.step) | ||
52 | |||
53 | /** | ||
54 | * __flush_tlb_slot | ||
55 | * | ||
56 | * @slot: Address of TLB slot. | ||
57 | * | ||
58 | * Flushes TLB slot @slot. | ||
59 | */ | ||
60 | static inline void __flush_tlb_slot(unsigned long long slot) | ||
61 | { | ||
62 | __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot)); | ||
63 | } | ||
64 | |||
65 | /* arch/sh64/mm/tlb.c */ | ||
66 | extern int sh64_tlb_init(void); | ||
67 | extern unsigned long long sh64_next_free_dtlb_entry(void); | ||
68 | extern unsigned long long sh64_get_wired_dtlb_entry(void); | ||
69 | extern int sh64_put_wired_dtlb_entry(unsigned long long entry); | ||
70 | |||
71 | extern void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr, unsigned long asid, unsigned long paddr); | ||
72 | extern void sh64_teardown_tlb_slot(unsigned long long config_addr); | ||
73 | |||
74 | #define tlb_start_vma(tlb, vma) \ | ||
75 | flush_cache_range(vma, vma->vm_start, vma->vm_end) | ||
76 | |||
77 | #define tlb_end_vma(tlb, vma) \ | ||
78 | flush_tlb_range(vma, vma->vm_start, vma->vm_end) | ||
79 | |||
80 | #define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0) | ||
81 | |||
82 | /* | ||
83 | * Flush whole TLBs for MM | ||
84 | */ | ||
85 | #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) | ||
86 | |||
87 | #include <asm-generic/tlb.h> | ||
88 | |||
89 | #endif /* __ASSEMBLY__ */ | ||
90 | |||
91 | #endif /* __ASM_SH64_TLB_H */ | ||
92 | |||
diff --git a/include/asm-sh64/tlbflush.h b/include/asm-sh64/tlbflush.h deleted file mode 100644 index 16a164a23754..000000000000 --- a/include/asm-sh64/tlbflush.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_TLBFLUSH_H | ||
2 | #define __ASM_SH64_TLBFLUSH_H | ||
3 | |||
4 | #include <asm/pgalloc.h> | ||
5 | |||
6 | /* | ||
7 | * TLB flushing: | ||
8 | * | ||
9 | * - flush_tlb() flushes the current mm struct TLBs | ||
10 | * - flush_tlb_all() flushes all processes TLBs | ||
11 | * - flush_tlb_mm(mm) flushes the specified mm context TLB's | ||
12 | * - flush_tlb_page(vma, vmaddr) flushes one page | ||
13 | * - flush_tlb_range(mm, start, end) flushes a range of pages | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | extern void flush_tlb(void); | ||
18 | extern void flush_tlb_all(void); | ||
19 | extern void flush_tlb_mm(struct mm_struct *mm); | ||
20 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | ||
21 | unsigned long end); | ||
22 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); | ||
23 | |||
24 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); | ||
25 | |||
26 | #endif /* __ASM_SH64_TLBFLUSH_H */ | ||
27 | |||
diff --git a/include/asm-sh64/topology.h b/include/asm-sh64/topology.h deleted file mode 100644 index 34211787345f..000000000000 --- a/include/asm-sh64/topology.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_TOPOLOGY_H | ||
2 | #define __ASM_SH64_TOPOLOGY_H | ||
3 | |||
4 | #include <asm-generic/topology.h> | ||
5 | |||
6 | #endif /* __ASM_SH64_TOPOLOGY_H */ | ||
diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h deleted file mode 100644 index 2c7ad73b3883..000000000000 --- a/include/asm-sh64/types.h +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_TYPES_H | ||
2 | #define __ASM_SH64_TYPES_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/types.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASSEMBLY__ | ||
16 | |||
17 | typedef unsigned short umode_t; | ||
18 | |||
19 | /* | ||
20 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the | ||
21 | * header files exported to user space | ||
22 | */ | ||
23 | |||
24 | typedef __signed__ char __s8; | ||
25 | typedef unsigned char __u8; | ||
26 | |||
27 | typedef __signed__ short __s16; | ||
28 | typedef unsigned short __u16; | ||
29 | |||
30 | typedef __signed__ int __s32; | ||
31 | typedef unsigned int __u32; | ||
32 | |||
33 | #if defined(__GNUC__) | ||
34 | __extension__ typedef __signed__ long long __s64; | ||
35 | __extension__ typedef unsigned long long __u64; | ||
36 | #endif | ||
37 | |||
38 | #endif /* __ASSEMBLY__ */ | ||
39 | |||
40 | /* | ||
41 | * These aren't exported outside the kernel to avoid name space clashes | ||
42 | */ | ||
43 | #ifdef __KERNEL__ | ||
44 | |||
45 | #ifndef __ASSEMBLY__ | ||
46 | |||
47 | typedef __signed__ char s8; | ||
48 | typedef unsigned char u8; | ||
49 | |||
50 | typedef __signed__ short s16; | ||
51 | typedef unsigned short u16; | ||
52 | |||
53 | typedef __signed__ int s32; | ||
54 | typedef unsigned int u32; | ||
55 | |||
56 | typedef __signed__ long long s64; | ||
57 | typedef unsigned long long u64; | ||
58 | |||
59 | /* DMA addresses come in generic and 64-bit flavours. */ | ||
60 | |||
61 | #ifdef CONFIG_HIGHMEM64G | ||
62 | typedef u64 dma_addr_t; | ||
63 | #else | ||
64 | typedef u32 dma_addr_t; | ||
65 | #endif | ||
66 | typedef u64 dma64_addr_t; | ||
67 | |||
68 | #endif /* __ASSEMBLY__ */ | ||
69 | |||
70 | #define BITS_PER_LONG 32 | ||
71 | |||
72 | #endif /* __KERNEL__ */ | ||
73 | |||
74 | #endif /* __ASM_SH64_TYPES_H */ | ||
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h deleted file mode 100644 index 644c67b65f94..000000000000 --- a/include/asm-sh64/uaccess.h +++ /dev/null | |||
@@ -1,316 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_UACCESS_H | ||
2 | #define __ASM_SH64_UACCESS_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/uaccess.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003, 2004 Paul Mundt | ||
13 | * | ||
14 | * User space memory access functions | ||
15 | * | ||
16 | * Copyright (C) 1999 Niibe Yutaka | ||
17 | * | ||
18 | * Based on: | ||
19 | * MIPS implementation version 1.15 by | ||
20 | * Copyright (C) 1996, 1997, 1998 by Ralf Baechle | ||
21 | * and i386 version. | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #include <linux/errno.h> | ||
26 | #include <linux/sched.h> | ||
27 | |||
28 | #define VERIFY_READ 0 | ||
29 | #define VERIFY_WRITE 1 | ||
30 | |||
31 | /* | ||
32 | * The fs value determines whether argument validity checking should be | ||
33 | * performed or not. If get_fs() == USER_DS, checking is performed, with | ||
34 | * get_fs() == KERNEL_DS, checking is bypassed. | ||
35 | * | ||
36 | * For historical reasons (Data Segment Register?), these macros are misnamed. | ||
37 | */ | ||
38 | |||
39 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | ||
40 | |||
41 | #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
42 | #define USER_DS MAKE_MM_SEG(0x80000000) | ||
43 | |||
44 | #define get_ds() (KERNEL_DS) | ||
45 | #define get_fs() (current_thread_info()->addr_limit) | ||
46 | #define set_fs(x) (current_thread_info()->addr_limit=(x)) | ||
47 | |||
48 | #define segment_eq(a,b) ((a).seg == (b).seg) | ||
49 | |||
50 | #define __addr_ok(addr) ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg)) | ||
51 | |||
52 | /* | ||
53 | * Uhhuh, this needs 33-bit arithmetic. We have a carry.. | ||
54 | * | ||
55 | * sum := addr + size; carry? --> flag = true; | ||
56 | * if (sum >= addr_limit) flag = true; | ||
57 | */ | ||
58 | #define __range_ok(addr,size) (((unsigned long) (addr) + (size) < (current_thread_info()->addr_limit.seg)) ? 0 : 1) | ||
59 | |||
60 | #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) | ||
61 | #define __access_ok(addr,size) (__range_ok(addr,size) == 0) | ||
62 | |||
63 | /* | ||
64 | * Uh, these should become the main single-value transfer routines ... | ||
65 | * They automatically use the right size if we just have the right | ||
66 | * pointer type ... | ||
67 | * | ||
68 | * As MIPS uses the same address space for kernel and user data, we | ||
69 | * can just do these as direct assignments. | ||
70 | * | ||
71 | * Careful to not | ||
72 | * (a) re-use the arguments for side effects (sizeof is ok) | ||
73 | * (b) require any knowledge of processes at this stage | ||
74 | */ | ||
75 | #define put_user(x,ptr) __put_user_check((x),(ptr),sizeof(*(ptr))) | ||
76 | #define get_user(x,ptr) __get_user_check((x),(ptr),sizeof(*(ptr))) | ||
77 | |||
78 | /* | ||
79 | * The "__xxx" versions do not do address space checking, useful when | ||
80 | * doing multiple accesses to the same area (the user has to do the | ||
81 | * checks by hand with "access_ok()") | ||
82 | */ | ||
83 | #define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr))) | ||
84 | #define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | ||
85 | |||
86 | /* | ||
87 | * The "xxx_ret" versions return constant specified in third argument, if | ||
88 | * something bad happens. These macros can be optimized for the | ||
89 | * case of just returning from the function xxx_ret is used. | ||
90 | */ | ||
91 | |||
92 | #define put_user_ret(x,ptr,ret) ({ \ | ||
93 | if (put_user(x,ptr)) return ret; }) | ||
94 | |||
95 | #define get_user_ret(x,ptr,ret) ({ \ | ||
96 | if (get_user(x,ptr)) return ret; }) | ||
97 | |||
98 | #define __put_user_ret(x,ptr,ret) ({ \ | ||
99 | if (__put_user(x,ptr)) return ret; }) | ||
100 | |||
101 | #define __get_user_ret(x,ptr,ret) ({ \ | ||
102 | if (__get_user(x,ptr)) return ret; }) | ||
103 | |||
104 | struct __large_struct { unsigned long buf[100]; }; | ||
105 | #define __m(x) (*(struct __large_struct *)(x)) | ||
106 | |||
107 | #define __get_user_size(x,ptr,size,retval) \ | ||
108 | do { \ | ||
109 | retval = 0; \ | ||
110 | switch (size) { \ | ||
111 | case 1: \ | ||
112 | retval = __get_user_asm_b(x, ptr); \ | ||
113 | break; \ | ||
114 | case 2: \ | ||
115 | retval = __get_user_asm_w(x, ptr); \ | ||
116 | break; \ | ||
117 | case 4: \ | ||
118 | retval = __get_user_asm_l(x, ptr); \ | ||
119 | break; \ | ||
120 | case 8: \ | ||
121 | retval = __get_user_asm_q(x, ptr); \ | ||
122 | break; \ | ||
123 | default: \ | ||
124 | __get_user_unknown(); \ | ||
125 | break; \ | ||
126 | } \ | ||
127 | } while (0) | ||
128 | |||
129 | #define __get_user_nocheck(x,ptr,size) \ | ||
130 | ({ \ | ||
131 | long __gu_err, __gu_val; \ | ||
132 | __get_user_size((void *)&__gu_val, (long)(ptr), \ | ||
133 | (size), __gu_err); \ | ||
134 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
135 | __gu_err; \ | ||
136 | }) | ||
137 | |||
138 | #define __get_user_check(x,ptr,size) \ | ||
139 | ({ \ | ||
140 | long __gu_addr = (long)(ptr); \ | ||
141 | long __gu_err = -EFAULT, __gu_val; \ | ||
142 | if (__access_ok(__gu_addr, (size))) \ | ||
143 | __get_user_size((void *)&__gu_val, __gu_addr, \ | ||
144 | (size), __gu_err); \ | ||
145 | (x) = (__typeof__(*(ptr))) __gu_val; \ | ||
146 | __gu_err; \ | ||
147 | }) | ||
148 | |||
149 | extern long __get_user_asm_b(void *, long); | ||
150 | extern long __get_user_asm_w(void *, long); | ||
151 | extern long __get_user_asm_l(void *, long); | ||
152 | extern long __get_user_asm_q(void *, long); | ||
153 | extern void __get_user_unknown(void); | ||
154 | |||
155 | #define __put_user_size(x,ptr,size,retval) \ | ||
156 | do { \ | ||
157 | retval = 0; \ | ||
158 | switch (size) { \ | ||
159 | case 1: \ | ||
160 | retval = __put_user_asm_b(x, ptr); \ | ||
161 | break; \ | ||
162 | case 2: \ | ||
163 | retval = __put_user_asm_w(x, ptr); \ | ||
164 | break; \ | ||
165 | case 4: \ | ||
166 | retval = __put_user_asm_l(x, ptr); \ | ||
167 | break; \ | ||
168 | case 8: \ | ||
169 | retval = __put_user_asm_q(x, ptr); \ | ||
170 | break; \ | ||
171 | default: \ | ||
172 | __put_user_unknown(); \ | ||
173 | } \ | ||
174 | } while (0) | ||
175 | |||
176 | #define __put_user_nocheck(x,ptr,size) \ | ||
177 | ({ \ | ||
178 | long __pu_err; \ | ||
179 | __typeof__(*(ptr)) __pu_val = (x); \ | ||
180 | __put_user_size((void *)&__pu_val, (long)(ptr), (size), __pu_err); \ | ||
181 | __pu_err; \ | ||
182 | }) | ||
183 | |||
184 | #define __put_user_check(x,ptr,size) \ | ||
185 | ({ \ | ||
186 | long __pu_err = -EFAULT; \ | ||
187 | long __pu_addr = (long)(ptr); \ | ||
188 | __typeof__(*(ptr)) __pu_val = (x); \ | ||
189 | \ | ||
190 | if (__access_ok(__pu_addr, (size))) \ | ||
191 | __put_user_size((void *)&__pu_val, __pu_addr, (size), __pu_err);\ | ||
192 | __pu_err; \ | ||
193 | }) | ||
194 | |||
195 | extern long __put_user_asm_b(void *, long); | ||
196 | extern long __put_user_asm_w(void *, long); | ||
197 | extern long __put_user_asm_l(void *, long); | ||
198 | extern long __put_user_asm_q(void *, long); | ||
199 | extern void __put_user_unknown(void); | ||
200 | |||
201 | |||
202 | /* Generic arbitrary sized copy. */ | ||
203 | /* Return the number of bytes NOT copied */ | ||
204 | /* XXX: should be such that: 4byte and the rest. */ | ||
205 | extern __kernel_size_t __copy_user(void *__to, const void *__from, __kernel_size_t __n); | ||
206 | |||
207 | #define copy_to_user(to,from,n) ({ \ | ||
208 | void *__copy_to = (void *) (to); \ | ||
209 | __kernel_size_t __copy_size = (__kernel_size_t) (n); \ | ||
210 | __kernel_size_t __copy_res; \ | ||
211 | if(__copy_size && __access_ok((unsigned long)__copy_to, __copy_size)) { \ | ||
212 | __copy_res = __copy_user(__copy_to, (void *) (from), __copy_size); \ | ||
213 | } else __copy_res = __copy_size; \ | ||
214 | __copy_res; }) | ||
215 | |||
216 | #define copy_to_user_ret(to,from,n,retval) ({ \ | ||
217 | if (copy_to_user(to,from,n)) \ | ||
218 | return retval; \ | ||
219 | }) | ||
220 | |||
221 | #define __copy_to_user(to,from,n) \ | ||
222 | __copy_user((void *)(to), \ | ||
223 | (void *)(from), n) | ||
224 | |||
225 | #define __copy_to_user_ret(to,from,n,retval) ({ \ | ||
226 | if (__copy_to_user(to,from,n)) \ | ||
227 | return retval; \ | ||
228 | }) | ||
229 | |||
230 | #define copy_from_user(to,from,n) ({ \ | ||
231 | void *__copy_to = (void *) (to); \ | ||
232 | void *__copy_from = (void *) (from); \ | ||
233 | __kernel_size_t __copy_size = (__kernel_size_t) (n); \ | ||
234 | __kernel_size_t __copy_res; \ | ||
235 | if(__copy_size && __access_ok((unsigned long)__copy_from, __copy_size)) { \ | ||
236 | __copy_res = __copy_user(__copy_to, __copy_from, __copy_size); \ | ||
237 | } else __copy_res = __copy_size; \ | ||
238 | __copy_res; }) | ||
239 | |||
240 | #define copy_from_user_ret(to,from,n,retval) ({ \ | ||
241 | if (copy_from_user(to,from,n)) \ | ||
242 | return retval; \ | ||
243 | }) | ||
244 | |||
245 | #define __copy_from_user(to,from,n) \ | ||
246 | __copy_user((void *)(to), \ | ||
247 | (void *)(from), n) | ||
248 | |||
249 | #define __copy_from_user_ret(to,from,n,retval) ({ \ | ||
250 | if (__copy_from_user(to,from,n)) \ | ||
251 | return retval; \ | ||
252 | }) | ||
253 | |||
254 | #define __copy_to_user_inatomic __copy_to_user | ||
255 | #define __copy_from_user_inatomic __copy_from_user | ||
256 | |||
257 | /* XXX: Not sure it works well.. | ||
258 | should be such that: 4byte clear and the rest. */ | ||
259 | extern __kernel_size_t __clear_user(void *addr, __kernel_size_t size); | ||
260 | |||
261 | #define clear_user(addr,n) ({ \ | ||
262 | void * __cl_addr = (addr); \ | ||
263 | unsigned long __cl_size = (n); \ | ||
264 | if (__cl_size && __access_ok(((unsigned long)(__cl_addr)), __cl_size)) \ | ||
265 | __cl_size = __clear_user(__cl_addr, __cl_size); \ | ||
266 | __cl_size; }) | ||
267 | |||
268 | extern int __strncpy_from_user(unsigned long __dest, unsigned long __src, int __count); | ||
269 | |||
270 | #define strncpy_from_user(dest,src,count) ({ \ | ||
271 | unsigned long __sfu_src = (unsigned long) (src); \ | ||
272 | int __sfu_count = (int) (count); \ | ||
273 | long __sfu_res = -EFAULT; \ | ||
274 | if(__access_ok(__sfu_src, __sfu_count)) { \ | ||
275 | __sfu_res = __strncpy_from_user((unsigned long) (dest), __sfu_src, __sfu_count); \ | ||
276 | } __sfu_res; }) | ||
277 | |||
278 | #define strlen_user(str) strnlen_user(str, ~0UL >> 1) | ||
279 | |||
280 | /* | ||
281 | * Return the size of a string (including the ending 0!) | ||
282 | */ | ||
283 | extern long __strnlen_user(const char *__s, long __n); | ||
284 | |||
285 | static inline long strnlen_user(const char *s, long n) | ||
286 | { | ||
287 | if (!__addr_ok(s)) | ||
288 | return 0; | ||
289 | else | ||
290 | return __strnlen_user(s, n); | ||
291 | } | ||
292 | |||
293 | struct exception_table_entry | ||
294 | { | ||
295 | unsigned long insn, fixup; | ||
296 | }; | ||
297 | |||
298 | #define ARCH_HAS_SEARCH_EXTABLE | ||
299 | |||
300 | /* If gcc inlines memset, it will use st.q instructions. Therefore, we need | ||
301 | kmalloc allocations to be 8-byte aligned. Without this, the alignment | ||
302 | becomes BYTE_PER_WORD i.e. only 4 (since sizeof(long)==sizeof(void*)==4 on | ||
303 | sh64 at the moment). */ | ||
304 | #define ARCH_KMALLOC_MINALIGN 8 | ||
305 | |||
306 | /* | ||
307 | * We want 8-byte alignment for the slab caches as well, otherwise we have | ||
308 | * the same BYTES_PER_WORD (sizeof(void *)) min align in kmem_cache_create(). | ||
309 | */ | ||
310 | #define ARCH_SLAB_MINALIGN 8 | ||
311 | |||
312 | /* Returns 0 if exception not found and fixup.unit otherwise. */ | ||
313 | extern unsigned long search_exception_table(unsigned long addr); | ||
314 | extern const struct exception_table_entry *search_exception_tables (unsigned long addr); | ||
315 | |||
316 | #endif /* __ASM_SH64_UACCESS_H */ | ||
diff --git a/include/asm-sh64/ucontext.h b/include/asm-sh64/ucontext.h deleted file mode 100644 index cf77a08551ca..000000000000 --- a/include/asm-sh64/ucontext.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_UCONTEXT_H | ||
2 | #define __ASM_SH64_UCONTEXT_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/ucontext.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | struct ucontext { | ||
16 | unsigned long uc_flags; | ||
17 | struct ucontext *uc_link; | ||
18 | stack_t uc_stack; | ||
19 | struct sigcontext uc_mcontext; | ||
20 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
21 | }; | ||
22 | |||
23 | #endif /* __ASM_SH64_UCONTEXT_H */ | ||
diff --git a/include/asm-sh64/unaligned.h b/include/asm-sh64/unaligned.h deleted file mode 100644 index 74481b186ae8..000000000000 --- a/include/asm-sh64/unaligned.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_UNALIGNED_H | ||
2 | #define __ASM_SH64_UNALIGNED_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/unaligned.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <asm-generic/unaligned.h> | ||
16 | |||
17 | #endif /* __ASM_SH64_UNALIGNED_H */ | ||
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h deleted file mode 100644 index 1a5197f369b2..000000000000 --- a/include/asm-sh64/unistd.h +++ /dev/null | |||
@@ -1,417 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_UNISTD_H | ||
2 | #define __ASM_SH64_UNISTD_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/unistd.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * Copyright (C) 2003 - 2007 Paul Mundt | ||
13 | * Copyright (C) 2004 Sean McGoogan | ||
14 | * | ||
15 | * This file contains the system call numbers. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #define __NR_restart_syscall 0 | ||
20 | #define __NR_exit 1 | ||
21 | #define __NR_fork 2 | ||
22 | #define __NR_read 3 | ||
23 | #define __NR_write 4 | ||
24 | #define __NR_open 5 | ||
25 | #define __NR_close 6 | ||
26 | #define __NR_waitpid 7 | ||
27 | #define __NR_creat 8 | ||
28 | #define __NR_link 9 | ||
29 | #define __NR_unlink 10 | ||
30 | #define __NR_execve 11 | ||
31 | #define __NR_chdir 12 | ||
32 | #define __NR_time 13 | ||
33 | #define __NR_mknod 14 | ||
34 | #define __NR_chmod 15 | ||
35 | #define __NR_lchown 16 | ||
36 | #define __NR_break 17 | ||
37 | #define __NR_oldstat 18 | ||
38 | #define __NR_lseek 19 | ||
39 | #define __NR_getpid 20 | ||
40 | #define __NR_mount 21 | ||
41 | #define __NR_umount 22 | ||
42 | #define __NR_setuid 23 | ||
43 | #define __NR_getuid 24 | ||
44 | #define __NR_stime 25 | ||
45 | #define __NR_ptrace 26 | ||
46 | #define __NR_alarm 27 | ||
47 | #define __NR_oldfstat 28 | ||
48 | #define __NR_pause 29 | ||
49 | #define __NR_utime 30 | ||
50 | #define __NR_stty 31 | ||
51 | #define __NR_gtty 32 | ||
52 | #define __NR_access 33 | ||
53 | #define __NR_nice 34 | ||
54 | #define __NR_ftime 35 | ||
55 | #define __NR_sync 36 | ||
56 | #define __NR_kill 37 | ||
57 | #define __NR_rename 38 | ||
58 | #define __NR_mkdir 39 | ||
59 | #define __NR_rmdir 40 | ||
60 | #define __NR_dup 41 | ||
61 | #define __NR_pipe 42 | ||
62 | #define __NR_times 43 | ||
63 | #define __NR_prof 44 | ||
64 | #define __NR_brk 45 | ||
65 | #define __NR_setgid 46 | ||
66 | #define __NR_getgid 47 | ||
67 | #define __NR_signal 48 | ||
68 | #define __NR_geteuid 49 | ||
69 | #define __NR_getegid 50 | ||
70 | #define __NR_acct 51 | ||
71 | #define __NR_umount2 52 | ||
72 | #define __NR_lock 53 | ||
73 | #define __NR_ioctl 54 | ||
74 | #define __NR_fcntl 55 | ||
75 | #define __NR_mpx 56 | ||
76 | #define __NR_setpgid 57 | ||
77 | #define __NR_ulimit 58 | ||
78 | #define __NR_oldolduname 59 | ||
79 | #define __NR_umask 60 | ||
80 | #define __NR_chroot 61 | ||
81 | #define __NR_ustat 62 | ||
82 | #define __NR_dup2 63 | ||
83 | #define __NR_getppid 64 | ||
84 | #define __NR_getpgrp 65 | ||
85 | #define __NR_setsid 66 | ||
86 | #define __NR_sigaction 67 | ||
87 | #define __NR_sgetmask 68 | ||
88 | #define __NR_ssetmask 69 | ||
89 | #define __NR_setreuid 70 | ||
90 | #define __NR_setregid 71 | ||
91 | #define __NR_sigsuspend 72 | ||
92 | #define __NR_sigpending 73 | ||
93 | #define __NR_sethostname 74 | ||
94 | #define __NR_setrlimit 75 | ||
95 | #define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ | ||
96 | #define __NR_getrusage 77 | ||
97 | #define __NR_gettimeofday 78 | ||
98 | #define __NR_settimeofday 79 | ||
99 | #define __NR_getgroups 80 | ||
100 | #define __NR_setgroups 81 | ||
101 | #define __NR_select 82 | ||
102 | #define __NR_symlink 83 | ||
103 | #define __NR_oldlstat 84 | ||
104 | #define __NR_readlink 85 | ||
105 | #define __NR_uselib 86 | ||
106 | #define __NR_swapon 87 | ||
107 | #define __NR_reboot 88 | ||
108 | #define __NR_readdir 89 | ||
109 | #define __NR_mmap 90 | ||
110 | #define __NR_munmap 91 | ||
111 | #define __NR_truncate 92 | ||
112 | #define __NR_ftruncate 93 | ||
113 | #define __NR_fchmod 94 | ||
114 | #define __NR_fchown 95 | ||
115 | #define __NR_getpriority 96 | ||
116 | #define __NR_setpriority 97 | ||
117 | #define __NR_profil 98 | ||
118 | #define __NR_statfs 99 | ||
119 | #define __NR_fstatfs 100 | ||
120 | #define __NR_ioperm 101 | ||
121 | #define __NR_socketcall 102 /* old implementation of socket systemcall */ | ||
122 | #define __NR_syslog 103 | ||
123 | #define __NR_setitimer 104 | ||
124 | #define __NR_getitimer 105 | ||
125 | #define __NR_stat 106 | ||
126 | #define __NR_lstat 107 | ||
127 | #define __NR_fstat 108 | ||
128 | #define __NR_olduname 109 | ||
129 | #define __NR_iopl 110 | ||
130 | #define __NR_vhangup 111 | ||
131 | #define __NR_idle 112 | ||
132 | #define __NR_vm86old 113 | ||
133 | #define __NR_wait4 114 | ||
134 | #define __NR_swapoff 115 | ||
135 | #define __NR_sysinfo 116 | ||
136 | #define __NR_ipc 117 | ||
137 | #define __NR_fsync 118 | ||
138 | #define __NR_sigreturn 119 | ||
139 | #define __NR_clone 120 | ||
140 | #define __NR_setdomainname 121 | ||
141 | #define __NR_uname 122 | ||
142 | #define __NR_modify_ldt 123 | ||
143 | #define __NR_adjtimex 124 | ||
144 | #define __NR_mprotect 125 | ||
145 | #define __NR_sigprocmask 126 | ||
146 | #define __NR_create_module 127 | ||
147 | #define __NR_init_module 128 | ||
148 | #define __NR_delete_module 129 | ||
149 | #define __NR_get_kernel_syms 130 | ||
150 | #define __NR_quotactl 131 | ||
151 | #define __NR_getpgid 132 | ||
152 | #define __NR_fchdir 133 | ||
153 | #define __NR_bdflush 134 | ||
154 | #define __NR_sysfs 135 | ||
155 | #define __NR_personality 136 | ||
156 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
157 | #define __NR_setfsuid 138 | ||
158 | #define __NR_setfsgid 139 | ||
159 | #define __NR__llseek 140 | ||
160 | #define __NR_getdents 141 | ||
161 | #define __NR__newselect 142 | ||
162 | #define __NR_flock 143 | ||
163 | #define __NR_msync 144 | ||
164 | #define __NR_readv 145 | ||
165 | #define __NR_writev 146 | ||
166 | #define __NR_getsid 147 | ||
167 | #define __NR_fdatasync 148 | ||
168 | #define __NR__sysctl 149 | ||
169 | #define __NR_mlock 150 | ||
170 | #define __NR_munlock 151 | ||
171 | #define __NR_mlockall 152 | ||
172 | #define __NR_munlockall 153 | ||
173 | #define __NR_sched_setparam 154 | ||
174 | #define __NR_sched_getparam 155 | ||
175 | #define __NR_sched_setscheduler 156 | ||
176 | #define __NR_sched_getscheduler 157 | ||
177 | #define __NR_sched_yield 158 | ||
178 | #define __NR_sched_get_priority_max 159 | ||
179 | #define __NR_sched_get_priority_min 160 | ||
180 | #define __NR_sched_rr_get_interval 161 | ||
181 | #define __NR_nanosleep 162 | ||
182 | #define __NR_mremap 163 | ||
183 | #define __NR_setresuid 164 | ||
184 | #define __NR_getresuid 165 | ||
185 | #define __NR_vm86 166 | ||
186 | #define __NR_query_module 167 | ||
187 | #define __NR_poll 168 | ||
188 | #define __NR_nfsservctl 169 | ||
189 | #define __NR_setresgid 170 | ||
190 | #define __NR_getresgid 171 | ||
191 | #define __NR_prctl 172 | ||
192 | #define __NR_rt_sigreturn 173 | ||
193 | #define __NR_rt_sigaction 174 | ||
194 | #define __NR_rt_sigprocmask 175 | ||
195 | #define __NR_rt_sigpending 176 | ||
196 | #define __NR_rt_sigtimedwait 177 | ||
197 | #define __NR_rt_sigqueueinfo 178 | ||
198 | #define __NR_rt_sigsuspend 179 | ||
199 | #define __NR_pread64 180 | ||
200 | #define __NR_pwrite64 181 | ||
201 | #define __NR_chown 182 | ||
202 | #define __NR_getcwd 183 | ||
203 | #define __NR_capget 184 | ||
204 | #define __NR_capset 185 | ||
205 | #define __NR_sigaltstack 186 | ||
206 | #define __NR_sendfile 187 | ||
207 | #define __NR_streams1 188 /* some people actually want it */ | ||
208 | #define __NR_streams2 189 /* some people actually want it */ | ||
209 | #define __NR_vfork 190 | ||
210 | #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ | ||
211 | #define __NR_mmap2 192 | ||
212 | #define __NR_truncate64 193 | ||
213 | #define __NR_ftruncate64 194 | ||
214 | #define __NR_stat64 195 | ||
215 | #define __NR_lstat64 196 | ||
216 | #define __NR_fstat64 197 | ||
217 | #define __NR_lchown32 198 | ||
218 | #define __NR_getuid32 199 | ||
219 | #define __NR_getgid32 200 | ||
220 | #define __NR_geteuid32 201 | ||
221 | #define __NR_getegid32 202 | ||
222 | #define __NR_setreuid32 203 | ||
223 | #define __NR_setregid32 204 | ||
224 | #define __NR_getgroups32 205 | ||
225 | #define __NR_setgroups32 206 | ||
226 | #define __NR_fchown32 207 | ||
227 | #define __NR_setresuid32 208 | ||
228 | #define __NR_getresuid32 209 | ||
229 | #define __NR_setresgid32 210 | ||
230 | #define __NR_getresgid32 211 | ||
231 | #define __NR_chown32 212 | ||
232 | #define __NR_setuid32 213 | ||
233 | #define __NR_setgid32 214 | ||
234 | #define __NR_setfsuid32 215 | ||
235 | #define __NR_setfsgid32 216 | ||
236 | #define __NR_pivot_root 217 | ||
237 | #define __NR_mincore 218 | ||
238 | #define __NR_madvise 219 | ||
239 | |||
240 | /* Non-multiplexed socket family */ | ||
241 | #define __NR_socket 220 | ||
242 | #define __NR_bind 221 | ||
243 | #define __NR_connect 222 | ||
244 | #define __NR_listen 223 | ||
245 | #define __NR_accept 224 | ||
246 | #define __NR_getsockname 225 | ||
247 | #define __NR_getpeername 226 | ||
248 | #define __NR_socketpair 227 | ||
249 | #define __NR_send 228 | ||
250 | #define __NR_sendto 229 | ||
251 | #define __NR_recv 230 | ||
252 | #define __NR_recvfrom 231 | ||
253 | #define __NR_shutdown 232 | ||
254 | #define __NR_setsockopt 233 | ||
255 | #define __NR_getsockopt 234 | ||
256 | #define __NR_sendmsg 235 | ||
257 | #define __NR_recvmsg 236 | ||
258 | |||
259 | /* Non-multiplexed IPC family */ | ||
260 | #define __NR_semop 237 | ||
261 | #define __NR_semget 238 | ||
262 | #define __NR_semctl 239 | ||
263 | #define __NR_msgsnd 240 | ||
264 | #define __NR_msgrcv 241 | ||
265 | #define __NR_msgget 242 | ||
266 | #define __NR_msgctl 243 | ||
267 | #if 0 | ||
268 | #define __NR_shmatcall 244 | ||
269 | #endif | ||
270 | #define __NR_shmdt 245 | ||
271 | #define __NR_shmget 246 | ||
272 | #define __NR_shmctl 247 | ||
273 | |||
274 | #define __NR_getdents64 248 | ||
275 | #define __NR_fcntl64 249 | ||
276 | /* 223 is unused */ | ||
277 | #define __NR_gettid 252 | ||
278 | #define __NR_readahead 253 | ||
279 | #define __NR_setxattr 254 | ||
280 | #define __NR_lsetxattr 255 | ||
281 | #define __NR_fsetxattr 256 | ||
282 | #define __NR_getxattr 257 | ||
283 | #define __NR_lgetxattr 258 | ||
284 | #define __NR_fgetxattr 269 | ||
285 | #define __NR_listxattr 260 | ||
286 | #define __NR_llistxattr 261 | ||
287 | #define __NR_flistxattr 262 | ||
288 | #define __NR_removexattr 263 | ||
289 | #define __NR_lremovexattr 264 | ||
290 | #define __NR_fremovexattr 265 | ||
291 | #define __NR_tkill 266 | ||
292 | #define __NR_sendfile64 267 | ||
293 | #define __NR_futex 268 | ||
294 | #define __NR_sched_setaffinity 269 | ||
295 | #define __NR_sched_getaffinity 270 | ||
296 | #define __NR_set_thread_area 271 | ||
297 | #define __NR_get_thread_area 272 | ||
298 | #define __NR_io_setup 273 | ||
299 | #define __NR_io_destroy 274 | ||
300 | #define __NR_io_getevents 275 | ||
301 | #define __NR_io_submit 276 | ||
302 | #define __NR_io_cancel 277 | ||
303 | #define __NR_fadvise64 278 | ||
304 | #define __NR_exit_group 280 | ||
305 | |||
306 | #define __NR_lookup_dcookie 281 | ||
307 | #define __NR_epoll_create 282 | ||
308 | #define __NR_epoll_ctl 283 | ||
309 | #define __NR_epoll_wait 284 | ||
310 | #define __NR_remap_file_pages 285 | ||
311 | #define __NR_set_tid_address 286 | ||
312 | #define __NR_timer_create 287 | ||
313 | #define __NR_timer_settime (__NR_timer_create+1) | ||
314 | #define __NR_timer_gettime (__NR_timer_create+2) | ||
315 | #define __NR_timer_getoverrun (__NR_timer_create+3) | ||
316 | #define __NR_timer_delete (__NR_timer_create+4) | ||
317 | #define __NR_clock_settime (__NR_timer_create+5) | ||
318 | #define __NR_clock_gettime (__NR_timer_create+6) | ||
319 | #define __NR_clock_getres (__NR_timer_create+7) | ||
320 | #define __NR_clock_nanosleep (__NR_timer_create+8) | ||
321 | #define __NR_statfs64 296 | ||
322 | #define __NR_fstatfs64 297 | ||
323 | #define __NR_tgkill 298 | ||
324 | #define __NR_utimes 299 | ||
325 | #define __NR_fadvise64_64 300 | ||
326 | #define __NR_vserver 301 | ||
327 | #define __NR_mbind 302 | ||
328 | #define __NR_get_mempolicy 303 | ||
329 | #define __NR_set_mempolicy 304 | ||
330 | #define __NR_mq_open 305 | ||
331 | #define __NR_mq_unlink (__NR_mq_open+1) | ||
332 | #define __NR_mq_timedsend (__NR_mq_open+2) | ||
333 | #define __NR_mq_timedreceive (__NR_mq_open+3) | ||
334 | #define __NR_mq_notify (__NR_mq_open+4) | ||
335 | #define __NR_mq_getsetattr (__NR_mq_open+5) | ||
336 | #define __NR_kexec_load 311 | ||
337 | #define __NR_waitid 312 | ||
338 | #define __NR_add_key 313 | ||
339 | #define __NR_request_key 314 | ||
340 | #define __NR_keyctl 315 | ||
341 | #define __NR_ioprio_set 316 | ||
342 | #define __NR_ioprio_get 317 | ||
343 | #define __NR_inotify_init 318 | ||
344 | #define __NR_inotify_add_watch 319 | ||
345 | #define __NR_inotify_rm_watch 320 | ||
346 | /* 321 is unused */ | ||
347 | #define __NR_migrate_pages 322 | ||
348 | #define __NR_openat 323 | ||
349 | #define __NR_mkdirat 324 | ||
350 | #define __NR_mknodat 325 | ||
351 | #define __NR_fchownat 326 | ||
352 | #define __NR_futimesat 327 | ||
353 | #define __NR_fstatat64 328 | ||
354 | #define __NR_unlinkat 329 | ||
355 | #define __NR_renameat 330 | ||
356 | #define __NR_linkat 331 | ||
357 | #define __NR_symlinkat 332 | ||
358 | #define __NR_readlinkat 333 | ||
359 | #define __NR_fchmodat 334 | ||
360 | #define __NR_faccessat 335 | ||
361 | #define __NR_pselect6 336 | ||
362 | #define __NR_ppoll 337 | ||
363 | #define __NR_unshare 338 | ||
364 | #define __NR_set_robust_list 339 | ||
365 | #define __NR_get_robust_list 340 | ||
366 | #define __NR_splice 341 | ||
367 | #define __NR_sync_file_range 342 | ||
368 | #define __NR_tee 343 | ||
369 | #define __NR_vmsplice 344 | ||
370 | #define __NR_move_pages 345 | ||
371 | #define __NR_getcpu 346 | ||
372 | #define __NR_epoll_pwait 347 | ||
373 | #define __NR_utimensat 348 | ||
374 | #define __NR_signalfd 349 | ||
375 | #define __NR_timerfd 350 | ||
376 | #define __NR_eventfd 351 | ||
377 | #define __NR_fallocate 352 | ||
378 | |||
379 | #ifdef __KERNEL__ | ||
380 | |||
381 | #define NR_syscalls 353 | ||
382 | |||
383 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
384 | #define __ARCH_WANT_OLD_READDIR | ||
385 | #define __ARCH_WANT_OLD_STAT | ||
386 | #define __ARCH_WANT_STAT64 | ||
387 | #define __ARCH_WANT_SYS_ALARM | ||
388 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
389 | #define __ARCH_WANT_SYS_PAUSE | ||
390 | #define __ARCH_WANT_SYS_SGETMASK | ||
391 | #define __ARCH_WANT_SYS_SIGNAL | ||
392 | #define __ARCH_WANT_SYS_TIME | ||
393 | #define __ARCH_WANT_SYS_UTIME | ||
394 | #define __ARCH_WANT_SYS_WAITPID | ||
395 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
396 | #define __ARCH_WANT_SYS_FADVISE64 | ||
397 | #define __ARCH_WANT_SYS_GETPGRP | ||
398 | #define __ARCH_WANT_SYS_LLSEEK | ||
399 | #define __ARCH_WANT_SYS_NICE | ||
400 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
401 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
402 | #define __ARCH_WANT_SYS_SIGPENDING | ||
403 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
404 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
405 | |||
406 | /* | ||
407 | * "Conditional" syscalls | ||
408 | * | ||
409 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
410 | * but it doesn't work on all toolchains, so we just do it by hand | ||
411 | */ | ||
412 | #ifndef cond_syscall | ||
413 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
414 | #endif | ||
415 | |||
416 | #endif /* __KERNEL__ */ | ||
417 | #endif /* __ASM_SH64_UNISTD_H */ | ||
diff --git a/include/asm-sh64/user.h b/include/asm-sh64/user.h deleted file mode 100644 index eb3b33edd73e..000000000000 --- a/include/asm-sh64/user.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | #ifndef __ASM_SH64_USER_H | ||
2 | #define __ASM_SH64_USER_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/user.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <asm/ptrace.h> | ||
17 | #include <asm/page.h> | ||
18 | |||
19 | /* | ||
20 | * Core file format: The core file is written in such a way that gdb | ||
21 | * can understand it and provide useful information to the user (under | ||
22 | * linux we use the `trad-core' bfd). The file contents are as follows: | ||
23 | * | ||
24 | * upage: 1 page consisting of a user struct that tells gdb | ||
25 | * what is present in the file. Directly after this is a | ||
26 | * copy of the task_struct, which is currently not used by gdb, | ||
27 | * but it may come in handy at some point. All of the registers | ||
28 | * are stored as part of the upage. The upage should always be | ||
29 | * only one page long. | ||
30 | * data: The data segment follows next. We use current->end_text to | ||
31 | * current->brk to pick up all of the user variables, plus any memory | ||
32 | * that may have been sbrk'ed. No attempt is made to determine if a | ||
33 | * page is demand-zero or if a page is totally unused, we just cover | ||
34 | * the entire range. All of the addresses are rounded in such a way | ||
35 | * that an integral number of pages is written. | ||
36 | * stack: We need the stack information in order to get a meaningful | ||
37 | * backtrace. We need to write the data from usp to | ||
38 | * current->start_stack, so we round each of these in order to be able | ||
39 | * to write an integer number of pages. | ||
40 | */ | ||
41 | |||
42 | struct user_fpu_struct { | ||
43 | unsigned long long fp_regs[32]; | ||
44 | unsigned int fpscr; | ||
45 | }; | ||
46 | |||
47 | struct user { | ||
48 | struct pt_regs regs; /* entire machine state */ | ||
49 | struct user_fpu_struct fpu; /* Math Co-processor registers */ | ||
50 | int u_fpvalid; /* True if math co-processor being used */ | ||
51 | size_t u_tsize; /* text size (pages) */ | ||
52 | size_t u_dsize; /* data size (pages) */ | ||
53 | size_t u_ssize; /* stack size (pages) */ | ||
54 | unsigned long start_code; /* text starting address */ | ||
55 | unsigned long start_data; /* data starting address */ | ||
56 | unsigned long start_stack; /* stack starting address */ | ||
57 | long int signal; /* signal causing core dump */ | ||
58 | struct regs * u_ar0; /* help gdb find registers */ | ||
59 | struct user_fpu_struct* u_fpstate; /* Math Co-processor pointer */ | ||
60 | unsigned long magic; /* identifies a core file */ | ||
61 | char u_comm[32]; /* user command name */ | ||
62 | }; | ||
63 | |||
64 | #define NBPG PAGE_SIZE | ||
65 | #define UPAGES 1 | ||
66 | #define HOST_TEXT_START_ADDR (u.start_code) | ||
67 | #define HOST_DATA_START_ADDR (u.start_data) | ||
68 | #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) | ||
69 | |||
70 | #endif /* __ASM_SH64_USER_H */ | ||