diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/m32r | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'arch/m32r')
27 files changed, 1142 insertions, 0 deletions
diff --git a/arch/m32r/include/asm/auxvec.h b/arch/m32r/include/asm/auxvec.h new file mode 100644 index 00000000000..f76dcc860fa --- /dev/null +++ b/arch/m32r/include/asm/auxvec.h | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #ifndef _ASM_M32R__AUXVEC_H | ||
| 2 | #define _ASM_M32R__AUXVEC_H | ||
| 3 | |||
| 4 | #endif /* _ASM_M32R__AUXVEC_H */ | ||
diff --git a/arch/m32r/include/asm/bitsperlong.h b/arch/m32r/include/asm/bitsperlong.h new file mode 100644 index 00000000000..6dc0bb0c13b --- /dev/null +++ b/arch/m32r/include/asm/bitsperlong.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/bitsperlong.h> | |||
diff --git a/arch/m32r/include/asm/byteorder.h b/arch/m32r/include/asm/byteorder.h new file mode 100644 index 00000000000..21855d8b028 --- /dev/null +++ b/arch/m32r/include/asm/byteorder.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _ASM_M32R_BYTEORDER_H | ||
| 2 | #define _ASM_M32R_BYTEORDER_H | ||
| 3 | |||
| 4 | #if defined(__LITTLE_ENDIAN__) | ||
| 5 | # include <linux/byteorder/little_endian.h> | ||
| 6 | #else | ||
| 7 | # include <linux/byteorder/big_endian.h> | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif /* _ASM_M32R_BYTEORDER_H */ | ||
diff --git a/arch/m32r/include/asm/errno.h b/arch/m32r/include/asm/errno.h new file mode 100644 index 00000000000..777149262aa --- /dev/null +++ b/arch/m32r/include/asm/errno.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _ASM_M32R_ERRNO_H | ||
| 2 | #define _ASM_M32R_ERRNO_H | ||
| 3 | |||
| 4 | #include <asm-generic/errno.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_M32R_ERRNO_H */ | ||
diff --git a/arch/m32r/include/asm/fcntl.h b/arch/m32r/include/asm/fcntl.h new file mode 100644 index 00000000000..46ab12db573 --- /dev/null +++ b/arch/m32r/include/asm/fcntl.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/fcntl.h> | |||
diff --git a/arch/m32r/include/asm/ioctl.h b/arch/m32r/include/asm/ioctl.h new file mode 100644 index 00000000000..b279fe06dfe --- /dev/null +++ b/arch/m32r/include/asm/ioctl.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/ioctl.h> | |||
diff --git a/arch/m32r/include/asm/ioctls.h b/arch/m32r/include/asm/ioctls.h new file mode 100644 index 00000000000..349bf87bfbd --- /dev/null +++ b/arch/m32r/include/asm/ioctls.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ARCH_M32R_IOCTLS_H__ | ||
| 2 | #define __ARCH_M32R_IOCTLS_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/ioctls.h> | ||
| 5 | |||
| 6 | #endif /* __ARCH_M32R_IOCTLS_H__ */ | ||
diff --git a/arch/m32r/include/asm/ipcbuf.h b/arch/m32r/include/asm/ipcbuf.h new file mode 100644 index 00000000000..8d2d7c8ffdb --- /dev/null +++ b/arch/m32r/include/asm/ipcbuf.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #ifndef _ASM_M32R_IPCBUF_H | ||
| 2 | #define _ASM_M32R_IPCBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The ipc64_perm structure for m32r 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 | |||
| 14 | struct 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 /* _ASM_M32R_IPCBUF_H */ | ||
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h new file mode 100644 index 00000000000..8eebf89f5ab --- /dev/null +++ b/arch/m32r/include/asm/mman.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/mman.h> | |||
diff --git a/arch/m32r/include/asm/module.h b/arch/m32r/include/asm/module.h new file mode 100644 index 00000000000..eb73ee01121 --- /dev/null +++ b/arch/m32r/include/asm/module.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _ASM_M32R_MODULE_H | ||
| 2 | #define _ASM_M32R_MODULE_H | ||
| 3 | |||
| 4 | struct mod_arch_specific { }; | ||
| 5 | |||
| 6 | #define Elf_Shdr Elf32_Shdr | ||
| 7 | #define Elf_Sym Elf32_Sym | ||
| 8 | #define Elf_Ehdr Elf32_Ehdr | ||
| 9 | |||
| 10 | #endif /* _ASM_M32R_MODULE_H */ | ||
diff --git a/arch/m32r/include/asm/msgbuf.h b/arch/m32r/include/asm/msgbuf.h new file mode 100644 index 00000000000..0d5a877b813 --- /dev/null +++ b/arch/m32r/include/asm/msgbuf.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #ifndef _ASM_M32R_MSGBUF_H | ||
| 2 | #define _ASM_M32R_MSGBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The msqid64_ds structure for m32r 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 | |||
| 14 | struct 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 /* _ASM_M32R_MSGBUF_H */ | ||
diff --git a/arch/m32r/include/asm/param.h b/arch/m32r/include/asm/param.h new file mode 100644 index 00000000000..94c77019604 --- /dev/null +++ b/arch/m32r/include/asm/param.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef _ASM_M32R_PARAM_H | ||
| 2 | #define _ASM_M32R_PARAM_H | ||
| 3 | |||
| 4 | #ifdef __KERNEL__ | ||
| 5 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ | ||
| 6 | # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | ||
| 7 | # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #ifndef HZ | ||
| 11 | #define HZ 100 | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #define EXEC_PAGESIZE 4096 | ||
| 15 | |||
| 16 | #ifndef NOGROUP | ||
| 17 | #define NOGROUP (-1) | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
| 21 | |||
| 22 | #endif /* _ASM_M32R_PARAM_H */ | ||
| 23 | |||
diff --git a/arch/m32r/include/asm/poll.h b/arch/m32r/include/asm/poll.h new file mode 100644 index 00000000000..c98509d3149 --- /dev/null +++ b/arch/m32r/include/asm/poll.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/poll.h> | |||
diff --git a/arch/m32r/include/asm/posix_types.h b/arch/m32r/include/asm/posix_types.h new file mode 100644 index 00000000000..b309c585863 --- /dev/null +++ b/arch/m32r/include/asm/posix_types.h | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | #ifndef _ASM_M32R_POSIX_TYPES_H | ||
| 2 | #define _ASM_M32R_POSIX_TYPES_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * This file is generally used by user-level software, so you need to | ||
| 6 | * be a little careful about namespace pollution etc. Also, we cannot | ||
| 7 | * assume GCC is being used. | ||
| 8 | */ | ||
| 9 | |||
| 10 | typedef unsigned long __kernel_ino_t; | ||
| 11 | typedef unsigned short __kernel_mode_t; | ||
| 12 | typedef unsigned short __kernel_nlink_t; | ||
| 13 | typedef long __kernel_off_t; | ||
| 14 | typedef int __kernel_pid_t; | ||
| 15 | typedef unsigned short __kernel_ipc_pid_t; | ||
| 16 | typedef unsigned short __kernel_uid_t; | ||
| 17 | typedef unsigned short __kernel_gid_t; | ||
| 18 | typedef unsigned int __kernel_size_t; | ||
| 19 | typedef int __kernel_ssize_t; | ||
| 20 | typedef int __kernel_ptrdiff_t; | ||
| 21 | typedef long __kernel_time_t; | ||
| 22 | typedef long __kernel_suseconds_t; | ||
| 23 | typedef long __kernel_clock_t; | ||
| 24 | typedef int __kernel_timer_t; | ||
| 25 | typedef int __kernel_clockid_t; | ||
| 26 | typedef int __kernel_daddr_t; | ||
| 27 | typedef char * __kernel_caddr_t; | ||
| 28 | typedef unsigned short __kernel_uid16_t; | ||
| 29 | typedef unsigned short __kernel_gid16_t; | ||
| 30 | typedef unsigned int __kernel_uid32_t; | ||
| 31 | typedef unsigned int __kernel_gid32_t; | ||
| 32 | |||
| 33 | typedef unsigned short __kernel_old_uid_t; | ||
| 34 | typedef unsigned short __kernel_old_gid_t; | ||
| 35 | typedef unsigned short __kernel_old_dev_t; | ||
| 36 | |||
| 37 | #ifdef __GNUC__ | ||
| 38 | typedef long long __kernel_loff_t; | ||
| 39 | #endif | ||
| 40 | |||
| 41 | typedef struct { | ||
| 42 | int val[2]; | ||
| 43 | } __kernel_fsid_t; | ||
| 44 | |||
| 45 | #if defined(__KERNEL__) | ||
| 46 | |||
| 47 | #undef __FD_SET | ||
| 48 | static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
| 49 | { | ||
| 50 | unsigned long __tmp = __fd / __NFDBITS; | ||
| 51 | unsigned long __rem = __fd % __NFDBITS; | ||
| 52 | __fdsetp->fds_bits[__tmp] |= (1UL<<__rem); | ||
| 53 | } | ||
| 54 | |||
| 55 | #undef __FD_CLR | ||
| 56 | static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
| 57 | { | ||
| 58 | unsigned long __tmp = __fd / __NFDBITS; | ||
| 59 | unsigned long __rem = __fd % __NFDBITS; | ||
| 60 | __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem); | ||
| 61 | } | ||
| 62 | |||
| 63 | |||
| 64 | #undef __FD_ISSET | ||
| 65 | static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p) | ||
| 66 | { | ||
| 67 | unsigned long __tmp = __fd / __NFDBITS; | ||
| 68 | unsigned long __rem = __fd % __NFDBITS; | ||
| 69 | return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0; | ||
| 70 | } | ||
| 71 | |||
| 72 | /* | ||
| 73 | * This will unroll the loop for the normal constant case (8 ints, | ||
| 74 | * for a 256-bit fd_set) | ||
| 75 | */ | ||
| 76 | #undef __FD_ZERO | ||
| 77 | static __inline__ void __FD_ZERO(__kernel_fd_set *__p) | ||
| 78 | { | ||
| 79 | unsigned long *__tmp = __p->fds_bits; | ||
| 80 | int __i; | ||
| 81 | |||
| 82 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
| 83 | switch (__FDSET_LONGS) { | ||
| 84 | case 16: | ||
| 85 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
| 86 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
| 87 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
| 88 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
| 89 | __tmp[ 8] = 0; __tmp[ 9] = 0; | ||
| 90 | __tmp[10] = 0; __tmp[11] = 0; | ||
| 91 | __tmp[12] = 0; __tmp[13] = 0; | ||
| 92 | __tmp[14] = 0; __tmp[15] = 0; | ||
| 93 | return; | ||
| 94 | |||
| 95 | case 8: | ||
| 96 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
| 97 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
| 98 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
| 99 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
| 100 | return; | ||
| 101 | |||
| 102 | case 4: | ||
| 103 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
| 104 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
| 105 | return; | ||
| 106 | } | ||
| 107 | } | ||
| 108 | __i = __FDSET_LONGS; | ||
| 109 | while (__i) { | ||
| 110 | __i--; | ||
| 111 | *__tmp = 0; | ||
| 112 | __tmp++; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | #endif /* defined(__KERNEL__) */ | ||
| 117 | |||
| 118 | #endif /* _ASM_M32R_POSIX_TYPES_H */ | ||
diff --git a/arch/m32r/include/asm/resource.h b/arch/m32r/include/asm/resource.h new file mode 100644 index 00000000000..b1ce766e37a --- /dev/null +++ b/arch/m32r/include/asm/resource.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _ASM_M32R_RESOURCE_H | ||
| 2 | #define _ASM_M32R_RESOURCE_H | ||
| 3 | |||
| 4 | #include <asm-generic/resource.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_M32R_RESOURCE_H */ | ||
diff --git a/arch/m32r/include/asm/sembuf.h b/arch/m32r/include/asm/sembuf.h new file mode 100644 index 00000000000..c9873d6890e --- /dev/null +++ b/arch/m32r/include/asm/sembuf.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef _ASM_M32R_SEMBUF_H | ||
| 2 | #define _ASM_M32R_SEMBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The semid64_ds structure for m32r 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 | |||
| 14 | struct 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 /* _ASM_M32R_SEMBUF_H */ | ||
diff --git a/arch/m32r/include/asm/shmbuf.h b/arch/m32r/include/asm/shmbuf.h new file mode 100644 index 00000000000..b0cdf0aa7d6 --- /dev/null +++ b/arch/m32r/include/asm/shmbuf.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #ifndef _ASM_M32R_SHMBUF_H | ||
| 2 | #define _ASM_M32R_SHMBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The shmid64_ds structure for M32R 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 | |||
| 14 | struct 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 | |||
| 30 | struct 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 /* _ASM_M32R_SHMBUF_H */ | ||
diff --git a/arch/m32r/include/asm/sigcontext.h b/arch/m32r/include/asm/sigcontext.h new file mode 100644 index 00000000000..da4a9c36d09 --- /dev/null +++ b/arch/m32r/include/asm/sigcontext.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef _ASM_M32R_SIGCONTEXT_H | ||
| 2 | #define _ASM_M32R_SIGCONTEXT_H | ||
| 3 | |||
| 4 | struct sigcontext { | ||
| 5 | /* CPU registers */ | ||
| 6 | /* Saved main processor registers. */ | ||
| 7 | unsigned long sc_r4; | ||
| 8 | unsigned long sc_r5; | ||
| 9 | unsigned long sc_r6; | ||
| 10 | struct pt_regs *sc_pt_regs; | ||
| 11 | unsigned long sc_r0; | ||
| 12 | unsigned long sc_r1; | ||
| 13 | unsigned long sc_r2; | ||
| 14 | unsigned long sc_r3; | ||
| 15 | unsigned long sc_r7; | ||
| 16 | unsigned long sc_r8; | ||
| 17 | unsigned long sc_r9; | ||
| 18 | unsigned long sc_r10; | ||
| 19 | unsigned long sc_r11; | ||
| 20 | unsigned long sc_r12; | ||
| 21 | |||
| 22 | /* Saved main processor status and miscellaneous context registers. */ | ||
| 23 | unsigned long sc_acc0h; | ||
| 24 | unsigned long sc_acc0l; | ||
| 25 | unsigned long sc_acc1h; /* ISA_DSP_LEVEL2 only */ | ||
| 26 | unsigned long sc_acc1l; /* ISA_DSP_LEVEL2 only */ | ||
| 27 | unsigned long sc_psw; | ||
| 28 | unsigned long sc_bpc; /* saved PC for TRAP syscalls */ | ||
| 29 | unsigned long sc_bbpsw; | ||
| 30 | unsigned long sc_bbpc; | ||
| 31 | unsigned long sc_spu; /* saved user stack */ | ||
| 32 | unsigned long sc_fp; | ||
| 33 | unsigned long sc_lr; /* saved PC for JL syscalls */ | ||
| 34 | unsigned long sc_spi; /* saved kernel stack */ | ||
| 35 | |||
| 36 | unsigned long oldmask; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* _ASM_M32R_SIGCONTEXT_H */ | ||
diff --git a/arch/m32r/include/asm/siginfo.h b/arch/m32r/include/asm/siginfo.h new file mode 100644 index 00000000000..7d9cd9ebfd0 --- /dev/null +++ b/arch/m32r/include/asm/siginfo.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _M32R_SIGINFO_H | ||
| 2 | #define _M32R_SIGINFO_H | ||
| 3 | |||
| 4 | #include <asm-generic/siginfo.h> | ||
| 5 | |||
| 6 | #endif /* _M32R_SIGINFO_H */ | ||
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h new file mode 100644 index 00000000000..469787c3009 --- /dev/null +++ b/arch/m32r/include/asm/socket.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | #ifndef _ASM_M32R_SOCKET_H | ||
| 2 | #define _ASM_M32R_SOCKET_H | ||
| 3 | |||
| 4 | #include <asm/sockios.h> | ||
| 5 | |||
| 6 | /* For setsockoptions(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_SNDBUFFORCE 32 | ||
| 18 | #define SO_RCVBUFFORCE 33 | ||
| 19 | #define SO_KEEPALIVE 9 | ||
| 20 | #define SO_OOBINLINE 10 | ||
| 21 | #define SO_NO_CHECK 11 | ||
| 22 | #define SO_PRIORITY 12 | ||
| 23 | #define SO_LINGER 13 | ||
| 24 | #define SO_BSDCOMPAT 14 | ||
| 25 | /* To add :#define SO_REUSEPORT 15 */ | ||
| 26 | #define SO_PASSCRED 16 | ||
| 27 | #define SO_PEERCRED 17 | ||
| 28 | #define SO_RCVLOWAT 18 | ||
| 29 | #define SO_SNDLOWAT 19 | ||
| 30 | #define SO_RCVTIMEO 20 | ||
| 31 | #define SO_SNDTIMEO 21 | ||
| 32 | |||
| 33 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
| 34 | #define SO_SECURITY_AUTHENTICATION 22 | ||
| 35 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
| 36 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
| 37 | |||
| 38 | #define SO_BINDTODEVICE 25 | ||
| 39 | |||
| 40 | /* Socket filtering */ | ||
| 41 | #define SO_ATTACH_FILTER 26 | ||
| 42 | #define SO_DETACH_FILTER 27 | ||
| 43 | |||
| 44 | #define SO_PEERNAME 28 | ||
| 45 | #define SO_TIMESTAMP 29 | ||
| 46 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
| 47 | |||
| 48 | #define SO_ACCEPTCONN 30 | ||
| 49 | |||
| 50 | #define SO_PEERSEC 31 | ||
| 51 | #define SO_PASSSEC 34 | ||
| 52 | #define SO_TIMESTAMPNS 35 | ||
| 53 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
| 54 | |||
| 55 | #define SO_MARK 36 | ||
| 56 | |||
| 57 | #define SO_TIMESTAMPING 37 | ||
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
| 59 | |||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 63 | #define SO_RXQ_OVFL 40 | ||
| 64 | |||
| 65 | #endif /* _ASM_M32R_SOCKET_H */ | ||
diff --git a/arch/m32r/include/asm/sockios.h b/arch/m32r/include/asm/sockios.h new file mode 100644 index 00000000000..6c1fb9b43bd --- /dev/null +++ b/arch/m32r/include/asm/sockios.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #ifndef _ASM_M32R_SOCKIOS_H | ||
| 2 | #define _ASM_M32R_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 (timeval) */ | ||
| 11 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
| 12 | |||
| 13 | #endif /* _ASM_M32R_SOCKIOS_H */ | ||
diff --git a/arch/m32r/include/asm/stat.h b/arch/m32r/include/asm/stat.h new file mode 100644 index 00000000000..da4518f82d6 --- /dev/null +++ b/arch/m32r/include/asm/stat.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | #ifndef _ASM_M32R_STAT_H | ||
| 2 | #define _ASM_M32R_STAT_H | ||
| 3 | |||
| 4 | #include <asm/byteorder.h> | ||
| 5 | |||
| 6 | struct __old_kernel_stat { | ||
| 7 | unsigned short st_dev; | ||
| 8 | unsigned short st_ino; | ||
| 9 | unsigned short st_mode; | ||
| 10 | unsigned short st_nlink; | ||
| 11 | unsigned short st_uid; | ||
| 12 | unsigned short st_gid; | ||
| 13 | unsigned short st_rdev; | ||
| 14 | unsigned long st_size; | ||
| 15 | unsigned long st_atime; | ||
| 16 | unsigned long st_mtime; | ||
| 17 | unsigned long st_ctime; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #define STAT_HAVE_NSEC 1 | ||
| 21 | |||
| 22 | struct stat { | ||
| 23 | unsigned short st_dev; | ||
| 24 | unsigned short __pad1; | ||
| 25 | unsigned long st_ino; | ||
| 26 | unsigned short st_mode; | ||
| 27 | unsigned short st_nlink; | ||
| 28 | unsigned short st_uid; | ||
| 29 | unsigned short st_gid; | ||
| 30 | unsigned short st_rdev; | ||
| 31 | unsigned short __pad2; | ||
| 32 | unsigned long st_size; | ||
| 33 | unsigned long st_blksize; | ||
| 34 | unsigned long st_blocks; | ||
| 35 | unsigned long st_atime; | ||
| 36 | unsigned long st_atime_nsec; | ||
| 37 | unsigned long st_mtime; | ||
| 38 | unsigned long st_mtime_nsec; | ||
| 39 | unsigned long st_ctime; | ||
| 40 | unsigned long st_ctime_nsec; | ||
| 41 | unsigned long __unused4; | ||
| 42 | unsigned long __unused5; | ||
| 43 | }; | ||
| 44 | |||
| 45 | /* This matches struct stat64 in glibc2.1, hence the absolutely | ||
| 46 | * insane amounts of padding around dev_t's. | ||
| 47 | */ | ||
| 48 | struct stat64 { | ||
| 49 | unsigned long long st_dev; | ||
| 50 | unsigned char __pad0[4]; | ||
| 51 | #define STAT64_HAS_BROKEN_ST_INO | ||
| 52 | unsigned long __st_ino; | ||
| 53 | |||
| 54 | unsigned int st_mode; | ||
| 55 | unsigned int st_nlink; | ||
| 56 | |||
| 57 | unsigned long st_uid; | ||
| 58 | unsigned long st_gid; | ||
| 59 | |||
| 60 | unsigned long long st_rdev; | ||
| 61 | unsigned char __pad3[4]; | ||
| 62 | |||
| 63 | long long st_size; | ||
| 64 | unsigned long st_blksize; | ||
| 65 | |||
| 66 | #if defined(__BIG_ENDIAN) | ||
| 67 | unsigned long __pad4; /* future possible st_blocks high bits */ | ||
| 68 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 69 | #elif defined(__LITTLE_ENDIAN) | ||
| 70 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 71 | unsigned long __pad4; /* future possible st_blocks high bits */ | ||
| 72 | #else | ||
| 73 | #error no endian defined | ||
| 74 | #endif | ||
| 75 | unsigned long st_atime; | ||
| 76 | unsigned long st_atime_nsec; | ||
| 77 | |||
| 78 | unsigned long st_mtime; | ||
| 79 | unsigned long st_mtime_nsec; | ||
| 80 | |||
| 81 | unsigned long st_ctime; | ||
| 82 | unsigned long st_ctime_nsec; | ||
| 83 | |||
| 84 | unsigned long long st_ino; | ||
| 85 | }; | ||
| 86 | |||
| 87 | #endif /* _ASM_M32R_STAT_H */ | ||
diff --git a/arch/m32r/include/asm/statfs.h b/arch/m32r/include/asm/statfs.h new file mode 100644 index 00000000000..6eb4c6007e6 --- /dev/null +++ b/arch/m32r/include/asm/statfs.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _ASM_M32R_STATFS_H | ||
| 2 | #define _ASM_M32R_STATFS_H | ||
| 3 | |||
| 4 | #include <asm-generic/statfs.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_M32R_STATFS_H */ | ||
diff --git a/arch/m32r/include/asm/swab.h b/arch/m32r/include/asm/swab.h new file mode 100644 index 00000000000..54dab001d6d --- /dev/null +++ b/arch/m32r/include/asm/swab.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _ASM_M32R_SWAB_H | ||
| 2 | #define _ASM_M32R_SWAB_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
| 7 | # define __SWAB_64_THRU_32__ | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif /* _ASM_M32R_SWAB_H */ | ||
diff --git a/arch/m32r/include/asm/system.h b/arch/m32r/include/asm/system.h new file mode 100644 index 00000000000..13c46794ccb --- /dev/null +++ b/arch/m32r/include/asm/system.h | |||
| @@ -0,0 +1,367 @@ | |||
| 1 | #ifndef _ASM_M32R_SYSTEM_H | ||
| 2 | #define _ASM_M32R_SYSTEM_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 6 | * License. See the file "COPYING" in the main directory of this archive | ||
| 7 | * for more details. | ||
| 8 | * | ||
| 9 | * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto | ||
| 10 | * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/compiler.h> | ||
| 14 | #include <linux/irqflags.h> | ||
| 15 | #include <asm/assembler.h> | ||
| 16 | |||
| 17 | #ifdef __KERNEL__ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * switch_to(prev, next) should switch from task `prev' to `next' | ||
| 21 | * `prev' will never be the same as `next'. | ||
| 22 | * | ||
| 23 | * `next' and `prev' should be struct task_struct, but it isn't always defined | ||
| 24 | */ | ||
| 25 | |||
| 26 | #if defined(CONFIG_FRAME_POINTER) || \ | ||
| 27 | !defined(CONFIG_SCHED_OMIT_FRAME_POINTER) | ||
| 28 | #define M32R_PUSH_FP " push fp\n" | ||
| 29 | #define M32R_POP_FP " pop fp\n" | ||
| 30 | #else | ||
| 31 | #define M32R_PUSH_FP "" | ||
| 32 | #define M32R_POP_FP "" | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #define switch_to(prev, next, last) do { \ | ||
| 36 | __asm__ __volatile__ ( \ | ||
| 37 | " seth lr, #high(1f) \n" \ | ||
| 38 | " or3 lr, lr, #low(1f) \n" \ | ||
| 39 | " st lr, @%4 ; store old LR \n" \ | ||
| 40 | " ld lr, @%5 ; load new LR \n" \ | ||
| 41 | M32R_PUSH_FP \ | ||
| 42 | " st sp, @%2 ; store old SP \n" \ | ||
| 43 | " ld sp, @%3 ; load new SP \n" \ | ||
| 44 | " push %1 ; store `prev' on new stack \n" \ | ||
| 45 | " jmp lr \n" \ | ||
| 46 | " .fillinsn \n" \ | ||
| 47 | "1: \n" \ | ||
| 48 | " pop %0 ; restore `__last' from new stack \n" \ | ||
| 49 | M32R_POP_FP \ | ||
| 50 | : "=r" (last) \ | ||
| 51 | : "0" (prev), \ | ||
| 52 | "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \ | ||
| 53 | "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \ | ||
| 54 | : "memory", "lr" \ | ||
| 55 | ); \ | ||
| 56 | } while(0) | ||
| 57 | |||
| 58 | #define nop() __asm__ __volatile__ ("nop" : : ) | ||
| 59 | |||
| 60 | #define xchg(ptr, x) \ | ||
| 61 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) | ||
| 62 | #define xchg_local(ptr, x) \ | ||
| 63 | ((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr), \ | ||
| 64 | sizeof(*(ptr)))) | ||
| 65 | |||
| 66 | extern void __xchg_called_with_bad_pointer(void); | ||
| 67 | |||
| 68 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
| 69 | #define DCACHE_CLEAR(reg0, reg1, addr) \ | ||
| 70 | "seth "reg1", #high(dcache_dummy); \n\t" \ | ||
| 71 | "or3 "reg1", "reg1", #low(dcache_dummy); \n\t" \ | ||
| 72 | "lock "reg0", @"reg1"; \n\t" \ | ||
| 73 | "add3 "reg0", "addr", #0x1000; \n\t" \ | ||
| 74 | "ld "reg0", @"reg0"; \n\t" \ | ||
| 75 | "add3 "reg0", "addr", #0x2000; \n\t" \ | ||
| 76 | "ld "reg0", @"reg0"; \n\t" \ | ||
| 77 | "unlock "reg0", @"reg1"; \n\t" | ||
| 78 | /* FIXME: This workaround code cannot handle kernel modules | ||
| 79 | * correctly under SMP environment. | ||
| 80 | */ | ||
| 81 | #else /* CONFIG_CHIP_M32700_TS1 */ | ||
| 82 | #define DCACHE_CLEAR(reg0, reg1, addr) | ||
| 83 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
| 84 | |||
| 85 | static __always_inline unsigned long | ||
| 86 | __xchg(unsigned long x, volatile void *ptr, int size) | ||
| 87 | { | ||
| 88 | unsigned long flags; | ||
| 89 | unsigned long tmp = 0; | ||
| 90 | |||
| 91 | local_irq_save(flags); | ||
| 92 | |||
| 93 | switch (size) { | ||
| 94 | #ifndef CONFIG_SMP | ||
| 95 | case 1: | ||
| 96 | __asm__ __volatile__ ( | ||
| 97 | "ldb %0, @%2 \n\t" | ||
| 98 | "stb %1, @%2 \n\t" | ||
| 99 | : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); | ||
| 100 | break; | ||
| 101 | case 2: | ||
| 102 | __asm__ __volatile__ ( | ||
| 103 | "ldh %0, @%2 \n\t" | ||
| 104 | "sth %1, @%2 \n\t" | ||
| 105 | : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); | ||
| 106 | break; | ||
| 107 | case 4: | ||
| 108 | __asm__ __volatile__ ( | ||
| 109 | "ld %0, @%2 \n\t" | ||
| 110 | "st %1, @%2 \n\t" | ||
| 111 | : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); | ||
| 112 | break; | ||
| 113 | #else /* CONFIG_SMP */ | ||
| 114 | case 4: | ||
| 115 | __asm__ __volatile__ ( | ||
| 116 | DCACHE_CLEAR("%0", "r4", "%2") | ||
| 117 | "lock %0, @%2; \n\t" | ||
| 118 | "unlock %1, @%2; \n\t" | ||
| 119 | : "=&r" (tmp) : "r" (x), "r" (ptr) | ||
| 120 | : "memory" | ||
| 121 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
| 122 | , "r4" | ||
| 123 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
| 124 | ); | ||
| 125 | break; | ||
| 126 | #endif /* CONFIG_SMP */ | ||
| 127 | default: | ||
| 128 | __xchg_called_with_bad_pointer(); | ||
| 129 | } | ||
| 130 | |||
| 131 | local_irq_restore(flags); | ||
| 132 | |||
| 133 | return (tmp); | ||
| 134 | } | ||
| 135 | |||
| 136 | static __always_inline unsigned long | ||
| 137 | __xchg_local(unsigned long x, volatile void *ptr, int size) | ||
| 138 | { | ||
| 139 | unsigned long flags; | ||
| 140 | unsigned long tmp = 0; | ||
| 141 | |||
| 142 | local_irq_save(flags); | ||
| 143 | |||
| 144 | switch (size) { | ||
| 145 | case 1: | ||
| 146 | __asm__ __volatile__ ( | ||
| 147 | "ldb %0, @%2 \n\t" | ||
| 148 | "stb %1, @%2 \n\t" | ||
| 149 | : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); | ||
| 150 | break; | ||
| 151 | case 2: | ||
| 152 | __asm__ __volatile__ ( | ||
| 153 | "ldh %0, @%2 \n\t" | ||
| 154 | "sth %1, @%2 \n\t" | ||
| 155 | : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); | ||
| 156 | break; | ||
| 157 | case 4: | ||
| 158 | __asm__ __volatile__ ( | ||
| 159 | "ld %0, @%2 \n\t" | ||
| 160 | "st %1, @%2 \n\t" | ||
| 161 | : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory"); | ||
| 162 | break; | ||
| 163 | default: | ||
| 164 | __xchg_called_with_bad_pointer(); | ||
| 165 | } | ||
| 166 | |||
| 167 | local_irq_restore(flags); | ||
| 168 | |||
| 169 | return (tmp); | ||
| 170 | } | ||
| 171 | |||
| 172 | #define __HAVE_ARCH_CMPXCHG 1 | ||
| 173 | |||
| 174 | static inline unsigned long | ||
| 175 | __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) | ||
| 176 | { | ||
| 177 | unsigned long flags; | ||
| 178 | unsigned int retval; | ||
| 179 | |||
| 180 | local_irq_save(flags); | ||
| 181 | __asm__ __volatile__ ( | ||
| 182 | DCACHE_CLEAR("%0", "r4", "%1") | ||
| 183 | M32R_LOCK" %0, @%1; \n" | ||
| 184 | " bne %0, %2, 1f; \n" | ||
| 185 | M32R_UNLOCK" %3, @%1; \n" | ||
| 186 | " bra 2f; \n" | ||
| 187 | " .fillinsn \n" | ||
| 188 | "1:" | ||
| 189 | M32R_UNLOCK" %0, @%1; \n" | ||
| 190 | " .fillinsn \n" | ||
| 191 | "2:" | ||
| 192 | : "=&r" (retval) | ||
| 193 | : "r" (p), "r" (old), "r" (new) | ||
| 194 | : "cbit", "memory" | ||
| 195 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
| 196 | , "r4" | ||
| 197 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
| 198 | ); | ||
| 199 | local_irq_restore(flags); | ||
| 200 | |||
| 201 | return retval; | ||
| 202 | } | ||
| 203 | |||
| 204 | static inline unsigned long | ||
| 205 | __cmpxchg_local_u32(volatile unsigned int *p, unsigned int old, | ||
| 206 | unsigned int new) | ||
| 207 | { | ||
| 208 | unsigned long flags; | ||
| 209 | unsigned int retval; | ||
| 210 | |||
| 211 | local_irq_save(flags); | ||
| 212 | __asm__ __volatile__ ( | ||
| 213 | DCACHE_CLEAR("%0", "r4", "%1") | ||
| 214 | "ld %0, @%1; \n" | ||
| 215 | " bne %0, %2, 1f; \n" | ||
| 216 | "st %3, @%1; \n" | ||
| 217 | " bra 2f; \n" | ||
| 218 | " .fillinsn \n" | ||
| 219 | "1:" | ||
| 220 | "st %0, @%1; \n" | ||
| 221 | " .fillinsn \n" | ||
| 222 | "2:" | ||
| 223 | : "=&r" (retval) | ||
| 224 | : "r" (p), "r" (old), "r" (new) | ||
| 225 | : "cbit", "memory" | ||
| 226 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
| 227 | , "r4" | ||
| 228 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
| 229 | ); | ||
| 230 | local_irq_restore(flags); | ||
| 231 | |||
| 232 | return retval; | ||
| 233 | } | ||
| 234 | |||
| 235 | /* This function doesn't exist, so you'll get a linker error | ||
| 236 | if something tries to do an invalid cmpxchg(). */ | ||
| 237 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
| 238 | |||
| 239 | static inline unsigned long | ||
| 240 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | ||
| 241 | { | ||
| 242 | switch (size) { | ||
| 243 | case 4: | ||
| 244 | return __cmpxchg_u32(ptr, old, new); | ||
| 245 | #if 0 /* we don't have __cmpxchg_u64 */ | ||
| 246 | case 8: | ||
| 247 | return __cmpxchg_u64(ptr, old, new); | ||
| 248 | #endif /* 0 */ | ||
| 249 | } | ||
| 250 | __cmpxchg_called_with_bad_pointer(); | ||
| 251 | return old; | ||
| 252 | } | ||
| 253 | |||
| 254 | #define cmpxchg(ptr, o, n) \ | ||
| 255 | ((__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)(o), \ | ||
| 256 | (unsigned long)(n), sizeof(*(ptr)))) | ||
| 257 | |||
| 258 | #include <asm-generic/cmpxchg-local.h> | ||
| 259 | |||
| 260 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
| 261 | unsigned long old, | ||
| 262 | unsigned long new, int size) | ||
| 263 | { | ||
| 264 | switch (size) { | ||
| 265 | case 4: | ||
| 266 | return __cmpxchg_local_u32(ptr, old, new); | ||
| 267 | default: | ||
| 268 | return __cmpxchg_local_generic(ptr, old, new, size); | ||
| 269 | } | ||
| 270 | |||
| 271 | return old; | ||
| 272 | } | ||
| 273 | |||
| 274 | /* | ||
| 275 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
| 276 | * them available. | ||
| 277 | */ | ||
| 278 | #define cmpxchg_local(ptr, o, n) \ | ||
| 279 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | ||
| 280 | (unsigned long)(n), sizeof(*(ptr)))) | ||
| 281 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
| 282 | |||
| 283 | #endif /* __KERNEL__ */ | ||
| 284 | |||
| 285 | /* | ||
| 286 | * Memory barrier. | ||
| 287 | * | ||
| 288 | * mb() prevents loads and stores being reordered across this point. | ||
| 289 | * rmb() prevents loads being reordered across this point. | ||
| 290 | * wmb() prevents stores being reordered across this point. | ||
| 291 | */ | ||
| 292 | #define mb() barrier() | ||
| 293 | #define rmb() mb() | ||
| 294 | #define wmb() mb() | ||
| 295 | |||
| 296 | /** | ||
| 297 | * read_barrier_depends - Flush all pending reads that subsequents reads | ||
| 298 | * depend on. | ||
| 299 | * | ||
| 300 | * No data-dependent reads from memory-like regions are ever reordered | ||
| 301 | * over this barrier. All reads preceding this primitive are guaranteed | ||
| 302 | * to access memory (but not necessarily other CPUs' caches) before any | ||
| 303 | * reads following this primitive that depend on the data return by | ||
| 304 | * any of the preceding reads. This primitive is much lighter weight than | ||
| 305 | * rmb() on most CPUs, and is never heavier weight than is | ||
| 306 | * rmb(). | ||
| 307 | * | ||
| 308 | * These ordering constraints are respected by both the local CPU | ||
| 309 | * and the compiler. | ||
| 310 | * | ||
| 311 | * Ordering is not guaranteed by anything other than these primitives, | ||
| 312 | * not even by data dependencies. See the documentation for | ||
| 313 | * memory_barrier() for examples and URLs to more information. | ||
| 314 | * | ||
| 315 | * For example, the following code would force ordering (the initial | ||
| 316 | * value of "a" is zero, "b" is one, and "p" is "&a"): | ||
| 317 | * | ||
| 318 | * <programlisting> | ||
| 319 | * CPU 0 CPU 1 | ||
| 320 | * | ||
| 321 | * b = 2; | ||
| 322 | * memory_barrier(); | ||
| 323 | * p = &b; q = p; | ||
| 324 | * read_barrier_depends(); | ||
| 325 | * d = *q; | ||
| 326 | * </programlisting> | ||
| 327 | * | ||
| 328 | * | ||
| 329 | * because the read of "*q" depends on the read of "p" and these | ||
| 330 | * two reads are separated by a read_barrier_depends(). However, | ||
| 331 | * the following code, with the same initial values for "a" and "b": | ||
| 332 | * | ||
| 333 | * <programlisting> | ||
| 334 | * CPU 0 CPU 1 | ||
| 335 | * | ||
| 336 | * a = 2; | ||
| 337 | * memory_barrier(); | ||
| 338 | * b = 3; y = b; | ||
| 339 | * read_barrier_depends(); | ||
| 340 | * x = a; | ||
| 341 | * </programlisting> | ||
| 342 | * | ||
| 343 | * does not enforce ordering, since there is no data dependency between | ||
| 344 | * the read of "a" and the read of "b". Therefore, on some CPUs, such | ||
| 345 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() | ||
| 346 | * in cases like this where there are no data dependencies. | ||
| 347 | **/ | ||
| 348 | |||
| 349 | #define read_barrier_depends() do { } while (0) | ||
| 350 | |||
| 351 | #ifdef CONFIG_SMP | ||
| 352 | #define smp_mb() mb() | ||
| 353 | #define smp_rmb() rmb() | ||
| 354 | #define smp_wmb() wmb() | ||
| 355 | #define smp_read_barrier_depends() read_barrier_depends() | ||
| 356 | #define set_mb(var, value) do { (void) xchg(&var, value); } while (0) | ||
| 357 | #else | ||
| 358 | #define smp_mb() barrier() | ||
| 359 | #define smp_rmb() barrier() | ||
| 360 | #define smp_wmb() barrier() | ||
| 361 | #define smp_read_barrier_depends() do { } while (0) | ||
| 362 | #define set_mb(var, value) do { var = value; barrier(); } while (0) | ||
| 363 | #endif | ||
| 364 | |||
| 365 | #define arch_align_stack(x) (x) | ||
| 366 | |||
| 367 | #endif /* _ASM_M32R_SYSTEM_H */ | ||
diff --git a/arch/m32r/include/asm/termbits.h b/arch/m32r/include/asm/termbits.h new file mode 100644 index 00000000000..957a3c68854 --- /dev/null +++ b/arch/m32r/include/asm/termbits.h | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | #ifndef _ASM_M32R_TERMBITS_H | ||
| 2 | #define _ASM_M32R_TERMBITS_H | ||
| 3 | |||
| 4 | #include <linux/posix_types.h> | ||
| 5 | |||
| 6 | typedef unsigned char cc_t; | ||
| 7 | typedef unsigned int speed_t; | ||
| 8 | typedef unsigned int tcflag_t; | ||
| 9 | |||
| 10 | #define NCCS 19 | ||
| 11 | struct termios { | ||
| 12 | tcflag_t c_iflag; /* input mode flags */ | ||
| 13 | tcflag_t c_oflag; /* output mode flags */ | ||
| 14 | tcflag_t c_cflag; /* control mode flags */ | ||
| 15 | tcflag_t c_lflag; /* local mode flags */ | ||
| 16 | cc_t c_line; /* line discipline */ | ||
| 17 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct termios2 { | ||
| 21 | tcflag_t c_iflag; /* input mode flags */ | ||
| 22 | tcflag_t c_oflag; /* output mode flags */ | ||
| 23 | tcflag_t c_cflag; /* control mode flags */ | ||
| 24 | tcflag_t c_lflag; /* local mode flags */ | ||
| 25 | cc_t c_line; /* line discipline */ | ||
| 26 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 27 | speed_t c_ispeed; /* input speed */ | ||
| 28 | speed_t c_ospeed; /* output speed */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ktermios { | ||
| 32 | tcflag_t c_iflag; /* input mode flags */ | ||
| 33 | tcflag_t c_oflag; /* output mode flags */ | ||
| 34 | tcflag_t c_cflag; /* control mode flags */ | ||
| 35 | tcflag_t c_lflag; /* local mode flags */ | ||
| 36 | cc_t c_line; /* line discipline */ | ||
| 37 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 38 | speed_t c_ispeed; /* input speed */ | ||
| 39 | speed_t c_ospeed; /* output speed */ | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* c_cc characters */ | ||
| 43 | #define VINTR 0 | ||
| 44 | #define VQUIT 1 | ||
| 45 | #define VERASE 2 | ||
| 46 | #define VKILL 3 | ||
| 47 | #define VEOF 4 | ||
| 48 | #define VTIME 5 | ||
| 49 | #define VMIN 6 | ||
| 50 | #define VSWTC 7 | ||
| 51 | #define VSTART 8 | ||
| 52 | #define VSTOP 9 | ||
| 53 | #define VSUSP 10 | ||
| 54 | #define VEOL 11 | ||
| 55 | #define VREPRINT 12 | ||
| 56 | #define VDISCARD 13 | ||
| 57 | #define VWERASE 14 | ||
| 58 | #define VLNEXT 15 | ||
| 59 | #define VEOL2 16 | ||
| 60 | |||
| 61 | /* c_iflag bits */ | ||
| 62 | #define IGNBRK 0000001 | ||
| 63 | #define BRKINT 0000002 | ||
| 64 | #define IGNPAR 0000004 | ||
| 65 | #define PARMRK 0000010 | ||
| 66 | #define INPCK 0000020 | ||
| 67 | #define ISTRIP 0000040 | ||
| 68 | #define INLCR 0000100 | ||
| 69 | #define IGNCR 0000200 | ||
| 70 | #define ICRNL 0000400 | ||
| 71 | #define IUCLC 0001000 | ||
| 72 | #define IXON 0002000 | ||
| 73 | #define IXANY 0004000 | ||
| 74 | #define IXOFF 0010000 | ||
| 75 | #define IMAXBEL 0020000 | ||
| 76 | #define IUTF8 0040000 | ||
| 77 | |||
| 78 | /* c_oflag bits */ | ||
| 79 | #define OPOST 0000001 | ||
| 80 | #define OLCUC 0000002 | ||
| 81 | #define ONLCR 0000004 | ||
| 82 | #define OCRNL 0000010 | ||
| 83 | #define ONOCR 0000020 | ||
| 84 | #define ONLRET 0000040 | ||
| 85 | #define OFILL 0000100 | ||
| 86 | #define OFDEL 0000200 | ||
| 87 | #define NLDLY 0000400 | ||
| 88 | #define NL0 0000000 | ||
| 89 | #define NL1 0000400 | ||
| 90 | #define CRDLY 0003000 | ||
| 91 | #define CR0 0000000 | ||
| 92 | #define CR1 0001000 | ||
| 93 | #define CR2 0002000 | ||
| 94 | #define CR3 0003000 | ||
| 95 | #define TABDLY 0014000 | ||
| 96 | #define TAB0 0000000 | ||
| 97 | #define TAB1 0004000 | ||
| 98 | #define TAB2 0010000 | ||
| 99 | #define TAB3 0014000 | ||
| 100 | #define XTABS 0014000 | ||
| 101 | #define BSDLY 0020000 | ||
| 102 | #define BS0 0000000 | ||
| 103 | #define BS1 0020000 | ||
| 104 | #define VTDLY 0040000 | ||
| 105 | #define VT0 0000000 | ||
| 106 | #define VT1 0040000 | ||
| 107 | #define FFDLY 0100000 | ||
| 108 | #define FF0 0000000 | ||
| 109 | #define FF1 0100000 | ||
| 110 | |||
| 111 | /* c_cflag bit meaning */ | ||
| 112 | #define CBAUD 0010017 | ||
| 113 | #define B0 0000000 /* hang up */ | ||
| 114 | #define B50 0000001 | ||
| 115 | #define B75 0000002 | ||
| 116 | #define B110 0000003 | ||
| 117 | #define B134 0000004 | ||
| 118 | #define B150 0000005 | ||
| 119 | #define B200 0000006 | ||
| 120 | #define B300 0000007 | ||
| 121 | #define B600 0000010 | ||
| 122 | #define B1200 0000011 | ||
| 123 | #define B1800 0000012 | ||
| 124 | #define B2400 0000013 | ||
| 125 | #define B4800 0000014 | ||
| 126 | #define B9600 0000015 | ||
| 127 | #define B19200 0000016 | ||
| 128 | #define B38400 0000017 | ||
| 129 | #define EXTA B19200 | ||
| 130 | #define EXTB B38400 | ||
| 131 | #define CSIZE 0000060 | ||
| 132 | #define CS5 0000000 | ||
| 133 | #define CS6 0000020 | ||
| 134 | #define CS7 0000040 | ||
| 135 | #define CS8 0000060 | ||
| 136 | #define CSTOPB 0000100 | ||
| 137 | #define CREAD 0000200 | ||
| 138 | #define PARENB 0000400 | ||
| 139 | #define PARODD 0001000 | ||
| 140 | #define HUPCL 0002000 | ||
| 141 | #define CLOCAL 0004000 | ||
| 142 | #define CBAUDEX 0010000 | ||
| 143 | #define BOTHER 0010000 | ||
| 144 | #define B57600 0010001 | ||
| 145 | #define B115200 0010002 | ||
| 146 | #define B230400 0010003 | ||
| 147 | #define B460800 0010004 | ||
| 148 | #define B500000 0010005 | ||
| 149 | #define B576000 0010006 | ||
| 150 | #define B921600 0010007 | ||
| 151 | #define B1000000 0010010 | ||
| 152 | #define B1152000 0010011 | ||
| 153 | #define B1500000 0010012 | ||
| 154 | #define B2000000 0010013 | ||
| 155 | #define B2500000 0010014 | ||
| 156 | #define B3000000 0010015 | ||
| 157 | #define B3500000 0010016 | ||
| 158 | #define B4000000 0010017 | ||
| 159 | #define CIBAUD 002003600000 /** input baud rate */ | ||
| 160 | #define CTVB 004000000000 /* VisioBraille Terminal flow control */ | ||
| 161 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
| 162 | #define CRTSCTS 020000000000 /* flow control */ | ||
| 163 | |||
| 164 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 165 | |||
| 166 | /* c_lflag bits */ | ||
| 167 | #define ISIG 0000001 | ||
| 168 | #define ICANON 0000002 | ||
| 169 | #define XCASE 0000004 | ||
| 170 | #define ECHO 0000010 | ||
| 171 | #define ECHOE 0000020 | ||
| 172 | #define ECHOK 0000040 | ||
| 173 | #define ECHONL 0000100 | ||
| 174 | #define NOFLSH 0000200 | ||
| 175 | #define TOSTOP 0000400 | ||
| 176 | #define ECHOCTL 0001000 | ||
| 177 | #define ECHOPRT 0002000 | ||
| 178 | #define ECHOKE 0004000 | ||
| 179 | #define FLUSHO 0010000 | ||
| 180 | #define PENDIN 0040000 | ||
| 181 | #define IEXTEN 0100000 | ||
| 182 | #define EXTPROC 0200000 | ||
| 183 | |||
| 184 | /* tcflow() and TCXONC use these */ | ||
| 185 | #define TCOOFF 0 | ||
| 186 | #define TCOON 1 | ||
| 187 | #define TCIOFF 2 | ||
| 188 | #define TCION 3 | ||
| 189 | |||
| 190 | /* tcflush() and TCFLSH use these */ | ||
| 191 | #define TCIFLUSH 0 | ||
| 192 | #define TCOFLUSH 1 | ||
| 193 | #define TCIOFLUSH 2 | ||
| 194 | |||
| 195 | /* tcsetattr uses these */ | ||
| 196 | #define TCSANOW 0 | ||
| 197 | #define TCSADRAIN 1 | ||
| 198 | #define TCSAFLUSH 2 | ||
| 199 | |||
| 200 | #endif /* _ASM_M32R_TERMBITS_H */ | ||
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c new file mode 100644 index 00000000000..6c42d5f8df5 --- /dev/null +++ b/arch/m32r/kernel/init_task.c | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* orig : i386 init_task.c */ | ||
| 2 | |||
| 3 | #include <linux/mm.h> | ||
| 4 | #include <linux/module.h> | ||
| 5 | #include <linux/sched.h> | ||
| 6 | #include <linux/init.h> | ||
| 7 | #include <linux/init_task.h> | ||
| 8 | #include <linux/fs.h> | ||
| 9 | #include <linux/mqueue.h> | ||
| 10 | |||
| 11 | #include <asm/uaccess.h> | ||
| 12 | #include <asm/pgtable.h> | ||
| 13 | |||
| 14 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
| 15 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
| 16 | /* | ||
| 17 | * Initial thread structure. | ||
| 18 | * | ||
| 19 | * We need to make sure that this is 8192-byte aligned due to the | ||
| 20 | * way process stacks are handled. This is done by having a special | ||
| 21 | * "init_task" linker map entry.. | ||
| 22 | */ | ||
| 23 | union thread_union init_thread_union __init_task_data = | ||
| 24 | { INIT_THREAD_INFO(init_task) }; | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Initial task structure. | ||
| 28 | * | ||
| 29 | * All other task structs will be allocated on slabs in fork.c | ||
| 30 | */ | ||
| 31 | struct task_struct init_task = INIT_TASK(init_task); | ||
| 32 | |||
| 33 | EXPORT_SYMBOL(init_task); | ||
| 34 | |||
