aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm26
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-arm26
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-arm26')
-rw-r--r--include/asm-arm26/a.out.h38
-rw-r--r--include/asm-arm26/assembler.h106
-rw-r--r--include/asm-arm26/atomic.h93
-rw-r--r--include/asm-arm26/bitops.h332
-rw-r--r--include/asm-arm26/bug.h17
-rw-r--r--include/asm-arm26/bugs.h15
-rw-r--r--include/asm-arm26/byteorder.h24
-rw-r--r--include/asm-arm26/cache.h11
-rw-r--r--include/asm-arm26/cacheflush.h52
-rw-r--r--include/asm-arm26/checksum.h160
-rw-r--r--include/asm-arm26/constants.h28
-rw-r--r--include/asm-arm26/cputime.h6
-rw-r--r--include/asm-arm26/current.h15
-rw-r--r--include/asm-arm26/delay.h34
-rw-r--r--include/asm-arm26/div64.h1
-rw-r--r--include/asm-arm26/dma-mapping.h2
-rw-r--r--include/asm-arm26/dma.h184
-rw-r--r--include/asm-arm26/ecard.h294
-rw-r--r--include/asm-arm26/elf.h77
-rw-r--r--include/asm-arm26/errno.h6
-rw-r--r--include/asm-arm26/fcntl.h87
-rw-r--r--include/asm-arm26/fiq.h37
-rw-r--r--include/asm-arm26/floppy.h141
-rw-r--r--include/asm-arm26/fpstate.h29
-rw-r--r--include/asm-arm26/hardirq.h41
-rw-r--r--include/asm-arm26/hardware.h110
-rw-r--r--include/asm-arm26/hdreg.h1
-rw-r--r--include/asm-arm26/ide.h34
-rw-r--r--include/asm-arm26/io.h435
-rw-r--r--include/asm-arm26/ioc.h72
-rw-r--r--include/asm-arm26/ioctl.h74
-rw-r--r--include/asm-arm26/ioctls.h81
-rw-r--r--include/asm-arm26/ipc.h1
-rw-r--r--include/asm-arm26/ipcbuf.h29
-rw-r--r--include/asm-arm26/irq.h52
-rw-r--r--include/asm-arm26/irqchip.h101
-rw-r--r--include/asm-arm26/kmap_types.h12
-rw-r--r--include/asm-arm26/leds.h51
-rw-r--r--include/asm-arm26/limits.h11
-rw-r--r--include/asm-arm26/linkage.h7
-rw-r--r--include/asm-arm26/local.h2
-rw-r--r--include/asm-arm26/locks.h161
-rw-r--r--include/asm-arm26/mach-types.h37
-rw-r--r--include/asm-arm26/map.h24
-rw-r--r--include/asm-arm26/mc146818rtc.h28
-rw-r--r--include/asm-arm26/memory.h101
-rw-r--r--include/asm-arm26/mman.h43
-rw-r--r--include/asm-arm26/mmu.h9
-rw-r--r--include/asm-arm26/mmu_context.h51
-rw-r--r--include/asm-arm26/module.h7
-rw-r--r--include/asm-arm26/msgbuf.h31
-rw-r--r--include/asm-arm26/namei.h25
-rw-r--r--include/asm-arm26/oldlatches.h37
-rw-r--r--include/asm-arm26/page.h115
-rw-r--r--include/asm-arm26/param.h33
-rw-r--r--include/asm-arm26/parport.h18
-rw-r--r--include/asm-arm26/pci.h6
-rw-r--r--include/asm-arm26/percpu.h6
-rw-r--r--include/asm-arm26/pgalloc.h70
-rw-r--r--include/asm-arm26/pgtable.h305
-rw-r--r--include/asm-arm26/poll.h25
-rw-r--r--include/asm-arm26/posix_types.h80
-rw-r--r--include/asm-arm26/proc-fns.h49
-rw-r--r--include/asm-arm26/processor.h113
-rw-r--r--include/asm-arm26/procinfo.h56
-rw-r--r--include/asm-arm26/ptrace.h104
-rw-r--r--include/asm-arm26/resource.h6
-rw-r--r--include/asm-arm26/scatterlist.h26
-rw-r--r--include/asm-arm26/sections.h2
-rw-r--r--include/asm-arm26/segment.h11
-rw-r--r--include/asm-arm26/semaphore-helper.h84
-rw-r--r--include/asm-arm26/semaphore.h103
-rw-r--r--include/asm-arm26/sembuf.h25
-rw-r--r--include/asm-arm26/serial.h63
-rw-r--r--include/asm-arm26/setup.h205
-rw-r--r--include/asm-arm26/shmbuf.h42
-rw-r--r--include/asm-arm26/shmparam.h15
-rw-r--r--include/asm-arm26/sigcontext.h33
-rw-r--r--include/asm-arm26/siginfo.h6
-rw-r--r--include/asm-arm26/signal.h201
-rw-r--r--include/asm-arm26/sizes.h52
-rw-r--r--include/asm-arm26/smp.h10
-rw-r--r--include/asm-arm26/socket.h50
-rw-r--r--include/asm-arm26/sockios.h12
-rw-r--r--include/asm-arm26/spinlock.h6
-rw-r--r--include/asm-arm26/stat.h77
-rw-r--r--include/asm-arm26/statfs.h8
-rw-r--r--include/asm-arm26/string.h43
-rw-r--r--include/asm-arm26/suspend.h4
-rw-r--r--include/asm-arm26/sysirq.h61
-rw-r--r--include/asm-arm26/system.h252
-rw-r--r--include/asm-arm26/termbits.h171
-rw-r--r--include/asm-arm26/termios.h108
-rw-r--r--include/asm-arm26/thread_info.h144
-rw-r--r--include/asm-arm26/timex.h29
-rw-r--r--include/asm-arm26/tlb.h78
-rw-r--r--include/asm-arm26/tlbflush.h70
-rw-r--r--include/asm-arm26/topology.h6
-rw-r--r--include/asm-arm26/types.h61
-rw-r--r--include/asm-arm26/uaccess-asm.h153
-rw-r--r--include/asm-arm26/uaccess.h299
-rw-r--r--include/asm-arm26/ucontext.h12
-rw-r--r--include/asm-arm26/unaligned.h118
-rw-r--r--include/asm-arm26/uncompress.h111
-rw-r--r--include/asm-arm26/unistd.h500
-rw-r--r--include/asm-arm26/user.h84
-rw-r--r--include/asm-arm26/xor.h141
107 files changed, 7919 insertions, 0 deletions
diff --git a/include/asm-arm26/a.out.h b/include/asm-arm26/a.out.h
new file mode 100644
index 000000000000..9b2702c42c87
--- /dev/null
+++ b/include/asm-arm26/a.out.h
@@ -0,0 +1,38 @@
1#ifndef __ARM_A_OUT_H__
2#define __ARM_A_OUT_H__
3
4#include <linux/personality.h>
5#include <asm/types.h>
6
7struct exec
8{
9 __u32 a_info; /* Use macros N_MAGIC, etc for access */
10 __u32 a_text; /* length of text, in bytes */
11 __u32 a_data; /* length of data, in bytes */
12 __u32 a_bss; /* length of uninitialized data area for file, in bytes */
13 __u32 a_syms; /* length of symbol table data in file, in bytes */
14 __u32 a_entry; /* start address */
15 __u32 a_trsize; /* length of relocation info for text, in bytes */
16 __u32 a_drsize; /* length of relocation info for data, in bytes */
17};
18
19/*
20 * This is always the same
21 */
22#define N_TXTADDR(a) (0x00008000)
23
24#define N_TRSIZE(a) ((a).a_trsize)
25#define N_DRSIZE(a) ((a).a_drsize)
26#define N_SYMSIZE(a) ((a).a_syms)
27
28#define M_ARM 103
29
30#ifdef __KERNEL__
31#define STACK_TOP TASK_SIZE
32#endif
33
34#ifndef LIBRARY_START_TEXT
35#define LIBRARY_START_TEXT (0x00c00000)
36#endif
37
38#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-arm26/assembler.h b/include/asm-arm26/assembler.h
new file mode 100644
index 000000000000..83f9aec55e4f
--- /dev/null
+++ b/include/asm-arm26/assembler.h
@@ -0,0 +1,106 @@
1/*
2 * linux/asm/assembler.h
3 *
4 * This file contains arm architecture specific defines
5 * for the different processors.
6 *
7 * Do not include any C declarations in this file - it is included by
8 * assembler source.
9 */
10#ifndef __ASSEMBLY__
11#error "Only include this from assembly code"
12#endif
13
14/*
15 * Endian independent macros for shifting bytes within registers.
16 */
17#define pull lsr
18#define push lsl
19#define byte(x) (x*8)
20
21#ifdef __STDC__
22#define LOADREGS(cond, base, reglist...)\
23 ldm##cond base,reglist^
24
25#define RETINSTR(instr, regs...)\
26 instr##s regs
27#else
28#define LOADREGS(cond, base, reglist...)\
29 ldm/**/cond base,reglist^
30
31#define RETINSTR(instr, regs...)\
32 instr/**/s regs
33#endif
34
35#define MODENOP\
36 mov r0, r0
37
38#define MODE(savereg,tmpreg,mode) \
39 mov savereg, pc; \
40 bic tmpreg, savereg, $0x0c000003; \
41 orr tmpreg, tmpreg, $mode; \
42 teqp tmpreg, $0
43
44#define RESTOREMODE(savereg) \
45 teqp savereg, $0
46
47#define SAVEIRQS(tmpreg)
48
49#define RESTOREIRQS(tmpreg)
50
51#define DISABLEIRQS(tmpreg)\
52 teqp pc, $0x08000003
53
54#define ENABLEIRQS(tmpreg)\
55 teqp pc, $0x00000003
56
57#define USERMODE(tmpreg)\
58 teqp pc, $0x00000000;\
59 mov r0, r0
60
61#define SVCMODE(tmpreg)\
62 teqp pc, $0x00000003;\
63 mov r0, r0
64
65
66/*
67 * Save the current IRQ state and disable IRQs
68 * Note that this macro assumes FIQs are enabled, and
69 * that the processor is in SVC mode.
70 */
71 .macro save_and_disable_irqs, oldcpsr, temp
72 mov \oldcpsr, pc
73 orr \temp, \oldcpsr, #0x08000000
74 teqp \temp, #0
75 .endm
76
77/*
78 * Restore interrupt state previously stored in
79 * a register
80 * ** Actually do nothing on Arc - hope that the caller uses a MOVS PC soon
81 * after!
82 */
83 .macro restore_irqs, oldcpsr
84 @ This be restore_irqs
85 .endm
86
87/*
88 * These two are used to save LR/restore PC over a user-based access.
89 * The old 26-bit architecture requires that we save lr (R14)
90 */
91 .macro save_lr
92 str lr, [sp, #-4]!
93 .endm
94
95 .macro restore_pc
96 ldmfd sp!, {pc}^
97 .endm
98
99#define USER(x...) \
1009999: x; \
101 .section __ex_table,"a"; \
102 .align 3; \
103 .long 9999b,9001f; \
104 .previous
105
106
diff --git a/include/asm-arm26/atomic.h b/include/asm-arm26/atomic.h
new file mode 100644
index 000000000000..4a88235c0e76
--- /dev/null
+++ b/include/asm-arm26/atomic.h
@@ -0,0 +1,93 @@
1/*
2 * linux/include/asm-arm26/atomic.h
3 *
4 * Copyright (c) 1996 Russell King.
5 * Modified for arm26 by Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Changelog:
12 * 25-11-2004 IM Updated for 2.6.9
13 * 27-06-1996 RMK Created
14 * 13-04-1997 RMK Made functions atomic!
15 * 07-12-1997 RMK Upgraded for v2.1.
16 * 26-08-1998 PJB Added #ifdef __KERNEL__
17 *
18 * FIXME - its probably worth seeing what these compile into...
19 */
20#ifndef __ASM_ARM_ATOMIC_H
21#define __ASM_ARM_ATOMIC_H
22
23#include <linux/config.h>
24
25#ifdef CONFIG_SMP
26#error SMP is NOT supported
27#endif
28
29typedef struct { volatile int counter; } atomic_t;
30
31#define ATOMIC_INIT(i) { (i) }
32
33#ifdef __KERNEL__
34#include <asm/system.h>
35
36#define atomic_read(v) ((v)->counter)
37#define atomic_set(v,i) (((v)->counter) = (i))
38
39static inline int atomic_add_return(int i, atomic_t *v)
40{
41 unsigned long flags;
42 int val;
43
44 local_irq_save(flags);
45 val = v->counter;
46 v->counter = val += i;
47 local_irq_restore(flags);
48
49 return val;
50}
51
52static inline int atomic_sub_return(int i, atomic_t *v)
53{
54 unsigned long flags;
55 int val;
56
57 local_irq_save(flags);
58 val = v->counter;
59 v->counter = val -= i;
60 local_irq_restore(flags);
61
62 return val;
63}
64
65static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
66{
67 unsigned long flags;
68
69 local_irq_save(flags);
70 *addr &= ~mask;
71 local_irq_restore(flags);
72}
73
74#define atomic_add(i, v) (void) atomic_add_return(i, v)
75#define atomic_inc(v) (void) atomic_add_return(1, v)
76#define atomic_sub(i, v) (void) atomic_sub_return(i, v)
77#define atomic_dec(v) (void) atomic_sub_return(1, v)
78
79#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
80#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
81#define atomic_inc_return(v) (atomic_add_return(1, v))
82#define atomic_dec_return(v) (atomic_sub_return(1, v))
83
84#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
85
86/* Atomic operations are already serializing on ARM26 */
87#define smp_mb__before_atomic_dec() barrier()
88#define smp_mb__after_atomic_dec() barrier()
89#define smp_mb__before_atomic_inc() barrier()
90#define smp_mb__after_atomic_inc() barrier()
91
92#endif
93#endif
diff --git a/include/asm-arm26/bitops.h b/include/asm-arm26/bitops.h
new file mode 100644
index 000000000000..7d062fb2e343
--- /dev/null
+++ b/include/asm-arm26/bitops.h
@@ -0,0 +1,332 @@
1/*
2 * Copyright 1995, Russell King.
3 *
4 * Based on the arm32 version by RMK (and others). Their copyrights apply to
5 * Those parts.
6 * Modified for arm26 by Ian Molton on 25/11/04
7 *
8 * bit 0 is the LSB of an "unsigned long" quantity.
9 *
10 * Please note that the code in this file should never be included
11 * from user space. Many of these are not implemented in assembler
12 * since they would be too costly. Also, they require privileged
13 * instructions (which are not available from user mode) to ensure
14 * that they are atomic.
15 */
16
17#ifndef __ASM_ARM_BITOPS_H
18#define __ASM_ARM_BITOPS_H
19
20#ifdef __KERNEL__
21
22#include <linux/compiler.h>
23#include <asm/system.h>
24
25#define smp_mb__before_clear_bit() do { } while (0)
26#define smp_mb__after_clear_bit() do { } while (0)
27
28/*
29 * These functions are the basis of our bit ops.
30 *
31 * First, the atomic bitops. These use native endian.
32 */
33static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
34{
35 unsigned long flags;
36 unsigned long mask = 1UL << (bit & 31);
37
38 p += bit >> 5;
39
40 local_irq_save(flags);
41 *p |= mask;
42 local_irq_restore(flags);
43}
44
45static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
46{
47 unsigned long flags;
48 unsigned long mask = 1UL << (bit & 31);
49
50 p += bit >> 5;
51
52 local_irq_save(flags);
53 *p &= ~mask;
54 local_irq_restore(flags);
55}
56
57static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
58{
59 unsigned long flags;
60 unsigned long mask = 1UL << (bit & 31);
61
62 p += bit >> 5;
63
64 local_irq_save(flags);
65 *p ^= mask;
66 local_irq_restore(flags);
67}
68
69static inline int
70____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
71{
72 unsigned long flags;
73 unsigned int res;
74 unsigned long mask = 1UL << (bit & 31);
75
76 p += bit >> 5;
77
78 local_irq_save(flags);
79 res = *p;
80 *p = res | mask;
81 local_irq_restore(flags);
82
83 return res & mask;
84}
85
86static inline int
87____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
88{
89 unsigned long flags;
90 unsigned int res;
91 unsigned long mask = 1UL << (bit & 31);
92
93 p += bit >> 5;
94
95 local_irq_save(flags);
96 res = *p;
97 *p = res & ~mask;
98 local_irq_restore(flags);
99
100 return res & mask;
101}
102
103static inline int
104____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
105{
106 unsigned long flags;
107 unsigned int res;
108 unsigned long mask = 1UL << (bit & 31);
109
110 p += bit >> 5;
111
112 local_irq_save(flags);
113 res = *p;
114 *p = res ^ mask;
115 local_irq_restore(flags);
116
117 return res & mask;
118}
119
120/*
121 * Now the non-atomic variants. We let the compiler handle all
122 * optimisations for these. These are all _native_ endian.
123 */
124static inline void __set_bit(int nr, volatile unsigned long *p)
125{
126 p[nr >> 5] |= (1UL << (nr & 31));
127}
128
129static inline void __clear_bit(int nr, volatile unsigned long *p)
130{
131 p[nr >> 5] &= ~(1UL << (nr & 31));
132}
133
134static inline void __change_bit(int nr, volatile unsigned long *p)
135{
136 p[nr >> 5] ^= (1UL << (nr & 31));
137}
138
139static inline int __test_and_set_bit(int nr, volatile unsigned long *p)
140{
141 unsigned long oldval, mask = 1UL << (nr & 31);
142
143 p += nr >> 5;
144
145 oldval = *p;
146 *p = oldval | mask;
147 return oldval & mask;
148}
149
150static inline int __test_and_clear_bit(int nr, volatile unsigned long *p)
151{
152 unsigned long oldval, mask = 1UL << (nr & 31);
153
154 p += nr >> 5;
155
156 oldval = *p;
157 *p = oldval & ~mask;
158 return oldval & mask;
159}
160
161static inline int __test_and_change_bit(int nr, volatile unsigned long *p)
162{
163 unsigned long oldval, mask = 1UL << (nr & 31);
164
165 p += nr >> 5;
166
167 oldval = *p;
168 *p = oldval ^ mask;
169 return oldval & mask;
170}
171
172/*
173 * This routine doesn't need to be atomic.
174 */
175static inline int __test_bit(int nr, const volatile unsigned long * p)
176{
177 return (p[nr >> 5] >> (nr & 31)) & 1UL;
178}
179
180/*
181 * Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
182 */
183extern void _set_bit_le(int nr, volatile unsigned long * p);
184extern void _clear_bit_le(int nr, volatile unsigned long * p);
185extern void _change_bit_le(int nr, volatile unsigned long * p);
186extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
187extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
188extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
189extern int _find_first_zero_bit_le(void * p, unsigned size);
190extern int _find_next_zero_bit_le(void * p, int size, int offset);
191extern int _find_first_bit_le(const unsigned long *p, unsigned size);
192extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
193
194/*
195 * The __* form of bitops are non-atomic and may be reordered.
196 */
197#define ATOMIC_BITOP_LE(name,nr,p) \
198 (__builtin_constant_p(nr) ? \
199 ____atomic_##name(nr, p) : \
200 _##name##_le(nr,p))
201
202#define NONATOMIC_BITOP(name,nr,p) \
203 (____nonatomic_##name(nr, p))
204
205/*
206 * These are the little endian, atomic definitions.
207 */
208#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p)
209#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p)
210#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p)
211#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
212#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
213#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
214#define test_bit(nr,p) __test_bit(nr,p)
215#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
216#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off)
217#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
218#define find_next_bit(p,sz,off) _find_next_bit_le(p,sz,off)
219
220#define WORD_BITOFF_TO_LE(x) ((x))
221
222/*
223 * ffz = Find First Zero in word. Undefined if no zero exists,
224 * so code should check against ~0UL first..
225 */
226static inline unsigned long ffz(unsigned long word)
227{
228 int k;
229
230 word = ~word;
231 k = 31;
232 if (word & 0x0000ffff) { k -= 16; word <<= 16; }
233 if (word & 0x00ff0000) { k -= 8; word <<= 8; }
234 if (word & 0x0f000000) { k -= 4; word <<= 4; }
235 if (word & 0x30000000) { k -= 2; word <<= 2; }
236 if (word & 0x40000000) { k -= 1; }
237 return k;
238}
239
240/*
241 * ffz = Find First Zero in word. Undefined if no zero exists,
242 * so code should check against ~0UL first..
243 */
244static inline unsigned long __ffs(unsigned long word)
245{
246 int k;
247
248 k = 31;
249 if (word & 0x0000ffff) { k -= 16; word <<= 16; }
250 if (word & 0x00ff0000) { k -= 8; word <<= 8; }
251 if (word & 0x0f000000) { k -= 4; word <<= 4; }
252 if (word & 0x30000000) { k -= 2; word <<= 2; }
253 if (word & 0x40000000) { k -= 1; }
254 return k;
255}
256
257/*
258 * fls: find last bit set.
259 */
260
261#define fls(x) generic_fls(x)
262
263/*
264 * ffs: find first bit set. This is defined the same way as
265 * the libc and compiler builtin ffs routines, therefore
266 * differs in spirit from the above ffz (man ffs).
267 */
268
269#define ffs(x) generic_ffs(x)
270
271/*
272 * Find first bit set in a 168-bit bitmap, where the first
273 * 128 bits are unlikely to be set.
274 */
275static inline int sched_find_first_bit(unsigned long *b)
276{
277 unsigned long v;
278 unsigned int off;
279
280 for (off = 0; v = b[off], off < 4; off++) {
281 if (unlikely(v))
282 break;
283 }
284 return __ffs(v) + off * 32;
285}
286
287/*
288 * hweightN: returns the hamming weight (i.e. the number
289 * of bits set) of a N-bit word
290 */
291
292#define hweight32(x) generic_hweight32(x)
293#define hweight16(x) generic_hweight16(x)
294#define hweight8(x) generic_hweight8(x)
295
296/*
297 * Ext2 is defined to use little-endian byte ordering.
298 * These do not need to be atomic.
299 */
300#define ext2_set_bit(nr,p) \
301 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
302#define ext2_set_bit_atomic(lock,nr,p) \
303 test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
304#define ext2_clear_bit(nr,p) \
305 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
306#define ext2_clear_bit_atomic(lock,nr,p) \
307 test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
308#define ext2_test_bit(nr,p) \
309 __test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
310#define ext2_find_first_zero_bit(p,sz) \
311 _find_first_zero_bit_le(p,sz)
312#define ext2_find_next_zero_bit(p,sz,off) \
313 _find_next_zero_bit_le(p,sz,off)
314
315/*
316 * Minix is defined to use little-endian byte ordering.
317 * These do not need to be atomic.
318 */
319#define minix_set_bit(nr,p) \
320 __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
321#define minix_test_bit(nr,p) \
322 __test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
323#define minix_test_and_set_bit(nr,p) \
324 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
325#define minix_test_and_clear_bit(nr,p) \
326 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
327#define minix_find_first_zero_bit(p,sz) \
328 _find_first_zero_bit_le(p,sz)
329
330#endif /* __KERNEL__ */
331
332#endif /* _ARM_BITOPS_H */
diff --git a/include/asm-arm26/bug.h b/include/asm-arm26/bug.h
new file mode 100644
index 000000000000..920b70533368
--- /dev/null
+++ b/include/asm-arm26/bug.h
@@ -0,0 +1,17 @@
1#ifndef _ASMARM_BUG_H
2#define _ASMARM_BUG_H
3
4#include <linux/config.h>
5
6#ifdef CONFIG_DEBUG_BUGVERBOSE
7extern volatile void __bug(const char *file, int line, void *data);
8/* give file/line information */
9#define BUG() __bug(__FILE__, __LINE__, NULL)
10#else
11#define BUG() (*(int *)0 = 0)
12#endif
13
14#define HAVE_ARCH_BUG
15#include <asm-generic/bug.h>
16
17#endif
diff --git a/include/asm-arm26/bugs.h b/include/asm-arm26/bugs.h
new file mode 100644
index 000000000000..e99ac2e46d7f
--- /dev/null
+++ b/include/asm-arm26/bugs.h
@@ -0,0 +1,15 @@
1/*
2 * linux/include/asm-arm26/bugs.h
3 *
4 * Copyright (C) 1995 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_BUGS_H
11#define __ASM_BUGS_H
12
13#define check_bugs() cpu_check_bugs()
14
15#endif
diff --git a/include/asm-arm26/byteorder.h b/include/asm-arm26/byteorder.h
new file mode 100644
index 000000000000..0b4af9ac76e9
--- /dev/null
+++ b/include/asm-arm26/byteorder.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/byteorder.h
3 *
4 * ARM Endian-ness. In little endian mode, the data bus is connected such
5 * that byte accesses appear as:
6 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
7 * and word accesses (data or instruction) appear as:
8 * d0...d31
9 *
10 */
11#ifndef __ASM_ARM_BYTEORDER_H
12#define __ASM_ARM_BYTEORDER_H
13
14#include <asm/types.h>
15
16#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
17# define __BYTEORDER_HAS_U64__
18# define __SWAB_64_THRU_32__
19#endif
20
21#include <linux/byteorder/little_endian.h>
22
23#endif
24
diff --git a/include/asm-arm26/cache.h b/include/asm-arm26/cache.h
new file mode 100644
index 000000000000..f52ca1b808cd
--- /dev/null
+++ b/include/asm-arm26/cache.h
@@ -0,0 +1,11 @@
1/*
2 * linux/include/asm-arm26/cache.h
3 */
4#ifndef __ASMARM_CACHE_H
5#define __ASMARM_CACHE_H
6
7#define L1_CACHE_BYTES 32
8#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
9#define SMP_CACHE_BYTES L1_CACHE_BYTES
10
11#endif
diff --git a/include/asm-arm26/cacheflush.h b/include/asm-arm26/cacheflush.h
new file mode 100644
index 000000000000..9c1b9c7f2ebd
--- /dev/null
+++ b/include/asm-arm26/cacheflush.h
@@ -0,0 +1,52 @@
1/*
2 * linux/include/asm-arm/cacheflush.h
3 *
4 * Copyright (C) 2000-2002 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * ARM26 cache 'functions'
12 *
13 */
14
15#ifndef _ASMARM_CACHEFLUSH_H
16#define _ASMARM_CACHEFLUSH_H
17
18#if 1 //FIXME - BAD INCLUDES!!!
19#include <linux/sched.h>
20#include <linux/mm.h>
21#endif
22
23#define flush_cache_all() do { } while (0)
24#define flush_cache_mm(mm) do { } while (0)
25#define flush_cache_range(vma,start,end) do { } while (0)
26#define flush_cache_page(vma,vmaddr,pfn) do { } while (0)
27#define flush_cache_vmap(start, end) do { } while (0)
28#define flush_cache_vunmap(start, end) do { } while (0)
29
30#define invalidate_dcache_range(start,end) do { } while (0)
31#define clean_dcache_range(start,end) do { } while (0)
32#define flush_dcache_range(start,end) do { } while (0)
33#define flush_dcache_page(page) do { } while (0)
34#define flush_dcache_mmap_lock(mapping) do { } while (0)
35#define flush_dcache_mmap_unlock(mapping) do { } while (0)
36#define clean_dcache_entry(_s) do { } while (0)
37#define clean_cache_entry(_start) do { } while (0)
38
39#define flush_icache_user_range(start,end, bob, fred) do { } while (0)
40#define flush_icache_range(start,end) do { } while (0)
41#define flush_icache_page(vma,page) do { } while (0)
42
43#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
44 memcpy(dst, src, len)
45#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
46 memcpy(dst, src, len)
47
48/* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */
49/* IM : Yes, it will, but only if setup to do so (we do this). */
50#define clean_cache_area(_start,_size) do { } while (0)
51
52#endif
diff --git a/include/asm-arm26/checksum.h b/include/asm-arm26/checksum.h
new file mode 100644
index 000000000000..d4256d5f3a7c
--- /dev/null
+++ b/include/asm-arm26/checksum.h
@@ -0,0 +1,160 @@
1/*
2 * linux/include/asm-arm/checksum.h
3 *
4 * IP checksum routines
5 *
6 * Copyright (C) Original authors of ../asm-i386/checksum.h
7 * Copyright (C) 1996-1999 Russell King
8 */
9#ifndef __ASM_ARM_CHECKSUM_H
10#define __ASM_ARM_CHECKSUM_H
11
12#include <linux/in6.h>
13
14/*
15 * computes the checksum of a memory block at buff, length len,
16 * and adds in "sum" (32-bit)
17 *
18 * returns a 32-bit number suitable for feeding into itself
19 * or csum_tcpudp_magic
20 *
21 * this function must be called with even lengths, except
22 * for the last fragment, which may be odd
23 *
24 * it's best to have buff aligned on a 32-bit boundary
25 */
26unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
27
28/*
29 * the same as csum_partial, but copies from src while it
30 * checksums, and handles user-space pointer exceptions correctly, when needed.
31 *
32 * here even more important to align src and dst on a 32-bit (or even
33 * better 64-bit) boundary
34 */
35
36unsigned int
37csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum);
38
39unsigned int
40csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr);
41
42/*
43 * This is the old (and unsafe) way of doing checksums, a warning message will
44 * be printed if it is used and an exception occurs.
45 *
46 * this functions should go away after some time.
47 */
48#define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum)
49
50/*
51 * This is a version of ip_compute_csum() optimized for IP headers,
52 * which always checksum on 4 octet boundaries.
53 */
54static inline unsigned short
55ip_fast_csum(unsigned char * iph, unsigned int ihl)
56{
57 unsigned int sum, tmp1;
58
59 __asm__ __volatile__(
60 "ldr %0, [%1], #4 @ ip_fast_csum \n\
61 ldr %3, [%1], #4 \n\
62 sub %2, %2, #5 \n\
63 adds %0, %0, %3 \n\
64 ldr %3, [%1], #4 \n\
65 adcs %0, %0, %3 \n\
66 ldr %3, [%1], #4 \n\
671: adcs %0, %0, %3 \n\
68 ldr %3, [%1], #4 \n\
69 tst %2, #15 @ do this carefully \n\
70 subne %2, %2, #1 @ without destroying \n\
71 bne 1b @ the carry flag \n\
72 adcs %0, %0, %3 \n\
73 adc %0, %0, #0 \n\
74 adds %0, %0, %0, lsl #16 \n\
75 addcs %0, %0, #0x10000 \n\
76 mvn %0, %0 \n\
77 mov %0, %0, lsr #16"
78 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
79 : "1" (iph), "2" (ihl)
80 : "cc");
81 return sum;
82}
83
84/*
85 * Fold a partial checksum without adding pseudo headers
86 */
87static inline unsigned int
88csum_fold(unsigned int sum)
89{
90 __asm__(
91 "adds %0, %1, %1, lsl #16 @ csum_fold \n\
92 addcs %0, %0, #0x10000"
93 : "=r" (sum)
94 : "r" (sum)
95 : "cc");
96 return (~sum) >> 16;
97}
98
99static inline unsigned int
100csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
101 unsigned int proto, unsigned int sum)
102{
103 __asm__(
104 "adds %0, %1, %2 @ csum_tcpudp_nofold \n\
105 adcs %0, %0, %3 \n\
106 adcs %0, %0, %4 \n\
107 adcs %0, %0, %5 \n\
108 adc %0, %0, #0"
109 : "=&r"(sum)
110 : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
111 : "cc");
112 return sum;
113}
114/*
115 * computes the checksum of the TCP/UDP pseudo-header
116 * returns a 16-bit checksum, already complemented
117 */
118static inline unsigned short int
119csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
120 unsigned int proto, unsigned int sum)
121{
122 __asm__(
123 "adds %0, %1, %2 @ csum_tcpudp_magic \n\
124 adcs %0, %0, %3 \n\
125 adcs %0, %0, %4 \n\
126 adcs %0, %0, %5 \n\
127 adc %0, %0, #0 \n\
128 adds %0, %0, %0, lsl #16 \n\
129 addcs %0, %0, #0x10000 \n\
130 mvn %0, %0"
131 : "=&r"(sum)
132 : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
133 : "cc");
134 return sum >> 16;
135}
136
137
138/*
139 * this routine is used for miscellaneous IP-like checksums, mainly
140 * in icmp.c
141 */
142static inline unsigned short
143ip_compute_csum(unsigned char * buff, int len)
144{
145 return csum_fold(csum_partial(buff, len, 0));
146}
147
148#define _HAVE_ARCH_IPV6_CSUM
149extern unsigned long
150__csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
151 __u32 proto, unsigned int sum);
152
153static inline unsigned short int
154csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
155 unsigned short proto, unsigned int sum)
156{
157 return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
158 htonl(proto), sum));
159}
160#endif
diff --git a/include/asm-arm26/constants.h b/include/asm-arm26/constants.h
new file mode 100644
index 000000000000..0d0b14415563
--- /dev/null
+++ b/include/asm-arm26/constants.h
@@ -0,0 +1,28 @@
1#ifndef __ASM_OFFSETS_H__
2#define __ASM_OFFSETS_H__
3/*
4 * DO NOT MODIFY.
5 *
6 * This file was generated by arch/arm26/Makefile
7 *
8 */
9
10#define TSK_ACTIVE_MM 96 /* offsetof(struct task_struct, active_mm) */
11
12#define VMA_VM_MM 0 /* offsetof(struct vm_area_struct, vm_mm) */
13#define VMA_VM_FLAGS 20 /* offsetof(struct vm_area_struct, vm_flags) */
14
15#define VM_EXEC 4 /* VM_EXEC */
16
17
18#define PAGE_PRESENT 1 /* L_PTE_PRESENT */
19#define PAGE_READONLY 95 /* PAGE_READONLY */
20#define PAGE_NOT_USER 3 /* PAGE_NONE */
21#define PAGE_OLD 3 /* PAGE_NONE */
22#define PAGE_CLEAN 128 /* L_PTE_DIRTY */
23
24#define PAGE_SZ 32768 /* PAGE_SIZE */
25
26#define SYS_ERROR0 10420224 /* 0x9f0000 */
27
28#endif
diff --git a/include/asm-arm26/cputime.h b/include/asm-arm26/cputime.h
new file mode 100644
index 000000000000..d2783a9e47b3
--- /dev/null
+++ b/include/asm-arm26/cputime.h
@@ -0,0 +1,6 @@
1#ifndef __ARM26_CPUTIME_H
2#define __ARM26_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* __ARM26_CPUTIME_H */
diff --git a/include/asm-arm26/current.h b/include/asm-arm26/current.h
new file mode 100644
index 000000000000..75d21e2a3ff7
--- /dev/null
+++ b/include/asm-arm26/current.h
@@ -0,0 +1,15 @@
1#ifndef _ASMARM_CURRENT_H
2#define _ASMARM_CURRENT_H
3
4#include <linux/thread_info.h>
5
6static inline struct task_struct *get_current(void) __attribute_const__;
7
8static inline struct task_struct *get_current(void)
9{
10 return current_thread_info()->task;
11}
12
13#define current (get_current())
14
15#endif /* _ASMARM_CURRENT_H */
diff --git a/include/asm-arm26/delay.h b/include/asm-arm26/delay.h
new file mode 100644
index 000000000000..40fbf7bbe6c2
--- /dev/null
+++ b/include/asm-arm26/delay.h
@@ -0,0 +1,34 @@
1#ifndef __ASM_ARM_DELAY_H
2#define __ASM_ARM_DELAY_H
3
4/*
5 * Copyright (C) 1995 Russell King
6 *
7 * Delay routines, using a pre-computed "loops_per_second" value.
8 */
9
10extern void __delay(int loops);
11
12/*
13 * division by multiplication: you don't have to worry about
14 * loss of precision.
15 *
16 * Use only for very small delays ( < 1 msec). Should probably use a
17 * lookup table, really, as the multiplications take much too long with
18 * short delays. This is a "reasonable" implementation, though (and the
19 * first constant multiplications gets optimized away if the delay is
20 * a constant)
21 *
22 * FIXME - lets improve it then...
23 */
24extern void udelay(unsigned long usecs);
25
26static inline unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
27{
28 return a * b / c;
29}
30
31
32
33#endif /* defined(_ARM_DELAY_H) */
34
diff --git a/include/asm-arm26/div64.h b/include/asm-arm26/div64.h
new file mode 100644
index 000000000000..6cd978cefb28
--- /dev/null
+++ b/include/asm-arm26/div64.h
@@ -0,0 +1 @@
#include <asm-generic/div64.h>
diff --git a/include/asm-arm26/dma-mapping.h b/include/asm-arm26/dma-mapping.h
new file mode 100644
index 000000000000..a95eae0aeb77
--- /dev/null
+++ b/include/asm-arm26/dma-mapping.h
@@ -0,0 +1,2 @@
1#include <asm-generic/dma-mapping-broken.h>
2
diff --git a/include/asm-arm26/dma.h b/include/asm-arm26/dma.h
new file mode 100644
index 000000000000..995e223e43a1
--- /dev/null
+++ b/include/asm-arm26/dma.h
@@ -0,0 +1,184 @@
1#ifndef __ASM_ARM_DMA_H
2#define __ASM_ARM_DMA_H
3
4typedef unsigned int dmach_t;
5
6#include <linux/config.h>
7#include <linux/spinlock.h>
8#include <asm/system.h>
9#include <asm/memory.h>
10#include <asm/scatterlist.h>
11
12// FIXME - do we really need this? arm26 cant do 'proper' DMA
13
14typedef struct dma_struct dma_t;
15typedef unsigned int dmamode_t;
16
17struct dma_ops {
18 int (*request)(dmach_t, dma_t *); /* optional */
19 void (*free)(dmach_t, dma_t *); /* optional */
20 void (*enable)(dmach_t, dma_t *); /* mandatory */
21 void (*disable)(dmach_t, dma_t *); /* mandatory */
22 int (*residue)(dmach_t, dma_t *); /* optional */
23 int (*setspeed)(dmach_t, dma_t *, int); /* optional */
24 char *type;
25};
26
27struct dma_struct {
28 struct scatterlist buf; /* single DMA */
29 int sgcount; /* number of DMA SG */
30 struct scatterlist *sg; /* DMA Scatter-Gather List */
31
32 unsigned int active:1; /* Transfer active */
33 unsigned int invalid:1; /* Address/Count changed */
34 unsigned int using_sg:1; /* using scatter list? */
35 dmamode_t dma_mode; /* DMA mode */
36 int speed; /* DMA speed */
37
38 unsigned int lock; /* Device is allocated */
39 const char *device_id; /* Device name */
40
41 unsigned int dma_base; /* Controller base address */
42 int dma_irq; /* Controller IRQ */
43 int state; /* Controller state */
44 struct scatterlist cur_sg; /* Current controller buffer */
45
46 struct dma_ops *d_ops;
47};
48
49/* Prototype: void arch_dma_init(dma)
50 * Purpose : Initialise architecture specific DMA
51 * Params : dma - pointer to array of DMA structures
52 */
53extern void arch_dma_init(dma_t *dma);
54
55extern void isa_init_dma(dma_t *dma);
56
57
58#define MAX_DMA_ADDRESS 0x03000000
59#define MAX_DMA_CHANNELS 3
60
61/* ARC */
62#define DMA_VIRTUAL_FLOPPY0 0
63#define DMA_VIRTUAL_FLOPPY1 1
64#define DMA_VIRTUAL_SOUND 2
65
66/* A5K */
67#define DMA_FLOPPY 0
68
69/*
70 * DMA modes
71 */
72#define DMA_MODE_MASK 3
73
74#define DMA_MODE_READ 0
75#define DMA_MODE_WRITE 1
76#define DMA_MODE_CASCADE 2
77#define DMA_AUTOINIT 4
78
79extern spinlock_t dma_spin_lock;
80
81static inline unsigned long claim_dma_lock(void)
82{
83 unsigned long flags;
84 spin_lock_irqsave(&dma_spin_lock, flags);
85 return flags;
86}
87
88static inline void release_dma_lock(unsigned long flags)
89{
90 spin_unlock_irqrestore(&dma_spin_lock, flags);
91}
92
93/* Clear the 'DMA Pointer Flip Flop'.
94 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
95 */
96#define clear_dma_ff(channel)
97
98/* Set only the page register bits of the transfer address.
99 *
100 * NOTE: This is an architecture specific function, and should
101 * be hidden from the drivers
102 */
103extern void set_dma_page(dmach_t channel, char pagenr);
104
105/* Request a DMA channel
106 *
107 * Some architectures may need to do allocate an interrupt
108 */
109extern int request_dma(dmach_t channel, const char * device_id);
110
111/* Free a DMA channel
112 *
113 * Some architectures may need to do free an interrupt
114 */
115extern void free_dma(dmach_t channel);
116
117/* Enable DMA for this channel
118 *
119 * On some architectures, this may have other side effects like
120 * enabling an interrupt and setting the DMA registers.
121 */
122extern void enable_dma(dmach_t channel);
123
124/* Disable DMA for this channel
125 *
126 * On some architectures, this may have other side effects like
127 * disabling an interrupt or whatever.
128 */
129extern void disable_dma(dmach_t channel);
130
131/* Test whether the specified channel has an active DMA transfer
132 */
133extern int dma_channel_active(dmach_t channel);
134
135/* Set the DMA scatter gather list for this channel
136 *
137 * This should not be called if a DMA channel is enabled,
138 * especially since some DMA architectures don't update the
139 * DMA address immediately, but defer it to the enable_dma().
140 */
141extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
142
143/* Set the DMA address for this channel
144 *
145 * This should not be called if a DMA channel is enabled,
146 * especially since some DMA architectures don't update the
147 * DMA address immediately, but defer it to the enable_dma().
148 */
149extern void set_dma_addr(dmach_t channel, unsigned long physaddr);
150
151/* Set the DMA byte count for this channel
152 *
153 * This should not be called if a DMA channel is enabled,
154 * especially since some DMA architectures don't update the
155 * DMA count immediately, but defer it to the enable_dma().
156 */
157extern void set_dma_count(dmach_t channel, unsigned long count);
158
159/* Set the transfer direction for this channel
160 *
161 * This should not be called if a DMA channel is enabled,
162 * especially since some DMA architectures don't update the
163 * DMA transfer direction immediately, but defer it to the
164 * enable_dma().
165 */
166extern void set_dma_mode(dmach_t channel, dmamode_t mode);
167
168/* Set the transfer speed for this channel
169 */
170extern void set_dma_speed(dmach_t channel, int cycle_ns);
171
172/* Get DMA residue count. After a DMA transfer, this
173 * should return zero. Reading this while a DMA transfer is
174 * still in progress will return unpredictable results.
175 * If called before the channel has been used, it may return 1.
176 * Otherwise, it returns the number of _bytes_ left to transfer.
177 */
178extern int get_dma_residue(dmach_t channel);
179
180#ifndef NO_DMA
181#define NO_DMA 255
182#endif
183
184#endif /* _ARM_DMA_H */
diff --git a/include/asm-arm26/ecard.h b/include/asm-arm26/ecard.h
new file mode 100644
index 000000000000..66691939c3c1
--- /dev/null
+++ b/include/asm-arm26/ecard.h
@@ -0,0 +1,294 @@
1/*
2 * linux/include/asm-arm26/ecard.h
3 *
4 * definitions for expansion cards
5 *
6 * This is a new system as from Linux 1.2.3
7 *
8 * Changelog:
9 * 11-12-1996 RMK Further minor improvements
10 * 12-09-1997 RMK Added interrupt enable/disable for card level
11 * 18-05-2003 IM Adjusted for ARM26
12 *
13 * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
14 */
15
16#ifndef __ASM_ECARD_H
17#define __ASM_ECARD_H
18
19/*
20 * Currently understood cards (but not necessarily
21 * supported):
22 * Manufacturer Product ID
23 */
24#define MANU_ACORN 0x0000
25#define PROD_ACORN_SCSI 0x0002
26#define PROD_ACORN_ETHER1 0x0003
27#define PROD_ACORN_MFM 0x000b
28
29#define MANU_CCONCEPTS 0x0009
30#define PROD_CCONCEPTS_COLOURCARD 0x0050
31
32#define MANU_ANT2 0x0011
33#define PROD_ANT_ETHER3 0x00a4
34
35#define MANU_ATOMWIDE 0x0017
36#define PROD_ATOMWIDE_3PSERIAL 0x0090
37
38#define MANU_IRLAM_INSTRUMENTS 0x001f
39#define MANU_IRLAM_INSTRUMENTS_ETHERN 0x5678
40
41#define MANU_OAK 0x0021
42#define PROD_OAK_SCSI 0x0058
43
44#define MANU_MORLEY 0x002b
45#define PROD_MORLEY_SCSI_UNCACHED 0x0067
46
47#define MANU_CUMANA 0x003a
48#define PROD_CUMANA_SCSI_2 0x003a
49#define PROD_CUMANA_SCSI_1 0x00a0
50
51#define MANU_ICS 0x003c
52#define PROD_ICS_IDE 0x00ae
53
54#define MANU_ICS2 0x003d
55#define PROD_ICS2_IDE 0x00ae
56
57#define MANU_SERPORT 0x003f
58#define PROD_SERPORT_DSPORT 0x00b9
59
60#define MANU_ARXE 0x0041
61#define PROD_ARXE_SCSI 0x00be
62
63#define MANU_I3 0x0046
64#define PROD_I3_ETHERLAN500 0x00d4
65#define PROD_I3_ETHERLAN600 0x00ec
66#define PROD_I3_ETHERLAN600A 0x011e
67
68#define MANU_ANT 0x0053
69#define PROD_ANT_ETHERM 0x00d8
70#define PROD_ANT_ETHERB 0x00e4
71
72#define MANU_ALSYSTEMS 0x005b
73#define PROD_ALSYS_SCSIATAPI 0x0107
74
75#define MANU_MCS 0x0063
76#define PROD_MCS_CONNECT32 0x0125
77
78#define MANU_EESOX 0x0064
79#define PROD_EESOX_SCSI2 0x008c
80
81#define MANU_YELLOWSTONE 0x0096
82#define PROD_YELLOWSTONE_RAPIDE32 0x0120
83
84#define MANU_SIMTEC 0x005f
85#define PROD_SIMTEC_IDE8 0x0130
86#define PROD_SIMTEC_IDE16 0x0131
87
88
89#ifdef ECARD_C
90#define CONST
91#else
92#define CONST const
93#endif
94
95#define MAX_ECARDS 4
96
97typedef enum { /* Cards address space */
98 ECARD_IOC,
99 ECARD_MEMC,
100 ECARD_EASI
101} card_type_t;
102
103typedef enum { /* Speed for ECARD_IOC space */
104 ECARD_SLOW = 0,
105 ECARD_MEDIUM = 1,
106 ECARD_FAST = 2,
107 ECARD_SYNC = 3
108} card_speed_t;
109
110struct ecard_id { /* Card ID structure */
111 unsigned short manufacturer;
112 unsigned short product;
113 void *data;
114};
115
116struct in_ecid { /* Packed card ID information */
117 unsigned short product; /* Product code */
118 unsigned short manufacturer; /* Manufacturer code */
119 unsigned char id:4; /* Simple ID */
120 unsigned char cd:1; /* Chunk dir present */
121 unsigned char is:1; /* Interrupt status pointers */
122 unsigned char w:2; /* Width */
123 unsigned char country; /* Country */
124 unsigned char irqmask; /* IRQ mask */
125 unsigned char fiqmask; /* FIQ mask */
126 unsigned long irqoff; /* IRQ offset */
127 unsigned long fiqoff; /* FIQ offset */
128};
129
130typedef struct expansion_card ecard_t;
131typedef unsigned long *loader_t;
132
133typedef struct { /* Card handler routines */
134 void (*irqenable)(ecard_t *ec, int irqnr);
135 void (*irqdisable)(ecard_t *ec, int irqnr);
136 int (*irqpending)(ecard_t *ec);
137 void (*fiqenable)(ecard_t *ec, int fiqnr);
138 void (*fiqdisable)(ecard_t *ec, int fiqnr);
139 int (*fiqpending)(ecard_t *ec);
140} expansioncard_ops_t;
141
142#define ECARD_NUM_RESOURCES (6)
143
144#define ECARD_RES_IOCSLOW (0)
145#define ECARD_RES_IOCMEDIUM (1)
146#define ECARD_RES_IOCFAST (2)
147#define ECARD_RES_IOCSYNC (3)
148#define ECARD_RES_MEMC (4)
149#define ECARD_RES_EASI (5)
150
151#define ecard_resource_start(ec,nr) ((ec)->resource[nr].start)
152#define ecard_resource_end(ec,nr) ((ec)->resource[nr].end)
153#define ecard_resource_len(ec,nr) ((ec)->resource[nr].end - \
154 (ec)->resource[nr].start + 1)
155
156/*
157 * This contains all the info needed on an expansion card
158 */
159struct expansion_card {
160 struct expansion_card *next;
161
162 struct device dev;
163 struct resource resource[ECARD_NUM_RESOURCES];
164
165 /* Public data */
166 volatile unsigned char *irqaddr; /* address of IRQ register */
167 volatile unsigned char *fiqaddr; /* address of FIQ register */
168 unsigned char irqmask; /* IRQ mask */
169 unsigned char fiqmask; /* FIQ mask */
170 unsigned char claimed; /* Card claimed? */
171
172 void *irq_data; /* Data for use for IRQ by card */
173 void *fiq_data; /* Data for use for FIQ by card */
174 const expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
175
176 CONST unsigned int slot_no; /* Slot number */
177 CONST unsigned int dma; /* DMA number (for request_dma) */
178 CONST unsigned int irq; /* IRQ number (for request_irq) */
179 CONST unsigned int fiq; /* FIQ number (for request_irq) */
180 CONST card_type_t type; /* Type of card */
181 CONST struct in_ecid cid; /* Card Identification */
182
183 /* Private internal data */
184 const char *card_desc; /* Card description */
185 CONST unsigned int podaddr; /* Base Linux address for card */
186 CONST loader_t loader; /* loader program */
187 u64 dma_mask;
188};
189
190struct in_chunk_dir {
191 unsigned int start_offset;
192 union {
193 unsigned char string[256];
194 unsigned char data[1];
195 } d;
196};
197
198/*
199 * ecard_claim: claim an expansion card entry
200 * FIXME - are these atomic / called with interrupts off ?
201 */
202#define ecard_claim(ec) ((ec)->claimed = 1)
203
204/*
205 * ecard_release: release an expansion card entry
206 */
207#define ecard_release(ec) ((ec)->claimed = 0)
208
209/*
210 * Read a chunk from an expansion card
211 * cd : where to put read data
212 * ec : expansion card info struct
213 * id : id number to find
214 * num: (n+1)'th id to find.
215 */
216extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
217
218/*
219 * Obtain the address of a card
220 */
221extern unsigned int ecard_address (struct expansion_card *ec, card_type_t card_type, card_speed_t speed);
222
223#ifdef ECARD_C
224/* Definitions internal to ecard.c - for it's use only!!
225 *
226 * External expansion card header as read from the card
227 */
228struct ex_ecid {
229 unsigned char r_irq:1;
230 unsigned char r_zero:1;
231 unsigned char r_fiq:1;
232 unsigned char r_id:4;
233 unsigned char r_a:1;
234
235 unsigned char r_cd:1;
236 unsigned char r_is:1;
237 unsigned char r_w:2;
238 unsigned char r_r1:4;
239
240 unsigned char r_r2:8;
241
242 unsigned char r_prod[2];
243
244 unsigned char r_manu[2];
245
246 unsigned char r_country;
247
248 unsigned char r_irqmask;
249 unsigned char r_irqoff[3];
250
251 unsigned char r_fiqmask;
252 unsigned char r_fiqoff[3];
253};
254
255/*
256 * Chunk directory entry as read from the card
257 */
258struct ex_chunk_dir {
259 unsigned char r_id;
260 unsigned char r_len[3];
261 unsigned long r_start;
262 union {
263 char string[256];
264 char data[1];
265 } d;
266#define c_id(x) ((x)->r_id)
267#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
268#define c_start(x) ((x)->r_start)
269};
270
271#endif
272
273extern struct bus_type ecard_bus_type;
274
275#define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev)
276
277struct ecard_driver {
278 int (*probe)(struct expansion_card *, const struct ecard_id *id);
279 void (*remove)(struct expansion_card *);
280 void (*shutdown)(struct expansion_card *);
281 const struct ecard_id *id_table;
282 unsigned int id;
283 struct device_driver drv;
284};
285
286#define ECARD_DRV(_d) container_of((_d), struct ecard_driver, drv)
287
288#define ecard_set_drvdata(ec,data) dev_set_drvdata(&(ec)->dev, (data))
289#define ecard_get_drvdata(ec) dev_get_drvdata(&(ec)->dev)
290
291int ecard_register_driver(struct ecard_driver *);
292void ecard_remove_driver(struct ecard_driver *);
293
294#endif
diff --git a/include/asm-arm26/elf.h b/include/asm-arm26/elf.h
new file mode 100644
index 000000000000..8b149474db24
--- /dev/null
+++ b/include/asm-arm26/elf.h
@@ -0,0 +1,77 @@
1#ifndef __ASMARM_ELF_H
2#define __ASMARM_ELF_H
3
4/*
5 * ELF register definitions..
6 */
7
8#include <asm/ptrace.h>
9#include <asm/procinfo.h>
10
11//FIXME - is it always 32K ?
12
13#define ELF_EXEC_PAGESIZE 32768
14#define SET_PERSONALITY(ex,ibcs2) set_personality(PER_LINUX)
15
16typedef unsigned long elf_greg_t;
17typedef unsigned long elf_freg_t[3];
18
19#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
20typedef elf_greg_t elf_gregset_t[ELF_NGREG];
21
22typedef struct { void *null; } elf_fpregset_t;
23
24/*
25 * This is used to ensure we don't load something for the wrong architecture.
26 * We can only execute 26-bit code.
27 */
28
29#define EM_ARM 40
30#define EF_ARM_APCS26 0x08
31
32//#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && ((x)->e_flags & EF_ARM_APCS26) ) FIXME!!!!! - this looks OK, but the flags seem to be wrong.
33#define elf_check_arch(x) (1)
34
35/*
36 * These are used to set parameters in the core dumps.
37 */
38#define ELF_CLASS ELFCLASS32
39#define ELF_DATA ELFDATA2LSB;
40#define ELF_ARCH EM_ARM
41
42#define USE_ELF_CORE_DUMP
43
44/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
45 use of this is to invoke "./ld.so someprog" to test out a new version of
46 the loader. We need to make sure that it is out of the way of the program
47 that it will "exec", and that there is sufficient room for the brk. */
48
49#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
50
51/* When the program starts, a1 contains a pointer to a function to be
52 registered with atexit, as per the SVR4 ABI. A value of 0 means we
53 have no such handler. */
54#define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
55
56/* This yields a mask that user programs can use to figure out what
57 instruction set this cpu supports. */
58
59extern unsigned int elf_hwcap;
60#define ELF_HWCAP (elf_hwcap)
61
62/* This yields a string that ld.so will use to load implementation
63 specific libraries for optimization. This is more specific in
64 intent than poking at uname or /proc/cpuinfo. */
65
66/* For now we just provide a fairly general string that describes the
67 processor family. This could be made more specific later if someone
68 implemented optimisations that require it. 26-bit CPUs give you
69 "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't
70 supported).
71 */
72
73#define ELF_PLATFORM_SIZE 8
74extern char elf_platform[];
75#define ELF_PLATFORM (elf_platform)
76
77#endif
diff --git a/include/asm-arm26/errno.h b/include/asm-arm26/errno.h
new file mode 100644
index 000000000000..6e60f0612bb6
--- /dev/null
+++ b/include/asm-arm26/errno.h
@@ -0,0 +1,6 @@
1#ifndef _ARM_ERRNO_H
2#define _ARM_ERRNO_H
3
4#include <asm-generic/errno.h>
5
6#endif
diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h
new file mode 100644
index 000000000000..485b6bdf4d7a
--- /dev/null
+++ b/include/asm-arm26/fcntl.h
@@ -0,0 +1,87 @@
1#ifndef _ARM_FCNTL_H
2#define _ARM_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif
diff --git a/include/asm-arm26/fiq.h b/include/asm-arm26/fiq.h
new file mode 100644
index 000000000000..a3bad09e825c
--- /dev/null
+++ b/include/asm-arm26/fiq.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/fiq.h
3 *
4 * Support for FIQ on ARM architectures.
5 * Written by Philip Blundell <philb@gnu.org>, 1998
6 * Re-written by Russell King
7 */
8
9#ifndef __ASM_FIQ_H
10#define __ASM_FIQ_H
11
12#include <asm/ptrace.h>
13
14struct fiq_handler {
15 struct fiq_handler *next;
16 /* Name
17 */
18 const char *name;
19 /* Called to ask driver to relinquish/
20 * reacquire FIQ
21 * return zero to accept, or -<errno>
22 */
23 int (*fiq_op)(void *, int relinquish);
24 /* data for the relinquish/reacquire functions
25 */
26 void *dev_id;
27};
28
29extern int claim_fiq(struct fiq_handler *f);
30extern void release_fiq(struct fiq_handler *f);
31extern void set_fiq_handler(void *start, unsigned int length);
32extern void set_fiq_regs(struct pt_regs *regs);
33extern void get_fiq_regs(struct pt_regs *regs);
34extern void enable_fiq(int fiq);
35extern void disable_fiq(int fiq);
36
37#endif
diff --git a/include/asm-arm26/floppy.h b/include/asm-arm26/floppy.h
new file mode 100644
index 000000000000..9e090ad7e477
--- /dev/null
+++ b/include/asm-arm26/floppy.h
@@ -0,0 +1,141 @@
1/*
2 * linux/include/asm-arm/floppy.h
3 *
4 * Copyright (C) 1996-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
11 */
12#ifndef __ASM_ARM_FLOPPY_H
13#define __ASM_ARM_FLOPPY_H
14
15#define fd_outb(val,port) \
16 do { \
17 if ((port) == FD_DOR) \
18 fd_setdor((val)); \
19 else \
20 outb((val),(port)); \
21 } while(0)
22
23#define fd_inb(port) inb((port))
24#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
25 SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL)
26#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
27#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
28#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
29
30#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
31#define fd_free_dma() free_dma(DMA_FLOPPY)
32#define fd_disable_dma() disable_dma(DMA_FLOPPY)
33#define fd_enable_dma() enable_dma(DMA_FLOPPY)
34#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
35#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
36#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
37#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
38#define fd_cacheflush(addr,sz)
39
40/* need to clean up dma.h */
41#define DMA_FLOPPYDISK DMA_FLOPPY
42
43/* Floppy_selects is the list of DOR's to select drive fd
44 *
45 * On initialisation, the floppy list is scanned, and the drives allocated
46 * in the order that they are found. This is done by seeking the drive
47 * to a non-zero track, and then restoring it to track 0. If an error occurs,
48 * then there is no floppy drive present. [to be put back in again]
49 */
50static unsigned char floppy_selects[2][4] =
51{
52 { 0x10, 0x21, 0x23, 0x33 },
53 { 0x10, 0x21, 0x23, 0x33 }
54};
55
56#define fd_setdor(dor) \
57do { \
58 int new_dor = (dor); \
59 if (new_dor & 0xf0) \
60 new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \
61 else \
62 new_dor &= 0x0c; \
63 outb(new_dor, FD_DOR); \
64} while (0)
65
66/*
67 * Someday, we'll automatically detect which drives are present...
68 */
69static inline void fd_scandrives (void)
70{
71#if 0
72 int floppy, drive_count;
73
74 fd_disable_irq();
75 raw_cmd = &default_raw_cmd;
76 raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
77 raw_cmd->track = 0;
78 raw_cmd->rate = ?;
79 drive_count = 0;
80 for (floppy = 0; floppy < 4; floppy ++) {
81 current_drive = drive_count;
82 /*
83 * Turn on floppy motor
84 */
85 if (start_motor(redo_fd_request))
86 continue;
87 /*
88 * Set up FDC
89 */
90 fdc_specify();
91 /*
92 * Tell FDC to recalibrate
93 */
94 output_byte(FD_RECALIBRATE);
95 LAST_OUT(UNIT(floppy));
96 /* wait for command to complete */
97 if (!successful) {
98 int i;
99 for (i = drive_count; i < 3; i--)
100 floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
101 floppy_selects[fdc][3] = 0;
102 floppy -= 1;
103 } else
104 drive_count++;
105 }
106#else
107 floppy_selects[0][0] = 0x10;
108 floppy_selects[0][1] = 0x21;
109 floppy_selects[0][2] = 0x23;
110 floppy_selects[0][3] = 0x33;
111#endif
112}
113
114#define FDC1 (0x3f0)
115
116#define FLOPPY0_TYPE 4
117#define FLOPPY1_TYPE 4
118
119#define N_FDC 1
120#define N_DRIVE 4
121
122#define FLOPPY_MOTOR_MASK 0xf0
123
124#define CROSS_64KB(a,s) (0)
125
126/*
127 * This allows people to reverse the order of
128 * fd0 and fd1, in case their hardware is
129 * strangely connected (as some RiscPCs
130 * and A5000s seem to be).
131 */
132static void driveswap(int *ints, int dummy, int dummy2)
133{
134 floppy_selects[0][0] ^= floppy_selects[0][1];
135 floppy_selects[0][1] ^= floppy_selects[0][0];
136 floppy_selects[0][0] ^= floppy_selects[0][1];
137}
138
139#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
140
141#endif
diff --git a/include/asm-arm26/fpstate.h b/include/asm-arm26/fpstate.h
new file mode 100644
index 000000000000..785749b3c5ab
--- /dev/null
+++ b/include/asm-arm26/fpstate.h
@@ -0,0 +1,29 @@
1/*
2 * linux/include/asm-arm/fpstate.h
3 *
4 * Copyright (C) 1995 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARM_FPSTATE_H
12#define __ASM_ARM_FPSTATE_H
13
14#define FP_SIZE 35
15
16struct fp_hard_struct {
17 unsigned int save[FP_SIZE]; /* as yet undefined */
18};
19
20struct fp_soft_struct {
21 unsigned int save[FP_SIZE]; /* undefined information */
22};
23
24union fp_state {
25 struct fp_hard_struct hard;
26 struct fp_soft_struct soft;
27};
28
29#endif
diff --git a/include/asm-arm26/hardirq.h b/include/asm-arm26/hardirq.h
new file mode 100644
index 000000000000..791ee1da9bfa
--- /dev/null
+++ b/include/asm-arm26/hardirq.h
@@ -0,0 +1,41 @@
1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H
3
4#include <linux/config.h>
5#include <linux/cache.h>
6#include <linux/threads.h>
7
8typedef 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#define HARDIRQ_BITS 8
15
16/*
17 * The hardirq mask has to be large enough to have space
18 * for potentially all IRQ sources in the system nesting
19 * on a single CPU:
20 */
21#if (1 << HARDIRQ_BITS) < NR_IRQS
22# error HARDIRQ_BITS is too low!
23#endif
24
25#define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
26
27#ifndef CONFIG_SMP
28
29extern asmlinkage void __do_softirq(void);
30
31#define irq_exit() \
32 do { \
33 preempt_count() -= IRQ_EXIT_OFFSET; \
34 if (!in_interrupt() && local_softirq_pending()) \
35 __do_softirq(); \
36 preempt_enable_no_resched(); \
37 } while (0)
38#endif
39
40
41#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-arm26/hardware.h b/include/asm-arm26/hardware.h
new file mode 100644
index 000000000000..82fc55e2a009
--- /dev/null
+++ b/include/asm-arm26/hardware.h
@@ -0,0 +1,110 @@
1/*
2 * linux/include/asm-arm/arch-arc/hardware.h
3 *
4 * Copyright (C) 1996-1999 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This file contains the hardware definitions of the
11 * Acorn Archimedes/A5000 machines.
12 *
13 * Modifications:
14 * 04-04-1998 PJB/RMK Merged arc and a5k versions
15 */
16#ifndef __ASM_HARDWARE_H
17#define __ASM_HARDWARE_H
18
19#include <linux/config.h>
20
21
22/*
23 * What hardware must be present - these can be tested by the kernel
24 * source.
25 */
26#define HAS_IOC
27#define HAS_MEMC
28#define HAS_VIDC
29
30#define VDMA_ALIGNMENT PAGE_SIZE
31#define VDMA_XFERSIZE 16
32#define VDMA_INIT 0
33#define VDMA_START 1
34#define VDMA_END 2
35
36#ifndef __ASSEMBLY__
37extern void memc_write(unsigned int reg, unsigned long val);
38
39#define video_set_dma(start,end,offset) \
40do { \
41 memc_write (VDMA_START, (start >> 2)); \
42 memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
43 memc_write (VDMA_INIT, (offset >> 2)); \
44} while (0)
45#endif
46
47
48/* Hardware addresses of major areas.
49 * *_START is the physical address
50 * *_SIZE is the size of the region
51 * *_BASE is the virtual address
52 */
53#define IO_START 0x03000000
54#define IO_SIZE 0x01000000
55#define IO_BASE 0x03000000
56
57/*
58 * Screen mapping information
59 */
60#define SCREEN_START 0x02000000
61#define SCREEN_END 0x02078000
62#define SCREEN_SIZE 0x00078000
63#define SCREEN_BASE 0x02000000
64
65
66#define EXPMASK_BASE 0x03360000
67#define IOEB_BASE 0x03350000
68#define VIDC_BASE 0x03400000
69#define LATCHA_BASE 0x03250040
70#define LATCHB_BASE 0x03250018
71#define IOC_BASE 0x03200000
72#define FLOPPYDMA_BASE 0x0302a000
73#define PCIO_BASE 0x03010000
74
75// FIXME - are the below correct?
76#define PODSLOT_IOC0_BASE 0x03240000
77#define PODSLOT_IOC_SIZE (1 << 14)
78#define PODSLOT_MEMC_BASE 0x03000000
79#define PODSLOT_MEMC_SIZE (1 << 14)
80
81#define vidc_writel(val) __raw_writel(val, VIDC_BASE)
82
83#ifndef __ASSEMBLY__
84
85/*
86 * for use with inb/outb
87 */
88#define IOEB_VID_CTL (IOEB_BASE + 0x48)
89#define IOEB_PRESENT (IOEB_BASE + 0x50)
90#define IOEB_PSCLR (IOEB_BASE + 0x58)
91#define IOEB_MONTYPE (IOEB_BASE + 0x70)
92
93//FIXME - These adresses are weird - ISTR some weirdo address shifting stuff was going on here...
94#define IO_EC_IOC_BASE 0x80090000
95#define IO_EC_MEMC_BASE 0x80000000
96
97#ifdef CONFIG_ARCH_ARC
98/* A680 hardware */
99#define WD1973_BASE 0x03290000
100#define WD1973_LATCH 0x03350000
101#define Z8530_BASE 0x032b0008
102#define SCSI_BASE 0x03100000
103#endif
104
105#endif
106
107#define EXPMASK_STATUS (EXPMASK_BASE + 0x00)
108#define EXPMASK_ENABLE (EXPMASK_BASE + 0x04)
109
110#endif
diff --git a/include/asm-arm26/hdreg.h b/include/asm-arm26/hdreg.h
new file mode 100644
index 000000000000..7f7fd1af0af3
--- /dev/null
+++ b/include/asm-arm26/hdreg.h
@@ -0,0 +1 @@
#include <asm-generic/hdreg.h>
diff --git a/include/asm-arm26/ide.h b/include/asm-arm26/ide.h
new file mode 100644
index 000000000000..db804d751df9
--- /dev/null
+++ b/include/asm-arm26/ide.h
@@ -0,0 +1,34 @@
1/*
2 * linux/include/asm-arm/ide.h
3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 */
6
7/*
8 * This file contains the i386 architecture specific IDE code.
9 */
10
11#ifndef __ASMARM_IDE_H
12#define __ASMARM_IDE_H
13
14#ifdef __KERNEL__
15
16#ifndef MAX_HWIFS
17#define MAX_HWIFS 4
18#endif
19
20#include <asm/irq.h>
21#include <asm/mach-types.h>
22
23/* JMA 18.05.03 these will never be needed, but the kernel needs them to compile */
24#define __ide_mm_insw(port,addr,len) readsw(port,addr,len)
25#define __ide_mm_insl(port,addr,len) readsl(port,addr,len)
26#define __ide_mm_outsw(port,addr,len) writesw(port,addr,len)
27#define __ide_mm_outsl(port,addr,len) writesl(port,addr,len)
28
29#define IDE_ARCH_OBSOLETE_INIT
30#define ide_default_io_ctl(base) (0)
31
32#endif /* __KERNEL__ */
33
34#endif /* __ASMARM_IDE_H */
diff --git a/include/asm-arm26/io.h b/include/asm-arm26/io.h
new file mode 100644
index 000000000000..02f94d88a124
--- /dev/null
+++ b/include/asm-arm26/io.h
@@ -0,0 +1,435 @@
1/*
2 * linux/include/asm-arm/io.h
3 *
4 * Copyright (C) 1996-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Modifications:
11 * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
12 * constant addresses and variable addresses.
13 * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
14 * specific IO header files.
15 * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
16 * 04-Apr-1999 PJB Added check_signature.
17 * 12-Dec-1999 RMK More cleanups
18 * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
19 */
20#ifndef __ASM_ARM_IO_H
21#define __ASM_ARM_IO_H
22
23#ifdef __KERNEL__
24
25#include <linux/config.h>
26#include <linux/types.h>
27#include <asm/byteorder.h>
28#include <asm/memory.h>
29#include <asm/hardware.h>
30
31/*
32 * Generic IO read/write. These perform native-endian accesses. Note
33 * that some architectures will want to re-define __raw_{read,write}w.
34 */
35extern void __raw_writesb(unsigned int addr, const void *data, int bytelen);
36extern void __raw_writesw(unsigned int addr, const void *data, int wordlen);
37extern void __raw_writesl(unsigned int addr, const void *data, int longlen);
38
39extern void __raw_readsb(unsigned int addr, void *data, int bytelen);
40extern void __raw_readsw(unsigned int addr, void *data, int wordlen);
41extern void __raw_readsl(unsigned int addr, void *data, int longlen);
42
43#define __raw_writeb(v,a) (*(volatile unsigned char *)(a) = (v))
44#define __raw_writew(v,a) (*(volatile unsigned short *)(a) = (v))
45#define __raw_writel(v,a) (*(volatile unsigned int *)(a) = (v))
46
47#define __raw_readb(a) (*(volatile unsigned char *)(a))
48#define __raw_readw(a) (*(volatile unsigned short *)(a))
49#define __raw_readl(a) (*(volatile unsigned int *)(a))
50
51
52/*
53 * Bad read/write accesses...
54 */
55extern void __readwrite_bug(const char *fn);
56
57/*
58 * Now, pick up the machine-defined IO definitions
59 */
60
61#define IO_SPACE_LIMIT 0xffffffff
62
63/*
64 * GCC is totally crap at loading/storing data. We try to persuade it
65 * to do the right thing by using these whereever possible instead of
66 * the above.
67 */
68#define __arch_base_getb(b,o) \
69 ({ \
70 unsigned int v, r = (b); \
71 __asm__ __volatile__( \
72 "ldrb %0, [%1, %2]" \
73 : "=r" (v) \
74 : "r" (r), "Ir" (o)); \
75 v; \
76 })
77
78#define __arch_base_getl(b,o) \
79 ({ \
80 unsigned int v, r = (b); \
81 __asm__ __volatile__( \
82 "ldr %0, [%1, %2]" \
83 : "=r" (v) \
84 : "r" (r), "Ir" (o)); \
85 v; \
86 })
87
88#define __arch_base_putb(v,b,o) \
89 ({ \
90 unsigned int r = (b); \
91 __asm__ __volatile__( \
92 "strb %0, [%1, %2]" \
93 : \
94 : "r" (v), "r" (r), "Ir" (o)); \
95 })
96
97#define __arch_base_putl(v,b,o) \
98 ({ \
99 unsigned int r = (b); \
100 __asm__ __volatile__( \
101 "str %0, [%1, %2]" \
102 : \
103 : "r" (v), "r" (r), "Ir" (o)); \
104 })
105
106/*
107 * We use two different types of addressing - PC style addresses, and ARM
108 * addresses. PC style accesses the PC hardware with the normal PC IO
109 * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
110 * and are translated to the start of IO. Note that all addresses are
111 * shifted left!
112 */
113#define __PORT_PCIO(x) (!((x) & 0x80000000))
114
115/*
116 * Dynamic IO functions - let the compiler
117 * optimize the expressions
118 */
119static inline void __outb (unsigned int value, unsigned int port)
120{
121 unsigned long temp;
122 __asm__ __volatile__(
123 "tst %2, #0x80000000\n\t"
124 "mov %0, %4\n\t"
125 "addeq %0, %0, %3\n\t"
126 "strb %1, [%0, %2, lsl #2] @ outb"
127 : "=&r" (temp)
128 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
129 : "cc");
130}
131
132static inline void __outw (unsigned int value, unsigned int port)
133{
134 unsigned long temp;
135 __asm__ __volatile__(
136 "tst %2, #0x80000000\n\t"
137 "mov %0, %4\n\t"
138 "addeq %0, %0, %3\n\t"
139 "str %1, [%0, %2, lsl #2] @ outw"
140 : "=&r" (temp)
141 : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
142 : "cc");
143}
144
145static inline void __outl (unsigned int value, unsigned int port)
146{
147 unsigned long temp;
148 __asm__ __volatile__(
149 "tst %2, #0x80000000\n\t"
150 "mov %0, %4\n\t"
151 "addeq %0, %0, %3\n\t"
152 "str %1, [%0, %2, lsl #2] @ outl"
153 : "=&r" (temp)
154 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
155 : "cc");
156}
157
158#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
159static inline unsigned sz __in##fnsuffix (unsigned int port) \
160{ \
161 unsigned long temp, value; \
162 __asm__ __volatile__( \
163 "tst %2, #0x80000000\n\t" \
164 "mov %0, %4\n\t" \
165 "addeq %0, %0, %3\n\t" \
166 "ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \
167 : "=&r" (temp), "=r" (value) \
168 : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
169 : "cc"); \
170 return (unsigned sz)value; \
171}
172
173static inline unsigned int __ioaddr (unsigned int port) \
174{ \
175 if (__PORT_PCIO(port)) \
176 return (unsigned int)(PCIO_BASE + (port << 2)); \
177 else \
178 return (unsigned int)(IO_BASE + (port << 2)); \
179}
180
181#define DECLARE_IO(sz,fnsuffix,instr) \
182 DECLARE_DYN_IN(sz,fnsuffix,instr)
183
184DECLARE_IO(char,b,"b")
185DECLARE_IO(short,w,"")
186DECLARE_IO(int,l,"")
187
188#undef DECLARE_IO
189#undef DECLARE_DYN_IN
190
191/*
192 * Constant address IO functions
193 *
194 * These have to be macros for the 'J' constraint to work -
195 * +/-4096 immediate operand.
196 */
197#define __outbc(value,port) \
198({ \
199 if (__PORT_PCIO((port))) \
200 __asm__ __volatile__( \
201 "strb %0, [%1, %2] @ outbc" \
202 : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
203 else \
204 __asm__ __volatile__( \
205 "strb %0, [%1, %2] @ outbc" \
206 : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
207})
208
209#define __inbc(port) \
210({ \
211 unsigned char result; \
212 if (__PORT_PCIO((port))) \
213 __asm__ __volatile__( \
214 "ldrb %0, [%1, %2] @ inbc" \
215 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
216 else \
217 __asm__ __volatile__( \
218 "ldrb %0, [%1, %2] @ inbc" \
219 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
220 result; \
221})
222
223#define __outwc(value,port) \
224({ \
225 unsigned long v = value; \
226 if (__PORT_PCIO((port))) \
227 __asm__ __volatile__( \
228 "str %0, [%1, %2] @ outwc" \
229 : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
230 else \
231 __asm__ __volatile__( \
232 "str %0, [%1, %2] @ outwc" \
233 : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
234})
235
236#define __inwc(port) \
237({ \
238 unsigned short result; \
239 if (__PORT_PCIO((port))) \
240 __asm__ __volatile__( \
241 "ldr %0, [%1, %2] @ inwc" \
242 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
243 else \
244 __asm__ __volatile__( \
245 "ldr %0, [%1, %2] @ inwc" \
246 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
247 result & 0xffff; \
248})
249
250#define __outlc(value,port) \
251({ \
252 unsigned long v = value; \
253 if (__PORT_PCIO((port))) \
254 __asm__ __volatile__( \
255 "str %0, [%1, %2] @ outlc" \
256 : : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
257 else \
258 __asm__ __volatile__( \
259 "str %0, [%1, %2] @ outlc" \
260 : : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
261})
262
263#define __inlc(port) \
264({ \
265 unsigned long result; \
266 if (__PORT_PCIO((port))) \
267 __asm__ __volatile__( \
268 "ldr %0, [%1, %2] @ inlc" \
269 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
270 else \
271 __asm__ __volatile__( \
272 "ldr %0, [%1, %2] @ inlc" \
273 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
274 result; \
275})
276
277#define __ioaddrc(port) \
278({ \
279 unsigned long addr; \
280 if (__PORT_PCIO((port))) \
281 addr = PCIO_BASE + ((port) << 2); \
282 else \
283 addr = IO_BASE + ((port) << 2); \
284 addr; \
285})
286
287#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
288#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
289#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
290#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
291#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
292#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
293#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
294
295/* JMA 18.02.03 added sb,sl from arm/io.h, changing io to ioaddr */
296
297#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
298#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
299#define outsl(p,d,l) __raw_writesl(__ioaddr(p),d,l)
300
301#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
302#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
303#define insl(p,d,l) __raw_readsl(__ioaddr(p),d,l)
304
305#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
306#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
307
308#define readb(c) (__readwrite_bug("readb"),0)
309#define readw(c) (__readwrite_bug("readw"),0)
310#define readl(c) (__readwrite_bug("readl"),0)
311#define readb_relaxed(addr) readb(addr)
312#define readw_relaxed(addr) readw(addr)
313#define readl_relaxed(addr) readl(addr)
314#define writeb(v,c) __readwrite_bug("writeb")
315#define writew(v,c) __readwrite_bug("writew")
316#define writel(v,c) __readwrite_bug("writel")
317
318#define readsw(p,d,l) (__readwrite_bug("readsw"),0)
319#define readsl(p,d,l) (__readwrite_bug("readsl"),0)
320#define writesw(p,d,l) __readwrite_bug("writesw")
321#define writesl(p,d,l) __readwrite_bug("writesl")
322
323#define mmiowb()
324
325/* the following macro is depreciated */
326#define ioaddr(port) __ioaddr((port))
327
328/*
329 * No ioremap support here.
330 */
331#define __arch_ioremap(c,s,f,a) ((void *)(c))
332#define __arch_iounmap(c) do { } while (0)
333
334
335#if defined(__arch_putb) || defined(__arch_putw) || defined(__arch_putl) || \
336 defined(__arch_getb) || defined(__arch_getw) || defined(__arch_getl)
337#warning machine class uses old __arch_putw or __arch_getw
338#endif
339
340/*
341 * IO port access primitives
342 * -------------------------
343 *
344 * The ARM doesn't have special IO access instructions; all IO is memory
345 * mapped. Note that these are defined to perform little endian accesses
346 * only. Their primary purpose is to access PCI and ISA peripherals.
347 *
348 * Note that for a big endian machine, this implies that the following
349 * big endian mode connectivity is in place, as described by numerious
350 * ARM documents:
351 *
352 * PCI: D0-D7 D8-D15 D16-D23 D24-D31
353 * ARM: D24-D31 D16-D23 D8-D15 D0-D7
354 *
355 * The machine specific io.h include defines __io to translate an "IO"
356 * address to a memory address.
357 *
358 * Note that we prevent GCC re-ordering or caching values in expressions
359 * by introducing sequence points into the in*() definitions. Note that
360 * __raw_* do not guarantee this behaviour.
361 */
362/*
363#define outsb(p,d,l) __raw_writesb(__io(p),d,l)
364#define outsw(p,d,l) __raw_writesw(__io(p),d,l)
365
366#define insb(p,d,l) __raw_readsb(__io(p),d,l)
367#define insw(p,d,l) __raw_readsw(__io(p),d,l)
368*/
369#define outb_p(val,port) outb((val),(port))
370#define outw_p(val,port) outw((val),(port))
371#define inb_p(port) inb((port))
372#define inw_p(port) inw((port))
373#define inl_p(port) inl((port))
374
375#define outsb_p(port,from,len) outsb(port,from,len)
376#define outsw_p(port,from,len) outsw(port,from,len)
377#define insb_p(port,to,len) insb(port,to,len)
378#define insw_p(port,to,len) insw(port,to,len)
379
380/*
381 * String version of IO memory access ops:
382 */
383extern void _memcpy_fromio(void *, unsigned long, size_t);
384extern void _memcpy_toio(unsigned long, const void *, size_t);
385extern void _memset_io(unsigned long, int, size_t);
386
387/*
388 * ioremap and friends.
389 *
390 * ioremap takes a PCI memory address, as specified in
391 * Documentation/IO-mapping.txt.
392 */
393extern void * __ioremap(unsigned long, size_t, unsigned long, unsigned long);
394extern void __iounmap(void *addr);
395
396#ifndef __arch_ioremap
397#define ioremap(cookie,size) __ioremap(cookie,size,0,1)
398#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0,1)
399#define iounmap(cookie) __iounmap(cookie)
400#else
401#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0,1)
402#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0,1)
403#define iounmap(cookie) __arch_iounmap(cookie)
404#endif
405
406/*
407 * DMA-consistent mapping functions. These allocate/free a region of
408 * uncached, unwrite-buffered mapped memory space for use with DMA
409 * devices. This is the "generic" version. The PCI specific version
410 * is in pci.h
411 */
412extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
413extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
414extern void consistent_sync(void *vaddr, size_t size, int rw);
415
416/*
417 * can the hardware map this into one segment or not, given no other
418 * constraints.
419 */
420#define BIOVEC_MERGEABLE(vec1, vec2) \
421 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
422
423/*
424 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
425 * access
426 */
427#define xlate_dev_mem_ptr(p) __va(p)
428
429/*
430 * Convert a virtual cached pointer to an uncached pointer
431 */
432#define xlate_dev_kmem_ptr(p) p
433
434#endif /* __KERNEL__ */
435#endif /* __ASM_ARM_IO_H */
diff --git a/include/asm-arm26/ioc.h b/include/asm-arm26/ioc.h
new file mode 100644
index 000000000000..b3b46ef65943
--- /dev/null
+++ b/include/asm-arm26/ioc.h
@@ -0,0 +1,72 @@
1/*
2 * linux/include/asm-arm/hardware/ioc.h
3 *
4 * Copyright (C) Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Use these macros to read/write the IOC. All it does is perform the actual
11 * read/write.
12 */
13#ifndef __ASMARM_HARDWARE_IOC_H
14#define __ASMARM_HARDWARE_IOC_H
15
16#ifndef __ASSEMBLY__
17
18/*
19 * We use __raw_base variants here so that we give the compiler the
20 * chance to keep IOC_BASE in a register.
21 */
22#define ioc_readb(off) __raw_readb(IOC_BASE + (off))
23#define ioc_writeb(val,off) __raw_writeb(val, IOC_BASE + (off))
24
25#endif
26
27#define IOC_CONTROL (0x00)
28#define IOC_KARTTX (0x04)
29#define IOC_KARTRX (0x04)
30
31#define IOC_IRQSTATA (0x10)
32#define IOC_IRQREQA (0x14)
33#define IOC_IRQCLRA (0x14)
34#define IOC_IRQMASKA (0x18)
35
36#define IOC_IRQSTATB (0x20)
37#define IOC_IRQREQB (0x24)
38#define IOC_IRQMASKB (0x28)
39
40#define IOC_FIQSTAT (0x30)
41#define IOC_FIQREQ (0x34)
42#define IOC_FIQMASK (0x38)
43
44#define IOC_T0CNTL (0x40)
45#define IOC_T0LTCHL (0x40)
46#define IOC_T0CNTH (0x44)
47#define IOC_T0LTCHH (0x44)
48#define IOC_T0GO (0x48)
49#define IOC_T0LATCH (0x4c)
50
51#define IOC_T1CNTL (0x50)
52#define IOC_T1LTCHL (0x50)
53#define IOC_T1CNTH (0x54)
54#define IOC_T1LTCHH (0x54)
55#define IOC_T1GO (0x58)
56#define IOC_T1LATCH (0x5c)
57
58#define IOC_T2CNTL (0x60)
59#define IOC_T2LTCHL (0x60)
60#define IOC_T2CNTH (0x64)
61#define IOC_T2LTCHH (0x64)
62#define IOC_T2GO (0x68)
63#define IOC_T2LATCH (0x6c)
64
65#define IOC_T3CNTL (0x70)
66#define IOC_T3LTCHL (0x70)
67#define IOC_T3CNTH (0x74)
68#define IOC_T3LTCHH (0x74)
69#define IOC_T3GO (0x78)
70#define IOC_T3LATCH (0x7c)
71
72#endif
diff --git a/include/asm-arm26/ioctl.h b/include/asm-arm26/ioctl.h
new file mode 100644
index 000000000000..2cbb7d0e9dc6
--- /dev/null
+++ b/include/asm-arm26/ioctl.h
@@ -0,0 +1,74 @@
1/*
2 * linux/ioctl.h for Linux by H.H. Bergman.
3 */
4
5#ifndef _ASMARM_IOCTL_H
6#define _ASMARM_IOCTL_H
7
8/* ioctl command encoding: 32 bits total, command in lower 16 bits,
9 * size of the parameter structure in the lower 14 bits of the
10 * upper 16 bits.
11 * Encoding the size of the parameter structure in the ioctl request
12 * is useful for catching programs compiled with old versions
13 * and to avoid overwriting user space outside the user buffer area.
14 * The highest 2 bits are reserved for indicating the ``access mode''.
15 * NOTE: This limits the max parameter size to 16kB -1 !
16 */
17
18/*
19 * The following is for compatibility across the various Linux
20 * platforms. The i386 ioctl numbering scheme doesn't really enforce
21 * a type field. De facto, however, the top 8 bits of the lower 16
22 * bits are indeed used as a type field, so we might just as well make
23 * this explicit here. Please be sure to use the decoding macros
24 * below from now on.
25 */
26#define _IOC_NRBITS 8
27#define _IOC_TYPEBITS 8
28#define _IOC_SIZEBITS 14
29#define _IOC_DIRBITS 2
30
31#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
32#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
33#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
34#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
35
36#define _IOC_NRSHIFT 0
37#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
38#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
39#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
40
41/*
42 * Direction bits.
43 */
44#define _IOC_NONE 0U
45#define _IOC_WRITE 1U
46#define _IOC_READ 2U
47
48#define _IOC(dir,type,nr,size) \
49 (((dir) << _IOC_DIRSHIFT) | \
50 ((type) << _IOC_TYPESHIFT) | \
51 ((nr) << _IOC_NRSHIFT) | \
52 ((size) << _IOC_SIZESHIFT))
53
54/* used to create numbers */
55#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
56#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
57#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
58#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
59
60/* used to decode ioctl numbers.. */
61#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
62#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
63#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
64#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
65
66/* ...and for the drivers/sound files... */
67
68#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
69#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
70#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
71#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
72#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
73
74#endif /* _ASMARM_IOCTL_H */
diff --git a/include/asm-arm26/ioctls.h b/include/asm-arm26/ioctls.h
new file mode 100644
index 000000000000..ba9c7d81d24e
--- /dev/null
+++ b/include/asm-arm26/ioctls.h
@@ -0,0 +1,81 @@
1#ifndef __ASM_ARM_IOCTLS_H
2#define __ASM_ARM_IOCTLS_H
3
4#include <asm/ioctl.h>
5
6/* 0x54 is just a magic number to make these relatively unique ('T') */
7
8#define TCGETS 0x5401
9#define TCSETS 0x5402
10#define TCSETSW 0x5403
11#define TCSETSF 0x5404
12#define TCGETA 0x5405
13#define TCSETA 0x5406
14#define TCSETAW 0x5407
15#define TCSETAF 0x5408
16#define TCSBRK 0x5409
17#define TCXONC 0x540A
18#define TCFLSH 0x540B
19#define TIOCEXCL 0x540C
20#define TIOCNXCL 0x540D
21#define TIOCSCTTY 0x540E
22#define TIOCGPGRP 0x540F
23#define TIOCSPGRP 0x5410
24#define TIOCOUTQ 0x5411
25#define TIOCSTI 0x5412
26#define TIOCGWINSZ 0x5413
27#define TIOCSWINSZ 0x5414
28#define TIOCMGET 0x5415
29#define TIOCMBIS 0x5416
30#define TIOCMBIC 0x5417
31#define TIOCMSET 0x5418
32#define TIOCGSOFTCAR 0x5419
33#define TIOCSSOFTCAR 0x541A
34#define FIONREAD 0x541B
35#define TIOCINQ FIONREAD
36#define TIOCLINUX 0x541C
37#define TIOCCONS 0x541D
38#define TIOCGSERIAL 0x541E
39#define TIOCSSERIAL 0x541F
40#define TIOCPKT 0x5420
41#define FIONBIO 0x5421
42#define TIOCNOTTY 0x5422
43#define TIOCSETD 0x5423
44#define TIOCGETD 0x5424
45#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
46#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52
53#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
54#define FIOCLEX 0x5451
55#define FIOASYNC 0x5452
56#define TIOCSERCONFIG 0x5453
57#define TIOCSERGWILD 0x5454
58#define TIOCSERSWILD 0x5455
59#define TIOCGLCKTRMIOS 0x5456
60#define TIOCSLCKTRMIOS 0x5457
61#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
62#define TIOCSERGETLSR 0x5459 /* Get line status register */
63#define TIOCSERGETMULTI 0x545A /* Get multiport config */
64#define TIOCSERSETMULTI 0x545B /* Set multiport config */
65
66#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
67#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
68#define FIOQSIZE 0x545E
69
70/* Used for packet mode */
71#define TIOCPKT_DATA 0
72#define TIOCPKT_FLUSHREAD 1
73#define TIOCPKT_FLUSHWRITE 2
74#define TIOCPKT_STOP 4
75#define TIOCPKT_START 8
76#define TIOCPKT_NOSTOP 16
77#define TIOCPKT_DOSTOP 32
78
79#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
80
81#endif
diff --git a/include/asm-arm26/ipc.h b/include/asm-arm26/ipc.h
new file mode 100644
index 000000000000..a46e3d9c2a3f
--- /dev/null
+++ b/include/asm-arm26/ipc.h
@@ -0,0 +1 @@
#include <asm-generic/ipc.h>
diff --git a/include/asm-arm26/ipcbuf.h b/include/asm-arm26/ipcbuf.h
new file mode 100644
index 000000000000..97683975f7df
--- /dev/null
+++ b/include/asm-arm26/ipcbuf.h
@@ -0,0 +1,29 @@
1#ifndef __ASMARM_IPCBUF_H
2#define __ASMARM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __ASMARM_IPCBUF_H */
diff --git a/include/asm-arm26/irq.h b/include/asm-arm26/irq.h
new file mode 100644
index 000000000000..06bd5a543d13
--- /dev/null
+++ b/include/asm-arm26/irq.h
@@ -0,0 +1,52 @@
1#ifndef __ASM_ARM_IRQ_H
2#define __ASM_ARM_IRQ_H
3
4#include <asm/sysirq.h>
5
6#ifndef NR_IRQS
7#define NR_IRQS 128
8#endif
9
10
11/* JMA 18.05.02 Copied off arch/arm/irq.h */
12#ifndef irq_canonicalize
13#define irq_canonicalize(i) (i)
14#endif
15
16
17/*
18 * Use this value to indicate lack of interrupt
19 * capability
20 */
21#ifndef NO_IRQ
22#define NO_IRQ ((unsigned int)(-1))
23#endif
24
25struct irqaction;
26
27#define disable_irq_nosync(i) disable_irq(i)
28
29extern void disable_irq(unsigned int);
30extern void enable_irq(unsigned int);
31
32#define __IRQT_FALEDGE (1 << 0)
33#define __IRQT_RISEDGE (1 << 1)
34#define __IRQT_LOWLVL (1 << 2)
35#define __IRQT_HIGHLVL (1 << 3)
36
37#define IRQT_NOEDGE (0)
38#define IRQT_RISING (__IRQT_RISEDGE)
39#define IRQT_FALLING (__IRQT_FALEDGE)
40#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
41#define IRQT_LOW (__IRQT_LOWLVL)
42#define IRQT_HIGH (__IRQT_HIGHLVL)
43#define IRQT_PROBE (1 << 4)
44
45int set_irq_type(unsigned int irq, unsigned int type);
46
47int setup_irq(unsigned int, struct irqaction *);
48struct pt_regs;
49int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
50
51#endif
52
diff --git a/include/asm-arm26/irqchip.h b/include/asm-arm26/irqchip.h
new file mode 100644
index 000000000000..6a007a954098
--- /dev/null
+++ b/include/asm-arm26/irqchip.h
@@ -0,0 +1,101 @@
1/*
2 * linux/include/asm-arm/mach/irq.h
3 *
4 * Copyright (C) 1995-2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARM_MACH_IRQ_H
11#define __ASM_ARM_MACH_IRQ_H
12
13struct irqdesc;
14struct pt_regs;
15struct seq_file;
16
17typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
18typedef void (*irq_control_t)(unsigned int);
19
20struct irqchip {
21 /*
22 * Acknowledge the IRQ.
23 * If this is a level-based IRQ, then it is expected to mask the IRQ
24 * as well.
25 */
26 void (*ack)(unsigned int);
27 /*
28 * Mask the IRQ in hardware.
29 */
30 void (*mask)(unsigned int);
31 /*
32 * Unmask the IRQ in hardware.
33 */
34 void (*unmask)(unsigned int);
35 /*
36 * Re-run the IRQ
37 */
38 void (*rerun)(unsigned int);
39 /*
40 * Set the type of the IRQ.
41 */
42 int (*type)(unsigned int, unsigned int);
43};
44
45struct irqdesc {
46 irq_handler_t handle;
47 struct irqchip *chip;
48 struct irqaction *action;
49
50 unsigned int enabled : 1; /* IRQ is currently enabled */
51 unsigned int triggered: 1; /* IRQ has occurred */
52 unsigned int running : 1; /* IRQ is running */
53 unsigned int pending : 1; /* IRQ is pending */
54 unsigned int probing : 1; /* IRQ in use for a probe */
55 unsigned int probe_ok : 1; /* IRQ can be used for probe */
56 unsigned int valid : 1; /* IRQ claimable */
57 unsigned int noautoenable : 1; /* don't automatically enable IRQ */
58 unsigned int unused :23;
59 unsigned int depth; /* disable depth */
60
61 /*
62 * IRQ lock detection
63 */
64 unsigned int lck_cnt;
65 unsigned int lck_pc;
66 unsigned int lck_jif;
67};
68
69extern struct irqdesc irq_desc[];
70
71/*
72 * This is internal. Do not use it.
73 */
74extern void (*init_arch_irq)(void);
75extern void init_FIQ(void);
76extern int show_fiq_list(struct seq_file *, void *);
77void __set_irq_handler(unsigned int irq, irq_handler_t, int);
78
79/*
80 * External stuff.
81 */
82#define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0)
83#define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1)
84
85void set_irq_chip(unsigned int irq, struct irqchip *);
86void set_irq_flags(unsigned int irq, unsigned int flags);
87
88#define IRQF_VALID (1 << 0)
89#define IRQF_PROBE (1 << 1)
90#define IRQF_NOAUTOEN (1 << 2)
91
92/*
93 * Built-in IRQ handlers.
94 */
95void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
96void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
97void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
98void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
99void dummy_mask_unmask_irq(unsigned int irq);
100
101#endif
diff --git a/include/asm-arm26/kmap_types.h b/include/asm-arm26/kmap_types.h
new file mode 100644
index 000000000000..d5da712b723c
--- /dev/null
+++ b/include/asm-arm26/kmap_types.h
@@ -0,0 +1,12 @@
1#ifndef __ARM_KMAP_TYPES_H
2#define __ARM_KMAP_TYPES_H
3
4/*
5 * This is the "bare minimum". AIO seems to require this.
6 */
7enum km_type {
8 KM_IRQ0,
9 KM_USER1
10};
11
12#endif
diff --git a/include/asm-arm26/leds.h b/include/asm-arm26/leds.h
new file mode 100644
index 000000000000..88ce4124f854
--- /dev/null
+++ b/include/asm-arm26/leds.h
@@ -0,0 +1,51 @@
1/*
2 * linux/include/asm-arm/leds.h
3 *
4 * Copyright (C) 1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Event-driven interface for LEDs on machines
11 * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
12 */
13#ifndef ASM_ARM_LEDS_H
14#define ASM_ARM_LEDS_H
15
16#include <linux/config.h>
17
18typedef enum {
19 led_idle_start,
20 led_idle_end,
21 led_timer,
22 led_start,
23 led_stop,
24 led_claim, /* override idle & timer leds */
25 led_release, /* restore idle & timer leds */
26 led_start_timer_mode,
27 led_stop_timer_mode,
28 led_green_on,
29 led_green_off,
30 led_amber_on,
31 led_amber_off,
32 led_red_on,
33 led_red_off,
34 led_blue_on,
35 led_blue_off,
36 /*
37 * I want this between led_timer and led_start, but
38 * someone has decided to export this to user space
39 */
40 led_halted
41} led_event_t;
42
43/* Use this routine to handle LEDs */
44
45#ifdef CONFIG_LEDS
46extern void (*leds_event)(led_event_t);
47#else
48#define leds_event(e)
49#endif
50
51#endif
diff --git a/include/asm-arm26/limits.h b/include/asm-arm26/limits.h
new file mode 100644
index 000000000000..08d8c6600804
--- /dev/null
+++ b/include/asm-arm26/limits.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_PIPE_H
2#define __ASM_PIPE_H
3
4#ifndef PAGE_SIZE
5#include <asm/page.h>
6#endif
7
8#define PIPE_BUF PAGE_SIZE
9
10#endif
11
diff --git a/include/asm-arm26/linkage.h b/include/asm-arm26/linkage.h
new file mode 100644
index 000000000000..dbe4b4e31a5b
--- /dev/null
+++ b/include/asm-arm26/linkage.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_LINKAGE_H
2#define __ASM_LINKAGE_H
3
4#define __ALIGN .align 0
5#define __ALIGN_STR ".align 0"
6
7#endif
diff --git a/include/asm-arm26/local.h b/include/asm-arm26/local.h
new file mode 100644
index 000000000000..6759e9183cef
--- /dev/null
+++ b/include/asm-arm26/local.h
@@ -0,0 +1,2 @@
1//FIXME - nicked from arm32 - check it is correct...
2#include <asm-generic/local.h>
diff --git a/include/asm-arm26/locks.h b/include/asm-arm26/locks.h
new file mode 100644
index 000000000000..81b3bda2ed00
--- /dev/null
+++ b/include/asm-arm26/locks.h
@@ -0,0 +1,161 @@
1/*
2 * linux/include/asm-arm/proc-armo/locks.h
3 *
4 * Copyright (C) 2000 Russell King
5 * Fixes for 26 bit machines, (C) 2000 Dave Gilbert
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Interrupt safe locking assembler.
12 */
13#ifndef __ASM_PROC_LOCKS_H
14#define __ASM_PROC_LOCKS_H
15
16/* Decrements by 1, fails if value < 0 */
17#define __down_op(ptr,fail) \
18 ({ \
19 __asm__ __volatile__ ( \
20 "@ atomic down operation\n" \
21" mov ip, pc\n" \
22" orr lr, ip, #0x08000000\n" \
23" teqp lr, #0\n" \
24" ldr lr, [%0]\n" \
25" and ip, ip, #0x0c000003\n" \
26" subs lr, lr, #1\n" \
27" str lr, [%0]\n" \
28" orrmi ip, ip, #0x80000000 @ set N\n" \
29" teqp ip, #0\n" \
30" movmi ip, %0\n" \
31" blmi " #fail \
32 : \
33 : "r" (ptr) \
34 : "ip", "lr", "cc"); \
35 })
36
37#define __down_op_ret(ptr,fail) \
38 ({ \
39 unsigned int result; \
40 __asm__ __volatile__ ( \
41" @ down_op_ret\n" \
42" mov ip, pc\n" \
43" orr lr, ip, #0x08000000\n" \
44" teqp lr, #0\n" \
45" ldr lr, [%1]\n" \
46" and ip, ip, #0x0c000003\n" \
47" subs lr, lr, #1\n" \
48" str lr, [%1]\n" \
49" orrmi ip, ip, #0x80000000 @ set N\n" \
50" teqp ip, #0\n" \
51" movmi ip, %1\n" \
52" movpl ip, #0\n" \
53" blmi " #fail "\n" \
54" mov %0, ip" \
55 : "=&r" (result) \
56 : "r" (ptr) \
57 : "ip", "lr", "cc"); \
58 result; \
59 })
60
61#define __up_op(ptr,wake) \
62 ({ \
63 __asm__ __volatile__ ( \
64 "@ up_op\n" \
65" mov ip, pc\n" \
66" orr lr, ip, #0x08000000\n" \
67" teqp lr, #0\n" \
68" ldr lr, [%0]\n" \
69" and ip, ip, #0x0c000003\n" \
70" adds lr, lr, #1\n" \
71" str lr, [%0]\n" \
72" orrle ip, ip, #0x80000000 @ set N - should this be mi ??? DAG ! \n" \
73" teqp ip, #0\n" \
74" movmi ip, %0\n" \
75" blmi " #wake \
76 : \
77 : "r" (ptr) \
78 : "ip", "lr", "cc"); \
79 })
80
81/*
82 * The value 0x01000000 supports up to 128 processors and
83 * lots of processes. BIAS must be chosen such that sub'ing
84 * BIAS once per CPU will result in the long remaining
85 * negative.
86 */
87#define RW_LOCK_BIAS 0x01000000
88#define RW_LOCK_BIAS_STR "0x01000000"
89
90/* Decrements by RW_LOCK_BIAS rather than 1, fails if value != 0 */
91#define __down_op_write(ptr,fail) \
92 ({ \
93 __asm__ __volatile__( \
94 "@ down_op_write\n" \
95" mov ip, pc\n" \
96" orr lr, ip, #0x08000000\n" \
97" teqp lr, #0\n" \
98" and ip, ip, #0x0c000003\n" \
99\
100" ldr lr, [%0]\n" \
101" subs lr, lr, %1\n" \
102" str lr, [%0]\n" \
103\
104" orreq ip, ip, #0x40000000 @ set Z \n"\
105" teqp ip, #0\n" \
106" movne ip, %0\n" \
107" blne " #fail \
108 : \
109 : "r" (ptr), "I" (RW_LOCK_BIAS) \
110 : "ip", "lr", "cc"); \
111 })
112
113/* Increments by RW_LOCK_BIAS, wakes if value >= 0 */
114#define __up_op_write(ptr,wake) \
115 ({ \
116 __asm__ __volatile__( \
117 "@ up_op_read\n" \
118" mov ip, pc\n" \
119" orr lr, ip, #0x08000000\n" \
120" teqp lr, #0\n" \
121\
122" ldr lr, [%0]\n" \
123" and ip, ip, #0x0c000003\n" \
124" adds lr, lr, %1\n" \
125" str lr, [%0]\n" \
126\
127" orrcs ip, ip, #0x20000000 @ set C\n" \
128" teqp ip, #0\n" \
129" movcs ip, %0\n" \
130" blcs " #wake \
131 : \
132 : "r" (ptr), "I" (RW_LOCK_BIAS) \
133 : "ip", "lr", "cc"); \
134 })
135
136#define __down_op_read(ptr,fail) \
137 __down_op(ptr, fail)
138
139#define __up_op_read(ptr,wake) \
140 ({ \
141 __asm__ __volatile__( \
142 "@ up_op_read\n" \
143" mov ip, pc\n" \
144" orr lr, ip, #0x08000000\n" \
145" teqp lr, #0\n" \
146\
147" ldr lr, [%0]\n" \
148" and ip, ip, #0x0c000003\n" \
149" adds lr, lr, %1\n" \
150" str lr, [%0]\n" \
151\
152" orreq ip, ip, #0x40000000 @ Set Z \n" \
153" teqp ip, #0\n" \
154" moveq ip, %0\n" \
155" bleq " #wake \
156 : \
157 : "r" (ptr), "I" (1) \
158 : "ip", "lr", "cc"); \
159 })
160
161#endif
diff --git a/include/asm-arm26/mach-types.h b/include/asm-arm26/mach-types.h
new file mode 100644
index 000000000000..b34045b78128
--- /dev/null
+++ b/include/asm-arm26/mach-types.h
@@ -0,0 +1,37 @@
1/*
2 * Unlike ARM32 this is NOT automatically generated. DONT delete it
3 * Instead, consider FIXME-ing it so its auto-detected.
4 */
5
6#ifndef __ASM_ARM_MACH_TYPE_H
7#define __ASM_ARM_MACH_TYPE_H
8
9#include <linux/config.h>
10
11#ifndef __ASSEMBLY__
12extern unsigned int __machine_arch_type;
13#endif
14
15#define MACH_TYPE_ARCHIMEDES 10
16#define MACH_TYPE_A5K 11
17
18#ifdef CONFIG_ARCH_ARC
19# define machine_arch_type MACH_TYPE_ARCHIMEDES
20# define machine_is_archimedes() (machine_arch_type == MACH_TYPE_ARCHIMEDES)
21#else
22# define machine_is_archimedes() (0)
23#endif
24
25#ifdef CONFIG_ARCH_A5K
26# define machine_arch_type MACH_TYPE_A5K
27# define machine_is_a5k() (machine_arch_type == MACH_TYPE_A5K)
28#else
29# define machine_is_a5k() (0)
30#endif
31
32#ifndef machine_arch_type
33#error Unknown machine type
34#define machine_arch_type __machine_arch_type
35#endif
36
37#endif
diff --git a/include/asm-arm26/map.h b/include/asm-arm26/map.h
new file mode 100644
index 000000000000..6e12a7fa5c5d
--- /dev/null
+++ b/include/asm-arm26/map.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/map.h
3 *
4 * Copyright (C) 1999-2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Page table mapping constructs and function prototypes
11 */
12struct map_desc {
13 unsigned long virtual;
14 unsigned long physical;
15 unsigned long length;
16 unsigned int type;
17};
18
19struct meminfo;
20
21extern void create_memmap_holes(struct meminfo *);
22extern void memtable_init(struct meminfo *);
23extern void iotable_init(struct map_desc *);
24extern void setup_io_desc(void);
diff --git a/include/asm-arm26/mc146818rtc.h b/include/asm-arm26/mc146818rtc.h
new file mode 100644
index 000000000000..a234130db8f1
--- /dev/null
+++ b/include/asm-arm26/mc146818rtc.h
@@ -0,0 +1,28 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifndef _ASM_MC146818RTC_H
5#define _ASM_MC146818RTC_H
6
7#include <asm/irq.h>
8#include <asm/io.h>
9
10#ifndef RTC_PORT
11#define RTC_PORT(x) (0x70 + (x))
12#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
13#endif
14
15/*
16 * The yet supported machines all access the RTC index register via
17 * an ISA port access but the way to access the date register differs ...
18 */
19#define CMOS_READ(addr) ({ \
20outb_p((addr),RTC_PORT(0)); \
21inb_p(RTC_PORT(1)); \
22})
23#define CMOS_WRITE(val, addr) ({ \
24outb_p((addr),RTC_PORT(0)); \
25outb_p((val),RTC_PORT(1)); \
26})
27
28#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-arm26/memory.h b/include/asm-arm26/memory.h
new file mode 100644
index 000000000000..20d78616f650
--- /dev/null
+++ b/include/asm-arm26/memory.h
@@ -0,0 +1,101 @@
1/*
2 * linux/include/asm-arm26/memory.h
3 *
4 * Copyright (C) 2000-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Note: this file should not be included by non-asm/.h files
11 */
12#ifndef __ASM_ARM_MEMORY_H
13#define __ASM_ARM_MEMORY_H
14
15/*
16 * User space: 26MB
17 */
18#define TASK_SIZE (0x01a00000UL)
19
20/*
21 * This decides where the kernel will search for a free chunk of vm
22 * space during mmap's.
23 */
24#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
25
26/*
27 * Page offset: 32MB
28 */
29#define PAGE_OFFSET (0x02000000UL)
30#define PHYS_OFFSET (0x02000000UL)
31
32#define PHYS_TO_NID(addr) (0)
33
34/*
35 * PFNs are used to describe any physical page; this means
36 * PFN 0 == physical address 0.
37 *
38 * This is the PFN of the first RAM page in the kernel
39 * direct-mapped view. We assume this is the first page
40 * of RAM in the mem_map as well.
41 */
42#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
43
44/*
45 * These are *only* valid on the kernel direct mapped RAM memory.
46 */
47static inline unsigned long virt_to_phys(void *x)
48{
49 return (unsigned long)x;
50}
51
52static inline void *phys_to_virt(unsigned long x)
53{
54 return (void *)((unsigned long)x);
55}
56
57#define __pa(x) (unsigned long)(x)
58#define __va(x) ((void *)(unsigned long)(x))
59
60/*
61 * Virtual <-> DMA view memory address translations
62 * Again, these are *only* valid on the kernel direct mapped RAM
63 * memory. Use of these is *depreciated*.
64 */
65#define virt_to_bus(x) ((unsigned long)(x))
66#define bus_to_virt(x) ((void *)((unsigned long)(x)))
67
68/*
69 * Conversion between a struct page and a physical address.
70 *
71 * Note: when converting an unknown physical address to a
72 * struct page, the resulting pointer must be validated
73 * using VALID_PAGE(). It must return an invalid struct page
74 * for any physical address not corresponding to a system
75 * RAM address.
76 *
77 * page_to_pfn(page) convert a struct page * to a PFN number
78 * pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
79 * pfn_valid(pfn) indicates whether a PFN number is valid
80 *
81 * virt_to_page(k) convert a _valid_ virtual address to struct page *
82 * virt_addr_valid(k) indicates whether a virtual address is valid
83 */
84#define page_to_pfn(page) (((page) - mem_map) + PHYS_PFN_OFFSET)
85#define pfn_to_page(pfn) ((mem_map + (pfn)) - PHYS_PFN_OFFSET)
86#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
87
88#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
89#define virt_addr_valid(kaddr) ((int)(kaddr) >= PAGE_OFFSET && (int)(kaddr) < (unsigned long)high_memory)
90
91/*
92 * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
93 */
94#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
95
96/*
97 * We should really eliminate virt_to_bus() here - it's depreciated.
98 */
99#define page_to_bus(page) (page_address(page))
100
101#endif
diff --git a/include/asm-arm26/mman.h b/include/asm-arm26/mman.h
new file mode 100644
index 000000000000..cc27b8240265
--- /dev/null
+++ b/include/asm-arm26/mman.h
@@ -0,0 +1,43 @@
1#ifndef __ARM_MMAN_H__
2#define __ARM_MMAN_H__
3
4#define PROT_READ 0x1 /* page can be read */
5#define PROT_WRITE 0x2 /* page can be written */
6#define PROT_EXEC 0x4 /* page can be executed */
7#define PROT_SEM 0x8 /* page may be used for atomic ops */
8#define PROT_NONE 0x0 /* page can not be accessed */
9#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
10#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
11
12#define MAP_SHARED 0x01 /* Share changes */
13#define MAP_PRIVATE 0x02 /* Changes are private */
14#define MAP_TYPE 0x0f /* Mask for type of mapping */
15#define MAP_FIXED 0x10 /* Interpret addr exactly */
16#define MAP_ANONYMOUS 0x20 /* don't use a file */
17
18#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
19#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
20#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
21#define MAP_LOCKED 0x2000 /* pages are locked */
22#define MAP_NORESERVE 0x4000 /* don't check for reservations */
23#define MAP_POPULATE 0x8000 /* populate (prefault) page tables */
24#define MAP_NONBLOCK 0x10000 /* do not block on IO */
25
26#define MS_ASYNC 1 /* sync memory asynchronously */
27#define MS_INVALIDATE 2 /* invalidate the caches */
28#define MS_SYNC 4 /* synchronous memory sync */
29
30#define MCL_CURRENT 1 /* lock all current mappings */
31#define MCL_FUTURE 2 /* lock all future mappings */
32
33#define MADV_NORMAL 0x0 /* default page-in behavior */
34#define MADV_RANDOM 0x1 /* page-in minimum required */
35#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */
38
39/* compatibility flags */
40#define MAP_ANON MAP_ANONYMOUS
41#define MAP_FILE 0
42
43#endif /* __ARM_MMAN_H__ */
diff --git a/include/asm-arm26/mmu.h b/include/asm-arm26/mmu.h
new file mode 100644
index 000000000000..9b8d3d781a1e
--- /dev/null
+++ b/include/asm-arm26/mmu.h
@@ -0,0 +1,9 @@
1#ifndef __ARM_MMU_H
2#define __ARM_MMU_H
3
4/*
5 * The ARM doesn't have a mmu context
6 */
7typedef struct { } mm_context_t;
8
9#endif
diff --git a/include/asm-arm26/mmu_context.h b/include/asm-arm26/mmu_context.h
new file mode 100644
index 000000000000..1a929bfe5c3a
--- /dev/null
+++ b/include/asm-arm26/mmu_context.h
@@ -0,0 +1,51 @@
1/*
2 * linux/include/asm-arm/mmu_context.h
3 *
4 * Copyright (C) 1996 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 27-06-1996 RMK Created
12 */
13#ifndef __ASM_ARM_MMU_CONTEXT_H
14#define __ASM_ARM_MMU_CONTEXT_H
15
16#define init_new_context(tsk,mm) 0
17#define destroy_context(mm) do { } while(0)
18
19/*
20 * This is called when "tsk" is about to enter lazy TLB mode.
21 *
22 * mm: describes the currently active mm context
23 * tsk: task which is entering lazy tlb
24 * cpu: cpu number which is entering lazy tlb
25 *
26 * tsk->mm will be NULL
27 */
28static inline void
29enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
30{
31}
32
33/*
34 * This is the actual mm switch as far as the scheduler
35 * is concerned. No registers are touched.
36 */
37static inline void
38switch_mm(struct mm_struct *prev, struct mm_struct *next,
39 struct task_struct *tsk)
40{
41 cpu_switch_mm(next->pgd, next);
42}
43
44#define deactivate_mm(tsk,mm) do { } while (0)
45
46static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
47{
48 cpu_switch_mm(next->pgd, next);
49}
50
51#endif
diff --git a/include/asm-arm26/module.h b/include/asm-arm26/module.h
new file mode 100644
index 000000000000..1157f178daec
--- /dev/null
+++ b/include/asm-arm26/module.h
@@ -0,0 +1,7 @@
1#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H
3/*
4 * This file contains the arm architecture specific module code.
5 */
6
7#endif /* _ASM_ARM_MODULE_H */
diff --git a/include/asm-arm26/msgbuf.h b/include/asm-arm26/msgbuf.h
new file mode 100644
index 000000000000..33b35b946eaa
--- /dev/null
+++ b/include/asm-arm26/msgbuf.h
@@ -0,0 +1,31 @@
1#ifndef _ASMARM_MSGBUF_H
2#define _ASMARM_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASMARM_MSGBUF_H */
diff --git a/include/asm-arm26/namei.h b/include/asm-arm26/namei.h
new file mode 100644
index 000000000000..a402d3b9d0f7
--- /dev/null
+++ b/include/asm-arm26/namei.h
@@ -0,0 +1,25 @@
1/*
2 * linux/include/asm-arm/namei.h
3 *
4 * Routines to handle famous /usr/gnemul
5 * Derived from the Sparc version of this file
6 *
7 * Included from linux/fs/namei.c
8 */
9
10#ifndef __ASMARM_NAMEI_H
11#define __ASMARM_NAMEI_H
12
13#define ARM_BSD_EMUL "usr/gnemul/bsd/"
14
15static inline char *__emul_prefix(void)
16{
17 switch (current->personality) {
18 case PER_BSD:
19 return ARM_BSD_EMUL;
20 default:
21 return NULL;
22 }
23}
24
25#endif /* __ASMARM_NAMEI_H */
diff --git a/include/asm-arm26/oldlatches.h b/include/asm-arm26/oldlatches.h
new file mode 100644
index 000000000000..bc87089b2152
--- /dev/null
+++ b/include/asm-arm26/oldlatches.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/arch-arc/oldlatches.h
3 *
4 * Copyright (C) 1996 Russell King, Dave Gilbert
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Modifications:
11 * 04-04-1998 PJB/RMK Merged arc and a5k versions
12 */
13#ifndef _ASM_ARCH_OLDLATCH_H
14#define _ASM_ARCH_OLDLATCH_H
15
16#define LATCHA_FDSEL0 (1<<0)
17#define LATCHA_FDSEL1 (1<<1)
18#define LATCHA_FDSEL2 (1<<2)
19#define LATCHA_FDSEL3 (1<<3)
20#define LATCHA_FDSELALL (0xf)
21#define LATCHA_SIDESEL (1<<4)
22#define LATCHA_MOTOR (1<<5)
23#define LATCHA_INUSE (1<<6)
24#define LATCHA_CHANGERST (1<<7)
25
26#define LATCHB_FDCDENSITY (1<<1)
27#define LATCHB_FDCRESET (1<<3)
28#define LATCHB_PRINTSTROBE (1<<4)
29
30/* newval=(oldval & mask)|newdata */
31void oldlatch_bupdate(unsigned char mask,unsigned char newdata);
32
33/* newval=(oldval & mask)|newdata */
34void oldlatch_aupdate(unsigned char mask,unsigned char newdata);
35
36#endif
37
diff --git a/include/asm-arm26/page.h b/include/asm-arm26/page.h
new file mode 100644
index 000000000000..c334079b082b
--- /dev/null
+++ b/include/asm-arm26/page.h
@@ -0,0 +1,115 @@
1#ifndef _ASMARM_PAGE_H
2#define _ASMARM_PAGE_H
3
4#include <linux/config.h>
5
6#ifdef __KERNEL__
7#ifndef __ASSEMBLY__
8
9extern void __clear_user_page(void *p, unsigned long user);
10extern void __copy_user_page(void *to, const void *from, unsigned long user);
11extern void copy_page(void *to, const void *from);
12
13//FIXME these may be wrong on ARM26
14#define clear_user_page(addr,vaddr,pg) \
15 do { \
16 preempt_disable(); \
17 __clear_user_page(addr, vaddr); \
18 preempt_enable(); \
19 } while (0)
20
21#define copy_user_page(to,from,vaddr,pg) \
22 do { \
23 preempt_disable(); \
24 __copy_user_page(to, from, vaddr); \
25 preempt_enable(); \
26 } while (0)
27
28#define clear_page(page) memzero((void *)(page), PAGE_SIZE)
29#define copy_page(to, from) __copy_user_page(to, from, 0);
30
31#undef STRICT_MM_TYPECHECKS
32
33#ifdef STRICT_MM_TYPECHECKS
34/*
35 * These are used to make use of C type-checking..
36 */
37typedef struct { unsigned long pgd; } pgd_t;
38typedef struct { unsigned long pte; } pte_t;
39typedef struct { unsigned long pmd; } pmd_t;
40typedef struct { unsigned long pgprot; } pgprot_t;
41
42#define pgd_val(x) ((x).pgd)
43#define pte_val(x) ((x).pte)
44#define pmd_val(x) ((x).pmd)
45#define pgprot_val(x) ((x).pgprot)
46
47#define __pte(x) ((pte_t) { (x) } )
48#define __pmd(x) ((pmd_t) { (x) } )
49#define __pgprot(x) ((pgprot_t) { (x) } )
50
51#else
52/*
53 * .. while these make it easier on the compiler
54 */
55typedef unsigned long pgd_t;
56typedef unsigned long pte_t;
57typedef unsigned long pmd_t;
58typedef unsigned long pgprot_t;
59
60//FIXME - should these cast to unsigned long?
61#define pgd_val(x) (x)
62#define pte_val(x) (x)
63#define pmd_val(x) (x)
64#define pgprot_val(x) (x)
65
66#define __pte(x) (x)
67#define __pmd(x) (x)
68#define __pgprot(x) (x)
69
70#endif /* STRICT_MM_TYPECHECKS */
71#endif /* !__ASSEMBLY__ */
72#endif /* __KERNEL__ */
73
74/* PAGE_SHIFT determines the page size. This is configurable. */
75#if defined(CONFIG_PAGESIZE_16)
76#define PAGE_SHIFT 14 /* 16K */
77#else /* default */
78#define PAGE_SHIFT 15 /* 32K */
79#endif
80
81#define EXEC_PAGESIZE 32768
82
83#define PAGE_SIZE (1UL << PAGE_SHIFT)
84#define PAGE_MASK (~(PAGE_SIZE-1))
85
86/* to align the pointer to the (next) page boundary */
87#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
88
89#ifdef __KERNEL__
90#ifndef __ASSEMBLY__
91
92/* Pure 2^n version of get_order */
93static inline int get_order(unsigned long size)
94{
95 int order;
96
97 size = (size-1) >> (PAGE_SHIFT-1);
98 order = -1;
99 do {
100 size >>= 1;
101 order++;
102 } while (size);
103 return order;
104}
105
106#include <asm/memory.h>
107
108#endif /* !__ASSEMBLY__ */
109
110#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
111 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
112
113#endif /* __KERNEL__ */
114
115#endif
diff --git a/include/asm-arm26/param.h b/include/asm-arm26/param.h
new file mode 100644
index 000000000000..6b1e52df542e
--- /dev/null
+++ b/include/asm-arm26/param.h
@@ -0,0 +1,33 @@
1/*
2 * linux/include/asm-arm/param.h
3 *
4 * Copyright (C) 1995-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_PARAM_H
11#define __ASM_PARAM_H
12
13#ifndef __KERNEL_HZ
14#define __KERNEL_HZ 100
15#endif
16
17#ifdef __KERNEL__
18# define HZ __KERNEL_HZ /* Internal kernel timer frequency */
19# define USER_HZ 100 /* User interfaces are in "ticks" */
20# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
21#else
22# define HZ 100
23#endif
24
25#ifndef NOGROUP
26#define NOGROUP (-1)
27#endif
28
29/* max length of hostname */
30#define MAXHOSTNAMELEN 64
31
32#endif
33
diff --git a/include/asm-arm26/parport.h b/include/asm-arm26/parport.h
new file mode 100644
index 000000000000..f2f90c76ddd1
--- /dev/null
+++ b/include/asm-arm26/parport.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/parport.h: ARM-specific parport initialisation
3 *
4 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
5 *
6 * This file should only be included by drivers/parport/parport_pc.c.
7 */
8
9#ifndef __ASMARM_PARPORT_H
10#define __ASMARM_PARPORT_H
11
12static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
13static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
14{
15 return parport_pc_find_isa_ports (autoirq, autodma);
16}
17
18#endif /* !(_ASMARM_PARPORT_H) */
diff --git a/include/asm-arm26/pci.h b/include/asm-arm26/pci.h
new file mode 100644
index 000000000000..6ac67ed7718c
--- /dev/null
+++ b/include/asm-arm26/pci.h
@@ -0,0 +1,6 @@
1/* Should not be needed. IDE stupidity */
2/* JMA 18.05.03 - is kinda needed, if only to tell it we don't have a PCI bus */
3
4#define PCI_DMA_BUS_IS_PHYS 0
5#define pcibios_scan_all_fns(a, b) 0
6
diff --git a/include/asm-arm26/percpu.h b/include/asm-arm26/percpu.h
new file mode 100644
index 000000000000..b4e32d8ec072
--- /dev/null
+++ b/include/asm-arm26/percpu.h
@@ -0,0 +1,6 @@
1#ifndef __ARM_PERCPU
2#define __ARM_PERCPU
3
4#include <asm-generic/percpu.h>
5
6#endif
diff --git a/include/asm-arm26/pgalloc.h b/include/asm-arm26/pgalloc.h
new file mode 100644
index 000000000000..6437167b1ffe
--- /dev/null
+++ b/include/asm-arm26/pgalloc.h
@@ -0,0 +1,70 @@
1/*
2 * linux/include/asm-arm/pgalloc.h
3 *
4 * Copyright (C) 2000-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef _ASMARM_PGALLOC_H
11#define _ASMARM_PGALLOC_H
12
13#include <asm/processor.h>
14#include <asm/cacheflush.h>
15#include <asm/tlbflush.h>
16#include <linux/slab.h>
17
18extern kmem_cache_t *pte_cache;
19
20static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr){
21 return kmem_cache_alloc(pte_cache, GFP_KERNEL);
22}
23
24static inline void pte_free_kernel(pte_t *pte){
25 if (pte)
26 kmem_cache_free(pte_cache, pte);
27}
28
29/*
30 * Populate the pmdp entry with a pointer to the pte. This pmd is part
31 * of the mm address space.
32 *
33 * If 'mm' is the init tasks mm, then we are doing a vmalloc, and we
34 * need to set stuff up correctly for it.
35 */
36static inline void
37pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
38{
39//FIXME - is this doing the right thing?
40 set_pmd(pmdp, (unsigned long)ptep | 1/*FIXME _PMD_PRESENT*/);
41}
42
43/*
44 * FIXME - We use the old 2.5.5-rmk1 hack for this.
45 * This is not truly correct, but should be functional.
46 */
47#define pte_alloc_one(mm,addr) ((struct page *)pte_alloc_one_kernel(mm,addr))
48#define pte_free(pte) pte_free_kernel((pte_t *)pte)
49#define pmd_populate(mm,pmdp,ptep) pmd_populate_kernel(mm,pmdp,(pte_t *)ptep)
50
51/*
52 * Since we have only two-level page tables, these are trivial
53 *
54 * trick __pmd_alloc into optimising away. The actual value is irrelevant though as it
55 * is thrown away. It just cant be zero. -IM
56 */
57
58#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); })
59#define pmd_free(pmd) do { } while (0)
60#define pgd_populate(mm,pmd,pte) BUG()
61
62extern pgd_t *get_pgd_slow(struct mm_struct *mm);
63extern void free_pgd_slow(pgd_t *pgd);
64
65#define pgd_alloc(mm) get_pgd_slow(mm)
66#define pgd_free(pgd) free_pgd_slow(pgd)
67
68#define check_pgt_cache() do { } while (0)
69
70#endif
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
new file mode 100644
index 000000000000..af0b8907dc14
--- /dev/null
+++ b/include/asm-arm26/pgtable.h
@@ -0,0 +1,305 @@
1/*
2 * linux/include/asm-arm26/pgtable.h
3 *
4 * Copyright (C) 2000-2002 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _ASMARM_PGTABLE_H
12#define _ASMARM_PGTABLE_H
13
14#include <asm-generic/4level-fixup.h>
15
16#include <linux/config.h>
17#include <asm/memory.h>
18
19/*
20 * The table below defines the page protection levels that we insert into our
21 * Linux page table version. These get translated into the best that the
22 * architecture can perform. Note that on most ARM hardware:
23 * 1) We cannot do execute protection
24 * 2) If we could do execute protection, then read is implied
25 * 3) write implies read permissions
26 */
27#define __P000 PAGE_NONE
28#define __P001 PAGE_READONLY
29#define __P010 PAGE_COPY
30#define __P011 PAGE_COPY
31#define __P100 PAGE_READONLY
32#define __P101 PAGE_READONLY
33#define __P110 PAGE_COPY
34#define __P111 PAGE_COPY
35
36#define __S000 PAGE_NONE
37#define __S001 PAGE_READONLY
38#define __S010 PAGE_SHARED
39#define __S011 PAGE_SHARED
40#define __S100 PAGE_READONLY
41#define __S101 PAGE_READONLY
42#define __S110 PAGE_SHARED
43#define __S111 PAGE_SHARED
44
45/*
46 * PMD_SHIFT determines the size of the area a second-level page table can map
47 * PGDIR_SHIFT determines what a third-level page table entry can map
48 */
49#define PGD_SHIFT 25
50#define PMD_SHIFT 20
51
52#define PGD_SIZE (1UL << PGD_SHIFT)
53#define PGD_MASK (~(PGD_SIZE-1))
54#define PMD_SIZE (1UL << PMD_SHIFT)
55#define PMD_MASK (~(PMD_SIZE-1))
56
57/* The kernel likes to use these names for the above (ick) */
58#define PGDIR_SIZE PGD_SIZE
59#define PGDIR_MASK PGD_MASK
60
61#define PTRS_PER_PGD 32
62#define PTRS_PER_PMD 1
63#define PTRS_PER_PTE 32
64
65#define FIRST_USER_PGD_NR 1
66#define USER_PTRS_PER_PGD ((TASK_SIZE/PGD_SIZE) - FIRST_USER_PGD_NR)
67
68// FIXME - WTF?
69#define LIBRARY_TEXT_START 0x0c000000
70
71
72
73#ifndef __ASSEMBLY__
74extern void __pte_error(const char *file, int line, unsigned long val);
75extern void __pmd_error(const char *file, int line, unsigned long val);
76extern void __pgd_error(const char *file, int line, unsigned long val);
77
78#define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))
79#define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd_val(pmd))
80#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd))
81
82/*
83 * ZERO_PAGE is a global shared page that is always zero: used
84 * for zero-mapped memory areas etc..
85 */
86extern struct page *empty_zero_page;
87#define ZERO_PAGE(vaddr) (empty_zero_page)
88
89#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
90#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
91#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
92#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT))
93#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
94#define page_pte_prot(page,prot) mk_pte(page, prot)
95#define page_pte(page) mk_pte(page, __pgprot(0))
96
97/*
98 * Terminology: PGD = Page Directory, PMD = Page Middle Directory,
99 * PTE = Page Table Entry
100 *
101 * on arm26 we have no 2nd level page table. we simulate this by removing the
102 * PMD.
103 *
104 * pgd_none is 0 to prevernt pmd_alloc() calling __pmd_alloc(). This causes it
105 * to return pmd_offset(pgd,addr) which is a pointer to the pgd (IOW, a no-op).
106 *
107 * however, to work this way, whilst we are allocating 32 pgds, containing 32
108 * PTEs, the actual work is done on the PMDs, thus:
109 *
110 * instead of mm->pgd->pmd->pte
111 * we have mm->pgdpmd->pte
112 *
113 * IOW, think of PGD operations and PMD ones as being the same thing, just
114 * that PGD stuff deals with the mm_struct side of things, wheras PMD stuff
115 * deals with the pte side of things.
116 *
117 * additionally, we store some bits in the PGD and PTE pointers:
118 * PGDs:
119 * o The lowest (1) bit of the PGD is to determine if it is present or swap.
120 * o The 2nd bit of the PGD is unused and must be zero.
121 * o The top 6 bits of the PGD must be zero.
122 * PTEs:
123 * o The lower 5 bits of a pte are flags. bit 1 is the 'present' flag. The
124 * others determine the pages attributes.
125 *
126 * the pgd_val, pmd_val, and pte_val macros seem to be private to our code.
127 * They get the RAW value of the PGD/PMD/PTE entry, including our flags
128 * encoded into the pointers.
129 *
130 * The pgd_offset, pmd_offset, and pte_offset macros are used by the kernel,
131 * so they shouldnt have our flags attached.
132 *
133 * If you understood that, feel free to explain it to me...
134 *
135 */
136
137#define _PMD_PRESENT (0x01)
138
139/* These definitions allow us to optimise out stuff like pmd_alloc() */
140#define pgd_none(pgd) (0)
141#define pgd_bad(pgd) (0)
142#define pgd_present(pgd) (1)
143#define pgd_clear(pgdp) do { } while (0)
144
145/* Whilst these handle our actual 'page directory' (the agglomeration of pgd and pmd)
146 */
147#define pmd_none(pmd) (!pmd_val(pmd))
148#define pmd_bad(pmd) ((pmd_val(pmd) & 0xfc000002))
149#define pmd_present(pmd) (pmd_val(pmd) & _PMD_PRESENT)
150#define set_pmd(pmd_ptr, pmd) ((*(pmd_ptr)) = (pmd))
151#define pmd_clear(pmdp) set_pmd(pmdp, __pmd(0))
152
153/* and these handle our pte tables */
154#define pte_none(pte) (!pte_val(pte))
155#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
156#define set_pte(pte_ptr, pte) ((*(pte_ptr)) = (pte))
157#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
158#define pte_clear(mm,addr,ptep) set_pte_at((mm),(addr),(ptep), __pte(0))
159
160/* macros to ease the getting of pointers to stuff... */
161#define pgd_offset(mm, addr) ((pgd_t *)(mm)->pgd + __pgd_index(addr))
162#define pmd_offset(pgd, addr) ((pmd_t *)(pgd))
163#define pte_offset(pmd, addr) ((pte_t *)pmd_page(*(pmd)) + __pte_index(addr))
164
165/* there is no __pmd_index as we dont use pmds */
166#define __pgd_index(addr) ((addr) >> PGD_SHIFT)
167#define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
168
169
170/* Keep the kernel happy */
171#define pgd_index(addr) __pgd_index(addr)
172#define pgd_offset_k(addr) (pgd_offset(&init_mm, addr))
173
174/*
175 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
176 * area for the same reason. ;) FIXME: surely 1 page not 4k ?
177 */
178#define VMALLOC_START 0x01a00000
179#define VMALLOC_END 0x01c00000
180
181/* Is pmd_page supposed to return a pointer to a page in some arches? ours seems to
182 * return a pointer to memory (no special alignment)
183 */
184#define pmd_page(pmd) ((struct page *)(pmd_val((pmd)) & ~_PMD_PRESENT))
185#define pmd_page_kernel(pmd) ((pte_t *)(pmd_val((pmd)) & ~_PMD_PRESENT))
186
187#define pte_offset_kernel(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
188
189#define pte_offset_map(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
190#define pte_offset_map_nested(dir,addr) (pmd_page_kernel(*(dir)) + __pte_index(addr))
191#define pte_unmap(pte) do { } while (0)
192#define pte_unmap_nested(pte) do { } while (0)
193
194
195#define _PAGE_PRESENT 0x01
196#define _PAGE_READONLY 0x02
197#define _PAGE_NOT_USER 0x04
198#define _PAGE_OLD 0x08
199#define _PAGE_CLEAN 0x10
200
201// an old page has never been read.
202// a clean page has never been written.
203
204/* -- present -- -- !dirty -- --- !write --- ---- !user --- */
205#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY | _PAGE_NOT_USER)
206#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_CLEAN )
207#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY )
208#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY )
209#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_NOT_USER)
210
211#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_OLD | _PAGE_CLEAN)
212
213/*
214 * The following only work if pte_present() is true.
215 * Undefined behaviour if not..
216 */
217#define pte_read(pte) (!(pte_val(pte) & _PAGE_NOT_USER))
218#define pte_write(pte) (!(pte_val(pte) & _PAGE_READONLY))
219#define pte_exec(pte) (!(pte_val(pte) & _PAGE_NOT_USER))
220#define pte_dirty(pte) (!(pte_val(pte) & _PAGE_CLEAN))
221#define pte_young(pte) (!(pte_val(pte) & _PAGE_OLD))
222//ONLY when !pte_present() I think. nicked from arm32 (FIXME!)
223#define pte_file(pte) (!(pte_val(pte) & _PAGE_OLD))
224
225#define PTE_BIT_FUNC(fn,op) \
226static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
227
228PTE_BIT_FUNC(wrprotect, |= _PAGE_READONLY);
229PTE_BIT_FUNC(mkwrite, &= ~_PAGE_READONLY);
230PTE_BIT_FUNC(exprotect, |= _PAGE_NOT_USER);
231PTE_BIT_FUNC(mkexec, &= ~_PAGE_NOT_USER);
232PTE_BIT_FUNC(mkclean, |= _PAGE_CLEAN);
233PTE_BIT_FUNC(mkdirty, &= ~_PAGE_CLEAN);
234PTE_BIT_FUNC(mkold, |= _PAGE_OLD);
235PTE_BIT_FUNC(mkyoung, &= ~_PAGE_OLD);
236
237/*
238 * We don't store cache state bits in the page table here. FIXME - or do we?
239 */
240#define pgprot_noncached(prot) (prot)
241#define pgprot_writecombine(prot) (prot) //FIXME - is a no-op?
242
243extern void pgtable_cache_init(void);
244
245//FIXME - nicked from arm32 and brutally hacked. probably wrong.
246#define pte_to_pgoff(x) (pte_val(x) >> 2)
247#define pgoff_to_pte(x) __pte(((x) << 2) & ~_PAGE_OLD)
248
249//FIXME - next line borrowed from arm32. is it right?
250#define PTE_FILE_MAX_BITS 30
251
252
253static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
254{
255 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
256 return pte;
257}
258
259extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
260
261/* Encode and decode a swap entry.
262 *
263 * We support up to 32GB of swap on 4k machines
264 */
265#define __swp_type(x) (((x).val >> 2) & 0x7f)
266#define __swp_offset(x) ((x).val >> 9)
267#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) })
268#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
269#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
270
271/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
272/* FIXME: this is not correct */
273#define kern_addr_valid(addr) (1)
274
275/*
276 * Conversion functions: convert a page and protection to a page entry,
277 * and a page entry and page directory to the page they refer to.
278 */
279static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
280{
281 pte_t pte;
282 pte_val(pte) = physpage | pgprot_val(pgprot);
283 return pte;
284}
285
286
287#include <asm-generic/pgtable.h>
288
289/*
290 * remap a physical address `phys' of size `size' with page protection `prot'
291 * into virtual address `from'
292 */
293#define io_remap_page_range(vma,from,phys,size,prot) \
294 remap_pfn_range(vma, from, (phys) >> PAGE_SHIFT, size, prot)
295
296#define io_remap_pfn_range(vma,from,pfn,size,prot) \
297 remap_pfn_range(vma, from, pfn, size, prot)
298
299#define MK_IOSPACE_PFN(space, pfn) (pfn)
300#define GET_IOSPACE(pfn) 0
301#define GET_PFN(pfn) (pfn)
302
303#endif /* !__ASSEMBLY__ */
304
305#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm26/poll.h b/include/asm-arm26/poll.h
new file mode 100644
index 000000000000..fdfdab064a65
--- /dev/null
+++ b/include/asm-arm26/poll.h
@@ -0,0 +1,25 @@
1#ifndef __ASMARM_POLL_H
2#define __ASMARM_POLL_H
3
4/* These are specified by iBCS2 */
5#define POLLIN 0x0001
6#define POLLPRI 0x0002
7#define POLLOUT 0x0004
8#define POLLERR 0x0008
9#define POLLHUP 0x0010
10#define POLLNVAL 0x0020
11
12/* The rest seem to be more-or-less nonstandard. Check them! */
13#define POLLRDNORM 0x0040
14#define POLLRDBAND 0x0080
15#define POLLWRNORM 0x0100
16#define POLLWRBAND 0x0200
17#define POLLMSG 0x0400
18
19struct pollfd {
20 int fd;
21 short events;
22 short revents;
23};
24
25#endif
diff --git a/include/asm-arm26/posix_types.h b/include/asm-arm26/posix_types.h
new file mode 100644
index 000000000000..b88344ad390c
--- /dev/null
+++ b/include/asm-arm26/posix_types.h
@@ -0,0 +1,80 @@
1/*
2 * linux/include/asm-arm/posix_types.h
3 *
4 * Copyright (C) 1996-1998 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 27-06-1996 RMK Created
12 */
13#ifndef __ARCH_ARM_POSIX_TYPES_H
14#define __ARCH_ARM_POSIX_TYPES_H
15
16/*
17 * This file is generally used by user-level software, so you need to
18 * be a little careful about namespace pollution etc. Also, we cannot
19 * assume GCC is being used.
20 */
21
22typedef unsigned long __kernel_ino_t;
23typedef unsigned short __kernel_mode_t;
24typedef unsigned short __kernel_nlink_t;
25typedef long __kernel_off_t;
26typedef int __kernel_pid_t;
27typedef unsigned short __kernel_ipc_pid_t;
28typedef unsigned short __kernel_uid_t;
29typedef unsigned short __kernel_gid_t;
30typedef unsigned int __kernel_size_t;
31typedef int __kernel_ssize_t;
32typedef int __kernel_ptrdiff_t;
33typedef long __kernel_time_t;
34typedef long __kernel_suseconds_t;
35typedef long __kernel_clock_t;
36typedef int __kernel_timer_t;
37typedef int __kernel_clockid_t;
38typedef int __kernel_daddr_t;
39typedef char * __kernel_caddr_t;
40typedef unsigned short __kernel_uid16_t;
41typedef unsigned short __kernel_gid16_t;
42typedef unsigned int __kernel_uid32_t;
43typedef unsigned int __kernel_gid32_t;
44
45typedef unsigned short __kernel_old_uid_t;
46typedef unsigned short __kernel_old_gid_t;
47
48#ifdef __GNUC__
49typedef long long __kernel_loff_t;
50#endif
51
52typedef struct {
53#if defined(__KERNEL__) || defined(__USE_ALL)
54 int val[2];
55#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
56 int __val[2];
57#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
58} __kernel_fsid_t;
59
60#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
61
62#undef __FD_SET
63#define __FD_SET(fd, fdsetp) \
64 (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
65
66#undef __FD_CLR
67#define __FD_CLR(fd, fdsetp) \
68 (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
69
70#undef __FD_ISSET
71#define __FD_ISSET(fd, fdsetp) \
72 ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
73
74#undef __FD_ZERO
75#define __FD_ZERO(fdsetp) \
76 (memset ((fdsetp), 0, sizeof (*(fd_set *)(fdsetp))))
77
78#endif
79
80#endif
diff --git a/include/asm-arm26/proc-fns.h b/include/asm-arm26/proc-fns.h
new file mode 100644
index 000000000000..a83100454055
--- /dev/null
+++ b/include/asm-arm26/proc-fns.h
@@ -0,0 +1,49 @@
1/*
2 * linux/include/asm-arm26/proc-fns.h
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASSEMBLY__
11
12#include <asm/page.h>
13
14/*
15 * Don't change this structure - ASM code
16 * relies on it.
17 */
18extern struct processor {
19 /* check for any bugs */
20 void (*_check_bugs)(void);
21 /* Set up any processor specifics */
22 void (*_proc_init)(void);
23 /* Disable any processor specifics */
24 void (*_proc_fin)(void);
25 /* set the MEMC hardware mappings */
26 void (*_set_pgd)(pgd_t *pgd);
27 /* XCHG */
28 unsigned long (*_xchg_1)(unsigned long x, volatile void *ptr);
29 unsigned long (*_xchg_4)(unsigned long x, volatile void *ptr);
30} processor;
31
32extern const struct processor arm2_processor_functions;
33extern const struct processor arm250_processor_functions;
34extern const struct processor arm3_processor_functions;
35
36#define cpu_check_bugs() processor._check_bugs()
37#define cpu_proc_init() processor._proc_init()
38#define cpu_proc_fin() processor._proc_fin()
39#define cpu_do_idle() do { } while (0)
40#define cpu_switch_mm(pgd,mm) processor._set_pgd(pgd)
41#define cpu_xchg_1(x,ptr) processor._xchg_1(x,ptr)
42#define cpu_xchg_4(x,ptr) processor._xchg_4(x,ptr)
43
44
45//FIXME - these shouldnt be in proc-fn.h
46extern void cpu_memc_update_all(pgd_t *pgd);
47extern void cpu_memc_update_entry(pgd_t *pgd, unsigned long phys_pte, unsigned long log_addr);
48
49#endif
diff --git a/include/asm-arm26/processor.h b/include/asm-arm26/processor.h
new file mode 100644
index 000000000000..1d2d5f7b467b
--- /dev/null
+++ b/include/asm-arm26/processor.h
@@ -0,0 +1,113 @@
1/*
2 * linux/include/asm-arm26/processor.h
3 *
4 * Copyright (C) 1995 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARM_PROCESSOR_H
13#define __ASM_ARM_PROCESSOR_H
14
15/*
16 * Default implementation of macro that returns current
17 * instruction pointer ("program counter").
18 */
19#define current_text_addr() ({ __label__ _l; _l: &&_l;})
20
21#ifdef __KERNEL__
22
23#include <asm/atomic.h>
24#include <asm/ptrace.h>
25#include <linux/string.h>
26
27#define KERNEL_STACK_SIZE 4096
28
29typedef struct {
30 void (*put_byte)(void); /* Special calling convention */
31 void (*get_byte)(void); /* Special calling convention */
32 void (*put_half)(void); /* Special calling convention */
33 void (*get_half)(void); /* Special calling convention */
34 void (*put_word)(void); /* Special calling convention */
35 void (*get_word)(void); /* Special calling convention */
36 void (*put_dword)(void); /* Special calling convention */
37 unsigned long (*copy_from_user)(void *to, const void *from, unsigned long sz);
38 unsigned long (*copy_to_user)(void *to, const void *from, unsigned long sz);
39 unsigned long (*clear_user)(void *addr, unsigned long sz);
40 unsigned long (*strncpy_from_user)(char *to, const char *from, unsigned long sz);
41 unsigned long (*strnlen_user)(const char *s, long n);
42} uaccess_t;
43
44extern uaccess_t uaccess_user, uaccess_kernel;
45
46#define EXTRA_THREAD_STRUCT \
47 uaccess_t *uaccess; /* User access functions*/
48
49#define EXTRA_THREAD_STRUCT_INIT \
50 .uaccess = &uaccess_kernel,
51
52// FIXME?!!
53
54#define start_thread(regs,pc,sp) \
55({ \
56 unsigned long *stack = (unsigned long *)sp; \
57 set_fs(USER_DS); \
58 memzero(regs->uregs, sizeof (regs->uregs)); \
59 regs->ARM_pc = pc | ~0xfc000003; /* pc */ \
60 regs->ARM_sp = sp; /* sp */ \
61 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
62 regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
63 regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
64})
65
66#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1020])
67#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1018])
68
69struct debug_entry {
70 u32 address;
71 u32 insn;
72};
73
74struct debug_info {
75 int nsaved;
76 struct debug_entry bp[2];
77};
78
79struct thread_struct {
80 /* fault info */
81 unsigned long address;
82 unsigned long trap_no;
83 unsigned long error_code;
84 /* debugging */
85 struct debug_info debug;
86 EXTRA_THREAD_STRUCT
87};
88
89#define INIT_THREAD { \
90EXTRA_THREAD_STRUCT_INIT \
91}
92
93/* Forward declaration, a strange C thing */
94struct task_struct;
95
96/* Free all resources held by a thread. */
97extern void release_thread(struct task_struct *);
98
99unsigned long get_wchan(struct task_struct *p);
100
101#define cpu_relax() barrier()
102
103/* Prepare to copy thread state - unlazy all lazy status */
104#define prepare_to_copy(tsk) do { } while (0)
105
106/*
107 * Create a new kernel thread
108 */
109extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
110
111#endif
112
113#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/include/asm-arm26/procinfo.h b/include/asm-arm26/procinfo.h
new file mode 100644
index 000000000000..b28624db69ff
--- /dev/null
+++ b/include/asm-arm26/procinfo.h
@@ -0,0 +1,56 @@
1/*
2 * linux/include/asm-arm/procinfo.h
3 *
4 * Copyright (C) 1996-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_PROCINFO_H
11#define __ASM_PROCINFO_H
12
13#ifndef __ASSEMBLY__
14
15//struct processor;
16//struct cpu_user_fns;
17
18struct proc_info_item {
19 const char *manufacturer;
20 const char *cpu_name;
21};
22
23/*
24 * Note! struct processor is always defined if we're
25 * using MULTI_CPU, otherwise this entry is unused,
26 * but still exists.
27 *
28 * NOTE! The following structure is defined by assembly
29 * language, NOT C code. For more information, check:
30 * arch/arm/mm/proc-*.S and arch/arm/kernel/head-armv.S
31 */
32struct proc_info_list {
33 unsigned int cpu_val;
34 unsigned int cpu_mask;
35 const char *arch_name;
36 const char *elf_name;
37 unsigned int elf_hwcap;
38 struct proc_info_item *info;
39 struct processor *proc;
40};
41
42#endif /* __ASSEMBLY__ */
43
44#define PROC_INFO_SZ 48
45
46#define HWCAP_SWP 1
47#define HWCAP_HALF 2
48#define HWCAP_THUMB 4
49#define HWCAP_26BIT 8 /* Play it safe */
50#define HWCAP_FAST_MULT 16
51#define HWCAP_FPA 32
52#define HWCAP_VFP 64
53#define HWCAP_EDSP 128
54#define HWCAP_JAVA 256
55
56#endif
diff --git a/include/asm-arm26/ptrace.h b/include/asm-arm26/ptrace.h
new file mode 100644
index 000000000000..6a46b5ae1156
--- /dev/null
+++ b/include/asm-arm26/ptrace.h
@@ -0,0 +1,104 @@
1#ifndef __ASM_ARM_PTRACE_H
2#define __ASM_ARM_PTRACE_H
3
4#define PTRACE_GETREGS 12
5#define PTRACE_SETREGS 13
6#define PTRACE_GETFPREGS 14
7#define PTRACE_SETFPREGS 15
8#define PTRACE_OLDSETOPTIONS 21
9
10/* options set using PTRACE_SETOPTIONS */
11#define PTRACE_O_TRACESYSGOOD 0x00000001
12
13#define MODE_USR26 0x00000000
14#define MODE_FIQ26 0x00000001
15#define MODE_IRQ26 0x00000002
16#define MODE_SVC26 0x00000003
17#define MODE_MASK 0x00000003
18
19#define PSR_F_BIT 0x04000000
20#define PSR_I_BIT 0x08000000
21#define PSR_V_BIT 0x10000000
22#define PSR_C_BIT 0x20000000
23#define PSR_Z_BIT 0x40000000
24#define PSR_N_BIT 0x80000000
25
26#define PCMASK 0xfc000003
27
28
29#ifndef __ASSEMBLY__
30
31#define pc_pointer(v) ((v) & ~PCMASK) /* convert v to pc type address */
32#define instruction_pointer(regs) (pc_pointer((regs)->ARM_pc)) /* get pc */
33#define profile_pc(regs) instruction_pointer(regs)
34
35/* this struct defines the way the registers are stored on the
36 stack during a system call. */
37
38struct pt_regs {
39 long uregs[17];
40};
41
42#define ARM_pc uregs[15]
43#define ARM_lr uregs[14]
44#define ARM_sp uregs[13]
45#define ARM_ip uregs[12]
46#define ARM_fp uregs[11]
47#define ARM_r10 uregs[10]
48#define ARM_r9 uregs[9]
49#define ARM_r8 uregs[8]
50#define ARM_r7 uregs[7]
51#define ARM_r6 uregs[6]
52#define ARM_r5 uregs[5]
53#define ARM_r4 uregs[4]
54#define ARM_r3 uregs[3]
55#define ARM_r2 uregs[2]
56#define ARM_r1 uregs[1]
57#define ARM_r0 uregs[0]
58#define ARM_ORIG_r0 uregs[16]
59
60#ifdef __KERNEL__
61
62#define processor_mode(regs) \
63 ((regs)->ARM_pc & MODE_MASK)
64
65#define user_mode(regs) \
66 (processor_mode(regs) == MODE_USR26)
67
68#define interrupts_enabled(regs) \
69 (!((regs)->ARM_pc & PSR_I_BIT))
70
71#define fast_interrupts_enabled(regs) \
72 (!((regs)->ARM_pc & PSR_F_BIT))
73
74#define condition_codes(regs) \
75 ((regs)->ARM_pc & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT))
76
77/* Are the current registers suitable for user mode?
78 * (used to maintain security in signal handlers)
79 */
80static inline int valid_user_regs(struct pt_regs *regs)
81{
82 if (user_mode(regs) &&
83 (regs->ARM_pc & (PSR_F_BIT | PSR_I_BIT)) == 0)
84 return 1;
85
86 /*
87 * force it to be something sensible
88 */
89 regs->ARM_pc &= ~(MODE_MASK | PSR_F_BIT | PSR_I_BIT);
90
91 return 0;
92}
93
94extern void show_regs(struct pt_regs *);
95
96#define predicate(x) (x & 0xf0000000)
97#define PREDICATE_ALWAYS 0xe0000000
98
99#endif /* __KERNEL__ */
100
101#endif /* __ASSEMBLY__ */
102
103#endif
104
diff --git a/include/asm-arm26/resource.h b/include/asm-arm26/resource.h
new file mode 100644
index 000000000000..734b581b5b6a
--- /dev/null
+++ b/include/asm-arm26/resource.h
@@ -0,0 +1,6 @@
1#ifndef _ARM_RESOURCE_H
2#define _ARM_RESOURCE_H
3
4#include <asm-generic/resource.h>
5
6#endif
diff --git a/include/asm-arm26/scatterlist.h b/include/asm-arm26/scatterlist.h
new file mode 100644
index 000000000000..d9c056c7784e
--- /dev/null
+++ b/include/asm-arm26/scatterlist.h
@@ -0,0 +1,26 @@
1#ifndef _ASMARM_SCATTERLIST_H
2#define _ASMARM_SCATTERLIST_H
3
4#include <asm/types.h>
5
6struct scatterlist {
7 struct page *page; /* buffer page */
8 unsigned int offset; /* buffer offset */
9 dma_addr_t dma_address; /* dma address */
10 unsigned int length; /* length */
11 char *__address; /* for set_dma_addr */
12};
13
14/*
15 * These macros should be used after a pci_map_sg call has been done
16 * to get bus addresses of each of the SG entries and their lengths.
17 * You should only work with the number of sg entries pci_map_sg
18 * returns, or alternatively stop on the first sg_dma_len(sg) which
19 * is 0.
20 */
21#define sg_dma_address(sg) ((sg)->dma_address)
22#define sg_dma_len(sg) ((sg)->length)
23
24#define ISA_DMA_THRESHOLD (0xffffffff)
25
26#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm26/sections.h b/include/asm-arm26/sections.h
new file mode 100644
index 000000000000..10b6370efad0
--- /dev/null
+++ b/include/asm-arm26/sections.h
@@ -0,0 +1,2 @@
1//FIXME - nicked from arm32 - check its correct.
2#include <asm-generic/sections.h>
diff --git a/include/asm-arm26/segment.h b/include/asm-arm26/segment.h
new file mode 100644
index 000000000000..9e24c21f6304
--- /dev/null
+++ b/include/asm-arm26/segment.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_ARM_SEGMENT_H
2#define __ASM_ARM_SEGMENT_H
3
4#define __KERNEL_CS 0x0
5#define __KERNEL_DS 0x0
6
7#define __USER_CS 0x1
8#define __USER_DS 0x1
9
10#endif /* __ASM_ARM_SEGMENT_H */
11
diff --git a/include/asm-arm26/semaphore-helper.h b/include/asm-arm26/semaphore-helper.h
new file mode 100644
index 000000000000..1d7f1987edb9
--- /dev/null
+++ b/include/asm-arm26/semaphore-helper.h
@@ -0,0 +1,84 @@
1#ifndef ASMARM_SEMAPHORE_HELPER_H
2#define ASMARM_SEMAPHORE_HELPER_H
3
4/*
5 * These two _must_ execute atomically wrt each other.
6 */
7static inline void wake_one_more(struct semaphore * sem)
8{
9 unsigned long flags;
10
11 spin_lock_irqsave(&semaphore_wake_lock, flags);
12 if (atomic_read(&sem->count) <= 0)
13 sem->waking++;
14 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
15}
16
17static inline int waking_non_zero(struct semaphore *sem)
18{
19 unsigned long flags;
20 int ret = 0;
21
22 spin_lock_irqsave(&semaphore_wake_lock, flags);
23 if (sem->waking > 0) {
24 sem->waking--;
25 ret = 1;
26 }
27 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
28 return ret;
29}
30
31/*
32 * waking non zero interruptible
33 * 1 got the lock
34 * 0 go to sleep
35 * -EINTR interrupted
36 *
37 * We must undo the sem->count down_interruptible() increment while we are
38 * protected by the spinlock in order to make this atomic_inc() with the
39 * atomic_read() in wake_one_more(), otherwise we can race. -arca
40 */
41static inline int waking_non_zero_interruptible(struct semaphore *sem,
42 struct task_struct *tsk)
43{
44 unsigned long flags;
45 int ret = 0;
46
47 spin_lock_irqsave(&semaphore_wake_lock, flags);
48 if (sem->waking > 0) {
49 sem->waking--;
50 ret = 1;
51 } else if (signal_pending(tsk)) {
52 atomic_inc(&sem->count);
53 ret = -EINTR;
54 }
55 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
56 return ret;
57}
58
59/*
60 * waking_non_zero_try_lock:
61 * 1 failed to lock
62 * 0 got the lock
63 *
64 * We must undo the sem->count down_interruptible() increment while we are
65 * protected by the spinlock in order to make this atomic_inc() with the
66 * atomic_read() in wake_one_more(), otherwise we can race. -arca
67 */
68static inline int waking_non_zero_trylock(struct semaphore *sem)
69{
70 unsigned long flags;
71 int ret = 1;
72
73 spin_lock_irqsave(&semaphore_wake_lock, flags);
74 if (sem->waking <= 0)
75 atomic_inc(&sem->count);
76 else {
77 sem->waking--;
78 ret = 0;
79 }
80 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
81 return ret;
82}
83
84#endif
diff --git a/include/asm-arm26/semaphore.h b/include/asm-arm26/semaphore.h
new file mode 100644
index 000000000000..c1b6a1edad92
--- /dev/null
+++ b/include/asm-arm26/semaphore.h
@@ -0,0 +1,103 @@
1/*
2 * linux/include/asm-arm/semaphore.h
3 */
4#ifndef __ASM_ARM_SEMAPHORE_H
5#define __ASM_ARM_SEMAPHORE_H
6
7#include <linux/linkage.h>
8#include <linux/spinlock.h>
9#include <linux/wait.h>
10#include <linux/rwsem.h>
11
12#include <asm/atomic.h>
13#include <asm/locks.h>
14
15struct semaphore {
16 atomic_t count;
17 int sleepers;
18 wait_queue_head_t wait;
19};
20
21#define __SEMAPHORE_INIT(name, n) \
22{ \
23 .count = ATOMIC_INIT(n), \
24 .sleepers = 0, \
25 .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
26}
27
28#define __MUTEX_INITIALIZER(name) \
29 __SEMAPHORE_INIT(name,1)
30
31#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
32 struct semaphore name = __SEMAPHORE_INIT(name,count)
33
34#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
35#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
36
37static inline void sema_init(struct semaphore *sem, int val)
38{
39 atomic_set(&sem->count, val);
40 sem->sleepers = 0;
41 init_waitqueue_head(&sem->wait);
42}
43
44static inline void init_MUTEX(struct semaphore *sem)
45{
46 sema_init(sem, 1);
47}
48
49static inline void init_MUTEX_LOCKED(struct semaphore *sem)
50{
51 sema_init(sem, 0);
52}
53
54/*
55 * special register calling convention
56 */
57asmlinkage void __down_failed(void);
58asmlinkage int __down_interruptible_failed(void);
59asmlinkage int __down_trylock_failed(void);
60asmlinkage void __up_wakeup(void);
61
62extern void __down(struct semaphore * sem);
63extern int __down_interruptible(struct semaphore * sem);
64extern int __down_trylock(struct semaphore * sem);
65extern void __up(struct semaphore * sem);
66
67/*
68 * This is ugly, but we want the default case to fall through.
69 * "__down" is the actual routine that waits...
70 */
71static inline void down(struct semaphore * sem)
72{
73 might_sleep();
74 __down_op(sem, __down_failed);
75}
76
77/*
78 * This is ugly, but we want the default case to fall through.
79 * "__down_interruptible" is the actual routine that waits...
80 */
81static inline int down_interruptible (struct semaphore * sem)
82{
83 might_sleep();
84 return __down_op_ret(sem, __down_interruptible_failed);
85}
86
87static inline int down_trylock(struct semaphore *sem)
88{
89 return __down_op_ret(sem, __down_trylock_failed);
90}
91
92/*
93 * Note! This is subtle. We jump to wake people up only if
94 * the semaphore was negative (== somebody was waiting on it).
95 * The default case (no contention) will result in NO
96 * jumps for both down() and up().
97 */
98static inline void up(struct semaphore * sem)
99{
100 __up_op(sem, __up_wakeup);
101}
102
103#endif
diff --git a/include/asm-arm26/sembuf.h b/include/asm-arm26/sembuf.h
new file mode 100644
index 000000000000..1c0283954289
--- /dev/null
+++ b/include/asm-arm26/sembuf.h
@@ -0,0 +1,25 @@
1#ifndef _ASMARM_SEMBUF_H
2#define _ASMARM_SEMBUF_H
3
4/*
5 * The semid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct semid64_ds {
15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16 __kernel_time_t sem_otime; /* last semop time */
17 unsigned long __unused1;
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long __unused2;
20 unsigned long sem_nsems; /* no. of semaphores in array */
21 unsigned long __unused3;
22 unsigned long __unused4;
23};
24
25#endif /* _ASMARM_SEMBUF_H */
diff --git a/include/asm-arm26/serial.h b/include/asm-arm26/serial.h
new file mode 100644
index 000000000000..21e1df31f086
--- /dev/null
+++ b/include/asm-arm26/serial.h
@@ -0,0 +1,63 @@
1/*
2 * linux/include/asm-arm/serial.h
3 *
4 * Copyright (C) 1996 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Changelog:
11 * 15-10-1996 RMK Created
12 */
13
14#ifndef __ASM_SERIAL_H
15#define __ASM_SERIAL_H
16
17#include <linux/config.h>
18
19/*
20 * This assumes you have a 1.8432 MHz clock for your UART.
21 *
22 * It'd be nice if someone built a serial card with a 24.576 MHz
23 * clock, since the 16550A is capable of handling a top speed of 1.5
24 * megabits/second; but this requires the faster clock.
25 */
26#define BASE_BAUD (1843200 / 16)
27
28#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
29
30#if defined(CONFIG_ARCH_A5K)
31 /* UART CLK PORT IRQ FLAGS */
32
33#define STD_SERIAL_PORT_DEFNS \
34 { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
35 { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */
36
37#else
38
39#define STD_SERIAL_PORT_DEFNS \
40 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS0 */ \
41 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */
42
43#endif
44
45#define EXTRA_SERIAL_PORT_DEFNS \
46 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
47 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
48 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
49 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
50 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
51 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
52 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
53 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
54 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
55 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
56 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
57 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
58
59#define SERIAL_PORT_DFNS \
60 STD_SERIAL_PORT_DEFNS \
61 EXTRA_SERIAL_PORT_DEFNS
62
63#endif
diff --git a/include/asm-arm26/setup.h b/include/asm-arm26/setup.h
new file mode 100644
index 000000000000..6348931be65d
--- /dev/null
+++ b/include/asm-arm26/setup.h
@@ -0,0 +1,205 @@
1/*
2 * linux/include/asm/setup.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
12 * for more info.
13 */
14#ifndef __ASMARM_SETUP_H
15#define __ASMARM_SETUP_H
16
17#define COMMAND_LINE_SIZE 1024
18
19/* The list ends with an ATAG_NONE node. */
20#define ATAG_NONE 0x00000000
21
22struct tag_header {
23 u32 size;
24 u32 tag;
25};
26
27/* The list must start with an ATAG_CORE node */
28#define ATAG_CORE 0x54410001
29
30struct tag_core {
31 u32 flags; /* bit 0 = read-only */
32 u32 pagesize;
33 u32 rootdev;
34};
35
36/* it is allowed to have multiple ATAG_MEM nodes */
37#define ATAG_MEM 0x54410002
38
39struct tag_mem32 {
40 u32 size;
41 u32 start; /* physical start address */
42};
43
44/* VGA text type displays */
45#define ATAG_VIDEOTEXT 0x54410003
46
47struct tag_videotext {
48 u8 x;
49 u8 y;
50 u16 video_page;
51 u8 video_mode;
52 u8 video_cols;
53 u16 video_ega_bx;
54 u8 video_lines;
55 u8 video_isvga;
56 u16 video_points;
57};
58
59/* describes how the ramdisk will be used in kernel */
60#define ATAG_RAMDISK 0x54410004
61
62struct tag_ramdisk {
63 u32 flags; /* bit 0 = load, bit 1 = prompt */
64 u32 size; /* decompressed ramdisk size in _kilo_ bytes */
65 u32 start; /* starting block of floppy-based RAM disk image */
66};
67
68/* describes where the compressed ramdisk image lives */
69/*
70 * this one accidentally used virtual addresses - as such,
71 * its depreciated.
72 */
73#define ATAG_INITRD 0x54410005
74
75/* describes where the compressed ramdisk image lives */
76#define ATAG_INITRD2 0x54420005
77
78struct tag_initrd {
79 u32 start; /* physical start address */
80 u32 size; /* size of compressed ramdisk image in bytes */
81};
82
83/* board serial number. "64 bits should be enough for everybody" */
84#define ATAG_SERIAL 0x54410006
85
86struct tag_serialnr {
87 u32 low;
88 u32 high;
89};
90
91/* board revision */
92#define ATAG_REVISION 0x54410007
93
94struct tag_revision {
95 u32 rev;
96};
97
98/* initial values for vesafb-type framebuffers. see struct screen_info
99 * in include/linux/tty.h
100 */
101#define ATAG_VIDEOLFB 0x54410008
102
103struct tag_videolfb {
104 u16 lfb_width;
105 u16 lfb_height;
106 u16 lfb_depth;
107 u16 lfb_linelength;
108 u32 lfb_base;
109 u32 lfb_size;
110 u8 red_size;
111 u8 red_pos;
112 u8 green_size;
113 u8 green_pos;
114 u8 blue_size;
115 u8 blue_pos;
116 u8 rsvd_size;
117 u8 rsvd_pos;
118};
119
120/* command line: \0 terminated string */
121#define ATAG_CMDLINE 0x54410009
122
123struct tag_cmdline {
124 char cmdline[1]; /* this is the minimum size */
125};
126
127/* acorn RiscPC specific information */
128#define ATAG_ACORN 0x41000101
129
130struct tag_acorn {
131 u32 memc_control_reg;
132 u32 vram_pages;
133 u8 sounddefault;
134 u8 adfsdrives;
135};
136
137/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
138#define ATAG_MEMCLK 0x41000402
139
140struct tag_memclk {
141 u32 fmemclk;
142};
143
144struct tag {
145 struct tag_header hdr;
146 union {
147 struct tag_core core;
148 struct tag_mem32 mem;
149 struct tag_videotext videotext;
150 struct tag_ramdisk ramdisk;
151 struct tag_initrd initrd;
152 struct tag_serialnr serialnr;
153 struct tag_revision revision;
154 struct tag_videolfb videolfb;
155 struct tag_cmdline cmdline;
156
157 /*
158 * Acorn specific
159 */
160 struct tag_acorn acorn;
161
162 /*
163 * DC21285 specific
164 */
165 struct tag_memclk memclk;
166 } u;
167};
168
169struct tagtable {
170 u32 tag;
171 int (*parse)(const struct tag *);
172};
173
174#define __tag __attribute_used__ __attribute__((__section__(".taglist")))
175#define __tagtable(tag, fn) \
176static struct tagtable __tagtable_##fn __tag = { tag, fn }
177
178#define tag_member_present(tag,member) \
179 ((unsigned long)(&((struct tag *)0L)->member + 1) \
180 <= (tag)->hdr.size * 4)
181
182#define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
183#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
184
185#define for_each_tag(t,base) \
186 for (t = base; t->hdr.size; t = tag_next(t))
187
188/*
189 * Memory map description
190 */
191#define NR_BANKS 8
192
193struct meminfo {
194 int nr_banks;
195 unsigned long end;
196 struct {
197 unsigned long start;
198 unsigned long size;
199 int node;
200 } bank[NR_BANKS];
201};
202
203extern struct meminfo meminfo;
204
205#endif
diff --git a/include/asm-arm26/shmbuf.h b/include/asm-arm26/shmbuf.h
new file mode 100644
index 000000000000..2e5c67ba1c97
--- /dev/null
+++ b/include/asm-arm26/shmbuf.h
@@ -0,0 +1,42 @@
1#ifndef _ASMARM_SHMBUF_H
2#define _ASMARM_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASMARM_SHMBUF_H */
diff --git a/include/asm-arm26/shmparam.h b/include/asm-arm26/shmparam.h
new file mode 100644
index 000000000000..d3748686631e
--- /dev/null
+++ b/include/asm-arm26/shmparam.h
@@ -0,0 +1,15 @@
1#ifndef _ASMARM_SHMPARAM_H
2#define _ASMARM_SHMPARAM_H
3
4#ifndef SHMMAX
5#define SHMMAX 0x003fa000
6#endif
7
8/*
9 * This should be the size of the virtually indexed cache/ways,
10 * or page size, whichever is greater since the cache aliases
11 * every size/ways bytes.
12 */
13#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
14
15#endif /* _ASMARM_SHMPARAM_H */
diff --git a/include/asm-arm26/sigcontext.h b/include/asm-arm26/sigcontext.h
new file mode 100644
index 000000000000..013ad2074fc7
--- /dev/null
+++ b/include/asm-arm26/sigcontext.h
@@ -0,0 +1,33 @@
1#ifndef _ASMARM_SIGCONTEXT_H
2#define _ASMARM_SIGCONTEXT_H
3
4/*
5 * Signal context structure - contains all info to do with the state
6 * before the signal handler was invoked. Note: only add new entries
7 * to the end of the structure.
8 */
9struct sigcontext {
10 unsigned long trap_no;
11 unsigned long error_code;
12 unsigned long oldmask;
13 unsigned long arm_r0;
14 unsigned long arm_r1;
15 unsigned long arm_r2;
16 unsigned long arm_r3;
17 unsigned long arm_r4;
18 unsigned long arm_r5;
19 unsigned long arm_r6;
20 unsigned long arm_r7;
21 unsigned long arm_r8;
22 unsigned long arm_r9;
23 unsigned long arm_r10;
24 unsigned long arm_fp;
25 unsigned long arm_ip;
26 unsigned long arm_sp;
27 unsigned long arm_lr;
28 unsigned long arm_pc;
29 unsigned long fault_address;
30};
31
32
33#endif
diff --git a/include/asm-arm26/siginfo.h b/include/asm-arm26/siginfo.h
new file mode 100644
index 000000000000..5e21852e6039
--- /dev/null
+++ b/include/asm-arm26/siginfo.h
@@ -0,0 +1,6 @@
1#ifndef _ASMARM_SIGINFO_H
2#define _ASMARM_SIGINFO_H
3
4#include <asm-generic/siginfo.h>
5
6#endif
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h
new file mode 100644
index 000000000000..6f62e51a2e5a
--- /dev/null
+++ b/include/asm-arm26/signal.h
@@ -0,0 +1,201 @@
1#ifndef _ASMARM_SIGNAL_H
2#define _ASMARM_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */
12
13#define _NSIG 64
14#define _NSIG_BPW 32
15#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
16
17typedef unsigned long old_sigset_t; /* at least 32 bits */
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73#define SIGSWI 32
74
75/*
76 * SA_FLAGS values:
77 *
78 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
79 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
80 * SA_SIGINFO deliver the signal with SIGINFO structs
81 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
82 * is running in 26-bit.
83 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
84 * SA_RESTART flag to get restarting signals (which were the default long ago)
85 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
86 * SA_NODEFER prevents the current signal from being masked in the handler.
87 * SA_RESETHAND clears the handler when the signal is delivered.
88 *
89 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
90 * Unix names RESETHAND and NODEFER respectively.
91 */
92#define SA_NOCLDSTOP 0x00000001
93#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
94#define SA_SIGINFO 0x00000004
95#define SA_THIRTYTWO 0x02000000
96#define SA_RESTORER 0x04000000
97#define SA_ONSTACK 0x08000000
98#define SA_RESTART 0x10000000
99#define SA_NODEFER 0x40000000
100#define SA_RESETHAND 0x80000000
101
102#define SA_NOMASK SA_NODEFER
103#define SA_ONESHOT SA_RESETHAND
104#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
105
106
107/*
108 * sigaltstack controls
109 */
110#define SS_ONSTACK 1
111#define SS_DISABLE 2
112
113#define MINSIGSTKSZ 2048
114#define SIGSTKSZ 8192
115
116#ifdef __KERNEL__
117
118/*
119 * These values of sa_flags are used only by the kernel as part of the
120 * irq handling routines.
121 *
122 * SA_INTERRUPT is also used by the irq handling routines.
123 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
124 */
125#define SA_PROBE 0x80000000
126#define SA_SAMPLE_RANDOM 0x10000000
127#define SA_IRQNOMASK 0x08000000
128#define SA_SHIRQ 0x04000000
129#endif
130
131#define SIG_BLOCK 0 /* for blocking signals */
132#define SIG_UNBLOCK 1 /* for unblocking signals */
133#define SIG_SETMASK 2 /* for setting the signal mask */
134
135/* Type of a signal handler. */
136typedef void (*__sighandler_t)(int);
137
138#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
139#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
140#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
141
142#ifdef __KERNEL__
143struct old_sigaction {
144 __sighandler_t sa_handler;
145 old_sigset_t sa_mask;
146 unsigned long sa_flags;
147 void (*sa_restorer)(void);
148};
149
150struct sigaction {
151 __sighandler_t sa_handler;
152 unsigned long sa_flags;
153 void (*sa_restorer)(void);
154 sigset_t sa_mask; /* mask last for extensibility */
155};
156
157struct k_sigaction {
158 struct sigaction sa;
159};
160
161#else
162/* Here we must cater to libcs that poke about in kernel headers. */
163
164struct sigaction {
165 union {
166 __sighandler_t _sa_handler;
167 void (*_sa_sigaction)(int, struct siginfo *, void *);
168 } _u;
169 sigset_t sa_mask;
170 unsigned long sa_flags;
171 void (*sa_restorer)(void);
172};
173
174#define sa_handler _u._sa_handler
175#define sa_sigaction _u._sa_sigaction
176
177#endif /* __KERNEL__ */
178
179typedef struct sigaltstack {
180 void *ss_sp;
181 int ss_flags;
182 size_t ss_size;
183} stack_t;
184
185#ifdef __KERNEL__
186#include <asm/sigcontext.h>
187
188#define sigmask(sig) (1UL << ((sig) - 1))
189//FIXME!!!
190//#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER
191
192#endif
193
194
195#ifdef __KERNEL__
196#include <asm/sigcontext.h>
197#define ptrace_signal_deliver(regs, cookie) do { } while (0)
198#endif
199
200
201#endif
diff --git a/include/asm-arm26/sizes.h b/include/asm-arm26/sizes.h
new file mode 100644
index 000000000000..f8d92ca12040
--- /dev/null
+++ b/include/asm-arm26/sizes.h
@@ -0,0 +1,52 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16/* DO NOT EDIT!! - this file automatically generated
17 * from .s file by awk -f s2h.awk
18 */
19/* Size defintions
20 * Copyright (C) ARM Limited 1998. All rights reserved.
21 */
22
23#ifndef __sizes_h
24#define __sizes_h 1
25
26/* handy sizes */
27#define SZ_1K 0x00000400
28#define SZ_4K 0x00001000
29#define SZ_8K 0x00002000
30#define SZ_16K 0x00004000
31#define SZ_64K 0x00010000
32#define SZ_128K 0x00020000
33#define SZ_256K 0x00040000
34#define SZ_512K 0x00080000
35
36#define SZ_1M 0x00100000
37#define SZ_2M 0x00200000
38#define SZ_4M 0x00400000
39#define SZ_8M 0x00800000
40#define SZ_16M 0x01000000
41#define SZ_32M 0x02000000
42#define SZ_64M 0x04000000
43#define SZ_128M 0x08000000
44#define SZ_256M 0x10000000
45#define SZ_512M 0x20000000
46
47#define SZ_1G 0x40000000
48#define SZ_2G 0x80000000
49
50#endif
51
52/* END */
diff --git a/include/asm-arm26/smp.h b/include/asm-arm26/smp.h
new file mode 100644
index 000000000000..5ca771631fd8
--- /dev/null
+++ b/include/asm-arm26/smp.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H
3
4#include <linux/config.h>
5
6#ifdef CONFIG_SMP
7#error SMP not supported
8#endif
9
10#endif
diff --git a/include/asm-arm26/socket.h b/include/asm-arm26/socket.h
new file mode 100644
index 000000000000..46d20585d951
--- /dev/null
+++ b/include/asm-arm26/socket.h
@@ -0,0 +1,50 @@
1#ifndef _ASMARM_SOCKET_H
2#define _ASMARM_SOCKET_H
3
4#include <asm/sockios.h>
5
6/* For setsockopt(2) */
7#define SOL_SOCKET 1
8
9#define SO_DEBUG 1
10#define SO_REUSEADDR 2
11#define SO_TYPE 3
12#define SO_ERROR 4
13#define SO_DONTROUTE 5
14#define SO_BROADCAST 6
15#define SO_SNDBUF 7
16#define SO_RCVBUF 8
17#define SO_KEEPALIVE 9
18#define SO_OOBINLINE 10
19#define SO_NO_CHECK 11
20#define SO_PRIORITY 12
21#define SO_LINGER 13
22#define SO_BSDCOMPAT 14
23/* To add :#define SO_REUSEPORT 15 */
24#define SO_PASSCRED 16
25#define SO_PEERCRED 17
26#define SO_RCVLOWAT 18
27#define SO_SNDLOWAT 19
28#define SO_RCVTIMEO 20
29#define SO_SNDTIMEO 21
30
31/* Security levels - as per NRL IPv6 - don't actually do anything */
32#define SO_SECURITY_AUTHENTICATION 22
33#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
34#define SO_SECURITY_ENCRYPTION_NETWORK 24
35
36#define SO_BINDTODEVICE 25
37
38/* Socket filtering */
39#define SO_ATTACH_FILTER 26
40#define SO_DETACH_FILTER 27
41
42#define SO_PEERNAME 28
43#define SO_TIMESTAMP 29
44#define SCM_TIMESTAMP SO_TIMESTAMP
45
46#define SO_ACCEPTCONN 30
47
48#define SO_PEERSEC 31
49
50#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-arm26/sockios.h b/include/asm-arm26/sockios.h
new file mode 100644
index 000000000000..77c34087d513
--- /dev/null
+++ b/include/asm-arm26/sockios.h
@@ -0,0 +1,12 @@
1#ifndef __ARCH_ARM_SOCKIOS_H
2#define __ARCH_ARM_SOCKIOS_H
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp */
11
12#endif
diff --git a/include/asm-arm26/spinlock.h b/include/asm-arm26/spinlock.h
new file mode 100644
index 000000000000..e92e81deb4fd
--- /dev/null
+++ b/include/asm-arm26/spinlock.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_SPINLOCK_H
2#define __ASM_SPINLOCK_H
3
4#error ARM architecture does not support SMP spin locks
5
6#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm26/stat.h b/include/asm-arm26/stat.h
new file mode 100644
index 000000000000..e4abc4fa0850
--- /dev/null
+++ b/include/asm-arm26/stat.h
@@ -0,0 +1,77 @@
1#ifndef _ASMARM_STAT_H
2#define _ASMARM_STAT_H
3
4struct __old_kernel_stat {
5 unsigned short st_dev;
6 unsigned short st_ino;
7 unsigned short st_mode;
8 unsigned short st_nlink;
9 unsigned short st_uid;
10 unsigned short st_gid;
11 unsigned short st_rdev;
12 unsigned long st_size;
13 unsigned long st_atime;
14 unsigned long st_mtime;
15 unsigned long st_ctime;
16};
17
18struct stat {
19 unsigned short st_dev;
20 unsigned short __pad1;
21 unsigned long st_ino;
22 unsigned short st_mode;
23 unsigned short st_nlink;
24 unsigned short st_uid;
25 unsigned short st_gid;
26 unsigned short st_rdev;
27 unsigned short __pad2;
28 unsigned long st_size;
29 unsigned long st_blksize;
30 unsigned long st_blocks;
31 unsigned long st_atime;
32 unsigned long st_atime_nsec;
33 unsigned long st_mtime;
34 unsigned long st_mtime_nsec;
35 unsigned long st_ctime;
36 unsigned long st_ctime_nsec;
37 unsigned long __unused4;
38 unsigned long __unused5;
39};
40
41/* This matches struct stat64 in glibc2.1, hence the absolutely
42 * insane amounts of padding around dev_t's.
43 */
44struct stat64 {
45 unsigned long long st_dev;
46 unsigned char __pad0[4];
47
48#define STAT64_HAS_BROKEN_ST_INO 1
49 unsigned long __st_ino;
50 unsigned int st_mode;
51 unsigned int st_nlink;
52
53 unsigned long st_uid;
54 unsigned long st_gid;
55
56 unsigned long long st_rdev;
57 unsigned char __pad3[4];
58
59 long long st_size;
60 unsigned long st_blksize;
61
62 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
63 unsigned long __pad4; /* Future possible st_blocks hi bits */
64
65 unsigned long st_atime;
66 unsigned long st_atime_nsec;
67
68 unsigned long st_mtime;
69 unsigned long st_mtime_nsec;
70
71 unsigned long st_ctime;
72 unsigned long st_ctime_nsec;
73
74 unsigned long long st_ino;
75};
76
77#endif
diff --git a/include/asm-arm26/statfs.h b/include/asm-arm26/statfs.h
new file mode 100644
index 000000000000..776dbc8f7623
--- /dev/null
+++ b/include/asm-arm26/statfs.h
@@ -0,0 +1,8 @@
1#ifndef _ASMARM_STATFS_H
2#define _ASMARM_STATFS_H
3
4//FIXME - this may not be appropriate for arm26. check it out.
5
6#include <asm-generic/statfs.h>
7
8#endif
diff --git a/include/asm-arm26/string.h b/include/asm-arm26/string.h
new file mode 100644
index 000000000000..2a8ab162412f
--- /dev/null
+++ b/include/asm-arm26/string.h
@@ -0,0 +1,43 @@
1#ifndef __ASM_ARM_STRING_H
2#define __ASM_ARM_STRING_H
3
4/*
5 * We don't do inline string functions, since the
6 * optimised inline asm versions are not small.
7 */
8
9#define __HAVE_ARCH_STRRCHR
10extern char * strrchr(const char * s, int c);
11
12#define __HAVE_ARCH_STRCHR
13extern char * strchr(const char * s, int c);
14
15#define __HAVE_ARCH_MEMCPY
16extern void * memcpy(void *, const void *, __kernel_size_t);
17
18#define __HAVE_ARCH_MEMMOVE
19extern void * memmove(void *, const void *, __kernel_size_t);
20
21#define __HAVE_ARCH_MEMCHR
22extern void * memchr(const void *, int, __kernel_size_t);
23
24#define __HAVE_ARCH_MEMZERO
25#define __HAVE_ARCH_MEMSET
26extern void * memset(void *, int, __kernel_size_t);
27
28extern void __memzero(void *ptr, __kernel_size_t n);
29
30#define memset(p,v,n) \
31 ({ \
32 if ((n) != 0) { \
33 if (__builtin_constant_p((v)) && (v) == 0) \
34 __memzero((p),(n)); \
35 else \
36 memset((p),(v),(n)); \
37 } \
38 (p); \
39 })
40
41#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
42
43#endif
diff --git a/include/asm-arm26/suspend.h b/include/asm-arm26/suspend.h
new file mode 100644
index 000000000000..5e4c1cc0c19d
--- /dev/null
+++ b/include/asm-arm26/suspend.h
@@ -0,0 +1,4 @@
1#ifdef _ASMARM_SUSPEND_H
2#define _ASMARM_SUSPEND_H
3
4#endif
diff --git a/include/asm-arm26/sysirq.h b/include/asm-arm26/sysirq.h
new file mode 100644
index 000000000000..cad250c7b9ec
--- /dev/null
+++ b/include/asm-arm26/sysirq.h
@@ -0,0 +1,61 @@
1/*
2 * linux/include/asm-arm/arch-arc/irqs.h
3 *
4 * Copyright (C) 1996 Russell King, Dave Gilbert
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Modifications:
11 * 04-04-1998 PJB Merged arc and a5k versions
12 */
13
14#include <linux/config.h>
15
16#if defined(CONFIG_ARCH_A5K)
17#define IRQ_PRINTER 0
18#define IRQ_BATLOW 1
19#define IRQ_FLOPPYINDEX 2
20#define IRQ_FLOPPYDISK 12
21#elif defined(CONFIG_ARCH_ARC)
22#define IRQ_PRINTERBUSY 0
23#define IRQ_SERIALRING 1
24#define IRQ_PRINTERACK 2
25#define IRQ_FLOPPYCHANGED 12
26#endif
27
28#define IRQ_VSYNCPULSE 3
29#define IRQ_POWERON 4
30#define IRQ_TIMER0 5
31#define IRQ_TIMER1 6
32#define IRQ_IMMEDIATE 7
33#define IRQ_EXPCARDFIQ 8
34#define IRQ_SOUNDCHANGE 9
35#define IRQ_SERIALPORT 10
36#define IRQ_HARDDISK 11
37#define IRQ_EXPANSIONCARD 13
38#define IRQ_KEYBOARDTX 14
39#define IRQ_KEYBOARDRX 15
40
41#if defined(CONFIG_ARCH_A5K)
42#define FIQ_SERIALPORT 4
43#elif defined(CONFIG_ARCH_ARC)
44#define FIQ_FLOPPYIRQ 1
45#define FIQ_FD1772 FIQ_FLOPPYIRQ
46#endif
47
48#define FIQ_FLOPPYDATA 0
49#define FIQ_ECONET 2
50#define FIQ_EXPANSIONCARD 6
51#define FIQ_FORCE 7
52
53#define IRQ_TIMER IRQ_TIMER0
54
55/*
56 * This is the offset of the FIQ "IRQ" numbers
57 */
58#define FIQ_START 64
59
60#define irq_cannonicalize(i) (i)
61
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
new file mode 100644
index 000000000000..f23fac1938f3
--- /dev/null
+++ b/include/asm-arm26/system.h
@@ -0,0 +1,252 @@
1#ifndef __ASM_ARM_SYSTEM_H
2#define __ASM_ARM_SYSTEM_H
3
4#ifdef __KERNEL__
5
6#include <linux/config.h>
7
8/*
9 * This is used to ensure the compiler did actually allocate the register we
10 * asked it for some inline assembly sequences. Apparently we can't trust
11 * the compiler from one version to another so a bit of paranoia won't hurt.
12 * This string is meant to be concatenated with the inline asm string and
13 * will cause compilation to stop on mismatch. (From ARM32 - may come in handy)
14 */
15#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
16
17#ifndef __ASSEMBLY__
18
19#include <linux/linkage.h>
20
21struct thread_info;
22struct task_struct;
23
24#if 0
25/* information about the system we're running on */
26extern unsigned int system_rev;
27extern unsigned int system_serial_low;
28extern unsigned int system_serial_high;
29extern unsigned int mem_fclk_21285;
30
31FIXME - sort this
32/*
33 * We need to turn the caches off before calling the reset vector - RiscOS
34 * messes up if we don't
35 */
36#define proc_hard_reset() cpu_proc_fin()
37
38#endif
39
40struct pt_regs;
41
42void die(const char *msg, struct pt_regs *regs, int err)
43 __attribute__((noreturn));
44
45void die_if_kernel(const char *str, struct pt_regs *regs, int err);
46
47void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
48 struct pt_regs *),
49 int sig, const char *name);
50
51#include <asm/proc-fns.h>
52
53#define xchg(ptr,x) \
54 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
55
56#define tas(ptr) (xchg((ptr),1))
57
58extern asmlinkage void __backtrace(void);
59
60#define set_cr(x) \
61 __asm__ __volatile__( \
62 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \
63 : : "r" (x) : "cc")
64
65#define get_cr() \
66 ({ \
67 unsigned int __val; \
68 __asm__ __volatile__( \
69 "mrc p15, 0, %0, c1, c0, 0 @ get CR" \
70 : "=r" (__val) : : "cc"); \
71 __val; \
72 })
73
74extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
75extern unsigned long cr_alignment; /* defined in entry-armv.S */
76
77#define UDBG_UNDEFINED (1 << 0)
78#define UDBG_SYSCALL (1 << 1)
79#define UDBG_BADABORT (1 << 2)
80#define UDBG_SEGV (1 << 3)
81#define UDBG_BUS (1 << 4)
82
83extern unsigned int user_debug;
84
85#define vectors_base() (0)
86
87#define mb() __asm__ __volatile__ ("" : : : "memory")
88#define rmb() mb()
89#define wmb() mb()
90#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
91
92#define read_barrier_depends() do { } while(0)
93#define set_mb(var, value) do { var = value; mb(); } while (0)
94#define set_wmb(var, value) do { var = value; wmb(); } while (0)
95
96/*
97 * We assume knowledge of how
98 * spin_unlock_irq() and friends are implemented. This avoids
99 * us needlessly decrementing and incrementing the preempt count.
100 */
101#define prepare_arch_switch(rq,next) local_irq_enable()
102#define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock)
103#define task_running(rq,p) ((rq)->curr == (p))
104
105/*
106 * switch_to(prev, next) should switch from task `prev' to `next'
107 * `prev' will never be the same as `next'. schedule() itself
108 * contains the memory barrier to tell GCC not to cache `current'.
109 */
110extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
111
112#define switch_to(prev,next,last) \
113do { \
114 last = __switch_to(prev,prev->thread_info,next->thread_info); \
115} while (0)
116
117/*
118 * Save the current interrupt enable state & disable IRQs
119 */
120#define local_irq_save(x) \
121 do { \
122 unsigned long temp; \
123 __asm__ __volatile__( \
124" mov %0, pc @ save_flags_cli\n" \
125" orr %1, %0, #0x08000000\n" \
126" and %0, %0, #0x0c000000\n" \
127" teqp %1, #0\n" \
128 : "=r" (x), "=r" (temp) \
129 : \
130 : "memory"); \
131 } while (0)
132
133/*
134 * Enable IRQs (sti)
135 */
136#define local_irq_enable() \
137 do { \
138 unsigned long temp; \
139 __asm__ __volatile__( \
140" mov %0, pc @ sti\n" \
141" bic %0, %0, #0x08000000\n" \
142" teqp %0, #0\n" \
143 : "=r" (temp) \
144 : \
145 : "memory"); \
146 } while(0)
147
148/*
149 * Disable IRQs (cli)
150 */
151#define local_irq_disable() \
152 do { \
153 unsigned long temp; \
154 __asm__ __volatile__( \
155" mov %0, pc @ cli\n" \
156" orr %0, %0, #0x08000000\n" \
157" teqp %0, #0\n" \
158 : "=r" (temp) \
159 : \
160 : "memory"); \
161 } while(0)
162
163/* Enable FIQs (stf) */
164
165#define __stf() do { \
166 unsigned long temp; \
167 __asm__ __volatile__( \
168" mov %0, pc @ stf\n" \
169" bic %0, %0, #0x04000000\n" \
170" teqp %0, #0\n" \
171 : "=r" (temp)); \
172 } while(0)
173
174/* Disable FIQs (clf) */
175
176#define __clf() do { \
177 unsigned long temp; \
178 __asm__ __volatile__( \
179" mov %0, pc @ clf\n" \
180" orr %0, %0, #0x04000000\n" \
181" teqp %0, #0\n" \
182 : "=r" (temp)); \
183 } while(0)
184
185
186/*
187 * Save the current interrupt enable state.
188 */
189#define local_save_flags(x) \
190 do { \
191 __asm__ __volatile__( \
192" mov %0, pc @ save_flags\n" \
193" and %0, %0, #0x0c000000\n" \
194 : "=r" (x)); \
195 } while (0)
196
197
198/*
199 * restore saved IRQ & FIQ state
200 */
201#define local_irq_restore(x) \
202 do { \
203 unsigned long temp; \
204 __asm__ __volatile__( \
205" mov %0, pc @ restore_flags\n" \
206" bic %0, %0, #0x0c000000\n" \
207" orr %0, %0, %1\n" \
208" teqp %0, #0\n" \
209 : "=&r" (temp) \
210 : "r" (x) \
211 : "memory"); \
212 } while (0)
213
214
215#ifdef CONFIG_SMP
216#error SMP not supported
217#endif
218
219#define smp_mb() barrier()
220#define smp_rmb() barrier()
221#define smp_wmb() barrier()
222#define smp_read_barrier_depends() do { } while(0)
223
224#define clf() __clf()
225#define stf() __stf()
226
227#define irqs_disabled() \
228({ \
229 unsigned long flags; \
230 local_save_flags(flags); \
231 flags & PSR_I_BIT; \
232})
233
234static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
235{
236 extern void __bad_xchg(volatile void *, int);
237
238 switch (size) {
239 case 1: return cpu_xchg_1(x, ptr);
240 case 4: return cpu_xchg_4(x, ptr);
241 default: __bad_xchg(ptr, size);
242 }
243 return 0;
244}
245
246#endif /* __ASSEMBLY__ */
247
248#define arch_align_stack(x) (x)
249
250#endif /* __KERNEL__ */
251
252#endif
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h
new file mode 100644
index 000000000000..bbc6e1d24d3f
--- /dev/null
+++ b/include/asm-arm26/termbits.h
@@ -0,0 +1,171 @@
1#ifndef __ASM_ARM_TERMBITS_H
2#define __ASM_ARM_TERMBITS_H
3
4typedef unsigned char cc_t;
5typedef unsigned int speed_t;
6typedef unsigned int tcflag_t;
7
8#define NCCS 19
9struct termios {
10 tcflag_t c_iflag; /* input mode flags */
11 tcflag_t c_oflag; /* output mode flags */
12 tcflag_t c_cflag; /* control mode flags */
13 tcflag_t c_lflag; /* local mode flags */
14 cc_t c_line; /* line discipline */
15 cc_t c_cc[NCCS]; /* control characters */
16};
17
18/* c_cc characters */
19#define VINTR 0
20#define VQUIT 1
21#define VERASE 2
22#define VKILL 3
23#define VEOF 4
24#define VTIME 5
25#define VMIN 6
26#define VSWTC 7
27#define VSTART 8
28#define VSTOP 9
29#define VSUSP 10
30#define VEOL 11
31#define VREPRINT 12
32#define VDISCARD 13
33#define VWERASE 14
34#define VLNEXT 15
35#define VEOL2 16
36
37/* c_iflag bits */
38#define IGNBRK 0000001
39#define BRKINT 0000002
40#define IGNPAR 0000004
41#define PARMRK 0000010
42#define INPCK 0000020
43#define ISTRIP 0000040
44#define INLCR 0000100
45#define IGNCR 0000200
46#define ICRNL 0000400
47#define IUCLC 0001000
48#define IXON 0002000
49#define IXANY 0004000
50#define IXOFF 0010000
51#define IMAXBEL 0020000
52#define IUTF8 0040000
53
54/* c_oflag bits */
55#define OPOST 0000001
56#define OLCUC 0000002
57#define ONLCR 0000004
58#define OCRNL 0000010
59#define ONOCR 0000020
60#define ONLRET 0000040
61#define OFILL 0000100
62#define OFDEL 0000200
63#define NLDLY 0000400
64#define NL0 0000000
65#define NL1 0000400
66#define CRDLY 0003000
67#define CR0 0000000
68#define CR1 0001000
69#define CR2 0002000
70#define CR3 0003000
71#define TABDLY 0014000
72#define TAB0 0000000
73#define TAB1 0004000
74#define TAB2 0010000
75#define TAB3 0014000
76#define XTABS 0014000
77#define BSDLY 0020000
78#define BS0 0000000
79#define BS1 0020000
80#define VTDLY 0040000
81#define VT0 0000000
82#define VT1 0040000
83#define FFDLY 0100000
84#define FF0 0000000
85#define FF1 0100000
86
87/* c_cflag bit meaning */
88#define CBAUD 0010017
89#define B0 0000000 /* hang up */
90#define B50 0000001
91#define B75 0000002
92#define B110 0000003
93#define B134 0000004
94#define B150 0000005
95#define B200 0000006
96#define B300 0000007
97#define B600 0000010
98#define B1200 0000011
99#define B1800 0000012
100#define B2400 0000013
101#define B4800 0000014
102#define B9600 0000015
103#define B19200 0000016
104#define B38400 0000017
105#define EXTA B19200
106#define EXTB B38400
107#define CSIZE 0000060
108#define CS5 0000000
109#define CS6 0000020
110#define CS7 0000040
111#define CS8 0000060
112#define CSTOPB 0000100
113#define CREAD 0000200
114#define PARENB 0000400
115#define PARODD 0001000
116#define HUPCL 0002000
117#define CLOCAL 0004000
118#define CBAUDEX 0010000
119#define B57600 0010001
120#define B115200 0010002
121#define B230400 0010003
122#define B460800 0010004
123#define B500000 0010005
124#define B576000 0010006
125#define B921600 0010007
126#define B1000000 0010010
127#define B1152000 0010011
128#define B1500000 0010012
129#define B2000000 0010013
130#define B2500000 0010014
131#define B3000000 0010015
132#define B3500000 0010016
133#define B4000000 0010017
134#define CIBAUD 002003600000 /* input baud rate (not used) */
135#define CMSPAR 010000000000 /* mark or space (stick) parity */
136#define CRTSCTS 020000000000 /* flow control */
137
138/* c_lflag bits */
139#define ISIG 0000001
140#define ICANON 0000002
141#define XCASE 0000004
142#define ECHO 0000010
143#define ECHOE 0000020
144#define ECHOK 0000040
145#define ECHONL 0000100
146#define NOFLSH 0000200
147#define TOSTOP 0000400
148#define ECHOCTL 0001000
149#define ECHOPRT 0002000
150#define ECHOKE 0004000
151#define FLUSHO 0010000
152#define PENDIN 0040000
153#define IEXTEN 0100000
154
155/* tcflow() and TCXONC use these */
156#define TCOOFF 0
157#define TCOON 1
158#define TCIOFF 2
159#define TCION 3
160
161/* tcflush() and TCFLSH use these */
162#define TCIFLUSH 0
163#define TCOFLUSH 1
164#define TCIOFLUSH 2
165
166/* tcsetattr uses these */
167#define TCSANOW 0
168#define TCSADRAIN 1
169#define TCSAFLUSH 2
170
171#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/include/asm-arm26/termios.h b/include/asm-arm26/termios.h
new file mode 100644
index 000000000000..7b8f5e8ae063
--- /dev/null
+++ b/include/asm-arm26/termios.h
@@ -0,0 +1,108 @@
1#ifndef __ASM_ARM_TERMIOS_H
2#define __ASM_ARM_TERMIOS_H
3
4#include <asm/termbits.h>
5#include <asm/ioctls.h>
6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24#ifdef __KERNEL__
25/* intr=^C quit=^| erase=del kill=^U
26 eof=^D vtime=\0 vmin=\1 sxtc=\0
27 start=^Q stop=^S susp=^Z eol=\0
28 reprint=^R discard=^U werase=^W lnext=^V
29 eol2=\0
30*/
31#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
32#endif
33
34/* modem lines */
35#define TIOCM_LE 0x001
36#define TIOCM_DTR 0x002
37#define TIOCM_RTS 0x004
38#define TIOCM_ST 0x008
39#define TIOCM_SR 0x010
40#define TIOCM_CTS 0x020
41#define TIOCM_CAR 0x040
42#define TIOCM_RNG 0x080
43#define TIOCM_DSR 0x100
44#define TIOCM_CD TIOCM_CAR
45#define TIOCM_RI TIOCM_RNG
46#define TIOCM_OUT1 0x2000
47#define TIOCM_OUT2 0x4000
48#define TIOCM_LOOP 0x8000
49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__
71
72/*
73 * Translate a "termio" structure into a "termios". Ugh.
74 */
75#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
76 unsigned short __tmp; \
77 get_user(__tmp,&(termio)->x); \
78 *(unsigned short *) &(termios)->x = __tmp; \
79}
80
81#define user_termio_to_kernel_termios(termios, termio) \
82({ \
83 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
84 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
85 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
86 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
87 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
88})
89
90/*
91 * Translate a "termios" structure into a "termio". Ugh.
92 */
93#define kernel_termios_to_user_termio(termio, termios) \
94({ \
95 put_user((termios)->c_iflag, &(termio)->c_iflag); \
96 put_user((termios)->c_oflag, &(termio)->c_oflag); \
97 put_user((termios)->c_cflag, &(termio)->c_cflag); \
98 put_user((termios)->c_lflag, &(termio)->c_lflag); \
99 put_user((termios)->c_line, &(termio)->c_line); \
100 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
101})
102
103#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
104#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
105
106#endif /* __KERNEL__ */
107
108#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/include/asm-arm26/thread_info.h b/include/asm-arm26/thread_info.h
new file mode 100644
index 000000000000..50f41b50268a
--- /dev/null
+++ b/include/asm-arm26/thread_info.h
@@ -0,0 +1,144 @@
1/*
2 * linux/include/asm-arm26/thread_info.h
3 *
4 * Copyright (C) 2002 Russell King.
5 * Copyright (C) 2003 Ian Molton.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_ARM_THREAD_INFO_H
12#define __ASM_ARM_THREAD_INFO_H
13
14#ifdef __KERNEL__
15
16#ifndef __ASSEMBLY__
17
18struct task_struct;
19struct exec_domain;
20
21#include <linux/compiler.h>
22#include <asm/fpstate.h>
23#include <asm/ptrace.h>
24#include <asm/types.h>
25
26typedef unsigned long mm_segment_t;
27
28struct cpu_context_save {
29 __u32 r4;
30 __u32 r5;
31 __u32 r6;
32 __u32 r7;
33 __u32 r8;
34 __u32 r9;
35 __u32 sl;
36 __u32 fp;
37 __u32 sp;
38 __u32 pc;
39};
40
41/*
42 * low level task data that entry.S needs immediate access to.
43 * We assume cpu_context follows immedately after cpu_domain.
44 */
45struct thread_info {
46 unsigned long flags; /* low level flags */
47 __s32 preempt_count; /* 0 => preemptable, <0 => bug */
48 mm_segment_t addr_limit; /* address limit */
49 struct task_struct *task; /* main task structure */
50 struct exec_domain *exec_domain; /* execution domain */
51 __u32 cpu; /* cpu */
52 struct cpu_context_save cpu_context; /* cpu context */
53 struct restart_block restart_block;
54 union fp_state fpstate;
55};
56
57#define INIT_THREAD_INFO(tsk) \
58{ \
59 .task &tsk, \
60 .exec_domain &default_exec_domain, \
61 .flags 0, \
62 .preempt_count 0, \
63 .addr_limit KERNEL_DS, \
64 .restart_block = { \
65 .fn = do_no_restart_syscall, \
66 }, \
67}
68
69#define init_thread_info (init_thread_union.thread_info)
70#define init_stack (init_thread_union.stack)
71
72/*
73 * how to get the thread information struct from C
74 */
75static inline struct thread_info *current_thread_info(void) __attribute_const__;
76
77static inline struct thread_info *current_thread_info(void)
78{
79 register unsigned long sp asm ("sp");
80 return (struct thread_info *)(sp & ~0x1fff);
81}
82
83/* FIXME - PAGE_SIZE < 32K */
84#define THREAD_SIZE (8*32768) // FIXME - this needs attention (see kernel/fork.c which gets a nice div by zero if this is lower than 8*32768
85#define __get_user_regs(x) (((struct pt_regs *)((unsigned long)(x) + THREAD_SIZE - 8)) - 1)
86
87extern struct thread_info *alloc_thread_info(struct task_struct *task);
88extern void free_thread_info(struct thread_info *);
89
90#define get_thread_info(ti) get_task_struct((ti)->task)
91#define put_thread_info(ti) put_task_struct((ti)->task)
92
93#define thread_saved_pc(tsk) \
94 ((unsigned long)(pc_pointer((tsk)->thread_info->cpu_context.pc)))
95#define thread_saved_fp(tsk) \
96 ((unsigned long)((tsk)->thread_info->cpu_context.fp))
97
98#else /* !__ASSEMBLY__ */
99
100#define TI_FLAGS 0
101#define TI_PREEMPT 4
102#define TI_ADDR_LIMIT 8
103#define TI_TASK 12
104#define TI_EXEC_DOMAIN 16
105#define TI_CPU 20
106#define TI_CPU_SAVE 24
107#define TI_RESTART_BLOCK 28
108#define TI_FPSTATE 68
109
110#endif
111
112#define PREEMPT_ACTIVE 0x04000000
113
114/*
115 * thread information flags:
116 * TIF_SYSCALL_TRACE - syscall trace active
117 * TIF_NOTIFY_RESUME - resumption notification requested
118 * TIF_SIGPENDING - signal pending
119 * TIF_NEED_RESCHED - rescheduling necessary
120 * TIF_USEDFPU - FPU was used by this task this quantum (SMP)
121 * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
122 */
123#define TIF_NOTIFY_RESUME 0
124#define TIF_SIGPENDING 1
125#define TIF_NEED_RESCHED 2
126#define TIF_SYSCALL_TRACE 8
127#define TIF_USED_FPU 16
128#define TIF_POLLING_NRFLAG 17
129#define TIF_MEMDIE 18
130
131#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
132#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
133#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
134#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
135#define _TIF_USED_FPU (1 << TIF_USED_FPU)
136#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
137
138/*
139 * Change these and you break ASM code in entry-common.S
140 */
141#define _TIF_WORK_MASK 0x000000ff
142
143#endif /* __KERNEL__ */
144#endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/include/asm-arm26/timex.h b/include/asm-arm26/timex.h
new file mode 100644
index 000000000000..68322fbc1aed
--- /dev/null
+++ b/include/asm-arm26/timex.h
@@ -0,0 +1,29 @@
1/*
2 * linux/include/asm-arm/timex.h
3 *
4 * Copyright (C) 1997,1998 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Architecture Specific TIME specifications
11 */
12#ifndef _ASMARM_TIMEX_H
13#define _ASMARM_TIMEX_H
14
15/*
16 * On the RiscPC, the clock ticks at 2MHz.
17 */
18#define CLOCK_TICK_RATE 2000000
19
20/* IS THAT RIGHT ON A5000? FIXME */
21
22typedef unsigned long cycles_t;
23
24static inline cycles_t get_cycles (void)
25{
26 return 0;
27}
28
29#endif
diff --git a/include/asm-arm26/tlb.h b/include/asm-arm26/tlb.h
new file mode 100644
index 000000000000..1316352a58f3
--- /dev/null
+++ b/include/asm-arm26/tlb.h
@@ -0,0 +1,78 @@
1#ifndef __ASMARM_TLB_H
2#define __ASMARM_TLB_H
3
4#include <asm/pgalloc.h>
5#include <asm/tlbflush.h>
6
7/*
8 * TLB handling. This allows us to remove pages from the page
9 * tables, and efficiently handle the TLB issues.
10 */
11struct mmu_gather {
12 struct mm_struct *mm;
13 unsigned int freed;
14 unsigned int fullmm;
15
16 unsigned int flushes;
17 unsigned int avoided_flushes;
18};
19
20extern struct mmu_gather mmu_gathers[NR_CPUS];
21
22static inline struct mmu_gather *
23tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
24{
25 int cpu = smp_processor_id();
26 struct mmu_gather *tlb = &mmu_gathers[cpu];
27
28 tlb->mm = mm;
29 tlb->freed = 0;
30 tlb->fullmm = full_mm_flush;
31
32 return tlb;
33}
34
35static inline void
36tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
37{
38 struct mm_struct *mm = tlb->mm;
39 unsigned long freed = tlb->freed;
40 int rss = get_mm_counter(mm, rss);
41
42 if (rss < freed)
43 freed = rss;
44 add_mm_counter(mm, rss, -freed);
45
46 if (freed) {
47 flush_tlb_mm(mm);
48 tlb->flushes++;
49 } else {
50 tlb->avoided_flushes++;
51 }
52
53 /* keep the page table cache within bounds */
54 check_pgt_cache();
55}
56
57
58static inline unsigned int
59tlb_is_full_mm(struct mmu_gather *tlb)
60{
61 return tlb->fullmm;
62}
63
64#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
65//#define tlb_start_vma(tlb,vma) do { } while (0)
66//FIXME - ARM32 uses this now that things changed in the kernel. seems like it may be pointless on arm26, however to get things compiling...
67#define tlb_start_vma(tlb,vma) \
68 do { \
69 if (!tlb->fullmm) \
70 flush_cache_range(vma, vma->vm_start, vma->vm_end); \
71 } while (0)
72#define tlb_end_vma(tlb,vma) do { } while (0)
73
74#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
75#define pte_free_tlb(tlb,ptep) pte_free(ptep)
76#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp)
77
78#endif
diff --git a/include/asm-arm26/tlbflush.h b/include/asm-arm26/tlbflush.h
new file mode 100644
index 000000000000..f79c1cbf4f69
--- /dev/null
+++ b/include/asm-arm26/tlbflush.h
@@ -0,0 +1,70 @@
1#ifndef __ASMARM_TLBFLUSH_H
2#define __ASMARM_TLBFLUSH_H
3
4/*
5 * TLB flushing:
6 *
7 * - flush_tlb_all() flushes all processes TLBs
8 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
9 * - flush_tlb_page(vma, vmaddr) flushes one page
10 * - flush_tlb_range(vma, start, end) flushes a range of pages
11 */
12
13#define flush_tlb_all() memc_update_all()
14#define flush_tlb_mm(mm) memc_update_mm(mm)
15#define flush_tlb_page(vma, vmaddr) do { printk("flush_tlb_page\n");} while (0) // IS THIS RIGHT?
16#define flush_tlb_range(vma,start,end) \
17 do { memc_update_mm(vma->vm_mm); (void)(start); (void)(end); } while (0)
18#define flush_tlb_pgtables(mm,start,end) do { printk("flush_tlb_pgtables\n");} while (0)
19#define flush_tlb_kernel_range(s,e) do { printk("flush_tlb_range\n");} while (0)
20
21/*
22 * The following handle the weird MEMC chip
23 */
24static inline void memc_update_all(void)
25{
26 struct task_struct *p;
27 cpu_memc_update_all(init_mm.pgd);
28 for_each_process(p) {
29 if (!p->mm)
30 continue;
31 cpu_memc_update_all(p->mm->pgd);
32 }
33 processor._set_pgd(current->active_mm->pgd);
34}
35
36static inline void memc_update_mm(struct mm_struct *mm)
37{
38 cpu_memc_update_all(mm->pgd);
39
40 if (mm == current->active_mm)
41 processor._set_pgd(mm->pgd);
42}
43
44static inline void
45memc_clear(struct mm_struct *mm, struct page *page)
46{
47 cpu_memc_update_entry(mm->pgd, (unsigned long) page_address(page), 0);
48
49 if (mm == current->active_mm)
50 processor._set_pgd(mm->pgd);
51}
52
53static inline void
54memc_update_addr(struct mm_struct *mm, pte_t pte, unsigned long vaddr)
55{
56 cpu_memc_update_entry(mm->pgd, pte_val(pte), vaddr);
57
58 if (mm == current->active_mm)
59 processor._set_pgd(mm->pgd);
60}
61
62static inline void
63update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
64{
65 struct mm_struct *mm = vma->vm_mm;
66printk("update_mmu_cache\n");
67 memc_update_addr(mm, pte, addr);
68}
69
70#endif
diff --git a/include/asm-arm26/topology.h b/include/asm-arm26/topology.h
new file mode 100644
index 000000000000..accbd7cad9b5
--- /dev/null
+++ b/include/asm-arm26/topology.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_ARM_TOPOLOGY_H
2#define _ASM_ARM_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_ARM_TOPOLOGY_H */
diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h
new file mode 100644
index 000000000000..56cbe573a234
--- /dev/null
+++ b/include/asm-arm26/types.h
@@ -0,0 +1,61 @@
1#ifndef __ASM_ARM_TYPES_H
2#define __ASM_ARM_TYPES_H
3
4#ifndef __ASSEMBLY__
5
6typedef unsigned short umode_t;
7
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
23typedef __signed__ long long __s64;
24typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */
28
29/*
30 * These aren't exported outside the kernel to avoid name space clashes
31 */
32#ifdef __KERNEL__
33
34#define BITS_PER_LONG 32
35
36#ifndef __ASSEMBLY__
37
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide. */
51
52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t;
54
55typedef unsigned int kmem_bufctl_t;
56
57#endif /* __ASSEMBLY__ */
58
59#endif /* __KERNEL__ */
60
61#endif
diff --git a/include/asm-arm26/uaccess-asm.h b/include/asm-arm26/uaccess-asm.h
new file mode 100644
index 000000000000..19f798e338c9
--- /dev/null
+++ b/include/asm-arm26/uaccess-asm.h
@@ -0,0 +1,153 @@
1/*
2 * linux/include/asm-arm/proc-armo/uaccess.h
3 *
4 * Copyright (C) 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*
12 * The fs functions are implemented on the ARM2 and ARM3 architectures
13 * manually.
14 * Use *_user functions to access user memory with faulting behaving
15 * as though the user is accessing the memory.
16 * Use set_fs(get_ds()) and then the *_user functions to allow them to
17 * access kernel memory.
18 */
19
20/*
21 * These are the values used to represent the user `fs' and the kernel `ds'
22 * FIXME - the KERNEL_DS should end at 0x03000000 but we want to access ROM at
23 * 0x03400000. ideally we want to forbid access to the IO space inbetween.
24 */
25#define KERNEL_DS 0x03FFFFFF
26#define USER_DS 0x02000000
27
28extern uaccess_t uaccess_user, uaccess_kernel;
29
30static inline void set_fs (mm_segment_t fs)
31{
32 current_thread_info()->addr_limit = fs;
33 current->thread.uaccess = (fs == USER_DS ? &uaccess_user : &uaccess_kernel);
34}
35
36#define __range_ok(addr,size) ({ \
37 unsigned long flag, sum; \
38 __asm__ __volatile__("subs %1, %0, %3; cmpcs %1, %2; movcs %0, #0" \
39 : "=&r" (flag), "=&r" (sum) \
40 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
41 : "cc"); \
42 flag; })
43
44#define __addr_ok(addr) ({ \
45 unsigned long flag; \
46 __asm__ __volatile__("cmp %2, %0; movlo %0, #0" \
47 : "=&r" (flag) \
48 : "0" (current_thread_info()->addr_limit), "r" (addr) \
49 : "cc"); \
50 (flag == 0); })
51
52#define __put_user_asm_byte(x,addr,err) \
53 __asm__ __volatile__( \
54 " mov r0, %1\n" \
55 " mov r1, %2\n" \
56 " mov r2, %0\n" \
57 " mov lr, pc\n" \
58 " mov pc, %3\n" \
59 " mov %0, r2\n" \
60 : "=r" (err) \
61 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_byte), \
62 "0" (err) \
63 : "r0", "r1", "r2", "lr")
64
65#define __put_user_asm_half(x,addr,err) \
66 __asm__ __volatile__( \
67 " mov r0, %1\n" \
68 " mov r1, %2\n" \
69 " mov r2, %0\n" \
70 " mov lr, pc\n" \
71 " mov pc, %3\n" \
72 " mov %0, r2\n" \
73 : "=r" (err) \
74 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_half), \
75 "0" (err) \
76 : "r0", "r1", "r2", "lr")
77
78#define __put_user_asm_word(x,addr,err) \
79 __asm__ __volatile__( \
80 " mov r0, %1\n" \
81 " mov r1, %2\n" \
82 " mov r2, %0\n" \
83 " mov lr, pc\n" \
84 " mov pc, %3\n" \
85 " mov %0, r2\n" \
86 : "=r" (err) \
87 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_word), \
88 "0" (err) \
89 : "r0", "r1", "r2", "lr")
90
91#define __put_user_asm_dword(x,addr,err) \
92 __asm__ __volatile__( \
93 " mov r0, %1\n" \
94 " mov r1, %2\n" \
95 " mov r2, %0\n" \
96 " mov lr, pc\n" \
97 " mov pc, %3\n" \
98 " mov %0, r2\n" \
99 : "=r" (err) \
100 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_dword), \
101 "0" (err) \
102 : "r0", "r1", "r2", "lr")
103
104#define __get_user_asm_byte(x,addr,err) \
105 __asm__ __volatile__( \
106 " mov r0, %2\n" \
107 " mov r1, %0\n" \
108 " mov lr, pc\n" \
109 " mov pc, %3\n" \
110 " mov %0, r1\n" \
111 " mov %1, r0\n" \
112 : "=r" (err), "=r" (x) \
113 : "r" (addr), "r" (current->thread.uaccess->get_byte), "0" (err) \
114 : "r0", "r1", "r2", "lr")
115
116#define __get_user_asm_half(x,addr,err) \
117 __asm__ __volatile__( \
118 " mov r0, %2\n" \
119 " mov r1, %0\n" \
120 " mov lr, pc\n" \
121 " mov pc, %3\n" \
122 " mov %0, r1\n" \
123 " mov %1, r0\n" \
124 : "=r" (err), "=r" (x) \
125 : "r" (addr), "r" (current->thread.uaccess->get_half), "0" (err) \
126 : "r0", "r1", "r2", "lr")
127
128#define __get_user_asm_word(x,addr,err) \
129 __asm__ __volatile__( \
130 " mov r0, %2\n" \
131 " mov r1, %0\n" \
132 " mov lr, pc\n" \
133 " mov pc, %3\n" \
134 " mov %0, r1\n" \
135 " mov %1, r0\n" \
136 : "=r" (err), "=r" (x) \
137 : "r" (addr), "r" (current->thread.uaccess->get_word), "0" (err) \
138 : "r0", "r1", "r2", "lr")
139
140#define __do_copy_from_user(to,from,n) \
141 (n) = current->thread.uaccess->copy_from_user((to),(from),(n))
142
143#define __do_copy_to_user(to,from,n) \
144 (n) = current->thread.uaccess->copy_to_user((to),(from),(n))
145
146#define __do_clear_user(addr,sz) \
147 (sz) = current->thread.uaccess->clear_user((addr),(sz))
148
149#define __do_strncpy_from_user(dst,src,count,res) \
150 (res) = current->thread.uaccess->strncpy_from_user(dst,src,count)
151
152#define __do_strnlen_user(s,n,res) \
153 (res) = current->thread.uaccess->strnlen_user(s,n)
diff --git a/include/asm-arm26/uaccess.h b/include/asm-arm26/uaccess.h
new file mode 100644
index 000000000000..ab9ce38c6aec
--- /dev/null
+++ b/include/asm-arm26/uaccess.h
@@ -0,0 +1,299 @@
1#ifndef _ASMARM_UACCESS_H
2#define _ASMARM_UACCESS_H
3
4/*
5 * User space memory access functions
6 */
7#include <linux/sched.h>
8#include <asm/errno.h>
9
10#define VERIFY_READ 0
11#define VERIFY_WRITE 1
12
13/*
14 * The exception table consists of pairs of addresses: the first is the
15 * address of an instruction that is allowed to fault, and the second is
16 * the address at which the program should continue. No registers are
17 * modified, so it is entirely up to the continuation code to figure out
18 * what to do.
19 *
20 * All the routines below use bits of fixup code that are out of line
21 * with the main instruction path. This means when everything is well,
22 * we don't even have to jump over them. Further, they do not intrude
23 * on our cache or tlb entries.
24 */
25
26struct exception_table_entry
27{
28 unsigned long insn, fixup;
29};
30
31/* Returns 0 if exception not found and fixup otherwise. */
32extern unsigned long search_exception_table(unsigned long);
33extern int fixup_exception(struct pt_regs *regs);
34
35#define get_ds() (KERNEL_DS)
36#define get_fs() (current_thread_info()->addr_limit)
37#define segment_eq(a,b) ((a) == (b))
38
39#include <asm/uaccess-asm.h>
40
41#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
42
43/* this function will go away soon - use access_ok() instead */
44static inline int __deprecated verify_area(int type, const void * addr, unsigned long size)
45{
46 return access_ok(type, addr, size) ? 0 : -EFAULT;
47}
48
49/*
50 * Single-value transfer routines. They automatically use the right
51 * size if we just have the right pointer type. Note that the functions
52 * which read from user space (*get_*) need to take care not to leak
53 * kernel data even if the calling code is buggy and fails to check
54 * the return value. This means zeroing out the destination variable
55 * or buffer on error. Normally this is done out of line by the
56 * fixup code, but there are a few places where it intrudes on the
57 * main code path. When we only write to user space, there is no
58 * problem.
59 *
60 * The "__xxx" versions of the user access functions do not verify the
61 * address space - it must have been done previously with a separate
62 * "access_ok()" call.
63 *
64 * The "xxx_error" versions set the third argument to EFAULT if an
65 * error occurs, and leave it unchanged on success. Note that these
66 * versions are void (ie, don't return a value as such).
67 */
68
69extern int __get_user_1(void *);
70extern int __get_user_2(void *);
71extern int __get_user_4(void *);
72extern int __get_user_8(void *);
73extern int __get_user_bad(void);
74
75#define __get_user_x(__r1,__p,__e,__s,__i...) \
76 __asm__ __volatile__ ("bl __get_user_" #__s \
77 : "=&r" (__e), "=r" (__r1) \
78 : "0" (__p) \
79 : __i)
80
81#define get_user(x,p) \
82 ({ \
83 const register typeof(*(p)) *__p asm("r0") = (p); \
84 register typeof(*(p)) __r1 asm("r1"); \
85 register int __e asm("r0"); \
86 switch (sizeof(*(p))) { \
87 case 1: \
88 __get_user_x(__r1, __p, __e, 1, "lr"); \
89 break; \
90 case 2: \
91 __get_user_x(__r1, __p, __e, 2, "r2", "lr"); \
92 break; \
93 case 4: \
94 __get_user_x(__r1, __p, __e, 4, "lr"); \
95 break; \
96 case 8: \
97 __get_user_x(__r1, __p, __e, 8, "lr"); \
98 break; \
99 default: __e = __get_user_bad(); break; \
100 } \
101 x = __r1; \
102 __e; \
103 })
104
105
106#define __get_user(x,ptr) \
107({ \
108 long __gu_err = 0; \
109 __get_user_err((x),(ptr),__gu_err); \
110 __gu_err; \
111})
112
113#define __get_user_error(x,ptr,err) \
114({ \
115 __get_user_err((x),(ptr),err); \
116 (void) 0; \
117})
118
119#define __get_user_err(x,ptr,err) \
120do { \
121 unsigned long __gu_addr = (unsigned long)(ptr); \
122 unsigned long __gu_val; \
123 switch (sizeof(*(ptr))) { \
124 case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \
125 case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \
126 case 4: __get_user_asm_word(__gu_val,__gu_addr,err); break; \
127 default: (__gu_val) = __get_user_bad(); \
128 } \
129 (x) = (__typeof__(*(ptr)))__gu_val; \
130} while (0)
131
132extern int __put_user_1(void *, unsigned int);
133extern int __put_user_2(void *, unsigned int);
134extern int __put_user_4(void *, unsigned int);
135extern int __put_user_8(void *, unsigned long long);
136extern int __put_user_bad(void);
137
138#define __put_user_x(__r1,__p,__e,__s) \
139 __asm__ __volatile__ ( \
140 __asmeq("%0", "r0") __asmeq("%2", "r1") \
141 "bl __put_user_" #__s \
142 : "=&r" (__e) \
143 : "0" (__p), "r" (__r1) \
144 : "ip", "lr", "cc")
145
146#define put_user(x,p) \
147 ({ \
148 const register typeof(*(p)) __r1 asm("r1") = (x); \
149 const register typeof(*(p)) *__p asm("r0") = (p); \
150 register int __e asm("r0"); \
151 switch (sizeof(*(__p))) { \
152 case 1: \
153 __put_user_x(__r1, __p, __e, 1); \
154 break; \
155 case 2: \
156 __put_user_x(__r1, __p, __e, 2); \
157 break; \
158 case 4: \
159 __put_user_x(__r1, __p, __e, 4); \
160 break; \
161 case 8: \
162 __put_user_x(__r1, __p, __e, 8); \
163 break; \
164 default: __e = __put_user_bad(); break; \
165 } \
166 __e; \
167 })
168
169#if 0
170/********************* OLD METHOD *******************/
171#define __put_user_x(__r1,__p,__e,__s,__i...) \
172 __asm__ __volatile__ ("bl __put_user_" #__s \
173 : "=&r" (__e) \
174 : "0" (__p), "r" (__r1) \
175 : __i)
176
177#define put_user(x,p) \
178 ({ \
179 const register typeof(*(p)) __r1 asm("r1") = (x); \
180 const register typeof(*(p)) *__p asm("r0") = (p); \
181 register int __e asm("r0"); \
182 switch (sizeof(*(p))) { \
183 case 1: \
184 __put_user_x(__r1, __p, __e, 1, "r2", "lr"); \
185 break; \
186 case 2: \
187 __put_user_x(__r1, __p, __e, 2, "r2", "lr"); \
188 break; \
189 case 4: \
190 __put_user_x(__r1, __p, __e, 4, "r2", "lr"); \
191 break; \
192 case 8: \
193 __put_user_x(__r1, __p, __e, 8, "r2", "ip", "lr"); \
194 break; \
195 default: __e = __put_user_bad(); break; \
196 } \
197 __e; \
198 })
199/*************************************************/
200#endif
201
202#define __put_user(x,ptr) \
203({ \
204 long __pu_err = 0; \
205 __put_user_err((x),(ptr),__pu_err); \
206 __pu_err; \
207})
208
209#define __put_user_error(x,ptr,err) \
210({ \
211 __put_user_err((x),(ptr),err); \
212 (void) 0; \
213})
214
215#define __put_user_err(x,ptr,err) \
216do { \
217 unsigned long __pu_addr = (unsigned long)(ptr); \
218 __typeof__(*(ptr)) __pu_val = (x); \
219 switch (sizeof(*(ptr))) { \
220 case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \
221 case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
222 case 4: __put_user_asm_word(__pu_val,__pu_addr,err); break; \
223 case 8: __put_user_asm_dword(__pu_val,__pu_addr,err); break; \
224 default: __put_user_bad(); \
225 } \
226} while (0)
227
228static __inline__ unsigned long copy_from_user(void *to, const void *from, unsigned long n)
229{
230 if (access_ok(VERIFY_READ, from, n))
231 __do_copy_from_user(to, from, n);
232 else /* security hole - plug it */
233 memzero(to, n);
234 return n;
235}
236
237static __inline__ unsigned long __copy_from_user(void *to, const void *from, unsigned long n)
238{
239 __do_copy_from_user(to, from, n);
240 return n;
241}
242
243static __inline__ unsigned long copy_to_user(void *to, const void *from, unsigned long n)
244{
245 if (access_ok(VERIFY_WRITE, to, n))
246 __do_copy_to_user(to, from, n);
247 return n;
248}
249
250static __inline__ unsigned long __copy_to_user(void *to, const void *from, unsigned long n)
251{
252 __do_copy_to_user(to, from, n);
253 return n;
254}
255
256#define __copy_to_user_inatomic __copy_to_user
257#define __copy_from_user_inatomic __copy_from_user
258
259static __inline__ unsigned long clear_user (void *to, unsigned long n)
260{
261 if (access_ok(VERIFY_WRITE, to, n))
262 __do_clear_user(to, n);
263 return n;
264}
265
266static __inline__ unsigned long __clear_user (void *to, unsigned long n)
267{
268 __do_clear_user(to, n);
269 return n;
270}
271
272static __inline__ long strncpy_from_user (char *dst, const char *src, long count)
273{
274 long res = -EFAULT;
275 if (access_ok(VERIFY_READ, src, 1))
276 __do_strncpy_from_user(dst, src, count, res);
277 return res;
278}
279
280static __inline__ long __strncpy_from_user (char *dst, const char *src, long count)
281{
282 long res;
283 __do_strncpy_from_user(dst, src, count, res);
284 return res;
285}
286
287#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
288
289static inline long strnlen_user(const char *s, long n)
290{
291 unsigned long res = 0;
292
293 if (__addr_ok(s))
294 __do_strnlen_user(s, n, res);
295
296 return res;
297}
298
299#endif /* _ASMARM_UACCESS_H */
diff --git a/include/asm-arm26/ucontext.h b/include/asm-arm26/ucontext.h
new file mode 100644
index 000000000000..f853130137cc
--- /dev/null
+++ b/include/asm-arm26/ucontext.h
@@ -0,0 +1,12 @@
1#ifndef _ASMARM_UCONTEXT_H
2#define _ASMARM_UCONTEXT_H
3
4struct ucontext {
5 unsigned long uc_flags;
6 struct ucontext *uc_link;
7 stack_t uc_stack;
8 struct sigcontext uc_mcontext;
9 sigset_t uc_sigmask; /* mask last for extensibility */
10};
11
12#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/include/asm-arm26/unaligned.h b/include/asm-arm26/unaligned.h
new file mode 100644
index 000000000000..d992782089fd
--- /dev/null
+++ b/include/asm-arm26/unaligned.h
@@ -0,0 +1,118 @@
1#ifndef __ASM_ARM_UNALIGNED_H
2#define __ASM_ARM_UNALIGNED_H
3
4#include <asm/types.h>
5
6extern int __bug_unaligned_x(void *ptr);
7
8/*
9 * What is the most efficient way of loading/storing an unaligned value?
10 *
11 * That is the subject of this file. Efficiency here is defined as
12 * minimum code size with minimum register usage for the common cases.
13 * It is currently not believed that long longs are common, so we
14 * trade efficiency for the chars, shorts and longs against the long
15 * longs.
16 *
17 * Current stats with gcc 2.7.2.2 for these functions:
18 *
19 * ptrsize get: code regs put: code regs
20 * 1 1 1 1 2
21 * 2 3 2 3 2
22 * 4 7 3 7 3
23 * 8 20 6 16 6
24 *
25 * gcc 2.95.1 seems to code differently:
26 *
27 * ptrsize get: code regs put: code regs
28 * 1 1 1 1 2
29 * 2 3 2 3 2
30 * 4 7 4 7 4
31 * 8 19 8 15 6
32 *
33 * which may or may not be more efficient (depending upon whether
34 * you can afford the extra registers). Hopefully the gcc 2.95
35 * is inteligent enough to decide if it is better to use the
36 * extra register, but evidence so far seems to suggest otherwise.
37 *
38 * Unfortunately, gcc is not able to optimise the high word
39 * out of long long >> 32, or the low word from long long << 32
40 */
41
42#define __get_unaligned_2_le(__p) \
43 (__p[0] | __p[1] << 8)
44
45#define __get_unaligned_4_le(__p) \
46 (__p[0] | __p[1] << 8 | __p[2] << 16 | __p[3] << 24)
47
48#define __get_unaligned_le(ptr) \
49 ({ \
50 __typeof__(*(ptr)) __v; \
51 __u8 *__p = (__u8 *)(ptr); \
52 switch (sizeof(*(ptr))) { \
53 case 1: __v = *(ptr); break; \
54 case 2: __v = __get_unaligned_2_le(__p); break; \
55 case 4: __v = __get_unaligned_4_le(__p); break; \
56 case 8: { \
57 unsigned int __v1, __v2; \
58 __v2 = __get_unaligned_4_le((__p+4)); \
59 __v1 = __get_unaligned_4_le(__p); \
60 __v = ((unsigned long long)__v2 << 32 | __v1); \
61 } \
62 break; \
63 default: __v = __bug_unaligned_x(__p); break; \
64 } \
65 __v; \
66 })
67
68static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p)
69{
70 *__p++ = __v;
71 *__p++ = __v >> 8;
72}
73
74static inline void __put_unaligned_4_le(__u32 __v, register __u8 *__p)
75{
76 __put_unaligned_2_le(__v >> 16, __p + 2);
77 __put_unaligned_2_le(__v, __p);
78}
79
80static inline void __put_unaligned_8_le(const unsigned long long __v, register __u8 *__p)
81{
82 /*
83 * tradeoff: 8 bytes of stack for all unaligned puts (2
84 * instructions), or an extra register in the long long
85 * case - go for the extra register.
86 */
87 __put_unaligned_4_le(__v >> 32, __p+4);
88 __put_unaligned_4_le(__v, __p);
89}
90
91/*
92 * Try to store an unaligned value as efficiently as possible.
93 */
94#define __put_unaligned_le(val,ptr) \
95 ({ \
96 switch (sizeof(*(ptr))) { \
97 case 1: \
98 *(ptr) = (val); \
99 break; \
100 case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); \
101 break; \
102 case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); \
103 break; \
104 case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); \
105 break; \
106 default: __bug_unaligned_x(ptr); \
107 break; \
108 } \
109 (void) 0; \
110 })
111
112/*
113 * Select endianness
114 */
115#define get_unaligned __get_unaligned_le
116#define put_unaligned __put_unaligned_le
117
118#endif
diff --git a/include/asm-arm26/uncompress.h b/include/asm-arm26/uncompress.h
new file mode 100644
index 000000000000..df2cba816a4e
--- /dev/null
+++ b/include/asm-arm26/uncompress.h
@@ -0,0 +1,111 @@
1/*
2 * linux/include/asm-arm/arch-arc/uncompress.h
3 *
4 * Copyright (C) 1996 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#define VIDMEM ((char *)0x02000000)
11
12int video_num_columns, video_num_lines, video_size_row;
13int white, bytes_per_char_h;
14extern unsigned long con_charconvtable[256];
15
16struct param_struct {
17 unsigned long page_size;
18 unsigned long nr_pages;
19 unsigned long ramdisk_size;
20 unsigned long mountrootrdonly;
21 unsigned long rootdev;
22 unsigned long video_num_cols;
23 unsigned long video_num_rows;
24 unsigned long video_x;
25 unsigned long video_y;
26 unsigned long memc_control_reg;
27 unsigned char sounddefault;
28 unsigned char adfsdrives;
29 unsigned char bytes_per_char_h;
30 unsigned char bytes_per_char_v;
31 unsigned long unused[256/4-11];
32};
33
34static struct param_struct *params = (struct param_struct *)0x0207c000;
35
36/*
37 * This does not append a newline
38 */
39static void puts(const char *s)
40{
41 extern void ll_write_char(char *, unsigned long);
42 int x,y;
43 unsigned char c;
44 char *ptr;
45
46 x = params->video_x;
47 y = params->video_y;
48
49 while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
50 if ( c == '\n' ) {
51 x = 0;
52 if ( ++y >= video_num_lines ) {
53 y--;
54 }
55 } else {
56 ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
57 ll_write_char(ptr, c|(white<<16));
58 if ( ++x >= video_num_columns ) {
59 x = 0;
60 if ( ++y >= video_num_lines ) {
61 y--;
62 }
63 }
64 }
65 }
66
67 params->video_x = x;
68 params->video_y = y;
69}
70
71static void error(char *x);
72
73/*
74 * Setup for decompression
75 */
76static void arch_decomp_setup(void)
77{
78 int i;
79
80 video_num_lines = params->video_num_rows;
81 video_num_columns = params->video_num_cols;
82 bytes_per_char_h = params->bytes_per_char_h;
83 video_size_row = video_num_columns * bytes_per_char_h;
84 if (bytes_per_char_h == 4)
85 for (i = 0; i < 256; i++)
86 con_charconvtable[i] =
87 (i & 128 ? 1 << 0 : 0) |
88 (i & 64 ? 1 << 4 : 0) |
89 (i & 32 ? 1 << 8 : 0) |
90 (i & 16 ? 1 << 12 : 0) |
91 (i & 8 ? 1 << 16 : 0) |
92 (i & 4 ? 1 << 20 : 0) |
93 (i & 2 ? 1 << 24 : 0) |
94 (i & 1 ? 1 << 28 : 0);
95 else
96 for (i = 0; i < 16; i++)
97 con_charconvtable[i] =
98 (i & 8 ? 1 << 0 : 0) |
99 (i & 4 ? 1 << 8 : 0) |
100 (i & 2 ? 1 << 16 : 0) |
101 (i & 1 ? 1 << 24 : 0);
102
103 white = bytes_per_char_h == 8 ? 0xfc : 7;
104
105 if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
106}
107
108/*
109 * nothing to do
110 */
111#define arch_decomp_wdog()
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h
new file mode 100644
index 000000000000..dfa0b0c30aa3
--- /dev/null
+++ b/include/asm-arm26/unistd.h
@@ -0,0 +1,500 @@
1/*
2 * linux/include/asm-arm/unistd.h
3 *
4 * Copyright (C) 2001-2003 Russell King
5 * Modified 25/11/04 Ian Molton for arm26.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Please forward _all_ changes to this file to spyro@f2s.com
12 * no matter what the change is. Thanks!
13 */
14#ifndef __ASM_ARM_UNISTD_H
15#define __ASM_ARM_UNISTD_H
16
17#include <linux/linkage.h>
18
19#define __NR_SYSCALL_BASE 0x900000
20
21/*
22 * This file contains the system call numbers.
23 */
24
25#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
26#define __NR_exit (__NR_SYSCALL_BASE+ 1)
27#define __NR_fork (__NR_SYSCALL_BASE+ 2)
28#define __NR_read (__NR_SYSCALL_BASE+ 3)
29#define __NR_write (__NR_SYSCALL_BASE+ 4)
30#define __NR_open (__NR_SYSCALL_BASE+ 5)
31#define __NR_close (__NR_SYSCALL_BASE+ 6)
32 /* 7 was sys_waitpid */
33#define __NR_creat (__NR_SYSCALL_BASE+ 8)
34#define __NR_link (__NR_SYSCALL_BASE+ 9)
35#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
36#define __NR_execve (__NR_SYSCALL_BASE+ 11)
37#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
38#define __NR_time (__NR_SYSCALL_BASE+ 13)
39#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
40#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
41#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
42 /* 17 was sys_break */
43 /* 18 was sys_stat */
44#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
45#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
46#define __NR_mount (__NR_SYSCALL_BASE+ 21)
47#define __NR_umount (__NR_SYSCALL_BASE+ 22)
48#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
49#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
50#define __NR_stime (__NR_SYSCALL_BASE+ 25)
51#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
52#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
53 /* 28 was sys_fstat */
54#define __NR_pause (__NR_SYSCALL_BASE+ 29)
55#define __NR_utime (__NR_SYSCALL_BASE+ 30)
56 /* 31 was sys_stty */
57 /* 32 was sys_gtty */
58#define __NR_access (__NR_SYSCALL_BASE+ 33)
59#define __NR_nice (__NR_SYSCALL_BASE+ 34)
60 /* 35 was sys_ftime */
61#define __NR_sync (__NR_SYSCALL_BASE+ 36)
62#define __NR_kill (__NR_SYSCALL_BASE+ 37)
63#define __NR_rename (__NR_SYSCALL_BASE+ 38)
64#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
65#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
66#define __NR_dup (__NR_SYSCALL_BASE+ 41)
67#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
68#define __NR_times (__NR_SYSCALL_BASE+ 43)
69 /* 44 was sys_prof */
70#define __NR_brk (__NR_SYSCALL_BASE+ 45)
71#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
72#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
73 /* 48 was sys_signal */
74#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
75#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
76#define __NR_acct (__NR_SYSCALL_BASE+ 51)
77#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
78 /* 53 was sys_lock */
79#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
80#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
81 /* 56 was sys_mpx */
82#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
83 /* 58 was sys_ulimit */
84 /* 59 was sys_olduname */
85#define __NR_umask (__NR_SYSCALL_BASE+ 60)
86#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
87#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
88#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
89#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
90#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
91#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
92#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
93 /* 68 was sys_sgetmask */
94 /* 69 was sys_ssetmask */
95#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
96#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
97#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
98#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
99#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
100#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
101#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
102#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
103#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
104#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
105#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
106#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
107#define __NR_select (__NR_SYSCALL_BASE+ 82)
108#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
109 /* 84 was sys_lstat */
110#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
111#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
112#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
113#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
114#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
115#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
116#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
117#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
118#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
119#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
120#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
121#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
122#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
123 /* 98 was sys_profil */
124#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
125#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
126 /* 101 was sys_ioperm */
127#define __NR_socketcall (__NR_SYSCALL_BASE+102)
128#define __NR_syslog (__NR_SYSCALL_BASE+103)
129#define __NR_setitimer (__NR_SYSCALL_BASE+104)
130#define __NR_getitimer (__NR_SYSCALL_BASE+105)
131#define __NR_stat (__NR_SYSCALL_BASE+106)
132#define __NR_lstat (__NR_SYSCALL_BASE+107)
133#define __NR_fstat (__NR_SYSCALL_BASE+108)
134 /* 109 was sys_uname */
135 /* 110 was sys_iopl */
136#define __NR_vhangup (__NR_SYSCALL_BASE+111)
137 /* 112 was sys_idle */
138#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
139#define __NR_wait4 (__NR_SYSCALL_BASE+114)
140#define __NR_swapoff (__NR_SYSCALL_BASE+115)
141#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
142#define __NR_ipc (__NR_SYSCALL_BASE+117)
143#define __NR_fsync (__NR_SYSCALL_BASE+118)
144#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
145#define __NR_clone (__NR_SYSCALL_BASE+120)
146#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
147#define __NR_uname (__NR_SYSCALL_BASE+122)
148 /* 123 was sys_modify_ldt */
149#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
150#define __NR_mprotect (__NR_SYSCALL_BASE+125)
151#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
152 /* 127 was sys_create_module */
153#define __NR_init_module (__NR_SYSCALL_BASE+128)
154#define __NR_delete_module (__NR_SYSCALL_BASE+129)
155 /* 130 was sys_get_kernel_syms */
156#define __NR_quotactl (__NR_SYSCALL_BASE+131)
157#define __NR_getpgid (__NR_SYSCALL_BASE+132)
158#define __NR_fchdir (__NR_SYSCALL_BASE+133)
159#define __NR_bdflush (__NR_SYSCALL_BASE+134)
160#define __NR_sysfs (__NR_SYSCALL_BASE+135)
161#define __NR_personality (__NR_SYSCALL_BASE+136)
162 /* 137 was sys_afs_syscall */
163#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
164#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
165#define __NR__llseek (__NR_SYSCALL_BASE+140)
166#define __NR_getdents (__NR_SYSCALL_BASE+141)
167#define __NR__newselect (__NR_SYSCALL_BASE+142)
168#define __NR_flock (__NR_SYSCALL_BASE+143)
169#define __NR_msync (__NR_SYSCALL_BASE+144)
170#define __NR_readv (__NR_SYSCALL_BASE+145)
171#define __NR_writev (__NR_SYSCALL_BASE+146)
172#define __NR_getsid (__NR_SYSCALL_BASE+147)
173#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
174#define __NR__sysctl (__NR_SYSCALL_BASE+149)
175#define __NR_mlock (__NR_SYSCALL_BASE+150)
176#define __NR_munlock (__NR_SYSCALL_BASE+151)
177#define __NR_mlockall (__NR_SYSCALL_BASE+152)
178#define __NR_munlockall (__NR_SYSCALL_BASE+153)
179#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
180#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
181#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
182#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
183#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
184#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
185#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
186#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
187#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
188#define __NR_mremap (__NR_SYSCALL_BASE+163)
189#define __NR_setresuid (__NR_SYSCALL_BASE+164)
190#define __NR_getresuid (__NR_SYSCALL_BASE+165)
191 /* 166 was sys_vm86 */
192 /* 167 was sys_query_module */
193#define __NR_poll (__NR_SYSCALL_BASE+168)
194#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
195#define __NR_setresgid (__NR_SYSCALL_BASE+170)
196#define __NR_getresgid (__NR_SYSCALL_BASE+171)
197#define __NR_prctl (__NR_SYSCALL_BASE+172)
198#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
199#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
200#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
201#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
202#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
203#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
204#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
205#define __NR_pread64 (__NR_SYSCALL_BASE+180)
206#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
207#define __NR_chown (__NR_SYSCALL_BASE+182)
208#define __NR_getcwd (__NR_SYSCALL_BASE+183)
209#define __NR_capget (__NR_SYSCALL_BASE+184)
210#define __NR_capset (__NR_SYSCALL_BASE+185)
211#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
212#define __NR_sendfile (__NR_SYSCALL_BASE+187)
213 /* 188 reserved */
214 /* 189 reserved */
215#define __NR_vfork (__NR_SYSCALL_BASE+190)
216#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
217#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
218#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
219#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
220#define __NR_stat64 (__NR_SYSCALL_BASE+195)
221#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
222#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
223#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
224#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
225#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
226#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
227#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
228#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
229#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
230#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
231#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
232#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
233#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
234#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
235#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
236#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
237#define __NR_chown32 (__NR_SYSCALL_BASE+212)
238#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
239#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
240#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
241#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
242#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
243#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
244#define __NR_mincore (__NR_SYSCALL_BASE+219)
245#define __NR_madvise (__NR_SYSCALL_BASE+220)
246#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
247 /* 222 for tux */
248 /* 223 is unused */
249#define __NR_gettid (__NR_SYSCALL_BASE+224)
250#define __NR_readahead (__NR_SYSCALL_BASE+225)
251#define __NR_setxattr (__NR_SYSCALL_BASE+226)
252#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
253#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
254#define __NR_getxattr (__NR_SYSCALL_BASE+229)
255#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
256#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
257#define __NR_listxattr (__NR_SYSCALL_BASE+232)
258#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
259#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
260#define __NR_removexattr (__NR_SYSCALL_BASE+235)
261#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
262#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
263#define __NR_tkill (__NR_SYSCALL_BASE+238)
264#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
265#define __NR_futex (__NR_SYSCALL_BASE+240)
266#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
267#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
268#define __NR_io_setup (__NR_SYSCALL_BASE+243)
269#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
270#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
271#define __NR_io_submit (__NR_SYSCALL_BASE+246)
272#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
273#define __NR_exit_group (__NR_SYSCALL_BASE+248)
274#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
275#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
276#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
277#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
278#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
279 /* 254 for set_thread_area */
280 /* 255 for get_thread_area */
281 /* 256 for set_tid_address */
282#define __NR_timer_create (__NR_SYSCALL_BASE+257)
283#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
284#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
285#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
286#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
287#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
288#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
289#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
290#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
291#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
292#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
293#define __NR_tgkill (__NR_SYSCALL_BASE+268)
294#define __NR_utimes (__NR_SYSCALL_BASE+269)
295#define __NR_fadvise64_64 (__NR_SYSCALL_BASE+270)
296#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
297#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
298#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
299#define __NR_mq_open (__NR_SYSCALL_BASE+274)
300#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
301#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
302#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
303#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
304#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
305#define __NR_waitid (__NR_SYSCALL_BASE+280)
306
307/*
308 * The following SWIs are ARM private. FIXME - make appropriate for arm26
309 */
310#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
311#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
312#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
313#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
314
315#define __sys2(x) #x
316#define __sys1(x) __sys2(x)
317
318#ifndef __syscall
319#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
320#endif
321
322#define __syscall_return(type, res) \
323do { \
324 if ((unsigned long)(res) >= (unsigned long)(-125)) { \
325 errno = -(res); \
326 res = -1; \
327 } \
328 return (type) (res); \
329} while (0)
330
331#define _syscall0(type,name) \
332type name(void) { \
333 register long __res_r0 __asm__("r0"); \
334 long __res; \
335 __asm__ __volatile__ ( \
336 __syscall(name) \
337 : "=r" (__res_r0) \
338 : \
339 : "lr"); \
340 __res = __res_r0; \
341 __syscall_return(type,__res); \
342}
343
344#define _syscall1(type,name,type1,arg1) \
345type name(type1 arg1) { \
346 register long __r0 __asm__("r0") = (long)arg1; \
347 register long __res_r0 __asm__("r0"); \
348 long __res; \
349 __asm__ __volatile__ ( \
350 __syscall(name) \
351 : "=r" (__res_r0) \
352 : "r" (__r0) \
353 : "lr"); \
354 __res = __res_r0; \
355 __syscall_return(type,__res); \
356}
357
358#define _syscall2(type,name,type1,arg1,type2,arg2) \
359type name(type1 arg1,type2 arg2) { \
360 register long __r0 __asm__("r0") = (long)arg1; \
361 register long __r1 __asm__("r1") = (long)arg2; \
362 register long __res_r0 __asm__("r0"); \
363 long __res; \
364 __asm__ __volatile__ ( \
365 __syscall(name) \
366 : "=r" (__res_r0) \
367 : "r" (__r0),"r" (__r1) \
368 : "lr"); \
369 __res = __res_r0; \
370 __syscall_return(type,__res); \
371}
372
373
374#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
375type name(type1 arg1,type2 arg2,type3 arg3) { \
376 register long __r0 __asm__("r0") = (long)arg1; \
377 register long __r1 __asm__("r1") = (long)arg2; \
378 register long __r2 __asm__("r2") = (long)arg3; \
379 register long __res_r0 __asm__("r0"); \
380 long __res; \
381 __asm__ __volatile__ ( \
382 __syscall(name) \
383 : "=r" (__res_r0) \
384 : "r" (__r0),"r" (__r1),"r" (__r2) \
385 : "lr"); \
386 __res = __res_r0; \
387 __syscall_return(type,__res); \
388}
389
390
391#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
392type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
393 register long __r0 __asm__("r0") = (long)arg1; \
394 register long __r1 __asm__("r1") = (long)arg2; \
395 register long __r2 __asm__("r2") = (long)arg3; \
396 register long __r3 __asm__("r3") = (long)arg4; \
397 register long __res_r0 __asm__("r0"); \
398 long __res; \
399 __asm__ __volatile__ ( \
400 __syscall(name) \
401 : "=r" (__res_r0) \
402 : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3) \
403 : "lr"); \
404 __res = __res_r0; \
405 __syscall_return(type,__res); \
406}
407
408
409#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
410type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
411 register long __r0 __asm__("r0") = (long)arg1; \
412 register long __r1 __asm__("r1") = (long)arg2; \
413 register long __r2 __asm__("r2") = (long)arg3; \
414 register long __r3 __asm__("r3") = (long)arg4; \
415 register long __r4 __asm__("r4") = (long)arg5; \
416 register long __res_r0 __asm__("r0"); \
417 long __res; \
418 __asm__ __volatile__ ( \
419 __syscall(name) \
420 : "=r" (__res_r0) \
421 : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3),"r" (__r4) \
422 : "lr"); \
423 __res = __res_r0; \
424 __syscall_return(type,__res); \
425}
426
427#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
428type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
429 register long __r0 __asm__("r0") = (long)arg1; \
430 register long __r1 __asm__("r1") = (long)arg2; \
431 register long __r2 __asm__("r2") = (long)arg3; \
432 register long __r3 __asm__("r3") = (long)arg4; \
433 register long __r4 __asm__("r4") = (long)arg5; \
434 register long __r5 __asm__("r5") = (long)arg6; \
435 register long __res_r0 __asm__("r0"); \
436 long __res; \
437 __asm__ __volatile__ ( \
438 __syscall(name) \
439 : "=r" (__res_r0) \
440 : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3), "r" (__r4),"r" (__r5) \
441 : "lr"); \
442 __res = __res_r0; \
443 __syscall_return(type,__res); \
444}
445
446#ifdef __KERNEL__
447#define __ARCH_WANT_IPC_PARSE_VERSION
448#define __ARCH_WANT_OLD_READDIR
449#define __ARCH_WANT_STAT64
450#define __ARCH_WANT_SYS_ALARM
451#define __ARCH_WANT_SYS_GETHOSTNAME
452#define __ARCH_WANT_SYS_PAUSE
453#define __ARCH_WANT_SYS_TIME
454#define __ARCH_WANT_SYS_UTIME
455#define __ARCH_WANT_SYS_SOCKETCALL
456#define __ARCH_WANT_SYS_FADVISE64
457#define __ARCH_WANT_SYS_GETPGRP
458#define __ARCH_WANT_SYS_LLSEEK
459#define __ARCH_WANT_SYS_NICE
460#define __ARCH_WANT_SYS_OLD_GETRLIMIT
461#define __ARCH_WANT_SYS_OLDUMOUNT
462#define __ARCH_WANT_SYS_SIGPENDING
463#define __ARCH_WANT_SYS_SIGPROCMASK
464#define __ARCH_WANT_SYS_RT_SIGACTION
465#endif
466
467#ifdef __KERNEL_SYSCALLS__
468
469#include <linux/compiler.h>
470#include <linux/types.h>
471#include <linux/syscalls.h>
472
473extern long execve(const char *file, char **argv, char **envp);
474
475struct pt_regs;
476asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
477 struct pt_regs *regs);
478asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
479 struct pt_regs *regs);
480asmlinkage int sys_fork(struct pt_regs *regs);
481asmlinkage int sys_vfork(struct pt_regs *regs);
482asmlinkage int sys_pipe(unsigned long *fildes);
483asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
484struct sigaction;
485asmlinkage long sys_rt_sigaction(int sig,
486 const struct sigaction __user *act,
487 struct sigaction __user *oact,
488 size_t sigsetsize);
489
490#endif
491
492/*
493 * "Conditional" syscalls
494 *
495 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
496 * but it doesn't work on all toolchains, so we just do it by hand
497 */
498#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
499
500#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-arm26/user.h b/include/asm-arm26/user.h
new file mode 100644
index 000000000000..3e8b0f879159
--- /dev/null
+++ b/include/asm-arm26/user.h
@@ -0,0 +1,84 @@
1#ifndef _ARM_USER_H
2#define _ARM_USER_H
3
4#include <asm/page.h>
5#include <asm/ptrace.h>
6/* Core file format: The core file is written in such a way that gdb
7 can understand it and provide useful information to the user (under
8 linux we use the 'trad-core' bfd). There are quite a number of
9 obstacles to being able to view the contents of the floating point
10 registers, and until these are solved you will not be able to view the
11 contents of them. Actually, you can read in the core file and look at
12 the contents of the user struct to find out what the floating point
13 registers contain.
14 The actual file contents are as follows:
15 UPAGE: 1 page consisting of a user struct that tells gdb what is present
16 in the file. Directly after this is a copy of the task_struct, which
17 is currently not used by gdb, but it may come in useful at some point.
18 All of the registers are stored as part of the upage. The upage should
19 always be only one page.
20 DATA: The data area is stored. We use current->end_text to
21 current->brk to pick up all of the user variables, plus any memory
22 that may have been malloced. No attempt is made to determine if a page
23 is demand-zero or if a page is totally unused, we just cover the entire
24 range. All of the addresses are rounded in such a way that an integral
25 number of pages is written.
26 STACK: We need the stack information in order to get a meaningful
27 backtrace. We need to write the data from (esp) to
28 current->start_stack, so we round each of these off in order to be able
29 to write an integer number of pages.
30 The minimum core file size is 3 pages, or 12288 bytes.
31*/
32
33struct user_fp {
34 struct fp_reg {
35 unsigned int sign1:1;
36 unsigned int unused:15;
37 unsigned int sign2:1;
38 unsigned int exponent:14;
39 unsigned int j:1;
40 unsigned int mantissa1:31;
41 unsigned int mantissa0:32;
42 } fpregs[8];
43 unsigned int fpsr:32;
44 unsigned int fpcr:32;
45 unsigned char ftype[8];
46 unsigned int init_flag;
47};
48
49/* When the kernel dumps core, it starts by dumping the user struct -
50 this will be used by gdb to figure out where the data and stack segments
51 are within the file, and what virtual addresses to use. */
52struct user{
53/* We start with the registers, to mimic the way that "memory" is returned
54 from the ptrace(3,...) function. */
55 struct pt_regs regs; /* Where the registers are actually stored */
56/* ptrace does not yet supply these. Someday.... */
57 int u_fpvalid; /* True if math co-processor being used. */
58 /* for this mess. Not yet used. */
59/* The rest of this junk is to help gdb figure out what goes where */
60 unsigned long int u_tsize; /* Text segment size (pages). */
61 unsigned long int u_dsize; /* Data segment size (pages). */
62 unsigned long int u_ssize; /* Stack segment size (pages). */
63 unsigned long start_code; /* Starting virtual address of text. */
64 unsigned long start_stack; /* Starting virtual address of stack area.
65 This is actually the bottom of the stack,
66 the top of the stack is always found in the
67 esp register. */
68 long int signal; /* Signal that caused the core dump. */
69 int reserved; /* No longer used */
70 struct pt_regs * u_ar0; /* Used by gdb to help find the values for */
71 /* the registers. */
72 unsigned long magic; /* To uniquely identify a core file */
73 char u_comm[32]; /* User command that was responsible */
74 int u_debugreg[8];
75 struct user_fp u_fp; /* FP state */
76 struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
77 /* the FP registers. */
78};
79#define NBPG PAGE_SIZE
80#define UPAGES 1
81#define HOST_TEXT_START_ADDR (u.start_code)
82#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
83
84#endif /* _ARM_USER_H */
diff --git a/include/asm-arm26/xor.h b/include/asm-arm26/xor.h
new file mode 100644
index 000000000000..e7c4cf58bed1
--- /dev/null
+++ b/include/asm-arm26/xor.h
@@ -0,0 +1,141 @@
1/*
2 * linux/include/asm-arm/xor.h
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <asm-generic/xor.h>
11
12#define __XOR(a1, a2) a1 ^= a2
13
14#define GET_BLOCK_2(dst) \
15 __asm__("ldmia %0, {%1, %2}" \
16 : "=r" (dst), "=r" (a1), "=r" (a2) \
17 : "0" (dst))
18
19#define GET_BLOCK_4(dst) \
20 __asm__("ldmia %0, {%1, %2, %3, %4}" \
21 : "=r" (dst), "=r" (a1), "=r" (a2), "=r" (a3), "=r" (a4) \
22 : "0" (dst))
23
24#define XOR_BLOCK_2(src) \
25 __asm__("ldmia %0!, {%1, %2}" \
26 : "=r" (src), "=r" (b1), "=r" (b2) \
27 : "0" (src)); \
28 __XOR(a1, b1); __XOR(a2, b2);
29
30#define XOR_BLOCK_4(src) \
31 __asm__("ldmia %0!, {%1, %2, %3, %4}" \
32 : "=r" (src), "=r" (b1), "=r" (b2), "=r" (b3), "=r" (b4) \
33 : "0" (src)); \
34 __XOR(a1, b1); __XOR(a2, b2); __XOR(a3, b3); __XOR(a4, b4)
35
36#define PUT_BLOCK_2(dst) \
37 __asm__ __volatile__("stmia %0!, {%2, %3}" \
38 : "=r" (dst) \
39 : "0" (dst), "r" (a1), "r" (a2))
40
41#define PUT_BLOCK_4(dst) \
42 __asm__ __volatile__("stmia %0!, {%2, %3, %4, %5}" \
43 : "=r" (dst) \
44 : "0" (dst), "r" (a1), "r" (a2), "r" (a3), "r" (a4))
45
46static void
47xor_arm4regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
48{
49 unsigned int lines = bytes / sizeof(unsigned long) / 4;
50 register unsigned int a1 __asm__("r4");
51 register unsigned int a2 __asm__("r5");
52 register unsigned int a3 __asm__("r6");
53 register unsigned int a4 __asm__("r7");
54 register unsigned int b1 __asm__("r8");
55 register unsigned int b2 __asm__("r9");
56 register unsigned int b3 __asm__("ip");
57 register unsigned int b4 __asm__("lr");
58
59 do {
60 GET_BLOCK_4(p1);
61 XOR_BLOCK_4(p2);
62 PUT_BLOCK_4(p1);
63 } while (--lines);
64}
65
66static void
67xor_arm4regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
68 unsigned long *p3)
69{
70 unsigned int lines = bytes / sizeof(unsigned long) / 4;
71 register unsigned int a1 __asm__("r4");
72 register unsigned int a2 __asm__("r5");
73 register unsigned int a3 __asm__("r6");
74 register unsigned int a4 __asm__("r7");
75 register unsigned int b1 __asm__("r8");
76 register unsigned int b2 __asm__("r9");
77 register unsigned int b3 __asm__("ip");
78 register unsigned int b4 __asm__("lr");
79
80 do {
81 GET_BLOCK_4(p1);
82 XOR_BLOCK_4(p2);
83 XOR_BLOCK_4(p3);
84 PUT_BLOCK_4(p1);
85 } while (--lines);
86}
87
88static void
89xor_arm4regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
90 unsigned long *p3, unsigned long *p4)
91{
92 unsigned int lines = bytes / sizeof(unsigned long) / 2;
93 register unsigned int a1 __asm__("r8");
94 register unsigned int a2 __asm__("r9");
95 register unsigned int b1 __asm__("ip");
96 register unsigned int b2 __asm__("lr");
97
98 do {
99 GET_BLOCK_2(p1);
100 XOR_BLOCK_2(p2);
101 XOR_BLOCK_2(p3);
102 XOR_BLOCK_2(p4);
103 PUT_BLOCK_2(p1);
104 } while (--lines);
105}
106
107static void
108xor_arm4regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
109 unsigned long *p3, unsigned long *p4, unsigned long *p5)
110{
111 unsigned int lines = bytes / sizeof(unsigned long) / 2;
112 register unsigned int a1 __asm__("r8");
113 register unsigned int a2 __asm__("r9");
114 register unsigned int b1 __asm__("ip");
115 register unsigned int b2 __asm__("lr");
116
117 do {
118 GET_BLOCK_2(p1);
119 XOR_BLOCK_2(p2);
120 XOR_BLOCK_2(p3);
121 XOR_BLOCK_2(p4);
122 XOR_BLOCK_2(p5);
123 PUT_BLOCK_2(p1);
124 } while (--lines);
125}
126
127static struct xor_block_template xor_block_arm4regs = {
128 .name = "arm4regs",
129 .do_2 = xor_arm4regs_2,
130 .do_3 = xor_arm4regs_3,
131 .do_4 = xor_arm4regs_4,
132 .do_5 = xor_arm4regs_5,
133};
134
135#undef XOR_TRY_TEMPLATES
136#define XOR_TRY_TEMPLATES \
137 do { \
138 xor_speed(&xor_block_arm4regs); \
139 xor_speed(&xor_block_8regs); \
140 xor_speed(&xor_block_32regs); \
141 } while (0)