From d2f1c0fa2b346769ac35559ae3bafccf151dd446 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Mon, 18 Jun 2007 19:56:28 +0200 Subject: [PARISC] stop lcd driver from stripping initial whitespace Signed-off-by: Julian Stecklina Signed-off-by: Kyle McMartin diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 98be288..e5d7ed9 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -195,12 +195,6 @@ static int led_proc_write(struct file *file, const char *buf, cur = lbuf; - /* skip initial spaces */ - while (*cur && isspace(*cur)) - { - cur++; - } - switch ((long)data) { case LED_NOLCD: -- cgit v0.10.2 From 06b32f3ab6df4c7489729f94bdc7093c72681d4b Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 19 Dec 2006 19:28:33 +0100 Subject: [PARISC] Handle wrapping in expand_upwards() Function expand_upwards() did not guarded against wrapping around to address 0. This fixes the adjtimex02 testcase from the Linux Test Project on a 32bit PARISC kernel. [expand_upwards is only used on parisc and ia64; it looks like it does the right thing on both. --kyle] Signed-off-by: Helge Deller Cc: Tony Luck Signed-off-by: Kyle McMartin diff --git a/mm/mmap.c b/mm/mmap.c index 68b9ad2..906ed40 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1536,9 +1536,14 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) * vma->vm_start/vm_end cannot change under us because the caller * is required to hold the mmap_sem in read mode. We need the * anon_vma lock to serialize against concurrent expand_stacks. + * Also guard against wrapping around to address 0. */ - address += 4 + PAGE_SIZE - 1; - address &= PAGE_MASK; + if (address < PAGE_ALIGN(address+4)) + address = PAGE_ALIGN(address+4); + else { + anon_vma_unlock(vma); + return -ENOMEM; + } error = 0; /* Somebody else might have raced and expanded it already */ -- cgit v0.10.2 From e036306aa1832963cd147849b282259a32f5ac08 Mon Sep 17 00:00:00 2001 From: Randolph Chung Date: Tue, 12 Jun 2007 14:27:32 +0800 Subject: [PARISC] Fix unwinder on 64-bit kernels The unwinder was broken by the shift of PAGE_OFFSET in order to increase the size of the vmalloc area on 64-bit kernels. Signed-off-by: Randolph Chung Signed-off-by: Kyle McMartin diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index e70f57e..cad9d78 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -26,6 +26,8 @@ #define dbg(x...) #endif +#define KERNEL_START (KERNEL_BINARY_TEXT_START - 0x1000) + extern struct unwind_table_entry __start___unwind[]; extern struct unwind_table_entry __stop___unwind[]; diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 7e9afa7..21fbfc5 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h @@ -188,7 +188,6 @@ static inline void set_eiem(unsigned long val) # define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) #endif -#define KERNEL_START (0x10100000 - 0x1000) #define arch_align_stack(x) (x) #endif -- cgit v0.10.2 From 05dc16d6a175139a5872d08db56ee277ec90df5b Mon Sep 17 00:00:00 2001 From: Randolph Chung Date: Tue, 12 Jun 2007 14:27:32 +0800 Subject: [PARISC] unwinder improvements Add special-case handling for "handle_interruption" so that we can rewind past the interruption. This is useful for seeing what caused a BUG() or WARN_ON(); otherwise the unwind stops at the interruption. Signed-off-by: Randolph Chung Signed-off-by: Kyle McMartin diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index cad9d78..3221677 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -16,6 +16,8 @@ #include #include +#include +#include #include @@ -199,6 +201,29 @@ static int unwind_init(void) return 0; } +#ifdef CONFIG_64BIT +#define get_func_addr(fptr) fptr[2] +#else +#define get_func_addr(fptr) fptr[0] +#endif + +static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size) +{ + void handle_interruption(int, struct pt_regs *); + static unsigned long *hi = (unsigned long)&handle_interruption; + + if (pc == get_func_addr(hi)) { + struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN); + dbg("Unwinding through handle_interruption()\n"); + info->prev_sp = regs->gr[30]; + info->prev_ip = regs->iaoq[0]; + + return 1; + } + + return 0; +} + static void unwind_frame_regs(struct unwind_frame_info *info) { const struct unwind_table_entry *e; @@ -312,13 +337,15 @@ static void unwind_frame_regs(struct unwind_frame_info *info) } } - info->prev_sp = info->sp - frame_size; - if (e->Millicode) - info->rp = info->r31; - else if (rpoffset) - info->rp = *(unsigned long *)(info->prev_sp - rpoffset); - info->prev_ip = info->rp; - info->rp = 0; + if (!unwind_special(info, e->region_start, frame_size)) { + info->prev_sp = info->sp - frame_size; + if (e->Millicode) + info->rp = info->r31; + else if (rpoffset) + info->rp = *(unsigned long *)(info->prev_sp - rpoffset); + info->prev_ip = info->rp; + info->rp = 0; + } dbg("analyzing func @ %lx, setting prev_sp=%lx " "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, -- cgit v0.10.2