aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/Makefile10
-rw-r--r--arch/mips/kernel/binfmt_elfn32.c2
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c2
-rw-r--r--arch/mips/kernel/cpu-bugs64.c4
-rw-r--r--arch/mips/kernel/cpu-probe.c6
-rw-r--r--arch/mips/kernel/gdb-low.S4
-rw-r--r--arch/mips/kernel/gdb-stub.c12
-rw-r--r--arch/mips/kernel/genex.S14
-rw-r--r--arch/mips/kernel/head.S6
-rw-r--r--arch/mips/kernel/ioctl32.c2
-rw-r--r--arch/mips/kernel/irq.c2
-rw-r--r--arch/mips/kernel/linux32.c22
-rw-r--r--arch/mips/kernel/mips_ksyms.c2
-rw-r--r--arch/mips/kernel/process.c8
-rw-r--r--arch/mips/kernel/ptrace.c12
-rw-r--r--arch/mips/kernel/r2300_switch.S4
-rw-r--r--arch/mips/kernel/r4k_fpu.S4
-rw-r--r--arch/mips/kernel/r4k_switch.S8
-rw-r--r--arch/mips/kernel/setup.c4
-rw-r--r--arch/mips/kernel/signal32.c2
-rw-r--r--arch/mips/kernel/traps.c2
-rw-r--r--arch/mips/kernel/unaligned.c12
-rw-r--r--arch/mips/kernel/vmlinux.lds.S2
23 files changed, 70 insertions, 76 deletions
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index a0230ee0f7f4..d3303584fbd1 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -13,8 +13,8 @@ binfmt_irix-objs := irixelf.o irixinv.o irixioctl.o irixsig.o \
13 13
14ifdef CONFIG_MODULES 14ifdef CONFIG_MODULES
15obj-y += mips_ksyms.o module.o 15obj-y += mips_ksyms.o module.o
16obj-$(CONFIG_MIPS32) += module-elf32.o 16obj-$(CONFIG_32BIT) += module-elf32.o
17obj-$(CONFIG_MIPS64) += module-elf64.o 17obj-$(CONFIG_64BIT) += module-elf64.o
18endif 18endif
19 19
20obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o 20obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o
@@ -45,8 +45,8 @@ obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o
45obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o 45obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o
46obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o 46obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o
47 47
48obj-$(CONFIG_MIPS32) += scall32-o32.o 48obj-$(CONFIG_32BIT) += scall32-o32.o
49obj-$(CONFIG_MIPS64) += scall64-64.o 49obj-$(CONFIG_64BIT) += scall64-64.o
50obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o 50obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o
51obj-$(CONFIG_MIPS32_COMPAT) += ioctl32.o linux32.o signal32.o 51obj-$(CONFIG_MIPS32_COMPAT) += ioctl32.o linux32.o signal32.o
52obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o 52obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o
@@ -55,7 +55,7 @@ obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o ptrace32.o
55obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o 55obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o
56obj-$(CONFIG_PROC_FS) += proc.o 56obj-$(CONFIG_PROC_FS) += proc.o
57 57
58obj-$(CONFIG_MIPS64) += cpu-bugs64.o 58obj-$(CONFIG_64BIT) += cpu-bugs64.o
59 59
60obj-$(CONFIG_GEN_RTC) += genrtc.o 60obj-$(CONFIG_GEN_RTC) += genrtc.o
61 61
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
index ed47041f3030..6b645fbb1ddc 100644
--- a/arch/mips/kernel/binfmt_elfn32.c
+++ b/arch/mips/kernel/binfmt_elfn32.c
@@ -103,7 +103,7 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
103 * Convert jiffies to nanoseconds and seperate with 103 * Convert jiffies to nanoseconds and seperate with
104 * one divide. 104 * one divide.
105 */ 105 */
106 u64 nsec = (u64)jiffies * TICK_NSEC; 106 u64 nsec = (u64)jiffies * TICK_NSEC;
107 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); 107 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec);
108 value->tv_usec /= NSEC_PER_USEC; 108 value->tv_usec /= NSEC_PER_USEC;
109} 109}
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index ee21b18c37a8..b4075e99c452 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -105,7 +105,7 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
105 * Convert jiffies to nanoseconds and seperate with 105 * Convert jiffies to nanoseconds and seperate with
106 * one divide. 106 * one divide.
107 */ 107 */
108 u64 nsec = (u64)jiffies * TICK_NSEC; 108 u64 nsec = (u64)jiffies * TICK_NSEC;
109 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); 109 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec);
110 value->tv_usec /= NSEC_PER_USEC; 110 value->tv_usec /= NSEC_PER_USEC;
111} 111}
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 11ebe5d4c446..47a087b6c11b 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -137,7 +137,7 @@ static inline void check_mult_sh(void)
137 for (i = 0; i < 8; i++) 137 for (i = 0; i < 8; i++)
138 if (v1[i] != w[i]) 138 if (v1[i] != w[i])
139 bug = 1; 139 bug = 1;
140 140
141 if (bug == 0) { 141 if (bug == 0) {
142 printk("no.\n"); 142 printk("no.\n");
143 return; 143 return;
@@ -149,7 +149,7 @@ static inline void check_mult_sh(void)
149 for (i = 0; i < 8; i++) 149 for (i = 0; i < 8; i++)
150 if (v2[i] != w[i]) 150 if (v2[i] != w[i])
151 fix = 0; 151 fix = 0;
152 152
153 if (fix == 1) { 153 if (fix == 1) {
154 printk("yes.\n"); 154 printk("yes.\n");
155 return; 155 return;
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 4bb849582314..7685f8baf3f0 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -229,15 +229,9 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
229 break; 229 break;
230 case PRID_IMP_VR41XX: 230 case PRID_IMP_VR41XX:
231 switch (c->processor_id & 0xf0) { 231 switch (c->processor_id & 0xf0) {
232#ifndef CONFIG_VR4181
233 case PRID_REV_VR4111: 232 case PRID_REV_VR4111:
234 c->cputype = CPU_VR4111; 233 c->cputype = CPU_VR4111;
235 break; 234 break;
236#else
237 case PRID_REV_VR4181:
238 c->cputype = CPU_VR4181;
239 break;
240#endif
241 case PRID_REV_VR4121: 235 case PRID_REV_VR4121:
242 c->cputype = CPU_VR4121; 236 c->cputype = CPU_VR4121;
243 break; 237 break;
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index ece6ddaf7011..512bedbfa7b9 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -13,13 +13,13 @@
13#include <asm/stackframe.h> 13#include <asm/stackframe.h>
14#include <asm/gdb-stub.h> 14#include <asm/gdb-stub.h>
15 15
16#ifdef CONFIG_MIPS32 16#ifdef CONFIG_32BIT
17#define DMFC0 mfc0 17#define DMFC0 mfc0
18#define DMTC0 mtc0 18#define DMTC0 mtc0
19#define LDC1 lwc1 19#define LDC1 lwc1
20#define SDC1 lwc1 20#define SDC1 lwc1
21#endif 21#endif
22#ifdef CONFIG_MIPS64 22#ifdef CONFIG_64BIT
23#define DMFC0 dmfc0 23#define DMFC0 dmfc0
24#define DMTC0 dmtc0 24#define DMTC0 dmtc0
25#define LDC1 ldc1 25#define LDC1 ldc1
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
index 269889302a27..d3fd1ab14274 100644
--- a/arch/mips/kernel/gdb-stub.c
+++ b/arch/mips/kernel/gdb-stub.c
@@ -687,8 +687,8 @@ void handle_exception (struct gdb_regs *regs)
687 * acquire the big kgdb spinlock 687 * acquire the big kgdb spinlock
688 */ 688 */
689 if (!spin_trylock(&kgdb_lock)) { 689 if (!spin_trylock(&kgdb_lock)) {
690 /* 690 /*
691 * some other CPU has the lock, we should go back to 691 * some other CPU has the lock, we should go back to
692 * receive the gdb_wait IPC 692 * receive the gdb_wait IPC
693 */ 693 */
694 return; 694 return;
@@ -703,7 +703,7 @@ void handle_exception (struct gdb_regs *regs)
703 async_bp.addr = 0; 703 async_bp.addr = 0;
704 } 704 }
705 705
706 /* 706 /*
707 * acquire the CPU spinlocks 707 * acquire the CPU spinlocks
708 */ 708 */
709 for (i = num_online_cpus()-1; i >= 0; i--) 709 for (i = num_online_cpus()-1; i >= 0; i--)
@@ -894,7 +894,7 @@ void handle_exception (struct gdb_regs *regs)
894 ptr = &input_buffer[1]; 894 ptr = &input_buffer[1];
895 if (hexToLong(&ptr, &addr)) 895 if (hexToLong(&ptr, &addr))
896 regs->cp0_epc = addr; 896 regs->cp0_epc = addr;
897 897
898 goto exit_kgdb_exception; 898 goto exit_kgdb_exception;
899 break; 899 break;
900 900
@@ -1001,7 +1001,7 @@ void breakpoint(void)
1001 return; 1001 return;
1002 1002
1003 __asm__ __volatile__( 1003 __asm__ __volatile__(
1004 ".globl breakinst\n\t" 1004 ".globl breakinst\n\t"
1005 ".set\tnoreorder\n\t" 1005 ".set\tnoreorder\n\t"
1006 "nop\n" 1006 "nop\n"
1007 "breakinst:\tbreak\n\t" 1007 "breakinst:\tbreak\n\t"
@@ -1014,7 +1014,7 @@ void breakpoint(void)
1014void async_breakpoint(void) 1014void async_breakpoint(void)
1015{ 1015{
1016 __asm__ __volatile__( 1016 __asm__ __volatile__(
1017 ".globl async_breakinst\n\t" 1017 ".globl async_breakinst\n\t"
1018 ".set\tnoreorder\n\t" 1018 ".set\tnoreorder\n\t"
1019 "nop\n" 1019 "nop\n"
1020 "async_breakinst:\tbreak\n\t" 1020 "async_breakinst:\tbreak\n\t"
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index a5b0a389b063..e7f6c1b90806 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -54,7 +54,7 @@ NESTED(except_vec3_generic, 0, sp)
54#endif 54#endif
55 mfc0 k1, CP0_CAUSE 55 mfc0 k1, CP0_CAUSE
56 andi k1, k1, 0x7c 56 andi k1, k1, 0x7c
57#ifdef CONFIG_MIPS64 57#ifdef CONFIG_64BIT
58 dsll k1, k1, 1 58 dsll k1, k1, 1
59#endif 59#endif
60 PTR_L k0, exception_handlers(k1) 60 PTR_L k0, exception_handlers(k1)
@@ -81,7 +81,7 @@ NESTED(except_vec3_r4000, 0, sp)
81 beq k1, k0, handle_vced 81 beq k1, k0, handle_vced
82 li k0, 14<<2 82 li k0, 14<<2
83 beq k1, k0, handle_vcei 83 beq k1, k0, handle_vcei
84#ifdef CONFIG_MIPS64 84#ifdef CONFIG_64BIT
85 dsll k1, k1, 1 85 dsll k1, k1, 1
86#endif 86#endif
87 .set pop 87 .set pop
@@ -244,12 +244,12 @@ NESTED(nmi_handler, PT_SIZE, sp)
244 start with an n and gas will believe \n is ok ... */ 244 start with an n and gas will believe \n is ok ... */
245 .macro __BUILD_verbose nexception 245 .macro __BUILD_verbose nexception
246 LONG_L a1, PT_EPC(sp) 246 LONG_L a1, PT_EPC(sp)
247#if CONFIG_MIPS32 247#ifdef CONFIG_32BIT
248 PRINT("Got \nexception at %08lx\012") 248 PRINT("Got \nexception at %08lx\012")
249#endif 249#endif
250#if CONFIG_MIPS64 250#ifdef CONFIG_64BIT
251 PRINT("Got \nexception at %016lx\012") 251 PRINT("Got \nexception at %016lx\012")
252#endif 252#endif
253 .endm 253 .endm
254 254
255 .macro __BUILD_count exception 255 .macro __BUILD_count exception
@@ -293,7 +293,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
293 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */ 293 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */
294 BUILD_HANDLER reserved reserved sti verbose /* others */ 294 BUILD_HANDLER reserved reserved sti verbose /* others */
295 295
296#ifdef CONFIG_MIPS64 296#ifdef CONFIG_64BIT
297/* A temporary overflow handler used by check_daddi(). */ 297/* A temporary overflow handler used by check_daddi(). */
298 298
299 __INIT 299 __INIT
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index a64e87d22014..2a1b45d66f04 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -107,7 +107,7 @@
107 .endm 107 .endm
108 108
109 .macro setup_c0_status_pri 109 .macro setup_c0_status_pri
110#ifdef CONFIG_MIPS64 110#ifdef CONFIG_64BIT
111 setup_c0_status ST0_KX 0 111 setup_c0_status ST0_KX 0
112#else 112#else
113 setup_c0_status 0 0 113 setup_c0_status 0 0
@@ -115,7 +115,7 @@
115 .endm 115 .endm
116 116
117 .macro setup_c0_status_sec 117 .macro setup_c0_status_sec
118#ifdef CONFIG_MIPS64 118#ifdef CONFIG_64BIT
119 setup_c0_status ST0_KX ST0_BEV 119 setup_c0_status ST0_KX ST0_BEV
120#else 120#else
121 setup_c0_status 0 ST0_BEV 121 setup_c0_status 0 ST0_BEV
@@ -215,7 +215,7 @@ NESTED(smp_bootstrap, 16, sp)
215 * slightly different layout ... 215 * slightly different layout ...
216 */ 216 */
217 page swapper_pg_dir, _PGD_ORDER 217 page swapper_pg_dir, _PGD_ORDER
218#ifdef CONFIG_MIPS64 218#ifdef CONFIG_64BIT
219 page invalid_pmd_table, _PMD_ORDER 219 page invalid_pmd_table, _PMD_ORDER
220#endif 220#endif
221 page invalid_pte_table, _PTE_ORDER 221 page invalid_pte_table, _PTE_ORDER
diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
index 519cd5d0aebb..c069719ff0d8 100644
--- a/arch/mips/kernel/ioctl32.c
+++ b/arch/mips/kernel/ioctl32.c
@@ -27,7 +27,7 @@ long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
27#include "compat_ioctl.c" 27#include "compat_ioctl.c"
28 28
29typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *); 29typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
30 30
31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
32#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 32#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL },
33#define IOCTL_TABLE_START \ 33#define IOCTL_TABLE_START \
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 441157a1f994..7d93992e462c 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -77,7 +77,7 @@ int show_interrupts(struct seq_file *p, void *v)
77 if (i < NR_IRQS) { 77 if (i < NR_IRQS) {
78 spin_lock_irqsave(&irq_desc[i].lock, flags); 78 spin_lock_irqsave(&irq_desc[i].lock, flags);
79 action = irq_desc[i].action; 79 action = irq_desc[i].action;
80 if (!action) 80 if (!action)
81 goto skip; 81 goto skip;
82 seq_printf(p, "%3d: ",i); 82 seq_printf(p, "%3d: ",i);
83#ifndef CONFIG_SMP 83#ifndef CONFIG_SMP
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 993abc868e54..4613219dd73e 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -313,7 +313,7 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
313 struct sysinfo s; 313 struct sysinfo s;
314 int ret, err; 314 int ret, err;
315 mm_segment_t old_fs = get_fs (); 315 mm_segment_t old_fs = get_fs ();
316 316
317 set_fs (KERNEL_DS); 317 set_fs (KERNEL_DS);
318 ret = sys_sysinfo(&s); 318 ret = sys_sysinfo(&s);
319 set_fs (old_fs); 319 set_fs (old_fs);
@@ -560,7 +560,7 @@ struct ipc64_perm32 {
560 compat_gid_t gid; 560 compat_gid_t gid;
561 compat_uid_t cuid; 561 compat_uid_t cuid;
562 compat_gid_t cgid; 562 compat_gid_t cgid;
563 compat_mode_t mode; 563 compat_mode_t mode;
564 unsigned short seq; 564 unsigned short seq;
565 unsigned short __pad1; 565 unsigned short __pad1;
566 unsigned int __unused1; 566 unsigned int __unused1;
@@ -1334,17 +1334,17 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset,
1334 mm_segment_t old_fs = get_fs(); 1334 mm_segment_t old_fs = get_fs();
1335 int ret; 1335 int ret;
1336 off_t of; 1336 off_t of;
1337 1337
1338 if (offset && get_user(of, offset)) 1338 if (offset && get_user(of, offset))
1339 return -EFAULT; 1339 return -EFAULT;
1340 1340
1341 set_fs(KERNEL_DS); 1341 set_fs(KERNEL_DS);
1342 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); 1342 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
1343 set_fs(old_fs); 1343 set_fs(old_fs);
1344 1344
1345 if (offset && put_user(of, offset)) 1345 if (offset && put_user(of, offset))
1346 return -EFAULT; 1346 return -EFAULT;
1347 1347
1348 return ret; 1348 return ret;
1349} 1349}
1350 1350
@@ -1362,11 +1362,11 @@ static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
1362#undef AL 1362#undef AL
1363 1363
1364/* 1364/*
1365 * System call vectors. 1365 * System call vectors.
1366 * 1366 *
1367 * Argument checking cleaned up. Saved 20% in size. 1367 * Argument checking cleaned up. Saved 20% in size.
1368 * This function doesn't need to set the kernel lock because 1368 * This function doesn't need to set the kernel lock because
1369 * it is set by the callees. 1369 * it is set by the callees.
1370 */ 1370 */
1371 1371
1372asmlinkage long sys32_socketcall(int call, unsigned int *args32) 1372asmlinkage long sys32_socketcall(int call, unsigned int *args32)
@@ -1402,11 +1402,11 @@ asmlinkage long sys32_socketcall(int call, unsigned int *args32)
1402 /* copy_from_user should be SMP safe. */ 1402 /* copy_from_user should be SMP safe. */
1403 if (copy_from_user(a, args32, socketcall_nargs[call])) 1403 if (copy_from_user(a, args32, socketcall_nargs[call]))
1404 return -EFAULT; 1404 return -EFAULT;
1405 1405
1406 a0=a[0]; 1406 a0=a[0];
1407 a1=a[1]; 1407 a1=a[1];
1408 1408
1409 switch(call) 1409 switch(call)
1410 { 1410 {
1411 case SYS_SOCKET: 1411 case SYS_SOCKET:
1412 err = sys_socket(a0,a1,a[2]); 1412 err = sys_socket(a0,a1,a[2]);
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index eed29fc9dc82..86e42c633f73 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -35,7 +35,7 @@ EXPORT_SYMBOL(memcpy);
35EXPORT_SYMBOL(memmove); 35EXPORT_SYMBOL(memmove);
36EXPORT_SYMBOL(strcat); 36EXPORT_SYMBOL(strcat);
37EXPORT_SYMBOL(strchr); 37EXPORT_SYMBOL(strchr);
38#ifdef CONFIG_MIPS64 38#ifdef CONFIG_64BIT
39EXPORT_SYMBOL(strncmp); 39EXPORT_SYMBOL(strncmp);
40#endif 40#endif
41EXPORT_SYMBOL(strlen); 41EXPORT_SYMBOL(strlen);
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 6e70c42c2058..e4f2f8011387 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -70,7 +70,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
70 70
71 /* New thread loses kernel privileges. */ 71 /* New thread loses kernel privileges. */
72 status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK); 72 status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK);
73#ifdef CONFIG_MIPS64 73#ifdef CONFIG_64BIT
74 status &= ~ST0_FR; 74 status &= ~ST0_FR;
75 status |= (current->thread.mflags & MF_32BIT_REGS) ? 0 : ST0_FR; 75 status |= (current->thread.mflags & MF_32BIT_REGS) ? 0 : ST0_FR;
76#endif 76#endif
@@ -236,10 +236,10 @@ static int __init get_frame_info(struct mips_frame_info *info, void *func)
236 break; 236 break;
237 237
238 if ( 238 if (
239#ifdef CONFIG_MIPS32 239#ifdef CONFIG_32BIT
240 ip->i_format.opcode == sw_op && 240 ip->i_format.opcode == sw_op &&
241#endif 241#endif
242#ifdef CONFIG_MIPS64 242#ifdef CONFIG_64BIT
243 ip->i_format.opcode == sd_op && 243 ip->i_format.opcode == sd_op &&
244#endif 244#endif
245 ip->i_format.rs == 29) 245 ip->i_format.rs == 29)
@@ -353,7 +353,7 @@ schedule_timeout_caller:
353 353
354out: 354out:
355 355
356#ifdef CONFIG_MIPS64 356#ifdef CONFIG_64BIT
357 if (current->thread.mflags & MF_32BIT_REGS) /* Kludge for 32-bit ps */ 357 if (current->thread.mflags & MF_32BIT_REGS) /* Kludge for 32-bit ps */
358 pc &= 0xffffffffUL; 358 pc &= 0xffffffffUL;
359#endif 359#endif
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 92e70ca3bff9..0b571a5b4b83 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -124,7 +124,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
124 if (tsk_used_math(child)) { 124 if (tsk_used_math(child)) {
125 fpureg_t *fregs = get_fpu_regs(child); 125 fpureg_t *fregs = get_fpu_regs(child);
126 126
127#ifdef CONFIG_MIPS32 127#ifdef CONFIG_32BIT
128 /* 128 /*
129 * The odd registers are actually the high 129 * The odd registers are actually the high
130 * order bits of the values stored in the even 130 * order bits of the values stored in the even
@@ -135,7 +135,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
135 else 135 else
136 tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff); 136 tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff);
137#endif 137#endif
138#ifdef CONFIG_MIPS64 138#ifdef CONFIG_64BIT
139 tmp = fregs[addr - FPR_BASE]; 139 tmp = fregs[addr - FPR_BASE];
140#endif 140#endif
141 } else { 141 } else {
@@ -213,7 +213,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
213 sizeof(child->thread.fpu.hard)); 213 sizeof(child->thread.fpu.hard));
214 child->thread.fpu.hard.fcr31 = 0; 214 child->thread.fpu.hard.fcr31 = 0;
215 } 215 }
216#ifdef CONFIG_MIPS32 216#ifdef CONFIG_32BIT
217 /* 217 /*
218 * The odd registers are actually the high order bits 218 * The odd registers are actually the high order bits
219 * of the values stored in the even registers - unless 219 * of the values stored in the even registers - unless
@@ -227,7 +227,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
227 fregs[addr - FPR_BASE] |= data; 227 fregs[addr - FPR_BASE] |= data;
228 } 228 }
229#endif 229#endif
230#ifdef CONFIG_MIPS64 230#ifdef CONFIG_64BIT
231 fregs[addr - FPR_BASE] = data; 231 fregs[addr - FPR_BASE] = data;
232#endif 232#endif
233 break; 233 break;
@@ -304,14 +304,14 @@ out:
304static inline int audit_arch(void) 304static inline int audit_arch(void)
305{ 305{
306#ifdef CONFIG_CPU_LITTLE_ENDIAN 306#ifdef CONFIG_CPU_LITTLE_ENDIAN
307#ifdef CONFIG_MIPS64 307#ifdef CONFIG_64BIT
308 if (!(current->thread.mflags & MF_32BIT_REGS)) 308 if (!(current->thread.mflags & MF_32BIT_REGS))
309 return AUDIT_ARCH_MIPSEL64; 309 return AUDIT_ARCH_MIPSEL64;
310#endif /* MIPS64 */ 310#endif /* MIPS64 */
311 return AUDIT_ARCH_MIPSEL; 311 return AUDIT_ARCH_MIPSEL;
312 312
313#else /* big endian... */ 313#else /* big endian... */
314#ifdef CONFIG_MIPS64 314#ifdef CONFIG_64BIT
315 if (!(current->thread.mflags & MF_32BIT_REGS)) 315 if (!(current->thread.mflags & MF_32BIT_REGS))
316 return AUDIT_ARCH_MIPS64; 316 return AUDIT_ARCH_MIPS64;
317#endif /* MIPS64 */ 317#endif /* MIPS64 */
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 243e7b629af6..f10019640ee9 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -35,7 +35,7 @@
35/* 35/*
36 * FPU context is saved iff the process has used it's FPU in the current 36 * FPU context is saved iff the process has used it's FPU in the current
37 * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user 37 * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user
38 * space STATUS register should be 0, so that a process *always* starts its 38 * space STATUS register should be 0, so that a process *always* starts its
39 * userland with FPU disabled after each context switch. 39 * userland with FPU disabled after each context switch.
40 * 40 *
41 * FPU will be enabled as soon as the process accesses FPU again, through 41 * FPU will be enabled as soon as the process accesses FPU again, through
@@ -55,7 +55,7 @@ LEAF(resume)
55 cpu_save_nonscratch a0 55 cpu_save_nonscratch a0
56 sw ra, THREAD_REG31(a0) 56 sw ra, THREAD_REG31(a0)
57 57
58 /* 58 /*
59 * check if we need to save FPU registers 59 * check if we need to save FPU registers
60 */ 60 */
61 lw t3, TASK_THREAD_INFO(a0) 61 lw t3, TASK_THREAD_INFO(a0)
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index ebb643d8d14c..aba665bcb386 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -36,7 +36,7 @@
36LEAF(_save_fp_context) 36LEAF(_save_fp_context)
37 cfc1 t1, fcr31 37 cfc1 t1, fcr31
38 38
39#ifdef CONFIG_MIPS64 39#ifdef CONFIG_64BIT
40 /* Store the 16 odd double precision registers */ 40 /* Store the 16 odd double precision registers */
41 EX sdc1 $f1, SC_FPREGS+8(a0) 41 EX sdc1 $f1, SC_FPREGS+8(a0)
42 EX sdc1 $f3, SC_FPREGS+24(a0) 42 EX sdc1 $f3, SC_FPREGS+24(a0)
@@ -118,7 +118,7 @@ LEAF(_save_fp_context32)
118 */ 118 */
119LEAF(_restore_fp_context) 119LEAF(_restore_fp_context)
120 EX lw t0, SC_FPC_CSR(a0) 120 EX lw t0, SC_FPC_CSR(a0)
121#ifdef CONFIG_MIPS64 121#ifdef CONFIG_64BIT
122 EX ldc1 $f1, SC_FPREGS+8(a0) 122 EX ldc1 $f1, SC_FPREGS+8(a0)
123 EX ldc1 $f3, SC_FPREGS+24(a0) 123 EX ldc1 $f3, SC_FPREGS+24(a0)
124 EX ldc1 $f5, SC_FPREGS+40(a0) 124 EX ldc1 $f5, SC_FPREGS+40(a0)
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 1fc3b2eb12bd..e02b7722ccb8 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -33,7 +33,7 @@
33/* 33/*
34 * FPU context is saved iff the process has used it's FPU in the current 34 * FPU context is saved iff the process has used it's FPU in the current
35 * time slice as indicated by _TIF_USEDFPU. In any case, the CU1 bit for user 35 * time slice as indicated by _TIF_USEDFPU. In any case, the CU1 bit for user
36 * space STATUS register should be 0, so that a process *always* starts its 36 * space STATUS register should be 0, so that a process *always* starts its
37 * userland with FPU disabled after each context switch. 37 * userland with FPU disabled after each context switch.
38 * 38 *
39 * FPU will be enabled as soon as the process accesses FPU again, through 39 * FPU will be enabled as soon as the process accesses FPU again, through
@@ -105,7 +105,7 @@
105 * Save a thread's fp context. 105 * Save a thread's fp context.
106 */ 106 */
107LEAF(_save_fp) 107LEAF(_save_fp)
108#ifdef CONFIG_MIPS64 108#ifdef CONFIG_64BIT
109 mfc0 t1, CP0_STATUS 109 mfc0 t1, CP0_STATUS
110#endif 110#endif
111 fpu_save_double a0 t1 t0 t2 # clobbers t1 111 fpu_save_double a0 t1 t0 t2 # clobbers t1
@@ -142,7 +142,7 @@ LEAF(_init_fpu)
142 142
143 li t1, -1 # SNaN 143 li t1, -1 # SNaN
144 144
145#ifdef CONFIG_MIPS64 145#ifdef CONFIG_64BIT
146 sll t0, t0, 5 146 sll t0, t0, 5
147 bgez t0, 1f # 16 / 32 register mode? 147 bgez t0, 1f # 16 / 32 register mode?
148 148
@@ -164,7 +164,7 @@ LEAF(_init_fpu)
164 dmtc1 t1, $f31 164 dmtc1 t1, $f31
1651: 1651:
166#endif 166#endif
167 167
168#ifdef CONFIG_CPU_MIPS32 168#ifdef CONFIG_CPU_MIPS32
169 mtc1 t1, $f0 169 mtc1 t1, $f0
170 mtc1 t1, $f1 170 mtc1 t1, $f1
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 3a240e3e004c..12b531c295c4 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -241,7 +241,7 @@ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_en
241 if (*tmp) 241 if (*tmp)
242 strcat(command_line, tmp); 242 strcat(command_line, tmp);
243 243
244#ifdef CONFIG_MIPS64 244#ifdef CONFIG_64BIT
245 /* HACK: Guess if the sign extension was forgotten */ 245 /* HACK: Guess if the sign extension was forgotten */
246 if (start > 0x0000000080000000 && start < 0x00000000ffffffff) 246 if (start > 0x0000000080000000 && start < 0x00000000ffffffff)
247 start |= 0xffffffff00000000; 247 start |= 0xffffffff00000000;
@@ -446,7 +446,7 @@ static inline void resource_init(void)
446{ 446{
447 int i; 447 int i;
448 448
449#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) 449#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
450 /* 450 /*
451 * The 64bit code in 32bit object format trick can't represent 451 * The 64bit code in 32bit object format trick can't represent
452 * 64bit wide relocations for linker script symbols. 452 * 64bit wide relocations for linker script symbols.
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index f6875f023a29..8ddfbd8d425a 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -558,7 +558,7 @@ static inline int setup_sigcontext32(struct pt_regs *regs,
558 if (!used_math()) 558 if (!used_math())
559 goto out; 559 goto out;
560 560
561 /* 561 /*
562 * Save FPU state to signal context. Signal handler will "inherit" 562 * Save FPU state to signal context. Signal handler will "inherit"
563 * current FPU state. 563 * current FPU state.
564 */ 564 */
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 56c36e42e0a6..a53b1ed7b386 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -924,7 +924,7 @@ void __init per_cpu_trap_init(void)
924 * flag that some firmware may have left set and the TS bit (for 924 * flag that some firmware may have left set and the TS bit (for
925 * IP27). Set XX for ISA IV code to work. 925 * IP27). Set XX for ISA IV code to work.
926 */ 926 */
927#ifdef CONFIG_MIPS64 927#ifdef CONFIG_64BIT
928 status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; 928 status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX;
929#endif 929#endif
930 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) 930 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index 3f24a1d45865..36c5212e0928 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -240,7 +240,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
240 break; 240 break;
241 241
242 case lwu_op: 242 case lwu_op:
243#ifdef CONFIG_MIPS64 243#ifdef CONFIG_64BIT
244 /* 244 /*
245 * A 32-bit kernel might be running on a 64-bit processor. But 245 * A 32-bit kernel might be running on a 64-bit processor. But
246 * if we're on a 32-bit processor and an i-cache incoherency 246 * if we're on a 32-bit processor and an i-cache incoherency
@@ -278,13 +278,13 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
278 *newvalue = value; 278 *newvalue = value;
279 *regptr = &regs->regs[insn.i_format.rt]; 279 *regptr = &regs->regs[insn.i_format.rt];
280 break; 280 break;
281#endif /* CONFIG_MIPS64 */ 281#endif /* CONFIG_64BIT */
282 282
283 /* Cannot handle 64-bit instructions in 32-bit kernel */ 283 /* Cannot handle 64-bit instructions in 32-bit kernel */
284 goto sigill; 284 goto sigill;
285 285
286 case ld_op: 286 case ld_op:
287#ifdef CONFIG_MIPS64 287#ifdef CONFIG_64BIT
288 /* 288 /*
289 * A 32-bit kernel might be running on a 64-bit processor. But 289 * A 32-bit kernel might be running on a 64-bit processor. But
290 * if we're on a 32-bit processor and an i-cache incoherency 290 * if we're on a 32-bit processor and an i-cache incoherency
@@ -320,7 +320,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
320 *newvalue = value; 320 *newvalue = value;
321 *regptr = &regs->regs[insn.i_format.rt]; 321 *regptr = &regs->regs[insn.i_format.rt];
322 break; 322 break;
323#endif /* CONFIG_MIPS64 */ 323#endif /* CONFIG_64BIT */
324 324
325 /* Cannot handle 64-bit instructions in 32-bit kernel */ 325 /* Cannot handle 64-bit instructions in 32-bit kernel */
326 goto sigill; 326 goto sigill;
@@ -392,7 +392,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
392 break; 392 break;
393 393
394 case sd_op: 394 case sd_op:
395#ifdef CONFIG_MIPS64 395#ifdef CONFIG_64BIT
396 /* 396 /*
397 * A 32-bit kernel might be running on a 64-bit processor. But 397 * A 32-bit kernel might be running on a 64-bit processor. But
398 * if we're on a 32-bit processor and an i-cache incoherency 398 * if we're on a 32-bit processor and an i-cache incoherency
@@ -428,7 +428,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
428 if (res) 428 if (res)
429 goto fault; 429 goto fault;
430 break; 430 break;
431#endif /* CONFIG_MIPS64 */ 431#endif /* CONFIG_64BIT */
432 432
433 /* Cannot handle 64-bit instructions in 32-bit kernel */ 433 /* Cannot handle 64-bit instructions in 32-bit kernel */
434 goto sigill; 434 goto sigill;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index e830d788c106..482ac310c937 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -15,7 +15,7 @@ SECTIONS
15 /* This is the value for an Origin kernel, taken from an IRIX kernel. */ 15 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
16 /* . = 0xc00000000001c000; */ 16 /* . = 0xc00000000001c000; */
17 17
18 /* Set the vaddr for the text segment to a value 18 /* Set the vaddr for the text segment to a value
19 >= 0xa800 0000 0001 9000 if no symmon is going to configured 19 >= 0xa800 0000 0001 9000 if no symmon is going to configured
20 >= 0xa800 0000 0030 0000 otherwise */ 20 >= 0xa800 0000 0030 0000 otherwise */
21 21