aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-21 18:57:50 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-21 18:57:50 -0400
commit9738cbe32192919356397f1e24f9b26e1f574fbb (patch)
tree75caa6d21a8b68a36285ee787095fb05b14627fb
parent58229a18994215bbfe0bcd1c99d2e039f30b076b (diff)
parent05dc16d6a175139a5872d08db56ee277ec90df5b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: [PARISC] unwinder improvements [PARISC] Fix unwinder on 64-bit kernels [PARISC] Handle wrapping in expand_upwards() [PARISC] stop lcd driver from stripping initial whitespace
-rw-r--r--arch/parisc/kernel/unwind.c43
-rw-r--r--drivers/parisc/led.c6
-rw-r--r--include/asm-parisc/system.h1
-rw-r--r--mm/mmap.c9
4 files changed, 43 insertions, 16 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index e70f57e27643..322167737de7 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -16,6 +16,8 @@
16 16
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/assembly.h> 18#include <asm/assembly.h>
19#include <asm/asm-offsets.h>
20#include <asm/ptrace.h>
19 21
20#include <asm/unwind.h> 22#include <asm/unwind.h>
21 23
@@ -26,6 +28,8 @@
26#define dbg(x...) 28#define dbg(x...)
27#endif 29#endif
28 30
31#define KERNEL_START (KERNEL_BINARY_TEXT_START - 0x1000)
32
29extern struct unwind_table_entry __start___unwind[]; 33extern struct unwind_table_entry __start___unwind[];
30extern struct unwind_table_entry __stop___unwind[]; 34extern struct unwind_table_entry __stop___unwind[];
31 35
@@ -197,6 +201,29 @@ static int unwind_init(void)
197 return 0; 201 return 0;
198} 202}
199 203
204#ifdef CONFIG_64BIT
205#define get_func_addr(fptr) fptr[2]
206#else
207#define get_func_addr(fptr) fptr[0]
208#endif
209
210static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size)
211{
212 void handle_interruption(int, struct pt_regs *);
213 static unsigned long *hi = (unsigned long)&handle_interruption;
214
215 if (pc == get_func_addr(hi)) {
216 struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN);
217 dbg("Unwinding through handle_interruption()\n");
218 info->prev_sp = regs->gr[30];
219 info->prev_ip = regs->iaoq[0];
220
221 return 1;
222 }
223
224 return 0;
225}
226
200static void unwind_frame_regs(struct unwind_frame_info *info) 227static void unwind_frame_regs(struct unwind_frame_info *info)
201{ 228{
202 const struct unwind_table_entry *e; 229 const struct unwind_table_entry *e;
@@ -310,13 +337,15 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
310 } 337 }
311 } 338 }
312 339
313 info->prev_sp = info->sp - frame_size; 340 if (!unwind_special(info, e->region_start, frame_size)) {
314 if (e->Millicode) 341 info->prev_sp = info->sp - frame_size;
315 info->rp = info->r31; 342 if (e->Millicode)
316 else if (rpoffset) 343 info->rp = info->r31;
317 info->rp = *(unsigned long *)(info->prev_sp - rpoffset); 344 else if (rpoffset)
318 info->prev_ip = info->rp; 345 info->rp = *(unsigned long *)(info->prev_sp - rpoffset);
319 info->rp = 0; 346 info->prev_ip = info->rp;
347 info->rp = 0;
348 }
320 349
321 dbg("analyzing func @ %lx, setting prev_sp=%lx " 350 dbg("analyzing func @ %lx, setting prev_sp=%lx "
322 "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, 351 "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp,
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index 98be2880757d..e5d7ed92d6f7 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,
195 195
196 cur = lbuf; 196 cur = lbuf;
197 197
198 /* skip initial spaces */
199 while (*cur && isspace(*cur))
200 {
201 cur++;
202 }
203
204 switch ((long)data) 198 switch ((long)data)
205 { 199 {
206 case LED_NOLCD: 200 case LED_NOLCD:
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 7e9afa720d43..21fbfc5afd02 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)
188# define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) 188# define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
189#endif 189#endif
190 190
191#define KERNEL_START (0x10100000 - 0x1000)
192#define arch_align_stack(x) (x) 191#define arch_align_stack(x) (x)
193 192
194#endif 193#endif
diff --git a/mm/mmap.c b/mm/mmap.c
index 68b9ad2ef1d6..906ed402f7ca 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1536,9 +1536,14 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
1536 * vma->vm_start/vm_end cannot change under us because the caller 1536 * vma->vm_start/vm_end cannot change under us because the caller
1537 * is required to hold the mmap_sem in read mode. We need the 1537 * is required to hold the mmap_sem in read mode. We need the
1538 * anon_vma lock to serialize against concurrent expand_stacks. 1538 * anon_vma lock to serialize against concurrent expand_stacks.
1539 * Also guard against wrapping around to address 0.
1539 */ 1540 */
1540 address += 4 + PAGE_SIZE - 1; 1541 if (address < PAGE_ALIGN(address+4))
1541 address &= PAGE_MASK; 1542 address = PAGE_ALIGN(address+4);
1543 else {
1544 anon_vma_unlock(vma);
1545 return -ENOMEM;
1546 }
1542 error = 0; 1547 error = 0;
1543 1548
1544 /* Somebody else might have raced and expanded it already */ 1549 /* Somebody else might have raced and expanded it already */