Update of /cvsroot/linux-mips/linux/arch/mips/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv23204/arch/mips/kernel
Modified Files:
head.S smp.c traps.c
Log Message:
Most of it was a collection of fixes and cleanups for mips64 and SMP stuff
Index: head.S
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/head.S,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- head.S 4 Jan 2002 18:04:53 -0000 1.12
+++ head.S 26 Feb 2002 17:34:14 -0000 1.13
@@ -21,6 +21,7 @@
#include <asm/asm.h>
#include <asm/current.h>
#include <asm/offset.h>
+#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/regdef.h>
#include <asm/cachectl.h>
@@ -153,9 +154,9 @@
mtc0 zero, CP0_WIRED
CLI
mfc0 t0, CP0_STATUS
- li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_BEV);
+ li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX)
and t0, t1
- or t0, (ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
+ or t0, (ST0_CU0|ST0_FR);
jal start_secondary
mtc0 t0, CP0_STATUS
.set pop
@@ -167,28 +168,20 @@
.comm kernelsp, NR_CPUS * 8, 8
.comm pgd_current, NR_CPUS * 8, 8
- .text
- .org 0x1000
-EXPORT(swapper_pg_dir)
-
- .org 0x2000
-EXPORT(empty_bad_page)
-
- .org 0x3000
-EXPORT(empty_bad_page_table)
+#undef PAGE_SIZE
+#define PAGE_SIZE 0x1000
- .org 0x4000
-EXPORT(invalid_pte_table)
+ .macro page name, order=0
+ .globl \name
+\name: .size \name, (PAGE_SIZE << \order)
+ .org . + (PAGE_SIZE << \order)
+ .type \name, @object
+ .endm
- .org 0x5000
-/*
- * Odd MIPS as behaviour but no bug - this label is required to keep as from
- * trying to be too clever ...
- */
-dummy:
+ .data
+ .align 12
-/*
- * Align to 8kb boundary for init_task_union which follows in the
- * .text segment.
- */
- .align 13
+ page swapper_pg_dir, PGD_ORDER
+ page empty_bad_page, 0
+ page empty_bad_page_table, 0
+ page invalid_pte_table, 0
Index: smp.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/smp.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- smp.c 19 Feb 2002 17:57:11 -0000 1.14
+++ smp.c 26 Feb 2002 17:34:14 -0000 1.15
@@ -88,19 +88,15 @@
unsigned int cpu = smp_processor_id();
prom_init_secondary();
+ per_cpu_trap_init();
- /* Do stuff that trap_init() did for the first processor */
- clear_cp0_status(ST0_BEV);
- if (mips_cpu.options & MIPS_CPU_DIVEC) {
- set_cp0_cause(CAUSEF_IV);
- }
- /* XXX parity protection should be folded in here when it's converted to
- an option instead of something based on .cputype */
+ /*
+ * XXX parity protection should be folded in here when it's converted
+ * to an option instead of something based on .cputype
+ */
- set_context(cpu << 23);
pgd_current[cpu] = init_mm.pgd;
cpu_data[cpu].udelay_val = loops_per_jiffy;
- cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
prom_smp_finish();
printk("Slave cpu booted successfully\n");
CPUMASK_SETB(cpu_online_map, cpu);
Index: traps.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/traps.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- traps.c 28 Jan 2002 19:23:57 -0000 1.30
+++ traps.c 26 Feb 2002 17:34:14 -0000 1.31
@@ -826,6 +826,24 @@
extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc);
extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc);
+void __init per_cpu_trap_init(void)
+{
+ unsigned int cpu = smp_processor_id();
+
+ /* Some firmware leaves the BEV flag set, clear it. */
+ clear_cp0_status(ST0_BEV);
+
+ /*
+ * Some MIPS CPUs have a dedicated interrupt vector which reduces the
+ * interrupt processing overhead. Use it where available.
+ */
+ if (mips_cpu.options & MIPS_CPU_DIVEC)
+ set_cp0_cause(CAUSEF_IV);
+
+ cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
+ set_context(cpu << 23);
+}
+
void __init trap_init(void)
{
extern char except_vec1_generic, except_vec2_generic;
@@ -833,9 +851,6 @@
extern char except_vec4;
extern char except_vec_ejtag_debug;
unsigned long i;
-
- /* Some firmware leaves the BEV flag set, clear it. */
- clear_cp0_status(ST0_BEV);
/* Copy the generic exception handler code to it's final destination. */
memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
|