diff options
Diffstat (limited to 'arch/frv')
31 files changed, 1270 insertions, 0 deletions
diff --git a/arch/frv/include/asm/auxvec.h b/arch/frv/include/asm/auxvec.h new file mode 100644 index 00000000000..07710778fa1 --- /dev/null +++ b/arch/frv/include/asm/auxvec.h | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #ifndef __FRV_AUXVEC_H | ||
| 2 | #define __FRV_AUXVEC_H | ||
| 3 | |||
| 4 | #endif | ||
diff --git a/arch/frv/include/asm/bitsperlong.h b/arch/frv/include/asm/bitsperlong.h new file mode 100644 index 00000000000..6dc0bb0c13b --- /dev/null +++ b/arch/frv/include/asm/bitsperlong.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/bitsperlong.h> | |||
diff --git a/arch/frv/include/asm/byteorder.h b/arch/frv/include/asm/byteorder.h new file mode 100644 index 00000000000..f29b7593e08 --- /dev/null +++ b/arch/frv/include/asm/byteorder.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _ASM_BYTEORDER_H | ||
| 2 | #define _ASM_BYTEORDER_H | ||
| 3 | |||
| 4 | #include <linux/byteorder/big_endian.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_BYTEORDER_H */ | ||
diff --git a/arch/frv/include/asm/cpumask.h b/arch/frv/include/asm/cpumask.h new file mode 100644 index 00000000000..d999c20c84d --- /dev/null +++ b/arch/frv/include/asm/cpumask.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _ASM_CPUMASK_H | ||
| 2 | #define _ASM_CPUMASK_H | ||
| 3 | |||
| 4 | #include <asm-generic/cpumask.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_CPUMASK_H */ | ||
diff --git a/arch/frv/include/asm/errno.h b/arch/frv/include/asm/errno.h new file mode 100644 index 00000000000..d010795ceef --- /dev/null +++ b/arch/frv/include/asm/errno.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef _ASM_ERRNO_H | ||
| 2 | #define _ASM_ERRNO_H | ||
| 3 | |||
| 4 | #include <asm-generic/errno.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_ERRNO_H */ | ||
| 7 | |||
diff --git a/arch/frv/include/asm/fcntl.h b/arch/frv/include/asm/fcntl.h new file mode 100644 index 00000000000..46ab12db573 --- /dev/null +++ b/arch/frv/include/asm/fcntl.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/fcntl.h> | |||
diff --git a/arch/frv/include/asm/ioctl.h b/arch/frv/include/asm/ioctl.h new file mode 100644 index 00000000000..b279fe06dfe --- /dev/null +++ b/arch/frv/include/asm/ioctl.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/ioctl.h> | |||
diff --git a/arch/frv/include/asm/ioctls.h b/arch/frv/include/asm/ioctls.h new file mode 100644 index 00000000000..2f9fb436ec3 --- /dev/null +++ b/arch/frv/include/asm/ioctls.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef __ASM_IOCTLS_H__ | ||
| 2 | #define __ASM_IOCTLS_H__ | ||
| 3 | |||
| 4 | #define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ | ||
| 5 | #define FIOQSIZE 0x545E | ||
| 6 | |||
| 7 | #include <asm-generic/ioctls.h> | ||
| 8 | |||
| 9 | #endif /* __ASM_IOCTLS_H__ */ | ||
| 10 | |||
diff --git a/arch/frv/include/asm/ipcbuf.h b/arch/frv/include/asm/ipcbuf.h new file mode 100644 index 00000000000..b546f67e455 --- /dev/null +++ b/arch/frv/include/asm/ipcbuf.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #ifndef __ASM_IPCBUF_H__ | ||
| 2 | #define __ASM_IPCBUF_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The user_ipc_perm structure for FR-V 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_IPCBUF_H__ */ | ||
| 30 | |||
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h new file mode 100644 index 00000000000..8eebf89f5ab --- /dev/null +++ b/arch/frv/include/asm/mman.h | |||
| @@ -0,0 +1 @@ | |||
| #include <asm-generic/mman.h> | |||
diff --git a/arch/frv/include/asm/msgbuf.h b/arch/frv/include/asm/msgbuf.h new file mode 100644 index 00000000000..97ceb55a06f --- /dev/null +++ b/arch/frv/include/asm/msgbuf.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef _ASM_MSGBUF_H | ||
| 2 | #define _ASM_MSGBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The msqid64_ds structure for FR-V 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_MSGBUF_H */ | ||
| 32 | |||
diff --git a/arch/frv/include/asm/param.h b/arch/frv/include/asm/param.h new file mode 100644 index 00000000000..6859dd503ed --- /dev/null +++ b/arch/frv/include/asm/param.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #ifndef _ASM_PARAM_H | ||
| 2 | #define _ASM_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 16384 | ||
| 15 | |||
| 16 | #ifndef NOGROUP | ||
| 17 | #define NOGROUP (-1) | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
| 21 | |||
| 22 | #endif /* _ASM_PARAM_H */ | ||
diff --git a/arch/frv/include/asm/poll.h b/arch/frv/include/asm/poll.h new file mode 100644 index 00000000000..0d01479ccc5 --- /dev/null +++ b/arch/frv/include/asm/poll.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef _ASM_POLL_H | ||
| 2 | #define _ASM_POLL_H | ||
| 3 | |||
| 4 | #define POLLWRNORM POLLOUT | ||
| 5 | #define POLLWRBAND 256 | ||
| 6 | |||
| 7 | #include <asm-generic/poll.h> | ||
| 8 | |||
| 9 | #undef POLLREMOVE | ||
| 10 | |||
| 11 | #endif | ||
| 12 | |||
diff --git a/arch/frv/include/asm/posix_types.h b/arch/frv/include/asm/posix_types.h new file mode 100644 index 00000000000..a9f1f5be063 --- /dev/null +++ b/arch/frv/include/asm/posix_types.h | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | #ifndef _ASM_POSIX_TYPES_H | ||
| 2 | #define _ASM_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 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | ||
| 49 | |||
| 50 | #undef __FD_CLR | ||
| 51 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | ||
| 52 | |||
| 53 | #undef __FD_ISSET | ||
| 54 | #define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d))) | ||
| 55 | |||
| 56 | #undef __FD_ZERO | ||
| 57 | #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) | ||
| 58 | |||
| 59 | #endif /* defined(__KERNEL__) */ | ||
| 60 | |||
| 61 | #endif | ||
| 62 | |||
diff --git a/arch/frv/include/asm/registers.h b/arch/frv/include/asm/registers.h new file mode 100644 index 00000000000..9666119fcf6 --- /dev/null +++ b/arch/frv/include/asm/registers.h | |||
| @@ -0,0 +1,232 @@ | |||
| 1 | /* registers.h: register frame declarations | ||
| 2 | * | ||
| 3 | * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | /* | ||
| 13 | * notes: | ||
| 14 | * | ||
| 15 | * (1) that the members of all these structures are carefully aligned to permit | ||
| 16 | * usage of STD/STDF instructions | ||
| 17 | * | ||
| 18 | * (2) if you change these structures, you must change the code in | ||
| 19 | * arch/frvnommu/kernel/{break.S,entry.S,switch_to.S,gdb-stub.c} | ||
| 20 | * | ||
| 21 | * | ||
| 22 | * the kernel stack space block looks like this: | ||
| 23 | * | ||
| 24 | * +0x2000 +---------------------- | ||
| 25 | * | union { | ||
| 26 | * | struct frv_frame0 { | ||
| 27 | * | struct user_context { | ||
| 28 | * | struct user_int_regs | ||
| 29 | * | struct user_fpmedia_regs | ||
| 30 | * | } | ||
| 31 | * | struct frv_debug_regs | ||
| 32 | * | } | ||
| 33 | * | struct pt_regs [user exception] | ||
| 34 | * | } | ||
| 35 | * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) | ||
| 36 | * | | ||
| 37 | * | kernel stack | ||
| 38 | * | | ||
| 39 | * |...................... | ||
| 40 | * | struct pt_regs [kernel exception] | ||
| 41 | * |...................... <-- __kernel_frame0_ptr (maybe GR28) | ||
| 42 | * | | ||
| 43 | * | kernel stack | ||
| 44 | * | | ||
| 45 | * |...................... <-- stack pointer (GR1) | ||
| 46 | * | | ||
| 47 | * | unused stack space | ||
| 48 | * | | ||
| 49 | * +---------------------- | ||
| 50 | * | struct thread_info | ||
| 51 | * +0x0000 +---------------------- <-- __current_thread_info (GR15); | ||
| 52 | * | ||
| 53 | * note that GR28 points to the current exception frame | ||
| 54 | */ | ||
| 55 | |||
| 56 | #ifndef _ASM_REGISTERS_H | ||
| 57 | #define _ASM_REGISTERS_H | ||
| 58 | |||
| 59 | #ifndef __ASSEMBLY__ | ||
| 60 | #define __OFFSET(X,N) ((X)+(N)*4) | ||
| 61 | #define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx | ||
| 62 | #else | ||
| 63 | #define __OFFSET(X,N) ((X)+(N)*4) | ||
| 64 | #define __OFFSETC(X,N) ((X)+(N)) | ||
| 65 | #endif | ||
| 66 | |||
| 67 | /*****************************************************************************/ | ||
| 68 | /* | ||
| 69 | * Exception/Interrupt frame | ||
| 70 | * - held on kernel stack | ||
| 71 | * - 8-byte aligned on stack (old SP is saved in frame) | ||
| 72 | * - GR0 is fixed 0, so we don't save it | ||
| 73 | */ | ||
| 74 | #ifndef __ASSEMBLY__ | ||
| 75 | |||
| 76 | struct pt_regs { | ||
| 77 | unsigned long psr; /* Processor Status Register */ | ||
| 78 | unsigned long isr; /* Integer Status Register */ | ||
| 79 | unsigned long ccr; /* Condition Code Register */ | ||
| 80 | unsigned long cccr; /* Condition Code for Conditional Insns Register */ | ||
| 81 | unsigned long lr; /* Link Register */ | ||
| 82 | unsigned long lcr; /* Loop Count Register */ | ||
| 83 | unsigned long pc; /* Program Counter Register */ | ||
| 84 | unsigned long __status; /* exception status */ | ||
| 85 | unsigned long syscallno; /* syscall number or -1 */ | ||
| 86 | unsigned long orig_gr8; /* original syscall arg #1 */ | ||
| 87 | unsigned long gner0; | ||
| 88 | unsigned long gner1; | ||
| 89 | unsigned long long iacc0; | ||
| 90 | unsigned long tbr; /* GR0 is fixed zero, so we use this for TBR */ | ||
| 91 | unsigned long sp; /* GR1: USP/KSP */ | ||
| 92 | unsigned long fp; /* GR2: FP */ | ||
| 93 | unsigned long gr3; | ||
| 94 | unsigned long gr4; | ||
| 95 | unsigned long gr5; | ||
| 96 | unsigned long gr6; | ||
| 97 | unsigned long gr7; /* syscall number */ | ||
| 98 | unsigned long gr8; /* 1st syscall param; syscall return */ | ||
| 99 | unsigned long gr9; /* 2nd syscall param */ | ||
| 100 | unsigned long gr10; /* 3rd syscall param */ | ||
| 101 | unsigned long gr11; /* 4th syscall param */ | ||
| 102 | unsigned long gr12; /* 5th syscall param */ | ||
| 103 | unsigned long gr13; /* 6th syscall param */ | ||
| 104 | unsigned long gr14; | ||
| 105 | unsigned long gr15; | ||
| 106 | unsigned long gr16; /* GP pointer */ | ||
| 107 | unsigned long gr17; /* small data */ | ||
| 108 | unsigned long gr18; /* PIC/PID */ | ||
| 109 | unsigned long gr19; | ||
| 110 | unsigned long gr20; | ||
| 111 | unsigned long gr21; | ||
| 112 | unsigned long gr22; | ||
| 113 | unsigned long gr23; | ||
| 114 | unsigned long gr24; | ||
| 115 | unsigned long gr25; | ||
| 116 | unsigned long gr26; | ||
| 117 | unsigned long gr27; | ||
| 118 | struct pt_regs *next_frame; /* GR28 - next exception frame */ | ||
| 119 | unsigned long gr29; /* GR29 - OS reserved */ | ||
| 120 | unsigned long gr30; /* GR30 - OS reserved */ | ||
| 121 | unsigned long gr31; /* GR31 - OS reserved */ | ||
| 122 | } __attribute__((aligned(8))); | ||
| 123 | |||
| 124 | #endif | ||
| 125 | |||
| 126 | #define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ | ||
| 127 | #define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ | ||
| 128 | #define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ | ||
| 129 | #define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ | ||
| 130 | #define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ | ||
| 131 | |||
| 132 | #define REG_GR(R) __OFFSET(REG_GR0, (R)) | ||
| 133 | |||
| 134 | #define REG_SP REG_GR(1) | ||
| 135 | #define REG_FP REG_GR(2) | ||
| 136 | #define REG_PREV_FRAME REG_GR(28) /* previous exception frame pointer (old gr28 value) */ | ||
| 137 | #define REG_CURR_TASK REG_GR(29) /* current task */ | ||
| 138 | |||
| 139 | /*****************************************************************************/ | ||
| 140 | /* | ||
| 141 | * debugging registers | ||
| 142 | */ | ||
| 143 | #ifndef __ASSEMBLY__ | ||
| 144 | |||
| 145 | struct frv_debug_regs | ||
| 146 | { | ||
| 147 | unsigned long dcr; | ||
| 148 | unsigned long ibar[4] __attribute__((aligned(8))); | ||
| 149 | unsigned long dbar[4] __attribute__((aligned(8))); | ||
| 150 | unsigned long dbdr[4][4] __attribute__((aligned(8))); | ||
| 151 | unsigned long dbmr[4][4] __attribute__((aligned(8))); | ||
| 152 | } __attribute__((aligned(8))); | ||
| 153 | |||
| 154 | #endif | ||
| 155 | |||
| 156 | /*****************************************************************************/ | ||
| 157 | /* | ||
| 158 | * userspace registers | ||
| 159 | */ | ||
| 160 | #ifndef __ASSEMBLY__ | ||
| 161 | |||
| 162 | struct user_int_regs | ||
| 163 | { | ||
| 164 | /* integer registers | ||
| 165 | * - up to gr[31] mirror pt_regs | ||
| 166 | * - total size must be multiple of 8 bytes | ||
| 167 | */ | ||
| 168 | unsigned long psr; /* Processor Status Register */ | ||
| 169 | unsigned long isr; /* Integer Status Register */ | ||
| 170 | unsigned long ccr; /* Condition Code Register */ | ||
| 171 | unsigned long cccr; /* Condition Code for Conditional Insns Register */ | ||
| 172 | unsigned long lr; /* Link Register */ | ||
| 173 | unsigned long lcr; /* Loop Count Register */ | ||
| 174 | unsigned long pc; /* Program Counter Register */ | ||
| 175 | unsigned long __status; /* exception status */ | ||
| 176 | unsigned long syscallno; /* syscall number or -1 */ | ||
| 177 | unsigned long orig_gr8; /* original syscall arg #1 */ | ||
| 178 | unsigned long gner[2]; | ||
| 179 | unsigned long long iacc[1]; | ||
| 180 | |||
| 181 | union { | ||
| 182 | unsigned long tbr; | ||
| 183 | unsigned long gr[64]; | ||
| 184 | }; | ||
| 185 | }; | ||
| 186 | |||
| 187 | struct user_fpmedia_regs | ||
| 188 | { | ||
| 189 | /* FP/Media registers */ | ||
| 190 | unsigned long fr[64]; | ||
| 191 | unsigned long fner[2]; | ||
| 192 | unsigned long msr[2]; | ||
| 193 | unsigned long acc[8]; | ||
| 194 | unsigned char accg[8]; | ||
| 195 | unsigned long fsr[1]; | ||
| 196 | }; | ||
| 197 | |||
| 198 | struct user_context | ||
| 199 | { | ||
| 200 | struct user_int_regs i; | ||
| 201 | struct user_fpmedia_regs f; | ||
| 202 | |||
| 203 | /* we provide a context extension so that we can save the regs for CPUs that | ||
| 204 | * implement many more of Fujitsu's lavish register spec | ||
| 205 | */ | ||
| 206 | void *extension; | ||
| 207 | } __attribute__((aligned(8))); | ||
| 208 | |||
| 209 | struct frv_frame0 { | ||
| 210 | union { | ||
| 211 | struct pt_regs regs; | ||
| 212 | struct user_context uc; | ||
| 213 | }; | ||
| 214 | |||
| 215 | struct frv_debug_regs debug; | ||
| 216 | |||
| 217 | } __attribute__((aligned(32))); | ||
| 218 | |||
| 219 | #endif | ||
| 220 | |||
| 221 | #define __INT_GR(R) __OFFSET(__INT_GR0, (R)) | ||
| 222 | |||
| 223 | #define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R)) | ||
| 224 | #define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R)) | ||
| 225 | #define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R)) | ||
| 226 | #define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R)) | ||
| 227 | #define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R)) | ||
| 228 | #define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R)) | ||
| 229 | |||
| 230 | #define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16) | ||
| 231 | |||
| 232 | #endif /* _ASM_REGISTERS_H */ | ||
diff --git a/arch/frv/include/asm/resource.h b/arch/frv/include/asm/resource.h new file mode 100644 index 00000000000..5fc60548fd0 --- /dev/null +++ b/arch/frv/include/asm/resource.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef _ASM_RESOURCE_H | ||
| 2 | #define _ASM_RESOURCE_H | ||
| 3 | |||
| 4 | #include <asm-generic/resource.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_RESOURCE_H */ | ||
| 7 | |||
diff --git a/arch/frv/include/asm/sembuf.h b/arch/frv/include/asm/sembuf.h new file mode 100644 index 00000000000..164b12786d6 --- /dev/null +++ b/arch/frv/include/asm/sembuf.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #ifndef _ASM_SEMBUF_H | ||
| 2 | #define _ASM_SEMBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The semid64_ds structure for FR-V 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_SEMBUF_H */ | ||
| 26 | |||
diff --git a/arch/frv/include/asm/shmbuf.h b/arch/frv/include/asm/shmbuf.h new file mode 100644 index 00000000000..4c6e711a477 --- /dev/null +++ b/arch/frv/include/asm/shmbuf.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #ifndef _ASM_SHMBUF_H | ||
| 2 | #define _ASM_SHMBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The shmid64_ds structure for FR-V 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_SHMBUF_H */ | ||
| 43 | |||
diff --git a/arch/frv/include/asm/sigcontext.h b/arch/frv/include/asm/sigcontext.h new file mode 100644 index 00000000000..3b263f3cc96 --- /dev/null +++ b/arch/frv/include/asm/sigcontext.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* sigcontext.h: FRV signal context | ||
| 2 | * | ||
| 3 | * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | #ifndef _ASM_SIGCONTEXT_H | ||
| 12 | #define _ASM_SIGCONTEXT_H | ||
| 13 | |||
| 14 | #include <asm/registers.h> | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Signal context structure - contains all info to do with the state | ||
| 18 | * before the signal handler was invoked. Note: only add new entries | ||
| 19 | * to the end of the structure. | ||
| 20 | */ | ||
| 21 | struct sigcontext { | ||
| 22 | struct user_context sc_context; | ||
| 23 | unsigned long sc_oldmask; /* old sigmask */ | ||
| 24 | } __attribute__((aligned(8))); | ||
| 25 | |||
| 26 | #endif | ||
diff --git a/arch/frv/include/asm/siginfo.h b/arch/frv/include/asm/siginfo.h new file mode 100644 index 00000000000..d3fd1ca4565 --- /dev/null +++ b/arch/frv/include/asm/siginfo.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef _ASM_SIGINFO_H | ||
| 2 | #define _ASM_SIGINFO_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <asm-generic/siginfo.h> | ||
| 6 | |||
| 7 | #define FPE_MDAOVF (__SI_FAULT|9) /* media overflow */ | ||
| 8 | #undef NSIGFPE | ||
| 9 | #define NSIGFPE 9 | ||
| 10 | |||
| 11 | #endif | ||
| 12 | |||
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h new file mode 100644 index 00000000000..a6b26880c1e --- /dev/null +++ b/arch/frv/include/asm/socket.h | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #ifndef _ASM_SOCKET_H | ||
| 2 | #define _ASM_SOCKET_H | ||
| 3 | |||
| 4 | #include <asm/sockios.h> | ||
| 5 | |||
| 6 | /* For setsockopt(2) */ | ||
| 7 | #define SOL_SOCKET 1 | ||
| 8 | |||
| 9 | #define SO_DEBUG 1 | ||
| 10 | #define SO_REUSEADDR 2 | ||
| 11 | #define SO_TYPE 3 | ||
| 12 | #define SO_ERROR 4 | ||
| 13 | #define SO_DONTROUTE 5 | ||
| 14 | #define SO_BROADCAST 6 | ||
| 15 | #define SO_SNDBUF 7 | ||
| 16 | #define SO_RCVBUF 8 | ||
| 17 | #define SO_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_SOCKET_H */ | ||
| 66 | |||
diff --git a/arch/frv/include/asm/sockios.h b/arch/frv/include/asm/sockios.h new file mode 100644 index 00000000000..5dbdd13e6de --- /dev/null +++ b/arch/frv/include/asm/sockios.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef _ASM_SOCKIOS__ | ||
| 2 | #define _ASM_SOCKIOS__ | ||
| 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_SOCKIOS__ */ | ||
| 14 | |||
diff --git a/arch/frv/include/asm/stat.h b/arch/frv/include/asm/stat.h new file mode 100644 index 00000000000..ce56de9b37b --- /dev/null +++ b/arch/frv/include/asm/stat.h | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | #ifndef _ASM_STAT_H | ||
| 2 | #define _ASM_STAT_H | ||
| 3 | |||
| 4 | struct __old_kernel_stat { | ||
| 5 | unsigned short st_dev; | ||
| 6 | unsigned short st_ino; | ||
| 7 | unsigned short st_mode; | ||
| 8 | unsigned short st_nlink; | ||
| 9 | unsigned short st_uid; | ||
| 10 | unsigned short st_gid; | ||
| 11 | unsigned short st_rdev; | ||
| 12 | unsigned long st_size; | ||
| 13 | unsigned long st_atime; | ||
| 14 | unsigned long st_mtime; | ||
| 15 | unsigned long st_ctime; | ||
| 16 | }; | ||
| 17 | |||
| 18 | /* This matches struct stat in uClibc/glibc. */ | ||
| 19 | struct stat { | ||
| 20 | unsigned char __pad1[6]; | ||
| 21 | unsigned short st_dev; | ||
| 22 | |||
| 23 | unsigned long __pad2; | ||
| 24 | unsigned long st_ino; | ||
| 25 | |||
| 26 | unsigned short __pad3; | ||
| 27 | unsigned short st_mode; | ||
| 28 | unsigned short __pad4; | ||
| 29 | unsigned short st_nlink; | ||
| 30 | |||
| 31 | unsigned short __pad5; | ||
| 32 | unsigned short st_uid; | ||
| 33 | unsigned short __pad6; | ||
| 34 | unsigned short st_gid; | ||
| 35 | |||
| 36 | unsigned char __pad7[6]; | ||
| 37 | unsigned short st_rdev; | ||
| 38 | |||
| 39 | unsigned long __pad8; | ||
| 40 | unsigned long st_size; | ||
| 41 | |||
| 42 | unsigned long __pad9; /* align 64-bit st_blocks to 2-word */ | ||
| 43 | unsigned long st_blksize; | ||
| 44 | |||
| 45 | unsigned long __pad10; /* future possible st_blocks high bits */ | ||
| 46 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 47 | |||
| 48 | unsigned long __unused1; | ||
| 49 | unsigned long st_atime; | ||
| 50 | |||
| 51 | unsigned long __unused2; | ||
| 52 | unsigned long st_mtime; | ||
| 53 | |||
| 54 | unsigned long __unused3; | ||
| 55 | unsigned long st_ctime; | ||
| 56 | |||
| 57 | unsigned long long __unused4; | ||
| 58 | }; | ||
| 59 | |||
| 60 | /* This matches struct stat64 in uClibc/glibc. The layout is exactly | ||
| 61 | the same as that of struct stat above, with 64-bit types taking up | ||
| 62 | space that was formerly used by padding. stat syscalls are still | ||
| 63 | different from stat64, though, in that the former tests for | ||
| 64 | overflow. */ | ||
| 65 | struct stat64 { | ||
| 66 | unsigned char __pad1[6]; | ||
| 67 | unsigned short st_dev; | ||
| 68 | |||
| 69 | unsigned long long st_ino; | ||
| 70 | |||
| 71 | unsigned int st_mode; | ||
| 72 | unsigned int st_nlink; | ||
| 73 | |||
| 74 | unsigned long st_uid; | ||
| 75 | unsigned long st_gid; | ||
| 76 | |||
| 77 | unsigned char __pad2[6]; | ||
| 78 | unsigned short st_rdev; | ||
| 79 | |||
| 80 | long long st_size; | ||
| 81 | |||
| 82 | unsigned long __pad3; /* align 64-bit st_blocks to 2-word */ | ||
| 83 | unsigned long st_blksize; | ||
| 84 | |||
| 85 | unsigned long __pad4; /* future possible st_blocks high bits */ | ||
| 86 | unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 87 | |||
| 88 | unsigned long st_atime_nsec; | ||
| 89 | unsigned long st_atime; | ||
| 90 | |||
| 91 | unsigned int st_mtime_nsec; | ||
| 92 | unsigned long st_mtime; | ||
| 93 | |||
| 94 | unsigned long st_ctime_nsec; | ||
| 95 | unsigned long st_ctime; | ||
| 96 | |||
| 97 | unsigned long long __unused4; | ||
| 98 | }; | ||
| 99 | |||
| 100 | #endif /* _ASM_STAT_H */ | ||
diff --git a/arch/frv/include/asm/statfs.h b/arch/frv/include/asm/statfs.h new file mode 100644 index 00000000000..741f586045b --- /dev/null +++ b/arch/frv/include/asm/statfs.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef _ASM_STATFS_H | ||
| 2 | #define _ASM_STATFS_H | ||
| 3 | |||
| 4 | #include <asm-generic/statfs.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_STATFS_H */ | ||
| 7 | |||
diff --git a/arch/frv/include/asm/swab.h b/arch/frv/include/asm/swab.h new file mode 100644 index 00000000000..f305834b479 --- /dev/null +++ b/arch/frv/include/asm/swab.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _ASM_SWAB_H | ||
| 2 | #define _ASM_SWAB_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
| 7 | # define __SWAB_64_THRU_32__ | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif /* _ASM_SWAB_H */ | ||
diff --git a/arch/frv/include/asm/system.h b/arch/frv/include/asm/system.h new file mode 100644 index 00000000000..6c10fd2c626 --- /dev/null +++ b/arch/frv/include/asm/system.h | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | /* system.h: FR-V CPU control definitions | ||
| 2 | * | ||
| 3 | * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _ASM_SYSTEM_H | ||
| 13 | #define _ASM_SYSTEM_H | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/linkage.h> | ||
| 17 | #include <linux/kernel.h> | ||
| 18 | |||
| 19 | struct thread_struct; | ||
| 20 | |||
| 21 | /* | ||
| 22 | * switch_to(prev, next) should switch from task `prev' to `next' | ||
| 23 | * `prev' will never be the same as `next'. | ||
| 24 | * The `mb' is to tell GCC not to cache `current' across this call. | ||
| 25 | */ | ||
| 26 | extern asmlinkage | ||
| 27 | struct task_struct *__switch_to(struct thread_struct *prev_thread, | ||
| 28 | struct thread_struct *next_thread, | ||
| 29 | struct task_struct *prev); | ||
| 30 | |||
| 31 | #define switch_to(prev, next, last) \ | ||
| 32 | do { \ | ||
| 33 | (prev)->thread.sched_lr = \ | ||
| 34 | (unsigned long) __builtin_return_address(0); \ | ||
| 35 | (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \ | ||
| 36 | mb(); \ | ||
| 37 | } while(0) | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Force strict CPU ordering. | ||
| 41 | */ | ||
| 42 | #define nop() asm volatile ("nop"::) | ||
| 43 | #define mb() asm volatile ("membar" : : :"memory") | ||
| 44 | #define rmb() asm volatile ("membar" : : :"memory") | ||
| 45 | #define wmb() asm volatile ("membar" : : :"memory") | ||
| 46 | #define read_barrier_depends() do { } while (0) | ||
| 47 | |||
| 48 | #define smp_mb() barrier() | ||
| 49 | #define smp_rmb() barrier() | ||
| 50 | #define smp_wmb() barrier() | ||
| 51 | #define smp_read_barrier_depends() do {} while(0) | ||
| 52 | #define set_mb(var, value) \ | ||
| 53 | do { var = (value); barrier(); } while (0) | ||
| 54 | |||
| 55 | extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2))); | ||
| 56 | extern void free_initmem(void); | ||
| 57 | |||
| 58 | #define arch_align_stack(x) (x) | ||
| 59 | |||
| 60 | /*****************************************************************************/ | ||
| 61 | /* | ||
| 62 | * compare and conditionally exchange value with memory | ||
| 63 | * - if (*ptr == test) then orig = *ptr; *ptr = test; | ||
| 64 | * - if (*ptr != test) then orig = *ptr; | ||
| 65 | */ | ||
| 66 | extern uint64_t __cmpxchg_64(uint64_t test, uint64_t new, volatile uint64_t *v); | ||
| 67 | |||
| 68 | #ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS | ||
| 69 | |||
| 70 | #define cmpxchg(ptr, test, new) \ | ||
| 71 | ({ \ | ||
| 72 | __typeof__(ptr) __xg_ptr = (ptr); \ | ||
| 73 | __typeof__(*(ptr)) __xg_orig, __xg_tmp; \ | ||
| 74 | __typeof__(*(ptr)) __xg_test = (test); \ | ||
| 75 | __typeof__(*(ptr)) __xg_new = (new); \ | ||
| 76 | \ | ||
| 77 | switch (sizeof(__xg_orig)) { \ | ||
| 78 | case 4: \ | ||
| 79 | asm volatile( \ | ||
| 80 | "0: \n" \ | ||
| 81 | " orcc gr0,gr0,gr0,icc3 \n" \ | ||
| 82 | " ckeq icc3,cc7 \n" \ | ||
| 83 | " ld.p %M0,%1 \n" \ | ||
| 84 | " orcr cc7,cc7,cc3 \n" \ | ||
| 85 | " sub%I4cc %1,%4,%2,icc0 \n" \ | ||
| 86 | " bne icc0,#0,1f \n" \ | ||
| 87 | " cst.p %3,%M0 ,cc3,#1 \n" \ | ||
| 88 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" \ | ||
| 89 | " beq icc3,#0,0b \n" \ | ||
| 90 | "1: \n" \ | ||
| 91 | : "+U"(*__xg_ptr), "=&r"(__xg_orig), "=&r"(__xg_tmp) \ | ||
| 92 | : "r"(__xg_new), "NPr"(__xg_test) \ | ||
| 93 | : "memory", "cc7", "cc3", "icc3", "icc0" \ | ||
| 94 | ); \ | ||
| 95 | break; \ | ||
| 96 | \ | ||
| 97 | default: \ | ||
| 98 | __xg_orig = (__typeof__(__xg_orig))0; \ | ||
| 99 | asm volatile("break"); \ | ||
| 100 | break; \ | ||
| 101 | } \ | ||
| 102 | \ | ||
| 103 | __xg_orig; \ | ||
| 104 | }) | ||
| 105 | |||
| 106 | #else | ||
| 107 | |||
| 108 | extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new); | ||
| 109 | |||
| 110 | #define cmpxchg(ptr, test, new) \ | ||
| 111 | ({ \ | ||
| 112 | __typeof__(ptr) __xg_ptr = (ptr); \ | ||
| 113 | __typeof__(*(ptr)) __xg_orig; \ | ||
| 114 | __typeof__(*(ptr)) __xg_test = (test); \ | ||
| 115 | __typeof__(*(ptr)) __xg_new = (new); \ | ||
| 116 | \ | ||
| 117 | switch (sizeof(__xg_orig)) { \ | ||
| 118 | case 4: __xg_orig = (__force __typeof__(*ptr)) \ | ||
| 119 | __cmpxchg_32((__force uint32_t *)__xg_ptr, \ | ||
| 120 | (__force uint32_t)__xg_test, \ | ||
| 121 | (__force uint32_t)__xg_new); break; \ | ||
| 122 | default: \ | ||
| 123 | __xg_orig = (__typeof__(__xg_orig))0; \ | ||
| 124 | asm volatile("break"); \ | ||
| 125 | break; \ | ||
| 126 | } \ | ||
| 127 | \ | ||
| 128 | __xg_orig; \ | ||
| 129 | }) | ||
| 130 | |||
| 131 | #endif | ||
| 132 | |||
| 133 | #include <asm-generic/cmpxchg-local.h> | ||
| 134 | |||
| 135 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
| 136 | unsigned long old, | ||
| 137 | unsigned long new, int size) | ||
| 138 | { | ||
| 139 | switch (size) { | ||
| 140 | case 4: | ||
| 141 | return cmpxchg((unsigned long *)ptr, old, new); | ||
| 142 | default: | ||
| 143 | return __cmpxchg_local_generic(ptr, old, new, size); | ||
| 144 | } | ||
| 145 | |||
| 146 | return old; | ||
| 147 | } | ||
| 148 | |||
| 149 | /* | ||
| 150 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
| 151 | * them available. | ||
| 152 | */ | ||
| 153 | #define cmpxchg_local(ptr, o, n) \ | ||
| 154 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | ||
| 155 | (unsigned long)(n), sizeof(*(ptr)))) | ||
| 156 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
| 157 | |||
| 158 | #endif /* _ASM_SYSTEM_H */ | ||
diff --git a/arch/frv/include/asm/termbits.h b/arch/frv/include/asm/termbits.h new file mode 100644 index 00000000000..7722e19cc34 --- /dev/null +++ b/arch/frv/include/asm/termbits.h | |||
| @@ -0,0 +1,203 @@ | |||
| 1 | #ifndef _ASM_TERMBITS_H__ | ||
| 2 | #define _ASM_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 | |||
| 62 | /* c_iflag bits */ | ||
| 63 | #define IGNBRK 0000001 | ||
| 64 | #define BRKINT 0000002 | ||
| 65 | #define IGNPAR 0000004 | ||
| 66 | #define PARMRK 0000010 | ||
| 67 | #define INPCK 0000020 | ||
| 68 | #define ISTRIP 0000040 | ||
| 69 | #define INLCR 0000100 | ||
| 70 | #define IGNCR 0000200 | ||
| 71 | #define ICRNL 0000400 | ||
| 72 | #define IUCLC 0001000 | ||
| 73 | #define IXON 0002000 | ||
| 74 | #define IXANY 0004000 | ||
| 75 | #define IXOFF 0010000 | ||
| 76 | #define IMAXBEL 0020000 | ||
| 77 | #define IUTF8 0040000 | ||
| 78 | |||
| 79 | /* c_oflag bits */ | ||
| 80 | #define OPOST 0000001 | ||
| 81 | #define OLCUC 0000002 | ||
| 82 | #define ONLCR 0000004 | ||
| 83 | #define OCRNL 0000010 | ||
| 84 | #define ONOCR 0000020 | ||
| 85 | #define ONLRET 0000040 | ||
| 86 | #define OFILL 0000100 | ||
| 87 | #define OFDEL 0000200 | ||
| 88 | #define NLDLY 0000400 | ||
| 89 | #define NL0 0000000 | ||
| 90 | #define NL1 0000400 | ||
| 91 | #define CRDLY 0003000 | ||
| 92 | #define CR0 0000000 | ||
| 93 | #define CR1 0001000 | ||
| 94 | #define CR2 0002000 | ||
| 95 | #define CR3 0003000 | ||
| 96 | #define TABDLY 0014000 | ||
| 97 | #define TAB0 0000000 | ||
| 98 | #define TAB1 0004000 | ||
| 99 | #define TAB2 0010000 | ||
| 100 | #define TAB3 0014000 | ||
| 101 | #define XTABS 0014000 | ||
| 102 | #define BSDLY 0020000 | ||
| 103 | #define BS0 0000000 | ||
| 104 | #define BS1 0020000 | ||
| 105 | #define VTDLY 0040000 | ||
| 106 | #define VT0 0000000 | ||
| 107 | #define VT1 0040000 | ||
| 108 | #define FFDLY 0100000 | ||
| 109 | #define FF0 0000000 | ||
| 110 | #define FF1 0100000 | ||
| 111 | |||
| 112 | /* c_cflag bit meaning */ | ||
| 113 | #define CBAUD 0010017 | ||
| 114 | #define B0 0000000 /* hang up */ | ||
| 115 | #define B50 0000001 | ||
| 116 | #define B75 0000002 | ||
| 117 | #define B110 0000003 | ||
| 118 | #define B134 0000004 | ||
| 119 | #define B150 0000005 | ||
| 120 | #define B200 0000006 | ||
| 121 | #define B300 0000007 | ||
| 122 | #define B600 0000010 | ||
| 123 | #define B1200 0000011 | ||
| 124 | #define B1800 0000012 | ||
| 125 | #define B2400 0000013 | ||
| 126 | #define B4800 0000014 | ||
| 127 | #define B9600 0000015 | ||
| 128 | #define B19200 0000016 | ||
| 129 | #define B38400 0000017 | ||
| 130 | #define EXTA B19200 | ||
| 131 | #define EXTB B38400 | ||
| 132 | #define CSIZE 0000060 | ||
| 133 | #define CS5 0000000 | ||
| 134 | #define CS6 0000020 | ||
| 135 | #define CS7 0000040 | ||
| 136 | #define CS8 0000060 | ||
| 137 | #define CSTOPB 0000100 | ||
| 138 | #define CREAD 0000200 | ||
| 139 | #define PARENB 0000400 | ||
| 140 | #define PARODD 0001000 | ||
| 141 | #define HUPCL 0002000 | ||
| 142 | #define CLOCAL 0004000 | ||
| 143 | #define CBAUDEX 0010000 | ||
| 144 | #define BOTHER 0010000 | ||
| 145 | #define B57600 0010001 | ||
| 146 | #define B115200 0010002 | ||
| 147 | #define B230400 0010003 | ||
| 148 | #define B460800 0010004 | ||
| 149 | #define B500000 0010005 | ||
| 150 | #define B576000 0010006 | ||
| 151 | #define B921600 0010007 | ||
| 152 | #define B1000000 0010010 | ||
| 153 | #define B1152000 0010011 | ||
| 154 | #define B1500000 0010012 | ||
| 155 | #define B2000000 0010013 | ||
| 156 | #define B2500000 0010014 | ||
| 157 | #define B3000000 0010015 | ||
| 158 | #define B3500000 0010016 | ||
| 159 | #define B4000000 0010017 | ||
| 160 | #define CIBAUD 002003600000 /* Input baud rate */ | ||
| 161 | #define CTVB 004000000000 /* VisioBraille Terminal flow control */ | ||
| 162 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
| 163 | #define CRTSCTS 020000000000 /* flow control */ | ||
| 164 | |||
| 165 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 166 | |||
| 167 | /* c_lflag bits */ | ||
| 168 | #define ISIG 0000001 | ||
| 169 | #define ICANON 0000002 | ||
| 170 | #define XCASE 0000004 | ||
| 171 | #define ECHO 0000010 | ||
| 172 | #define ECHOE 0000020 | ||
| 173 | #define ECHOK 0000040 | ||
| 174 | #define ECHONL 0000100 | ||
| 175 | #define NOFLSH 0000200 | ||
| 176 | #define TOSTOP 0000400 | ||
| 177 | #define ECHOCTL 0001000 | ||
| 178 | #define ECHOPRT 0002000 | ||
| 179 | #define ECHOKE 0004000 | ||
| 180 | #define FLUSHO 0010000 | ||
| 181 | #define PENDIN 0040000 | ||
| 182 | #define IEXTEN 0100000 | ||
| 183 | #define EXTPROC 0200000 | ||
| 184 | |||
| 185 | |||
| 186 | /* tcflow() and TCXONC use these */ | ||
| 187 | #define TCOOFF 0 | ||
| 188 | #define TCOON 1 | ||
| 189 | #define TCIOFF 2 | ||
| 190 | #define TCION 3 | ||
| 191 | |||
| 192 | /* tcflush() and TCFLSH use these */ | ||
| 193 | #define TCIFLUSH 0 | ||
| 194 | #define TCOFLUSH 1 | ||
| 195 | #define TCIOFLUSH 2 | ||
| 196 | |||
| 197 | /* tcsetattr uses these */ | ||
| 198 | #define TCSANOW 0 | ||
| 199 | #define TCSADRAIN 1 | ||
| 200 | #define TCSAFLUSH 2 | ||
| 201 | |||
| 202 | #endif /* _ASM_TERMBITS_H__ */ | ||
| 203 | |||
diff --git a/arch/frv/kernel/init_task.c b/arch/frv/kernel/init_task.c new file mode 100644 index 00000000000..3c3e0b336a9 --- /dev/null +++ b/arch/frv/kernel/init_task.c | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #include <linux/mm.h> | ||
| 2 | #include <linux/module.h> | ||
| 3 | #include <linux/sched.h> | ||
| 4 | #include <linux/init.h> | ||
| 5 | #include <linux/init_task.h> | ||
| 6 | #include <linux/fs.h> | ||
| 7 | #include <linux/mqueue.h> | ||
| 8 | |||
| 9 | #include <asm/uaccess.h> | ||
| 10 | #include <asm/pgtable.h> | ||
| 11 | |||
| 12 | |||
| 13 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
| 14 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
| 15 | /* | ||
| 16 | * Initial thread structure. | ||
| 17 | * | ||
| 18 | * We need to make sure that this is THREAD_SIZE aligned due to the | ||
| 19 | * way process stacks are handled. This is done by having a special | ||
| 20 | * "init_task" linker map entry.. | ||
| 21 | */ | ||
| 22 | union thread_union init_thread_union __init_task_data = | ||
| 23 | { INIT_THREAD_INFO(init_task) }; | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Initial task structure. | ||
| 27 | * | ||
| 28 | * All other task structs will be allocated on slabs in fork.c | ||
| 29 | */ | ||
| 30 | struct task_struct init_task = INIT_TASK(init_task); | ||
| 31 | |||
| 32 | EXPORT_SYMBOL(init_task); | ||
diff --git a/arch/frv/kernel/kernel_execve.S b/arch/frv/kernel/kernel_execve.S new file mode 100644 index 00000000000..9b074a16a05 --- /dev/null +++ b/arch/frv/kernel/kernel_execve.S | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* in-kernel program execution | ||
| 2 | * | ||
| 3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/linkage.h> | ||
| 13 | #include <asm/unistd.h> | ||
| 14 | |||
| 15 | ############################################################################### | ||
| 16 | # | ||
| 17 | # Do a system call from kernel instead of calling sys_execve so we end up with | ||
| 18 | # proper pt_regs. | ||
| 19 | # | ||
| 20 | # int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | ||
| 21 | # | ||
| 22 | # On entry: GR8/GR9/GR10: arguments to function | ||
| 23 | # On return: GR8: syscall return. | ||
| 24 | # | ||
| 25 | ############################################################################### | ||
| 26 | .globl kernel_execve | ||
| 27 | .type kernel_execve,@function | ||
| 28 | kernel_execve: | ||
| 29 | setlos __NR_execve,gr7 | ||
| 30 | tira gr0,#0 | ||
| 31 | bralr | ||
| 32 | |||
| 33 | .size kernel_execve,.-kernel_execve | ||
diff --git a/arch/frv/kernel/kernel_thread.S b/arch/frv/kernel/kernel_thread.S new file mode 100644 index 00000000000..4531c830d20 --- /dev/null +++ b/arch/frv/kernel/kernel_thread.S | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* kernel_thread.S: kernel thread creation | ||
| 2 | * | ||
| 3 | * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/linkage.h> | ||
| 13 | #include <asm/unistd.h> | ||
| 14 | |||
| 15 | #define CLONE_VM 0x00000100 /* set if VM shared between processes */ | ||
| 16 | #define KERN_ERR "<3>" | ||
| 17 | |||
| 18 | .section .rodata | ||
| 19 | kernel_thread_emsg: | ||
| 20 | .asciz KERN_ERR "failed to create kernel thread: error=%d\n" | ||
| 21 | |||
| 22 | .text | ||
| 23 | .balign 4 | ||
| 24 | |||
| 25 | ############################################################################### | ||
| 26 | # | ||
| 27 | # Create a kernel thread | ||
| 28 | # | ||
| 29 | # int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | ||
| 30 | # | ||
| 31 | ############################################################################### | ||
| 32 | .globl kernel_thread | ||
| 33 | .type kernel_thread,@function | ||
| 34 | kernel_thread: | ||
| 35 | or.p gr8,gr0,gr4 | ||
| 36 | or gr9,gr0,gr5 | ||
| 37 | |||
| 38 | # start by forking the current process, but with shared VM | ||
| 39 | setlos.p #__NR_clone,gr7 ; syscall number | ||
| 40 | ori gr10,#CLONE_VM,gr8 ; first syscall arg [clone_flags] | ||
| 41 | sethi.p #0xe4e4,gr9 ; second syscall arg [newsp] | ||
| 42 | setlo #0xe4e4,gr9 | ||
| 43 | setlos.p #0,gr10 ; third syscall arg [parent_tidptr] | ||
| 44 | setlos #0,gr11 ; fourth syscall arg [child_tidptr] | ||
| 45 | tira gr0,#0 | ||
| 46 | setlos.p #4095,gr7 | ||
| 47 | andcc gr8,gr8,gr0,icc0 | ||
| 48 | addcc.p gr8,gr7,gr0,icc1 | ||
| 49 | bnelr icc0,#2 | ||
| 50 | bc icc1,#0,kernel_thread_error | ||
| 51 | |||
| 52 | # now invoke the work function | ||
| 53 | or gr5,gr0,gr8 | ||
| 54 | calll @(gr4,gr0) | ||
| 55 | |||
| 56 | # and finally exit the thread | ||
| 57 | setlos #__NR_exit,gr7 ; syscall number | ||
| 58 | tira gr0,#0 | ||
| 59 | |||
| 60 | kernel_thread_error: | ||
| 61 | subi sp,#8,sp | ||
| 62 | movsg lr,gr4 | ||
| 63 | sti gr8,@(sp,#0) | ||
| 64 | sti.p gr4,@(sp,#4) | ||
| 65 | |||
| 66 | or gr8,gr0,gr9 | ||
| 67 | sethi.p %hi(kernel_thread_emsg),gr8 | ||
| 68 | setlo %lo(kernel_thread_emsg),gr8 | ||
| 69 | |||
| 70 | call printk | ||
| 71 | |||
| 72 | ldi @(sp,#4),gr4 | ||
| 73 | ldi @(sp,#0),gr8 | ||
| 74 | subi sp,#8,sp | ||
| 75 | jmpl @(gr4,gr0) | ||
| 76 | |||
| 77 | .size kernel_thread,.-kernel_thread | ||
diff --git a/arch/frv/mb93090-mb00/pci-iomap.c b/arch/frv/mb93090-mb00/pci-iomap.c new file mode 100644 index 00000000000..35f6df28351 --- /dev/null +++ b/arch/frv/mb93090-mb00/pci-iomap.c | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* pci-iomap.c: description | ||
| 2 | * | ||
| 3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the License, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | #include <linux/pci.h> | ||
| 12 | #include <linux/module.h> | ||
| 13 | |||
| 14 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
| 15 | { | ||
| 16 | resource_size_t start = pci_resource_start(dev, bar); | ||
| 17 | resource_size_t len = pci_resource_len(dev, bar); | ||
| 18 | unsigned long flags = pci_resource_flags(dev, bar); | ||
| 19 | |||
| 20 | if (!len || !start) | ||
| 21 | return NULL; | ||
| 22 | |||
| 23 | if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM)) | ||
| 24 | return (void __iomem *) start; | ||
| 25 | |||
| 26 | return NULL; | ||
| 27 | } | ||
| 28 | |||
| 29 | EXPORT_SYMBOL(pci_iomap); | ||
