Cleanup for -Wall and -Wstrict-prototypes
This commit is contained in:
parent
585e1044c8
commit
db6f1b1304
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: amiga_init.c,v 1.36 1996/03/19 11:12:10 is Exp $ */
|
||||
/* $NetBSD: amiga_init.c,v 1.37 1996/04/21 21:06:46 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Michael L. Hitch
|
||||
|
@ -105,6 +105,14 @@ static u_long boot_flags;
|
|||
u_long scsi_nosync;
|
||||
int shift_nosync;
|
||||
|
||||
void start_c __P((int, u_int, u_int, u_int, char *, u_int, u_long));
|
||||
void rollcolor __P((int));
|
||||
static int kernel_image_magic_size __P((void));
|
||||
static void kernel_image_magic_copy __P((u_char *));
|
||||
int kernel_reload_write __P((struct uio *));
|
||||
extern void kernel_reload ();
|
||||
extern void etext __P((void));
|
||||
|
||||
void *
|
||||
chipmem_steal(amount)
|
||||
long amount;
|
||||
|
@ -169,12 +177,11 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync)
|
|||
u_long inh_sync;
|
||||
{
|
||||
extern char end[];
|
||||
extern void etext();
|
||||
extern u_int protorp[2];
|
||||
struct cfdev *cd;
|
||||
u_int pstart, pend, vstart, vend, avail;
|
||||
u_int pt, ptpa, ptsize, ptextra, kstsize;
|
||||
u_int Sysptmap_pa, umap_pa;
|
||||
u_int Sysptmap_pa;
|
||||
register st_entry_t sg_proto, *sg, *esg;
|
||||
register pt_entry_t pg_proto, *pg;
|
||||
u_int tc, end_loaded, ncd, i;
|
||||
|
@ -568,7 +575,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync)
|
|||
asm volatile ("movel %0,a0; .word 0x4e7b,0x8807"
|
||||
: : "a" (Sysseg_pa) : "a0");
|
||||
asm volatile (".word 0xf518" : : );
|
||||
asm volatile ("movel #0xc000,d0; .word 0x4e7b,0x0003"
|
||||
asm volatile ("movel #0xc000,d0; .word 0x4e7b,0x0003"
|
||||
: : : "d0");
|
||||
} else
|
||||
#endif
|
||||
|
@ -726,10 +733,10 @@ kernel_reload_write(uio)
|
|||
/*
|
||||
* Pull in the exec header and check it.
|
||||
*/
|
||||
if (error = uiomove((caddr_t)&kernel_exec, sizeof(kernel_exec),
|
||||
uio))
|
||||
if ((error = uiomove((caddr_t)&kernel_exec, sizeof(kernel_exec),
|
||||
uio)) != 0)
|
||||
return(error);
|
||||
printf("loading kernel %d+%d+%d+%d\n", kernel_exec.a_text,
|
||||
printf("loading kernel %ld+%ld+%ld+%ld\n", kernel_exec.a_text,
|
||||
kernel_exec.a_data, kernel_exec.a_bss,
|
||||
esym == NULL ? 0 : kernel_exec.a_syms);
|
||||
/*
|
||||
|
@ -768,7 +775,7 @@ kernel_reload_write(uio)
|
|||
*/
|
||||
c = min(iov->iov_len, kernel_load_endseg - kernel_load_ofs);
|
||||
c = min(c, MAXPHYS);
|
||||
if (error = uiomove(kernel_image + kernel_load_ofs, (int)c, uio))
|
||||
if ((error = uiomove(kernel_image + kernel_load_ofs, (int)c, uio)) != 0)
|
||||
return(error);
|
||||
kernel_load_ofs += c;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: autoconf.c,v 1.31 1996/04/04 06:25:07 cgd Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.32 1996/04/21 21:06:49 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
|
@ -40,7 +40,6 @@
|
|||
#include <amiga/amiga/device.h>
|
||||
#include <amiga/amiga/custom.h>
|
||||
|
||||
void configure __P((void));
|
||||
void setroot __P((void));
|
||||
void swapconf __P((void));
|
||||
void mbattach __P((struct device *, struct device *, void *));
|
||||
|
@ -140,7 +139,7 @@ amiga_config_found(pcfp, pdp, auxp, pfn)
|
|||
* basically this means start attaching the grfxx's that support
|
||||
* the console. Kinda hacky but it works.
|
||||
*/
|
||||
int
|
||||
void
|
||||
config_console()
|
||||
{
|
||||
struct cfdata *cf;
|
||||
|
@ -258,18 +257,19 @@ swapconf()
|
|||
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */
|
||||
|
||||
static char devname[][2] = {
|
||||
0,0,
|
||||
0,0,
|
||||
'f','d', /* 2 = fd */
|
||||
0,0,
|
||||
's','d', /* 4 = sd -- new SCSI system */
|
||||
{ 0 ,0 },
|
||||
{ 0 ,0 },
|
||||
{ 'f' ,'d' }, /* 2 = fd */
|
||||
{ 0 ,0 },
|
||||
{ 's' ,'d' } /* 4 = sd -- new SCSI system */
|
||||
};
|
||||
|
||||
void
|
||||
setroot()
|
||||
{
|
||||
int majdev, mindev, unit, part, adaptor;
|
||||
dev_t temp, orootdev;
|
||||
dev_t temp = 0;
|
||||
dev_t orootdev;
|
||||
struct swdevt *swp;
|
||||
|
||||
if (boothowto & RB_DFLTROOT ||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cc.c,v 1.8 1996/01/28 19:49:32 chopps Exp $ */
|
||||
/* $NetBSD: cc.c,v 1.9 1996/04/21 21:06:50 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
|
@ -478,7 +478,6 @@ void *
|
|||
alloc_chipmem(size)
|
||||
u_long size;
|
||||
{
|
||||
void *mem;
|
||||
int s;
|
||||
struct mem_node *mn, *new;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cc.h,v 1.6 1994/10/26 02:01:37 cgd Exp $ */
|
||||
/* $NetBSD: cc.h,v 1.7 1996/04/21 21:06:52 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
|
@ -183,5 +183,10 @@ void * alloc_chipmem __P((u_long));
|
|||
void free_chipmem __P((void *));
|
||||
u_long avail_chipmem __P((int));
|
||||
u_long sizeof_chipmem __P((void *));
|
||||
|
||||
void wait_tof __P((void));
|
||||
void vbl_handler __P((void));
|
||||
void *chipmem_steal __P((long));
|
||||
|
||||
#endif /* _CC_H */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: conf.c,v 1.33 1996/03/14 21:22:23 christos Exp $ */
|
||||
/* $NetBSD: conf.c,v 1.34 1996/04/21 21:06:53 veego Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
|
@ -44,41 +44,27 @@
|
|||
#include <sys/vnode.h>
|
||||
#include <dev/cons.h>
|
||||
|
||||
#include <machine/conf.h>
|
||||
|
||||
#ifdef BANKEDDEVPAGER
|
||||
#include <sys/bankeddev.h>
|
||||
#endif
|
||||
|
||||
int ttselect __P((dev_t, int, struct proc *));
|
||||
|
||||
#ifndef LKM
|
||||
#define lkmenodev enodev
|
||||
#else
|
||||
int lkmenodev();
|
||||
#endif
|
||||
|
||||
bdev_decl(sw);
|
||||
#include "vnd.h"
|
||||
bdev_decl(vnd);
|
||||
#include "sd.h"
|
||||
bdev_decl(sd);
|
||||
#include "cd.h"
|
||||
bdev_decl(cd);
|
||||
#include "st.h"
|
||||
bdev_decl(st);
|
||||
#include "fd.h"
|
||||
#define fdopen Fdopen /* conflicts with fdopen() in kern_descrip.c */
|
||||
bdev_decl(fd);
|
||||
#undef fdopen
|
||||
#include "ccd.h"
|
||||
bdev_decl(ccd);
|
||||
#include "ss.h"
|
||||
|
||||
struct bdevsw bdevsw[] =
|
||||
{
|
||||
bdev_notdef(), /* 0 */
|
||||
bdev_notdef(), /* 1 */
|
||||
#define fdopen Fdopen /* conflicts with fdopen() in kern_descrip.c */
|
||||
bdev_disk_init(NFD,fd), /* 2: floppy disk */
|
||||
#undef fdopen
|
||||
bdev_swap_init(1,sw), /* 3: swap pseudo-device */
|
||||
bdev_disk_init(NSD,sd), /* 4: SCSI disk */
|
||||
bdev_tape_init(NST,st), /* 5: SCSI tape */
|
||||
|
@ -94,77 +80,19 @@ struct bdevsw bdevsw[] =
|
|||
};
|
||||
int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
|
||||
|
||||
/* open, close, ioctl, select, mmap -- XXX should be a map device */
|
||||
#define cdev_grf_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) nullop, \
|
||||
(dev_type_write((*))) nullop, dev_init(c,n,ioctl), \
|
||||
(dev_type_stop((*))) enodev, 0, dev_init(c,n,select), \
|
||||
dev_init(c,n,mmap) }
|
||||
|
||||
/* open, close, ioctl, select, mmap -- XXX should be a map device */
|
||||
#define cdev_view_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) nullop, \
|
||||
(dev_type_write((*))) nullop, dev_init(c,n,ioctl), \
|
||||
(dev_type_stop((*))) enodev, 0, dev_init(c,n,select), \
|
||||
dev_init(c,n,mmap) }
|
||||
|
||||
/* open, close, read, write, ioctl -- XXX should be a generic device */
|
||||
#define cdev_par_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
|
||||
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
|
||||
0, (dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev }
|
||||
|
||||
cdev_decl(cn);
|
||||
cdev_decl(ctty);
|
||||
#define mmread mmrw
|
||||
#define mmwrite mmrw
|
||||
cdev_decl(mm);
|
||||
cdev_decl(sw);
|
||||
#include "pty.h"
|
||||
#define ptstty ptytty
|
||||
#define ptsioctl ptyioctl
|
||||
cdev_decl(pts);
|
||||
#define ptctty ptytty
|
||||
#define ptcioctl ptyioctl
|
||||
cdev_decl(ptc);
|
||||
cdev_decl(log);
|
||||
cdev_decl(sd);
|
||||
cdev_decl(cd);
|
||||
#include "grf.h"
|
||||
cdev_decl(grf);
|
||||
#include "par.h"
|
||||
cdev_decl(par);
|
||||
#include "ser.h"
|
||||
cdev_decl(ser);
|
||||
#include "msc.h"
|
||||
cdev_decl(msc);
|
||||
#include "ite.h"
|
||||
cdev_decl(ite);
|
||||
#include "kbd.h"
|
||||
cdev_decl(kbd);
|
||||
#include "mouse.h"
|
||||
cdev_decl(ms);
|
||||
#include "view.h"
|
||||
cdev_decl(view);
|
||||
#include "mfcs.h"
|
||||
cdev_decl(mfcs);
|
||||
#define fdopen Fdopen /* conflicts with fdopen() in kern_descrip.c */
|
||||
cdev_decl(fd);
|
||||
#undef fdopen
|
||||
cdev_decl(vnd);
|
||||
cdev_decl(ccd);
|
||||
cdev_decl(st);
|
||||
dev_decl(filedesc,open);
|
||||
#include "bpfilter.h"
|
||||
cdev_decl(bpf);
|
||||
#include "tun.h"
|
||||
cdev_decl(tun);
|
||||
#ifdef LKM
|
||||
#define NLKM 1
|
||||
#else
|
||||
#define NLKM 0
|
||||
#endif
|
||||
cdev_decl(lkm);
|
||||
|
||||
struct cdevsw cdevsw[] =
|
||||
{
|
||||
|
@ -186,9 +114,7 @@ struct cdevsw cdevsw[] =
|
|||
cdev_mouse_init(NMOUSE,ms), /* 15: /dev/mouse0 /dev/mouse1 */
|
||||
cdev_view_init(NVIEW,view), /* 16: /dev/view00 /dev/view01 ... */
|
||||
cdev_tty_init(NMFCS,mfcs), /* 17: MultiFaceCard III serial */
|
||||
#define fdopen Fdopen /* conflicts with fdopen() in kern_descrip.c */
|
||||
cdev_disk_init(NFD,fd), /* 18: floppy disk */
|
||||
#undef fdopen
|
||||
cdev_disk_init(NVND,vnd), /* 19: vnode disk driver */
|
||||
cdev_tape_init(NST,st), /* 20: SCSI tape */
|
||||
cdev_fd_init(1,filedesc), /* 21: file descriptor pseudo-dev */
|
||||
|
@ -242,6 +168,7 @@ dev_t swapdev = makedev(3, 0);
|
|||
/*
|
||||
* Returns true if dev is /dev/mem or /dev/kmem.
|
||||
*/
|
||||
int
|
||||
iskmemdev(dev)
|
||||
dev_t dev;
|
||||
{
|
||||
|
@ -300,6 +227,7 @@ static int chrtoblktab[] = {
|
|||
/*
|
||||
* Convert a character device number to a block device number.
|
||||
*/
|
||||
int
|
||||
chrtoblk(dev)
|
||||
dev_t dev;
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_memrw.c,v 1.2 1996/01/28 19:43:34 chopps Exp $ */
|
||||
/* $NetBSD: db_memrw.c,v 1.3 1996/04/21 21:06:55 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Gordon W. Ross
|
||||
|
@ -40,8 +40,19 @@
|
|||
#include <vm/vm.h>
|
||||
|
||||
#include <machine/db_machdep.h>
|
||||
#include <ddb/db_sym.h>
|
||||
#include <ddb/db_output.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/pte.h>
|
||||
|
||||
static char db_read_data __P((char *src));
|
||||
void db_read_bytes __P((vm_offset_t addr, register int size, register char *data));
|
||||
static void db_write_text __P((char *dst, int ch));
|
||||
static void db_write_data __P((char *dst, int ch));
|
||||
void db_write_bytes __P((vm_offset_t addr, int size, char *data));
|
||||
|
||||
|
||||
/*
|
||||
* Read one byte somewhere in the kernel.
|
||||
* It does not matter if this is slow. -gwr
|
||||
|
@ -52,13 +63,12 @@ db_read_data(src)
|
|||
{
|
||||
u_int *pte;
|
||||
vm_offset_t pgva;
|
||||
int ch;
|
||||
|
||||
pgva = amiga_trunc_page((long)src);
|
||||
pte = kvtopte(pgva);
|
||||
|
||||
if ((*pte & PG_V) == 0) {
|
||||
db_printf(" address 0x%x not a valid page\n", src);
|
||||
db_printf(" address %p not a valid page\n", src);
|
||||
return 0;
|
||||
}
|
||||
return (*src);
|
||||
|
@ -100,18 +110,18 @@ db_write_text(dst, ch)
|
|||
pte = kvtopte((vm_offset_t)dst);
|
||||
oldpte = *pte;
|
||||
if ((oldpte & PG_V) == 0) {
|
||||
db_printf(" address 0x%x not a valid page\n", dst);
|
||||
db_printf(" address %p not a valid page\n", dst);
|
||||
return;
|
||||
}
|
||||
|
||||
/*printf("db_write_text: %x: %x = %x (%x:%x)\n", dst, *dst, ch, pte, *pte);*/
|
||||
*pte &= ~PG_RO;
|
||||
TBIS(dst);
|
||||
TBIS((vm_offset_t)dst);
|
||||
|
||||
*dst = (char) ch;
|
||||
|
||||
*pte = oldpte;
|
||||
TBIS(dst);
|
||||
TBIS((vm_offset_t)dst);
|
||||
dma_cachectl (dst, 1);
|
||||
}
|
||||
|
||||
|
@ -129,7 +139,7 @@ db_write_data(dst, ch)
|
|||
pte = kvtopte((vm_offset_t)dst);
|
||||
|
||||
if ((*pte & (PG_V | PG_RO)) != PG_V) {
|
||||
db_printf(" address 0x%x not a valid page\n", dst);
|
||||
db_printf(" address %p not a valid page\n", dst);
|
||||
return;
|
||||
}
|
||||
*dst = (char) ch;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: device.h,v 1.4 1994/10/26 02:01:48 cgd Exp $ */
|
||||
/* $NetBSD: device.h,v 1.5 1996/04/21 21:06:57 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
|
@ -37,6 +37,7 @@
|
|||
* *and know it* (i.e. everything is really tight certain params won't be
|
||||
* passed in some cases and the devices will deal with it)
|
||||
*/
|
||||
void config_console __P((void));
|
||||
int amiga_config_found __P((struct cfdata *, struct device *,
|
||||
void *, cfprint_t ));
|
||||
int simple_devprint __P((void *, char *));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: disksubr.c,v 1.22 1996/04/05 04:50:26 mhitch Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.23 1996/04/21 21:06:58 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
|
@ -38,10 +38,8 @@
|
|||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/cpu.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/dkstat.h>
|
||||
#include <amiga/amiga/adosglue.h>
|
||||
|
||||
/*
|
||||
|
@ -74,7 +72,7 @@ struct rdbmap {
|
|||
|
||||
u_long rdbchksum __P((void *));
|
||||
struct adostype getadostype __P((u_long));
|
||||
struct rdbmap *getrdbmap __P((dev_t, void (*)(), struct disklabel *,
|
||||
struct rdbmap *getrdbmap __P((dev_t, void (*)(struct buf *), struct disklabel *,
|
||||
struct cpu_disklabel *));
|
||||
|
||||
/* XXX unknown function but needed for /sys/scsi to link */
|
||||
|
@ -97,18 +95,17 @@ dk_establish(dk, dev)
|
|||
char *
|
||||
readdisklabel(dev, strat, lp, clp)
|
||||
dev_t dev;
|
||||
void (*strat)();
|
||||
void (*strat)(struct buf *);
|
||||
struct disklabel *lp;
|
||||
struct cpu_disklabel *clp;
|
||||
{
|
||||
struct adostype adt;
|
||||
struct partition *pp;
|
||||
struct partition *pp = NULL;
|
||||
struct partblock *pbp;
|
||||
struct rdblock *rbp;
|
||||
struct buf *bp;
|
||||
char *msg, *bcpls, *s, bcpli, cindex;
|
||||
int i, trypart, nopname;
|
||||
u_char fstype;
|
||||
char *msg, *bcpls, *s, bcpli;
|
||||
int cindex, i, nopname;
|
||||
u_long nextb;
|
||||
|
||||
clp->rdblock = RDBNULL;
|
||||
|
@ -202,12 +199,12 @@ readdisklabel(dev, strat, lp, clp)
|
|||
lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks;
|
||||
#ifdef DIAGNOSTIC
|
||||
if (lp->d_ncylinders != rbp->ncylinders)
|
||||
printf("warning found rdb->ncylinders(%d) != "
|
||||
"rdb->highcyl(%d) + 1\n", rbp->ncylinders,
|
||||
printf("warning found rdb->ncylinders(%ld) != "
|
||||
"rdb->highcyl(%ld) + 1\n", rbp->ncylinders,
|
||||
rbp->highcyl);
|
||||
if (lp->d_nsectors * lp->d_ntracks != rbp->secpercyl)
|
||||
printf("warning found rdb->secpercyl(%d) != "
|
||||
"rdb->nsectors(%d) * rdb->nheads(%d)\n", rbp->secpercyl,
|
||||
printf("warning found rdb->secpercyl(%ld) != "
|
||||
"rdb->nsectors(%ld) * rdb->nheads(%ld)\n", rbp->secpercyl,
|
||||
rbp->nsectors, rbp->nheads);
|
||||
#endif
|
||||
lp->d_sparespercyl =
|
||||
|
@ -320,7 +317,7 @@ readdisklabel(dev, strat, lp, clp)
|
|||
pbp->partname[pbp->partname[0] + 1] = 0;
|
||||
else
|
||||
pbp->partname[sizeof(pbp->partname) - 1] = 0;
|
||||
printf("Partition '%s' geometry %d/%d differs",
|
||||
printf("Partition '%s' geometry %ld/%ld differs",
|
||||
pbp->partname + 1, pbp->e.numheads,
|
||||
pbp->e.secpertrk);
|
||||
printf(" from RDB %d/%d\n", lp->d_ntracks,
|
||||
|
@ -453,13 +450,17 @@ setdisklabel(olp, nlp, openmask, clp)
|
|||
* this means write out the Rigid disk blocks to represent the
|
||||
* label. Hope the user was carefull.
|
||||
*/
|
||||
int
|
||||
writedisklabel(dev, strat, lp, clp)
|
||||
dev_t dev;
|
||||
void (*strat)();
|
||||
void (*strat)(struct buf *);
|
||||
register struct disklabel *lp;
|
||||
struct cpu_disklabel *clp;
|
||||
{
|
||||
struct rdbmap *bmap;
|
||||
struct buf *bp;
|
||||
bp = NULL; /* XXX */
|
||||
|
||||
return(EINVAL);
|
||||
/*
|
||||
* get write out partition list iff cpu_label is valid.
|
||||
|
@ -578,7 +579,7 @@ getadostype(dostype)
|
|||
return(adt);
|
||||
case DOST_XXXBSD:
|
||||
#ifdef DIAGNOSTIC
|
||||
printf("found dostype: 0x%x which is deprecated", dostype);
|
||||
printf("found dostype: 0x%lx which is deprecated", dostype);
|
||||
#endif
|
||||
if (b1 == 'S') {
|
||||
dostype = DOST_NBS;
|
||||
|
@ -591,12 +592,12 @@ getadostype(dostype)
|
|||
dostype |= FS_BSDFFS;
|
||||
}
|
||||
#ifdef DIAGNOSTIC
|
||||
printf(" using: 0x%x instead\n", dostype);
|
||||
printf(" using: 0x%lx instead\n", dostype);
|
||||
#endif
|
||||
return(getadostype(dostype));
|
||||
default:
|
||||
#ifdef DIAGNOSTIC
|
||||
printf("warning unknown dostype: 0x%x marking unused\n",
|
||||
printf("warning unknown dostype: 0x%lx marking unused\n",
|
||||
dostype);
|
||||
#endif
|
||||
adt.archtype = ADT_UNKNOWN;
|
||||
|
@ -612,7 +613,7 @@ getadostype(dostype)
|
|||
struct rdbmap *
|
||||
getrdbmap(dev, strat, lp, clp)
|
||||
dev_t dev;
|
||||
void (*strat)();
|
||||
void (*strat)(struct buf *);
|
||||
struct disklabel *lp;
|
||||
struct cpu_disklabel *clp;
|
||||
{
|
||||
|
@ -625,7 +626,6 @@ getrdbmap(dev, strat, lp, clp)
|
|||
|
||||
bp->b_dev = MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART);
|
||||
/* XXX finish */
|
||||
bad:
|
||||
brelse(bp);
|
||||
return(NULL);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dkbad.c,v 1.6 1994/10/26 02:01:51 cgd Exp $ */
|
||||
/* $NetBSD: dkbad.c,v 1.7 1996/04/21 21:07:00 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
|
||||
|
@ -40,14 +40,18 @@
|
|||
#include <sys/buf.h>
|
||||
#include <sys/dkbad.h>
|
||||
|
||||
int isbad __P((struct dkbad *, int, int, int));
|
||||
|
||||
/*
|
||||
* Search the bad sector table looking for
|
||||
* the specified sector. Return index if found.
|
||||
* Return -1 if not found.
|
||||
*/
|
||||
|
||||
int
|
||||
isbad(bt, cyl, trk, sec)
|
||||
register struct dkbad *bt;
|
||||
int cyl, trk, sec;
|
||||
{
|
||||
register int i;
|
||||
register long blk, bblk;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: genassym.c,v 1.24 1996/03/15 19:47:45 is Exp $ */
|
||||
/* $NetBSD: genassym.c,v 1.25 1996/04/21 21:07:01 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990 The Regents of the University of California.
|
||||
|
@ -42,6 +42,7 @@
|
|||
#include <sys/msgbuf.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
|
||||
|
@ -55,37 +56,38 @@
|
|||
#include <amiga/amiga/cia.h>
|
||||
#include <amiga/amiga/isr.h>
|
||||
|
||||
int main __P((void));
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
register struct proc *p = (struct proc *)0;
|
||||
register struct vmmeter *vm = (struct vmmeter *)0;
|
||||
register struct user *up = (struct user *)0;
|
||||
register struct rusage *rup = (struct rusage *)0;
|
||||
struct frame *frame = NULL;
|
||||
struct vmspace *vms = (struct vmspace *)0;
|
||||
pmap_t pmap = (pmap_t)0;
|
||||
struct pcb *pcb = (struct pcb *)0;
|
||||
register unsigned i;
|
||||
struct CIA *cia = (struct CIA *)0;
|
||||
struct isr *isr = (struct isr *)0;
|
||||
struct mdproc *mdproc = (struct mdproc *)0;
|
||||
|
||||
printf("#define\tP_FORW %d\n", &p->p_forw);
|
||||
printf("#define\tP_BACK %d\n", &p->p_back);
|
||||
printf("#define\tP_VMSPACE %d\n", &p->p_vmspace);
|
||||
printf("#define\tP_ADDR %d\n", &p->p_addr);
|
||||
printf("#define\tP_PRIORITY %d\n", &p->p_priority);
|
||||
printf("#define\tP_STAT %d\n", &p->p_stat);
|
||||
printf("#define\tP_WCHAN %d\n", &p->p_wchan);
|
||||
printf("#define\tP_MD %d\n", &p->p_md);
|
||||
printf("#define\tP_PID %d\n", &p->p_pid);
|
||||
printf("#define\tMD_REGS %d\n", &mdproc->md_regs);
|
||||
printf("#define\tP_FORW %p\n", (void *)&p->p_forw);
|
||||
printf("#define\tP_BACK %p\n", (void *)&p->p_back);
|
||||
printf("#define\tP_VMSPACE %p\n", (void *)&p->p_vmspace);
|
||||
printf("#define\tP_ADDR %p\n", (void *)&p->p_addr);
|
||||
printf("#define\tP_PRIORITY %p\n", (void *)&p->p_priority);
|
||||
printf("#define\tP_STAT %p\n", (void *)&p->p_stat);
|
||||
printf("#define\tP_WCHAN %p\n", (void *)&p->p_wchan);
|
||||
printf("#define\tP_MD %p\n", (void *)&p->p_md);
|
||||
printf("#define\tP_PID %p\n", (void *)&p->p_pid);
|
||||
printf("#define\tMD_REGS %p\n", (void *)&mdproc->md_regs);
|
||||
printf("#define\tSRUN %d\n", SRUN);
|
||||
|
||||
printf("#define\tPM_STCHG %d\n", &pmap->pm_stchanged);
|
||||
printf("#define\tPM_STCHG %p\n", (void *)&pmap->pm_stchanged);
|
||||
|
||||
printf("#define\tVM_PMAP %d\n", &vms->vm_pmap);
|
||||
printf("#define\tV_INTR %d\n", &vm->v_intr);
|
||||
printf("#define\tVM_PMAP %p\n", (void *)&vms->vm_pmap);
|
||||
printf("#define\tV_INTR %p\n", (void *)&vm->v_intr);
|
||||
|
||||
printf("#define\tUPAGES %d\n", UPAGES);
|
||||
printf("#define\tUSPACE %d\n", USPACE);
|
||||
|
@ -93,8 +95,9 @@ main()
|
|||
printf("#define\tPGSHIFT %d\n", PGSHIFT);
|
||||
printf("#define\tUSRSTACK %d\n", USRSTACK);
|
||||
|
||||
printf("#define\tU_PROF %d\n", &up->u_stats.p_prof);
|
||||
printf("#define\tU_PROFSCALE %d\n", &up->u_stats.p_prof.pr_scale);
|
||||
printf("#define\tU_PROF %p\n", (void *)&up->u_stats.p_prof);
|
||||
printf("#define\tU_PROFSCALE %p\n",
|
||||
(void *)&up->u_stats.p_prof.pr_scale);
|
||||
printf("#define\tT_BUSERR %d\n", T_BUSERR);
|
||||
printf("#define\tT_ADDRERR %d\n", T_ADDRERR);
|
||||
printf("#define\tT_ILLINST %d\n", T_ILLINST);
|
||||
|
@ -136,32 +139,32 @@ main()
|
|||
printf("#define\tPG_CI %d\n", PG_CI);
|
||||
printf("#define\tPG_PROT %d\n", PG_PROT);
|
||||
printf("#define\tPG_FRAME %d\n", PG_FRAME);
|
||||
printf("#define\tPCB_FLAGS %d\n", &pcb->pcb_flags);
|
||||
printf("#define\tPCB_PS %d\n", &pcb->pcb_ps);
|
||||
printf("#define\tPCB_USTP %d\n", &pcb->pcb_ustp);
|
||||
printf("#define\tPCB_USP %d\n", &pcb->pcb_usp);
|
||||
printf("#define\tPCB_REGS %d\n", pcb->pcb_regs);
|
||||
printf("#define\tPCB_CMAP2 %d\n", &pcb->pcb_cmap2);
|
||||
printf("#define\tPCB_ONFAULT %d\n", &pcb->pcb_onfault);
|
||||
printf("#define\tPCB_FPCTX %d\n", &pcb->pcb_fpregs);
|
||||
printf("#define\tPCB_FLAGS %p\n", (void *)&pcb->pcb_flags);
|
||||
printf("#define\tPCB_PS %p\n", (void *)&pcb->pcb_ps);
|
||||
printf("#define\tPCB_USTP %p\n", (void *)&pcb->pcb_ustp);
|
||||
printf("#define\tPCB_USP %p\n", (void *)&pcb->pcb_usp);
|
||||
printf("#define\tPCB_REGS %p\n", (void *)pcb->pcb_regs);
|
||||
printf("#define\tPCB_CMAP2 %p\n", (void *)&pcb->pcb_cmap2);
|
||||
printf("#define\tPCB_ONFAULT %p\n", (void *)&pcb->pcb_onfault);
|
||||
printf("#define\tPCB_FPCTX %p\n", (void *)&pcb->pcb_fpregs);
|
||||
printf("#define\tSIZEOF_PCB %d\n", sizeof(struct pcb));
|
||||
|
||||
printf("#define\tFR_SP %d\n", &frame->f_regs[15]);
|
||||
printf("#define\tFR_HW %d\n", &frame->f_sr);
|
||||
printf("#define\tFR_ADJ %d\n", &frame->f_stackadj);
|
||||
printf("#define\tFR_SP %p\n", (void *)&frame->f_regs[15]);
|
||||
printf("#define\tFR_HW %p\n", (void *)&frame->f_sr);
|
||||
printf("#define\tFR_ADJ %p\n", (void *)&frame->f_stackadj);
|
||||
|
||||
printf("#define\tSP %d\n", SP);
|
||||
printf("#define\tSYS_exit %d\n", SYS_exit);
|
||||
printf("#define\tSYS_execve %d\n", SYS_execve);
|
||||
printf("#define\tSYS_sigreturn %d\n", SYS_sigreturn);
|
||||
printf("#define\tCIAICR %d\n", &cia->icr);
|
||||
printf("#define\tAMIGA_68020 %d\n", AMIGA_68020);
|
||||
printf("#define\tAMIGA_68030 %d\n", AMIGA_68030);
|
||||
printf("#define\tAMIGA_68040 %d\n", AMIGA_68040);
|
||||
printf("#define\tAMIGA_68060 %d\n", AMIGA_68060);
|
||||
printf("#define\tISR_FORW %d\n", &isr->isr_forw);
|
||||
printf("#define\tISR_INTR %d\n", &isr->isr_intr);
|
||||
printf("#define\tISR_ARG %d\n", &isr->isr_arg);
|
||||
printf("#define\tCIAICR %p\n", (void *)&cia->icr);
|
||||
printf("#define\tAMIGA_68020 %ld\n", AMIGA_68020);
|
||||
printf("#define\tAMIGA_68030 %ld\n", AMIGA_68030);
|
||||
printf("#define\tAMIGA_68040 %ld\n", AMIGA_68040);
|
||||
printf("#define\tAMIGA_68060 %ld\n", AMIGA_68060);
|
||||
printf("#define\tISR_FORW %p\n", (void *)&isr->isr_forw);
|
||||
printf("#define\tISR_INTR %p\n", (void *)&isr->isr_intr);
|
||||
printf("#define\tISR_ARG %p\n", (void *)&isr->isr_arg);
|
||||
printf("#define\tMMU_68040 %d\n", MMU_68040);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: isr.h,v 1.7 1995/10/09 15:19:58 chopps Exp $ */
|
||||
/* $NetBSD: isr.h,v 1.8 1996/04/21 21:07:02 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982 Regents of the University of California.
|
||||
|
@ -38,7 +38,7 @@
|
|||
struct isr {
|
||||
struct isr *isr_forw;
|
||||
struct isr *isr_back;
|
||||
int (*isr_intr)();
|
||||
int (*isr_intr) __P((void *));
|
||||
void *isr_arg;
|
||||
int isr_ipl;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locore.s,v 1.49 1996/02/02 02:34:55 mycroft Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.50 1996/04/21 21:07:04 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -436,42 +436,8 @@ _trace:
|
|||
moveq #T_TRACE,d0
|
||||
jra fault
|
||||
|
||||
/*
|
||||
* The sigreturn() syscall comes here. It requires special handling
|
||||
* because we must open a hole in the stack to fill in the (possibly much
|
||||
* larger) original stack frame.
|
||||
*/
|
||||
sigreturn:
|
||||
lea sp@(-84),sp | leave enough space for largest frame
|
||||
movl sp@(84),sp@ | move up current 8 byte frame
|
||||
movl sp@(88),sp@(4)
|
||||
movl #84,sp@- | default: adjust by 84 bytes
|
||||
moveml #0xFFFF,sp@- | save user registers
|
||||
movl usp,a0 | save the user SP
|
||||
movl a0,sp@(FR_SP) | in the savearea
|
||||
movl #SYS_sigreturn,sp@- | push syscall number
|
||||
jbsr _syscall | handle it
|
||||
addql #4,sp | pop syscall#
|
||||
movl sp@(FR_SP),a0 | grab and restore
|
||||
movl a0,usp | user SP
|
||||
lea sp@(FR_HW),a1 | pointer to HW frame
|
||||
movw sp@(FR_ADJ),d0 | do we need to adjust the stack?
|
||||
jeq Lsigr1 | no, just continue
|
||||
moveq #92,d1 | total size
|
||||
subw d0,d1 | - hole size = frame size
|
||||
lea a1@(92),a0 | destination
|
||||
addw d1,a1 | source
|
||||
lsrw #1,d1 | convert to word count
|
||||
subqw #1,d1 | minus 1 for dbf
|
||||
Lsigrlp:
|
||||
movw a1@-,a0@- | copy a word
|
||||
dbf d1,Lsigrlp | continue
|
||||
movl a0,a1 | new HW frame base
|
||||
Lsigr1:
|
||||
movl a1,sp@(FR_SP) | new SP value
|
||||
moveml sp@+,#0x7FFF | restore user registers
|
||||
movl sp@,sp | and our SP
|
||||
jra rei | all done
|
||||
/* Use common m68k sigreturn */
|
||||
#include <m68k/m68k/sigreturn.s>
|
||||
|
||||
/*
|
||||
* Interrupt handlers.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.60 1996/01/04 22:21:42 jtc Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.61 1996/04/21 21:07:06 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -46,6 +46,7 @@
|
|||
#include <sys/systm.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/cpu.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
|
@ -81,6 +82,11 @@
|
|||
#include <vm/vm_object.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/vm_page.h>
|
||||
|
||||
#include <machine/db_machdep.h>
|
||||
#include <ddb/db_sym.h>
|
||||
#include <ddb/db_extern.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/reg.h>
|
||||
#include <machine/psl.h>
|
||||
|
@ -95,13 +101,47 @@
|
|||
#include "fd.h"
|
||||
#include "ser.h"
|
||||
#include "ether.h"
|
||||
|
||||
#include "ppp.h"
|
||||
|
||||
#include <net/netisr.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#ifdef INET
|
||||
#include <netinet/in.h>
|
||||
#ifdef NETHER
|
||||
#include <netinet/if_ether.h>
|
||||
#endif
|
||||
#include <netinet/ip_var.h>
|
||||
#endif
|
||||
#ifdef NS
|
||||
#include <netns/ns_var.h>
|
||||
#endif
|
||||
#ifdef ISO
|
||||
#include <netiso/iso.h>
|
||||
#include <netiso/clnp.h>
|
||||
#endif
|
||||
#if NPPP > 0
|
||||
#include <net/ppp_defs.h>
|
||||
#include <net/if_ppp.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* vm_map_t buffer_map; */
|
||||
extern vm_offset_t avail_end;
|
||||
extern vm_offset_t avail_start;
|
||||
|
||||
/* prototypes */
|
||||
void identifycpu __P((void));
|
||||
vm_offset_t reserve_dumppages __P((vm_offset_t));
|
||||
void dumpsys __P((void));
|
||||
void initcpu __P((void));
|
||||
void straytrap __P((int, u_short));
|
||||
static void netintr __P((void));
|
||||
static void call_sicallbacks __P((void));
|
||||
void intrhand __P((int));
|
||||
static void dumpmem __P((int *, int, int));
|
||||
static char *hexstr __P((int, int));
|
||||
|
||||
/*
|
||||
* Declare these as initialized data so we can patch them.
|
||||
*/
|
||||
|
@ -168,8 +208,6 @@ consinit()
|
|||
void
|
||||
cpu_startup()
|
||||
{
|
||||
extern long Usrptsize;
|
||||
extern struct map *useriomap;
|
||||
register unsigned i;
|
||||
register caddr_t v, firstaddr;
|
||||
int base, residual;
|
||||
|
@ -178,7 +216,7 @@ cpu_startup()
|
|||
int opmapdebug = pmapdebug;
|
||||
#endif
|
||||
vm_offset_t minaddr, maxaddr;
|
||||
vm_size_t size;
|
||||
vm_size_t size = 0;
|
||||
#ifdef MACHINE_NONCONTIG
|
||||
extern struct {
|
||||
vm_offset_t start;
|
||||
|
@ -356,7 +394,7 @@ again:
|
|||
#ifdef DEBUG
|
||||
pmapdebug = opmapdebug;
|
||||
#endif
|
||||
printf("avail mem = %d (%d pages)\n", ptoa(cnt.v_free_count),
|
||||
printf("avail mem = %ld (%ld pages)\n", ptoa(cnt.v_free_count),
|
||||
ptoa(cnt.v_free_count)/NBPG);
|
||||
printf("using %d buffers containing %d bytes of memory\n",
|
||||
nbuf, bufpages * CLBYTES);
|
||||
|
@ -366,13 +404,13 @@ again:
|
|||
*/
|
||||
if (memlist->m_nseg > 0 && memlist->m_nseg < 16)
|
||||
for (i = 0; i < memlist->m_nseg; i++)
|
||||
printf("memory segment %d at %08lx size %08lx\n", i,
|
||||
printf("memory segment %d at %x size %x\n", i,
|
||||
memlist->m_seg[i].ms_start,
|
||||
memlist->m_seg[i].ms_size);
|
||||
#if defined(MACHINE_NONCONTIG) && defined(DEBUG)
|
||||
printf ("Physical memory segments:\n");
|
||||
for (i = 0; phys_segs[i].start; ++i)
|
||||
printf ("Physical segment %d at %08lx size %d pages %d\n", i,
|
||||
printf ("Physical segment %d at %08lx size %ld pages %d\n", i,
|
||||
phys_segs[i].start,
|
||||
(phys_segs[i].end - phys_segs[i].start) / NBPG,
|
||||
phys_segs[i].first_page);
|
||||
|
@ -424,6 +462,7 @@ setregs(p, pack, stack, retval)
|
|||
char cpu_model[120];
|
||||
extern char version[];
|
||||
|
||||
void
|
||||
identifycpu()
|
||||
{
|
||||
/* there's alot of XXX in here... */
|
||||
|
@ -470,6 +509,7 @@ identifycpu()
|
|||
/*
|
||||
* machine dependent system variables.
|
||||
*/
|
||||
int
|
||||
cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
|
||||
int *name;
|
||||
u_int namelen;
|
||||
|
@ -573,7 +613,7 @@ sendsig(catcher, sig, mask, code)
|
|||
(void)grow(p, (unsigned)fp);
|
||||
#ifdef DEBUG
|
||||
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
|
||||
printf("sendsig(%d): sig %d ssp %x usp %x scp %x ft %d\n",
|
||||
printf("sendsig(%d): sig %d ssp %p usp %p scp %p ft %d\n",
|
||||
p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft);
|
||||
#endif
|
||||
if (useracc((caddr_t)fp, sizeof(struct sigframe), B_WRITE) == 0) {
|
||||
|
@ -644,7 +684,7 @@ sendsig(catcher, sig, mask, code)
|
|||
m68881_save(&kfp->sf_state.ss_fpstate);
|
||||
#ifdef DEBUG
|
||||
if ((sigdebug & SDB_FPSTATE) && *(char *)&kfp->sf_state.ss_fpstate)
|
||||
printf("sendsig(%d): copy out FP state (%x) to %x\n",
|
||||
printf("sendsig(%d): copy out FP state (%x) to %p\n",
|
||||
p->p_pid, *(u_int *)&kfp->sf_state.ss_fpstate,
|
||||
&kfp->sf_state.ss_fpstate);
|
||||
#endif
|
||||
|
@ -663,7 +703,7 @@ sendsig(catcher, sig, mask, code)
|
|||
frame->f_regs[SP] = (int)fp;
|
||||
#ifdef DEBUG
|
||||
if (sigdebug & SDB_FOLLOW)
|
||||
printf("sendsig(%d): sig %d scp %x fp %x sc_sp %x sc_ap %x\n",
|
||||
printf("sendsig(%d): sig %d scp %p fp %p sc_sp %x sc_ap %x\n",
|
||||
p->p_pid, sig, kfp->sf_scp, fp,
|
||||
kfp->sf_sc.sc_sp, kfp->sf_sc.sc_ap);
|
||||
#endif
|
||||
|
@ -709,7 +749,7 @@ sys_sigreturn(p, v, retval)
|
|||
scp = SCARG(uap, sigcntxp);
|
||||
#ifdef DEBUG
|
||||
if (sigdebug & SDB_FOLLOW)
|
||||
printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp);
|
||||
printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
|
||||
#endif
|
||||
if ((int)scp & 1)
|
||||
return(EINVAL);
|
||||
|
@ -761,7 +801,7 @@ sys_sigreturn(p, v, retval)
|
|||
return (EJUSTRETURN);
|
||||
#ifdef DEBUG
|
||||
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
|
||||
printf("sigreturn(%d): ssp %x usp %x scp %x ft %d\n",
|
||||
printf("sigreturn(%d): ssp %p usp %x scp %p ft %d\n",
|
||||
p->p_pid, &flags, scp->sc_sp, SCARG(uap, sigcntxp),
|
||||
(flags&SS_RTEFRAME) ? tstate.ss_frame.f_format : -1);
|
||||
#endif
|
||||
|
@ -802,7 +842,7 @@ sys_sigreturn(p, v, retval)
|
|||
m68881_restore(&tstate.ss_fpstate);
|
||||
#ifdef DEBUG
|
||||
if ((sigdebug & SDB_FPSTATE) && *(char *)&tstate.ss_fpstate)
|
||||
printf("sigreturn(%d): copied in FP state (%x) at %x\n",
|
||||
printf("sigreturn(%d): copied in FP state (%x) at %p\n",
|
||||
p->p_pid, *(u_int *)&tstate.ss_fpstate,
|
||||
&tstate.ss_fpstate);
|
||||
#endif
|
||||
|
@ -867,21 +907,23 @@ boot(howto)
|
|||
{
|
||||
/* take a snap shot before clobbering any registers */
|
||||
if (curproc)
|
||||
savectx(curproc->p_addr);
|
||||
savectx(&curproc->p_addr->u_pcb);
|
||||
|
||||
boothowto = howto;
|
||||
if ((howto&RB_NOSYNC) == 0)
|
||||
if ((howto & RB_NOSYNC) == 0)
|
||||
bootsync();
|
||||
spl7(); /* extreme priority */
|
||||
if (howto&RB_HALT) {
|
||||
if (howto & RB_HALT) {
|
||||
printf("halted\n\n");
|
||||
asm(" stop #0x2700");
|
||||
} else {
|
||||
if (howto & RB_DUMP)
|
||||
dumpsys();
|
||||
doboot();
|
||||
panic("This reboot failure should never happen");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
panic("This reboot failure should never happen");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
@ -889,6 +931,7 @@ unsigned dumpmag = 0x8fca0101; /* magic number for savecore */
|
|||
int dumpsize = 0; /* also for savecore */
|
||||
long dumplo = 0;
|
||||
|
||||
void
|
||||
dumpconf()
|
||||
{
|
||||
int nblks;
|
||||
|
@ -925,15 +968,14 @@ reserve_dumppages(p)
|
|||
return (p + BYTES_PER_DUMP);
|
||||
}
|
||||
|
||||
void
|
||||
dumpsys()
|
||||
{
|
||||
unsigned bytes, i, n;
|
||||
int range;
|
||||
int maddr, psize;
|
||||
daddr_t blkno;
|
||||
int (*dump) __P((dev_t, daddr_t, caddr_t, size_t));
|
||||
int error = 0;
|
||||
int c;
|
||||
|
||||
msgbufmapped = 0;
|
||||
if (dumpdev == NODEV)
|
||||
|
@ -946,7 +988,7 @@ dumpsys()
|
|||
dumpconf();
|
||||
if (dumplo < 0)
|
||||
return;
|
||||
printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo);
|
||||
printf("\ndumping to dev %x, offset %ld\n", dumpdev, dumplo);
|
||||
|
||||
psize = (*bdevsw[major(dumpdev)].d_psize) (dumpdev);
|
||||
printf("dump ");
|
||||
|
@ -1035,10 +1077,12 @@ microtime(tvp)
|
|||
splx(s);
|
||||
}
|
||||
|
||||
void
|
||||
initcpu()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
straytrap(pc, evec)
|
||||
int pc;
|
||||
u_short evec;
|
||||
|
@ -1050,6 +1094,7 @@ straytrap(pc, evec)
|
|||
|
||||
int *nofault;
|
||||
|
||||
int
|
||||
badaddr(addr)
|
||||
register caddr_t addr;
|
||||
{
|
||||
|
@ -1069,6 +1114,7 @@ badaddr(addr)
|
|||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
badbaddr(addr)
|
||||
register caddr_t addr;
|
||||
{
|
||||
|
@ -1088,6 +1134,7 @@ badbaddr(addr)
|
|||
return(0);
|
||||
}
|
||||
|
||||
static void
|
||||
netintr()
|
||||
{
|
||||
#ifdef INET
|
||||
|
@ -1247,7 +1294,7 @@ call_sicallbacks()
|
|||
|
||||
do {
|
||||
s = splhigh ();
|
||||
if (si = si_callbacks)
|
||||
if ((si = si_callbacks) != 0)
|
||||
si_callbacks = si->next;
|
||||
splx(s);
|
||||
|
||||
|
@ -1312,6 +1359,7 @@ remove_isr(isr)
|
|||
custom.intena = isr->isr_ipl == 6 ? INTF_EXTER : INTF_PORTS;
|
||||
}
|
||||
|
||||
void
|
||||
intrhand(sr)
|
||||
int sr;
|
||||
{
|
||||
|
@ -1339,27 +1387,33 @@ intrhand(sr)
|
|||
custom.intreq = INTF_DSKBLK;
|
||||
}
|
||||
if (ireq & INTF_SOFTINT) {
|
||||
unsigned char ssir_active;
|
||||
int s;
|
||||
|
||||
/*
|
||||
* first clear the softint-bit
|
||||
* then process all classes of softints.
|
||||
* this order is dicated by the nature of
|
||||
* software interrupts. The other order
|
||||
* allows software interrupts to be missed
|
||||
* allows software interrupts to be missed.
|
||||
* Also copy and clear ssir to prevent
|
||||
* interrupt loss.
|
||||
*/
|
||||
clrsoftint();
|
||||
if (ssir & SIR_NET) {
|
||||
siroff(SIR_NET);
|
||||
s = splhigh();
|
||||
ssir_active = ssir;
|
||||
siroff(SIR_NET | SIR_CLOCK | SIR_CBACK);
|
||||
splx(s);
|
||||
if (ssir_active & SIR_NET) {
|
||||
cnt.v_soft++;
|
||||
netintr();
|
||||
}
|
||||
if (ssir & SIR_CLOCK) {
|
||||
siroff(SIR_CLOCK);
|
||||
if (ssir_active & SIR_CLOCK) {
|
||||
cnt.v_soft++;
|
||||
/* XXXX softclock(&frame.f_stackadj); */
|
||||
softclock();
|
||||
}
|
||||
if (ssir & SIR_CBACK) {
|
||||
siroff(SIR_CBACK);
|
||||
if (ssir_active & SIR_CBACK) {
|
||||
cnt.v_soft++;
|
||||
call_sicallbacks();
|
||||
}
|
||||
|
@ -1414,7 +1468,9 @@ intrhand(sr)
|
|||
int panicbutton = 1; /* non-zero if panic buttons are enabled */
|
||||
int crashandburn = 0;
|
||||
int candbdelay = 50; /* give em half a second */
|
||||
void candbtimer __P((void));
|
||||
|
||||
void
|
||||
candbtimer()
|
||||
{
|
||||
crashandburn = 0;
|
||||
|
@ -1460,7 +1516,7 @@ nmihand(frame)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
regdump(fp, sbytes)
|
||||
struct frame *fp; /* must not be register */
|
||||
int sbytes;
|
||||
|
@ -1468,13 +1524,13 @@ regdump(fp, sbytes)
|
|||
static int doingdump = 0;
|
||||
register int i;
|
||||
int s;
|
||||
extern char *hexstr();
|
||||
|
||||
if (doingdump)
|
||||
return;
|
||||
s = splhigh();
|
||||
doingdump = 1;
|
||||
printf("pid = %d, pc = %s, ", curproc->p_pid, hexstr(fp->f_pc, 8));
|
||||
printf("pid = %d, pc = %s, ", curproc ? curproc->p_pid : 0,
|
||||
hexstr(fp->f_pc, 8));
|
||||
printf("ps = %s, ", hexstr(fp->f_sr, 4));
|
||||
printf("sfc = %s, ", hexstr(getsfc(), 4));
|
||||
printf("dfc = %s\n", hexstr(getdfc(), 4));
|
||||
|
@ -1501,14 +1557,15 @@ regdump(fp, sbytes)
|
|||
splx(s);
|
||||
}
|
||||
|
||||
#define KSADDR ((int *)((u_int)curproc->p_addr + USPACE - NBPG))
|
||||
extern u_int proc0paddr;
|
||||
#define KSADDR ((int *)((curproc ? (u_int)curproc->p_addr : proc0paddr) + USPACE - NBPG))
|
||||
|
||||
static void
|
||||
dumpmem(ptr, sz, ustack)
|
||||
register int *ptr;
|
||||
int sz;
|
||||
int sz, ustack;
|
||||
{
|
||||
register int i, val;
|
||||
extern char *hexstr();
|
||||
|
||||
for (i = 0; i < sz; i++) {
|
||||
if ((i & 7) == 0)
|
||||
|
@ -1529,9 +1586,10 @@ dumpmem(ptr, sz, ustack)
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
char *
|
||||
static char *
|
||||
hexstr(val, len)
|
||||
register int val;
|
||||
int len;
|
||||
{
|
||||
static char nbuf[9];
|
||||
register int x, i;
|
||||
|
@ -1556,6 +1614,7 @@ hexstr(val, len)
|
|||
* ZMAGIC always worked the `right' way (;-)) just ignore the missing
|
||||
* MID and proceed to new zmagic code ;-)
|
||||
*/
|
||||
int
|
||||
cpu_exec_aout_makecmds(p, epp)
|
||||
struct proc *p;
|
||||
struct exec_package *epp;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mem.c,v 1.15 1995/10/09 02:46:09 chopps Exp $ */
|
||||
/* $NetBSD: mem.c,v 1.16 1996/04/21 21:07:08 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -50,6 +50,7 @@
|
|||
#include <sys/systm.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
|
||||
|
@ -59,11 +60,18 @@ extern int kernel_reload_write(struct uio *uio);
|
|||
extern u_int lowram;
|
||||
caddr_t zeropage;
|
||||
|
||||
int mmopen __P((dev_t, int, int, struct proc *));
|
||||
int mmclose __P((dev_t, int, int, struct proc *));
|
||||
int mmrw __P((dev_t, struct uio *, int));
|
||||
int mmmmap __P((dev_t, int, int));
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mmopen(dev, flag, mode)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
mmopen(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
|
@ -71,9 +79,10 @@ mmopen(dev, flag, mode)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mmclose(dev, flag, mode)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
mmclose(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
|
@ -114,7 +123,7 @@ mmrw(dev, uio, flags)
|
|||
}
|
||||
switch (minor(dev)) {
|
||||
|
||||
/* minor device 0 is physical memory */
|
||||
/* minor device 0 is physical memory */
|
||||
case 0:
|
||||
v = uio->uio_offset;
|
||||
#ifndef DEBUG
|
||||
|
@ -134,7 +143,7 @@ mmrw(dev, uio, flags)
|
|||
(vm_offset_t)vmmap + NBPG);
|
||||
continue;
|
||||
|
||||
/* minor device 1 is kernel memory */
|
||||
/* minor device 1 is kernel memory */
|
||||
case 1:
|
||||
v = uio->uio_offset;
|
||||
c = min(iov->iov_len, MAXPHYS);
|
||||
|
@ -163,13 +172,16 @@ mmrw(dev, uio, flags)
|
|||
error = uiomove((caddr_t)v, c, uio);
|
||||
continue;
|
||||
|
||||
/* minor device 2 is EOF/RATHOLE */
|
||||
/* minor device 2 is EOF/RATHOLE */
|
||||
case 2:
|
||||
if (uio->uio_rw == UIO_WRITE)
|
||||
uio->uio_resid = 0;
|
||||
return (0);
|
||||
|
||||
/* minor device 12 (/dev/zero) is source of nulls on read, rathole on write */
|
||||
/*
|
||||
* minor device 12 (/dev/zero) is source of nulls on read,
|
||||
* rathole on write
|
||||
*/
|
||||
case 12:
|
||||
if (uio->uio_rw == UIO_WRITE) {
|
||||
c = iov->iov_len;
|
||||
|
@ -184,7 +196,11 @@ mmrw(dev, uio, flags)
|
|||
error = uiomove(zeropage, c, uio);
|
||||
continue;
|
||||
|
||||
/* minor device 20 (/dev/reload) represents magic memory which you can write a kernel image to, causing a reboot into that kernel */
|
||||
/*
|
||||
* minor device 20 (/dev/reload) represents magic memory
|
||||
* which you can write a kernel image to, causing a reboot
|
||||
* into that kernel
|
||||
*/
|
||||
case 20:
|
||||
if (uio->uio_rw == UIO_READ)
|
||||
return 0;
|
||||
|
@ -202,7 +218,6 @@ mmrw(dev, uio, flags)
|
|||
uio->uio_resid -= c;
|
||||
}
|
||||
if (minor(dev) == 0) {
|
||||
unlock:
|
||||
if (physlock > 1)
|
||||
wakeup((caddr_t)&physlock);
|
||||
physlock = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.c,v 1.28 1995/11/30 00:56:39 jtc Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.29 1996/04/21 21:07:10 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991 Regents of the University of California.
|
||||
|
@ -252,8 +252,8 @@ static vm_size_t avail_remaining;
|
|||
u_long noncontig_enable;
|
||||
#endif
|
||||
|
||||
boolean_t pmap_testbit();
|
||||
void pmap_enter_ptpage();
|
||||
boolean_t pmap_testbit __P((register vm_offset_t, int));
|
||||
void pmap_enter_ptpage __P((register pmap_t, register vm_offset_t));
|
||||
|
||||
#ifdef MACHINE_NONCONTIG
|
||||
#define pmap_valid_page(pa) (pmap_initialized && pmap_page_index(pa) >= 0)
|
||||
|
@ -262,7 +262,15 @@ void pmap_enter_ptpage();
|
|||
pa < vm_last_phys)
|
||||
#endif
|
||||
|
||||
void pmap_activate __P((register pmap_t, struct pcb *));
|
||||
extern vm_offset_t reserve_dumppages __P((vm_offset_t));
|
||||
static void amiga_protection_init __P((void));
|
||||
void pmap_check_wiring __P((char *, vm_offset_t));
|
||||
static void pmap_changebit __P((register vm_offset_t, int, boolean_t));
|
||||
#ifdef DEBUG
|
||||
void pmap_pvdump __P((vm_offset_t));
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* All those kernel PT submaps that BSD is so fond of
|
||||
|
@ -443,7 +451,7 @@ pmap_init(phys_start, phys_end)
|
|||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
#ifdef MACHINE_NONCONTIG
|
||||
printf("pmap_init(%x, %x)\n", avail_start, avail_end);
|
||||
printf("pmap_init(%lx, %lx)\n", avail_start, avail_end);
|
||||
#else
|
||||
printf("pmap_init(%x, %x)\n", phys_start, phys_end);
|
||||
#endif
|
||||
|
@ -470,9 +478,9 @@ pmap_init(phys_start, phys_end)
|
|||
panic("pmap_init: bogons in the VM system!\n");
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_INIT) {
|
||||
printf("pmap_init: Sysseg %x, Sysmap %x, Sysptmap %x\n",
|
||||
printf("pmap_init: Sysseg %p, Sysmap %p, Sysptmap %p\n",
|
||||
Sysseg, Sysmap, Sysptmap);
|
||||
printf(" pstart %x, pend %x, vstart %x, vend %x\n",
|
||||
printf(" pstart %lx, pend %lx, vstart %lx, vend %lx\n",
|
||||
avail_start, avail_end, virtual_avail, virtual_end);
|
||||
}
|
||||
#endif
|
||||
|
@ -488,7 +496,7 @@ pmap_init(phys_start, phys_end)
|
|||
npg += atop(phys_segs[i].end - phys_segs[i].start);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
printf ("pmap_init: avail_start %08x phys_segs[0].start %08x npg %d\n",
|
||||
printf ("pmap_init: avail_start %lx phys_segs[0].start %lx npg %ld\n",
|
||||
avail_start, phys_segs[0].start, npg);
|
||||
#endif
|
||||
#else
|
||||
|
@ -507,7 +515,7 @@ pmap_init(phys_start, phys_end)
|
|||
pmap_attributes = (char *) addr;
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_INIT)
|
||||
printf("pmap_init: %x bytes (%x pgs): seg %x tbl %x attr %x\n",
|
||||
printf("pmap_init: %lx bytes (%lx pgs): seg %p tbl %x attr %p\n",
|
||||
s, npg, Segtabzero, pv_table, pmap_attributes);
|
||||
#endif
|
||||
|
||||
|
@ -549,7 +557,7 @@ pmap_init(phys_start, phys_end)
|
|||
#ifdef DEBUG
|
||||
kpt_stats.kpttotal = atop(s);
|
||||
if (pmapdebug & PDB_INIT)
|
||||
printf("pmap_init: KPT: %d pages from %x to %x\n",
|
||||
printf("pmap_init: KPT: %ld pages from %lx to %lx\n",
|
||||
atop(s), addr, addr + s);
|
||||
#endif
|
||||
|
||||
|
@ -572,7 +580,7 @@ pmap_init(phys_start, phys_end)
|
|||
panic("pmap_init: cannot map range to pt_map");
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_INIT)
|
||||
printf("pmap_init: pt_map [%x - %x)\n", addr, addr2);
|
||||
printf("pmap_init: pt_map [%lx - %lx)\n", addr, addr2);
|
||||
#endif
|
||||
|
||||
#ifdef M68040
|
||||
|
@ -613,7 +621,7 @@ pmap_next_page(addrp)
|
|||
if (avail_next == phys_segs[cur_seg].end) {
|
||||
avail_next = phys_segs[++cur_seg].start;
|
||||
#ifdef DEBUG
|
||||
printf ("pmap_next_page: next %08x remain %d\n",
|
||||
printf ("pmap_next_page: next %lx remain %ld\n",
|
||||
avail_next, avail_remaining);
|
||||
#endif
|
||||
}
|
||||
|
@ -669,7 +677,7 @@ pmap_map(virt, start, end, prot)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_map(%x, %x, %x, %x)\n", virt, start, end, prot);
|
||||
printf("pmap_map(%lx, %lx, %lx, %x)\n", virt, start, end, prot);
|
||||
#endif
|
||||
while (start < end) {
|
||||
pmap_enter(pmap_kernel(), virt, start, prot, FALSE);
|
||||
|
@ -699,7 +707,7 @@ pmap_create(size)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
|
||||
printf("pmap_create(%x)\n", size);
|
||||
printf("pmap_create(%lx)\n", size);
|
||||
#endif
|
||||
/*
|
||||
* Software use map does not need a pmap
|
||||
|
@ -729,7 +737,7 @@ pmap_pinit(pmap)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
|
||||
printf("pmap_pinit(%x)\n", pmap);
|
||||
printf("pmap_pinit(%p)\n", pmap);
|
||||
#endif
|
||||
/*
|
||||
* No need to allocate page table space yet but we do need a
|
||||
|
@ -787,7 +795,7 @@ pmap_release(pmap)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_release(%x)\n", pmap);
|
||||
printf("pmap_release(%p)\n", pmap);
|
||||
#endif
|
||||
#ifdef notdef /* DIAGNOSTIC */
|
||||
/* count would be 0 from pmap_destroy... */
|
||||
|
@ -841,7 +849,7 @@ pmap_remove(pmap, sva, eva)
|
|||
u_int opte;
|
||||
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
|
||||
printf("pmap_remove(%x, %x, %x)\n", pmap, sva, eva);
|
||||
printf("pmap_remove(%x, %lx, %lx)\n", pmap, sva, eva);
|
||||
#endif
|
||||
|
||||
if (pmap == NULL)
|
||||
|
@ -884,7 +892,7 @@ pmap_remove(pmap, sva, eva)
|
|||
*/
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_REMOVE)
|
||||
printf("remove: invalidating %x\n", pte);
|
||||
printf("remove: invalidating %p\n", pte);
|
||||
#endif
|
||||
bits = *(int *)pte & (PG_U|PG_M);
|
||||
*(int *)pte = PG_NV;
|
||||
|
@ -945,7 +953,7 @@ pmap_remove(pmap, sva, eva)
|
|||
}
|
||||
#ifdef DEBUG
|
||||
if (npv == NULL) {
|
||||
printf ("pmap_remove: PA %08x index %d\n", pa, pa_index(pa));
|
||||
printf ("pmap_remove: PA %lx index %d\n", pa, pa_index(pa));
|
||||
panic("pmap_remove: PA not in pv_tab");
|
||||
}
|
||||
#endif
|
||||
|
@ -963,7 +971,7 @@ printf ("pmap_remove: PA %08x index %d\n", pa, pa_index(pa));
|
|||
#ifdef DEBUG
|
||||
remove_stats.ptinvalid++;
|
||||
if (pmapdebug & (PDB_REMOVE|PDB_PTPAGE)) {
|
||||
printf("remove: ste was %x@%x pte was %x@%x\n",
|
||||
printf("remove: ste was %x@%p pte was %x@%p\n",
|
||||
*ste, ste,
|
||||
*(int *)&opte, pmap_pte(pmap, va));
|
||||
}
|
||||
|
@ -983,7 +991,7 @@ printf ("pmap_remove: PA %08x index %d\n", pa, pa_index(pa));
|
|||
ste -= NPTEPG / SG4_LEV3SIZE;
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug &(PDB_REMOVE|PDB_SEGTAB|0x10000))
|
||||
printf("pmap_remove:PT at %x removed\n",
|
||||
printf("pmap_remove:PT at %lx removed\n",
|
||||
va);
|
||||
#endif
|
||||
}
|
||||
|
@ -998,7 +1006,7 @@ printf ("pmap_remove: PA %08x index %d\n", pa, pa_index(pa));
|
|||
if (ptpmap != pmap_kernel()) {
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_REMOVE|PDB_SEGTAB))
|
||||
printf("remove: stab %x, refcnt %d\n",
|
||||
printf("remove: stab %p, refcnt %d\n",
|
||||
ptpmap->pm_stab,
|
||||
ptpmap->pm_sref - 1);
|
||||
if ((pmapdebug & PDB_PARANOIA) &&
|
||||
|
@ -1008,7 +1016,7 @@ printf ("pmap_remove: PA %08x index %d\n", pa, pa_index(pa));
|
|||
if (--(ptpmap->pm_sref) == 0) {
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug&(PDB_REMOVE|PDB_SEGTAB))
|
||||
printf("remove: free stab %x\n",
|
||||
printf("remove: free stab %p\n",
|
||||
ptpmap->pm_stab);
|
||||
#endif
|
||||
kmem_free(kernel_map,
|
||||
|
@ -1075,8 +1083,8 @@ pmap_page_protect(pa, prot)
|
|||
|
||||
#ifdef DEBUG
|
||||
if ((pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) ||
|
||||
prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE))
|
||||
printf("pmap_page_protect(%x, %x)\n", pa, prot);
|
||||
(prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE)))
|
||||
printf("pmap_page_protect(%lx, %x)\n", pa, prot);
|
||||
#endif
|
||||
if (!pmap_valid_page(pa))
|
||||
return;
|
||||
|
@ -1098,10 +1106,10 @@ pmap_page_protect(pa, prot)
|
|||
if (!pmap_ste_v(pv->pv_pmap,pv->pv_va) ||
|
||||
pmap_pte_pa(pmap_pte(pv->pv_pmap,pv->pv_va)) != pa)
|
||||
{
|
||||
printf ("pmap_page_protect: va %08x, pmap_ste_v %d pmap_pte_pa %08x/%08x\n",
|
||||
printf ("pmap_page_protect: va %lx, pmap_ste_v %d pmap_pte_pa %08x/%lx\n",
|
||||
pv->pv_va, pmap_ste_v(pv->pv_pmap,pv->pv_va),
|
||||
pmap_pte_pa(pmap_pte(pv->pv_pmap,pv->pv_va)),pa);
|
||||
printf (" pvh %08x pv %08x pv_next %08x\n", pa_to_pvh(pa), pv, pv->pv_next);
|
||||
printf (" pvh %08x pv %08x pv_next %p\n", pa_to_pvh(pa), pv, pv->pv_next);
|
||||
panic("pmap_page_protect: bad mapping");
|
||||
}
|
||||
#endif
|
||||
|
@ -1130,7 +1138,7 @@ pmap_protect(pmap, sva, eva, prot)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT))
|
||||
printf("pmap_protect(%x, %x, %x, %x)\n", pmap, sva, eva, prot);
|
||||
printf("pmap_protect(%x, %lx, %lx, %x)\n", pmap, sva, eva, prot);
|
||||
#endif
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
@ -1214,7 +1222,7 @@ pmap_enter(pmap, va, pa, prot, wired)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
|
||||
printf("pmap_enter(%x, %x, %x, %x, %x)\n",
|
||||
printf("pmap_enter(%x, %lx, %lx, %x, %x)\n",
|
||||
pmap, va, pa, prot, wired);
|
||||
#endif
|
||||
if (pmap == NULL)
|
||||
|
@ -1243,7 +1251,7 @@ pmap_enter(pmap, va, pa, prot, wired)
|
|||
opa = pmap_pte_pa(pte);
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_ENTER)
|
||||
printf("enter: pte %x, *pte %x\n", pte, *(int *)pte);
|
||||
printf("enter: pte %p, *pte %x\n", pte, *(int *)pte);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -1259,7 +1267,7 @@ pmap_enter(pmap, va, pa, prot, wired)
|
|||
* resident as long as there are valid mappings in them.
|
||||
* Hence, if a user page is wired, the PT page will be also.
|
||||
*/
|
||||
if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
|
||||
if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_ENTER)
|
||||
printf("enter: wiring change -> %x\n", wired);
|
||||
|
@ -1288,7 +1296,7 @@ pmap_enter(pmap, va, pa, prot, wired)
|
|||
if (opa) {
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_ENTER)
|
||||
printf("enter: removing old mapping %x\n", va);
|
||||
printf("enter: removing old mapping %lx\n", va);
|
||||
#endif
|
||||
pmap_remove(pmap, va, va + PAGE_SIZE);
|
||||
#ifdef DEBUG
|
||||
|
@ -1321,7 +1329,7 @@ pmap_enter(pmap, va, pa, prot, wired)
|
|||
s = splimp();
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_ENTER)
|
||||
printf("enter: pv at %x: %x/%x/%x\n",
|
||||
printf("enter: pv at %x: %lx/%p/%p\n",
|
||||
pv, pv->pv_va, pv->pv_pmap, pv->pv_next);
|
||||
#endif
|
||||
/*
|
||||
|
@ -1447,7 +1455,7 @@ pmap_change_wiring(pmap, va, wired)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_change_wiring(%x, %x, %x)\n", pmap, va, wired);
|
||||
printf("pmap_change_wiring(%x, %lx, %x)\n", pmap, va, wired);
|
||||
#endif
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
@ -1461,7 +1469,7 @@ pmap_change_wiring(pmap, va, wired)
|
|||
*/
|
||||
if (!pmap_ste_v(pmap, va)) {
|
||||
if (pmapdebug & PDB_PARANOIA)
|
||||
printf("pmap_change_wiring: invalid STE for %x\n", va);
|
||||
printf("pmap_change_wiring: invalid STE for %lx\n", va);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
|
@ -1470,10 +1478,10 @@ pmap_change_wiring(pmap, va, wired)
|
|||
*/
|
||||
if (!pmap_pte_v(pte)) {
|
||||
if (pmapdebug & PDB_PARANOIA)
|
||||
printf("pmap_change_wiring: invalid PTE for %x\n", va);
|
||||
printf("pmap_change_wiring: invalid PTE for %lx\n", va);
|
||||
}
|
||||
#endif
|
||||
if (wired && !pmap_pte_w(pte) || !wired && pmap_pte_w(pte)) {
|
||||
if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
|
||||
if (wired)
|
||||
pmap->pm_stats.wired_count++;
|
||||
else
|
||||
|
@ -1502,7 +1510,7 @@ pmap_extract(pmap, va)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_extract(%x, %x) -> ", pmap, va);
|
||||
printf("pmap_extract(%x, %lx) -> ", pmap, va);
|
||||
#endif
|
||||
pa = 0;
|
||||
if (pmap && pmap_ste_v(pmap, va))
|
||||
|
@ -1511,7 +1519,7 @@ pmap_extract(pmap, va)
|
|||
pa = (pa & PG_FRAME) | (va & ~PG_FRAME);
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("%x\n", pa);
|
||||
printf("%lx\n", pa);
|
||||
#endif
|
||||
return(pa);
|
||||
}
|
||||
|
@ -1532,7 +1540,7 @@ void pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_copy(%x, %x, %x, %x, %x)\n",
|
||||
printf("pmap_copy(%x, %x, %lx, %lx, %lx)\n",
|
||||
dst_pmap, src_pmap, dst_addr, len, src_addr);
|
||||
#endif
|
||||
}
|
||||
|
@ -1577,7 +1585,7 @@ pmap_collect(pmap)
|
|||
|
||||
#ifdef DEBUG
|
||||
int *ste;
|
||||
int opmapdebug;
|
||||
int opmapdebug = 0;
|
||||
#endif
|
||||
if (pmap != pmap_kernel())
|
||||
return;
|
||||
|
@ -1601,7 +1609,7 @@ pmap_collect(pmap)
|
|||
do {
|
||||
if (pv->pv_ptste && pv->pv_ptpmap == pmap_kernel())
|
||||
break;
|
||||
} while (pv = pv->pv_next);
|
||||
} while ((pv = pv->pv_next) > 0);
|
||||
if (pv == NULL)
|
||||
continue;
|
||||
#ifdef DEBUG
|
||||
|
@ -1622,7 +1630,7 @@ ok:
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_PTPAGE|PDB_COLLECT)) {
|
||||
printf("collect: freeing KPT page at %x (ste %x@%x)\n",
|
||||
printf("collect: freeing KPT page at %lx (ste %x@%p)\n",
|
||||
pv->pv_va, *(int *)pv->pv_ptste, pv->pv_ptste);
|
||||
opmapdebug = pmapdebug;
|
||||
pmapdebug |= PDB_PTPAGE;
|
||||
|
@ -1651,7 +1659,7 @@ ok:
|
|||
if (kpt == (struct kpt_page *)0)
|
||||
panic("pmap_collect: lost a KPT page");
|
||||
if (pmapdebug & (PDB_PTPAGE|PDB_COLLECT))
|
||||
printf("collect: %x (%x) to free list\n",
|
||||
printf("collect: %lx (%lx) to free list\n",
|
||||
kpt->kpt_va, kpa);
|
||||
#endif
|
||||
*pkpt = kpt->kpt_next;
|
||||
|
@ -1664,11 +1672,11 @@ ok:
|
|||
pmapdebug = opmapdebug;
|
||||
|
||||
if (*ste)
|
||||
printf("collect: kernel STE at %x still valid (%x)\n",
|
||||
printf("collect: kernel STE at %p still valid (%x)\n",
|
||||
ste, *ste);
|
||||
ste = (int *)&Sysptmap[(u_int *)ste-pmap_ste(pmap_kernel(), 0)];
|
||||
if (*ste)
|
||||
printf("collect: kernel PTmap at %x still valid (%x)\n",
|
||||
printf("collect: kernel PTmap at %p still valid (%x)\n",
|
||||
ste, *ste);
|
||||
#endif
|
||||
}
|
||||
|
@ -1682,7 +1690,7 @@ pmap_activate(pmap, pcbp)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_SEGTAB))
|
||||
printf("pmap_activate(%x, %x)\n", pmap, pcbp);
|
||||
printf("pmap_activate(%x, %p)\n", pmap, pcbp);
|
||||
#endif
|
||||
PMAP_ACTIVATE(pmap, pcbp, pmap == curproc->p_vmspace->vm_map.pmap);
|
||||
}
|
||||
|
@ -1699,7 +1707,7 @@ pmap_zero_page(phys)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_zero_page(%x)\n", phys);
|
||||
printf("pmap_zero_page(%lx)\n", phys);
|
||||
#endif
|
||||
phys >>= PG_SHIFT;
|
||||
clearseg(phys);
|
||||
|
@ -1717,7 +1725,7 @@ pmap_copy_page(src, dst)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_copy_page(%x, %x)\n", src, dst);
|
||||
printf("pmap_copy_page(%lx, %lx)\n", src, dst);
|
||||
#endif
|
||||
src >>= PG_SHIFT;
|
||||
dst >>= PG_SHIFT;
|
||||
|
@ -1747,7 +1755,7 @@ pmap_pageable(pmap, sva, eva, pageable)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_pageable(%x, %x, %x, %x)\n",
|
||||
printf("pmap_pageable(%x, %lx, %lx, %x)\n",
|
||||
pmap, sva, eva, pageable);
|
||||
#endif
|
||||
/*
|
||||
|
@ -1764,7 +1772,7 @@ pmap_pageable(pmap, sva, eva, pageable)
|
|||
|
||||
#ifdef DEBUG
|
||||
if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
|
||||
printf("pmap_pageable(%x, %x, %x, %x)\n",
|
||||
printf("pmap_pageable(%x, %lx, %lx, %x)\n",
|
||||
pmap, sva, eva, pageable);
|
||||
#endif
|
||||
if (!pmap_ste_v(pmap, sva))
|
||||
|
@ -1777,7 +1785,7 @@ pmap_pageable(pmap, sva, eva, pageable)
|
|||
return;
|
||||
#ifdef DEBUG
|
||||
if (pv->pv_va != sva || pv->pv_next) {
|
||||
printf("pmap_pageable: bad PT page va %x next %x\n",
|
||||
printf("pmap_pageable: bad PT page va %lx next %p\n",
|
||||
pv->pv_va, pv->pv_next);
|
||||
return;
|
||||
}
|
||||
|
@ -1788,7 +1796,7 @@ pmap_pageable(pmap, sva, eva, pageable)
|
|||
pmap_changebit(pa, PG_M, FALSE);
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_PTPAGE)
|
||||
printf("pmap_pageable: PT page %x(%x) unmodified\n",
|
||||
printf("pmap_pageable: PT page %lx(%x) unmodified\n",
|
||||
sva, *(int *)pmap_pte(pmap, sva));
|
||||
if (pmapdebug & PDB_WIRING)
|
||||
pmap_check_wiring("pageable", sva);
|
||||
|
@ -1806,7 +1814,7 @@ pmap_clear_modify(pa)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_clear_modify(%x)\n", pa);
|
||||
printf("pmap_clear_modify(%lx)\n", pa);
|
||||
#endif
|
||||
pmap_changebit(pa, PG_M, FALSE);
|
||||
}
|
||||
|
@ -1822,7 +1830,7 @@ void pmap_clear_reference(pa)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW)
|
||||
printf("pmap_clear_reference(%x)\n", pa);
|
||||
printf("pmap_clear_reference(%lx)\n", pa);
|
||||
#endif
|
||||
pmap_changebit(pa, PG_U, FALSE);
|
||||
}
|
||||
|
@ -1841,7 +1849,7 @@ pmap_is_referenced(pa)
|
|||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW) {
|
||||
boolean_t rv = pmap_testbit(pa, PG_U);
|
||||
printf("pmap_is_referenced(%x) -> %c\n", pa, "FT"[rv]);
|
||||
printf("pmap_is_referenced(%lx) -> %c\n", pa, "FT"[rv]);
|
||||
return(rv);
|
||||
}
|
||||
#endif
|
||||
|
@ -1862,7 +1870,7 @@ pmap_is_modified(pa)
|
|||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_FOLLOW) {
|
||||
boolean_t rv = pmap_testbit(pa, PG_M);
|
||||
printf("pmap_is_modified(%x) -> %c\n", pa, "FT"[rv]);
|
||||
printf("pmap_is_modified(%lx) -> %c\n", pa, "FT"[rv]);
|
||||
return(rv);
|
||||
}
|
||||
#endif
|
||||
|
@ -1880,7 +1888,7 @@ pmap_phys_address(ppn)
|
|||
* Miscellaneous support routines follow
|
||||
*/
|
||||
|
||||
/* static */
|
||||
static void
|
||||
amiga_protection_init()
|
||||
{
|
||||
register int *kp, prot;
|
||||
|
@ -1945,7 +1953,7 @@ pmap_testbit(pa, bit)
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
/* static */
|
||||
static void
|
||||
pmap_changebit(pa, bit, setem)
|
||||
register vm_offset_t pa;
|
||||
int bit;
|
||||
|
@ -1961,7 +1969,7 @@ pmap_changebit(pa, bit, setem)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_BITS)
|
||||
printf("pmap_changebit(%x, %x, %s)\n",
|
||||
printf("pmap_changebit(%lx, %x, %s)\n",
|
||||
pa, bit, setem ? "set" : "clear");
|
||||
#endif
|
||||
if (!pmap_valid_page(pa))
|
||||
|
@ -2008,7 +2016,7 @@ pmap_changebit(pa, bit, setem)
|
|||
*/
|
||||
#ifdef M68040
|
||||
if (firstpage && mmutype == MMU_68040 &&
|
||||
(bit == PG_RO && setem || (bit & PG_CMASK))) {
|
||||
((bit == PG_RO && setem) || (bit & PG_CMASK))) {
|
||||
firstpage = FALSE;
|
||||
DCFP(pa);
|
||||
ICPP(pa);
|
||||
|
@ -2032,11 +2040,10 @@ pmap_enter_ptpage(pmap, va)
|
|||
register pv_entry_t pv;
|
||||
u_int *ste;
|
||||
int s;
|
||||
u_int sg_proto, *sg;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_FOLLOW|PDB_ENTER|PDB_PTPAGE))
|
||||
printf("pmap_enter_ptpage: pmap %x, va %x\n", pmap, va);
|
||||
printf("pmap_enter_ptpage: pmap %x, va %lx\n", pmap, va);
|
||||
enter_stats.ptpneeded++;
|
||||
#endif
|
||||
/*
|
||||
|
@ -2065,7 +2072,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
PMAP_ACTIVATE(pmap, (struct pcb *)curproc->p_addr, 1);
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
|
||||
printf("enter_pt: pmap %x stab %x(%x)\n",
|
||||
printf("enter_pt: pmap %x stab %p(%p)\n",
|
||||
pmap, pmap->pm_stab, pmap->pm_stpa);
|
||||
#endif
|
||||
}
|
||||
|
@ -2091,7 +2098,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
*ste = (u_int) addr | SG_RW | SG_U | SG_V;
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
|
||||
printf("enter_pt: alloc ste2 %d(%x)\n", ix, addr);
|
||||
printf("enter_pt: alloc ste2 %d(%p)\n", ix, addr);
|
||||
#endif
|
||||
}
|
||||
ste = pmap_ste2(pmap, va);
|
||||
|
@ -2106,7 +2113,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
ste = (u_int *)((int)ste & ~(NBPG / SG4_LEV3SIZE - 1));
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
|
||||
printf("enter_pt: ste2 %x (%x)\n",
|
||||
printf("enter_pt: ste2 %p (%p)\n",
|
||||
pmap_ste2(pmap, va), ste);
|
||||
#endif
|
||||
}
|
||||
|
@ -2147,7 +2154,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, TRUE);
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
|
||||
printf("enter_pt: add &Sysptmap[%d]: %x (KPT page %x)\n",
|
||||
printf("enter_pt: add &Sysptmap[%d]: %x (KPT page %lx)\n",
|
||||
ste - pmap_ste(pmap, 0),
|
||||
*(int *)&Sysptmap[ste - pmap_ste(pmap, 0)],
|
||||
kpt->kpt_va);
|
||||
|
@ -2166,7 +2173,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
pmap->pm_sref++;
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
|
||||
printf("enter_pt: about to fault UPT pg at %x\n", va);
|
||||
printf("enter_pt: about to fault UPT pg at %lx\n", va);
|
||||
#endif
|
||||
if (vm_fault(pt_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE)
|
||||
!= KERN_SUCCESS)
|
||||
|
@ -2189,11 +2196,11 @@ pmap_enter_ptpage(pmap, va)
|
|||
do {
|
||||
if (pv->pv_pmap == pmap_kernel() && pv->pv_va == va)
|
||||
break;
|
||||
} while (pv = pv->pv_next);
|
||||
} while ((pv = pv->pv_next) > 0);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (pv == NULL) {
|
||||
printf("enter_pt: PV entry for PT page %x not found\n", ptpa);
|
||||
printf("enter_pt: PV entry for PT page %lx not found\n", ptpa);
|
||||
panic("pmap_enter_ptpage: PT page not entered");
|
||||
}
|
||||
#endif
|
||||
|
@ -2201,7 +2208,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
pv->pv_ptpmap = pmap;
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
|
||||
printf("enter_pt: new PT page at PA %x, ste at %x\n", ptpa, ste);
|
||||
printf("enter_pt: new PT page at PA %lx, ste at %p\n", ptpa, ste);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -2227,7 +2234,7 @@ pmap_enter_ptpage(pmap, va)
|
|||
if (pmap != pmap_kernel()) {
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
|
||||
printf("enter_pt: stab %x refcnt %d\n",
|
||||
printf("enter_pt: stab %p refcnt %d\n",
|
||||
pmap->pm_stab, pmap->pm_sref);
|
||||
#endif
|
||||
}
|
||||
|
@ -2243,19 +2250,21 @@ pmap_enter_ptpage(pmap, va)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
pmap_pvdump(pa)
|
||||
vm_offset_t pa;
|
||||
{
|
||||
register pv_entry_t pv;
|
||||
|
||||
printf("pa %x", pa);
|
||||
printf("pa %lx", pa);
|
||||
for (pv = pa_to_pvh(pa); pv; pv = pv->pv_next)
|
||||
printf(" -> pmap %x, va %x, ptste %x, ptpmap %x, flags %x",
|
||||
printf(" -> pmap %p, va %lx, ptste %p, ptpmap %p, flags %x",
|
||||
pv->pv_pmap, pv->pv_va, pv->pv_ptste, pv->pv_ptpmap,
|
||||
pv->pv_flags);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void
|
||||
pmap_check_wiring(str, va)
|
||||
char *str;
|
||||
vm_offset_t va;
|
||||
|
@ -2269,7 +2278,7 @@ pmap_check_wiring(str, va)
|
|||
return;
|
||||
|
||||
if (!vm_map_lookup_entry(pt_map, va, &entry)) {
|
||||
printf("wired_check: entry for %x not found\n", va);
|
||||
printf("wired_check: entry for %lx not found\n", va);
|
||||
return;
|
||||
}
|
||||
count = 0;
|
||||
|
@ -2277,7 +2286,7 @@ pmap_check_wiring(str, va)
|
|||
if (*pte)
|
||||
count++;
|
||||
if (entry->wired_count != count)
|
||||
printf("*%s*: %x: w%d/a%d\n",
|
||||
printf("*%s*: %lx: w%d/a%d\n",
|
||||
str, va, entry->wired_count, count);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: swapgeneric.c,v 1.21 1996/03/17 05:54:41 mhitch Exp $ */
|
||||
/* $NetBSD: swapgeneric.c,v 1.22 1996/04/21 21:07:12 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||
|
@ -45,16 +45,21 @@
|
|||
#include <sys/fcntl.h> /* XXXX and all that uses it */
|
||||
#include <sys/proc.h> /* XXXX and all that uses it */
|
||||
#include <sys/disk.h>
|
||||
#include <dev/cons.h>
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include "fd.h"
|
||||
#include "sd.h"
|
||||
#include "cd.h"
|
||||
|
||||
#if NCD > 0
|
||||
int cd9660_mountroot();
|
||||
#include <sys/mount.h>
|
||||
#include <isofs/cd9660/iso.h>
|
||||
#endif
|
||||
int ffs_mountroot();
|
||||
int (*mountroot)() = ffs_mountroot;
|
||||
#include <ufs/ffs/ffs_extern.h>
|
||||
int (*mountroot) __P((void)) = ffs_mountroot;
|
||||
|
||||
void gets __P((char *));
|
||||
|
||||
/*
|
||||
* Generic configuration; all in one
|
||||
|
@ -102,6 +107,8 @@ struct genericconf genericconf[] = {
|
|||
{ 0 },
|
||||
};
|
||||
|
||||
struct genericconf * getgenconf __P((char *));
|
||||
|
||||
struct genericconf *
|
||||
getgenconf(bp)
|
||||
char *bp;
|
||||
|
@ -131,6 +138,7 @@ getgenconf(bp)
|
|||
return(gc);
|
||||
}
|
||||
|
||||
void
|
||||
setconf()
|
||||
{
|
||||
struct disk *dkp;
|
||||
|
@ -210,6 +218,7 @@ justdoswap:
|
|||
rootdev = dumpdev;
|
||||
}
|
||||
|
||||
void
|
||||
gets(cp)
|
||||
char *cp;
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sys_machdep.c,v 1.13 1995/11/30 00:56:41 jtc Exp $ */
|
||||
/* $NetBSD: sys_machdep.c,v 1.14 1996/04/21 21:07:13 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||
|
@ -119,6 +119,7 @@ vdoualarm(arg)
|
|||
/* XXX end should be */
|
||||
|
||||
/*ARGSUSED1*/
|
||||
int
|
||||
cachectl(req, addr, len)
|
||||
int req;
|
||||
caddr_t addr;
|
||||
|
@ -129,10 +130,10 @@ cachectl(req, addr, len)
|
|||
if (mmutype == MMU_68040) {
|
||||
register int inc = 0;
|
||||
int pa = 0, doall = 0;
|
||||
caddr_t end;
|
||||
caddr_t end = 0;
|
||||
|
||||
if (addr == 0 ||
|
||||
(req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG)
|
||||
((req & ~CC_EXTPURGE) != CC_PURGE && len > 2*NBPG))
|
||||
doall = 1;
|
||||
if (!doall) {
|
||||
end = addr + len;
|
||||
|
@ -230,6 +231,7 @@ cachectl(req, addr, len)
|
|||
*/
|
||||
|
||||
/*ARGSUSED1*/
|
||||
int
|
||||
dma_cachectl(addr, len)
|
||||
caddr_t addr;
|
||||
int len;
|
||||
|
@ -253,7 +255,7 @@ dma_cachectl(addr, len)
|
|||
* Convert to physical address.
|
||||
*/
|
||||
if (pa == 0 || ((int)addr & PGOFSET) == 0) {
|
||||
pa = kvtop ((vm_offset_t)addr);
|
||||
pa = kvtop (addr);
|
||||
}
|
||||
if (inc == 16) {
|
||||
DCFL(pa);
|
||||
|
@ -276,10 +278,12 @@ sys_sysarch(p, v, retval)
|
|||
void *v;
|
||||
register_t *retval;
|
||||
{
|
||||
#ifdef notyet
|
||||
struct sys_sysarch_args /* {
|
||||
syscallarg(int) op;
|
||||
syscallarg(char *) parms;
|
||||
} */ *uap = v;
|
||||
#endif
|
||||
|
||||
return ENOSYS;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: trap.c,v 1.43 1995/11/30 00:56:43 jtc Exp $ */
|
||||
/* $NetBSD: trap.c,v 1.44 1996/04/21 21:07:15 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -168,8 +168,22 @@ int mmudebug = 0;
|
|||
#endif
|
||||
|
||||
extern struct pcb *curpcb;
|
||||
int fubail();
|
||||
int subail();
|
||||
extern char fubail[], subail[];
|
||||
int _write_back __P((u_int, u_int, u_int, u_int, vm_map_t));
|
||||
static void userret __P((struct proc *, int, u_quad_t));
|
||||
void panictrap __P((int, u_int, u_int, struct frame *));
|
||||
void trapcpfault __P((struct proc *, struct frame *));
|
||||
void trapmmufault __P((int, u_int, u_int, struct frame *, struct proc *,
|
||||
u_quad_t));
|
||||
void trap __P((int, u_int, u_int, struct frame));
|
||||
#ifdef DDB
|
||||
#include <m68k/db_machdep.h>
|
||||
int kdb_trap __P((int, struct mc68020_saved_state *));
|
||||
#endif
|
||||
void syscall __P((register_t, struct frame));
|
||||
void child_return __P((struct proc *, struct frame));
|
||||
void _wb_fault __P((void));
|
||||
|
||||
|
||||
static void
|
||||
userret(p, pc, oticks)
|
||||
|
@ -261,7 +275,7 @@ trapmmufault(type, code, v, fp, p, sticks)
|
|||
u_quad_t sticks;
|
||||
{
|
||||
extern vm_map_t kernel_map;
|
||||
struct vmspace *vm;
|
||||
struct vmspace *vm = NULL;
|
||||
vm_prot_t ftype;
|
||||
vm_offset_t va;
|
||||
vm_map_t map;
|
||||
|
@ -285,10 +299,10 @@ trapmmufault(type, code, v, fp, p, sticks)
|
|||
mmudebug |= 0x100; /* XXX PAGE0 */
|
||||
#endif
|
||||
if (mmudebug && mmutype == MMU_68040) {
|
||||
printf ("68040 access error: pc %x, code %x,"
|
||||
printf("68040 access error: pc %x, code %x,"
|
||||
" ea %x, fa %x\n", fp->f_pc, code, fp->f_fmt7.f_ea, v);
|
||||
if (curpcb)
|
||||
printf (" curpcb %x ->pcb_ustp %x / %x\n",
|
||||
printf(" curpcb %p ->pcb_ustp %x / %x\n",
|
||||
curpcb, curpcb->pcb_ustp,
|
||||
curpcb->pcb_ustp << PG_SHIFT);
|
||||
#ifdef DDB /* XXX PAGE0 */
|
||||
|
@ -321,7 +335,7 @@ trapmmufault(type, code, v, fp, p, sticks)
|
|||
va = trunc_page((vm_offset_t)v);
|
||||
#ifdef DEBUG
|
||||
if (map == kernel_map && va == 0) {
|
||||
printf("trap: bad kernel access at %x\n", v);
|
||||
printf("trap: bad kernel access at %x pc %x\n", v, fp->f_pc);
|
||||
panictrap(type, code, v, fp);
|
||||
}
|
||||
#endif
|
||||
|
@ -341,14 +355,14 @@ trapmmufault(type, code, v, fp, p, sticks)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (mmudebug)
|
||||
printf("vm_fault(%x,%x,%d,0)\n", map, va, ftype);
|
||||
printf("vm_fault(%x,%lx,%d,0)\n", map, va, ftype);
|
||||
#endif
|
||||
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (mmudebug)
|
||||
printf("vmfault %s %x returned %d\n",
|
||||
printf("vmfault %s %lx returned %d\n",
|
||||
map == kernel_map ? "kernel" : "user", va, rv);
|
||||
#endif
|
||||
if (mmutype == MMU_68040) {
|
||||
|
@ -449,7 +463,7 @@ nogo:
|
|||
trapcpfault(p, fp);
|
||||
return;
|
||||
}
|
||||
printf("vm_fault(%x, %x, %x, 0) -> %x\n",
|
||||
printf("vm_fault(%x, %lx, %x, 0) -> %x\n",
|
||||
map, va, ftype, rv);
|
||||
printf(" type %x, code [mmu,,ssw]: %x\n",
|
||||
type, code);
|
||||
|
@ -466,15 +480,16 @@ nogo:
|
|||
* System calls are broken out for efficiency.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
trap(type, code, v, frame)
|
||||
int type;
|
||||
u_int code, v;
|
||||
struct frame frame;
|
||||
{
|
||||
struct proc *p;
|
||||
u_int ncode, ucode;
|
||||
u_quad_t sticks;
|
||||
int i, s;
|
||||
u_int ucode;
|
||||
u_quad_t sticks = 0;
|
||||
int i;
|
||||
#ifdef COMPAT_SUNOS
|
||||
extern struct emul emul_sunos;
|
||||
#endif
|
||||
|
@ -491,7 +506,7 @@ trap(type, code, v, frame)
|
|||
|
||||
#ifdef DDB
|
||||
if (type == T_TRACE || type == T_BREAKPOINT) {
|
||||
if (kdb_trap(type, &frame))
|
||||
if (kdb_trap(type, (db_regs_t *)&frame))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -668,6 +683,7 @@ trap(type, code, v, frame)
|
|||
/*
|
||||
* Process a system call.
|
||||
*/
|
||||
void
|
||||
syscall(code, frame)
|
||||
register_t code;
|
||||
struct frame frame;
|
||||
|
@ -839,6 +855,7 @@ child_return(p, frame)
|
|||
/*
|
||||
* Process a pending write back
|
||||
*/
|
||||
int
|
||||
_write_back (wb, wb_sts, wb_data, wb_addr, wb_map)
|
||||
u_int wb; /* writeback type: 1, 2, or 3 */
|
||||
u_int wb_sts; /* writeback status information */
|
||||
|
@ -848,7 +865,6 @@ _write_back (wb, wb_sts, wb_data, wb_addr, wb_map)
|
|||
{
|
||||
u_int wb_extra_page = 0;
|
||||
u_int wb_rc, mmusr;
|
||||
void _wb_fault (); /* fault handler for write back */
|
||||
|
||||
#ifdef DEBUG
|
||||
if (mmudebug)
|
||||
|
@ -967,7 +983,8 @@ _write_back (wb, wb_sts, wb_data, wb_addr, wb_map)
|
|||
/*
|
||||
* fault handler for write back
|
||||
*/
|
||||
void _wb_fault()
|
||||
void
|
||||
_wb_fault()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf ("trap: writeback fault\n");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vm_machdep.c,v 1.26 1996/02/05 02:06:38 christos Exp $ */
|
||||
/* $NetBSD: vm_machdep.c,v 1.27 1996/04/21 21:07:17 veego Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -59,6 +59,14 @@
|
|||
#include <vm/vm_kern.h>
|
||||
#include <machine/pte.h>
|
||||
|
||||
/* XXX - Put this in some header file? */
|
||||
void child_return __P((struct proc *, struct frame));
|
||||
void cpu_exit __P((struct proc *));
|
||||
void pagemove __P((register caddr_t, register caddr_t, size_t));
|
||||
int cpu_coredump __P((struct proc *, struct vnode *, struct ucred *,
|
||||
struct core *));
|
||||
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
* Copy and update the kernel stack and pcb, making the child
|
||||
|
@ -76,7 +84,6 @@ cpu_fork(p1, p2)
|
|||
register struct trapframe *tf;
|
||||
register struct switchframe *sf;
|
||||
extern struct pcb *curpcb;
|
||||
extern void proc_trampoline(), child_return();
|
||||
|
||||
p2->p_md.md_flags = p1->p_md.md_flags;
|
||||
|
||||
|
@ -112,17 +119,16 @@ cpu_fork(p1, p2)
|
|||
*/
|
||||
void
|
||||
cpu_set_kpc(p, pc)
|
||||
struct proc *p;
|
||||
u_int32_t pc;
|
||||
struct proc *p;
|
||||
void (*pc)(struct proc *);
|
||||
{
|
||||
struct pcb *pcbp;
|
||||
struct switchframe *sf;
|
||||
extern void proc_trampoline(), child_return();
|
||||
|
||||
pcbp = &p->p_addr->u_pcb;
|
||||
sf = (struct switchframe *)pcbp->pcb_regs[11];
|
||||
sf->sf_pc = (u_int)proc_trampoline;
|
||||
pcbp->pcb_regs[6] = pc; /* A2 */
|
||||
pcbp->pcb_regs[6] = (int)pc; /* A2 */
|
||||
pcbp->pcb_regs[7] = (int)p; /* A3 */
|
||||
}
|
||||
|
||||
|
@ -150,9 +156,10 @@ cpu_exit(p)
|
|||
* Both addresses are assumed to reside in the Sysmap,
|
||||
* and size must be a multiple of CLSIZE.
|
||||
*/
|
||||
void
|
||||
pagemove(from, to, size)
|
||||
register caddr_t from, to;
|
||||
int size;
|
||||
size_t size;
|
||||
{
|
||||
register vm_offset_t pa;
|
||||
|
||||
|
@ -183,6 +190,7 @@ pagemove(from, to, size)
|
|||
* kernel VA space at `vaddr'. Read/write and cache-inhibit status
|
||||
* are specified by `prot'.
|
||||
*/
|
||||
void
|
||||
physaccess(vaddr, paddr, size, prot)
|
||||
caddr_t vaddr, paddr;
|
||||
register int size, prot;
|
||||
|
@ -202,6 +210,7 @@ physaccess(vaddr, paddr, size, prot)
|
|||
TBIAS();
|
||||
}
|
||||
|
||||
void
|
||||
physunaccess(vaddr, size)
|
||||
caddr_t vaddr;
|
||||
register int size;
|
||||
|
@ -301,6 +310,7 @@ cpu_coredump(p, vp, cred, chdr)
|
|||
* Look at _lev6intr in locore.s for more details.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
setredzone(pte, vaddr)
|
||||
u_int *pte;
|
||||
caddr_t vaddr;
|
||||
|
@ -310,6 +320,7 @@ setredzone(pte, vaddr)
|
|||
/*
|
||||
* Convert kernel VA to physical address
|
||||
*/
|
||||
int
|
||||
kvtop(addr)
|
||||
register caddr_t addr;
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue