diff options
Diffstat (limited to 'arch/xtensa')
50 files changed, 1801 insertions, 0 deletions
diff --git a/arch/xtensa/boot/ramdisk/Makefile b/arch/xtensa/boot/ramdisk/Makefile new file mode 100644 index 00000000000..b12f7635243 --- /dev/null +++ b/arch/xtensa/boot/ramdisk/Makefile | |||
@@ -0,0 +1,23 @@ | |||
1 | # | ||
2 | # Makefile for a ramdisk image | ||
3 | # | ||
4 | |||
5 | BIG_ENDIAN := $(shell echo -e "\#ifdef __XTENSA_EL__\nint little;\n\#else\nint big;\n\#endif" | $(CC) -E -|grep -c big) | ||
6 | |||
7 | ifeq ($(BIG_ENDIAN),1) | ||
8 | OBJCOPY_ARGS := -O elf32-xtensa-be | ||
9 | else | ||
10 | OBJCOPY_ARGS := -O elf32-xtensa-le | ||
11 | endif | ||
12 | |||
13 | obj-y = ramdisk.o | ||
14 | |||
15 | RAMDISK_IMAGE = arch/$(ARCH)/boot/ramdisk/$(CONFIG_EMBEDDED_RAMDISK_IMAGE) | ||
16 | |||
17 | arch/$(ARCH)/boot/ramdisk/ramdisk.o: | ||
18 | $(Q)echo -e "dummy:" | $(AS) -o $@; | ||
19 | $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) \ | ||
20 | --add-section .initrd=$(RAMDISK_IMAGE) \ | ||
21 | --set-section-flags .initrd=contents,alloc,load,load,data \ | ||
22 | arch/$(ARCH)/boot/ramdisk/ramdisk.o $@ | ||
23 | |||
diff --git a/arch/xtensa/include/asm/auxvec.h b/arch/xtensa/include/asm/auxvec.h new file mode 100644 index 00000000000..257dec75c5a --- /dev/null +++ b/arch/xtensa/include/asm/auxvec.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #ifndef __XTENSA_AUXVEC_H | ||
2 | #define __XTENSA_AUXVEC_H | ||
3 | |||
4 | #endif | ||
diff --git a/arch/xtensa/include/asm/bitsperlong.h b/arch/xtensa/include/asm/bitsperlong.h new file mode 100644 index 00000000000..6dc0bb0c13b --- /dev/null +++ b/arch/xtensa/include/asm/bitsperlong.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/bitsperlong.h> | |||
diff --git a/arch/xtensa/include/asm/bug.h b/arch/xtensa/include/asm/bug.h new file mode 100644 index 00000000000..3e52d72712f --- /dev/null +++ b/arch/xtensa/include/asm/bug.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/bug.h | ||
3 | * | ||
4 | * Macros to cause a 'bug' message. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_BUG_H | ||
14 | #define _XTENSA_BUG_H | ||
15 | |||
16 | #include <asm-generic/bug.h> | ||
17 | |||
18 | #endif /* _XTENSA_BUG_H */ | ||
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/asm/byteorder.h new file mode 100644 index 00000000000..54eb6315349 --- /dev/null +++ b/arch/xtensa/include/asm/byteorder.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _XTENSA_BYTEORDER_H | ||
2 | #define _XTENSA_BYTEORDER_H | ||
3 | |||
4 | #ifdef __XTENSA_EL__ | ||
5 | #include <linux/byteorder/little_endian.h> | ||
6 | #elif defined(__XTENSA_EB__) | ||
7 | #include <linux/byteorder/big_endian.h> | ||
8 | #else | ||
9 | # error processor byte order undefined! | ||
10 | #endif | ||
11 | |||
12 | #endif /* _XTENSA_BYTEORDER_H */ | ||
diff --git a/arch/xtensa/include/asm/cpumask.h b/arch/xtensa/include/asm/cpumask.h new file mode 100644 index 00000000000..ebeede397db --- /dev/null +++ b/arch/xtensa/include/asm/cpumask.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/cpumask.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_CPUMASK_H | ||
12 | #define _XTENSA_CPUMASK_H | ||
13 | |||
14 | #include <asm-generic/cpumask.h> | ||
15 | |||
16 | #endif /* _XTENSA_CPUMASK_H */ | ||
diff --git a/arch/xtensa/include/asm/cputime.h b/arch/xtensa/include/asm/cputime.h new file mode 100644 index 00000000000..a7fb864a50a --- /dev/null +++ b/arch/xtensa/include/asm/cputime.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _XTENSA_CPUTIME_H | ||
2 | #define _XTENSA_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* _XTENSA_CPUTIME_H */ | ||
diff --git a/arch/xtensa/include/asm/device.h b/arch/xtensa/include/asm/device.h new file mode 100644 index 00000000000..d8f9872b0e2 --- /dev/null +++ b/arch/xtensa/include/asm/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/arch/xtensa/include/asm/div64.h b/arch/xtensa/include/asm/div64.h new file mode 100644 index 00000000000..f35678cb0a9 --- /dev/null +++ b/arch/xtensa/include/asm/div64.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/div64.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2007 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_DIV64_H | ||
12 | #define _XTENSA_DIV64_H | ||
13 | |||
14 | #include <asm-generic/div64.h> | ||
15 | |||
16 | #endif /* _XTENSA_DIV64_H */ | ||
diff --git a/arch/xtensa/include/asm/emergency-restart.h b/arch/xtensa/include/asm/emergency-restart.h new file mode 100644 index 00000000000..108d8c48e42 --- /dev/null +++ b/arch/xtensa/include/asm/emergency-restart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/arch/xtensa/include/asm/errno.h b/arch/xtensa/include/asm/errno.h new file mode 100644 index 00000000000..a0f3b96b79b --- /dev/null +++ b/arch/xtensa/include/asm/errno.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/errno.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2002 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_ERRNO_H | ||
12 | #define _XTENSA_ERRNO_H | ||
13 | |||
14 | #include <asm-generic/errno.h> | ||
15 | |||
16 | #endif /* _XTENSA_ERRNO_H */ | ||
diff --git a/arch/xtensa/include/asm/fcntl.h b/arch/xtensa/include/asm/fcntl.h new file mode 100644 index 00000000000..46ab12db573 --- /dev/null +++ b/arch/xtensa/include/asm/fcntl.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/fcntl.h> | |||
diff --git a/arch/xtensa/include/asm/futex.h b/arch/xtensa/include/asm/futex.h new file mode 100644 index 00000000000..0b745828f42 --- /dev/null +++ b/arch/xtensa/include/asm/futex.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/futex.h> | |||
diff --git a/arch/xtensa/include/asm/hardirq.h b/arch/xtensa/include/asm/hardirq.h new file mode 100644 index 00000000000..26664cef8f1 --- /dev/null +++ b/arch/xtensa/include/asm/hardirq.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/hardirq.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2002 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_HARDIRQ_H | ||
12 | #define _XTENSA_HARDIRQ_H | ||
13 | |||
14 | void ack_bad_irq(unsigned int irq); | ||
15 | #define ack_bad_irq ack_bad_irq | ||
16 | |||
17 | #include <asm-generic/hardirq.h> | ||
18 | |||
19 | #endif /* _XTENSA_HARDIRQ_H */ | ||
diff --git a/arch/xtensa/include/asm/ioctl.h b/arch/xtensa/include/asm/ioctl.h new file mode 100644 index 00000000000..b279fe06dfe --- /dev/null +++ b/arch/xtensa/include/asm/ioctl.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/ioctl.h> | |||
diff --git a/arch/xtensa/include/asm/ioctls.h b/arch/xtensa/include/asm/ioctls.h new file mode 100644 index 00000000000..fd1d1369a40 --- /dev/null +++ b/arch/xtensa/include/asm/ioctls.h | |||
@@ -0,0 +1,120 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/ioctls.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2003 - 2005 Tensilica Inc. | ||
9 | * | ||
10 | * Derived from "include/asm-i386/ioctls.h" | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_IOCTLS_H | ||
14 | #define _XTENSA_IOCTLS_H | ||
15 | |||
16 | #include <asm/ioctl.h> | ||
17 | |||
18 | #define FIOCLEX _IO('f', 1) | ||
19 | #define FIONCLEX _IO('f', 2) | ||
20 | #define FIOASYNC _IOW('f', 125, int) | ||
21 | #define FIONBIO _IOW('f', 126, int) | ||
22 | #define FIONREAD _IOR('f', 127, int) | ||
23 | #define TIOCINQ FIONREAD | ||
24 | #define FIOQSIZE _IOR('f', 128, loff_t) | ||
25 | |||
26 | #define TCGETS 0x5401 | ||
27 | #define TCSETS 0x5402 | ||
28 | #define TCSETSW 0x5403 | ||
29 | #define TCSETSF 0x5404 | ||
30 | |||
31 | #define TCGETA _IOR('t', 23, struct termio) | ||
32 | #define TCSETA _IOW('t', 24, struct termio) | ||
33 | #define TCSETAW _IOW('t', 25, struct termio) | ||
34 | #define TCSETAF _IOW('t', 28, struct termio) | ||
35 | |||
36 | #define TCSBRK _IO('t', 29) | ||
37 | #define TCXONC _IO('t', 30) | ||
38 | #define TCFLSH _IO('t', 31) | ||
39 | |||
40 | #define TIOCSWINSZ _IOW('t', 103, struct winsize) | ||
41 | #define TIOCGWINSZ _IOR('t', 104, struct winsize) | ||
42 | #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ | ||
43 | #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ | ||
44 | #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ | ||
45 | |||
46 | #define TIOCSPGRP _IOW('t', 118, int) | ||
47 | #define TIOCGPGRP _IOR('t', 119, int) | ||
48 | |||
49 | #define TIOCEXCL _IO('T', 12) | ||
50 | #define TIOCNXCL _IO('T', 13) | ||
51 | #define TIOCSCTTY _IO('T', 14) | ||
52 | |||
53 | #define TIOCSTI _IOW('T', 18, char) | ||
54 | #define TIOCMGET _IOR('T', 21, unsigned int) | ||
55 | #define TIOCMBIS _IOW('T', 22, unsigned int) | ||
56 | #define TIOCMBIC _IOW('T', 23, unsigned int) | ||
57 | #define TIOCMSET _IOW('T', 24, unsigned int) | ||
58 | # define TIOCM_LE 0x001 | ||
59 | # define TIOCM_DTR 0x002 | ||
60 | # define TIOCM_RTS 0x004 | ||
61 | # define TIOCM_ST 0x008 | ||
62 | # define TIOCM_SR 0x010 | ||
63 | # define TIOCM_CTS 0x020 | ||
64 | # define TIOCM_CAR 0x040 | ||
65 | # define TIOCM_RNG 0x080 | ||
66 | # define TIOCM_DSR 0x100 | ||
67 | # define TIOCM_CD TIOCM_CAR | ||
68 | # define TIOCM_RI TIOCM_RNG | ||
69 | |||
70 | #define TIOCGSOFTCAR _IOR('T', 25, unsigned int) | ||
71 | #define TIOCSSOFTCAR _IOW('T', 26, unsigned int) | ||
72 | #define TIOCLINUX _IOW('T', 28, char) | ||
73 | #define TIOCCONS _IO('T', 29) | ||
74 | #define TIOCGSERIAL _IOR('T', 30, struct serial_struct) | ||
75 | #define TIOCSSERIAL _IOW('T', 31, struct serial_struct) | ||
76 | #define TIOCPKT _IOW('T', 32, int) | ||
77 | # define TIOCPKT_DATA 0 | ||
78 | # define TIOCPKT_FLUSHREAD 1 | ||
79 | # define TIOCPKT_FLUSHWRITE 2 | ||
80 | # define TIOCPKT_STOP 4 | ||
81 | # define TIOCPKT_START 8 | ||
82 | # define TIOCPKT_NOSTOP 16 | ||
83 | # define TIOCPKT_DOSTOP 32 | ||
84 | # define TIOCPKT_IOCTL 64 | ||
85 | |||
86 | |||
87 | #define TIOCNOTTY _IO('T', 34) | ||
88 | #define TIOCSETD _IOW('T', 35, int) | ||
89 | #define TIOCGETD _IOR('T', 36, int) | ||
90 | #define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/ | ||
91 | #define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/ | ||
92 | #define TIOCSBRK _IO('T', 39) /* BSD compatibility */ | ||
93 | #define TIOCCBRK _IO('T', 40) /* BSD compatibility */ | ||
94 | #define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/ | ||
95 | #define TCGETS2 _IOR('T', 42, struct termios2) | ||
96 | #define TCSETS2 _IOW('T', 43, struct termios2) | ||
97 | #define TCSETSW2 _IOW('T', 44, struct termios2) | ||
98 | #define TCSETSF2 _IOW('T', 45, struct termios2) | ||
99 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
100 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | ||
101 | #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
102 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ | ||
103 | #define TIOCVHANGUP _IO('T', 0x37) | ||
104 | |||
105 | #define TIOCSERCONFIG _IO('T', 83) | ||
106 | #define TIOCSERGWILD _IOR('T', 84, int) | ||
107 | #define TIOCSERSWILD _IOW('T', 85, int) | ||
108 | #define TIOCGLCKTRMIOS 0x5456 | ||
109 | #define TIOCSLCKTRMIOS 0x5457 | ||
110 | #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ | ||
111 | #define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */ | ||
112 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
113 | # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
114 | #define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config */ | ||
115 | #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ | ||
116 | |||
117 | #define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ | ||
118 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | ||
119 | |||
120 | #endif /* _XTENSA_IOCTLS_H */ | ||
diff --git a/arch/xtensa/include/asm/ipcbuf.h b/arch/xtensa/include/asm/ipcbuf.h new file mode 100644 index 00000000000..c33aa6a4214 --- /dev/null +++ b/arch/xtensa/include/asm/ipcbuf.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/ipcbuf.h | ||
3 | * | ||
4 | * The ipc64_perm structure for the Xtensa architecture. | ||
5 | * Note extra padding because this structure is passed back and forth | ||
6 | * between kernel and user space. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_IPCBUF_H | ||
12 | #define _XTENSA_IPCBUF_H | ||
13 | |||
14 | /* | ||
15 | * Pad space is left for: | ||
16 | * - 32-bit mode_t and seq | ||
17 | * - 2 miscellaneous 32-bit values | ||
18 | * | ||
19 | * This file is subject to the terms and conditions of the GNU General | ||
20 | * Public License. See the file "COPYING" in the main directory of | ||
21 | * this archive for more details. | ||
22 | */ | ||
23 | |||
24 | struct ipc64_perm | ||
25 | { | ||
26 | __kernel_key_t key; | ||
27 | __kernel_uid32_t uid; | ||
28 | __kernel_gid32_t gid; | ||
29 | __kernel_uid32_t cuid; | ||
30 | __kernel_gid32_t cgid; | ||
31 | __kernel_mode_t mode; | ||
32 | unsigned long seq; | ||
33 | unsigned long __unused1; | ||
34 | unsigned long __unused2; | ||
35 | }; | ||
36 | |||
37 | #endif /* _XTENSA_IPCBUF_H */ | ||
diff --git a/arch/xtensa/include/asm/irq_regs.h b/arch/xtensa/include/asm/irq_regs.h new file mode 100644 index 00000000000..3dd9c0b7027 --- /dev/null +++ b/arch/xtensa/include/asm/irq_regs.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/irq_regs.h> | |||
diff --git a/arch/xtensa/include/asm/kdebug.h b/arch/xtensa/include/asm/kdebug.h new file mode 100644 index 00000000000..6ece1b03766 --- /dev/null +++ b/arch/xtensa/include/asm/kdebug.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kdebug.h> | |||
diff --git a/arch/xtensa/include/asm/kmap_types.h b/arch/xtensa/include/asm/kmap_types.h new file mode 100644 index 00000000000..11c687e527f --- /dev/null +++ b/arch/xtensa/include/asm/kmap_types.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _XTENSA_KMAP_TYPES_H | ||
2 | #define _XTENSA_KMAP_TYPES_H | ||
3 | |||
4 | #include <asm-generic/kmap_types.h> | ||
5 | |||
6 | #endif /* _XTENSA_KMAP_TYPES_H */ | ||
diff --git a/arch/xtensa/include/asm/local.h b/arch/xtensa/include/asm/local.h new file mode 100644 index 00000000000..48723e550d1 --- /dev/null +++ b/arch/xtensa/include/asm/local.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/local.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_LOCAL_H | ||
12 | #define _XTENSA_LOCAL_H | ||
13 | |||
14 | #include <asm-generic/local.h> | ||
15 | |||
16 | #endif /* _XTENSA_LOCAL_H */ | ||
diff --git a/arch/xtensa/include/asm/local64.h b/arch/xtensa/include/asm/local64.h new file mode 100644 index 00000000000..36c93b5cc23 --- /dev/null +++ b/arch/xtensa/include/asm/local64.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/local64.h> | |||
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h new file mode 100644 index 00000000000..30789010733 --- /dev/null +++ b/arch/xtensa/include/asm/mman.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/mman.h | ||
3 | * | ||
4 | * Xtensa Processor memory-manager definitions | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 1995 by Ralf Baechle | ||
11 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
12 | */ | ||
13 | |||
14 | #ifndef _XTENSA_MMAN_H | ||
15 | #define _XTENSA_MMAN_H | ||
16 | |||
17 | /* | ||
18 | * Protections are chosen from these bits, OR'd together. The | ||
19 | * implementation does not necessarily support PROT_EXEC or PROT_WRITE | ||
20 | * without PROT_READ. The only guarantees are that no writing will be | ||
21 | * allowed without PROT_WRITE and no access will be allowed for PROT_NONE. | ||
22 | */ | ||
23 | |||
24 | #define PROT_NONE 0x0 /* page can not be accessed */ | ||
25 | #define PROT_READ 0x1 /* page can be read */ | ||
26 | #define PROT_WRITE 0x2 /* page can be written */ | ||
27 | #define PROT_EXEC 0x4 /* page can be executed */ | ||
28 | |||
29 | #define PROT_SEM 0x10 /* page may be used for atomic ops */ | ||
30 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | ||
31 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end fo growsup vma */ | ||
32 | |||
33 | /* | ||
34 | * Flags for mmap | ||
35 | */ | ||
36 | #define MAP_SHARED 0x001 /* Share changes */ | ||
37 | #define MAP_PRIVATE 0x002 /* Changes are private */ | ||
38 | #define MAP_TYPE 0x00f /* Mask for type of mapping */ | ||
39 | #define MAP_FIXED 0x010 /* Interpret addr exactly */ | ||
40 | |||
41 | /* not used by linux, but here to make sure we don't clash with ABI defines */ | ||
42 | #define MAP_RENAME 0x020 /* Assign page to file */ | ||
43 | #define MAP_AUTOGROW 0x040 /* File may grow by writing */ | ||
44 | #define MAP_LOCAL 0x080 /* Copy on fork/sproc */ | ||
45 | #define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */ | ||
46 | |||
47 | /* These are linux-specific */ | ||
48 | #define MAP_NORESERVE 0x0400 /* don't check for reservations */ | ||
49 | #define MAP_ANONYMOUS 0x0800 /* don't use a file */ | ||
50 | #define MAP_GROWSDOWN 0x1000 /* stack-like segment */ | ||
51 | #define MAP_DENYWRITE 0x2000 /* ETXTBSY */ | ||
52 | #define MAP_EXECUTABLE 0x4000 /* mark it as an executable */ | ||
53 | #define MAP_LOCKED 0x8000 /* pages are locked */ | ||
54 | #define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ | ||
55 | #define MAP_NONBLOCK 0x20000 /* do not block on IO */ | ||
56 | #define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */ | ||
57 | #define MAP_HUGETLB 0x80000 /* create a huge page mapping */ | ||
58 | |||
59 | /* | ||
60 | * Flags for msync | ||
61 | */ | ||
62 | #define MS_ASYNC 0x0001 /* sync memory asynchronously */ | ||
63 | #define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */ | ||
64 | #define MS_SYNC 0x0004 /* synchronous memory sync */ | ||
65 | |||
66 | /* | ||
67 | * Flags for mlockall | ||
68 | */ | ||
69 | #define MCL_CURRENT 1 /* lock all current mappings */ | ||
70 | #define MCL_FUTURE 2 /* lock all future mappings */ | ||
71 | |||
72 | #define MADV_NORMAL 0 /* no further special treatment */ | ||
73 | #define MADV_RANDOM 1 /* expect random page references */ | ||
74 | #define MADV_SEQUENTIAL 2 /* expect sequential page references */ | ||
75 | #define MADV_WILLNEED 3 /* will need these pages */ | ||
76 | #define MADV_DONTNEED 4 /* don't need these pages */ | ||
77 | |||
78 | /* common parameters: try to keep these consistent across architectures */ | ||
79 | #define MADV_REMOVE 9 /* remove these pages & resources */ | ||
80 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | ||
81 | #define MADV_DOFORK 11 /* do inherit across fork */ | ||
82 | |||
83 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | ||
84 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | ||
85 | |||
86 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | ||
87 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | ||
88 | |||
89 | /* compatibility flags */ | ||
90 | #define MAP_FILE 0 | ||
91 | |||
92 | #endif /* _XTENSA_MMAN_H */ | ||
diff --git a/arch/xtensa/include/asm/msgbuf.h b/arch/xtensa/include/asm/msgbuf.h new file mode 100644 index 00000000000..693c9675528 --- /dev/null +++ b/arch/xtensa/include/asm/msgbuf.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/msgbuf.h | ||
3 | * | ||
4 | * The msqid64_ds structure for the Xtensa architecture. | ||
5 | * Note extra padding because this structure is passed back and forth | ||
6 | * between kernel and user space. | ||
7 | * | ||
8 | * Pad space is left for: | ||
9 | * - 64-bit time_t to solve y2038 problem | ||
10 | * - 2 miscellaneous 32-bit values | ||
11 | * | ||
12 | * This file is subject to the terms and conditions of the GNU General | ||
13 | * Public License. See the file "COPYING" in the main directory of | ||
14 | * this archive for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef _XTENSA_MSGBUF_H | ||
18 | #define _XTENSA_MSGBUF_H | ||
19 | |||
20 | struct msqid64_ds { | ||
21 | struct ipc64_perm msg_perm; | ||
22 | #ifdef __XTENSA_EB__ | ||
23 | unsigned int __unused1; | ||
24 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
25 | unsigned int __unused2; | ||
26 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
27 | unsigned int __unused3; | ||
28 | __kernel_time_t msg_ctime; /* last change time */ | ||
29 | #elif defined(__XTENSA_EL__) | ||
30 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
31 | unsigned int __unused1; | ||
32 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
33 | unsigned int __unused2; | ||
34 | __kernel_time_t msg_ctime; /* last change time */ | ||
35 | unsigned int __unused3; | ||
36 | #else | ||
37 | # error processor byte order undefined! | ||
38 | #endif | ||
39 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
40 | unsigned long msg_qnum; /* number of messages in queue */ | ||
41 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
42 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
43 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
44 | unsigned long __unused4; | ||
45 | unsigned long __unused5; | ||
46 | }; | ||
47 | |||
48 | #endif /* _XTENSA_MSGBUF_H */ | ||
diff --git a/arch/xtensa/include/asm/nommu.h b/arch/xtensa/include/asm/nommu.h new file mode 100644 index 00000000000..dce2c438c5b --- /dev/null +++ b/arch/xtensa/include/asm/nommu.h | |||
@@ -0,0 +1,3 @@ | |||
1 | typedef struct { | ||
2 | unsigned long end_brk; | ||
3 | } mm_context_t; | ||
diff --git a/arch/xtensa/include/asm/percpu.h b/arch/xtensa/include/asm/percpu.h new file mode 100644 index 00000000000..6d2bc2ada9d --- /dev/null +++ b/arch/xtensa/include/asm/percpu.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * linux/include/asm-xtensa/percpu.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_PERCPU__ | ||
12 | #define _XTENSA_PERCPU__ | ||
13 | |||
14 | #include <asm-generic/percpu.h> | ||
15 | |||
16 | #endif /* _XTENSA_PERCPU__ */ | ||
diff --git a/arch/xtensa/include/asm/poll.h b/arch/xtensa/include/asm/poll.h new file mode 100644 index 00000000000..9d2d5993f06 --- /dev/null +++ b/arch/xtensa/include/asm/poll.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/poll.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_POLL_H | ||
12 | #define _XTENSA_POLL_H | ||
13 | |||
14 | #define POLLWRNORM POLLOUT | ||
15 | #define POLLWRBAND 0x0100 | ||
16 | #define POLLREMOVE 0x0800 | ||
17 | |||
18 | #include <asm-generic/poll.h> | ||
19 | |||
20 | #endif /* _XTENSA_POLL_H */ | ||
diff --git a/arch/xtensa/include/asm/posix_types.h b/arch/xtensa/include/asm/posix_types.h new file mode 100644 index 00000000000..6b2190c3588 --- /dev/null +++ b/arch/xtensa/include/asm/posix_types.h | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/posix_types.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Largely copied from include/asm-ppc/posix_types.h | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_POSIX_TYPES_H | ||
14 | #define _XTENSA_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 | |||
22 | typedef unsigned long __kernel_ino_t; | ||
23 | typedef unsigned int __kernel_mode_t; | ||
24 | typedef unsigned long __kernel_nlink_t; | ||
25 | typedef long __kernel_off_t; | ||
26 | typedef int __kernel_pid_t; | ||
27 | typedef unsigned short __kernel_ipc_pid_t; | ||
28 | typedef unsigned int __kernel_uid_t; | ||
29 | typedef unsigned int __kernel_gid_t; | ||
30 | typedef unsigned int __kernel_size_t; | ||
31 | typedef int __kernel_ssize_t; | ||
32 | typedef long __kernel_ptrdiff_t; | ||
33 | typedef long __kernel_time_t; | ||
34 | typedef long __kernel_suseconds_t; | ||
35 | typedef long __kernel_clock_t; | ||
36 | typedef int __kernel_timer_t; | ||
37 | typedef int __kernel_clockid_t; | ||
38 | typedef int __kernel_daddr_t; | ||
39 | typedef char * __kernel_caddr_t; | ||
40 | typedef unsigned short __kernel_uid16_t; | ||
41 | typedef unsigned short __kernel_gid16_t; | ||
42 | typedef unsigned int __kernel_uid32_t; | ||
43 | typedef unsigned int __kernel_gid32_t; | ||
44 | |||
45 | typedef unsigned short __kernel_old_uid_t; | ||
46 | typedef unsigned short __kernel_old_gid_t; | ||
47 | typedef unsigned short __kernel_old_dev_t; | ||
48 | |||
49 | #ifdef __GNUC__ | ||
50 | typedef long long __kernel_loff_t; | ||
51 | #endif | ||
52 | |||
53 | typedef struct { | ||
54 | int val[2]; | ||
55 | } __kernel_fsid_t; | ||
56 | |||
57 | #ifndef __GNUC__ | ||
58 | |||
59 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | ||
60 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | ||
61 | #define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d))) | ||
62 | #define __FD_ZERO(set) \ | ||
63 | ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set))) | ||
64 | |||
65 | #else /* __GNUC__ */ | ||
66 | |||
67 | #if defined(__KERNEL__) | ||
68 | /* With GNU C, use inline functions instead so args are evaluated only once: */ | ||
69 | |||
70 | #undef __FD_SET | ||
71 | static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) | ||
72 | { | ||
73 | unsigned long _tmp = fd / __NFDBITS; | ||
74 | unsigned long _rem = fd % __NFDBITS; | ||
75 | fdsetp->fds_bits[_tmp] |= (1UL<<_rem); | ||
76 | } | ||
77 | |||
78 | #undef __FD_CLR | ||
79 | static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) | ||
80 | { | ||
81 | unsigned long _tmp = fd / __NFDBITS; | ||
82 | unsigned long _rem = fd % __NFDBITS; | ||
83 | fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); | ||
84 | } | ||
85 | |||
86 | #undef __FD_ISSET | ||
87 | static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p) | ||
88 | { | ||
89 | unsigned long _tmp = fd / __NFDBITS; | ||
90 | unsigned long _rem = fd % __NFDBITS; | ||
91 | return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; | ||
92 | } | ||
93 | |||
94 | /* | ||
95 | * This will unroll the loop for the normal constant case (8 ints, | ||
96 | * for a 256-bit fd_set) | ||
97 | */ | ||
98 | #undef __FD_ZERO | ||
99 | static __inline__ void __FD_ZERO(__kernel_fd_set *p) | ||
100 | { | ||
101 | unsigned int *tmp = (unsigned int *)p->fds_bits; | ||
102 | int i; | ||
103 | |||
104 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
105 | switch (__FDSET_LONGS) { | ||
106 | case 8: | ||
107 | tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0; | ||
108 | tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0; | ||
109 | return; | ||
110 | } | ||
111 | } | ||
112 | i = __FDSET_LONGS; | ||
113 | while (i) { | ||
114 | i--; | ||
115 | *tmp = 0; | ||
116 | tmp++; | ||
117 | } | ||
118 | } | ||
119 | |||
120 | #endif /* defined(__KERNEL__) */ | ||
121 | #endif /* __GNUC__ */ | ||
122 | #endif /* _XTENSA_POSIX_TYPES_H */ | ||
diff --git a/arch/xtensa/include/asm/resource.h b/arch/xtensa/include/asm/resource.h new file mode 100644 index 00000000000..17b5ab31177 --- /dev/null +++ b/arch/xtensa/include/asm/resource.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/resource.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_RESOURCE_H | ||
12 | #define _XTENSA_RESOURCE_H | ||
13 | |||
14 | #include <asm-generic/resource.h> | ||
15 | |||
16 | #endif /* _XTENSA_RESOURCE_H */ | ||
diff --git a/arch/xtensa/include/asm/rmap.h b/arch/xtensa/include/asm/rmap.h new file mode 100644 index 00000000000..649588b7e9a --- /dev/null +++ b/arch/xtensa/include/asm/rmap.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/rmap.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_RMAP_H | ||
12 | #define _XTENSA_RMAP_H | ||
13 | |||
14 | #include <asm-generic/rmap.h> | ||
15 | |||
16 | #endif | ||
diff --git a/arch/xtensa/include/asm/scatterlist.h b/arch/xtensa/include/asm/scatterlist.h new file mode 100644 index 00000000000..a0421a61d9e --- /dev/null +++ b/arch/xtensa/include/asm/scatterlist.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/scatterlist.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SCATTERLIST_H | ||
12 | #define _XTENSA_SCATTERLIST_H | ||
13 | |||
14 | #include <asm-generic/scatterlist.h> | ||
15 | |||
16 | #endif /* _XTENSA_SCATTERLIST_H */ | ||
diff --git a/arch/xtensa/include/asm/sections.h b/arch/xtensa/include/asm/sections.h new file mode 100644 index 00000000000..40b5191b55a --- /dev/null +++ b/arch/xtensa/include/asm/sections.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/sections.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SECTIONS_H | ||
12 | #define _XTENSA_SECTIONS_H | ||
13 | |||
14 | #include <asm-generic/sections.h> | ||
15 | |||
16 | #endif /* _XTENSA_SECTIONS_H */ | ||
diff --git a/arch/xtensa/include/asm/sembuf.h b/arch/xtensa/include/asm/sembuf.h new file mode 100644 index 00000000000..c15870493b3 --- /dev/null +++ b/arch/xtensa/include/asm/sembuf.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/sembuf.h | ||
3 | * | ||
4 | * The semid64_ds structure for Xtensa architecture. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | * | ||
12 | * Note extra padding because this structure is passed back and forth | ||
13 | * between kernel and user space. | ||
14 | * | ||
15 | * Pad space is left for: | ||
16 | * - 64-bit time_t to solve y2038 problem | ||
17 | * - 2 miscellaneous 32-bit values | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #ifndef _XTENSA_SEMBUF_H | ||
22 | #define _XTENSA_SEMBUF_H | ||
23 | |||
24 | #include <asm/byteorder.h> | ||
25 | |||
26 | struct semid64_ds { | ||
27 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
28 | #ifdef __XTENSA_EL__ | ||
29 | __kernel_time_t sem_otime; /* last semop time */ | ||
30 | unsigned long __unused1; | ||
31 | __kernel_time_t sem_ctime; /* last change time */ | ||
32 | unsigned long __unused2; | ||
33 | #else | ||
34 | unsigned long __unused1; | ||
35 | __kernel_time_t sem_otime; /* last semop time */ | ||
36 | unsigned long __unused2; | ||
37 | __kernel_time_t sem_ctime; /* last change time */ | ||
38 | #endif | ||
39 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
40 | unsigned long __unused3; | ||
41 | unsigned long __unused4; | ||
42 | }; | ||
43 | |||
44 | #endif /* __ASM_XTENSA_SEMBUF_H */ | ||
diff --git a/arch/xtensa/include/asm/setup.h b/arch/xtensa/include/asm/setup.h new file mode 100644 index 00000000000..e3636520d8c --- /dev/null +++ b/arch/xtensa/include/asm/setup.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/setup.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SETUP_H | ||
12 | #define _XTENSA_SETUP_H | ||
13 | |||
14 | #define COMMAND_LINE_SIZE 256 | ||
15 | |||
16 | #endif | ||
diff --git a/arch/xtensa/include/asm/shmbuf.h b/arch/xtensa/include/asm/shmbuf.h new file mode 100644 index 00000000000..ad4b0121782 --- /dev/null +++ b/arch/xtensa/include/asm/shmbuf.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/shmbuf.h | ||
3 | * | ||
4 | * The shmid64_ds structure for Xtensa architecture. | ||
5 | * Note extra padding because this structure is passed back and forth | ||
6 | * between kernel and user space. | ||
7 | * | ||
8 | * Pad space is left for: | ||
9 | * - 64-bit time_t to solve y2038 problem | ||
10 | * - 2 miscellaneous 32-bit values | ||
11 | * | ||
12 | * This file is subject to the terms and conditions of the GNU General Public | ||
13 | * License. See the file "COPYING" in the main directory of this archive | ||
14 | * for more details. | ||
15 | * | ||
16 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
17 | */ | ||
18 | |||
19 | #ifndef _XTENSA_SHMBUF_H | ||
20 | #define _XTENSA_SHMBUF_H | ||
21 | |||
22 | #if defined (__XTENSA_EL__) | ||
23 | struct shmid64_ds { | ||
24 | struct ipc64_perm shm_perm; /* operation perms */ | ||
25 | size_t shm_segsz; /* size of segment (bytes) */ | ||
26 | __kernel_time_t shm_atime; /* last attach time */ | ||
27 | unsigned long __unused1; | ||
28 | __kernel_time_t shm_dtime; /* last detach time */ | ||
29 | unsigned long __unused2; | ||
30 | __kernel_time_t shm_ctime; /* last change time */ | ||
31 | unsigned long __unused3; | ||
32 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
33 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
34 | unsigned long shm_nattch; /* no. of current attaches */ | ||
35 | unsigned long __unused4; | ||
36 | unsigned long __unused5; | ||
37 | }; | ||
38 | #elif defined (__XTENSA_EB__) | ||
39 | struct shmid64_ds { | ||
40 | struct ipc64_perm shm_perm; /* operation perms */ | ||
41 | size_t shm_segsz; /* size of segment (bytes) */ | ||
42 | __kernel_time_t shm_atime; /* last attach time */ | ||
43 | unsigned long __unused1; | ||
44 | __kernel_time_t shm_dtime; /* last detach time */ | ||
45 | unsigned long __unused2; | ||
46 | __kernel_time_t shm_ctime; /* last change time */ | ||
47 | unsigned long __unused3; | ||
48 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
49 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
50 | unsigned long shm_nattch; /* no. of current attaches */ | ||
51 | unsigned long __unused4; | ||
52 | unsigned long __unused5; | ||
53 | }; | ||
54 | #else | ||
55 | # error endian order not defined | ||
56 | #endif | ||
57 | |||
58 | |||
59 | struct shminfo64 { | ||
60 | unsigned long shmmax; | ||
61 | unsigned long shmmin; | ||
62 | unsigned long shmmni; | ||
63 | unsigned long shmseg; | ||
64 | unsigned long shmall; | ||
65 | unsigned long __unused1; | ||
66 | unsigned long __unused2; | ||
67 | unsigned long __unused3; | ||
68 | unsigned long __unused4; | ||
69 | }; | ||
70 | |||
71 | #endif /* _XTENSA_SHMBUF_H */ | ||
diff --git a/arch/xtensa/include/asm/sigcontext.h b/arch/xtensa/include/asm/sigcontext.h new file mode 100644 index 00000000000..03383af8c3b --- /dev/null +++ b/arch/xtensa/include/asm/sigcontext.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/sigcontext.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2007 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SIGCONTEXT_H | ||
12 | #define _XTENSA_SIGCONTEXT_H | ||
13 | |||
14 | |||
15 | struct sigcontext { | ||
16 | unsigned long sc_pc; | ||
17 | unsigned long sc_ps; | ||
18 | unsigned long sc_lbeg; | ||
19 | unsigned long sc_lend; | ||
20 | unsigned long sc_lcount; | ||
21 | unsigned long sc_sar; | ||
22 | unsigned long sc_acclo; | ||
23 | unsigned long sc_acchi; | ||
24 | unsigned long sc_a[16]; | ||
25 | void *sc_xtregs; | ||
26 | }; | ||
27 | |||
28 | #endif /* _XTENSA_SIGCONTEXT_H */ | ||
diff --git a/arch/xtensa/include/asm/siginfo.h b/arch/xtensa/include/asm/siginfo.h new file mode 100644 index 00000000000..6916248295d --- /dev/null +++ b/arch/xtensa/include/asm/siginfo.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/siginfo.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SIGINFO_H | ||
12 | #define _XTENSA_SIGINFO_H | ||
13 | |||
14 | #include <asm-generic/siginfo.h> | ||
15 | |||
16 | #endif /* _XTENSA_SIGINFO_H */ | ||
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h new file mode 100644 index 00000000000..cbdf2ffaacf --- /dev/null +++ b/arch/xtensa/include/asm/socket.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/socket.h | ||
3 | * | ||
4 | * Copied from i386. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SOCKET_H | ||
12 | #define _XTENSA_SOCKET_H | ||
13 | |||
14 | #include <asm/sockios.h> | ||
15 | |||
16 | /* For setsockoptions(2) */ | ||
17 | #define SOL_SOCKET 1 | ||
18 | |||
19 | #define SO_DEBUG 1 | ||
20 | #define SO_REUSEADDR 2 | ||
21 | #define SO_TYPE 3 | ||
22 | #define SO_ERROR 4 | ||
23 | #define SO_DONTROUTE 5 | ||
24 | #define SO_BROADCAST 6 | ||
25 | #define SO_SNDBUF 7 | ||
26 | #define SO_RCVBUF 8 | ||
27 | #define SO_SNDBUFFORCE 32 | ||
28 | #define SO_RCVBUFFORCE 33 | ||
29 | #define SO_KEEPALIVE 9 | ||
30 | #define SO_OOBINLINE 10 | ||
31 | #define SO_NO_CHECK 11 | ||
32 | #define SO_PRIORITY 12 | ||
33 | #define SO_LINGER 13 | ||
34 | #define SO_BSDCOMPAT 14 | ||
35 | /* To add :#define SO_REUSEPORT 15 */ | ||
36 | #define SO_PASSCRED 16 | ||
37 | #define SO_PEERCRED 17 | ||
38 | #define SO_RCVLOWAT 18 | ||
39 | #define SO_SNDLOWAT 19 | ||
40 | #define SO_RCVTIMEO 20 | ||
41 | #define SO_SNDTIMEO 21 | ||
42 | |||
43 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
44 | |||
45 | #define SO_SECURITY_AUTHENTICATION 22 | ||
46 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
47 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
48 | |||
49 | #define SO_BINDTODEVICE 25 | ||
50 | |||
51 | /* Socket filtering */ | ||
52 | |||
53 | #define SO_ATTACH_FILTER 26 | ||
54 | #define SO_DETACH_FILTER 27 | ||
55 | |||
56 | #define SO_PEERNAME 28 | ||
57 | #define SO_TIMESTAMP 29 | ||
58 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
59 | |||
60 | #define SO_ACCEPTCONN 30 | ||
61 | #define SO_PEERSEC 31 | ||
62 | #define SO_PASSSEC 34 | ||
63 | #define SO_TIMESTAMPNS 35 | ||
64 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
65 | |||
66 | #define SO_MARK 36 | ||
67 | |||
68 | #define SO_TIMESTAMPING 37 | ||
69 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
70 | |||
71 | #define SO_PROTOCOL 38 | ||
72 | #define SO_DOMAIN 39 | ||
73 | |||
74 | #define SO_RXQ_OVFL 40 | ||
75 | |||
76 | #endif /* _XTENSA_SOCKET_H */ | ||
diff --git a/arch/xtensa/include/asm/sockios.h b/arch/xtensa/include/asm/sockios.h new file mode 100644 index 00000000000..efe0af379f0 --- /dev/null +++ b/arch/xtensa/include/asm/sockios.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/sockios.h | ||
3 | * | ||
4 | * Socket-level I/O control calls. Copied from MIPS. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 1995 by Ralf Baechle | ||
11 | * Copyright (C) 2001 Tensilica Inc. | ||
12 | */ | ||
13 | |||
14 | #ifndef _XTENSA_SOCKIOS_H | ||
15 | #define _XTENSA_SOCKIOS_H | ||
16 | |||
17 | #include <asm/ioctl.h> | ||
18 | |||
19 | /* Socket-level I/O control calls. */ | ||
20 | |||
21 | #define FIOGETOWN _IOR('f', 123, int) | ||
22 | #define FIOSETOWN _IOW('f', 124, int) | ||
23 | |||
24 | #define SIOCATMARK _IOR('s', 7, int) | ||
25 | #define SIOCSPGRP _IOW('s', 8, pid_t) | ||
26 | #define SIOCGPGRP _IOR('s', 9, pid_t) | ||
27 | |||
28 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
29 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
30 | |||
31 | #endif /* _XTENSA_SOCKIOS_H */ | ||
diff --git a/arch/xtensa/include/asm/stat.h b/arch/xtensa/include/asm/stat.h new file mode 100644 index 00000000000..c4992038cee --- /dev/null +++ b/arch/xtensa/include/asm/stat.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/stat.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2007 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_STAT_H | ||
12 | #define _XTENSA_STAT_H | ||
13 | |||
14 | #define STAT_HAVE_NSEC 1 | ||
15 | |||
16 | struct stat { | ||
17 | unsigned long st_dev; | ||
18 | unsigned long st_ino; | ||
19 | unsigned int st_mode; | ||
20 | unsigned int st_nlink; | ||
21 | unsigned int st_uid; | ||
22 | unsigned int st_gid; | ||
23 | unsigned long st_rdev; | ||
24 | long st_size; | ||
25 | unsigned long st_blksize; | ||
26 | unsigned long st_blocks; | ||
27 | unsigned long st_atime; | ||
28 | unsigned long st_atime_nsec; | ||
29 | unsigned long st_mtime; | ||
30 | unsigned long st_mtime_nsec; | ||
31 | unsigned long st_ctime; | ||
32 | unsigned long st_ctime_nsec; | ||
33 | unsigned long __unused4; | ||
34 | unsigned long __unused5; | ||
35 | }; | ||
36 | |||
37 | struct stat64 { | ||
38 | unsigned long long st_dev; /* Device */ | ||
39 | unsigned long long st_ino; /* File serial number */ | ||
40 | unsigned int st_mode; /* File mode. */ | ||
41 | unsigned int st_nlink; /* Link count. */ | ||
42 | unsigned int st_uid; /* User ID of the file's owner. */ | ||
43 | unsigned int st_gid; /* Group ID of the file's group. */ | ||
44 | unsigned long long st_rdev; /* Device number, if device. */ | ||
45 | long long st_size; /* Size of file, in bytes. */ | ||
46 | unsigned long st_blksize; /* Optimal block size for I/O. */ | ||
47 | unsigned long __unused2; | ||
48 | unsigned long long st_blocks; /* Number 512-byte blocks allocated. */ | ||
49 | unsigned long st_atime; /* Time of last access. */ | ||
50 | unsigned long st_atime_nsec; | ||
51 | unsigned long st_mtime; /* Time of last modification. */ | ||
52 | unsigned long st_mtime_nsec; | ||
53 | unsigned long st_ctime; /* Time of last status change. */ | ||
54 | unsigned long st_ctime_nsec; | ||
55 | unsigned long __unused4; | ||
56 | unsigned long __unused5; | ||
57 | }; | ||
58 | |||
59 | #endif /* _XTENSA_STAT_H */ | ||
diff --git a/arch/xtensa/include/asm/statfs.h b/arch/xtensa/include/asm/statfs.h new file mode 100644 index 00000000000..9c3d1a21313 --- /dev/null +++ b/arch/xtensa/include/asm/statfs.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/statfs.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_STATFS_H | ||
12 | #define _XTENSA_STATFS_H | ||
13 | |||
14 | #include <asm-generic/statfs.h> | ||
15 | |||
16 | #endif /* _XTENSA_STATFS_H */ | ||
17 | |||
diff --git a/arch/xtensa/include/asm/swab.h b/arch/xtensa/include/asm/swab.h new file mode 100644 index 00000000000..226a3916231 --- /dev/null +++ b/arch/xtensa/include/asm/swab.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/swab.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SWAB_H | ||
12 | #define _XTENSA_SWAB_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/compiler.h> | ||
16 | |||
17 | #define __SWAB_64_THRU_32__ | ||
18 | |||
19 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | ||
20 | { | ||
21 | __u32 res; | ||
22 | /* instruction sequence from Xtensa ISA release 2/2000 */ | ||
23 | __asm__("ssai 8 \n\t" | ||
24 | "srli %0, %1, 16 \n\t" | ||
25 | "src %0, %0, %1 \n\t" | ||
26 | "src %0, %0, %0 \n\t" | ||
27 | "src %0, %1, %0 \n" | ||
28 | : "=&a" (res) | ||
29 | : "a" (x) | ||
30 | ); | ||
31 | return res; | ||
32 | } | ||
33 | #define __arch_swab32 __arch_swab32 | ||
34 | |||
35 | static inline __attribute_const__ __u16 __arch_swab16(__u16 x) | ||
36 | { | ||
37 | /* Given that 'short' values are signed (i.e., can be negative), | ||
38 | * we cannot assume that the upper 16-bits of the register are | ||
39 | * zero. We are careful to mask values after shifting. | ||
40 | */ | ||
41 | |||
42 | /* There exists an anomaly between xt-gcc and xt-xcc. xt-gcc | ||
43 | * inserts an extui instruction after putting this function inline | ||
44 | * to ensure that it uses only the least-significant 16 bits of | ||
45 | * the result. xt-xcc doesn't use an extui, but assumes the | ||
46 | * __asm__ macro follows convention that the upper 16 bits of an | ||
47 | * 'unsigned short' result are still zero. This macro doesn't | ||
48 | * follow convention; indeed, it leaves garbage in the upport 16 | ||
49 | * bits of the register. | ||
50 | |||
51 | * Declaring the temporary variables 'res' and 'tmp' to be 32-bit | ||
52 | * types while the return type of the function is a 16-bit type | ||
53 | * forces both compilers to insert exactly one extui instruction | ||
54 | * (or equivalent) to mask off the upper 16 bits. */ | ||
55 | |||
56 | __u32 res; | ||
57 | __u32 tmp; | ||
58 | |||
59 | __asm__("extui %1, %2, 8, 8\n\t" | ||
60 | "slli %0, %2, 8 \n\t" | ||
61 | "or %0, %0, %1 \n" | ||
62 | : "=&a" (res), "=&a" (tmp) | ||
63 | : "a" (x) | ||
64 | ); | ||
65 | |||
66 | return res; | ||
67 | } | ||
68 | #define __arch_swab16 __arch_swab16 | ||
69 | |||
70 | #endif /* _XTENSA_SWAB_H */ | ||
diff --git a/arch/xtensa/include/asm/system.h b/arch/xtensa/include/asm/system.h new file mode 100644 index 00000000000..1e7e09ab6cd --- /dev/null +++ b/arch/xtensa/include/asm/system.h | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/system.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SYSTEM_H | ||
12 | #define _XTENSA_SYSTEM_H | ||
13 | |||
14 | #include <linux/stringify.h> | ||
15 | #include <linux/irqflags.h> | ||
16 | |||
17 | #include <asm/processor.h> | ||
18 | |||
19 | #define smp_read_barrier_depends() do { } while(0) | ||
20 | #define read_barrier_depends() do { } while(0) | ||
21 | |||
22 | #define mb() barrier() | ||
23 | #define rmb() mb() | ||
24 | #define wmb() mb() | ||
25 | |||
26 | #ifdef CONFIG_SMP | ||
27 | #error smp_* not defined | ||
28 | #else | ||
29 | #define smp_mb() barrier() | ||
30 | #define smp_rmb() barrier() | ||
31 | #define smp_wmb() barrier() | ||
32 | #endif | ||
33 | |||
34 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
35 | |||
36 | #if !defined (__ASSEMBLY__) | ||
37 | |||
38 | /* * switch_to(n) should switch tasks to task nr n, first | ||
39 | * checking that n isn't the current task, in which case it does nothing. | ||
40 | */ | ||
41 | extern void *_switch_to(void *last, void *next); | ||
42 | |||
43 | #endif /* __ASSEMBLY__ */ | ||
44 | |||
45 | #define switch_to(prev,next,last) \ | ||
46 | do { \ | ||
47 | (last) = _switch_to(prev, next); \ | ||
48 | } while(0) | ||
49 | |||
50 | /* | ||
51 | * cmpxchg | ||
52 | */ | ||
53 | |||
54 | static inline unsigned long | ||
55 | __cmpxchg_u32(volatile int *p, int old, int new) | ||
56 | { | ||
57 | __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" | ||
58 | "l32i %0, %1, 0 \n\t" | ||
59 | "bne %0, %2, 1f \n\t" | ||
60 | "s32i %3, %1, 0 \n\t" | ||
61 | "1: \n\t" | ||
62 | "wsr a15, "__stringify(PS)" \n\t" | ||
63 | "rsync \n\t" | ||
64 | : "=&a" (old) | ||
65 | : "a" (p), "a" (old), "r" (new) | ||
66 | : "a15", "memory"); | ||
67 | return old; | ||
68 | } | ||
69 | /* This function doesn't exist, so you'll get a linker error | ||
70 | * if something tries to do an invalid cmpxchg(). */ | ||
71 | |||
72 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
73 | |||
74 | static __inline__ unsigned long | ||
75 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | ||
76 | { | ||
77 | switch (size) { | ||
78 | case 4: return __cmpxchg_u32(ptr, old, new); | ||
79 | default: __cmpxchg_called_with_bad_pointer(); | ||
80 | return old; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | #define cmpxchg(ptr,o,n) \ | ||
85 | ({ __typeof__(*(ptr)) _o_ = (o); \ | ||
86 | __typeof__(*(ptr)) _n_ = (n); \ | ||
87 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | ||
88 | (unsigned long)_n_, sizeof (*(ptr))); \ | ||
89 | }) | ||
90 | |||
91 | #include <asm-generic/cmpxchg-local.h> | ||
92 | |||
93 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
94 | unsigned long old, | ||
95 | unsigned long new, int size) | ||
96 | { | ||
97 | switch (size) { | ||
98 | case 4: | ||
99 | return __cmpxchg_u32(ptr, old, new); | ||
100 | default: | ||
101 | return __cmpxchg_local_generic(ptr, old, new, size); | ||
102 | } | ||
103 | |||
104 | return old; | ||
105 | } | ||
106 | |||
107 | /* | ||
108 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
109 | * them available. | ||
110 | */ | ||
111 | #define cmpxchg_local(ptr, o, n) \ | ||
112 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
113 | (unsigned long)(n), sizeof(*(ptr)))) | ||
114 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
115 | |||
116 | /* | ||
117 | * xchg_u32 | ||
118 | * | ||
119 | * Note that a15 is used here because the register allocation | ||
120 | * done by the compiler is not guaranteed and a window overflow | ||
121 | * may not occur between the rsil and wsr instructions. By using | ||
122 | * a15 in the rsil, the machine is guaranteed to be in a state | ||
123 | * where no register reference will cause an overflow. | ||
124 | */ | ||
125 | |||
126 | static inline unsigned long xchg_u32(volatile int * m, unsigned long val) | ||
127 | { | ||
128 | unsigned long tmp; | ||
129 | __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" | ||
130 | "l32i %0, %1, 0 \n\t" | ||
131 | "s32i %2, %1, 0 \n\t" | ||
132 | "wsr a15, "__stringify(PS)" \n\t" | ||
133 | "rsync \n\t" | ||
134 | : "=&a" (tmp) | ||
135 | : "a" (m), "a" (val) | ||
136 | : "a15", "memory"); | ||
137 | return tmp; | ||
138 | } | ||
139 | |||
140 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | ||
141 | |||
142 | /* | ||
143 | * This only works if the compiler isn't horribly bad at optimizing. | ||
144 | * gcc-2.5.8 reportedly can't handle this, but I define that one to | ||
145 | * be dead anyway. | ||
146 | */ | ||
147 | |||
148 | extern void __xchg_called_with_bad_pointer(void); | ||
149 | |||
150 | static __inline__ unsigned long | ||
151 | __xchg(unsigned long x, volatile void * ptr, int size) | ||
152 | { | ||
153 | switch (size) { | ||
154 | case 4: | ||
155 | return xchg_u32(ptr, x); | ||
156 | } | ||
157 | __xchg_called_with_bad_pointer(); | ||
158 | return x; | ||
159 | } | ||
160 | |||
161 | extern void set_except_vector(int n, void *addr); | ||
162 | |||
163 | static inline void spill_registers(void) | ||
164 | { | ||
165 | unsigned int a0, ps; | ||
166 | |||
167 | __asm__ __volatile__ ( | ||
168 | "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t" | ||
169 | "mov a12, a0\n\t" | ||
170 | "rsr a13," __stringify(SAR) "\n\t" | ||
171 | "xsr a14," __stringify(PS) "\n\t" | ||
172 | "movi a0, _spill_registers\n\t" | ||
173 | "rsync\n\t" | ||
174 | "callx0 a0\n\t" | ||
175 | "mov a0, a12\n\t" | ||
176 | "wsr a13," __stringify(SAR) "\n\t" | ||
177 | "wsr a14," __stringify(PS) "\n\t" | ||
178 | :: "a" (&a0), "a" (&ps) | ||
179 | : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory"); | ||
180 | } | ||
181 | |||
182 | #define arch_align_stack(x) (x) | ||
183 | |||
184 | #endif /* _XTENSA_SYSTEM_H */ | ||
diff --git a/arch/xtensa/include/asm/termbits.h b/arch/xtensa/include/asm/termbits.h new file mode 100644 index 00000000000..0d6c8715b24 --- /dev/null +++ b/arch/xtensa/include/asm/termbits.h | |||
@@ -0,0 +1,220 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/termbits.h | ||
3 | * | ||
4 | * Copied from SH. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_TERMBITS_H | ||
14 | #define _XTENSA_TERMBITS_H | ||
15 | |||
16 | |||
17 | #include <linux/posix_types.h> | ||
18 | |||
19 | typedef unsigned char cc_t; | ||
20 | typedef unsigned int speed_t; | ||
21 | typedef unsigned int tcflag_t; | ||
22 | |||
23 | #define NCCS 19 | ||
24 | struct termios { | ||
25 | tcflag_t c_iflag; /* input mode flags */ | ||
26 | tcflag_t c_oflag; /* output mode flags */ | ||
27 | tcflag_t c_cflag; /* control mode flags */ | ||
28 | tcflag_t c_lflag; /* local mode flags */ | ||
29 | cc_t c_line; /* line discipline */ | ||
30 | cc_t c_cc[NCCS]; /* control characters */ | ||
31 | }; | ||
32 | |||
33 | struct termios2 { | ||
34 | tcflag_t c_iflag; /* input mode flags */ | ||
35 | tcflag_t c_oflag; /* output mode flags */ | ||
36 | tcflag_t c_cflag; /* control mode flags */ | ||
37 | tcflag_t c_lflag; /* local mode flags */ | ||
38 | cc_t c_line; /* line discipline */ | ||
39 | cc_t c_cc[NCCS]; /* control characters */ | ||
40 | speed_t c_ispeed; /* input speed */ | ||
41 | speed_t c_ospeed; /* output speed */ | ||
42 | }; | ||
43 | |||
44 | struct ktermios { | ||
45 | tcflag_t c_iflag; /* input mode flags */ | ||
46 | tcflag_t c_oflag; /* output mode flags */ | ||
47 | tcflag_t c_cflag; /* control mode flags */ | ||
48 | tcflag_t c_lflag; /* local mode flags */ | ||
49 | cc_t c_line; /* line discipline */ | ||
50 | cc_t c_cc[NCCS]; /* control characters */ | ||
51 | speed_t c_ispeed; /* input speed */ | ||
52 | speed_t c_ospeed; /* output speed */ | ||
53 | }; | ||
54 | |||
55 | /* c_cc characters */ | ||
56 | |||
57 | #define VINTR 0 | ||
58 | #define VQUIT 1 | ||
59 | #define VERASE 2 | ||
60 | #define VKILL 3 | ||
61 | #define VEOF 4 | ||
62 | #define VTIME 5 | ||
63 | #define VMIN 6 | ||
64 | #define VSWTC 7 | ||
65 | #define VSTART 8 | ||
66 | #define VSTOP 9 | ||
67 | #define VSUSP 10 | ||
68 | #define VEOL 11 | ||
69 | #define VREPRINT 12 | ||
70 | #define VDISCARD 13 | ||
71 | #define VWERASE 14 | ||
72 | #define VLNEXT 15 | ||
73 | #define VEOL2 16 | ||
74 | |||
75 | /* c_iflag bits */ | ||
76 | |||
77 | #define IGNBRK 0000001 | ||
78 | #define BRKINT 0000002 | ||
79 | #define IGNPAR 0000004 | ||
80 | #define PARMRK 0000010 | ||
81 | #define INPCK 0000020 | ||
82 | #define ISTRIP 0000040 | ||
83 | #define INLCR 0000100 | ||
84 | #define IGNCR 0000200 | ||
85 | #define ICRNL 0000400 | ||
86 | #define IUCLC 0001000 | ||
87 | #define IXON 0002000 | ||
88 | #define IXANY 0004000 | ||
89 | #define IXOFF 0010000 | ||
90 | #define IMAXBEL 0020000 | ||
91 | #define IUTF8 0040000 | ||
92 | |||
93 | /* c_oflag bits */ | ||
94 | |||
95 | #define OPOST 0000001 | ||
96 | #define OLCUC 0000002 | ||
97 | #define ONLCR 0000004 | ||
98 | #define OCRNL 0000010 | ||
99 | #define ONOCR 0000020 | ||
100 | #define ONLRET 0000040 | ||
101 | #define OFILL 0000100 | ||
102 | #define OFDEL 0000200 | ||
103 | #define NLDLY 0000400 | ||
104 | #define NL0 0000000 | ||
105 | #define NL1 0000400 | ||
106 | #define CRDLY 0003000 | ||
107 | #define CR0 0000000 | ||
108 | #define CR1 0001000 | ||
109 | #define CR2 0002000 | ||
110 | #define CR3 0003000 | ||
111 | #define TABDLY 0014000 | ||
112 | #define TAB0 0000000 | ||
113 | #define TAB1 0004000 | ||
114 | #define TAB2 0010000 | ||
115 | #define TAB3 0014000 | ||
116 | #define XTABS 0014000 | ||
117 | #define BSDLY 0020000 | ||
118 | #define BS0 0000000 | ||
119 | #define BS1 0020000 | ||
120 | #define VTDLY 0040000 | ||
121 | #define VT0 0000000 | ||
122 | #define VT1 0040000 | ||
123 | #define FFDLY 0100000 | ||
124 | #define FF0 0000000 | ||
125 | #define FF1 0100000 | ||
126 | |||
127 | /* c_cflag bit meaning */ | ||
128 | |||
129 | #define CBAUD 0010017 | ||
130 | #define B0 0000000 /* hang up */ | ||
131 | #define B50 0000001 | ||
132 | #define B75 0000002 | ||
133 | #define B110 0000003 | ||
134 | #define B134 0000004 | ||
135 | #define B150 0000005 | ||
136 | #define B200 0000006 | ||
137 | #define B300 0000007 | ||
138 | #define B600 0000010 | ||
139 | #define B1200 0000011 | ||
140 | #define B1800 0000012 | ||
141 | #define B2400 0000013 | ||
142 | #define B4800 0000014 | ||
143 | #define B9600 0000015 | ||
144 | #define B19200 0000016 | ||
145 | #define B38400 0000017 | ||
146 | #define EXTA B19200 | ||
147 | #define EXTB B38400 | ||
148 | #define CSIZE 0000060 | ||
149 | #define CS5 0000000 | ||
150 | #define CS6 0000020 | ||
151 | #define CS7 0000040 | ||
152 | #define CS8 0000060 | ||
153 | #define CSTOPB 0000100 | ||
154 | #define CREAD 0000200 | ||
155 | #define PARENB 0000400 | ||
156 | #define PARODD 0001000 | ||
157 | #define HUPCL 0002000 | ||
158 | #define CLOCAL 0004000 | ||
159 | #define CBAUDEX 0010000 | ||
160 | #define BOTHER 0010000 | ||
161 | #define B57600 0010001 | ||
162 | #define B115200 0010002 | ||
163 | #define B230400 0010003 | ||
164 | #define B460800 0010004 | ||
165 | #define B500000 0010005 | ||
166 | #define B576000 0010006 | ||
167 | #define B921600 0010007 | ||
168 | #define B1000000 0010010 | ||
169 | #define B1152000 0010011 | ||
170 | #define B1500000 0010012 | ||
171 | #define B2000000 0010013 | ||
172 | #define B2500000 0010014 | ||
173 | #define B3000000 0010015 | ||
174 | #define B3500000 0010016 | ||
175 | #define B4000000 0010017 | ||
176 | #define CIBAUD 002003600000 /* input baud rate */ | ||
177 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
178 | #define CRTSCTS 020000000000 /* flow control */ | ||
179 | |||
180 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
181 | |||
182 | /* c_lflag bits */ | ||
183 | |||
184 | #define ISIG 0000001 | ||
185 | #define ICANON 0000002 | ||
186 | #define XCASE 0000004 | ||
187 | #define ECHO 0000010 | ||
188 | #define ECHOE 0000020 | ||
189 | #define ECHOK 0000040 | ||
190 | #define ECHONL 0000100 | ||
191 | #define NOFLSH 0000200 | ||
192 | #define TOSTOP 0000400 | ||
193 | #define ECHOCTL 0001000 | ||
194 | #define ECHOPRT 0002000 | ||
195 | #define ECHOKE 0004000 | ||
196 | #define FLUSHO 0010000 | ||
197 | #define PENDIN 0040000 | ||
198 | #define IEXTEN 0100000 | ||
199 | #define EXTPROC 0200000 | ||
200 | |||
201 | /* tcflow() and TCXONC use these */ | ||
202 | |||
203 | #define TCOOFF 0 | ||
204 | #define TCOON 1 | ||
205 | #define TCIOFF 2 | ||
206 | #define TCION 3 | ||
207 | |||
208 | /* tcflush() and TCFLSH use these */ | ||
209 | |||
210 | #define TCIFLUSH 0 | ||
211 | #define TCOFLUSH 1 | ||
212 | #define TCIOFLUSH 2 | ||
213 | |||
214 | /* tcsetattr uses these */ | ||
215 | |||
216 | #define TCSANOW 0 | ||
217 | #define TCSADRAIN 1 | ||
218 | #define TCSAFLUSH 2 | ||
219 | |||
220 | #endif /* _XTENSA_TERMBITS_H */ | ||
diff --git a/arch/xtensa/include/asm/termios.h b/arch/xtensa/include/asm/termios.h new file mode 100644 index 00000000000..4673f42f88a --- /dev/null +++ b/arch/xtensa/include/asm/termios.h | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/termios.h | ||
3 | * | ||
4 | * Copied from SH. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_TERMIOS_H | ||
14 | #define _XTENSA_TERMIOS_H | ||
15 | |||
16 | #include <asm/termbits.h> | ||
17 | #include <asm/ioctls.h> | ||
18 | |||
19 | struct winsize { | ||
20 | unsigned short ws_row; | ||
21 | unsigned short ws_col; | ||
22 | unsigned short ws_xpixel; | ||
23 | unsigned short ws_ypixel; | ||
24 | }; | ||
25 | |||
26 | #define NCC 8 | ||
27 | struct termio { | ||
28 | unsigned short c_iflag; /* input mode flags */ | ||
29 | unsigned short c_oflag; /* output mode flags */ | ||
30 | unsigned short c_cflag; /* control mode flags */ | ||
31 | unsigned short c_lflag; /* local mode flags */ | ||
32 | unsigned char c_line; /* line discipline */ | ||
33 | unsigned char c_cc[NCC]; /* control characters */ | ||
34 | }; | ||
35 | |||
36 | /* Modem lines */ | ||
37 | |||
38 | #define TIOCM_LE 0x001 | ||
39 | #define TIOCM_DTR 0x002 | ||
40 | #define TIOCM_RTS 0x004 | ||
41 | #define TIOCM_ST 0x008 | ||
42 | #define TIOCM_SR 0x010 | ||
43 | #define TIOCM_CTS 0x020 | ||
44 | #define TIOCM_CAR 0x040 | ||
45 | #define TIOCM_RNG 0x080 | ||
46 | #define TIOCM_DSR 0x100 | ||
47 | #define TIOCM_CD TIOCM_CAR | ||
48 | #define TIOCM_RI TIOCM_RNG | ||
49 | #define TIOCM_OUT1 0x2000 | ||
50 | #define TIOCM_OUT2 0x4000 | ||
51 | #define TIOCM_LOOP 0x8000 | ||
52 | |||
53 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
54 | |||
55 | #ifdef __KERNEL__ | ||
56 | |||
57 | /* intr=^C quit=^\ erase=del kill=^U | ||
58 | eof=^D vtime=\0 vmin=\1 sxtc=\0 | ||
59 | start=^Q stop=^S susp=^Z eol=\0 | ||
60 | reprint=^R discard=^U werase=^W lnext=^V | ||
61 | eol2=\0 | ||
62 | */ | ||
63 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" | ||
64 | |||
65 | /* | ||
66 | * Translate a "termio" structure into a "termios". Ugh. | ||
67 | */ | ||
68 | |||
69 | #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ | ||
70 | unsigned short __tmp; \ | ||
71 | get_user(__tmp,&(termio)->x); \ | ||
72 | *(unsigned short *) &(termios)->x = __tmp; \ | ||
73 | } | ||
74 | |||
75 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
76 | ({ \ | ||
77 | SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ | ||
78 | SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ | ||
79 | SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ | ||
80 | SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ | ||
81 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
82 | }) | ||
83 | |||
84 | /* | ||
85 | * Translate a "termios" structure into a "termio". Ugh. | ||
86 | */ | ||
87 | |||
88 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
89 | ({ \ | ||
90 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
91 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
92 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
93 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
94 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
95 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
96 | }) | ||
97 | |||
98 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) | ||
99 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) | ||
100 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
101 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
102 | |||
103 | #endif /* __KERNEL__ */ | ||
104 | |||
105 | #endif /* _XTENSA_TERMIOS_H */ | ||
diff --git a/arch/xtensa/include/asm/topology.h b/arch/xtensa/include/asm/topology.h new file mode 100644 index 00000000000..7309e38a0cc --- /dev/null +++ b/arch/xtensa/include/asm/topology.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/topology.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_TOPOLOGY_H | ||
12 | #define _XTENSA_TOPOLOGY_H | ||
13 | |||
14 | #include <asm-generic/topology.h> | ||
15 | |||
16 | #endif /* _XTENSA_TOPOLOGY_H */ | ||
diff --git a/arch/xtensa/include/asm/xor.h b/arch/xtensa/include/asm/xor.h new file mode 100644 index 00000000000..e7b1f083991 --- /dev/null +++ b/arch/xtensa/include/asm/xor.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/xor.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_XOR_H | ||
12 | #define _XTENSA_XOR_H | ||
13 | |||
14 | #include <asm-generic/xor.h> | ||
15 | |||
16 | #endif | ||
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c new file mode 100644 index 00000000000..cd122fb7e48 --- /dev/null +++ b/arch/xtensa/kernel/init_task.c | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * arch/xtensa/kernel/init_task.c | ||
3 | * | ||
4 | * Xtensa Processor version. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2007 Tensilica Inc. | ||
11 | * | ||
12 | * Chris Zankel <chris@zankel.net> | ||
13 | */ | ||
14 | |||
15 | #include <linux/mm.h> | ||
16 | #include <linux/fs.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/init_task.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/mqueue.h> | ||
21 | |||
22 | #include <asm/uaccess.h> | ||
23 | |||
24 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
25 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
26 | union thread_union init_thread_union __init_task_data = | ||
27 | { INIT_THREAD_INFO(init_task) }; | ||
28 | |||
29 | struct task_struct init_task = INIT_TASK(init_task); | ||
30 | |||
31 | EXPORT_SYMBOL(init_task); | ||
diff --git a/arch/xtensa/kernel/io.c b/arch/xtensa/kernel/io.c new file mode 100644 index 00000000000..5b65269b1d2 --- /dev/null +++ b/arch/xtensa/kernel/io.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * arch/xtensa/io.c | ||
3 | * | ||
4 | * IO primitives | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | * Copied from sparc. | ||
12 | * | ||
13 | * Chris Zankel <chris@zankel.net> | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <asm/io.h> | ||
18 | #include <asm/byteorder.h> | ||
19 | |||
20 | void outsb(unsigned long addr, const void *src, unsigned long count) { | ||
21 | while (count) { | ||
22 | count -= 1; | ||
23 | writeb(*(const char *)src, addr); | ||
24 | src += 1; | ||
25 | addr += 1; | ||
26 | } | ||
27 | } | ||
28 | |||
29 | void outsw(unsigned long addr, const void *src, unsigned long count) { | ||
30 | while (count) { | ||
31 | count -= 2; | ||
32 | writew(*(const short *)src, addr); | ||
33 | src += 2; | ||
34 | addr += 2; | ||
35 | } | ||
36 | } | ||
37 | |||
38 | void outsl(unsigned long addr, const void *src, unsigned long count) { | ||
39 | while (count) { | ||
40 | count -= 4; | ||
41 | writel(*(const long *)src, addr); | ||
42 | src += 4; | ||
43 | addr += 4; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | void insb(unsigned long addr, void *dst, unsigned long count) { | ||
48 | while (count) { | ||
49 | count -= 1; | ||
50 | *(unsigned char *)dst = readb(addr); | ||
51 | dst += 1; | ||
52 | addr += 1; | ||
53 | } | ||
54 | } | ||
55 | |||
56 | void insw(unsigned long addr, void *dst, unsigned long count) { | ||
57 | while (count) { | ||
58 | count -= 2; | ||
59 | *(unsigned short *)dst = readw(addr); | ||
60 | dst += 2; | ||
61 | addr += 2; | ||
62 | } | ||
63 | } | ||
64 | |||
65 | void insl(unsigned long addr, void *dst, unsigned long count) { | ||
66 | while (count) { | ||
67 | count -= 4; | ||
68 | /* | ||
69 | * XXX I am sure we are in for an unaligned trap here. | ||
70 | */ | ||
71 | *(unsigned long *)dst = readl(addr); | ||
72 | dst += 4; | ||
73 | addr += 4; | ||
74 | } | ||
75 | } | ||
diff --git a/arch/xtensa/platforms/iss/io.c b/arch/xtensa/platforms/iss/io.c new file mode 100644 index 00000000000..571d0b24f89 --- /dev/null +++ b/arch/xtensa/platforms/iss/io.c | |||
@@ -0,0 +1,32 @@ | |||
1 | /* This file isn't really needed right now. */ | ||
2 | |||
3 | #if 0 | ||
4 | |||
5 | #include <asm/io.h> | ||
6 | #include <platform/platform-iss/simcall.h> | ||
7 | |||
8 | extern int __simc (); | ||
9 | |||
10 | |||
11 | char iss_serial_getc() | ||
12 | { | ||
13 | char c; | ||
14 | __simc( SYS_read, 0, &c, 1 ); | ||
15 | return c; | ||
16 | } | ||
17 | |||
18 | void iss_serial_putc( char c ) | ||
19 | { | ||
20 | __simc( SYS_write, 1, &c, 1 ); | ||
21 | } | ||
22 | |||
23 | void iss_serial_puts( char *s ) | ||
24 | { | ||
25 | if( s != 0 && *s != 0 ) | ||
26 | __simc( SYS_write, 1, s, strlen(s) ); | ||
27 | } | ||
28 | |||
29 | /*#error Need I/O ports to specific hardware!*/ | ||
30 | |||
31 | #endif | ||
32 | |||