aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorKyle McMartin <kyle@parisc-linux.org>2007-02-17 00:18:23 -0500
committerKyle McMartin <kyle@parisc-linux.org>2007-02-17 00:18:23 -0500
commite7b3ca08549caccf5d6e1cf066780bf4f0ae77a7 (patch)
tree7e5745bea06675cfce60d6813ee3b4d5e19cbb56 /arch/parisc
parent62d0cfcb27cf755cebdc93ca95dabc83608007cd (diff)
parentcb6efb39163bfb6bb6475fa7c8a5e08e44dbf14a (diff)
Merge branch 'parisc' from /home/kyle/repos/parisc-2.6.git
Conflicts: arch/parisc/hpux/sys_hpux.c arch/parisc/mm/ioremap.c
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/Makefile8
-rw-r--r--arch/parisc/hpux/fs.c26
-rw-r--r--arch/parisc/hpux/sys_hpux.c30
-rw-r--r--arch/parisc/kernel/drivers.c8
-rw-r--r--arch/parisc/kernel/module.c3
-rw-r--r--arch/parisc/kernel/pci-dma.c2
-rw-r--r--arch/parisc/kernel/pci.c4
-rw-r--r--arch/parisc/kernel/process.c4
-rw-r--r--arch/parisc/kernel/processor.c2
-rw-r--r--arch/parisc/kernel/smp.c11
-rw-r--r--arch/parisc/mm/init.c64
-rw-r--r--arch/parisc/mm/ioremap.c6
-rw-r--r--arch/parisc/mm/kmap.c166
-rw-r--r--arch/parisc/oprofile/init.c2
14 files changed, 116 insertions, 220 deletions
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 9b7e42490dd1..760567a9ba16 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -35,12 +35,8 @@ FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align
35 35
36OBJCOPY_FLAGS =-O binary -R .note -R .comment -S 36OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
37 37
38GCC_VERSION := $(call cc-version) 38ifneq ($(call cc-ifversion, -lt, 0303, "bad"),)
39ifneq ($(shell if [ -z $(GCC_VERSION) ] ; then echo "bad"; fi ;),) 39$(error Sorry, GCC v3.3 or above is required.)
40$(error Sorry, couldn't find ($(cc-version)).)
41endif
42ifneq ($(shell if [ $(GCC_VERSION) -lt 0303 ] ; then echo "bad"; fi ;),)
43$(error Sorry, your compiler is too old ($(GCC_VERSION)). GCC v3.3 or above is required.)
44endif 40endif
45 41
46cflags-y := -pipe 42cflags-y := -pipe
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c
index 4204cd1f3cf9..c7a81a2c014c 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -35,13 +35,13 @@ int hpux_execve(struct pt_regs *regs)
35 int error; 35 int error;
36 char *filename; 36 char *filename;
37 37
38 filename = getname((char *) regs->gr[26]); 38 filename = getname((char __user *) regs->gr[26]);
39 error = PTR_ERR(filename); 39 error = PTR_ERR(filename);
40 if (IS_ERR(filename)) 40 if (IS_ERR(filename))
41 goto out; 41 goto out;
42 42
43 error = do_execve(filename, (char **) regs->gr[25], 43 error = do_execve(filename, (char __user * __user *) regs->gr[25],
44 (char **)regs->gr[24], regs); 44 (char __user * __user *) regs->gr[24], regs);
45 45
46 if (error == 0) { 46 if (error == 0) {
47 task_lock(current); 47 task_lock(current);
@@ -63,19 +63,19 @@ struct hpux_dirent {
63}; 63};
64 64
65struct getdents_callback { 65struct getdents_callback {
66 struct hpux_dirent *current_dir; 66 struct hpux_dirent __user *current_dir;
67 struct hpux_dirent *previous; 67 struct hpux_dirent __user *previous;
68 int count; 68 int count;
69 int error; 69 int error;
70}; 70};
71 71
72#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de))) 72#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
73#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) 73#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
74 74
75static int filldir(void * __buf, const char * name, int namlen, loff_t offset, 75static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
76 u64 ino, unsigned d_type) 76 u64 ino, unsigned d_type)
77{ 77{
78 struct hpux_dirent * dirent; 78 struct hpux_dirent __user * dirent;
79 struct getdents_callback * buf = (struct getdents_callback *) __buf; 79 struct getdents_callback * buf = (struct getdents_callback *) __buf;
80 ino_t d_ino; 80 ino_t d_ino;
81 int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); 81 int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
@@ -105,10 +105,10 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
105#undef NAME_OFFSET 105#undef NAME_OFFSET
106#undef ROUND_UP 106#undef ROUND_UP
107 107
108int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count) 108int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned int count)
109{ 109{
110 struct file * file; 110 struct file * file;
111 struct hpux_dirent * lastdirent; 111 struct hpux_dirent __user * lastdirent;
112 struct getdents_callback buf; 112 struct getdents_callback buf;
113 int error = -EBADF; 113 int error = -EBADF;
114 114
@@ -143,7 +143,7 @@ int hpux_mount(const char *fs, const char *path, int mflag,
143 return -ENOSYS; 143 return -ENOSYS;
144} 144}
145 145
146static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 *statbuf) 146static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 __user *statbuf)
147{ 147{
148 struct hpux_stat64 tmp; 148 struct hpux_stat64 tmp;
149 149
@@ -169,7 +169,7 @@ static int cp_hpux_stat(struct kstat *stat, struct hpux_stat64 *statbuf)
169 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 169 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
170} 170}
171 171
172long hpux_stat64(char *filename, struct hpux_stat64 *statbuf) 172long hpux_stat64(char __user *filename, struct hpux_stat64 __user *statbuf)
173{ 173{
174 struct kstat stat; 174 struct kstat stat;
175 int error = vfs_stat(filename, &stat); 175 int error = vfs_stat(filename, &stat);
@@ -180,7 +180,7 @@ long hpux_stat64(char *filename, struct hpux_stat64 *statbuf)
180 return error; 180 return error;
181} 181}
182 182
183long hpux_fstat64(unsigned int fd, struct hpux_stat64 *statbuf) 183long hpux_fstat64(unsigned int fd, struct hpux_stat64 __user *statbuf)
184{ 184{
185 struct kstat stat; 185 struct kstat stat;
186 int error = vfs_fstat(fd, &stat); 186 int error = vfs_fstat(fd, &stat);
@@ -191,7 +191,7 @@ long hpux_fstat64(unsigned int fd, struct hpux_stat64 *statbuf)
191 return error; 191 return error;
192} 192}
193 193
194long hpux_lstat64(char *filename, struct hpux_stat64 *statbuf) 194long hpux_lstat64(char __user *filename, struct hpux_stat64 __user *statbuf)
195{ 195{
196 struct kstat stat; 196 struct kstat stat;
197 int error = vfs_lstat(filename, &stat); 197 int error = vfs_lstat(filename, &stat);
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c
index 04c2ff444396..c57fcb4b2173 100644
--- a/arch/parisc/hpux/sys_hpux.c
+++ b/arch/parisc/hpux/sys_hpux.c
@@ -61,7 +61,7 @@ int hpux_ptrace(void)
61 return -ENOSYS; 61 return -ENOSYS;
62} 62}
63 63
64int hpux_wait(int *stat_loc) 64int hpux_wait(int __user *stat_loc)
65{ 65{
66 return sys_waitpid(-1, stat_loc, 0); 66 return sys_waitpid(-1, stat_loc, 0);
67} 67}
@@ -255,7 +255,7 @@ asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf)
255/* TODO: Are these put_user calls OK? Should they pass an int? 255/* TODO: Are these put_user calls OK? Should they pass an int?
256 * (I copied it from sys_i386.c like this.) 256 * (I copied it from sys_i386.c like this.)
257 */ 257 */
258static int hpux_uname(struct hpux_utsname *name) 258static int hpux_uname(struct hpux_utsname __user *name)
259{ 259{
260 int error; 260 int error;
261 261
@@ -300,14 +300,14 @@ static int hpux_uname(struct hpux_utsname *name)
300/* Note: HP-UX just uses the old suser() function to check perms 300/* Note: HP-UX just uses the old suser() function to check perms
301 * in this system call. We'll use capable(CAP_SYS_ADMIN). 301 * in this system call. We'll use capable(CAP_SYS_ADMIN).
302 */ 302 */
303int hpux_utssys(char *ubuf, int n, int type) 303int hpux_utssys(char __user *ubuf, int n, int type)
304{ 304{
305 int len; 305 int len;
306 int error; 306 int error;
307 switch( type ) { 307 switch( type ) {
308 case 0: 308 case 0:
309 /* uname(): */ 309 /* uname(): */
310 return( hpux_uname( (struct hpux_utsname *)ubuf ) ); 310 return hpux_uname((struct hpux_utsname __user *)ubuf);
311 break ; 311 break ;
312 case 1: 312 case 1:
313 /* Obsolete (used to be umask().) */ 313 /* Obsolete (used to be umask().) */
@@ -315,8 +315,9 @@ int hpux_utssys(char *ubuf, int n, int type)
315 break ; 315 break ;
316 case 2: 316 case 2:
317 /* ustat(): */ 317 /* ustat(): */
318 return( hpux_ustat(new_decode_dev(n), (struct hpux_ustat *)ubuf) ); 318 return hpux_ustat(new_decode_dev(n),
319 break ; 319 (struct hpux_ustat __user *)ubuf);
320 break;
320 case 3: 321 case 3:
321 /* setuname(): 322 /* setuname():
322 * 323 *
@@ -332,7 +333,7 @@ int hpux_utssys(char *ubuf, int n, int type)
332 return -EINVAL ; 333 return -EINVAL ;
333 /* Unlike Linux, HP-UX truncates it if n is too big: */ 334 /* Unlike Linux, HP-UX truncates it if n is too big: */
334 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ; 335 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
335 return( sys_sethostname(ubuf, len) ); 336 return sys_sethostname(ubuf, len);
336 break ; 337 break ;
337 case 4: 338 case 4:
338 /* sethostname(): 339 /* sethostname():
@@ -346,7 +347,7 @@ int hpux_utssys(char *ubuf, int n, int type)
346 return -EINVAL ; 347 return -EINVAL ;
347 /* Unlike Linux, HP-UX truncates it if n is too big: */ 348 /* Unlike Linux, HP-UX truncates it if n is too big: */
348 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ; 349 len = (n <= __NEW_UTS_LEN) ? n : __NEW_UTS_LEN ;
349 return( sys_sethostname(ubuf, len) ); 350 return sys_sethostname(ubuf, len);
350 break ; 351 break ;
351 case 5: 352 case 5:
352 /* gethostname(): 353 /* gethostname():
@@ -356,7 +357,7 @@ int hpux_utssys(char *ubuf, int n, int type)
356 /* Unlike Linux, HP-UX returns an error if n==0: */ 357 /* Unlike Linux, HP-UX returns an error if n==0: */
357 if ( n <= 0 ) 358 if ( n <= 0 )
358 return -EINVAL ; 359 return -EINVAL ;
359 return( sys_gethostname(ubuf, n) ); 360 return sys_gethostname(ubuf, n);
360 break ; 361 break ;
361 case 6: 362 case 6:
362 /* Supposedly called from setuname() in libc. 363 /* Supposedly called from setuname() in libc.
@@ -420,7 +421,7 @@ int hpux_utssys(char *ubuf, int n, int type)
420 } 421 }
421} 422}
422 423
423int hpux_getdomainname(char *name, int len) 424int hpux_getdomainname(char __user *name, int len)
424{ 425{
425 int nlen; 426 int nlen;
426 int err = -EFAULT; 427 int err = -EFAULT;
@@ -471,17 +472,18 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
471 printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1); 472 printk(KERN_DEBUG "hpux_sysfs called with arg1='%lx'\n", arg1);
472 473
473 if ( opcode == 1 ) { /* GETFSIND */ 474 if ( opcode == 1 ) { /* GETFSIND */
474 len = strlen_user((char *)arg1); 475 char __user *user_fsname = (char __user *)arg1;
476 len = strlen_user(user_fsname);
475 printk(KERN_DEBUG "len of arg1 = %d\n", len); 477 printk(KERN_DEBUG "len of arg1 = %d\n", len);
476 if (len == 0) 478 if (len == 0)
477 return 0; 479 return 0;
478 fsname = kmalloc(len, GFP_KERNEL); 480 fsname = kmalloc(len, GFP_KERNEL);
479 if ( !fsname ) { 481 if (!fsname) {
480 printk(KERN_DEBUG "failed to kmalloc fsname\n"); 482 printk(KERN_DEBUG "failed to kmalloc fsname\n");
481 return 0; 483 return 0;
482 } 484 }
483 485
484 if ( copy_from_user(fsname, (char *)arg1, len) ) { 486 if (copy_from_user(fsname, user_fsname, len)) {
485 printk(KERN_DEBUG "failed to copy_from_user fsname\n"); 487 printk(KERN_DEBUG "failed to copy_from_user fsname\n");
486 kfree(fsname); 488 kfree(fsname);
487 return 0; 489 return 0;
@@ -495,7 +497,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
495 fstype = 0; 497 fstype = 0;
496 } else { 498 } else {
497 fstype = 0; 499 fstype = 0;
498 }; 500 }
499 501
500 kfree(fsname); 502 kfree(fsname);
501 503
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index d6c486e9501c..6274cd268e6a 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -689,7 +689,9 @@ parse_tree_node(struct device *parent, int index, struct hardware_path *modpath)
689 .fn = check_parent, 689 .fn = check_parent,
690 }; 690 };
691 691
692 device_for_each_child(parent, &recurse_data, descend_children); 692 if (device_for_each_child(parent, &recurse_data, descend_children))
693 /* nothing */;
694
693 return d.dev; 695 return d.dev;
694} 696}
695 697
@@ -835,8 +837,8 @@ static void print_parisc_device(struct parisc_device *dev)
835 static int count; 837 static int count;
836 838
837 print_pa_hwpath(dev, hw_path); 839 print_pa_hwpath(dev, hw_path);
838 printk(KERN_INFO "%d. %s at 0x%lx [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", 840 printk(KERN_INFO "%d. %s at 0x%p [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
839 ++count, dev->name, dev->hpa.start, hw_path, dev->id.hw_type, 841 ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type,
840 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); 842 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
841 843
842 if (dev->num_addrs) { 844 if (dev->num_addrs) {
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index f50b982b0834..47ea4e4a2179 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -822,7 +822,8 @@ int module_finalize(const Elf_Ehdr *hdr,
822 me->name, strtab, symhdr); 822 me->name, strtab, symhdr);
823 823
824 if(me->arch.got_count > MAX_GOTS) { 824 if(me->arch.got_count > MAX_GOTS) {
825 printk(KERN_ERR "%s: Global Offset Table overflow (used %ld, allowed %d\n", me->name, me->arch.got_count, MAX_GOTS); 825 printk(KERN_ERR "%s: Global Offset Table overflow (used %ld, allowed %d)\n",
826 me->name, me->arch.got_count, MAX_GOTS);
826 return -EINVAL; 827 return -EINVAL;
827 } 828 }
828 829
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index a6caf1073085..0c3aecb85a5c 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -342,7 +342,7 @@ pcxl_dma_init(void)
342 pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL, 342 pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL,
343 get_order(pcxl_res_size)); 343 get_order(pcxl_res_size));
344 memset(pcxl_res_map, 0, pcxl_res_size); 344 memset(pcxl_res_map, 0, pcxl_res_size);
345 proc_gsc_root = proc_mkdir("gsc", 0); 345 proc_gsc_root = proc_mkdir("gsc", NULL);
346 if (!proc_gsc_root) 346 if (!proc_gsc_root)
347 printk(KERN_WARNING 347 printk(KERN_WARNING
348 "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); 348 "pcxl_dma_init: Unable to create gsc /proc dir entry\n");
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 199887a61c76..563df0072dee 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -200,8 +200,8 @@ static void
200pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) 200pcibios_link_hba_resources( struct resource *hba_res, struct resource *r)
201{ 201{
202 if (!r->parent) { 202 if (!r->parent) {
203 printk(KERN_EMERG "PCI: resource not parented! [%lx-%lx]\n", 203 printk(KERN_EMERG "PCI: resource not parented! [%p-%p]\n",
204 r->start, r->end); 204 (void*) r->start, (void*) r->end);
205 r->parent = hba_res; 205 r->parent = hba_res;
206 206
207 /* reverse link is harder *sigh* */ 207 /* reverse link is harder *sigh* */
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 2f9f9dfa66f7..dfca014b49ba 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -355,8 +355,8 @@ asmlinkage int sys_execve(struct pt_regs *regs)
355 error = PTR_ERR(filename); 355 error = PTR_ERR(filename);
356 if (IS_ERR(filename)) 356 if (IS_ERR(filename))
357 goto out; 357 goto out;
358 error = do_execve(filename, (char __user **) regs->gr[25], 358 error = do_execve(filename, (char __user * __user *) regs->gr[25],
359 (char __user **) regs->gr[24], regs); 359 (char __user * __user *) regs->gr[24], regs);
360 if (error == 0) { 360 if (error == 0) {
361 task_lock(current); 361 task_lock(current);
362 current->ptrace &= ~PT_DTRACE; 362 current->ptrace &= ~PT_DTRACE;
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index fb81e5687e7c..0af1fad2fc65 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -153,8 +153,6 @@ static int __init processor_probe(struct parisc_device *dev)
153 p->cpuid = cpuid; /* save CPU id */ 153 p->cpuid = cpuid; /* save CPU id */
154 p->txn_addr = txn_addr; /* save CPU IRQ address */ 154 p->txn_addr = txn_addr; /* save CPU IRQ address */
155#ifdef CONFIG_SMP 155#ifdef CONFIG_SMP
156 spin_lock_init(&p->lock);
157
158 /* 156 /*
159 ** FIXME: review if any other initialization is clobbered 157 ** FIXME: review if any other initialization is clobbered
160 ** for boot_cpu by the above memset(). 158 ** for boot_cpu by the above memset().
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 12cc019307ad..3b67d115fb0a 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -76,6 +76,7 @@ cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; /* Bitmap of Present CP
76EXPORT_SYMBOL(cpu_online_map); 76EXPORT_SYMBOL(cpu_online_map);
77EXPORT_SYMBOL(cpu_possible_map); 77EXPORT_SYMBOL(cpu_possible_map);
78 78
79DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;
79 80
80struct smp_call_struct { 81struct smp_call_struct {
81 void (*func) (void *info); 82 void (*func) (void *info);
@@ -167,10 +168,11 @@ ipi_interrupt(int irq, void *dev_id)
167 mb(); /* Order interrupt and bit testing. */ 168 mb(); /* Order interrupt and bit testing. */
168 169
169 for (;;) { 170 for (;;) {
170 spin_lock_irqsave(&(p->lock),flags); 171 spinlock_t *lock = &per_cpu(ipi_lock, this_cpu);
172 spin_lock_irqsave(lock, flags);
171 ops = p->pending_ipi; 173 ops = p->pending_ipi;
172 p->pending_ipi = 0; 174 p->pending_ipi = 0;
173 spin_unlock_irqrestore(&(p->lock),flags); 175 spin_unlock_irqrestore(lock, flags);
174 176
175 mb(); /* Order bit clearing and data access. */ 177 mb(); /* Order bit clearing and data access. */
176 178
@@ -275,12 +277,13 @@ static inline void
275ipi_send(int cpu, enum ipi_message_type op) 277ipi_send(int cpu, enum ipi_message_type op)
276{ 278{
277 struct cpuinfo_parisc *p = &cpu_data[cpu]; 279 struct cpuinfo_parisc *p = &cpu_data[cpu];
280 spinlock_t *lock = &per_cpu(ipi_lock, cpu);
278 unsigned long flags; 281 unsigned long flags;
279 282
280 spin_lock_irqsave(&(p->lock),flags); 283 spin_lock_irqsave(lock, flags);
281 p->pending_ipi |= 1 << op; 284 p->pending_ipi |= 1 << op;
282 gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa); 285 gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa);
283 spin_unlock_irqrestore(&(p->lock),flags); 286 spin_unlock_irqrestore(lock, flags);
284} 287}
285 288
286 289
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 0667f2b4f977..fc49a5ed78cc 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -24,6 +24,7 @@
24#include <linux/pagemap.h> /* for release_pages and page_cache_release */ 24#include <linux/pagemap.h> /* for release_pages and page_cache_release */
25 25
26#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
27#include <asm/pgtable.h>
27#include <asm/tlb.h> 28#include <asm/tlb.h>
28#include <asm/pdc_chassis.h> 29#include <asm/pdc_chassis.h>
29#include <asm/mmzone.h> 30#include <asm/mmzone.h>
@@ -453,6 +454,8 @@ unsigned long pcxl_dma_start __read_mostly;
453 454
454void __init mem_init(void) 455void __init mem_init(void)
455{ 456{
457 int codesize, reservedpages, datasize, initsize;
458
456 high_memory = __va((max_pfn << PAGE_SHIFT)); 459 high_memory = __va((max_pfn << PAGE_SHIFT));
457 460
458#ifndef CONFIG_DISCONTIGMEM 461#ifndef CONFIG_DISCONTIGMEM
@@ -467,7 +470,32 @@ void __init mem_init(void)
467 } 470 }
468#endif 471#endif
469 472
470 printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10)); 473 codesize = (unsigned long)_etext - (unsigned long)_text;
474 datasize = (unsigned long)_edata - (unsigned long)_etext;
475 initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
476
477 reservedpages = 0;
478{
479 unsigned long pfn;
480#ifdef CONFIG_DISCONTIGMEM
481 int i;
482
483 for (i = 0; i < npmem_ranges; i++) {
484 for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
485 if (PageReserved(pfn_to_page(pfn)))
486 reservedpages++;
487 }
488 }
489#else /* !CONFIG_DISCONTIGMEM */
490 for (pfn = 0; pfn < max_pfn; pfn++) {
491 /*
492 * Only count reserved RAM pages
493 */
494 if (PageReserved(pfn_to_page(pfn)))
495 reservedpages++;
496 }
497#endif
498}
471 499
472#ifdef CONFIG_PA11 500#ifdef CONFIG_PA11
473 if (hppa_dma_ops == &pcxl_dma_ops) { 501 if (hppa_dma_ops == &pcxl_dma_ops) {
@@ -481,6 +509,38 @@ void __init mem_init(void)
481 vmalloc_start = SET_MAP_OFFSET(MAP_START); 509 vmalloc_start = SET_MAP_OFFSET(MAP_START);
482#endif 510#endif
483 511
512 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
513 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
514 num_physpages << (PAGE_SHIFT-10),
515 codesize >> 10,
516 reservedpages << (PAGE_SHIFT-10),
517 datasize >> 10,
518 initsize >> 10
519 );
520
521#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
522 printk("virtual kernel memory layout:\n"
523 " vmalloc : 0x%p - 0x%p (%4ld MB)\n"
524 " memory : 0x%p - 0x%p (%4ld MB)\n"
525 " .init : 0x%p - 0x%p (%4ld kB)\n"
526 " .data : 0x%p - 0x%p (%4ld kB)\n"
527 " .text : 0x%p - 0x%p (%4ld kB)\n",
528
529 (void*)VMALLOC_START, (void*)VMALLOC_END,
530 (VMALLOC_END - VMALLOC_START) >> 20,
531
532 __va(0), high_memory,
533 ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20,
534
535 __init_begin, __init_end,
536 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10,
537
538 _etext, _edata,
539 ((unsigned long)_edata - (unsigned long)_etext) >> 10,
540
541 _text, _etext,
542 ((unsigned long)_etext - (unsigned long)_text) >> 10);
543#endif
484} 544}
485 545
486unsigned long *empty_zero_page __read_mostly; 546unsigned long *empty_zero_page __read_mostly;
@@ -548,7 +608,7 @@ void show_mem(void)
548 608
549 printk("Zone list for zone %d on node %d: ", j, i); 609 printk("Zone list for zone %d on node %d: ", j, i);
550 for (k = 0; zl->zones[k] != NULL; k++) 610 for (k = 0; zl->zones[k] != NULL; k++)
551 printk("[%d/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); 611 printk("[%ld/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name);
552 printk("\n"); 612 printk("\n");
553 } 613 }
554 } 614 }
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index 44b42c7f639d..92d496ad07c9 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -26,7 +26,7 @@
26 */ 26 */
27void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) 27void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
28{ 28{
29 void *addr; 29 void __iomem *addr;
30 struct vm_struct *area; 30 struct vm_struct *area;
31 unsigned long offset, last_addr; 31 unsigned long offset, last_addr;
32 pgprot_t pgprot; 32 pgprot_t pgprot;
@@ -80,14 +80,14 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
80 if (!area) 80 if (!area)
81 return NULL; 81 return NULL;
82 82
83 addr = area->addr; 83 addr = (void __iomem *) area->addr;
84 if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, 84 if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
85 phys_addr, pgprot)) { 85 phys_addr, pgprot)) {
86 vfree(addr); 86 vfree(addr);
87 return NULL; 87 return NULL;
88 } 88 }
89 89
90 return (void __iomem *) (offset + (char *)addr); 90 return (void __iomem *) (offset + (char __iomem *)addr);
91} 91}
92EXPORT_SYMBOL(__ioremap); 92EXPORT_SYMBOL(__ioremap);
93 93
diff --git a/arch/parisc/mm/kmap.c b/arch/parisc/mm/kmap.c
deleted file mode 100644
index 1b1acd5e2f6e..000000000000
--- a/arch/parisc/mm/kmap.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * kmap/page table map and unmap support routines
3 *
4 * Copyright 1999,2000 Hewlett-Packard Company
5 * Copyright 2000 John Marvin <jsm at hp.com>
6 * Copyright 2000 Grant Grundler <grundler at parisc-linux.org>
7 * Copyright 2000 Philipp Rumpf <prumpf@tux.org>
8 *
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24/*
25** Stolen mostly from arch/parisc/kernel/pci-dma.c
26*/
27
28#include <linux/types.h>
29#include <linux/mm.h>
30#include <linux/string.h>
31#include <linux/pci.h>
32
33#include <linux/slab.h>
34#include <linux/vmalloc.h>
35
36#include <asm/uaccess.h>
37#include <asm/pgalloc.h>
38
39#include <asm/io.h>
40#include <asm/page.h> /* get_order */
41
42#undef flush_cache_all
43#define flush_cache_all flush_all_caches
44
45typedef void (*pte_iterator_t) (pte_t * pte, unsigned long arg);
46
47#if 0
48/* XXX This routine could be used with iterate_page() to replace
49 * unmap_uncached_page() and save a little code space but I didn't
50 * do that since I'm not certain whether this is the right path. -PB
51 */
52static void unmap_cached_pte(pte_t * pte, unsigned long addr, unsigned long arg)
53{
54 pte_t page = *pte;
55 pte_clear(&init_mm, addr, pte);
56 if (!pte_none(page)) {
57 if (pte_present(page)) {
58 unsigned long map_nr = pte_pagenr(page);
59 if (map_nr < max_mapnr)
60 __free_page(mem_map + map_nr);
61 } else {
62 printk(KERN_CRIT
63 "Whee.. Swapped out page in kernel page table\n");
64 }
65 }
66}
67#endif
68
69/* These two routines should probably check a few things... */
70static void set_uncached(pte_t * pte, unsigned long arg)
71{
72 pte_val(*pte) |= _PAGE_NO_CACHE;
73}
74
75static void set_cached(pte_t * pte, unsigned long arg)
76{
77 pte_val(*pte) &= ~_PAGE_NO_CACHE;
78}
79
80static inline void iterate_pte(pmd_t * pmd, unsigned long address,
81 unsigned long size, pte_iterator_t op,
82 unsigned long arg)
83{
84 pte_t *pte;
85 unsigned long end;
86
87 if (pmd_none(*pmd))
88 return;
89 if (pmd_bad(*pmd)) {
90 pmd_ERROR(*pmd);
91 pmd_clear(pmd);
92 return;
93 }
94 pte = pte_offset(pmd, address);
95 address &= ~PMD_MASK;
96 end = address + size;
97 if (end > PMD_SIZE)
98 end = PMD_SIZE;
99 do {
100 op(pte, arg);
101 address += PAGE_SIZE;
102 pte++;
103 } while (address < end);
104}
105
106static inline void iterate_pmd(pgd_t * dir, unsigned long address,
107 unsigned long size, pte_iterator_t op,
108 unsigned long arg)
109{
110 pmd_t *pmd;
111 unsigned long end;
112
113 if (pgd_none(*dir))
114 return;
115 if (pgd_bad(*dir)) {
116 pgd_ERROR(*dir);
117 pgd_clear(dir);
118 return;
119 }
120 pmd = pmd_offset(dir, address);
121 address &= ~PGDIR_MASK;
122 end = address + size;
123 if (end > PGDIR_SIZE)
124 end = PGDIR_SIZE;
125 do {
126 iterate_pte(pmd, address, end - address, op, arg);
127 address = (address + PMD_SIZE) & PMD_MASK;
128 pmd++;
129 } while (address < end);
130}
131
132static void iterate_pages(unsigned long address, unsigned long size,
133 pte_iterator_t op, unsigned long arg)
134{
135 pgd_t *dir;
136 unsigned long end = address + size;
137
138 dir = pgd_offset_k(address);
139 flush_cache_all();
140 do {
141 iterate_pmd(dir, address, end - address, op, arg);
142 address = (address + PGDIR_SIZE) & PGDIR_MASK;
143 dir++;
144 } while (address && (address < end));
145 flush_tlb_all();
146}
147
148void
149kernel_set_cachemode(unsigned long vaddr, unsigned long size, int what)
150{
151 switch (what) {
152 case IOMAP_FULL_CACHING:
153 iterate_pages(vaddr, size, set_cached, 0);
154 flush_tlb_range(NULL, vaddr, size);
155 break;
156 case IOMAP_NOCACHE_SER:
157 iterate_pages(vaddr, size, set_uncached, 0);
158 flush_tlb_range(NULL, vaddr, size);
159 break;
160 default:
161 printk(KERN_CRIT
162 "kernel_set_cachemode mode %d not understood\n",
163 what);
164 break;
165 }
166}
diff --git a/arch/parisc/oprofile/init.c b/arch/parisc/oprofile/init.c
index a5b898c4d0b0..113f5139f551 100644
--- a/arch/parisc/oprofile/init.c
+++ b/arch/parisc/oprofile/init.c
@@ -18,6 +18,6 @@ int __init oprofile_arch_init(struct oprofile_operations * ops)
18} 18}
19 19
20 20
21void oprofile_arch_exit() 21void oprofile_arch_exit(void)
22{ 22{
23} 23}