PERFORCE change 143382 for review
Przemek Witaszczyk
vi0 at FreeBSD.org
Thu Jun 12 17:58:00 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143382
Change 143382 by vi0 at vi0_gilgamesh.semihalf.com on 2008/06/12 17:57:42
Affected files ...
.. //depot/projects/soc2008/vi0/Efika01/aim/clock.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/aim/locore.S#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/aim/machdep.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/aim/mmu_oea.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/aim/mp_cpudep.c#1 branch
.. //depot/projects/soc2008/vi0/Efika01/aim/swtch.S#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/aim/trap_subr.S#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/aim/vm_machdep.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/booke/pmap.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/booke/trap_subr.S#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/booke/vm_machdep.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/conf/GENERIC#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/conf/MPC85XX#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/conf/NOTES#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/include/cpufunc.h#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/include/dbdma.h#1 branch
.. //depot/projects/soc2008/vi0/Efika01/include/pcpu.h#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/include/smp.h#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/include/spr.h#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/mpc85xx/mpc85xx.c#1 branch
.. //depot/projects/soc2008/vi0/Efika01/mpc85xx/ocpbus.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/mpc85xx/ocpbus.h#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/mpc85xx/pci_ocp.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powermac/dbdma.c#1 branch
.. //depot/projects/soc2008/vi0/Efika01/powermac/dbdmavar.h#1 branch
.. //depot/projects/soc2008/vi0/Efika01/powermac/macio.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powermac/maciovar.h#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powerpc/genassym.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powerpc/intr_machdep.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powerpc/mmu_if.m#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powerpc/mp_machdep.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powerpc/openpic.c#2 integrate
.. //depot/projects/soc2008/vi0/Efika01/powerpc/pmap_dispatch.c#2 integrate
Differences ...
==== //depot/projects/soc2008/vi0/Efika01/aim/clock.c#2 (text+ko) ====
@@ -56,15 +56,16 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/aim/clock.c,v 1.33 2008/04/22 19:38:30 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/aim/clock.c,v 1.34 2008/04/27 22:33:42 marcel Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/interrupt.h>
+#include <sys/pcpu.h>
#include <sys/sysctl.h>
-#include <sys/bus.h>
#include <sys/timetc.h>
-#include <sys/interrupt.h>
#include <dev/ofw/openfirm.h>
@@ -76,11 +77,9 @@
/*
* Initially we assume a processor with a bus frequency of 12.5 MHz.
*/
-u_int tickspending;
u_long ns_per_tick = 80;
static u_long ticks_per_sec = 12500000;
static long ticks_per_intr;
-static volatile u_long lasttb;
static timecounter_get_t decr_get_timecount;
@@ -95,7 +94,6 @@
void
decr_intr(struct trapframe *frame)
{
- u_long tb;
long tick;
int nticks;
@@ -109,36 +107,17 @@
* Based on the actual time delay since the last decrementer reload,
* we arrange for earlier interrupt next time.
*/
- __asm ("mftb %0; mfdec %1" : "=r"(tb), "=r"(tick));
+ __asm ("mfdec %0" : "=r"(tick));
for (nticks = 0; tick < 0; nticks++)
tick += ticks_per_intr;
mtdec(tick);
- /*
- * lasttb is used during microtime. Set it to the virtual
- * start of this tick interval.
- */
- lasttb = tb + tick - ticks_per_intr;
- nticks += tickspending;
- tickspending = 0;
-
- /*
- * Reenable interrupts
- */
-#if 0
- msr = mfmsr();
- mtmsr(msr | PSL_EE | PSL_RI);
-#endif
- /*
- * Do standard timer interrupt stuff.
- * Do softclock stuff only on the last iteration.
- */
-#if 0
- while (--nticks > 0) {
- hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+ while (nticks-- > 0) {
+ if (PCPU_GET(cpuid) == 0)
+ hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+ else
+ hardclock_cpu(TRAPF_USERMODE(frame));
}
-#endif
- hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
}
void
@@ -166,7 +145,6 @@
ns_per_tick = 1000000000 / ticks_per_sec;
ticks_per_intr = ticks_per_sec / hz;
- __asm __volatile ("mftb %0" : "=r"(lasttb));
mtdec(ticks_per_intr);
mtmsr(msr);
==== //depot/projects/soc2008/vi0/Efika01/aim/locore.S#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/powerpc/aim/locore.S,v 1.26 2008/04/16 23:28:11 marcel Exp $ */
+/* $FreeBSD: src/sys/powerpc/aim/locore.S,v 1.28 2008/04/27 22:33:42 marcel Exp $ */
/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */
/*-
@@ -77,19 +77,21 @@
.globl kernbase
.set kernbase, KERNBASE
+#define TMPSTKSZ 8192 /* 8K temporary stack */
+
/*
* Globals
*/
.data
+ .align 4
GLOBAL(tmpstk)
- .space 8208
+ .space TMPSTKSZ
GLOBAL(esym)
.long 0 /* end of symbol table */
GLOBAL(ofmsr)
.long 0, 0, 0, 0, 0 /* msr/sprg0-3 used in Open Firmware */
-#define INTSTK 16384 /* 16K interrupt stack */
#define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */
GLOBAL(intrnames)
.space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2
@@ -151,9 +153,8 @@
stw 5,openfirmware_entry at l(8) /* save client interface handler */
mr 3,5
- lis 1,tmpstk at ha
- addi 1,1,tmpstk at l
- addi 1,1,8192
+ lis 1,(tmpstk+TMPSTKSZ-16)@ha
+ addi 1,1,(tmpstk+TMPSTKSZ-16)@l
mfmsr 0
lis 9,ofmsr at ha
==== //depot/projects/soc2008/vi0/Efika01/aim/machdep.c#2 (text+ko) ====
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/aim/machdep.c,v 1.114 2008/04/25 05:18:49 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/aim/machdep.c,v 1.116 2008/05/23 04:03:53 alc Exp $");
#include "opt_compat.h"
#include "opt_ddb.h"
@@ -129,7 +129,8 @@
int cold = 1;
-static struct pcpu pcpu0;
+struct pcpu __pcpu[MAXCPU];
+
static struct trapframe frame0;
char machine[] = "powerpc";
@@ -165,14 +166,6 @@
struct kva_md_info kmi;
-void setPQL2(int *const size, int *const ways);
-
-void
-setPQL2(int *const size, int *const ways)
-{
- return;
-}
-
static void
powerpc_ofw_shutdown(void *junk, int howto)
{
@@ -236,6 +229,9 @@
extern char kernel_text[], _end[];
+#ifdef SMP
+extern void *rstcode, *rstsize;
+#endif
extern void *trapcode, *trapsize;
extern void *alitrap, *alisize;
extern void *dsitrap, *dsisize;
@@ -288,7 +284,7 @@
/*
* Set up per-cpu data.
*/
- pc = &pcpu0;
+ pc = __pcpu;
pcpu_init(pc, 0, sizeof(struct pcpu));
pc->pc_curthread = &thread0;
pc->pc_cpuid = 0;
@@ -320,7 +316,11 @@
*/
mtmsr(mfmsr() & ~(PSL_IR | PSL_DR));
isync();
+#ifdef SMP
+ bcopy(&rstcode, (void *)EXC_RST, (size_t)&rstsize);
+#else
bcopy(&trapcode, (void *)EXC_RST, (size_t)&trapsize);
+#endif
bcopy(&trapcode, (void *)EXC_MCHK, (size_t)&trapsize);
bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
bcopy(&trapcode, (void *)EXC_ISI, (size_t)&trapsize);
@@ -337,8 +337,7 @@
bcopy(&trapcode, (void *)EXC_THRM, (size_t)&trapsize);
bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize);
#ifdef KDB
- bcopy(&dblow, (void *)EXC_RST, (size_t)&dbsize);
- bcopy(&dblow, (void *)EXC_MCHK, (size_t)&dbsize);
+ bcopy(&dblow, (void *)EXC_MCHK, (size_t)&dbsize);
bcopy(&dblow, (void *)EXC_PGM, (size_t)&dbsize);
bcopy(&dblow, (void *)EXC_TRC, (size_t)&dbsize);
bcopy(&dblow, (void *)EXC_BPT, (size_t)&dbsize);
==== //depot/projects/soc2008/vi0/Efika01/aim/mmu_oea.c#2 (text+ko) ====
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/aim/mmu_oea.c,v 1.119 2008/04/17 00:37:40 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/aim/mmu_oea.c,v 1.122 2008/05/23 19:16:24 marcel Exp $");
/*
* Manages physical address maps.
@@ -147,6 +147,7 @@
#include <machine/md_var.h>
#include <machine/psl.h>
#include <machine/pte.h>
+#include <machine/smp.h>
#include <machine/sr.h>
#include <machine/mmuvar.h>
@@ -203,8 +204,6 @@
extern struct pmap ofw_pmap;
-
-
/*
* Lock for the pteg and pvo tables.
*/
@@ -605,6 +604,64 @@
}
void
+pmap_cpu_bootstrap(volatile uint32_t *trcp, int ap)
+{
+ u_int sdr;
+ int i;
+
+ trcp[0] = 0x1000;
+ trcp[1] = (uint32_t)&pmap_cpu_bootstrap;
+
+ if (ap) {
+ __asm __volatile("mtdbatu 0,%0" :: "r"(battable[0].batu));
+ __asm __volatile("mtdbatl 0,%0" :: "r"(battable[0].batl));
+ isync();
+ __asm __volatile("mtibatu 0,%0" :: "r"(battable[0].batu));
+ __asm __volatile("mtibatl 0,%0" :: "r"(battable[0].batl));
+ isync();
+ }
+
+ trcp[0] = 0x1001;
+
+ __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu));
+ __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl));
+ isync();
+
+ trcp[0] = 0x1002;
+
+ __asm __volatile("mtibatu 1,%0" :: "r"(0));
+ __asm __volatile("mtdbatu 2,%0" :: "r"(0));
+ __asm __volatile("mtibatu 2,%0" :: "r"(0));
+ __asm __volatile("mtdbatu 3,%0" :: "r"(0));
+ __asm __volatile("mtibatu 3,%0" :: "r"(0));
+ isync();
+
+ trcp[0] = 0x1003;
+
+ for (i = 0; i < 16; i++)
+ mtsrin(i << ADDR_SR_SHFT, EMPTY_SEGMENT);
+
+ trcp[0] = 0x1004;
+
+ __asm __volatile("mtsr %0,%1" :: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT));
+ __asm __volatile("mtsr %0,%1" :: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
+ __asm __volatile("sync");
+
+ trcp[0] = 0x1005;
+
+ sdr = (u_int)moea_pteg_table | (moea_pteg_mask >> 10);
+ __asm __volatile("mtsdr1 %0" :: "r"(sdr));
+ isync();
+
+ trcp[0] = 0x1006;
+ trcp[1] = sdr;
+
+ tlbia();
+
+ trcp[0] = 0x1007;
+}
+
+void
moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
{
ihandle_t mmui;
@@ -612,9 +669,9 @@
int sz;
int i, j;
int ofw_mappings;
+ uint32_t trace[2];
vm_size_t size, physsz, hwphyssz;
vm_offset_t pa, va, off;
- u_int batl, batu;
/*
* Set up BAT0 to map the lowest 256 MB area
@@ -647,18 +704,15 @@
* Use an IBAT and a DBAT to map the bottom segment of memory
* where we are.
*/
- batu = BATU(0x00000000, BAT_BL_256M, BAT_Vs);
- batl = BATL(0x00000000, BAT_M, BAT_PP_RW);
__asm (".balign 32; \n"
"mtibatu 0,%0; mtibatl 0,%1; isync; \n"
"mtdbatu 0,%0; mtdbatl 0,%1; isync"
- :: "r"(batu), "r"(batl));
+ :: "r"(battable[0].batu), "r"(battable[0].batl));
/* map pci space */
- batu = BATU(0x80000000, BAT_BL_256M, BAT_Vs);
- batl = BATL(0x80000000, BAT_I|BAT_G, BAT_PP_RW);
- __asm ("mtdbatu 1,%0; mtdbatl 1,%1; isync"
- :: "r"(batu), "r"(batl));
+ __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu));
+ __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl));
+ isync();
mem_regions(&pregions, &pregions_sz, ®ions, ®ions_sz);
CTR0(KTR_PMAP, "moea_bootstrap: physical memory");
@@ -844,19 +898,7 @@
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT;
kernel_pmap->pm_active = ~0;
- /*
- * Initialize hardware.
- */
- for (i = 0; i < 16; i++) {
- mtsrin(i << ADDR_SR_SHFT, EMPTY_SEGMENT);
- }
- __asm __volatile ("mtsr %0,%1"
- :: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT));
- __asm __volatile ("mtsr %0,%1"
- :: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
- __asm __volatile ("sync; mtsdr1 %0; isync"
- :: "r"((u_int)moea_pteg_table | (moea_pteg_mask >> 10)));
- tlbia();
+ pmap_cpu_bootstrap(trace, 0);
pmap_bootstrapped++;
==== //depot/projects/soc2008/vi0/Efika01/aim/swtch.S#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/powerpc/aim/swtch.S,v 1.24 2008/03/02 17:05:56 raj Exp $ */
+/* $FreeBSD: src/sys/powerpc/aim/swtch.S,v 1.25 2008/04/27 22:33:42 marcel Exp $ */
/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */
/*-
@@ -67,6 +67,13 @@
#include <machine/asm.h>
/*
+ * void cpu_throw(struct thread *old, struct thread *new)
+ */
+ENTRY(cpu_throw)
+ mr %r15, %r4
+ b cpu_switchin
+
+/*
* void cpu_switch(struct thread *old,
* struct thread *new,
* struct mutex *mtx);
@@ -94,7 +101,8 @@
mr %r14,%r3 /* Copy the old thread ptr... */
mr %r15,%r4 /* and the new thread ptr in scratch */
- lwz %r6,PCB_FLAGS(%r5) /* Save FPU context if needed */
+ lwz %r6,PCB_FLAGS(%r5)
+ /* Save FPU context if needed */
andi. %r6, %r6, PCB_FPU
beq .L1
bl save_fpu
@@ -102,6 +110,7 @@
.L1:
bl pmap_deactivate /* Deactivate the current pmap */
+cpu_switchin:
mr %r3,%r15 /* Get new thread ptr */
bl pmap_activate /* Activate the new address space */
@@ -110,7 +119,8 @@
lwz %r17,TD_PCB(%r15) /* Store new current PCB */
stw %r17,PC_CURPCB(%r7)
- lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */
+ lwz %r6, PCB_FLAGS(%r17)
+ /* Restore FPU context if needed */
andi. %r6, %r6, PCB_FPU
beq .L2
mr %r3,%r15 /* Pass curthread to enable_fpu */
==== //depot/projects/soc2008/vi0/Efika01/aim/trap_subr.S#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/powerpc/aim/trap_subr.S,v 1.18 2008/03/02 17:05:56 raj Exp $ */
+/* $FreeBSD: src/sys/powerpc/aim/trap_subr.S,v 1.19 2008/04/27 22:33:42 marcel Exp $ */
/* $NetBSD: trap_subr.S,v 1.20 2002/04/22 23:20:08 kleink Exp $ */
/*-
@@ -228,20 +228,67 @@
mfsprg2 %r2; /* restore r2 & r3 */ \
mfsprg3 %r3
-#ifdef KDB
+#ifdef SMP
/*
- * Define the kdb debugger stack
+ * Processor reset exception handler. These are typically
+ * the first instructions the processor executes after a
+ * software reset.
*/
- .data
-GLOBAL(dbstk)
- .space INTSTK+8 /* kdb stack */
+ .globl CNAME(rstcode), CNAME(rstsize)
+CNAME(rstcode):
+ bl 1f
+
+ /* We use this space for tracing purposes. */
+ .long 0
+ .long 0
+
+1:
+ mflr %r2
+ mfmsr %r3
+ stw %r2,0(%r2) /* trace: 0x104 - we're here. */
+ stw %r3,4(%r2) /* trace data: MSR */
+ sync
+
+ lis %r1,(tmpstk+TMPSTKSZ-16)@ha
+ addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l
+
+ addi %r3,%r2,4
+ stw %r3,0(%r1)
+ sync
+ stw %r3,0(%r2) /* trace: 0x108 - stack is writable */
+ stw %r1,4(%r2) /* trace data: SP */
+ sync
+
+ mr %r3,%r2
+ lis %r4,1 at l
+ bla CNAME(pmap_cpu_bootstrap)
+
+ addi %r3,%r2,8
+ stw %r3,0(%r2) /* trace 0x10c - back from 1st call */
+ sync
+
+ mr %r3,%r2
+ bla CNAME(cpudep_ap_bootstrap)
+ mr %r1,%r3
+
+ addi %r3,%r2,12
+ stw %r3,0(%r2) /* trace 0x110 - back from 2nd call */
+ stw %r1,4(%r2) /* trace data: SP */
+
+ mr %r3,%r2
+ bla CNAME(machdep_ap_bootstrap)
+
+ /* Should not be reached */
+9:
+ b 9b
+CNAME(rstsize) = . - CNAME(rstcode)
#endif
/*
* This code gets copied to all the trap vectors
* (except ISI/DSI, ALI, and the interrupts)
*/
- .text
+
.globl CNAME(trapcode),CNAME(trapsize)
CNAME(trapcode):
mtsprg1 %r1 /* save SP */
@@ -385,8 +432,8 @@
stw %r30,(PC_DBSAVE +CPUSAVE_R30)(%r1) /* save r30 */
lwz %r31,(PC_DISISAVE+CPUSAVE_R31)(%r1) /* get r31 */
stw %r31,(PC_DBSAVE +CPUSAVE_R31)(%r1) /* save r31 */
- lis %r1,dbstk+INTSTK at ha /* get new SP */
- addi %r1,%r1,dbstk+INTSTK at l
+ lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */
+ addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l
b dbtrap
#endif
@@ -457,8 +504,8 @@
/*
* Deliberate entry to dbtrap
*/
- .globl CNAME(ppc_db_trap)
-CNAME(ppc_db_trap):
+ .globl CNAME(breakpoint)
+CNAME(breakpoint):
mtsprg1 %r1
mfmsr %r3
mtsrr1 %r3
@@ -533,8 +580,8 @@
stw %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */
stw %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */
mflr %r28 /* save LR */
- lis %r1,dbstk+INTSTK at ha /* get new SP */
- addi %r1,%r1,dbstk+INTSTK at l
+ lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */
+ addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l
bla dbtrap
CNAME(dbsize) = .-CNAME(dblow)
#endif /* KDB */
==== //depot/projects/soc2008/vi0/Efika01/aim/vm_machdep.c#2 (text+ko) ====
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $FreeBSD: src/sys/powerpc/aim/vm_machdep.c,v 1.120 2008/03/12 10:12:00 jeff Exp $
+ * $FreeBSD: src/sys/powerpc/aim/vm_machdep.c,v 1.121 2008/04/27 22:33:42 marcel Exp $
*/
/*-
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -192,15 +192,6 @@
{
}
-/* Temporary helper */
-void
-cpu_throw(struct thread *old, struct thread *new)
-{
-
- cpu_switch(old, new, old->td_lock);
- panic("cpu_throw() didn't");
-}
-
/*
* Reset back to firmware.
*/
==== //depot/projects/soc2008/vi0/Efika01/booke/pmap.c#2 (text+ko) ====
@@ -39,7 +39,7 @@
* Virtual address space layout:
* -----------------------------
* 0x0000_0000 - 0xbfff_efff : user process
- * 0xc000_0000 - 0xc1ff_ffff : kerel reserved
+ * 0xc000_0000 - 0xc1ff_ffff : kernel reserved
* 0xc000_0000 - kernelend : kernel code &data
* 0xc1ff_c000 - 0xc200_0000 : kstack0
* 0xc200_0000 - 0xffef_ffff : KVA
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/booke/pmap.c,v 1.1 2008/03/03 17:17:00 raj Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/booke/pmap.c,v 1.4 2008/06/11 20:05:25 wkoszek Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -269,7 +269,6 @@
/*
* Kernel MMU interface
*/
-static vm_offset_t mmu_booke_addr_hint(mmu_t, vm_object_t, vm_offset_t, vm_size_t);
static void mmu_booke_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t);
static void mmu_booke_clear_modify(mmu_t, vm_page_t);
static void mmu_booke_clear_reference(mmu_t, vm_page_t);
@@ -323,7 +322,6 @@
static mmu_method_t mmu_booke_methods[] = {
/* pmap dispatcher interface */
- MMUMETHOD(mmu_addr_hint, mmu_booke_addr_hint),
MMUMETHOD(mmu_change_wiring, mmu_booke_change_wiring),
MMUMETHOD(mmu_clear_modify, mmu_booke_clear_modify),
MMUMETHOD(mmu_clear_reference, mmu_booke_clear_reference),
@@ -379,20 +377,6 @@
};
MMU_DEF(booke_mmu);
-/*
- * This routine defines the region(s) of memory that should
- * not be tested for the modified bit.
- */
-static __inline int
-track_modified_needed(pmap_t pmap, vm_offset_t va)
-{
-
- if (pmap == kernel_pmap)
- return ((va < kmi.clean_sva) || (va >= kmi.clean_eva));
- else
- return (1);
-}
-
/* Return number of entries in TLB0. */
static __inline void
tlb0_get_tlbconf(void)
@@ -780,10 +764,8 @@
if (PTE_ISMANAGED(pte)) {
/* Handle modified pages. */
- if (PTE_ISMODIFIED(pte)) {
- if (track_modified_needed(pmap, va))
- vm_page_dirty(m);
- }
+ if (PTE_ISMODIFIED(pte))
+ vm_page_dirty(m);
/* Referenced pages. */
if (PTE_ISREFERENCED(pte))
@@ -1487,10 +1469,8 @@
pte->flags |= PTE_UW;
} else {
/* Handle modified pages, sense modify status. */
- if (PTE_ISMODIFIED(pte)) {
- if (track_modified_needed(pmap, va))
- vm_page_dirty(m);
- }
+ if (PTE_ISMODIFIED(pte))
+ vm_page_dirty(m);
}
/* If we're turning on execute permissions, flush the icache. */
@@ -1809,10 +1789,8 @@
m = PHYS_TO_VM_PAGE(PTE_PA(pte));
/* Handle modified pages. */
- if (PTE_ISMODIFIED(pte)) {
- if (track_modified_needed(pmap, va))
- vm_page_dirty(m);
- }
+ if (PTE_ISMODIFIED(pte))
+ vm_page_dirty(m);
/* Referenced pages. */
if (PTE_ISREFERENCED(pte))
@@ -1850,11 +1828,8 @@
m = PHYS_TO_VM_PAGE(PTE_PA(pte));
/* Handle modified pages. */
- if (PTE_ISMODIFIED(pte)) {
- if (track_modified_needed(pv->pv_pmap,
- pv->pv_va))
- vm_page_dirty(m);
- }
+ if (PTE_ISMODIFIED(pte))
+ vm_page_dirty(m);
/* Referenced pages. */
if (PTE_ISREFERENCED(pte))
@@ -2055,9 +2030,6 @@
if (!PTE_ISVALID(pte))
goto make_sure_to_unlock;
- if (!track_modified_needed(pv->pv_pmap, pv->pv_va))
- goto make_sure_to_unlock;
-
if (PTE_ISMODIFIED(pte)) {
PMAP_UNLOCK(pv->pv_pmap);
return (TRUE);
@@ -2138,9 +2110,6 @@
if (!PTE_ISVALID(pte))
goto make_sure_to_unlock;
- if (!track_modified_needed(pv->pv_pmap, pv->pv_va))
- goto make_sure_to_unlock;
-
if (PTE_ISREFERENCED(pte)) {
pte->flags &= ~PTE_REFERENCED;
tlb0_flush_entry(pv->pv_pmap, pv->pv_va);
@@ -2349,14 +2318,6 @@
return (0);
}
-static vm_offset_t
-mmu_booke_addr_hint(mmu_t mmu, vm_object_t object, vm_offset_t va,
- vm_size_t size)
-{
-
- return (va);
-}
-
/**************************************************************************/
/* TID handling */
/**************************************************************************/
==== //depot/projects/soc2008/vi0/Efika01/booke/trap_subr.S#2 (text+ko) ====
@@ -26,7 +26,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/powerpc/booke/trap_subr.S,v 1.1 2008/03/03 17:17:00 raj Exp $
+ * $FreeBSD: src/sys/powerpc/booke/trap_subr.S,v 1.2 2008/04/27 22:33:42 marcel Exp $
*/
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -795,8 +795,8 @@
/*
* Deliberate entry to dbtrap
*/
- .globl CNAME(ppc_db_trap)
-CNAME(ppc_db_trap):
+ .globl CNAME(breakpoint)
+CNAME(breakpoint):
mtsprg1 %r1
mfmsr %r3
mtsrr1 %r3
==== //depot/projects/soc2008/vi0/Efika01/booke/vm_machdep.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * from: $FreeBSD: src/sys/powerpc/booke/vm_machdep.c,v 1.3 2008/03/16 10:58:08 rwatson Exp $
+ * from: $FreeBSD: src/sys/powerpc/booke/vm_machdep.c,v 1.4 2008/04/26 17:57:29 raj Exp $
*/
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -99,7 +99,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/booke/vm_machdep.c,v 1.3 2008/03/16 10:58:08 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/booke/vm_machdep.c,v 1.4 2008/04/26 17:57:29 raj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -257,22 +257,6 @@
panic("cpu_throw() didn't");
}
-/* Reset back to firmware. */
-void
-cpu_reset()
-{
-
- /* Clear DBCR0, disables debug interrupts and events. */
- mtspr(SPR_DBCR0, 0);
- __asm volatile("isync");
-
- /* Enable Debug Interrupts in MSR. */
- mtmsr(mfmsr() | PSL_DE);
-
- /* Enable debug interrupts and issue reset. */
- mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM);
-}
-
/*
* Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-))
*/
@@ -404,7 +388,7 @@
* stuff other tests for known memory-mapped devices (PCI?)
* here
*/
- return 1;
+ return (1);
}
/*
==== //depot/projects/soc2008/vi0/Efika01/conf/GENERIC#2 (text+ko) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/powerpc/conf/GENERIC,v 1.77 2008/03/27 11:54:19 dfr Exp $
+# $FreeBSD: src/sys/powerpc/conf/GENERIC,v 1.79 2008/06/07 22:58:32 marcel Exp $
cpu AIM
ident GENERIC
@@ -30,7 +30,7 @@
options POWERMAC #NewWorld Apple PowerMacs
options PSIM #GDB PSIM ppc simulator
-options SCHED_ULE #ULE scheduler
+options SCHED_ULE #ULE scheduler
options INET #InterNETworking
options INET6 #IPv6 communications protocols
options SCTP #Stream Control Transmission Protocol
@@ -95,8 +95,8 @@
# syscons is the default console driver, resembling an SCO console
device sc
device kbdmux
-options SC_OFWFB # OFW frame buffer
-options SC_DFLT_FONT # compile font in
+options SC_OFWFB # OFW frame buffer
+options SC_DFLT_FONT # compile font in
makeoptions SC_DFLT_FONT=cp437
# Serial (COM) ports
@@ -106,6 +106,7 @@
# PCI Ethernet NICs that use the common MII bus controller code.
device miibus # MII bus support
device bge # Broadcom BCM570xx Gigabit Ethernet
+device bm # Apple BMAC Ethernet
device gem # Sun GEM/Sun ERI/Apple GMAC
device dc # DEC/Intel 21143 and various workalikes
device fxp # Intel EtherExpress PRO/100B (82557, 82558)
==== //depot/projects/soc2008/vi0/Efika01/conf/MPC85XX#2 (text+ko) ====
@@ -1,7 +1,7 @@
#
# Custom kernel for Freescale MPC85XX development boards like the CDS etc.
#
-# $FreeBSD: src/sys/powerpc/conf/MPC85XX,v 1.3 2008/04/21 10:09:55 phk Exp $
+# $FreeBSD: src/sys/powerpc/conf/MPC85XX,v 1.4 2008/04/26 17:37:13 raj Exp $
#
cpu E500
@@ -37,6 +37,7 @@
options MSDOSFS
options NFS_ROOT
options NFSCLIENT
+options NFSLOCKD
options PROCFS
options PSEUDOFS
options SCHED_4BSD
==== //depot/projects/soc2008/vi0/Efika01/conf/NOTES#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/powerpc/conf/NOTES,v 1.16 2008/03/04 03:05:53 marcel Exp $
+# $FreeBSD: src/sys/powerpc/conf/NOTES,v 1.18 2008/06/08 01:58:11 marcel Exp $
#
# This file contains machine dependent kernel configuration notes. For
# machine independent notes, look in /sys/conf/NOTES.
@@ -24,6 +24,7 @@
# Standard busses
device pci
+device bm # Apple BMAC (Big Mac Ethernet)
device ofwd # Open Firmware disks
@@ -61,8 +62,6 @@
#####################################################################
# Options we don't want to deal with
-nooption SMP
-nooption ADAPTIVE_SX
nooption PPC_DEBUG
nooption PPC_PROBE_CHIPSET
nooption SC_NO_MODE_CHANGE
==== //depot/projects/soc2008/vi0/Efika01/include/cpufunc.h#2 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/powerpc/include/cpufunc.h,v 1.21 2004/08/07 00:20:00 grehan Exp $
+ * $FreeBSD: src/sys/powerpc/include/cpufunc.h,v 1.24 2008/04/27 22:33:42 marcel Exp $
*/
#ifndef _MACHINE_CPUFUNC_H_
@@ -44,21 +44,14 @@
#include <sys/types.h>
#include <machine/psl.h>
+#include <machine/spr.h>
struct thread;
#ifdef KDB
-void ppc_db_trap(void);
+void breakpoint(void);
#endif
-static __inline void
-breakpoint(void)
-{
-#ifdef KDB
- ppc_db_trap();
-#endif
-}
-
/* CPU register mangling inlines */
static __inline void
==== //depot/projects/soc2008/vi0/Efika01/include/pcpu.h#2 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/powerpc/include/pcpu.h,v 1.26 2008/03/06 16:59:36 marcel Exp $
+ * $FreeBSD: src/sys/powerpc/include/pcpu.h,v 1.27 2008/04/27 22:33:42 marcel Exp $
*/
#ifndef _MACHINE_PCPU_H_
@@ -40,6 +40,11 @@
int pc_inside_intr; \
struct pmap *pc_curpmap; /* current pmap */ \
struct thread *pc_fputhread; /* current fpu user */ \
+ uintptr_t pc_hwref; \
+ uint32_t pc_pir; \
+ int pc_bsp:1; \
+ int pc_awake:1; \
+ uint32_t pc_ipimask; \
register_t pc_tempsave[CPUSAVE_LEN]; \
register_t pc_disisave[CPUSAVE_LEN]; \
register_t pc_dbsave[CPUSAVE_LEN];
@@ -112,18 +117,18 @@
int pc_md_placeholder
#endif
-#define PCPUP ((struct pcpu *) powerpc_get_pcpup())
+#define pcpup ((struct pcpu *) powerpc_get_pcpup())
-#define PCPU_GET(member) (PCPUP->pc_ ## member)
+#define PCPU_GET(member) (pcpup->pc_ ## member)
/*
* XXX The implementation of this operation should be made atomic
* with respect to preemption.
*/
-#define PCPU_ADD(member, value) (PCPUP->pc_ ## member += (value))
+#define PCPU_ADD(member, value) (pcpup->pc_ ## member += (value))
#define PCPU_INC(member) PCPU_ADD(member, 1)
-#define PCPU_PTR(member) (&PCPUP->pc_ ## member)
-#define PCPU_SET(member,value) (PCPUP->pc_ ## member = (value))
+#define PCPU_PTR(member) (&pcpup->pc_ ## member)
+#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
#endif /* _KERNEL */
==== //depot/projects/soc2008/vi0/Efika01/include/smp.h#2 (text+ko) ====
@@ -1,7 +1,64 @@
-/* $FreeBSD: src/sys/powerpc/include/smp.h,v 1.1 2001/06/16 07:14:04 benno Exp $ */
+/*-
+ * Copyright (c) 2008 Marcel Moolenaar
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list