aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-12 21:46:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-12 21:46:18 -0400
commit54f7fc25e5736c39050454fe6b5a2bed027fbfab (patch)
tree89b1d6395360c17d03a5c3900cb274932d12791e
parent0c4a479bdf7c0cf3fa1610b25e0c4ddd5b58713e (diff)
parentc19c6c954b9b264abdc21e0c855118e3daf019b0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull tile arch update from Chris Metcalf: "The bulk of this change is the tile uapi disintegration. There is also a one-line change in here to enable interrupts in do_work_pending() to avoid a WARN_ON in _local_bh_enable_ip()." * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: arch/tile: enable interrupts in do_work_pending() UAPI: (Scripted) Disintegrate arch/tile/include/asm UAPI: (Scripted) Disintegrate arch/tile/include/arch
-rw-r--r--arch/tile/include/arch/Kbuild17
-rw-r--r--arch/tile/include/arch/spr_def.h12
-rw-r--r--arch/tile/include/asm/Kbuild3
-rw-r--r--arch/tile/include/asm/hardwall.h33
-rw-r--r--arch/tile/include/asm/ptrace.h72
-rw-r--r--arch/tile/include/asm/setup.h7
-rw-r--r--arch/tile/include/asm/signal.h12
-rw-r--r--arch/tile/include/asm/unistd.h25
-rw-r--r--arch/tile/include/uapi/arch/Kbuild17
-rw-r--r--arch/tile/include/uapi/arch/abi.h (renamed from arch/tile/include/arch/abi.h)0
-rw-r--r--arch/tile/include/uapi/arch/chip.h (renamed from arch/tile/include/arch/chip.h)0
-rw-r--r--arch/tile/include/uapi/arch/chip_tile64.h (renamed from arch/tile/include/arch/chip_tile64.h)0
-rw-r--r--arch/tile/include/uapi/arch/chip_tilegx.h (renamed from arch/tile/include/arch/chip_tilegx.h)0
-rw-r--r--arch/tile/include/uapi/arch/chip_tilepro.h (renamed from arch/tile/include/arch/chip_tilepro.h)0
-rw-r--r--arch/tile/include/uapi/arch/icache.h (renamed from arch/tile/include/arch/icache.h)0
-rw-r--r--arch/tile/include/uapi/arch/interrupts.h (renamed from arch/tile/include/arch/interrupts.h)0
-rw-r--r--arch/tile/include/uapi/arch/interrupts_32.h (renamed from arch/tile/include/arch/interrupts_32.h)0
-rw-r--r--arch/tile/include/uapi/arch/interrupts_64.h (renamed from arch/tile/include/arch/interrupts_64.h)0
-rw-r--r--arch/tile/include/uapi/arch/opcode.h (renamed from arch/tile/include/arch/opcode.h)0
-rw-r--r--arch/tile/include/uapi/arch/opcode_tilegx.h (renamed from arch/tile/include/arch/opcode_tilegx.h)0
-rw-r--r--arch/tile/include/uapi/arch/opcode_tilepro.h (renamed from arch/tile/include/arch/opcode_tilepro.h)0
-rw-r--r--arch/tile/include/uapi/arch/sim.h (renamed from arch/tile/include/arch/sim.h)0
-rw-r--r--arch/tile/include/uapi/arch/sim_def.h (renamed from arch/tile/include/arch/sim_def.h)0
-rw-r--r--arch/tile/include/uapi/arch/spr_def.h26
-rw-r--r--arch/tile/include/uapi/arch/spr_def_32.h (renamed from arch/tile/include/arch/spr_def_32.h)6
-rw-r--r--arch/tile/include/uapi/arch/spr_def_64.h (renamed from arch/tile/include/arch/spr_def_64.h)6
-rw-r--r--arch/tile/include/uapi/asm/Kbuild15
-rw-r--r--arch/tile/include/uapi/asm/auxvec.h (renamed from arch/tile/include/asm/auxvec.h)0
-rw-r--r--arch/tile/include/uapi/asm/bitsperlong.h (renamed from arch/tile/include/asm/bitsperlong.h)0
-rw-r--r--arch/tile/include/uapi/asm/byteorder.h (renamed from arch/tile/include/asm/byteorder.h)0
-rw-r--r--arch/tile/include/uapi/asm/cachectl.h (renamed from arch/tile/include/asm/cachectl.h)0
-rw-r--r--arch/tile/include/uapi/asm/hardwall.h51
-rw-r--r--arch/tile/include/uapi/asm/kvm_para.h (renamed from arch/tile/include/asm/kvm_para.h)0
-rw-r--r--arch/tile/include/uapi/asm/mman.h (renamed from arch/tile/include/asm/mman.h)0
-rw-r--r--arch/tile/include/uapi/asm/ptrace.h88
-rw-r--r--arch/tile/include/uapi/asm/setup.h21
-rw-r--r--arch/tile/include/uapi/asm/sigcontext.h (renamed from arch/tile/include/asm/sigcontext.h)0
-rw-r--r--arch/tile/include/uapi/asm/siginfo.h (renamed from arch/tile/include/asm/siginfo.h)0
-rw-r--r--arch/tile/include/uapi/asm/signal.h27
-rw-r--r--arch/tile/include/uapi/asm/stat.h (renamed from arch/tile/include/asm/stat.h)0
-rw-r--r--arch/tile/include/uapi/asm/swab.h (renamed from arch/tile/include/asm/swab.h)0
-rw-r--r--arch/tile/include/uapi/asm/unistd.h34
-rw-r--r--arch/tile/kernel/process.c3
43 files changed, 298 insertions, 177 deletions
diff --git a/arch/tile/include/arch/Kbuild b/arch/tile/include/arch/Kbuild
index 9c0ea24cc948..e69de29bb2d1 100644
--- a/arch/tile/include/arch/Kbuild
+++ b/arch/tile/include/arch/Kbuild
@@ -1,17 +0,0 @@
1header-y += abi.h
2header-y += chip.h
3header-y += chip_tile64.h
4header-y += chip_tilegx.h
5header-y += chip_tilepro.h
6header-y += icache.h
7header-y += interrupts.h
8header-y += interrupts_32.h
9header-y += interrupts_64.h
10header-y += opcode.h
11header-y += opcode_tilegx.h
12header-y += opcode_tilepro.h
13header-y += sim.h
14header-y += sim_def.h
15header-y += spr_def.h
16header-y += spr_def_32.h
17header-y += spr_def_64.h
diff --git a/arch/tile/include/arch/spr_def.h b/arch/tile/include/arch/spr_def.h
index d6ba449b5363..2de83e7aff3e 100644
--- a/arch/tile/include/arch/spr_def.h
+++ b/arch/tile/include/arch/spr_def.h
@@ -11,15 +11,11 @@
11 * NON INFRINGEMENT. See the GNU General Public License for 11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details. 12 * more details.
13 */ 13 */
14#ifndef __ARCH_SPR_DEF_H__
15#define __ARCH_SPR_DEF_H__
14 16
15/* Include the proper base SPR definition file. */ 17#include <uapi/arch/spr_def.h>
16#ifdef __tilegx__
17#include <arch/spr_def_64.h>
18#else
19#include <arch/spr_def_32.h>
20#endif
21 18
22#ifdef __KERNEL__
23 19
24/* 20/*
25 * In addition to including the proper base SPR definition file, depending 21 * In addition to including the proper base SPR definition file, depending
@@ -110,4 +106,4 @@
110#define INT_INTCTRL_K \ 106#define INT_INTCTRL_K \
111 _concat4(INT_INTCTRL_, CONFIG_KERNEL_PL,,) 107 _concat4(INT_INTCTRL_, CONFIG_KERNEL_PL,,)
112 108
113#endif /* __KERNEL__ */ 109#endif /* __ARCH_SPR_DEF_H__ */
diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild
index 5cd98fac9899..c68808a09da7 100644
--- a/arch/tile/include/asm/Kbuild
+++ b/arch/tile/include/asm/Kbuild
@@ -1,10 +1,7 @@
1include include/asm-generic/Kbuild.asm
2 1
3header-y += ../arch/ 2header-y += ../arch/
4 3
5header-y += cachectl.h
6header-y += ucontext.h 4header-y += ucontext.h
7header-y += hardwall.h
8 5
9generic-y += bug.h 6generic-y += bug.h
10generic-y += bugs.h 7generic-y += bugs.h
diff --git a/arch/tile/include/asm/hardwall.h b/arch/tile/include/asm/hardwall.h
index 47514a58d685..2f572b6b7bc2 100644
--- a/arch/tile/include/asm/hardwall.h
+++ b/arch/tile/include/asm/hardwall.h
@@ -14,40 +14,11 @@
14 * Provide methods for access control of per-cpu resources like 14 * Provide methods for access control of per-cpu resources like
15 * UDN, IDN, or IPI. 15 * UDN, IDN, or IPI.
16 */ 16 */
17
18#ifndef _ASM_TILE_HARDWALL_H 17#ifndef _ASM_TILE_HARDWALL_H
19#define _ASM_TILE_HARDWALL_H 18#define _ASM_TILE_HARDWALL_H
20 19
21#include <arch/chip.h> 20#include <uapi/asm/hardwall.h>
22#include <linux/ioctl.h>
23
24#define HARDWALL_IOCTL_BASE 0xa2
25
26/*
27 * The HARDWALL_CREATE() ioctl is a macro with a "size" argument.
28 * The resulting ioctl value is passed to the kernel in conjunction
29 * with a pointer to a standard kernel bitmask of cpus.
30 * For network resources (UDN or IDN) the bitmask must physically
31 * represent a rectangular configuration on the chip.
32 * The "size" is the number of bytes of cpu mask data.
33 */
34#define _HARDWALL_CREATE 1
35#define HARDWALL_CREATE(size) \
36 _IOC(_IOC_READ, HARDWALL_IOCTL_BASE, _HARDWALL_CREATE, (size))
37
38#define _HARDWALL_ACTIVATE 2
39#define HARDWALL_ACTIVATE \
40 _IO(HARDWALL_IOCTL_BASE, _HARDWALL_ACTIVATE)
41
42#define _HARDWALL_DEACTIVATE 3
43#define HARDWALL_DEACTIVATE \
44 _IO(HARDWALL_IOCTL_BASE, _HARDWALL_DEACTIVATE)
45
46#define _HARDWALL_GET_ID 4
47#define HARDWALL_GET_ID \
48 _IO(HARDWALL_IOCTL_BASE, _HARDWALL_GET_ID)
49 21
50#ifdef __KERNEL__
51/* /proc hooks for hardwall. */ 22/* /proc hooks for hardwall. */
52struct proc_dir_entry; 23struct proc_dir_entry;
53#ifdef CONFIG_HARDWALL 24#ifdef CONFIG_HARDWALL
@@ -56,6 +27,4 @@ int proc_pid_hardwall(struct task_struct *task, char *buffer);
56#else 27#else
57static inline void proc_tile_hardwall_init(struct proc_dir_entry *root) {} 28static inline void proc_tile_hardwall_init(struct proc_dir_entry *root) {}
58#endif 29#endif
59#endif
60
61#endif /* _ASM_TILE_HARDWALL_H */ 30#endif /* _ASM_TILE_HARDWALL_H */
diff --git a/arch/tile/include/asm/ptrace.h b/arch/tile/include/asm/ptrace.h
index c6cddd7e8d51..1a4fd9ab0ee1 100644
--- a/arch/tile/include/asm/ptrace.h
+++ b/arch/tile/include/asm/ptrace.h
@@ -11,87 +11,21 @@
11 * NON INFRINGEMENT. See the GNU General Public License for 11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details. 12 * more details.
13 */ 13 */
14
15#ifndef _ASM_TILE_PTRACE_H 14#ifndef _ASM_TILE_PTRACE_H
16#define _ASM_TILE_PTRACE_H 15#define _ASM_TILE_PTRACE_H
17 16
18#include <arch/chip.h> 17#include <linux/compiler.h>
19#include <arch/abi.h>
20
21/* These must match struct pt_regs, below. */
22#if CHIP_WORD_SIZE() == 32
23#define PTREGS_OFFSET_REG(n) ((n)*4)
24#else
25#define PTREGS_OFFSET_REG(n) ((n)*8)
26#endif
27#define PTREGS_OFFSET_BASE 0
28#define PTREGS_OFFSET_TP PTREGS_OFFSET_REG(53)
29#define PTREGS_OFFSET_SP PTREGS_OFFSET_REG(54)
30#define PTREGS_OFFSET_LR PTREGS_OFFSET_REG(55)
31#define PTREGS_NR_GPRS 56
32#define PTREGS_OFFSET_PC PTREGS_OFFSET_REG(56)
33#define PTREGS_OFFSET_EX1 PTREGS_OFFSET_REG(57)
34#define PTREGS_OFFSET_FAULTNUM PTREGS_OFFSET_REG(58)
35#define PTREGS_OFFSET_ORIG_R0 PTREGS_OFFSET_REG(59)
36#define PTREGS_OFFSET_FLAGS PTREGS_OFFSET_REG(60)
37#if CHIP_HAS_CMPEXCH()
38#define PTREGS_OFFSET_CMPEXCH PTREGS_OFFSET_REG(61)
39#endif
40#define PTREGS_SIZE PTREGS_OFFSET_REG(64)
41 18
42#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
43
44#ifdef __KERNEL__
45/* Benefit from consistent use of "long" on all chips. */ 20/* Benefit from consistent use of "long" on all chips. */
46typedef unsigned long pt_reg_t; 21typedef unsigned long pt_reg_t;
47#else
48/* Provide appropriate length type to userspace regardless of -m32/-m64. */
49typedef uint_reg_t pt_reg_t;
50#endif
51
52/*
53 * This struct defines the way the registers are stored on the stack during a
54 * system call or exception. "struct sigcontext" has the same shape.
55 */
56struct pt_regs {
57 /* Saved main processor registers; 56..63 are special. */
58 /* tp, sp, and lr must immediately follow regs[] for aliasing. */
59 pt_reg_t regs[53];
60 pt_reg_t tp; /* aliases regs[TREG_TP] */
61 pt_reg_t sp; /* aliases regs[TREG_SP] */
62 pt_reg_t lr; /* aliases regs[TREG_LR] */
63
64 /* Saved special registers. */
65 pt_reg_t pc; /* stored in EX_CONTEXT_K_0 */
66 pt_reg_t ex1; /* stored in EX_CONTEXT_K_1 (PL and ICS bit) */
67 pt_reg_t faultnum; /* fault number (INT_SWINT_1 for syscall) */
68 pt_reg_t orig_r0; /* r0 at syscall entry, else zero */
69 pt_reg_t flags; /* flags (see below) */
70#if !CHIP_HAS_CMPEXCH()
71 pt_reg_t pad[3];
72#else
73 pt_reg_t cmpexch; /* value of CMPEXCH_VALUE SPR at interrupt */
74 pt_reg_t pad[2];
75#endif 22#endif
76};
77
78#endif /* __ASSEMBLY__ */
79 23
80#define PTRACE_GETREGS 12 24#include <uapi/asm/ptrace.h>
81#define PTRACE_SETREGS 13
82#define PTRACE_GETFPREGS 14
83#define PTRACE_SETFPREGS 15
84 25
85/* Support TILE-specific ptrace options, with events starting at 16. */
86#define PTRACE_O_TRACEMIGRATE 0x00010000
87#define PTRACE_EVENT_MIGRATE 16
88#ifdef __KERNEL__
89#define PTRACE_O_MASK_TILE (PTRACE_O_TRACEMIGRATE) 26#define PTRACE_O_MASK_TILE (PTRACE_O_TRACEMIGRATE)
90#define PT_TRACE_MIGRATE 0x00080000 27#define PT_TRACE_MIGRATE 0x00080000
91#define PT_TRACE_MASK_TILE (PT_TRACE_MIGRATE) 28#define PT_TRACE_MASK_TILE (PT_TRACE_MIGRATE)
92#endif
93
94#ifdef __KERNEL__
95 29
96/* Flag bits in pt_regs.flags */ 30/* Flag bits in pt_regs.flags */
97#define PT_FLAGS_DISABLE_IRQ 1 /* on return to kernel, disable irqs */ 31#define PT_FLAGS_DISABLE_IRQ 1 /* on return to kernel, disable irqs */
@@ -159,6 +93,4 @@ extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,
159#define SINGLESTEP_STATE_TARGET_LB 2 93#define SINGLESTEP_STATE_TARGET_LB 2
160#define SINGLESTEP_STATE_TARGET_UB 7 94#define SINGLESTEP_STATE_TARGET_UB 7
161 95
162#endif /* !__KERNEL__ */
163
164#endif /* _ASM_TILE_PTRACE_H */ 96#endif /* _ASM_TILE_PTRACE_H */
diff --git a/arch/tile/include/asm/setup.h b/arch/tile/include/asm/setup.h
index c67eb70ea78e..d048888c5d9a 100644
--- a/arch/tile/include/asm/setup.h
+++ b/arch/tile/include/asm/setup.h
@@ -11,16 +11,13 @@
11 * NON INFRINGEMENT. See the GNU General Public License for 11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details. 12 * more details.
13 */ 13 */
14
15#ifndef _ASM_TILE_SETUP_H 14#ifndef _ASM_TILE_SETUP_H
16#define _ASM_TILE_SETUP_H 15#define _ASM_TILE_SETUP_H
17 16
18#define COMMAND_LINE_SIZE 2048
19
20#ifdef __KERNEL__
21 17
22#include <linux/pfn.h> 18#include <linux/pfn.h>
23#include <linux/init.h> 19#include <linux/init.h>
20#include <uapi/asm/setup.h>
24 21
25/* 22/*
26 * Reserved space for vmalloc and iomap - defined in asm/page.h 23 * Reserved space for vmalloc and iomap - defined in asm/page.h
@@ -53,6 +50,4 @@ int hardwall_ipi_valid(int cpu);
53} while (0) 50} while (0)
54#endif 51#endif
55 52
56#endif /* __KERNEL__ */
57
58#endif /* _ASM_TILE_SETUP_H */ 53#endif /* _ASM_TILE_SETUP_H */
diff --git a/arch/tile/include/asm/signal.h b/arch/tile/include/asm/signal.h
index 1e5e49aad548..10e183de96d3 100644
--- a/arch/tile/include/asm/signal.h
+++ b/arch/tile/include/asm/signal.h
@@ -11,19 +11,11 @@
11 * NON INFRINGEMENT. See the GNU General Public License for 11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details. 12 * more details.
13 */ 13 */
14
15#ifndef _ASM_TILE_SIGNAL_H 14#ifndef _ASM_TILE_SIGNAL_H
16#define _ASM_TILE_SIGNAL_H 15#define _ASM_TILE_SIGNAL_H
17 16
18/* Do not notify a ptracer when this signal is handled. */ 17#include <uapi/asm/signal.h>
19#define SA_NOPTRACE 0x02000000u
20
21/* Used in earlier Tilera releases, so keeping for binary compatibility. */
22#define SA_RESTORER 0x04000000u
23
24#include <asm-generic/signal.h>
25 18
26#if defined(__KERNEL__)
27#if !defined(__ASSEMBLY__) 19#if !defined(__ASSEMBLY__)
28struct pt_regs; 20struct pt_regs;
29int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); 21int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
@@ -34,6 +26,4 @@ void signal_fault(const char *type, struct pt_regs *,
34void trace_unhandled_signal(const char *type, struct pt_regs *regs, 26void trace_unhandled_signal(const char *type, struct pt_regs *regs,
35 unsigned long address, int signo); 27 unsigned long address, int signo);
36#endif 28#endif
37#endif
38
39#endif /* _ASM_TILE_SIGNAL_H */ 29#endif /* _ASM_TILE_SIGNAL_H */
diff --git a/arch/tile/include/asm/unistd.h b/arch/tile/include/asm/unistd.h
index 0e1f3e66e492..6e032a0a268e 100644
--- a/arch/tile/include/asm/unistd.h
+++ b/arch/tile/include/asm/unistd.h
@@ -11,32 +11,9 @@
11 * NON INFRINGEMENT. See the GNU General Public License for 11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details. 12 * more details.
13 */ 13 */
14
15#if !defined(__LP64__) || defined(__SYSCALL_COMPAT)
16/* Use the flavor of this syscall that matches the 32-bit API better. */
17#define __ARCH_WANT_SYNC_FILE_RANGE2
18#endif
19
20/* Use the standard ABI for syscalls. */
21#include <asm-generic/unistd.h>
22
23/* Additional Tilera-specific syscalls. */
24#define __NR_cacheflush (__NR_arch_specific_syscall + 1)
25__SYSCALL(__NR_cacheflush, sys_cacheflush)
26
27#ifndef __tilegx__
28/* "Fast" syscalls provide atomic support for 32-bit chips. */
29#define __NR_FAST_cmpxchg -1
30#define __NR_FAST_atomic_update -2
31#define __NR_FAST_cmpxchg64 -3
32#define __NR_cmpxchg_badaddr (__NR_arch_specific_syscall + 0)
33__SYSCALL(__NR_cmpxchg_badaddr, sys_cmpxchg_badaddr)
34#endif
35
36#ifdef __KERNEL__
37/* In compat mode, we use sys_llseek() for compat_sys_llseek(). */ 14/* In compat mode, we use sys_llseek() for compat_sys_llseek(). */
38#ifdef CONFIG_COMPAT 15#ifdef CONFIG_COMPAT
39#define __ARCH_WANT_SYS_LLSEEK 16#define __ARCH_WANT_SYS_LLSEEK
40#endif 17#endif
41#define __ARCH_WANT_SYS_NEWFSTATAT 18#define __ARCH_WANT_SYS_NEWFSTATAT
42#endif 19#include <uapi/asm/unistd.h>
diff --git a/arch/tile/include/uapi/arch/Kbuild b/arch/tile/include/uapi/arch/Kbuild
index aafaa5aa54d4..4ebc34f4768d 100644
--- a/arch/tile/include/uapi/arch/Kbuild
+++ b/arch/tile/include/uapi/arch/Kbuild
@@ -1 +1,18 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += abi.h
3header-y += chip.h
4header-y += chip_tile64.h
5header-y += chip_tilegx.h
6header-y += chip_tilepro.h
7header-y += icache.h
8header-y += interrupts.h
9header-y += interrupts_32.h
10header-y += interrupts_64.h
11header-y += opcode.h
12header-y += opcode_tilegx.h
13header-y += opcode_tilepro.h
14header-y += sim.h
15header-y += sim_def.h
16header-y += spr_def.h
17header-y += spr_def_32.h
18header-y += spr_def_64.h
diff --git a/arch/tile/include/arch/abi.h b/arch/tile/include/uapi/arch/abi.h
index c55a3d432644..c55a3d432644 100644
--- a/arch/tile/include/arch/abi.h
+++ b/arch/tile/include/uapi/arch/abi.h
diff --git a/arch/tile/include/arch/chip.h b/arch/tile/include/uapi/arch/chip.h
index 926d3db0e91e..926d3db0e91e 100644
--- a/arch/tile/include/arch/chip.h
+++ b/arch/tile/include/uapi/arch/chip.h
diff --git a/arch/tile/include/arch/chip_tile64.h b/arch/tile/include/uapi/arch/chip_tile64.h
index 261aaba092d4..261aaba092d4 100644
--- a/arch/tile/include/arch/chip_tile64.h
+++ b/arch/tile/include/uapi/arch/chip_tile64.h
diff --git a/arch/tile/include/arch/chip_tilegx.h b/arch/tile/include/uapi/arch/chip_tilegx.h
index ea8e4f2c9483..ea8e4f2c9483 100644
--- a/arch/tile/include/arch/chip_tilegx.h
+++ b/arch/tile/include/uapi/arch/chip_tilegx.h
diff --git a/arch/tile/include/arch/chip_tilepro.h b/arch/tile/include/uapi/arch/chip_tilepro.h
index 70017699a74c..70017699a74c 100644
--- a/arch/tile/include/arch/chip_tilepro.h
+++ b/arch/tile/include/uapi/arch/chip_tilepro.h
diff --git a/arch/tile/include/arch/icache.h b/arch/tile/include/uapi/arch/icache.h
index 762eafa8a11e..762eafa8a11e 100644
--- a/arch/tile/include/arch/icache.h
+++ b/arch/tile/include/uapi/arch/icache.h
diff --git a/arch/tile/include/arch/interrupts.h b/arch/tile/include/uapi/arch/interrupts.h
index 20f8f07d2de9..20f8f07d2de9 100644
--- a/arch/tile/include/arch/interrupts.h
+++ b/arch/tile/include/uapi/arch/interrupts.h
diff --git a/arch/tile/include/arch/interrupts_32.h b/arch/tile/include/uapi/arch/interrupts_32.h
index 96b5710505b6..96b5710505b6 100644
--- a/arch/tile/include/arch/interrupts_32.h
+++ b/arch/tile/include/uapi/arch/interrupts_32.h
diff --git a/arch/tile/include/arch/interrupts_64.h b/arch/tile/include/uapi/arch/interrupts_64.h
index 5bb58b2e4e6f..5bb58b2e4e6f 100644
--- a/arch/tile/include/arch/interrupts_64.h
+++ b/arch/tile/include/uapi/arch/interrupts_64.h
diff --git a/arch/tile/include/arch/opcode.h b/arch/tile/include/uapi/arch/opcode.h
index 92d15229ecec..92d15229ecec 100644
--- a/arch/tile/include/arch/opcode.h
+++ b/arch/tile/include/uapi/arch/opcode.h
diff --git a/arch/tile/include/arch/opcode_tilegx.h b/arch/tile/include/uapi/arch/opcode_tilegx.h
index c14d02c81600..c14d02c81600 100644
--- a/arch/tile/include/arch/opcode_tilegx.h
+++ b/arch/tile/include/uapi/arch/opcode_tilegx.h
diff --git a/arch/tile/include/arch/opcode_tilepro.h b/arch/tile/include/uapi/arch/opcode_tilepro.h
index 71b763b8ce83..71b763b8ce83 100644
--- a/arch/tile/include/arch/opcode_tilepro.h
+++ b/arch/tile/include/uapi/arch/opcode_tilepro.h
diff --git a/arch/tile/include/arch/sim.h b/arch/tile/include/uapi/arch/sim.h
index e54b7b0527f3..e54b7b0527f3 100644
--- a/arch/tile/include/arch/sim.h
+++ b/arch/tile/include/uapi/arch/sim.h
diff --git a/arch/tile/include/arch/sim_def.h b/arch/tile/include/uapi/arch/sim_def.h
index 4b44a2b6a09a..4b44a2b6a09a 100644
--- a/arch/tile/include/arch/sim_def.h
+++ b/arch/tile/include/uapi/arch/sim_def.h
diff --git a/arch/tile/include/uapi/arch/spr_def.h b/arch/tile/include/uapi/arch/spr_def.h
new file mode 100644
index 000000000000..c250c5adb1a6
--- /dev/null
+++ b/arch/tile/include/uapi/arch/spr_def.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _UAPI__ARCH_SPR_DEF_H__
16#define _UAPI__ARCH_SPR_DEF_H__
17
18/* Include the proper base SPR definition file. */
19#ifdef __tilegx__
20#include <arch/spr_def_64.h>
21#else
22#include <arch/spr_def_32.h>
23#endif
24
25
26#endif /* _UAPI__ARCH_SPR_DEF_H__ */
diff --git a/arch/tile/include/arch/spr_def_32.h b/arch/tile/include/uapi/arch/spr_def_32.h
index 78bbce2fb19a..c689446e6284 100644
--- a/arch/tile/include/arch/spr_def_32.h
+++ b/arch/tile/include/uapi/arch/spr_def_32.h
@@ -14,8 +14,8 @@
14 14
15#ifndef __DOXYGEN__ 15#ifndef __DOXYGEN__
16 16
17#ifndef __ARCH_SPR_DEF_H__ 17#ifndef __ARCH_SPR_DEF_32_H__
18#define __ARCH_SPR_DEF_H__ 18#define __ARCH_SPR_DEF_32_H__
19 19
20#define SPR_AUX_PERF_COUNT_0 0x6005 20#define SPR_AUX_PERF_COUNT_0 0x6005
21#define SPR_AUX_PERF_COUNT_1 0x6006 21#define SPR_AUX_PERF_COUNT_1 0x6006
@@ -252,6 +252,6 @@
252#define SPR_WATCH_MASK 0x420a 252#define SPR_WATCH_MASK 0x420a
253#define SPR_WATCH_VAL 0x420b 253#define SPR_WATCH_VAL 0x420b
254 254
255#endif /* !defined(__ARCH_SPR_DEF_H__) */ 255#endif /* !defined(__ARCH_SPR_DEF_32_H__) */
256 256
257#endif /* !defined(__DOXYGEN__) */ 257#endif /* !defined(__DOXYGEN__) */
diff --git a/arch/tile/include/arch/spr_def_64.h b/arch/tile/include/uapi/arch/spr_def_64.h
index 0da86faa3370..67a6c1751e3b 100644
--- a/arch/tile/include/arch/spr_def_64.h
+++ b/arch/tile/include/uapi/arch/spr_def_64.h
@@ -14,8 +14,8 @@
14 14
15#ifndef __DOXYGEN__ 15#ifndef __DOXYGEN__
16 16
17#ifndef __ARCH_SPR_DEF_H__ 17#ifndef __ARCH_SPR_DEF_64_H__
18#define __ARCH_SPR_DEF_H__ 18#define __ARCH_SPR_DEF_64_H__
19 19
20#define SPR_AUX_PERF_COUNT_0 0x2105 20#define SPR_AUX_PERF_COUNT_0 0x2105
21#define SPR_AUX_PERF_COUNT_1 0x2106 21#define SPR_AUX_PERF_COUNT_1 0x2106
@@ -211,6 +211,6 @@
211#define SPR_WATCH_MASK 0x200a 211#define SPR_WATCH_MASK 0x200a
212#define SPR_WATCH_VAL 0x200b 212#define SPR_WATCH_VAL 0x200b
213 213
214#endif /* !defined(__ARCH_SPR_DEF_H__) */ 214#endif /* !defined(__ARCH_SPR_DEF_64_H__) */
215 215
216#endif /* !defined(__DOXYGEN__) */ 216#endif /* !defined(__DOXYGEN__) */
diff --git a/arch/tile/include/uapi/asm/Kbuild b/arch/tile/include/uapi/asm/Kbuild
index baebb3da1d44..5c6915fd30b5 100644
--- a/arch/tile/include/uapi/asm/Kbuild
+++ b/arch/tile/include/uapi/asm/Kbuild
@@ -1,3 +1,18 @@
1# UAPI Header export list 1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4header-y += auxvec.h
5header-y += bitsperlong.h
6header-y += byteorder.h
7header-y += cachectl.h
8header-y += hardwall.h
9header-y += kvm_para.h
10header-y += mman.h
11header-y += ptrace.h
12header-y += setup.h
13header-y += sigcontext.h
14header-y += siginfo.h
15header-y += signal.h
16header-y += stat.h
17header-y += swab.h
18header-y += unistd.h
diff --git a/arch/tile/include/asm/auxvec.h b/arch/tile/include/uapi/asm/auxvec.h
index 1d393edb0641..1d393edb0641 100644
--- a/arch/tile/include/asm/auxvec.h
+++ b/arch/tile/include/uapi/asm/auxvec.h
diff --git a/arch/tile/include/asm/bitsperlong.h b/arch/tile/include/uapi/asm/bitsperlong.h
index 58c771f2af2f..58c771f2af2f 100644
--- a/arch/tile/include/asm/bitsperlong.h
+++ b/arch/tile/include/uapi/asm/bitsperlong.h
diff --git a/arch/tile/include/asm/byteorder.h b/arch/tile/include/uapi/asm/byteorder.h
index fb72ecf49218..fb72ecf49218 100644
--- a/arch/tile/include/asm/byteorder.h
+++ b/arch/tile/include/uapi/asm/byteorder.h
diff --git a/arch/tile/include/asm/cachectl.h b/arch/tile/include/uapi/asm/cachectl.h
index af4c9f9154d1..af4c9f9154d1 100644
--- a/arch/tile/include/asm/cachectl.h
+++ b/arch/tile/include/uapi/asm/cachectl.h
diff --git a/arch/tile/include/uapi/asm/hardwall.h b/arch/tile/include/uapi/asm/hardwall.h
new file mode 100644
index 000000000000..c2169d4f4010
--- /dev/null
+++ b/arch/tile/include/uapi/asm/hardwall.h
@@ -0,0 +1,51 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 *
14 * Provide methods for access control of per-cpu resources like
15 * UDN, IDN, or IPI.
16 */
17
18#ifndef _UAPI_ASM_TILE_HARDWALL_H
19#define _UAPI_ASM_TILE_HARDWALL_H
20
21#include <arch/chip.h>
22#include <linux/ioctl.h>
23
24#define HARDWALL_IOCTL_BASE 0xa2
25
26/*
27 * The HARDWALL_CREATE() ioctl is a macro with a "size" argument.
28 * The resulting ioctl value is passed to the kernel in conjunction
29 * with a pointer to a standard kernel bitmask of cpus.
30 * For network resources (UDN or IDN) the bitmask must physically
31 * represent a rectangular configuration on the chip.
32 * The "size" is the number of bytes of cpu mask data.
33 */
34#define _HARDWALL_CREATE 1
35#define HARDWALL_CREATE(size) \
36 _IOC(_IOC_READ, HARDWALL_IOCTL_BASE, _HARDWALL_CREATE, (size))
37
38#define _HARDWALL_ACTIVATE 2
39#define HARDWALL_ACTIVATE \
40 _IO(HARDWALL_IOCTL_BASE, _HARDWALL_ACTIVATE)
41
42#define _HARDWALL_DEACTIVATE 3
43#define HARDWALL_DEACTIVATE \
44 _IO(HARDWALL_IOCTL_BASE, _HARDWALL_DEACTIVATE)
45
46#define _HARDWALL_GET_ID 4
47#define HARDWALL_GET_ID \
48 _IO(HARDWALL_IOCTL_BASE, _HARDWALL_GET_ID)
49
50
51#endif /* _UAPI_ASM_TILE_HARDWALL_H */
diff --git a/arch/tile/include/asm/kvm_para.h b/arch/tile/include/uapi/asm/kvm_para.h
index 14fab8f0b957..14fab8f0b957 100644
--- a/arch/tile/include/asm/kvm_para.h
+++ b/arch/tile/include/uapi/asm/kvm_para.h
diff --git a/arch/tile/include/asm/mman.h b/arch/tile/include/uapi/asm/mman.h
index 81b8fc348d63..81b8fc348d63 100644
--- a/arch/tile/include/asm/mman.h
+++ b/arch/tile/include/uapi/asm/mman.h
diff --git a/arch/tile/include/uapi/asm/ptrace.h b/arch/tile/include/uapi/asm/ptrace.h
new file mode 100644
index 000000000000..c717d0fec72e
--- /dev/null
+++ b/arch/tile/include/uapi/asm/ptrace.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _UAPI_ASM_TILE_PTRACE_H
16#define _UAPI_ASM_TILE_PTRACE_H
17
18#include <arch/chip.h>
19#include <arch/abi.h>
20
21/* These must match struct pt_regs, below. */
22#if CHIP_WORD_SIZE() == 32
23#define PTREGS_OFFSET_REG(n) ((n)*4)
24#else
25#define PTREGS_OFFSET_REG(n) ((n)*8)
26#endif
27#define PTREGS_OFFSET_BASE 0
28#define PTREGS_OFFSET_TP PTREGS_OFFSET_REG(53)
29#define PTREGS_OFFSET_SP PTREGS_OFFSET_REG(54)
30#define PTREGS_OFFSET_LR PTREGS_OFFSET_REG(55)
31#define PTREGS_NR_GPRS 56
32#define PTREGS_OFFSET_PC PTREGS_OFFSET_REG(56)
33#define PTREGS_OFFSET_EX1 PTREGS_OFFSET_REG(57)
34#define PTREGS_OFFSET_FAULTNUM PTREGS_OFFSET_REG(58)
35#define PTREGS_OFFSET_ORIG_R0 PTREGS_OFFSET_REG(59)
36#define PTREGS_OFFSET_FLAGS PTREGS_OFFSET_REG(60)
37#if CHIP_HAS_CMPEXCH()
38#define PTREGS_OFFSET_CMPEXCH PTREGS_OFFSET_REG(61)
39#endif
40#define PTREGS_SIZE PTREGS_OFFSET_REG(64)
41
42
43#ifndef __ASSEMBLY__
44
45#ifndef __KERNEL__
46/* Provide appropriate length type to userspace regardless of -m32/-m64. */
47typedef uint_reg_t pt_reg_t;
48#endif
49
50/*
51 * This struct defines the way the registers are stored on the stack during a
52 * system call or exception. "struct sigcontext" has the same shape.
53 */
54struct pt_regs {
55 /* Saved main processor registers; 56..63 are special. */
56 /* tp, sp, and lr must immediately follow regs[] for aliasing. */
57 pt_reg_t regs[53];
58 pt_reg_t tp; /* aliases regs[TREG_TP] */
59 pt_reg_t sp; /* aliases regs[TREG_SP] */
60 pt_reg_t lr; /* aliases regs[TREG_LR] */
61
62 /* Saved special registers. */
63 pt_reg_t pc; /* stored in EX_CONTEXT_K_0 */
64 pt_reg_t ex1; /* stored in EX_CONTEXT_K_1 (PL and ICS bit) */
65 pt_reg_t faultnum; /* fault number (INT_SWINT_1 for syscall) */
66 pt_reg_t orig_r0; /* r0 at syscall entry, else zero */
67 pt_reg_t flags; /* flags (see below) */
68#if !CHIP_HAS_CMPEXCH()
69 pt_reg_t pad[3];
70#else
71 pt_reg_t cmpexch; /* value of CMPEXCH_VALUE SPR at interrupt */
72 pt_reg_t pad[2];
73#endif
74};
75
76#endif /* __ASSEMBLY__ */
77
78#define PTRACE_GETREGS 12
79#define PTRACE_SETREGS 13
80#define PTRACE_GETFPREGS 14
81#define PTRACE_SETFPREGS 15
82
83/* Support TILE-specific ptrace options, with events starting at 16. */
84#define PTRACE_O_TRACEMIGRATE 0x00010000
85#define PTRACE_EVENT_MIGRATE 16
86
87
88#endif /* _UAPI_ASM_TILE_PTRACE_H */
diff --git a/arch/tile/include/uapi/asm/setup.h b/arch/tile/include/uapi/asm/setup.h
new file mode 100644
index 000000000000..e6f7da265ac3
--- /dev/null
+++ b/arch/tile/include/uapi/asm/setup.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _UAPI_ASM_TILE_SETUP_H
16#define _UAPI_ASM_TILE_SETUP_H
17
18#define COMMAND_LINE_SIZE 2048
19
20
21#endif /* _UAPI_ASM_TILE_SETUP_H */
diff --git a/arch/tile/include/asm/sigcontext.h b/arch/tile/include/uapi/asm/sigcontext.h
index 6348e59d3724..6348e59d3724 100644
--- a/arch/tile/include/asm/sigcontext.h
+++ b/arch/tile/include/uapi/asm/sigcontext.h
diff --git a/arch/tile/include/asm/siginfo.h b/arch/tile/include/uapi/asm/siginfo.h
index 56d661bb010b..56d661bb010b 100644
--- a/arch/tile/include/asm/siginfo.h
+++ b/arch/tile/include/uapi/asm/siginfo.h
diff --git a/arch/tile/include/uapi/asm/signal.h b/arch/tile/include/uapi/asm/signal.h
new file mode 100644
index 000000000000..ef0d32d84a4c
--- /dev/null
+++ b/arch/tile/include/uapi/asm/signal.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _UAPI_ASM_TILE_SIGNAL_H
16#define _UAPI_ASM_TILE_SIGNAL_H
17
18/* Do not notify a ptracer when this signal is handled. */
19#define SA_NOPTRACE 0x02000000u
20
21/* Used in earlier Tilera releases, so keeping for binary compatibility. */
22#define SA_RESTORER 0x04000000u
23
24#include <asm-generic/signal.h>
25
26
27#endif /* _UAPI_ASM_TILE_SIGNAL_H */
diff --git a/arch/tile/include/asm/stat.h b/arch/tile/include/uapi/asm/stat.h
index c0db34d56be3..c0db34d56be3 100644
--- a/arch/tile/include/asm/stat.h
+++ b/arch/tile/include/uapi/asm/stat.h
diff --git a/arch/tile/include/asm/swab.h b/arch/tile/include/uapi/asm/swab.h
index 7c37b38f6c8d..7c37b38f6c8d 100644
--- a/arch/tile/include/asm/swab.h
+++ b/arch/tile/include/uapi/asm/swab.h
diff --git a/arch/tile/include/uapi/asm/unistd.h b/arch/tile/include/uapi/asm/unistd.h
new file mode 100644
index 000000000000..cd7b6dd9d471
--- /dev/null
+++ b/arch/tile/include/uapi/asm/unistd.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#if !defined(__LP64__) || defined(__SYSCALL_COMPAT)
16/* Use the flavor of this syscall that matches the 32-bit API better. */
17#define __ARCH_WANT_SYNC_FILE_RANGE2
18#endif
19
20/* Use the standard ABI for syscalls. */
21#include <asm-generic/unistd.h>
22
23/* Additional Tilera-specific syscalls. */
24#define __NR_cacheflush (__NR_arch_specific_syscall + 1)
25__SYSCALL(__NR_cacheflush, sys_cacheflush)
26
27#ifndef __tilegx__
28/* "Fast" syscalls provide atomic support for 32-bit chips. */
29#define __NR_FAST_cmpxchg -1
30#define __NR_FAST_atomic_update -2
31#define __NR_FAST_cmpxchg64 -3
32#define __NR_cmpxchg_badaddr (__NR_arch_specific_syscall + 0)
33__SYSCALL(__NR_cmpxchg_badaddr, sys_cmpxchg_badaddr)
34#endif
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index 622560030a58..307d010696c9 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -548,6 +548,9 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
548 if (!user_mode(regs)) 548 if (!user_mode(regs))
549 return 0; 549 return 0;
550 550
551 /* Enable interrupts; they are disabled again on return to caller. */
552 local_irq_enable();
553
551 if (thread_info_flags & _TIF_NEED_RESCHED) { 554 if (thread_info_flags & _TIF_NEED_RESCHED) {
552 schedule(); 555 schedule();
553 return 1; 556 return 1;