diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-09-03 14:45:52 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-09-03 14:45:52 -0400 |
commit | 051168df528fe4456d63f5f65b041c147c26fe97 (patch) | |
tree | 789109ca42db49bf4d8c0c2794cf55659a171a39 /arch/tile/include | |
parent | 309272f99f3e65b9bb5c49a2901c63a1859172f3 (diff) |
tile: don't assume user privilege is zero
Technically, user privilege is anything less than kernel
privilege. We modify the existing user_mode() macro to have
this semantic (and use it in a couple of places it wasn't being
used before), and add an IS_KERNEL_EX1() macro to the assembly
code as well.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/include')
-rw-r--r-- | arch/tile/include/asm/processor.h | 4 | ||||
-rw-r--r-- | arch/tile/include/asm/ptrace.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h index 230b830e94d4..c72fcba7016a 100644 --- a/arch/tile/include/asm/processor.h +++ b/arch/tile/include/asm/processor.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef _ASM_TILE_PROCESSOR_H | 15 | #ifndef _ASM_TILE_PROCESSOR_H |
16 | #define _ASM_TILE_PROCESSOR_H | 16 | #define _ASM_TILE_PROCESSOR_H |
17 | 17 | ||
18 | #include <arch/chip.h> | ||
19 | |||
18 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
19 | 21 | ||
20 | /* | 22 | /* |
@@ -25,7 +27,6 @@ | |||
25 | #include <asm/ptrace.h> | 27 | #include <asm/ptrace.h> |
26 | #include <asm/percpu.h> | 28 | #include <asm/percpu.h> |
27 | 29 | ||
28 | #include <arch/chip.h> | ||
29 | #include <arch/spr_def.h> | 30 | #include <arch/spr_def.h> |
30 | 31 | ||
31 | struct task_struct; | 32 | struct task_struct; |
@@ -347,7 +348,6 @@ extern int kdata_huge; | |||
347 | 348 | ||
348 | /* | 349 | /* |
349 | * Provide symbolic constants for PLs. | 350 | * Provide symbolic constants for PLs. |
350 | * Note that assembly code assumes that USER_PL is zero. | ||
351 | */ | 351 | */ |
352 | #define USER_PL 0 | 352 | #define USER_PL 0 |
353 | #if CONFIG_KERNEL_PL == 2 | 353 | #if CONFIG_KERNEL_PL == 2 |
diff --git a/arch/tile/include/asm/ptrace.h b/arch/tile/include/asm/ptrace.h index 0d25c21bcd61..b9620c077abc 100644 --- a/arch/tile/include/asm/ptrace.h +++ b/arch/tile/include/asm/ptrace.h | |||
@@ -39,7 +39,7 @@ typedef unsigned long pt_reg_t; | |||
39 | #define user_stack_pointer(regs) ((regs)->sp) | 39 | #define user_stack_pointer(regs) ((regs)->sp) |
40 | 40 | ||
41 | /* Does the process account for user or for system time? */ | 41 | /* Does the process account for user or for system time? */ |
42 | #define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL) | 42 | #define user_mode(regs) (EX1_PL((regs)->ex1) < KERNEL_PL) |
43 | 43 | ||
44 | /* Fill in a struct pt_regs with the current kernel registers. */ | 44 | /* Fill in a struct pt_regs with the current kernel registers. */ |
45 | struct pt_regs *get_pt_regs(struct pt_regs *); | 45 | struct pt_regs *get_pt_regs(struct pt_regs *); |