Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Peform a rototill over the powerpc-based ports.
details: https://anonhg.NetBSD.org/src/rev/d281c5f1a980
branches: trunk
changeset: 533632:d281c5f1a980
user: matt <matt%NetBSD.org@localhost>
date: Fri Jul 05 18:45:15 2002 +0000
description:
Peform a rototill over the powerpc-based ports.
Move the trap/vector initialization for MPC6xx ports to mpc6xx_machdep.c
Also move softnet, install_extintr, mapiodev, kvtop. Add common BAT
initialization code.
Add user Altivec support.
Fix calls to OF_call_method in macppc/macppc/machdep.c.
Use ci_fpuproc in cpu_info instead of separate fpuproc.
Add separate syscall.c and defined __HAVE_SYSCALL_INTERN.
diffstat:
sys/arch/amigappc/amigappc/machdep.c | 4 +-
sys/arch/amigappc/include/intr.h | 10 +-
sys/arch/bebox/bebox/machdep.c | 358 +------------------------
sys/arch/bebox/include/autoconf.h | 4 -
sys/arch/bebox/include/intr.h | 9 +-
sys/arch/macppc/conf/GENERIC | 11 +-
sys/arch/macppc/include/autoconf.h | 4 +-
sys/arch/macppc/include/intr.h | 6 +-
sys/arch/macppc/include/keyboard.h | 4 +-
sys/arch/macppc/macppc/extintr.c | 13 +-
sys/arch/macppc/macppc/machdep.c | 400 +----------------------------
sys/arch/mvmeppc/include/autoconf.h | 8 +-
sys/arch/mvmeppc/include/intr.h | 11 +-
sys/arch/mvmeppc/mvmeppc/extintr.c | 10 +-
sys/arch/mvmeppc/mvmeppc/machdep.c | 342 +-----------------------
sys/arch/ofppc/firepower/firepower.c | 11 +-
sys/arch/ofppc/include/autoconf.h | 3 -
sys/arch/ofppc/ofppc/machdep.c | 304 +---------------------
sys/arch/ofppc/ofwgen/ofwgen_intr.c | 12 +-
sys/arch/pmppc/include/intr.h | 9 +-
sys/arch/pmppc/include/pmppc.h | 8 +-
sys/arch/pmppc/pmppc/extintr.c | 10 +-
sys/arch/pmppc/pmppc/machdep.c | 342 +----------------------
sys/arch/powerpc/conf/files.powerpc | 8 +-
sys/arch/powerpc/ibm4xx/trap.c | 113 +-------
sys/arch/powerpc/include/altivec.h | 9 +-
sys/arch/powerpc/include/cpu.h | 43 ++-
sys/arch/powerpc/include/frame.h | 3 +-
sys/arch/powerpc/include/mpc6xx/bat.h | 4 +-
sys/arch/powerpc/include/pcb.h | 8 +-
sys/arch/powerpc/include/proc.h | 16 +-
sys/arch/powerpc/include/reg.h | 5 +-
sys/arch/powerpc/include/types.h | 3 +-
sys/arch/powerpc/mpc6xx/altivec.c | 14 +-
sys/arch/powerpc/mpc6xx/cpu_subr.c | 18 +-
sys/arch/powerpc/mpc6xx/genassym.cf | 3 +-
sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c | 142 ++++++++--
sys/arch/powerpc/powerpc/db_trace.c | 7 +-
sys/arch/powerpc/powerpc/fpu.c | 10 +-
sys/arch/powerpc/powerpc/powerpc_machdep.c | 16 +-
sys/arch/powerpc/powerpc/process_machdep.c | 8 +-
sys/arch/powerpc/powerpc/trap.c | 216 ++++-----------
sys/arch/powerpc/powerpc/trap_subr.S | 37 ++-
sys/arch/powerpc/powerpc/vm_machdep.c | 28 +-
sys/arch/prep/include/autoconf.h | 4 +-
sys/arch/prep/include/intr.h | 11 +-
sys/arch/prep/prep/extintr.c | 8 +-
sys/arch/prep/prep/machdep.c | 338 +-----------------------
sys/arch/sandpoint/conf/GENERIC | 3 +-
sys/arch/sandpoint/include/intr.h | 11 +-
sys/arch/sandpoint/sandpoint/machdep.c | 364 ++------------------------
sys/arch/walnut/include/intr.h | 4 +-
52 files changed, 550 insertions(+), 2797 deletions(-)
diffs (truncated from 5240 to 300 lines):
diff -r b4b1d3dfbd24 -r d281c5f1a980 sys/arch/amigappc/amigappc/machdep.c
--- a/sys/arch/amigappc/amigappc/machdep.c Fri Jul 05 18:33:20 2002 +0000
+++ b/sys/arch/amigappc/amigappc/machdep.c Fri Jul 05 18:45:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.19 2002/06/08 15:58:47 yamt Exp $ */
+/* $NetBSD: machdep.c,v 1.20 2002/07/05 18:45:15 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -416,8 +416,6 @@
}
-paddr_t msgbuf_paddr;
-
/*
* This is called during initppc, before the system is really initialized.
* It shall provide the total and the available regions of RAM.
diff -r b4b1d3dfbd24 -r d281c5f1a980 sys/arch/amigappc/include/intr.h
--- a/sys/arch/amigappc/include/intr.h Fri Jul 05 18:33:20 2002 +0000
+++ b/sys/arch/amigappc/include/intr.h Fri Jul 05 18:45:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.10 2002/02/11 11:19:29 wiz Exp $ */
+/* $NetBSD: intr.h,v 1.11 2002/07/05 18:45:16 matt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -97,14 +97,6 @@
int ih_irq;
};
-void clearsoftclock __P((void));
-int splsoftclock __P((void));
-/*
-void setsoftnet __P((void));
-*/
-void clearsoftnet __P((void));
-int splsoftnet __P((void));
-
void do_pending_int __P((void));
static __inline int splraise __P((int));
diff -r b4b1d3dfbd24 -r d281c5f1a980 sys/arch/bebox/bebox/machdep.c
--- a/sys/arch/bebox/bebox/machdep.c Fri Jul 05 18:33:20 2002 +0000
+++ b/sys/arch/bebox/bebox/machdep.c Fri Jul 05 18:45:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.72 2002/05/13 06:26:45 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.73 2002/07/05 18:45:16 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -106,23 +106,8 @@
/*
* Global variables used here and there
*/
-struct vm_map *exec_map = NULL;
-struct vm_map *mb_map = NULL;
-struct vm_map *phys_map = NULL;
-
char bootinfo[BOOTINFO_MAXSIZE];
-char machine[] = MACHINE; /* machine */
-char machine_arch[] = MACHINE_ARCH; /* machine architecture */
-
-struct pcb *curpcb;
-struct pmap *curpm;
-struct proc *fpuproc;
-
-extern struct user *proc0paddr;
-
-struct bat battable[16];
-
paddr_t bebox_mb_reg; /* BeBox MotherBoard register */
#define OFMEMREGIONS 32
@@ -130,36 +115,17 @@
char *bootpath;
-paddr_t msgbuf_paddr;
-vaddr_t msgbuf_vaddr;
-
paddr_t avail_end; /* XXX temporary */
-void install_extint __P((void (*)(void)));
+extern void *startsym, *endsym;
void
initppc(startkernel, endkernel, args, btinfo)
u_int startkernel, endkernel, args;
void *btinfo;
{
- extern int trapcode, trapsize;
- extern int alitrap, alisize;
- extern int dsitrap, dsisize;
- extern int isitrap, isisize;
- extern int decrint, decrsize;
- extern int tlbimiss, tlbimsize;
- extern int tlbdlmiss, tlbdlmsize;
- extern int tlbdsmiss, tlbdsmsize;
-#ifdef DDB
- extern int ddblow, ddbsize;
- extern void *startsym, *endsym;
-#endif
-#ifdef IPKDB
- extern int ipkdblow, ipkdbsize;
-#endif
extern void consinit __P((void));
extern void ext_intr __P((void));
- int exc, scratch;
/*
* copy bootinfo
@@ -206,13 +172,6 @@
*(volatile u_int *)(MOTHER_BOARD_REG + CPU0_INT_MASK) = 0x80000023;
*(volatile u_int *)(MOTHER_BOARD_REG + CPU1_INT_MASK) = 0x0ffffffc;
- proc0.p_addr = proc0paddr;
- memset(proc0.p_addr, 0, sizeof *proc0.p_addr);
-
- curpcb = &proc0paddr->u_pcb;
-
- curpm = curpcb->pcb_pmreal = curpcb->pcb_pm = pmap_kernel();
-
/*
* boothowto
*/
@@ -231,112 +190,17 @@
consinit();
/*
- * Initialize BAT registers to unmapped to not generate
- * overlapping mappings below.
- */
- asm volatile ("mtibatu 0,%0" :: "r"(0));
- asm volatile ("mtibatu 1,%0" :: "r"(0));
- asm volatile ("mtibatu 2,%0" :: "r"(0));
- asm volatile ("mtibatu 3,%0" :: "r"(0));
- asm volatile ("mtdbatu 0,%0" :: "r"(0));
- asm volatile ("mtdbatu 1,%0" :: "r"(0));
- asm volatile ("mtdbatu 2,%0" :: "r"(0));
- asm volatile ("mtdbatu 3,%0" :: "r"(0));
-
- /*
* Set up initial BAT table
*/
- /* map the lowest 256M area */
- battable[0x0].batl = BATL(0x00000000, BAT_M, BAT_PP_RW);
- battable[0x0].batu = BATU(0x00000000, BAT_BL_256M, BAT_Vs);
-
- /* map the PCI/ISA I/O 256M area */
- battable[0x8].batl = BATL(BEBOX_BUS_SPACE_IO, BAT_I, BAT_PP_RW);
- battable[0x8].batu = BATU(BEBOX_BUS_SPACE_IO, BAT_BL_256M, BAT_Vs);
-
- /* map the PCI/ISA MEMORY 256M area */
- battable[0xc].batl = BATL(BEBOX_BUS_SPACE_MEM, BAT_I, BAT_PP_RW);
- battable[0xc].batu = BATU(BEBOX_BUS_SPACE_MEM, BAT_BL_256M, BAT_Vs);
-
- /*
- * Now setup fixed bat registers
- */
- asm volatile ("mtibatl 0,%0; mtibatu 0,%1"
- :: "r"(battable[0x0].batl), "r"(battable[0x0].batu));
- asm volatile ("mtibatl 1,%0; mtibatu 1,%1"
- :: "r"(battable[0x8].batl), "r"(battable[0x8].batu));
- asm volatile ("mtibatl 2,%0; mtibatu 2,%1"
- :: "r"(battable[0xc].batl), "r"(battable[0xc].batu));
-
- asm volatile ("mtdbatl 0,%0; mtdbatu 0,%1"
- :: "r"(battable[0x0].batl), "r"(battable[0x0].batu));
- asm volatile ("mtdbatl 1,%0; mtdbatu 1,%1"
- :: "r"(battable[0x8].batl), "r"(battable[0x8].batu));
- asm volatile ("mtdbatl 2,%0; mtdbatu 2,%1"
- :: "r"(battable[0xc].batl), "r"(battable[0xc].batu));
+ mpc6xx_batinit(
+ BEBOX_BUS_SPACE_IO, BAT_BL_256M,
+ BEBOX_BUS_SPACE_MEM, BAT_BL_256M,
+ 0);
/*
- * Set up trap vectors
+ * Initialize the vector table and interrupt routine.
*/
- for (exc = EXC_RSVD; exc <= EXC_LAST; exc += 0x100)
- switch (exc) {
- default:
- memcpy((void *)exc, &trapcode, (size_t)&trapsize);
- break;
- case EXC_EXI:
- /*
- * This one is (potentially) installed during autoconf
- */
- break;
- case EXC_ALI:
- memcpy((void *)EXC_ALI, &alitrap, (size_t)&alisize);
- break;
- case EXC_DSI:
- memcpy((void *)EXC_DSI, &dsitrap, (size_t)&dsisize);
- break;
- case EXC_ISI:
- memcpy((void *)EXC_ISI, &isitrap, (size_t)&isisize);
- break;
- case EXC_DECR:
- memcpy((void *)EXC_DECR, &decrint, (size_t)&decrsize);
- break;
- case EXC_IMISS:
- memcpy((void *)EXC_IMISS, &tlbimiss,
- (size_t)&tlbimsize);
- break;
- case EXC_DLMISS:
- memcpy((void *)EXC_DLMISS, &tlbdlmiss,
- (size_t)&tlbdlmsize);
- break;
- case EXC_DSMISS:
- memcpy((void *)EXC_DSMISS, &tlbdsmiss,
- (size_t)&tlbdsmsize);
- break;
-#if defined(DDB) || defined(IPKDB)
- case EXC_PGM:
- case EXC_TRC:
- case EXC_BPT:
-#if defined(DDB)
- memcpy((void *)exc, &ddblow, (size_t)&ddbsize);
-#else
- memcpy((void *)exc, &ipkdblow, (size_t)&ipkdbsize);
-#endif
- break;
-#endif /* DDB || IPKDB */
- }
-
- __syncicache((void *)EXC_RST, EXC_LAST - EXC_RST + 0x100);
-
- /*
- * external interrupt handler install
- */
- install_extint(ext_intr);
-
- /*
- * Now enable translation (and machine checks/recoverable interrupts).
- */
- asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0; isync"
- : "=r"(scratch) : "K"(PSL_IR|PSL_DR|PSL_ME|PSL_RI));
+ mpc6xx_init(ext_intr);
/*
* Set the page size.
@@ -370,166 +234,28 @@
}
/*
- * This should probably be in autoconf! XXX
- */
-
-void
-install_extint(handler)
- void (*handler) __P((void));
-{
- extern int extint, extsize;
- extern u_long extint_call;
- u_long offset = (u_long)handler - (u_long)&extint_call;
- int omsr, msr;
-
-#ifdef DIAGNOSTIC
- if (offset > 0x1ffffff)
- panic("install_extint: too far away");
-#endif
- asm volatile ("mfmsr %0; andi. %1,%0,%2; mtmsr %1"
- : "=r"(omsr), "=r"(msr) : "K"((u_short)~PSL_EE));
- extint_call = (extint_call & 0xfc000003) | offset;
- memcpy((void *)EXC_EXI, &extint, (size_t)&extsize);
- __syncicache((void *)&extint_call, sizeof extint_call);
- __syncicache((void *)EXC_EXI, (int)&extsize);
- asm volatile ("mtmsr %0" :: "r"(omsr));
-}
-
-/*
* Machine dependent startup code.
*/
void
cpu_startup()
{
- int sz, i;
- caddr_t v;
- vaddr_t minaddr, maxaddr;
- int base, residual;
- char pbuf[9];
-
- proc0.p_addr = proc0paddr;
- v = (caddr_t)proc0paddr + USPACE;
-
/*
* BeBox Mother Board's Register Mapping
*/
- if (!(bebox_mb_reg = uvm_km_valloc(kernel_map, round_page(NBPG))))
- panic("initppc: no room for interrupt register");
- pmap_enter(pmap_kernel(), bebox_mb_reg, MOTHER_BOARD_REG,
- VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
- pmap_update(pmap_kernel());
-
- /*
Home |
Main Index |
Thread Index |
Old Index