aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-22 17:51:06 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-22 17:51:06 -0400
commita4936044001694f033fe4ea94d6034d51a6b465c (patch)
tree4f1caf9899c1859277082422b1fc37901c6097ac /arch
parent9092131f7ea2f9e92a510ae13ac4d20165aa921c (diff)
parent92a8cbed29eb9bf6e8eec16ca29d54015bc0e8a2 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/common/dmabounce.c18
-rw-r--r--arch/arm/common/sa1111.c13
-rw-r--r--arch/arm/kernel/setup.c25
-rw-r--r--arch/arm/kernel/signal.c29
-rw-r--r--arch/arm/kernel/signal.h12
-rw-r--r--arch/arm/kernel/traps.c9
-rw-r--r--arch/arm/mach-clps7500/core.c2
-rw-r--r--arch/arm/mach-rpc/riscpc.c7
-rw-r--r--arch/arm/mm/init.c19
9 files changed, 77 insertions, 57 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 9d63a01214eb..cbf2165476b0 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -93,15 +93,12 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info)
93static inline struct dmabounce_device_info * 93static inline struct dmabounce_device_info *
94find_dmabounce_dev(struct device *dev) 94find_dmabounce_dev(struct device *dev)
95{ 95{
96 struct list_head *entry; 96 struct dmabounce_device_info *d;
97
98 list_for_each(entry, &dmabounce_devs) {
99 struct dmabounce_device_info *d =
100 list_entry(entry, struct dmabounce_device_info, node);
101 97
98 list_for_each_entry(d, &dmabounce_devs, node)
102 if (d->dev == dev) 99 if (d->dev == dev)
103 return d; 100 return d;
104 } 101
105 return NULL; 102 return NULL;
106} 103}
107 104
@@ -172,15 +169,11 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
172static inline struct safe_buffer * 169static inline struct safe_buffer *
173find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr) 170find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr)
174{ 171{
175 struct list_head *entry; 172 struct safe_buffer *b;
176
177 list_for_each(entry, &device_info->safe_buffers) {
178 struct safe_buffer *b =
179 list_entry(entry, struct safe_buffer, node);
180 173
174 list_for_each_entry(b, &device_info->safe_buffers, node)
181 if (b->safe_dma_addr == safe_dma_addr) 175 if (b->safe_dma_addr == safe_dma_addr)
182 return b; 176 return b;
183 }
184 177
185 return NULL; 178 return NULL;
186} 179}
@@ -301,7 +294,6 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
301 __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), 294 __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
302 buf->safe, (void *) buf->safe_dma_addr); 295 buf->safe, (void *) buf->safe_dma_addr);
303 296
304
305 DO_STATS ( device_info->bounce_count++ ); 297 DO_STATS ( device_info->bounce_count++ );
306 298
307 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { 299 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 21fce3414ed1..38c2eb667eb9 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -721,16 +721,17 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
721 return ret; 721 return ret;
722} 722}
723 723
724static int sa1111_remove_one(struct device *dev, void *data)
725{
726 device_unregister(dev);
727 return 0;
728}
729
724static void __sa1111_remove(struct sa1111 *sachip) 730static void __sa1111_remove(struct sa1111 *sachip)
725{ 731{
726 struct list_head *l, *n;
727 void __iomem *irqbase = sachip->base + SA1111_INTC; 732 void __iomem *irqbase = sachip->base + SA1111_INTC;
728 733
729 list_for_each_safe(l, n, &sachip->dev->children) { 734 device_for_each_child(sachip->dev, NULL, sa1111_remove_one);
730 struct device *d = list_to_dev(l);
731
732 device_unregister(d);
733 }
734 735
735 /* disable all IRQs */ 736 /* disable all IRQs */
736 sa1111_writel(0, irqbase + SA1111_INTEN0); 737 sa1111_writel(0, irqbase + SA1111_INTEN0);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 9fed5fa194d9..8cf733daa800 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -395,6 +395,20 @@ static void __init early_initrd(char **p)
395} 395}
396__early_param("initrd=", early_initrd); 396__early_param("initrd=", early_initrd);
397 397
398static void __init add_memory(unsigned long start, unsigned long size)
399{
400 /*
401 * Ensure that start/size are aligned to a page boundary.
402 * Size is appropriately rounded down, start is rounded up.
403 */
404 size -= start & ~PAGE_MASK;
405
406 meminfo.bank[meminfo.nr_banks].start = PAGE_ALIGN(start);
407 meminfo.bank[meminfo.nr_banks].size = size & PAGE_MASK;
408 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start);
409 meminfo.nr_banks += 1;
410}
411
398/* 412/*
399 * Pick out the memory size. We look for mem=size@start, 413 * Pick out the memory size. We look for mem=size@start,
400 * where start and size are "size[KkMm]" 414 * where start and size are "size[KkMm]"
@@ -419,10 +433,7 @@ static void __init early_mem(char **p)
419 if (**p == '@') 433 if (**p == '@')
420 start = memparse(*p + 1, p); 434 start = memparse(*p + 1, p);
421 435
422 meminfo.bank[meminfo.nr_banks].start = start; 436 add_memory(start, size);
423 meminfo.bank[meminfo.nr_banks].size = size;
424 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start);
425 meminfo.nr_banks += 1;
426} 437}
427__early_param("mem=", early_mem); 438__early_param("mem=", early_mem);
428 439
@@ -564,11 +575,7 @@ static int __init parse_tag_mem32(const struct tag *tag)
564 tag->u.mem.start, tag->u.mem.size / 1024); 575 tag->u.mem.start, tag->u.mem.size / 1024);
565 return -EINVAL; 576 return -EINVAL;
566 } 577 }
567 meminfo.bank[meminfo.nr_banks].start = tag->u.mem.start; 578 add_memory(tag->u.mem.start, tag->u.mem.size);
568 meminfo.bank[meminfo.nr_banks].size = tag->u.mem.size;
569 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(tag->u.mem.start);
570 meminfo.nr_banks += 1;
571
572 return 0; 579 return 0;
573} 580}
574 581
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 931919fd5121..07ddeed61766 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -19,6 +19,7 @@
19#include <asm/unistd.h> 19#include <asm/unistd.h>
20 20
21#include "ptrace.h" 21#include "ptrace.h"
22#include "signal.h"
22 23
23#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 24#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
24 25
@@ -35,7 +36,7 @@
35#define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE)) 36#define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE))
36#define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) 37#define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE))
37 38
38static const unsigned long retcodes[4] = { 39const unsigned long sigreturn_codes[4] = {
39 SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, 40 SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN,
40 SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN 41 SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN
41}; 42};
@@ -500,17 +501,25 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
500 if (ka->sa.sa_flags & SA_SIGINFO) 501 if (ka->sa.sa_flags & SA_SIGINFO)
501 idx += 2; 502 idx += 2;
502 503
503 if (__put_user(retcodes[idx], rc)) 504 if (__put_user(sigreturn_codes[idx], rc))
504 return 1; 505 return 1;
505 506
506 /* 507 if (cpsr & MODE32_BIT) {
507 * Ensure that the instruction cache sees 508 /*
508 * the return code written onto the stack. 509 * 32-bit code can use the new high-page
509 */ 510 * signal return code support.
510 flush_icache_range((unsigned long)rc, 511 */
511 (unsigned long)(rc + 1)); 512 retcode = KERN_SIGRETURN_CODE + (idx << 2) + thumb;
512 513 } else {
513 retcode = ((unsigned long)rc) + thumb; 514 /*
515 * Ensure that the instruction cache sees
516 * the return code written onto the stack.
517 */
518 flush_icache_range((unsigned long)rc,
519 (unsigned long)(rc + 1));
520
521 retcode = ((unsigned long)rc) + thumb;
522 }
514 } 523 }
515 524
516 regs->ARM_r0 = usig; 525 regs->ARM_r0 = usig;
diff --git a/arch/arm/kernel/signal.h b/arch/arm/kernel/signal.h
new file mode 100644
index 000000000000..91d26faca62b
--- /dev/null
+++ b/arch/arm/kernel/signal.h
@@ -0,0 +1,12 @@
1/*
2 * linux/arch/arm/kernel/signal.h
3 *
4 * Copyright (C) 2005 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#define KERN_SIGRETURN_CODE 0xffff0500
11
12extern const unsigned long sigreturn_codes[4];
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 45d2a032d890..2fb0a4cfb37a 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -30,6 +30,7 @@
30#include <asm/traps.h> 30#include <asm/traps.h>
31 31
32#include "ptrace.h" 32#include "ptrace.h"
33#include "signal.h"
33 34
34const char *processor_modes[]= 35const char *processor_modes[]=
35{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , 36{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
@@ -683,6 +684,14 @@ void __init trap_init(void)
683 memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start); 684 memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start);
684 memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start); 685 memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start);
685 memcpy((void *)0xffff1000 - kuser_sz, __kuser_helper_start, kuser_sz); 686 memcpy((void *)0xffff1000 - kuser_sz, __kuser_helper_start, kuser_sz);
687
688 /*
689 * Copy signal return handlers into the vector page, and
690 * set sigreturn to be a pointer to these.
691 */
692 memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,
693 sizeof(sigreturn_codes));
694
686 flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE); 695 flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE);
687 modify_domain(DOMAIN_USER, DOMAIN_CLIENT); 696 modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
688} 697}
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
index fdfededfd96f..0bc7da488612 100644
--- a/arch/arm/mach-clps7500/core.c
+++ b/arch/arm/mach-clps7500/core.c
@@ -26,6 +26,8 @@
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28 28
29unsigned int vram_size;
30
29static void cl7500_ack_irq_a(unsigned int irq) 31static void cl7500_ack_irq_a(unsigned int irq)
30{ 32{
31 unsigned int val, mask; 33 unsigned int val, mask;
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 815c53225cd8..437106881436 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -32,10 +32,7 @@
32 32
33extern void rpc_init_irq(void); 33extern void rpc_init_irq(void);
34 34
35extern unsigned int vram_size; 35unsigned int vram_size;
36
37#if 0
38
39unsigned int memc_ctrl_reg; 36unsigned int memc_ctrl_reg;
40unsigned int number_mfm_drives; 37unsigned int number_mfm_drives;
41 38
@@ -63,8 +60,6 @@ static int __init parse_tag_acorn(const struct tag *tag)
63 60
64__tagtable(ATAG_ACORN, parse_tag_acorn); 61__tagtable(ATAG_ACORN, parse_tag_acorn);
65 62
66#endif
67
68static struct map_desc rpc_io_desc[] __initdata = { 63static struct map_desc rpc_io_desc[] __initdata = {
69 { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */ 64 { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */
70 { (u32)IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */ 65 { (u32)IO_BASE, IO_START, IO_SIZE , MT_DEVICE }, /* IO space */
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 72a2b8cee319..c08710b1ff02 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -93,14 +93,7 @@ struct node_info {
93}; 93};
94 94
95#define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT) 95#define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT)
96#define V_PFN_DOWN(x) O_PFN_DOWN(__pa(x))
97
98#define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT) 96#define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT)
99#define V_PFN_UP(x) O_PFN_UP(__pa(x))
100
101#define PFN_SIZE(x) ((x) >> PAGE_SHIFT)
102#define PFN_RANGE(s,e) PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \
103 (((unsigned long)(s)) & PAGE_MASK))
104 97
105/* 98/*
106 * FIXME: We really want to avoid allocating the bootmap bitmap 99 * FIXME: We really want to avoid allocating the bootmap bitmap
@@ -113,7 +106,7 @@ find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
113{ 106{
114 unsigned int start_pfn, bank, bootmap_pfn; 107 unsigned int start_pfn, bank, bootmap_pfn;
115 108
116 start_pfn = V_PFN_UP(&_end); 109 start_pfn = O_PFN_UP(__pa(&_end));
117 bootmap_pfn = 0; 110 bootmap_pfn = 0;
118 111
119 for (bank = 0; bank < mi->nr_banks; bank ++) { 112 for (bank = 0; bank < mi->nr_banks; bank ++) {
@@ -122,9 +115,9 @@ find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
122 if (mi->bank[bank].node != node) 115 if (mi->bank[bank].node != node)
123 continue; 116 continue;
124 117
125 start = O_PFN_UP(mi->bank[bank].start); 118 start = mi->bank[bank].start >> PAGE_SHIFT;
126 end = O_PFN_DOWN(mi->bank[bank].size + 119 end = (mi->bank[bank].size +
127 mi->bank[bank].start); 120 mi->bank[bank].start) >> PAGE_SHIFT;
128 121
129 if (end < start_pfn) 122 if (end < start_pfn)
130 continue; 123 continue;
@@ -191,8 +184,8 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
191 /* 184 /*
192 * Get the start and end pfns for this bank 185 * Get the start and end pfns for this bank
193 */ 186 */
194 start = O_PFN_UP(mi->bank[i].start); 187 start = mi->bank[i].start >> PAGE_SHIFT;
195 end = O_PFN_DOWN(mi->bank[i].start + mi->bank[i].size); 188 end = (mi->bank[i].start + mi->bank[i].size) >> PAGE_SHIFT;
196 189
197 if (np[node].start > start) 190 if (np[node].start > start)
198 np[node].start = start; 191 np[node].start = start;