Clean up a lot. Run machdep.c through indent.

Remove a bunch of old debugging code and some dead code.
Put in some new comments.  Need more.
This commit is contained in:
briggs 1995-07-08 04:25:07 +00:00
parent 21d1e8d60f
commit 33cef0adfd
6 changed files with 808 additions and 1284 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.40 1995/06/30 05:23:03 briggs Exp $ */
/* $NetBSD: locore.s,v 1.41 1995/07/08 04:25:07 briggs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -807,7 +807,6 @@ _esym: .long 0
.globl _edata
.globl _etext
.globl start
.globl _gray_bar
.globl _videoaddr, _videorowbytes
.globl _videobitdepth
.globl _machineid
@ -849,7 +848,6 @@ start:
.globl _initenv, _getenvvars | in machdep.c
.globl _setmachdep | in machdep.c
.globl _printenvvars
/* Initialize source/destination control registers for movs */
moveq #FC_USERD,d0 | user space

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: macromasm.s,v 1.1 1994/12/03 23:35:04 briggs Exp $ */
/* $NetBSD: macromasm.s,v 1.2 1995/07/08 04:25:16 briggs Exp $ */
/*-
* Copyright (C) 1994 Bradley A. Grantham
@ -104,7 +104,6 @@
.text
.even
.global _gray_bar2
.global _Debugger
.global _printf

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.18 1995/06/22 03:08:29 briggs Exp $ */
/* $NetBSD: pmap.c,v 1.19 1995/07/08 04:25:18 briggs Exp $ */
/*
* Copyright (c) 1991, 1993
@ -232,7 +232,6 @@ extern vm_offset_t pager_sva, pager_eva;
#define pmap_valid_page(pa) (pmap_initialized && pmap_page_index(pa) >= 0)
void print_pmap(pmap_t pmap); /* LAK */
int pmap_page_index(vm_offset_t pa);
/*
@ -2520,53 +2519,6 @@ pmap_check_wiring(str, va)
}
#endif
/* LAK: */
void print_pmap(pmap_t pmap)
{
register pt_entry_t *pte;
vm_offset_t opa, va;
int i;
printf ("print_pmap(): [stab=%d,ptab=%d] ==\n",(int)pmap->pm_stab,(int)pmap->pm_ptab);
i = 0;
for (va = 0; va <= 4000000; va += 4096)
{
pte = pmap_pte(pmap, va);
opa = pmap_pte_pa(pte);
if (opa != 0)
{
printf ("%d -> %d (%d), ", (int)va, (int)opa, (int)pte);
if (++i == 2)
{
printf ("\n");
i=0;
}
}
}
printf ("\n\n");
}
pmap_print_debug()
{
printf ("pmap_print_debug()\n");
printf ("System segment table:\n");
hex_dump((int)Sysseg,(int)32);
printf ("System page tables (through map):\n");
hex_dump((int)Sysmap,(int)32);
printf ("System page tables (direct):\n");
hex_dump((int)Sysseg+4096,(int)32);
printf ("System page table map:\n");
hex_dump(*((int *)Sysseg+2) & PG_FRAME,(int)32);
}
pmap_check_stab()
{
if(pmap_kernel()->pm_stab != Sysseg){
printf("Uh-oh. pmap_kernel()->pm_stab != Sysseg\n");
panic("Sysseg!");
}
}
/*
* LAK: These functions are from NetBSD/i386 and are used for
* the non-contiguous memory machines, such as the IIci, IIsi, and IIvx.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.7 1995/07/06 13:30:24 briggs Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.8 1995/07/08 04:25:22 briggs Exp $ */
/*
* Copyright (c) 1991, 1993
@ -105,7 +105,7 @@ pmap_bootstrap(nextpa, firstpa)
vm_offset_t nextpa;
register vm_offset_t firstpa;
{
vm_offset_t kstpa, kptpa, vidpa, iiopa, eiopa, rompa;
vm_offset_t kstpa, kptpa, vidpa, iiopa, nbpa, rompa;
vm_offset_t kptmpa, lkptpa, p0upa;
u_int nptpages, kstsize;
caddr_t oldROMBase;
@ -122,14 +122,20 @@ pmap_bootstrap(nextpa, firstpa)
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
* vidpa internal video space for some machines
* PT pages VIDMAPSIZE pages
*
* nbpa NuBus IO space
* PT pages NBMAPSIZE pages
*
* rompa ROM space
* PT pages ROMMAPSIZE pages
*
* iiopa internal IO space
* PT pages IIOMAPSIZE pages
*
* eiopa external IO space
* PT pages EIOMAPSIZE pages
*
* [ Sysptsize is the number of pages of PT, IIOMAPSIZE and
* EIOMAPSIZE are the number of PTEs, hence we need to round
* NBMAPSIZE are the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
@ -138,8 +144,6 @@ pmap_bootstrap(nextpa, firstpa)
*
* p0upa proc 0 u-area UPAGES pages
*
* The KVA corresponding to any of these PAs is:
* (PA - firstpa + KERNBASE).
*/
if (mmutype == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
@ -153,8 +157,8 @@ pmap_bootstrap(nextpa, firstpa)
+ NPTEPG - 1) / NPTEPG;
nextpa += nptpages * NBPG;
vidpa = nextpa - VIDMAPSIZE * sizeof(pt_entry_t);
eiopa = vidpa - NBMAPSIZE * sizeof(pt_entry_t);
rompa = eiopa - ROMMAPSIZE * sizeof(pt_entry_t);
nbpa = vidpa - NBMAPSIZE * sizeof(pt_entry_t);
rompa = nbpa - ROMMAPSIZE * sizeof(pt_entry_t);
iiopa = rompa - IIOMAPSIZE * sizeof(pt_entry_t);
kptmpa = nextpa;
nextpa += NBPG;
@ -356,19 +360,46 @@ pmap_bootstrap(nextpa, firstpa)
}
pte = PA2VA(rompa, u_int *);
epte = PA2VA(eiopa, u_int *);
epte = PA2VA(nbpa, u_int *);
protopte = ((u_int) ROMBase) | PG_RO | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
pte = PA2VA(eiopa, u_int *);
epte = pte + NBMAPSIZE;
protopte = NBBASE | PG_RW | PG_V | PG_CI;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
if (nbnumranges) {
int len;
u_long offset;
for (i = 0; i < nbnumranges; i++) {
pte = (PA2VA(nbpa, u_int *))
+ mac68k_btop(nblog[i] - NBBASE);
protopte = (nbphys[i]&PG_FRAME) | PG_RW | PG_V | PG_CI;
if (nblen[i] < 0) {
len = mac68k_btop(-nblen[i]);
offset = 0;
while (len--) {
*pte++ = protopte + offset;
/* Wrap around every 32k: */
offset = (offset + NBPG) & 0x7fff;
}
} else {
len = mac68k_btop(nblen[i]);
while (len--) {
*pte++ = protopte;
protopte += NBPG;
}
}
if (pte > Sysmap) printf("Ack! Over Sysmap!\n");
}
} else {
pte = PA2VA(nbpa, u_int *);
epte = pte + NBMAPSIZE;
protopte = NBBASE | PG_RW | PG_V | PG_CI;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
}
if (mac68k_vidlog) {
@ -420,31 +451,6 @@ pmap_bootstrap(nextpa, firstpa)
if (mac68k_vidlog)
mac68k_vidlog = (u_int32_t)
mac68k_ptob(nptpages*NPTEPG - VIDMAPSIZE);
{
int len;
u_long offset;
for (i = 0; i < nbnumranges; i++) {
pte = (PA2VA(eiopa, u_int *)) + mac68k_btop(nblog[i] - NBBASE);
protopte = (nbphys[i] & PG_FRAME) | PG_RW | PG_V | PG_CI;
if (nblen[i] < 0) {
len = mac68k_btop(-nblen[i]);
offset = 0;
while (len--) {
*pte++ = protopte + offset;
/* Wrap around every 32k: */
offset = (offset + NBPG) & 0x7fff;
}
} else {
len = mac68k_btop(nblen[i]);
while (len--) {
*pte++ = protopte;
protopte += NBPG;
}
}
if (pte > Sysmap) printf("Ack! Over Sysmap!\n");
}
}
/*
* Setup u-area for process 0.

View File

@ -1,4 +1,4 @@
/* $NetBSD: via.c,v 1.22 1995/07/01 16:35:16 briggs Exp $ */
/* $NetBSD: via.c,v 1.23 1995/07/08 04:25:23 briggs Exp $ */
/*-
* Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo,
@ -350,22 +350,20 @@ via_shutdown()
}
int
rbv_vidstatus(void)
rbv_vidstatus()
{
int montype;
/*
montype = via_reg(VIA2, rMonitor) & RBVMonitorMask;
if(montype == RBVMonIDNone)
montype = RBVMonIDOff;
ddprintf("Monitor type: %d\n", montype);
return(0);
return(montype);
*/
return(0);
}
static int
scsi_irq_intr(void)
scsi_irq_intr()
{
#if NNCR96SCSI
if (mac68k_machine.scsi96) {
@ -381,7 +379,7 @@ scsi_irq_intr(void)
}
static int
scsi_drq_intr(void)
scsi_drq_intr()
{
#if NNCR96SCSI
if (mac68k_machine.scsi96) {