From 17425275112960af0dc9882c06c343d3b6ec8dc9 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Thu, 16 Feb 2012 14:56:14 +0100 Subject: openrisc: included linux/thread_info.h twice arch/openrisc/include/asm/uaccess.h: included 'linux/thread_info.h' twice, remove the duplicate. Signed-off-by: Danny Kukawka Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/uaccess.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/openrisc/include') diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h index c310e45b538e..f5abaa0ffc38 100644 --- a/arch/openrisc/include/asm/uaccess.h +++ b/arch/openrisc/include/asm/uaccess.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #define VERIFY_READ 0 -- cgit v1.2.2 From 2f099a280e92c259598d8ed8da82c7ec2dd49845 Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Fri, 2 Mar 2012 07:56:09 +0100 Subject: openrisc: fix virt_addr_valid virt_addr_valid() shouldn't be comparing the address to memory_end which is a phys_addr_t. Change this to do like other arches and check that the address falls within a valid page frame. Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/page.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/openrisc/include') diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h index b041b344b229..c4ffaee5f940 100644 --- a/arch/openrisc/include/asm/page.h +++ b/arch/openrisc/include/asm/page.h @@ -94,8 +94,7 @@ extern unsigned long memory_end; #define pfn_valid(pfn) ((pfn) < max_mapnr) -#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ - ((void *)(kaddr) < (void *)memory_end)) +#define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) #endif /* __ASSEMBLY__ */ -- cgit v1.2.2 From 6cbe5e95267449ea0b79c0b049342409949da3ac Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Fri, 2 Mar 2012 10:05:24 +0100 Subject: openrisc: sanitize use of orig_gpr11 The pt_regs struct had both a 'syscallno' field and an 'orig_gpr11' field and it wasn't really clear how these were supposed to be used. This patch removes the syscallno field altogether and makes orig_gpr11 work more like other architectures: keep track of syscall number in progress or hold -1 for non-syscall exceptions. Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/ptrace.h | 6 +++++- arch/openrisc/include/asm/syscall.h | 7 ++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'arch/openrisc/include') diff --git a/arch/openrisc/include/asm/ptrace.h b/arch/openrisc/include/asm/ptrace.h index e612ce4512c7..4651a737591d 100644 --- a/arch/openrisc/include/asm/ptrace.h +++ b/arch/openrisc/include/asm/ptrace.h @@ -73,9 +73,13 @@ struct pt_regs { }; }; long pc; + /* For restarting system calls: + * Set to syscall number for syscall exceptions, + * -1 for all other exceptions. + */ long orig_gpr11; /* For restarting system calls */ - long syscallno; /* Syscall number (used by strace) */ long dummy; /* Cheap alignment fix */ + long dummy2; /* Cheap alignment fix */ }; /* TODO: Rename this to REDZONE because that's what it is */ diff --git a/arch/openrisc/include/asm/syscall.h b/arch/openrisc/include/asm/syscall.h index 9f0337055d26..b752bb67891d 100644 --- a/arch/openrisc/include/asm/syscall.h +++ b/arch/openrisc/include/asm/syscall.h @@ -25,7 +25,7 @@ static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { - return regs->syscallno ? regs->syscallno : -1; + return regs->orig_gpr11; } static inline void @@ -50,10 +50,7 @@ static inline void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, int error, long val) { - if (error) - regs->gpr[11] = -error; - else - regs->gpr[11] = val; + regs->gpr[11] = (long) error ?: val; } static inline void -- cgit v1.2.2 From 1bc0b9fd7510742cf159ecc9e4d2fa87c804939a Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Tue, 6 Mar 2012 07:57:25 +0100 Subject: openrisc: remove semicolon from KSTK_ defs Things break rather ungracefully when a semicolon gets substituted into an expression... discovered while build-testing linux-next for 3.4 Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/openrisc/include') diff --git a/arch/openrisc/include/asm/processor.h b/arch/openrisc/include/asm/processor.h index bb54c97b9783..f7516fa78b58 100644 --- a/arch/openrisc/include/asm/processor.h +++ b/arch/openrisc/include/asm/processor.h @@ -81,8 +81,8 @@ extern inline void prepare_to_copy(struct task_struct *tsk) #define INIT_THREAD { } -#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc); -#define KSTK_ESP(tsk) (task_pt_regs(tsk)->sp); +#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) +#define KSTK_ESP(tsk) (task_pt_regs(tsk)->sp) extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -- cgit v1.2.2 From fa8d9d74c360726fe743b08af00ee3d0e0eb8bc1 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Fri, 2 Mar 2012 16:41:02 +0100 Subject: OpenRISC: Remove memory_start/end prototypes OpenRISC does not have global memory_start and memory_end symbols. The prototypes are in vain. Signed-off-by: Richard Weinberger Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/page.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/openrisc/include') diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h index c4ffaee5f940..108906f991d6 100644 --- a/arch/openrisc/include/asm/page.h +++ b/arch/openrisc/include/asm/page.h @@ -71,9 +71,6 @@ typedef struct page *pgtable_t; #define __pgd(x) ((pgd_t) { (x) }) #define __pgprot(x) ((pgprot_t) { (x) }) -extern unsigned long memory_start; -extern unsigned long memory_end; - #endif /* !__ASSEMBLY__ */ -- cgit v1.2.2