aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c3
-rw-r--r--arch/alpha/kernel/entry.S10
-rw-r--r--arch/alpha/kernel/osf_sys.c34
-rw-r--r--arch/alpha/kernel/proto.h15
-rw-r--r--arch/alpha/kernel/srmcons.c2
-rw-r--r--arch/alpha/kernel/time.c15
-rw-r--r--arch/alpha/mm/Makefile2
-rw-r--r--arch/alpha/mm/remap.c86
8 files changed, 44 insertions, 123 deletions
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index f042cc42b00f..dbe327d32b6f 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -36,7 +36,6 @@
36#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
37#include <asm/vga.h> 37#include <asm/vga.h>
38 38
39#define __KERNEL_SYSCALLS__
40#include <asm/unistd.h> 39#include <asm/unistd.h>
41 40
42extern struct hwrpb_struct *hwrpb; 41extern struct hwrpb_struct *hwrpb;
@@ -116,7 +115,7 @@ EXPORT_SYMBOL(sys_dup);
116EXPORT_SYMBOL(sys_exit); 115EXPORT_SYMBOL(sys_exit);
117EXPORT_SYMBOL(sys_write); 116EXPORT_SYMBOL(sys_write);
118EXPORT_SYMBOL(sys_lseek); 117EXPORT_SYMBOL(sys_lseek);
119EXPORT_SYMBOL(execve); 118EXPORT_SYMBOL(kernel_execve);
120EXPORT_SYMBOL(sys_setsid); 119EXPORT_SYMBOL(sys_setsid);
121EXPORT_SYMBOL(sys_wait4); 120EXPORT_SYMBOL(sys_wait4);
122 121
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index 01ecd09d4a64..c95e95e1ab04 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -655,12 +655,12 @@ kernel_thread:
655.end kernel_thread 655.end kernel_thread
656 656
657/* 657/*
658 * execve(path, argv, envp) 658 * kernel_execve(path, argv, envp)
659 */ 659 */
660 .align 4 660 .align 4
661 .globl execve 661 .globl kernel_execve
662 .ent execve 662 .ent kernel_execve
663execve: 663kernel_execve:
664 /* We can be called from a module. */ 664 /* We can be called from a module. */
665 ldgp $gp, 0($27) 665 ldgp $gp, 0($27)
666 lda $sp, -(32+SIZEOF_PT_REGS+8)($sp) 666 lda $sp, -(32+SIZEOF_PT_REGS+8)($sp)
@@ -704,7 +704,7 @@ execve:
704 704
7051: lda $sp, 32+SIZEOF_PT_REGS+8($sp) 7051: lda $sp, 32+SIZEOF_PT_REGS+8($sp)
706 ret 706 ret
707.end execve 707.end kernel_execve
708 708
709 709
710/* 710/*
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 73c7622b5297..ad6173651995 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -111,22 +111,26 @@ struct osf_dirent_callback {
111 111
112static int 112static int
113osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, 113osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
114 ino_t ino, unsigned int d_type) 114 u64 ino, unsigned int d_type)
115{ 115{
116 struct osf_dirent __user *dirent; 116 struct osf_dirent __user *dirent;
117 struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; 117 struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
118 unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1); 118 unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1);
119 unsigned int d_ino;
119 120
120 buf->error = -EINVAL; /* only used if we fail */ 121 buf->error = -EINVAL; /* only used if we fail */
121 if (reclen > buf->count) 122 if (reclen > buf->count)
122 return -EINVAL; 123 return -EINVAL;
124 d_ino = ino;
125 if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
126 return -EOVERFLOW;
123 if (buf->basep) { 127 if (buf->basep) {
124 if (put_user(offset, buf->basep)) 128 if (put_user(offset, buf->basep))
125 return -EFAULT; 129 return -EFAULT;
126 buf->basep = NULL; 130 buf->basep = NULL;
127 } 131 }
128 dirent = buf->dirent; 132 dirent = buf->dirent;
129 put_user(ino, &dirent->d_ino); 133 put_user(d_ino, &dirent->d_ino);
130 put_user(namlen, &dirent->d_namlen); 134 put_user(namlen, &dirent->d_namlen);
131 put_user(reclen, &dirent->d_reclen); 135 put_user(reclen, &dirent->d_reclen);
132 if (copy_to_user(dirent->d_name, name, namlen) || 136 if (copy_to_user(dirent->d_name, name, namlen) ||
@@ -402,15 +406,15 @@ osf_utsname(char __user *name)
402 406
403 down_read(&uts_sem); 407 down_read(&uts_sem);
404 error = -EFAULT; 408 error = -EFAULT;
405 if (copy_to_user(name + 0, system_utsname.sysname, 32)) 409 if (copy_to_user(name + 0, utsname()->sysname, 32))
406 goto out; 410 goto out;
407 if (copy_to_user(name + 32, system_utsname.nodename, 32)) 411 if (copy_to_user(name + 32, utsname()->nodename, 32))
408 goto out; 412 goto out;
409 if (copy_to_user(name + 64, system_utsname.release, 32)) 413 if (copy_to_user(name + 64, utsname()->release, 32))
410 goto out; 414 goto out;
411 if (copy_to_user(name + 96, system_utsname.version, 32)) 415 if (copy_to_user(name + 96, utsname()->version, 32))
412 goto out; 416 goto out;
413 if (copy_to_user(name + 128, system_utsname.machine, 32)) 417 if (copy_to_user(name + 128, utsname()->machine, 32))
414 goto out; 418 goto out;
415 419
416 error = 0; 420 error = 0;
@@ -449,8 +453,8 @@ osf_getdomainname(char __user *name, int namelen)
449 453
450 down_read(&uts_sem); 454 down_read(&uts_sem);
451 for (i = 0; i < len; ++i) { 455 for (i = 0; i < len; ++i) {
452 __put_user(system_utsname.domainname[i], name + i); 456 __put_user(utsname()->domainname[i], name + i);
453 if (system_utsname.domainname[i] == '\0') 457 if (utsname()->domainname[i] == '\0')
454 break; 458 break;
455 } 459 }
456 up_read(&uts_sem); 460 up_read(&uts_sem);
@@ -607,12 +611,12 @@ osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
607asmlinkage long 611asmlinkage long
608osf_sysinfo(int command, char __user *buf, long count) 612osf_sysinfo(int command, char __user *buf, long count)
609{ 613{
610 static char * sysinfo_table[] = { 614 char *sysinfo_table[] = {
611 system_utsname.sysname, 615 utsname()->sysname,
612 system_utsname.nodename, 616 utsname()->nodename,
613 system_utsname.release, 617 utsname()->release,
614 system_utsname.version, 618 utsname()->version,
615 system_utsname.machine, 619 utsname()->machine,
616 "alpha", /* instruction set architecture */ 620 "alpha", /* instruction set architecture */
617 "dummy", /* hardware serial number */ 621 "dummy", /* hardware serial number */
618 "dummy", /* hardware manufacturer */ 622 "dummy", /* hardware manufacturer */
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h
index 2a6e3da8144f..21f71287b6f5 100644
--- a/arch/alpha/kernel/proto.h
+++ b/arch/alpha/kernel/proto.h
@@ -1,5 +1,7 @@
1#include <linux/interrupt.h> 1#include <linux/interrupt.h>
2#include <linux/io.h>
2 3
4#include <asm/pgtable.h>
3 5
4/* Prototypes of functions used across modules here in this directory. */ 6/* Prototypes of functions used across modules here in this directory. */
5 7
@@ -181,9 +183,16 @@ extern void titan_dispatch_irqs(u64, struct pt_regs *);
181extern void switch_to_system_map(void); 183extern void switch_to_system_map(void);
182extern void srm_paging_stop(void); 184extern void srm_paging_stop(void);
183 185
184/* ../mm/remap.c */ 186static inline int
185extern int __alpha_remap_area_pages(unsigned long, unsigned long, 187__alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
186 unsigned long, unsigned long); 188 unsigned long size, unsigned long flags)
189{
190 pgprot_t prot;
191
192 prot = __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE
193 | _PAGE_KWE | flags);
194 return ioremap_page_range(address, address + size, phys_addr, prot);
195}
187 196
188/* irq.c */ 197/* irq.c */
189 198
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 9d7dff27f815..756923203860 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -229,7 +229,7 @@ srmcons_close(struct tty_struct *tty, struct file *filp)
229 229
230static struct tty_driver *srmcons_driver; 230static struct tty_driver *srmcons_driver;
231 231
232static struct tty_operations srmcons_ops = { 232static const struct tty_operations srmcons_ops = {
233 .open = srmcons_open, 233 .open = srmcons_open,
234 .close = srmcons_close, 234 .close = srmcons_close,
235 .write = srmcons_write, 235 .write = srmcons_write,
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 7c1e44420a78..581ddcc22fc5 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -54,8 +54,6 @@
54#include "proto.h" 54#include "proto.h"
55#include "irq_impl.h" 55#include "irq_impl.h"
56 56
57extern unsigned long wall_jiffies; /* kernel/timer.c */
58
59static int set_rtc_mmss(unsigned long); 57static int set_rtc_mmss(unsigned long);
60 58
61DEFINE_SPINLOCK(rtc_lock); 59DEFINE_SPINLOCK(rtc_lock);
@@ -413,7 +411,7 @@ void
413do_gettimeofday(struct timeval *tv) 411do_gettimeofday(struct timeval *tv)
414{ 412{
415 unsigned long flags; 413 unsigned long flags;
416 unsigned long sec, usec, lost, seq; 414 unsigned long sec, usec, seq;
417 unsigned long delta_cycles, delta_usec, partial_tick; 415 unsigned long delta_cycles, delta_usec, partial_tick;
418 416
419 do { 417 do {
@@ -423,14 +421,13 @@ do_gettimeofday(struct timeval *tv)
423 sec = xtime.tv_sec; 421 sec = xtime.tv_sec;
424 usec = (xtime.tv_nsec / 1000); 422 usec = (xtime.tv_nsec / 1000);
425 partial_tick = state.partial_tick; 423 partial_tick = state.partial_tick;
426 lost = jiffies - wall_jiffies;
427 424
428 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 425 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
429 426
430#ifdef CONFIG_SMP 427#ifdef CONFIG_SMP
431 /* Until and unless we figure out how to get cpu cycle counters 428 /* Until and unless we figure out how to get cpu cycle counters
432 in sync and keep them there, we can't use the rpcc tricks. */ 429 in sync and keep them there, we can't use the rpcc tricks. */
433 delta_usec = lost * (1000000 / HZ); 430 delta_usec = 0;
434#else 431#else
435 /* 432 /*
436 * usec = cycles * ticks_per_cycle * 2**48 * 1e6 / (2**48 * ticks) 433 * usec = cycles * ticks_per_cycle * 2**48 * 1e6 / (2**48 * ticks)
@@ -446,8 +443,7 @@ do_gettimeofday(struct timeval *tv)
446 */ 443 */
447 444
448 delta_usec = (delta_cycles * state.scaled_ticks_per_cycle 445 delta_usec = (delta_cycles * state.scaled_ticks_per_cycle
449 + partial_tick 446 + partial_tick) * 15625;
450 + (lost << FIX_SHIFT)) * 15625;
451 delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2; 447 delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
452#endif 448#endif
453 449
@@ -480,12 +476,11 @@ do_settimeofday(struct timespec *tv)
480 time. Without this, a full-tick error is possible. */ 476 time. Without this, a full-tick error is possible. */
481 477
482#ifdef CONFIG_SMP 478#ifdef CONFIG_SMP
483 delta_nsec = (jiffies - wall_jiffies) * (NSEC_PER_SEC / HZ); 479 delta_nsec = 0;
484#else 480#else
485 delta_nsec = rpcc() - state.last_time; 481 delta_nsec = rpcc() - state.last_time;
486 delta_nsec = (delta_nsec * state.scaled_ticks_per_cycle 482 delta_nsec = (delta_nsec * state.scaled_ticks_per_cycle
487 + state.partial_tick 483 + state.partial_tick) * 15625;
488 + ((jiffies - wall_jiffies) << FIX_SHIFT)) * 15625;
489 delta_nsec = ((delta_nsec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2; 484 delta_nsec = ((delta_nsec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
490 delta_nsec *= 1000; 485 delta_nsec *= 1000;
491#endif 486#endif
diff --git a/arch/alpha/mm/Makefile b/arch/alpha/mm/Makefile
index 6edd9a09ea4f..09399c5386cb 100644
--- a/arch/alpha/mm/Makefile
+++ b/arch/alpha/mm/Makefile
@@ -4,6 +4,6 @@
4 4
5EXTRA_CFLAGS := -Werror 5EXTRA_CFLAGS := -Werror
6 6
7obj-y := init.o fault.o extable.o remap.o 7obj-y := init.o fault.o extable.o
8 8
9obj-$(CONFIG_DISCONTIGMEM) += numa.o 9obj-$(CONFIG_DISCONTIGMEM) += numa.o
diff --git a/arch/alpha/mm/remap.c b/arch/alpha/mm/remap.c
deleted file mode 100644
index a78356c3ead5..000000000000
--- a/arch/alpha/mm/remap.c
+++ /dev/null
@@ -1,86 +0,0 @@
1#include <linux/vmalloc.h>
2#include <asm/pgalloc.h>
3#include <asm/cacheflush.h>
4
5static inline void
6remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
7 unsigned long phys_addr, unsigned long flags)
8{
9 unsigned long end;
10 unsigned long pfn;
11
12 address &= ~PMD_MASK;
13 end = address + size;
14 if (end > PMD_SIZE)
15 end = PMD_SIZE;
16 if (address >= end)
17 BUG();
18 pfn = phys_addr >> PAGE_SHIFT;
19 do {
20 if (!pte_none(*pte)) {
21 printk("remap_area_pte: page already exists\n");
22 BUG();
23 }
24 set_pte(pte, pfn_pte(pfn,
25 __pgprot(_PAGE_VALID | _PAGE_ASM |
26 _PAGE_KRE | _PAGE_KWE | flags)));
27 address += PAGE_SIZE;
28 pfn++;
29 pte++;
30 } while (address && (address < end));
31}
32
33static inline int
34remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
35 unsigned long phys_addr, unsigned long flags)
36{
37 unsigned long end;
38
39 address &= ~PGDIR_MASK;
40 end = address + size;
41 if (end > PGDIR_SIZE)
42 end = PGDIR_SIZE;
43 phys_addr -= address;
44 if (address >= end)
45 BUG();
46 do {
47 pte_t * pte = pte_alloc_kernel(pmd, address);
48 if (!pte)
49 return -ENOMEM;
50 remap_area_pte(pte, address, end - address,
51 address + phys_addr, flags);
52 address = (address + PMD_SIZE) & PMD_MASK;
53 pmd++;
54 } while (address && (address < end));
55 return 0;
56}
57
58int
59__alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
60 unsigned long size, unsigned long flags)
61{
62 pgd_t * dir;
63 int error = 0;
64 unsigned long end = address + size;
65
66 phys_addr -= address;
67 dir = pgd_offset(&init_mm, address);
68 flush_cache_all();
69 if (address >= end)
70 BUG();
71 do {
72 pmd_t *pmd;
73 pmd = pmd_alloc(&init_mm, dir, address);
74 error = -ENOMEM;
75 if (!pmd)
76 break;
77 if (remap_area_pmd(pmd, address, end - address,
78 phys_addr + address, flags))
79 break;
80 error = 0;
81 address = (address + PGDIR_SIZE) & PGDIR_MASK;
82 dir++;
83 } while (address && (address < end));
84 return error;
85}
86