diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-05-02 06:44:48 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-05-02 06:44:48 +0000 |
commit | a1ab0133973a053ec8cb7034b5f525c772d2c6d6 (patch) | |
tree | 348052b6165a33d50f05b52e0989ec9095b81452 /sys/arch | |
parent | 357d854e83a35ee1bdb134546c9f0e8b086a8833 (diff) |
Sync with NetBSD 9600430. The port has gone over a major -Wall treat
Diffstat (limited to 'sys/arch')
103 files changed, 4321 insertions, 3242 deletions
diff --git a/sys/arch/amiga/amiga/amiga_init.c b/sys/arch/amiga/amiga/amiga_init.c index d05074ca9a8..4899de06ed1 100644 --- a/sys/arch/amiga/amiga/amiga_init.c +++ b/sys/arch/amiga/amiga/amiga_init.c @@ -1,5 +1,5 @@ -/* $OpenBSD: amiga_init.c,v 1.7 1996/04/21 22:14:47 deraadt Exp $ */ -/* $NetBSD: amiga_init.c,v 1.36 1996/03/19 11:12:10 is Exp $ */ +/* $OpenBSD: amiga_init.c,v 1.8 1996/05/02 06:43:09 niklas Exp $ */ +/* $NetBSD: amiga_init.c,v 1.37 1996/04/21 21:06:46 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -103,6 +103,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; @@ -167,12 +175,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; @@ -719,10 +726,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); /* @@ -761,7 +768,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; diff --git a/sys/arch/amiga/amiga/autoconf.c b/sys/arch/amiga/amiga/autoconf.c index c7955a02819..b2c5ef5681f 100644 --- a/sys/arch/amiga/amiga/autoconf.c +++ b/sys/arch/amiga/amiga/autoconf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: autoconf.c,v 1.2 1996/04/21 22:14:49 deraadt Exp $ */ -/* $NetBSD: autoconf.c,v 1.31 1996/04/04 06:25:07 cgd Exp $ */ +/* $OpenBSD: autoconf.c,v 1.3 1996/05/02 06:43:11 niklas Exp $ */ +/* $NetBSD: autoconf.c,v 1.34 1996/04/27 20:48:47 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -41,7 +41,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 *)); @@ -141,7 +140,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; @@ -202,6 +201,7 @@ mbattach(pdp, dp, auxp) config_found(dp, "ser", simple_devprint); config_found(dp, "par", simple_devprint); config_found(dp, "kbd", simple_devprint); + config_found(dp, "ms", simple_devprint); config_found(dp, "grfcc", simple_devprint); config_found(dp, "fdc", simple_devprint); if (is_a4000() || is_a1200()) @@ -259,18 +259,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 || diff --git a/sys/arch/amiga/amiga/cc.c b/sys/arch/amiga/amiga/cc.c index a9871c09a56..f04b5420444 100644 --- a/sys/arch/amiga/amiga/cc.c +++ b/sys/arch/amiga/amiga/cc.c @@ -1,4 +1,5 @@ -/* $NetBSD: cc.c,v 1.7 1994/10/26 02:01:36 cgd Exp $ */ +/* $OpenBSD: cc.c,v 1.4 1996/05/02 06:43:12 niklas Exp $ */ +/* $NetBSD: cc.c,v 1.9 1996/04/21 21:06:50 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -497,7 +498,6 @@ void * alloc_chipmem(size) u_long size; { - void *mem; int s; struct mem_node *mn, *new; diff --git a/sys/arch/amiga/amiga/cc.h b/sys/arch/amiga/amiga/cc.h index 29464e78142..9f88f467a24 100644 --- a/sys/arch/amiga/amiga/cc.h +++ b/sys/arch/amiga/amiga/cc.h @@ -1,4 +1,5 @@ -/* $NetBSD: cc.h,v 1.6 1994/10/26 02:01:37 cgd Exp $ */ +/* $OpenBSD: cc.h,v 1.3 1996/05/02 06:43:13 niklas Exp $ */ +/* $NetBSD: cc.h,v 1.7 1996/04/21 21:06:52 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -185,5 +186,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 */ diff --git a/sys/arch/amiga/amiga/conf.c b/sys/arch/amiga/amiga/conf.c index 9fdc17d70f0..1d65059f552 100644 --- a/sys/arch/amiga/amiga/conf.c +++ b/sys/arch/amiga/amiga/conf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: conf.c,v 1.5 1996/04/27 18:38:45 niklas Exp $ */ -/* $NetBSD: conf.c,v 1.33 1996/03/14 21:22:23 christos Exp $ */ +/* $OpenBSD: conf.c,v 1.6 1996/05/02 06:43:13 niklas Exp $ */ +/* $NetBSD: conf.c,v 1.35 1996/04/27 20:48:50 veego Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -45,41 +45,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 */ @@ -95,96 +81,26 @@ 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 } - -/* open, close, write, ioctl */ -#define cdev_lpt_init(c,n) { \ - dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ - dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \ - 0, seltrue, (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 "ms.h" #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); - -/* open, close, read, ioctl */ -cdev_decl(ipl); #ifdef IPFILTER #define NIPF 1 #else #define NIPF 0 #endif - #include "com.h" -cdev_decl(com); #include "lpt.h" -cdev_decl(lpt); struct cdevsw cdevsw[] = { @@ -203,12 +119,10 @@ struct cdevsw cdevsw[] = cdev_tty_init(NSER,ser), /* 12: built-in single-port serial */ cdev_tty_init(NITE,ite), /* 13: console terminal emulator */ cdev_mouse_init(NKBD,kbd), /* 14: /dev/kbd */ - cdev_mouse_init(NMOUSE,ms), /* 15: /dev/mouse0 /dev/mouse1 */ + cdev_mouse_init(NMS,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 */ @@ -265,6 +179,7 @@ dev_t swapdev = makedev(3, 0); /* * Returns true if dev is /dev/mem or /dev/kmem. */ +int iskmemdev(dev) dev_t dev; { @@ -323,6 +238,7 @@ static int chrtoblktab[] = { /* * Convert a character device number to a block device number. */ +int chrtoblk(dev) dev_t dev; { diff --git a/sys/arch/amiga/amiga/db_memrw.c b/sys/arch/amiga/amiga/db_memrw.c index b41200af49e..6f4b7db6e4f 100644 --- a/sys/arch/amiga/amiga/db_memrw.c +++ b/sys/arch/amiga/amiga/db_memrw.c @@ -1,4 +1,5 @@ -/* $NetBSD: db_memrw.c,v 1.1 1995/02/13 00:27:37 chopps Exp $ */ +/* $OpenBSD: db_memrw.c,v 1.3 1996/05/02 06:43:14 niklas Exp $ */ +/* $NetBSD: db_memrw.c,v 1.3 1996/04/21 21:06:55 veego Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -40,8 +41,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 +64,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 +111,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 +140,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; diff --git a/sys/arch/amiga/amiga/device.h b/sys/arch/amiga/amiga/device.h index 11d64f06ed4..5f2344dd7db 100644 --- a/sys/arch/amiga/amiga/device.h +++ b/sys/arch/amiga/amiga/device.h @@ -1,4 +1,5 @@ -/* $NetBSD: device.h,v 1.4 1994/10/26 02:01:48 cgd Exp $ */ +/* $OpenBSD: device.h,v 1.2 1996/05/02 06:43:15 niklas Exp $ */ +/* $NetBSD: device.h,v 1.5 1996/04/21 21:06:57 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -37,6 +38,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 *)); diff --git a/sys/arch/amiga/amiga/disksubr.c b/sys/arch/amiga/amiga/disksubr.c index 95030a86692..554e0e18717 100644 --- a/sys/arch/amiga/amiga/disksubr.c +++ b/sys/arch/amiga/amiga/disksubr.c @@ -1,5 +1,5 @@ -/* $OpenBSD: disksubr.c,v 1.3 1996/04/21 22:14:50 deraadt Exp $ */ -/* $NetBSD: disksubr.c,v 1.22 1996/04/05 04:50:26 mhitch Exp $ */ +/* $OpenBSD: disksubr.c,v 1.4 1996/05/02 06:43:15 niklas Exp $ */ +/* $NetBSD: disksubr.c,v 1.24 1996/04/29 06:15:32 mhitch Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -39,10 +39,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> /* @@ -75,7 +73,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 */ @@ -98,18 +96,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; @@ -203,12 +200,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 = @@ -321,7 +318,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, @@ -389,7 +386,7 @@ readdisklabel(dev, strat, lp, clp) /* * store this partitions block number */ - clp->pblist[clp->pbindex[i] = cindex++]; + clp->pblist[clp->pbindex[i] = cindex++] = nextb; } /* * calulate new checksum. @@ -454,13 +451,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. @@ -579,7 +580,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; @@ -592,12 +593,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; @@ -613,7 +614,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; { @@ -626,7 +627,6 @@ getrdbmap(dev, strat, lp, clp) bp->b_dev = MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART); /* XXX finish */ -bad: brelse(bp); return(NULL); } diff --git a/sys/arch/amiga/amiga/dkbad.c b/sys/arch/amiga/amiga/dkbad.c index 2ae33aa01ce..00cfee99b06 100644 --- a/sys/arch/amiga/amiga/dkbad.c +++ b/sys/arch/amiga/amiga/dkbad.c @@ -1,4 +1,5 @@ -/* $NetBSD: dkbad.c,v 1.6 1994/10/26 02:01:51 cgd Exp $ */ +/* $OpenBSD: dkbad.c,v 1.2 1996/05/02 06:43:16 niklas 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 +41,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; diff --git a/sys/arch/amiga/amiga/genassym.c b/sys/arch/amiga/amiga/genassym.c index d3d2c1365ce..dd6216565f0 100644 --- a/sys/arch/amiga/amiga/genassym.c +++ b/sys/arch/amiga/amiga/genassym.c @@ -1,5 +1,5 @@ -/* $OpenBSD: genassym.c,v 1.4 1996/03/30 22:18:07 niklas Exp $ */ -/* $NetBSD: genassym.c,v 1.24 1996/03/15 19:47:45 is Exp $ */ +/* $OpenBSD: genassym.c,v 1.5 1996/05/02 06:43:17 niklas 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. @@ -43,6 +43,7 @@ #include <sys/msgbuf.h> #include <sys/syscall.h> #include <sys/user.h> +#include <sys/systm.h> #include <vm/vm.h> @@ -56,37 +57,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); @@ -94,8 +96,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); @@ -138,32 +141,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); } diff --git a/sys/arch/amiga/amiga/isr.h b/sys/arch/amiga/amiga/isr.h index 6ffca5b0134..b6369d54bc2 100644 --- a/sys/arch/amiga/amiga/isr.h +++ b/sys/arch/amiga/amiga/isr.h @@ -1,4 +1,5 @@ -/* $NetBSD: isr.h,v 1.7 1995/10/09 15:19:58 chopps Exp $ */ +/* $OpenBSD: isr.h,v 1.3 1996/05/02 06:43:18 niklas 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 +39,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; #if defined(IPL_REMAP_1) || defined(IPL_REMAP_2) diff --git a/sys/arch/amiga/amiga/locore.s b/sys/arch/amiga/amiga/locore.s index 99adab4abb6..443b93fa089 100644 --- a/sys/arch/amiga/amiga/locore.s +++ b/sys/arch/amiga/amiga/locore.s @@ -1,5 +1,5 @@ -/* $OpenBSD: locore.s,v 1.5 1996/02/26 21:31:00 niklas Exp $ */ -/* $NetBSD: locore.s,v 1.48 1995/12/11 02:37:59 thorpej Exp $ */ +/* $OpenBSD: locore.s,v 1.6 1996/05/02 06:43:18 niklas Exp $ */ +/* $NetBSD: locore.s,v 1.50 1996/04/21 21:07:04 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -439,42 +439,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. diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index 9b3bd77a769..788bad19ef5 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -1,5 +1,5 @@ -/* $OpenBSD: machdep.c,v 1.7 1996/04/27 18:38:46 niklas Exp $ */ -/* $NetBSD: machdep.c,v 1.59 1995/10/09 04:33:58 chopps Exp $ */ +/* $OpenBSD: machdep.c,v 1.8 1996/05/02 06:43:20 niklas Exp $ */ +/* $NetBSD: machdep.c,v 1.64 1996/04/28 06:57:15 mhitch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -47,6 +47,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> @@ -82,6 +83,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> @@ -96,13 +102,53 @@ #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)); +#if NSER > 0 +void ser_outintr __P((void)); +#endif +#if NFD > 0 +void fdintr __P((int)); +#endif + /* * Declare these as initialized data so we can patch them. */ @@ -253,8 +299,6 @@ consinit() void cpu_startup() { - extern long Usrptsize; - extern struct map *useriomap; register unsigned i; register caddr_t v, firstaddr; int base, residual; @@ -263,8 +307,8 @@ cpu_startup() int opmapdebug = pmapdebug; #endif vm_offset_t minaddr, maxaddr; - vm_size_t size; -#ifdef MACHINE_NONCONTIG + vm_size_t size = 0; +#if defined(MACHINE_NONCONTIG) && defined(DEBUG) extern struct { vm_offset_t start; vm_offset_t end; @@ -441,7 +485,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); @@ -451,13 +495,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); @@ -520,6 +564,7 @@ setregs(p, pack, stack, retval) char cpu_model[120]; extern char version[]; +void identifycpu() { /* there's alot of XXX in here... */ @@ -566,6 +611,7 @@ identifycpu() /* * machine dependent system variables. */ +int cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) int *name; u_int namelen; @@ -669,7 +715,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) { @@ -740,7 +786,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 @@ -759,7 +805,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 @@ -805,7 +851,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); @@ -857,7 +903,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 @@ -898,7 +944,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 @@ -957,34 +1003,42 @@ bootsync(void) } } + void boot(howto) register int 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) { - printf("halted\n\n"); + + /* Disable interrupts. */ + spl7(); + + /* If rebooting and a dump is requested do it. */ + if (howto & RB_DUMP) + dumpsys(); + + if (howto & RB_HALT) { + printf("System halted.\n\n"); asm(" stop #0x2700"); - } else { - if (howto & RB_DUMP) - dumpsys(); - doboot(); /*NOTREACHED*/ } + + doboot(); /*NOTREACHED*/ } + unsigned dumpmag = 0x8fca0101; /* magic number for savecore */ int dumpsize = 0; /* also for savecore */ long dumplo = 0; +void dumpconf() { int nblks; @@ -1021,15 +1075,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) @@ -1042,7 +1095,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 "); @@ -1131,10 +1184,12 @@ microtime(tvp) splx(s); } +void initcpu() { } +void straytrap(pc, evec) int pc; u_short evec; @@ -1146,6 +1201,7 @@ straytrap(pc, evec) int *nofault; +int badaddr(addr) register caddr_t addr; { @@ -1165,6 +1221,7 @@ badaddr(addr) return(0); } +int badbaddr(addr) register caddr_t addr; { @@ -1184,6 +1241,7 @@ badbaddr(addr) return(0); } +static void netintr() { #ifdef INET @@ -1349,8 +1407,7 @@ call_sicallbacks() do { s = splhigh (); - si = si_callbacks; - if (si) + if ((si = si_callbacks) != 0) si_callbacks = si->next; splx(s); @@ -1443,6 +1500,7 @@ remove_isr(isr) #endif } +void intrhand(sr) int sr; { @@ -1470,27 +1528,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 dictated 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(); } @@ -1545,7 +1609,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; @@ -1591,7 +1657,7 @@ nmihand(frame) } #endif - +void regdump(fp, sbytes) struct frame *fp; /* must not be register */ int sbytes; @@ -1599,13 +1665,13 @@ regdump(fp, sbytes) static int doingdump = 0; register int i; int s; - extern char *hexstr(); if (doingdump) return; s = spl7(); 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)); @@ -1632,14 +1698,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) @@ -1660,9 +1727,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; @@ -1687,6 +1755,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; diff --git a/sys/arch/amiga/amiga/mem.c b/sys/arch/amiga/amiga/mem.c index 50f5cad9ba9..62ea3a46404 100644 --- a/sys/arch/amiga/amiga/mem.c +++ b/sys/arch/amiga/amiga/mem.c @@ -1,4 +1,5 @@ -/* $NetBSD: mem.c,v 1.15 1995/10/09 02:46:09 chopps Exp $ */ +/* $OpenBSD: mem.c,v 1.2 1996/05/02 06:43:21 niklas Exp $ */ +/* $NetBSD: mem.c,v 1.17 1996/04/23 05:14:40 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,6 +51,7 @@ #include <sys/systm.h> #include <sys/uio.h> #include <sys/malloc.h> +#include <sys/proc.h> #include <machine/cpu.h> @@ -59,11 +61,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 +80,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 +124,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 +144,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 +173,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 +197,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 +219,9 @@ mmrw(dev, uio, flags) uio->uio_resid -= c; } if (minor(dev) == 0) { +#ifndef DEBUG unlock: +#endif if (physlock > 1) wakeup((caddr_t)&physlock); physlock = 0; diff --git a/sys/arch/amiga/amiga/pmap.c b/sys/arch/amiga/amiga/pmap.c index 6f0249d433b..272f200024c 100644 --- a/sys/arch/amiga/amiga/pmap.c +++ b/sys/arch/amiga/amiga/pmap.c @@ -1,4 +1,5 @@ -/* $NetBSD: pmap.c,v 1.27.2.1 1995/11/10 16:10:00 chopps Exp $ */ +/* $OpenBSD: pmap.c,v 1.5 1996/05/02 06:43:22 niklas Exp $ */ +/* $NetBSD: pmap.c,v 1.30 1996/04/28 06:59:08 mhitch Exp $ */ /* * Copyright (c) 1991 Regents of the University of California. @@ -252,8 +253,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 +263,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 +452,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 +479,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 +497,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 +516,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 %p attr %p\n", s, npg, Segtabzero, pv_table, pmap_attributes); #endif @@ -549,7 +558,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 @@ -573,7 +582,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 @@ -614,7 +623,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 } @@ -670,7 +679,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); @@ -700,7 +709,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 @@ -730,7 +739,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 @@ -762,7 +771,7 @@ pmap_destroy(pmap) #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) - printf("pmap_destroy(%x)\n", pmap); + printf("pmap_destroy(%p)\n", pmap); #endif if (pmap == NULL) return; @@ -788,7 +797,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... */ @@ -812,7 +821,7 @@ pmap_reference(pmap) { #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) - printf("pmap_reference(%x)\n", pmap); + printf("pmap_reference(%p)\n", pmap); #endif if (pmap != NULL) { simple_lock(&pmap->pm_lock); @@ -842,7 +851,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(%p, %lx, %lx)\n", pmap, sva, eva); #endif if (pmap == NULL) @@ -885,7 +894,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; @@ -946,7 +955,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 @@ -964,7 +973,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)); } @@ -984,7 +993,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 } @@ -999,7 +1008,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) && @@ -1009,7 +1018,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, @@ -1076,8 +1085,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; @@ -1099,10 +1108,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 %p pv %p pv_next %p\n", pa_to_pvh(pa), pv, pv->pv_next); panic("pmap_page_protect: bad mapping"); } #endif @@ -1131,7 +1140,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(%p, %lx, %lx, %x)\n", pmap, sva, eva, prot); #endif if (pmap == NULL) return; @@ -1215,7 +1224,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(%p, %lx, %lx, %x, %x)\n", pmap, va, pa, prot, wired); #endif if (pmap == NULL) @@ -1244,7 +1253,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 /* @@ -1260,7 +1269,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); @@ -1289,7 +1298,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 @@ -1322,7 +1331,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 %p: %lx/%p/%p\n", pv, pv->pv_va, pv->pv_pmap, pv->pv_next); #endif /* @@ -1454,7 +1463,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(%p, %lx, %x)\n", pmap, va, wired); #endif if (pmap == NULL) return; @@ -1468,7 +1477,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; } /* @@ -1477,10 +1486,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 @@ -1509,7 +1518,7 @@ pmap_extract(pmap, va) #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) - printf("pmap_extract(%x, %x) -> ", pmap, va); + printf("pmap_extract(%p, %lx) -> ", pmap, va); #endif pa = 0; if (pmap && pmap_ste_v(pmap, va)) @@ -1518,7 +1527,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); } @@ -1539,7 +1548,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(%p, %p, %lx, %lx, %lx)\n", dst_pmap, src_pmap, dst_addr, len, src_addr); #endif } @@ -1584,14 +1593,14 @@ pmap_collect(pmap) #ifdef DEBUG int *ste; - int opmapdebug; + int opmapdebug = 0; #endif if (pmap != pmap_kernel()) return; #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) - printf("pmap_collect(%x)\n", pmap); + printf("pmap_collect(%p)\n", pmap); kpt_stats.collectscans++; #endif s = splimp(); @@ -1608,7 +1617,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 @@ -1629,7 +1638,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; @@ -1658,7 +1667,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; @@ -1671,11 +1680,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 } @@ -1689,7 +1698,7 @@ pmap_activate(pmap, pcbp) { #ifdef DEBUG if (pmapdebug & (PDB_FOLLOW|PDB_SEGTAB)) - printf("pmap_activate(%x, %x)\n", pmap, pcbp); + printf("pmap_activate(%p, %p)\n", pmap, pcbp); #endif PMAP_ACTIVATE(pmap, pcbp, pmap == curproc->p_vmspace->vm_map.pmap); } @@ -1706,7 +1715,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); @@ -1724,7 +1733,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; @@ -1754,7 +1763,7 @@ pmap_pageable(pmap, sva, eva, pageable) { #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) - printf("pmap_pageable(%x, %x, %x, %x)\n", + printf("pmap_pageable(%p, %lx, %lx, %x)\n", pmap, sva, eva, pageable); #endif /* @@ -1771,7 +1780,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(%p, %lx, %lx, %x)\n", pmap, sva, eva, pageable); #endif if (!pmap_ste_v(pmap, sva)) @@ -1784,7 +1793,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; } @@ -1795,7 +1804,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); @@ -1813,7 +1822,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); } @@ -1829,7 +1838,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); } @@ -1848,7 +1857,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 @@ -1869,7 +1878,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 @@ -1887,7 +1896,7 @@ pmap_phys_address(ppn) * Miscellaneous support routines follow */ -/* static */ +static void amiga_protection_init() { register int *kp, prot; @@ -1952,7 +1961,7 @@ pmap_testbit(pa, bit) return(FALSE); } -/* static */ +static void pmap_changebit(pa, bit, setem) register vm_offset_t pa; int bit; @@ -1968,7 +1977,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)) @@ -2015,7 +2024,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); @@ -2039,11 +2048,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 %p, va %lx\n", pmap, va); enter_stats.ptpneeded++; #endif /* @@ -2072,7 +2080,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 %p stab %p(%p)\n", pmap, pmap->pm_stab, pmap->pm_stpa); #endif } @@ -2098,7 +2106,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); @@ -2113,7 +2121,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 } @@ -2154,7 +2162,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); @@ -2173,7 +2181,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) @@ -2196,11 +2204,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 @@ -2208,7 +2216,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 /* @@ -2234,7 +2242,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 } @@ -2250,19 +2258,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; @@ -2276,7 +2286,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; @@ -2284,7 +2294,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 diff --git a/sys/arch/amiga/amiga/swapgeneric.c b/sys/arch/amiga/amiga/swapgeneric.c index b619de64638..f0bb2e0645f 100644 --- a/sys/arch/amiga/amiga/swapgeneric.c +++ b/sys/arch/amiga/amiga/swapgeneric.c @@ -1,5 +1,5 @@ -/* $OpenBSD: swapgeneric.c,v 1.3 1996/04/21 22:14:51 deraadt Exp $ */ -/* $NetBSD: swapgeneric.c,v 1.21 1996/03/17 05:54:41 mhitch Exp $ */ +/* $OpenBSD: swapgeneric.c,v 1.4 1996/05/02 06:43:23 niklas 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. @@ -46,16 +46,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 @@ -103,6 +108,8 @@ struct genericconf genericconf[] = { { 0 }, }; +struct genericconf * getgenconf __P((char *)); + struct genericconf * getgenconf(bp) char *bp; @@ -132,6 +139,7 @@ getgenconf(bp) return(gc); } +void setconf() { struct disk *dkp; @@ -211,6 +219,7 @@ justdoswap: rootdev = dumpdev; } +void gets(cp) char *cp; { diff --git a/sys/arch/amiga/amiga/sys_machdep.c b/sys/arch/amiga/amiga/sys_machdep.c index bf4f9b66e4c..f000374cabc 100644 --- a/sys/arch/amiga/amiga/sys_machdep.c +++ b/sys/arch/amiga/amiga/sys_machdep.c @@ -1,4 +1,5 @@ -/* $NetBSD: sys_machdep.c,v 1.12.2.1 1995/11/10 16:13:41 chopps Exp $ */ +/* $OpenBSD: sys_machdep.c,v 1.3 1996/05/02 06:43:23 niklas 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 +120,7 @@ vdoualarm(arg) /* XXX end should be */ /*ARGSUSED1*/ +int cachectl(req, addr, len) int req; caddr_t addr; @@ -129,10 +131,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 +232,7 @@ cachectl(req, addr, len) */ /*ARGSUSED1*/ +int dma_cachectl(addr, len) caddr_t addr; int len; @@ -253,7 +256,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 +279,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; } diff --git a/sys/arch/amiga/amiga/trap.c b/sys/arch/amiga/amiga/trap.c index cd6f281691c..c571ca850e6 100644 --- a/sys/arch/amiga/amiga/trap.c +++ b/sys/arch/amiga/amiga/trap.c @@ -1,4 +1,5 @@ -/* $NetBSD: trap.c,v 1.42.2.1 1995/11/10 19:32:59 chopps Exp $ */ +/* $OpenBSD: trap.c,v 1.4 1996/05/02 06:43:24 niklas Exp $ */ +/* $NetBSD: trap.c,v 1.45 1996/04/28 07:01:08 mhitch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -168,8 +169,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 +276,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 +300,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 +336,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 +356,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(%p,%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,13 +464,13 @@ nogo: trapcpfault(p, fp); return; } - printf("vm_fault(%x, %x, %x, 0) -> %x\n", + printf("vm_fault(%p, %lx, %x, 0) -> %x\n", map, va, ftype, rv); printf(" type %x, code [mmu,,ssw]: %x\n", type, code); panictrap(type, code, v, fp); } - trapsignal(p, SIGSEGV, v); + trapsignal(p, (rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV, v); if ((type & T_USER) == 0) return; userret(p, fp->f_pc, sticks); @@ -466,15 +481,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 +507,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 +684,7 @@ trap(type, code, v, frame) /* * Process a system call. */ +void syscall(code, frame) register_t code; struct frame frame; @@ -839,6 +856,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 +866,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 +984,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"); diff --git a/sys/arch/amiga/amiga/vm_machdep.c b/sys/arch/amiga/amiga/vm_machdep.c index f7d1ffbdc9d..405b382752c 100644 --- a/sys/arch/amiga/amiga/vm_machdep.c +++ b/sys/arch/amiga/amiga/vm_machdep.c @@ -1,4 +1,5 @@ -/* $NetBSD: vm_machdep.c,v 1.26 1996/02/05 02:06:38 christos Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.4 1996/05/02 06:43:25 niklas Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.29 1996/04/25 05:57:38 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -59,6 +60,10 @@ #include <vm/vm_kern.h> #include <machine/pte.h> +/* XXX - Put this in some header file? */ +void child_return __P((struct proc *, struct frame)); + + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the kernel stack and pcb, making the child @@ -76,7 +81,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 +116,16 @@ cpu_fork(p1, p2) */ void cpu_set_kpc(p, pc) - struct proc *p; - u_int32_t pc; + struct proc *p; + void (*pc) __P((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 +153,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 +187,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 +207,7 @@ physaccess(vaddr, paddr, size, prot) TBIAS(); } +void physunaccess(vaddr, size) caddr_t vaddr; register int size; @@ -301,6 +307,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 +317,7 @@ setredzone(pte, vaddr) /* * Convert kernel VA to physical address */ +int kvtop(addr) register caddr_t addr; { diff --git a/sys/arch/amiga/conf/FILIPPA b/sys/arch/amiga/conf/FILIPPA index 133d2bfc24d..d86b849aebc 100644 --- a/sys/arch/amiga/conf/FILIPPA +++ b/sys/arch/amiga/conf/FILIPPA @@ -1,4 +1,4 @@ -# $OpenBSD: FILIPPA,v 1.3 1996/04/27 18:38:48 niklas Exp $ +# $OpenBSD: FILIPPA,v 1.4 1996/05/02 06:43:28 niklas Exp $ # # GENERIC AMIGA @@ -33,9 +33,10 @@ options INET # IP networking support (Required) #options CCITT # CCITT X.25 #options NS # Xerox XNS #options EON # ISO CLNL over IP -options GATEWAY # Packet forwarding +options GATEWAY # Packet forwarding #options DIRECTED_BROADCAST # Broadcast across subnets #options NSIP # XNS over IP +options NTP # Network time protocol syscalls # # File system related options diff --git a/sys/arch/amiga/conf/GENERIC b/sys/arch/amiga/conf/GENERIC index 64cf05730c9..894a1312b98 100644 --- a/sys/arch/amiga/conf/GENERIC +++ b/sys/arch/amiga/conf/GENERIC @@ -1,5 +1,5 @@ -# $OpenBSD: GENERIC,v 1.6 1996/03/30 22:18:09 niklas Exp $ -# $NetBSD: GENERIC,v 1.53 1996/03/05 17:46:23 veego Exp $ +# $OpenBSD: GENERIC,v 1.7 1996/05/02 06:43:29 niklas Exp $ +# $NetBSD: GENERIC,v 1.55 1996/04/27 20:51:07 veego Exp $ # # GENERIC AMIGA @@ -36,6 +36,7 @@ options INET # IP networking support (Required) #options ISO,TPIP # OSI #options EON # OSI tunneling over IP #options CCITT,LLC,HDLC # X.25 +#options PPP_BSDCOMP,PPP_DEFLATE # BSD compression for PPP # # File systems @@ -83,7 +84,7 @@ options SYSVSEM # System V-like semaphores # Support for various kernel options # -options UCONSOLE # only super-user can redirect console +options UCONSOLE # anyone can redirect a virtual console options GENERIC # Mini-root boot support options LKM # Loadable kernel modules @@ -105,6 +106,7 @@ options KTRACE # Add kernel tracing system call # Amiga specific options # options MACHINE_NONCONTIG # Non-contiguous memory support +#options KBDRESET # sync on Ctrl-Amiga-Amiga # These options improve performance with the built-in serial port # on slower Amigas. Try the larger buffers first then lev6_defer. @@ -197,6 +199,7 @@ afsc0 at zbus0 # A4091 scsi aftsc0 at mainbus0 # A4000T scsi flsc0 at zbus0 # FastlaneZ3 scsi bzsc0 at zbus0 # Blizzard 1230 scsi +empsc0 at zbus0 # Emplant scsibus* at gtsc0 scsibus* at ahsc0 @@ -213,6 +216,7 @@ scsibus* at afsc0 scsibus* at aftsc0 scsibus* at flsc0 scsibus* at bzsc0 +scsibus* at empsc0 # each hard drive from low target to high # will configure to the next available sd unit number @@ -231,5 +235,6 @@ pseudo-device view 10 # views pseudo-device pty 16 # pseudo terminals pseudo-device vnd 4 # paging to files +#pseudo-device ccd 4 # concatenated disk devices config bsd swap on generic diff --git a/sys/arch/amiga/conf/files.amiga b/sys/arch/amiga/conf/files.amiga index f4ec2743234..6f9579bebbe 100644 --- a/sys/arch/amiga/conf/files.amiga +++ b/sys/arch/amiga/conf/files.amiga @@ -1,5 +1,5 @@ -# $OpenBSD: files.amiga,v 1.10 1996/04/27 18:38:49 niklas Exp $ -# $NetBSD: files.amiga,v 1.41 1996/03/28 18:41:55 is Exp $ +# $OpenBSD: files.amiga,v 1.11 1996/05/02 06:43:30 niklas Exp $ +# $NetBSD: files.amiga,v 1.44 1996/04/27 20:51:08 veego Exp $ # maxpartitions must be first item in files.${ARCH} maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL! @@ -12,7 +12,7 @@ attach mainbus at root device cpu attach cpu at mainbus -# zorro II expansion bus. +# zorro expansion bus. device zbus {} attach zbus at mainbus file arch/amiga/dev/zbus.c zbus @@ -34,14 +34,15 @@ device ser: tty attach ser at mainbus file arch/amiga/dev/ser.c ser needs-count -# parellel port +# parallel port device par attach par at mainbus file arch/amiga/dev/par.c par needs-count # mouse -pseudo-device mouse -file arch/amiga/dev/ms.c mouse needs-count +device ms: event +attach ms at mainbus +file arch/amiga/dev/ms.c ms needs-flag device fdc { unit = -1 } attach fdc at mainbus diff --git a/sys/arch/amiga/conf/std.amiga b/sys/arch/amiga/conf/std.amiga index 725b6cc9228..6ef97f53568 100644 --- a/sys/arch/amiga/conf/std.amiga +++ b/sys/arch/amiga/conf/std.amiga @@ -1,4 +1,5 @@ -# $NetBSD: std.amiga,v 1.5 1994/12/28 09:13:45 chopps Exp $ +# $OpenBSD: std.amiga,v 1.2 1996/05/02 06:43:30 niklas Exp $ +# $NetBSD: std.amiga,v 1.7 1996/04/27 20:51:09 veego Exp $ # standard amiga information @@ -10,9 +11,9 @@ clock0 at mainbus0 ser0 at mainbus0 par0 at mainbus0 kbd0 at mainbus0 +ms* at mainbus0 fdc0 at mainbus0 -fd0 at fdc0 unit 0 +fd* at fdc0 unit ? zbus0 at mainbus0 -# zthreebus0 at mainbus0 -pseudo-device mouse 2 +#pseudo-device mouse 2 diff --git a/sys/arch/amiga/dev/afsc.c b/sys/arch/amiga/dev/afsc.c index 39faa7e19be..b02aff05f79 100644 --- a/sys/arch/amiga/dev/afsc.c +++ b/sys/arch/amiga/dev/afsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: afsc.c,v 1.4 1996/04/21 22:14:56 deraadt Exp $ */ -/* $NetBSD: afsc.c,v 1.13 1996/03/18 04:58:36 mhitch Exp $ */ +/* $OpenBSD: afsc.c,v 1.5 1996/05/02 06:43:32 niklas Exp $ */ +/* $NetBSD: afsc.c,v 1.14 1996/04/21 21:10:48 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -43,6 +43,7 @@ #include <sys/device.h> #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> +#include <machine/cpu.h> #include <amiga/amiga/custom.h> #include <amiga/amiga/cc.h> #include <amiga/amiga/device.h> @@ -54,8 +55,10 @@ int afscprint __P((void *auxp, char *)); void afscattach __P((struct device *, struct device *, void *)); int afscmatch __P((struct device *, void *, void *)); -int siopintr __P((struct siop_softc *)); -int afsc_dmaintr __P((struct siop_softc *)); +int afsc_dmaintr __P((void *)); +#ifdef DEBUG +void afsc_dump __P((void)); +#endif struct scsi_adapter afsc_scsiswitch = { siop_scsicmd, @@ -99,7 +102,6 @@ afscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; siop_regmap_p rp; u_long temp, scratch; @@ -110,7 +112,7 @@ afscmatch(pdp, match, auxp) if (!is_a4000() || !matchname(auxp, "afsc")) return(0); /* Not on an A4000 or not A4000T SCSI */ rp = ztwomap(0xdd0040); - if (badaddr(&rp->siop_scratch) || badaddr(&rp->siop_temp)) { + if (badaddr((caddr_t)&rp->siop_scratch) || badaddr((caddr_t)&rp->siop_temp)) { return(0); } scratch = rp->siop_scratch; @@ -185,9 +187,10 @@ afscprint(auxp, pnp) } int -afsc_dmaintr(sc) - struct siop_softc *sc; +afsc_dmaintr(arg) + void *arg; { + struct siop_softc *sc = arg; siop_regmap_p rp; u_char istat; diff --git a/sys/arch/amiga/dev/ahsc.c b/sys/arch/amiga/dev/ahsc.c index 45c698e8755..2d40f8e8890 100644 --- a/sys/arch/amiga/dev/ahsc.c +++ b/sys/arch/amiga/dev/ahsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ahsc.c,v 1.2 1996/04/21 22:14:57 deraadt Exp $ */ -/* $NetBSD: ahsc.c,v 1.11 1996/03/17 01:17:00 thorpej Exp $ */ +/* $OpenBSD: ahsc.c,v 1.3 1996/05/02 06:43:33 niklas Exp $ */ +/* $NetBSD: ahsc.c,v 1.12 1996/04/21 21:10:49 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -59,9 +59,13 @@ int ahscmatch __P((struct device *, void *, void *)); void ahsc_enintr __P((struct sbic_softc *)); void ahsc_dmastop __P((struct sbic_softc *)); int ahsc_dmanext __P((struct sbic_softc *)); -int ahsc_dmaintr __P((struct sbic_softc *)); +int ahsc_dmaintr __P((void *)); int ahsc_dmago __P((struct sbic_softc *, char *, int, int)); +#ifdef DEBUG +void ahsc_dump __P((void)); +#endif + struct scsi_adapter ahsc_scsiswitch = { sbic_scsicmd, sbic_minphys, @@ -97,7 +101,6 @@ ahscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; char *mbusstr; mbusstr = auxp; @@ -244,9 +247,10 @@ ahsc_dmastop(dev) } int -ahsc_dmaintr(dev) - struct sbic_softc *dev; +ahsc_dmaintr(arg) + void *arg; { + struct sbic_softc *dev = arg; volatile struct sdmac *sdp; int stat, found; @@ -289,7 +293,6 @@ ahsc_dmanext(dev) struct sbic_softc *dev; { volatile struct sdmac *sdp; - int i, stat; sdp = dev->sc_cregs; diff --git a/sys/arch/amiga/dev/atzsc.c b/sys/arch/amiga/dev/atzsc.c index 2073fda49a5..d870992901f 100644 --- a/sys/arch/amiga/dev/atzsc.c +++ b/sys/arch/amiga/dev/atzsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: atzsc.c,v 1.2 1996/04/21 22:14:59 deraadt Exp $ */ -/* $NetBSD: atzsc.c,v 1.15 1996/03/18 04:58:37 mhitch Exp $ */ +/* $OpenBSD: atzsc.c,v 1.3 1996/05/02 06:43:34 niklas Exp $ */ +/* $NetBSD: atzsc.c,v 1.16 1996/04/21 21:10:51 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -59,9 +59,13 @@ int atzscmatch __P((struct device *, void *, void *)); void atzsc_enintr __P((struct sbic_softc *)); void atzsc_dmastop __P((struct sbic_softc *)); int atzsc_dmanext __P((struct sbic_softc *)); -int atzsc_dmaintr __P((struct sbic_softc *)); +int atzsc_dmaintr __P((void *)); int atzsc_dmago __P((struct sbic_softc *, char *, int, int)); +#ifdef DEBUG +void atzsc_dump __P((void)); +#endif + struct scsi_adapter atzsc_scsiswitch = { sbic_scsicmd, sbic_minphys, @@ -97,7 +101,6 @@ atzscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -158,7 +161,7 @@ atzscattach(pdp, dp, auxp) sc->sc_sbicp = (sbic_regmap_p) ((int)rp + 0x91); sc->sc_clkfreq = sbic_clock_override ? sbic_clock_override : 77; - printf(": dmamask 0x%x\n", ~sc->sc_dmamask); + printf(": dmamask 0x%lx\n", ~sc->sc_dmamask); sc->sc_link.adapter_softc = sc; sc->sc_link.adapter_target = 7; @@ -268,9 +271,10 @@ atzsc_dmastop(dev) } int -atzsc_dmaintr(dev) - struct sbic_softc *dev; +atzsc_dmaintr(arg) + void *arg; { + struct sbic_softc *dev = arg; volatile struct sdmac *sdp; int stat, found; @@ -313,7 +317,6 @@ atzsc_dmanext(dev) struct sbic_softc *dev; { volatile struct sdmac *sdp; - int i, stat; sdp = dev->sc_cregs; diff --git a/sys/arch/amiga/dev/bzsc.c b/sys/arch/amiga/dev/bzsc.c index 1cd4456ab1f..972714ae3ff 100644 --- a/sys/arch/amiga/dev/bzsc.c +++ b/sys/arch/amiga/dev/bzsc.c @@ -1,4 +1,6 @@ -/* $OpenBSD: bzsc.c,v 1.2 1996/04/21 22:15:00 deraadt Exp $ */ +/* $OpenBSD: bzsc.c,v 1.3 1996/05/02 06:43:34 niklas Exp $ */ + +/* $NetBSD: bzsc.c,v 1.7 1996/04/21 21:10:52 veego Exp $ */ /* * Copyright (c) 1995 Daniel Widenfalk @@ -83,37 +85,45 @@ struct cfdriver bzsc_cd = { NULL, "bzsc", DV_DULL, NULL, 0 }; -int bzsc_intr __P((struct sfas_softc *dev)); -int bzsc_setup_dma __P((struct sfas_softc *sc, void *ptr, int len, +int bzsc_intr __P((void *)); +void bzsc_set_dma_adr __P((struct sfas_softc *sc, vm_offset_t ptr, int mode)); +void bzsc_set_dma_tc __P((struct sfas_softc *sc, unsigned int len)); +int bzsc_setup_dma __P((struct sfas_softc *sc, vm_offset_t ptr, int len, int mode)); int bzsc_build_dma_chain __P((struct sfas_softc *sc, struct sfas_dma_chain *chain, void *p, int l)); -int bzsc_need_bump __P((struct sfas_softc *sc, void *ptr, int len)); -void bzsc_led_dummy __P((struct sfas_softc *sc)); +int bzsc_need_bump __P((struct sfas_softc *sc, vm_offset_t ptr, int len)); +void bzsc_led_dummy __P((struct sfas_softc *sc, int mode)); /* * if we are an Advanced Systems & Software FastlaneZ3 */ -int bzscmatch(struct device *pdp, void *match, void *auxp) +int +bzscmatch(pdp, match, auxp) + struct device *pdp; + void *match, *auxp; { - struct zbus_args *zap; + struct zbus_args *zap; - if (!is_a1200()) - return(0); + if (!is_a1200()) + return(0); - zap = auxp; - if (zap->manid == 0x2140 && zap->prodid == 11) - return(1); + zap = auxp; + if (zap->manid == 0x2140 && zap->prodid == 11) + return(1); - return(0); + return(0); } -void bzscattach(struct device *pdp, struct device *dp, void *auxp) +void +bzscattach(pdp, dp, auxp) + struct device *pdp; + struct device *dp; + void *auxp; { struct bzsc_softc *sc; struct zbus_args *zap; bzsc_regmap_p rp; - u_int *pte, page; vu_char *fas; zap = auxp; @@ -177,7 +187,10 @@ void bzscattach(struct device *pdp, struct device *dp, void *auxp) } /* print diag if pnp is NULL else just extra */ -int bzscprint(void *auxp, char *pnp) +int +bzscprint(auxp, pnp) + void *auxp; + char *pnp; { if (pnp == NULL) return(UNCONF); @@ -185,8 +198,11 @@ int bzscprint(void *auxp, char *pnp) return(QUIET); } -int bzsc_intr(struct sfas_softc *dev) +int +bzsc_intr(arg) + void *arg; { + struct sfas_softc *dev = arg; bzsc_regmap_p rp; int quickints; @@ -212,7 +228,11 @@ int bzsc_intr(struct sfas_softc *dev) } /* --------- */ -void bzsc_set_dma_adr(struct sfas_softc *sc, void *ptr, int mode) +void +bzsc_set_dma_adr(sc, ptr, mode) + struct sfas_softc *sc; + vm_offset_t ptr; + int mode; { bzsc_regmap_p rp; unsigned long p; @@ -233,7 +253,10 @@ void bzsc_set_dma_adr(struct sfas_softc *sc, void *ptr, int mode) } /* Set DMA transfer counter */ -void bzsc_set_dma_tc(struct sfas_softc *sc, unsigned int len) +void +bzsc_set_dma_tc(sc, len) + struct sfas_softc *sc; + unsigned int len; { *sc->sc_fas->sfas_tc_low = len; len >>= 8; *sc->sc_fas->sfas_tc_mid = len; len >>= 8; @@ -241,7 +264,12 @@ void bzsc_set_dma_tc(struct sfas_softc *sc, unsigned int len) } /* Initialize DMA for transfer */ -int bzsc_setup_dma(struct sfas_softc *sc, void *ptr, int len, int mode) +int +bzsc_setup_dma(sc, ptr, len, mode) + struct sfas_softc *sc; + vm_offset_t ptr; + int len; + int mode; { int retval; @@ -267,7 +295,11 @@ int bzsc_setup_dma(struct sfas_softc *sc, void *ptr, int len, int mode) } /* Check if address and len is ok for DMA transfer */ -int bzsc_need_bump(struct sfas_softc *sc, void *ptr, int len) +int +bzsc_need_bump(sc, ptr, len) + struct sfas_softc *sc; + vm_offset_t ptr; + int len; { int p; @@ -284,8 +316,12 @@ int bzsc_need_bump(struct sfas_softc *sc, void *ptr, int len) } /* Interrupt driven routines */ -int bzsc_build_dma_chain(struct sfas_softc *sc, struct sfas_dma_chain *chain, - void *p, int l) +int +bzsc_build_dma_chain(sc, chain, p, l) + struct sfas_softc *sc; + struct sfas_dma_chain *chain; + void *p; + int l; { int n; @@ -317,7 +353,7 @@ do { chain[n].ptr = (p); chain[n].len = (l); chain[n++].flg = (f); } while(0) } else { char *ptr; vm_offset_t pa, lastpa; - int len, prelen, postlen, max_t; + int len, prelen, max_t; ptr = p; len = l; @@ -360,6 +396,8 @@ do { chain[n].ptr = (p); chain[n].len = (l); chain[n++].flg = (f); } while(0) } /* Turn on led */ -void bzsc_led_dummy(struct sfas_softc *sc) +void bzsc_led_dummy(sc, mode) + struct sfas_softc *sc; + int mode; { } diff --git a/sys/arch/amiga/dev/bzscreg.h b/sys/arch/amiga/dev/bzscreg.h index 930515ecc32..40e6fd844ef 100644 --- a/sys/arch/amiga/dev/bzscreg.h +++ b/sys/arch/amiga/dev/bzscreg.h @@ -1,3 +1,6 @@ +/* $OpenBSD: bzscreg.h,v 1.2 1996/05/02 06:43:35 niklas Exp $ */ +/* $NetBSD: bzscreg.h,v 1.2 1996/04/21 21:10:54 veego Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * diff --git a/sys/arch/amiga/dev/bzscvar.h b/sys/arch/amiga/dev/bzscvar.h index 5150a45a56b..be9fe39fc1d 100644 --- a/sys/arch/amiga/dev/bzscvar.h +++ b/sys/arch/amiga/dev/bzscvar.h @@ -1,3 +1,6 @@ +/* $OpenBSD: bzscvar.h,v 1.2 1996/05/02 06:43:36 niklas Exp $ */ +/* $NetBSD: bzscvar.h,v 1.2 1996/04/21 21:10:55 veego Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * diff --git a/sys/arch/amiga/dev/clock.c b/sys/arch/amiga/dev/clock.c index aad42f1f0b5..8f307f3316a 100644 --- a/sys/arch/amiga/dev/clock.c +++ b/sys/arch/amiga/dev/clock.c @@ -1,5 +1,5 @@ -/* $OpenBSD: clock.c,v 1.5 1996/04/27 18:38:50 niklas Exp $ */ -/* $NetBSD: clock.c,v 1.12 1996/03/17 05:58:30 mhitch Exp $ */ +/* $OpenBSD: clock.c,v 1.6 1996/05/02 06:43:37 niklas Exp $ */ +/* $NetBSD: clock.c,v 1.13 1996/04/21 21:10:57 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -46,6 +46,7 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/device.h> +#include <sys/systm.h> #include <machine/psl.h> #include <machine/cpu.h> #include <machine/intr.h> @@ -97,6 +98,8 @@ struct clockframe hardclock_frame; int clockmatch __P((struct device *, void *, void *)); void clockattach __P((struct device *, struct device *, void *)); +void cpu_initclocks __P((void)); +void setmicspertick __P((void)); struct cfattach clock_ca = { sizeof(struct device), clockmatch, clockattach @@ -110,7 +113,6 @@ clockmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cfp = match; if (matchname("clock", auxp)) return(1); @@ -198,6 +200,7 @@ cpu_initclocks() #endif } +void setstatclockrate(hz) int hz; { @@ -207,6 +210,7 @@ setstatclockrate(hz) * Returns number of usec since last recorded clock "tick" * (i.e. clock interrupt). */ +u_long clkread() { u_char hi, hi2, lo; @@ -274,7 +278,6 @@ delay(mic) u_int mic; { u_int temp; - int s; if (micspertick == 0) setmicspertick(); @@ -693,6 +696,7 @@ int rtcinit __P((void)); * Initialize the time of day register, based on the time base which is, e.g. * from a filesystem. */ +void inittodr(base) time_t base; { @@ -712,11 +716,11 @@ inittodr(base) time.tv_sec = timbuf; } +void resettodr() { - if (settod && settod(time.tv_sec) == 1) - return; - printf("Cannot set battery backed clock\n"); + if (settod && settod(time.tv_sec) == 0) + printf("Cannot set battery backed clock\n"); } int diff --git a/sys/arch/amiga/dev/empsc.c b/sys/arch/amiga/dev/empsc.c index 9618c00b696..b035ebeef3b 100644 --- a/sys/arch/amiga/dev/empsc.c +++ b/sys/arch/amiga/dev/empsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: empsc.c,v 1.1 1996/04/21 22:15:02 deraadt Exp $ */ -/* $NetBSD: empsc.c,v 1.4 1996/04/05 15:53:41 is Exp $ */ +/* $OpenBSD: empsc.c,v 1.2 1996/05/02 06:43:37 niklas Exp $ */ +/* $NetBSD: empsc.c,v 1.5 1996/04/21 21:10:59 veego Exp $ */ /* @@ -52,8 +52,8 @@ int empscprint __P((void *auxp, char *)); void empscattach __P((struct device *, struct device *, void *)); -int empscmatch __P((struct device *, struct cfdata *, void *)); -int empsc_intr __P((struct sci_softc *)); +int empscmatch __P((struct device *, void *, void *)); +int empsc_intr __P((void *)); struct scsi_adapter empsc_scsiswitch = { sci_scsicmd, @@ -69,8 +69,6 @@ struct scsi_device empsc_scsidev = { NULL, /* Use default done routine */ }; -#define QPRINTF - #ifdef DEBUG extern int sci_debug; #endif @@ -169,9 +167,10 @@ empscprint(auxp, pnp) } int -empsc_intr(dev) - struct sci_softc *dev; +empsc_intr(arg) + void *arg; { + struct sci_softc *dev = arg; u_char stat; if ((*dev->sci_csr & SCI_CSR_INT) == 0) diff --git a/sys/arch/amiga/dev/fd.c b/sys/arch/amiga/dev/fd.c index 86c76049a14..ef0c3159046 100644 --- a/sys/arch/amiga/dev/fd.c +++ b/sys/arch/amiga/dev/fd.c @@ -1,5 +1,5 @@ -/* $OpenBSD: fd.c,v 1.5 1996/04/21 22:15:04 deraadt Exp $ */ -/* $NetBSD: fd.c,v 1.28 1996/04/05 05:08:07 mhitch Exp $ */ +/* $OpenBSD: fd.c,v 1.6 1996/05/02 06:43:38 niklas Exp $ */ +/* $NetBSD: fd.c,v 1.30 1996/04/29 06:23:47 mhitch Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -38,15 +38,20 @@ #include <sys/device.h> #include <sys/ioctl.h> #include <sys/fcntl.h> -#include <sys/conf.h> #include <sys/disklabel.h> #include <sys/disk.h> #include <sys/dkbad.h> +#include <sys/proc.h> +#include <sys/cpu.h> +#include <machine/cpu.h> #include <amiga/amiga/device.h> #include <amiga/amiga/custom.h> #include <amiga/amiga/cia.h> #include <amiga/amiga/cc.h> +#include <sys/conf.h> +#include <machine/conf.h> + enum fdc_bits { FDB_CHANGED = 2, FDB_PROTECT, FDB_CYLZERO, FDB_READY }; /* * partitions in fd represent different format floppies @@ -144,35 +149,44 @@ int fdc_wantwakeup; int fdc_side; void *fdc_dmap; struct fd_softc *fdc_indma; +int fdc_dmalen; +int fdc_dmawrite; struct fdcargs { struct fdtype *type; int unit; }; -int fdmatch __P((struct device *, void *, void *)); -int fdcmatch __P((struct device *, void *, void *)); -int fdcprint __P((void *, char *)); -void fdcattach __P((struct device *, struct device *, void *)); -void fdattach __P((struct device *, struct device *, void *)); - -void fdstart __P((struct fd_softc *)); -void fddone __P((struct fd_softc *)); -void fdfindwork __P((int)); -void fddmastart __P((struct fd_softc *, int)); -void fddmadone __P((struct fd_softc *, int)); -void fdsetpos __P((struct fd_softc *, int, int)); -void fdmotoroff __P((void *)); -void fdmotorwait __P((void *)); -void fdminphys __P((struct buf *)); -void fdcachetoraw __P((struct fd_softc *)); -int fdrawtocache __P((struct fd_softc *)); -int fdloaddisk __P((struct fd_softc *)); -u_long *mfmblkencode __P((u_long *, u_long *, u_long *, int)); -u_long *mfmblkdecode __P((u_long *, u_long *, u_long *, int)); -struct fdtype * fdcgetfdtype __P((int)); - -void fdstrategy __P((struct buf *)); +int fdcmatch __P((struct device *, void *, void *)); +void fdcattach __P((struct device *, struct device *, void *)); +int fdcprint __P((void *, char *)); +int fdmatch __P((struct device *, void *, void *)); +void fdattach __P((struct device *, struct device *, void *)); + +void fdintr __P((int)); +void fdidxintr __P((void)); +void fdstrategy __P((struct buf *)); +int fdloaddisk __P((struct fd_softc *)); +int fdgetdisklabel __P((struct fd_softc *, dev_t)); +int fdsetdisklabel __P((struct fd_softc *, struct disklabel *)); +int fdputdisklabel __P((struct fd_softc *, dev_t)); +struct fdtype * fdcgetfdtype __P((int)); +void fdmotoroff __P((void *)); +void fdsetpos __P((struct fd_softc *, int, int)); +void fdselunit __P((struct fd_softc *)); +void fdstart __P((struct fd_softc *)); +void fdcont __P((struct fd_softc *)); +void fddmastart __P((struct fd_softc *, int)); +void fdcalibrate __P((void *)); +void fddmadone __P((struct fd_softc *, int)); +void fddone __P((struct fd_softc *)); +void fdfindwork __P((int)); +void fdminphys __P((struct buf *)); +void fdcachetoraw __P((struct fd_softc *)); +u_long *fdfindsync __P((u_long *, u_long *)); +int fdrawtocache __P((struct fd_softc *)); +u_long *mfmblkencode __P((u_long *, u_long *, u_long *, int)); +u_long *mfmblkdecode __P((u_long *, u_long *, u_long *, int)); struct dkdriver fddkdriver = { fdstrategy }; @@ -282,7 +296,7 @@ fdcmatch(pdp, match, auxp) void fdcattach(pdp, dp, auxp) - struct device *pdp, *dp; + struct device *pdp, *dp; void *auxp; { struct fdcargs args; @@ -309,7 +323,8 @@ fdcprint(auxp, pnp) fcp = auxp; if (pnp) - printf("fd%d at %s:", fcp->unit, pnp); + printf("fd%d at %s unit %d:", fcp->unit, pnp, + fcp->type->driveid); return(UNCONF); } @@ -349,8 +364,8 @@ fdattach(pdp, dp, auxp) sc->unitmask = 1 << (3 + ap->unit); sc->retries = FDRETRIES; sc->stepdelay = FDSTEPDELAY; - printf(": %s %d cyl, %d head, %d sec [%d sec], 512 bytes/sec\n", - sc->type->desc, sc->type->ncylinders, FDNHEADS, + printf(" unit %d: %s %d cyl, %d head, %d sec [%d sec], 512 bytes/sec\n", + sc->hwunit, sc->type->desc, sc->type->ncylinders, FDNHEADS, sc->type->amiga_nsectors, sc->type->msdos_nsectors); /* @@ -372,14 +387,13 @@ fdattach(pdp, dp, auxp) * enable disk related interrupts */ custom.dmacon = DMAF_SETCLR | DMAF_MASTER | DMAF_DISK; - /* XXX why softint */ - custom.intena = INTF_SETCLR |INTF_SOFTINT | INTF_DSKBLK; - ciaa.icr = CIA_ICR_IR_SC | CIA_ICR_FLG; + custom.intena = INTF_SETCLR | INTF_DSKBLK; + ciab.icr = CIA_ICR_FLG; } /*ARGSUSED*/ int -Fdopen(dev, flags, devtype, p) +fdopen(dev, flags, devtype, p) dev_t dev; int flags, devtype; struct proc *p; @@ -405,7 +419,7 @@ Fdopen(dev, flags, devtype, p) * shut the motor off, do a sleep here also. */ while (sc->flags & FDF_WMOTOROFF) - tsleep(fdmotoroff, PRIBIO, "Fdopen", 0); + tsleep(fdmotoroff, PRIBIO, "fdopen", 0); fwork = 0; /* @@ -429,11 +443,11 @@ Fdopen(dev, flags, devtype, p) if (fdc_indma) { fwork = 1; fdc_wantwakeup++; - tsleep(Fdopen, PRIBIO, "Fdopen", 0); + tsleep(fdopen, PRIBIO, "fdopen", 0); } - if (error = fdloaddisk(sc)) + if ((error = fdloaddisk(sc)) != 0) goto done; - if (error = fdgetdisklabel(sc, dev)) + if ((error = fdgetdisklabel(sc, dev)) != 0) goto done; #ifdef FDDEBUG printf(" open successful\n"); @@ -490,7 +504,6 @@ fdioctl(dev, cmd, addr, flag, p) struct proc *p; { struct fd_softc *sc; - void *data; int error, wlab; sc = getsoftc(fd_cd, FDUNIT(dev)); @@ -526,7 +539,7 @@ fdioctl(dev, cmd, addr, flag, p) case DIOCWDINFO: if ((flag & FWRITE) == 0) return(EBADF); - if (error = fdsetdisklabel(sc, (struct disklabel *)addr)) + if ((error = fdsetdisklabel(sc, (struct disklabel *)addr)) != 0) return(error); wlab = sc->wlabel; sc->wlabel = 1; @@ -554,24 +567,27 @@ fdsize(dev) } int -fdread(dev, uio) - dev_t dev; - struct uio *uio; +fdread(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { return (physio(fdstrategy, NULL, dev, B_READ, fdminphys, uio)); } int -fdwrite(dev, uio) - dev_t dev; - struct uio *uio; +fdwrite(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { return (physio(fdstrategy, NULL, dev, B_WRITE, fdminphys, uio)); } -int -fdintr() +void +fdintr(flag) + int flag; { int s; @@ -582,6 +598,19 @@ fdintr() } void +fdidxintr() +{ + if (fdc_indma && fdc_dmalen) { + /* + * turn off intr and start actual dma + */ + ciab.icr = CIA_ICR_FLG; + FDDMASTART(fdc_dmalen, fdc_dmawrite); + fdc_dmalen = 0; + } +} + +void fdstrategy(bp) struct buf *bp; { @@ -641,8 +670,9 @@ fdloaddisk(sc) /* * if diskchange is low step drive to 0 then up one then to zero. */ - fdsetpos(sc, 0, 0); + fdselunit(sc); /* make sure the unit is selected */ if (FDTESTC(FDB_CHANGED)) { + fdsetpos(sc, 0, 0); sc->cachetrk = -1; /* invalidate the cache */ sc->flags &= ~FDF_HAVELABEL; fdsetpos(sc, FDNHEADS, 0); @@ -712,7 +742,7 @@ fdgetdisklabel(sc, dev) bp->b_bcount = FDSECSIZE; bp->b_flags = B_BUSY | B_READ; fdstrategy(bp); - if (error = biowait(bp)) + if ((error = biowait(bp)) != 0) goto nolabel; dlp = (struct disklabel *)(bp->b_data + LABELOFFSET); if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC || @@ -842,7 +872,7 @@ fdputdisklabel(sc, dev) bp->b_bcount = FDSECSIZE; bp->b_flags = B_BUSY | B_READ; fdstrategy(bp); - if (error = biowait(bp)) + if ((error = biowait(bp)) != 0) goto done; /* * copy disklabel to buf and write it out syncronous @@ -896,7 +926,7 @@ fdcgetfdtype(unit) delay(1); } #ifdef FDDEBUG - printf("fdcgettype unit %d id 0x%x\n", unit, id); + printf("fdcgettype unit %d id 0x%lx\n", unit, id); #endif for (cnt = 0, ftp = fdtype; cnt < nfdtype; ftp++, cnt++) @@ -919,7 +949,7 @@ fdmotoroff(arg) void *arg; { struct fd_softc *sc; - int unitmask, s; + int s; sc = arg; s = splbio(); @@ -971,7 +1001,7 @@ fdmotoroff(arg) } #ifdef FDDEBUG - printf(" hw turing unit off\n"); + printf(" hw turning unit off\n"); #endif sc->flags &= ~(FDF_MOTORON | FDF_MOTOROFF); @@ -1456,7 +1486,7 @@ fddone(sc) { struct buf *dp, *bp; char *data; - int sz, blk; + int sz; #ifdef FDDEBUG printf("fddone: unit %d\n", sc->hwunit); @@ -1526,10 +1556,10 @@ fdfindwork(unit) int i, last; /* - * first see if we have any Fdopen()'s waiting + * first see if we have any fdopen()'s waiting */ if (fdc_wantwakeup) { - wakeup(Fdopen); + wakeup(fdopen); fdc_wantwakeup--; return; } @@ -1735,7 +1765,7 @@ again: } if (((info >> 16) & 0xff) != sc->cachetrk) { #ifdef DEBUG - printf("%s: incorrect track found: 0x%0x %d\n", + printf("%s: incorrect track found: 0x%lx %d\n", sc->sc_dv.dv_xname, info, sc->cachetrk); #endif goto again; @@ -1780,7 +1810,6 @@ mfmblkencode(dp, rp, cp, len) int len; { u_long *sdp, *edp, d, dtmp, correct; - int i; sdp = dp; edp = dp + len; @@ -1875,7 +1904,11 @@ mfmblkdecode(rp, dp, cp, len) } int -fddump() +fddump(dev, blkno, va, size) + dev_t dev; + daddr_t blkno; + caddr_t va; + size_t size; { return (EINVAL); } diff --git a/sys/arch/amiga/dev/flsc.c b/sys/arch/amiga/dev/flsc.c index 9da31524678..b1197ba2cba 100644 --- a/sys/arch/amiga/dev/flsc.c +++ b/sys/arch/amiga/dev/flsc.c @@ -1,4 +1,6 @@ -/* $OpenBSD: flsc.c,v 1.2 1996/04/21 22:15:05 deraadt Exp $ */ +/* $OpenBSD: flsc.c,v 1.3 1996/05/02 06:43:39 niklas Exp $ */ + +/* $NetBSD: flsc.c,v 1.5 1996/04/21 21:11:03 veego Exp $ */ /* * Copyright (c) 1995 Daniel Widenfalk @@ -83,12 +85,15 @@ struct cfdriver flsc_cd = { NULL, "flsc", DV_DULL, NULL, 0 }; -int flsc_intr __P((struct sfas_softc *dev)); -int flsc_setup_dma __P((struct sfas_softc *sc, void *ptr, int len, +int flsc_intr __P((void *)); +void flsc_set_dma_adr __P((struct sfas_softc *sc, vm_offset_t ptr)); +void flsc_set_dma_tc __P((struct sfas_softc *sc, unsigned int len)); +void flsc_set_dma_mode __P((struct sfas_softc *sc, int mode)); +int flsc_setup_dma __P((struct sfas_softc *sc, vm_offset_t ptr, int len, int mode)); int flsc_build_dma_chain __P((struct sfas_softc *sc, struct sfas_dma_chain *chain, void *p, int l)); -int flsc_need_bump __P((struct sfas_softc *sc, void *ptr, int len)); +int flsc_need_bump __P((struct sfas_softc *sc, vm_offset_t ptr, int len)); void flsc_led __P((struct sfas_softc *sc, int mode)); /* @@ -202,9 +207,10 @@ flscprint(auxp, pnp) } int -flsc_intr(dev) - struct sfas_softc *dev; +flsc_intr(arg) + void *arg; { + struct sfas_softc *dev = arg; flsc_regmap_p rp; struct flsc_specific *flspec; int quickints; @@ -247,7 +253,7 @@ flsc_intr(dev) void flsc_set_dma_adr(sc, ptr) struct sfas_softc *sc; - void *ptr; + vm_offset_t ptr; { flsc_regmap_p rp; unsigned int *p; @@ -291,7 +297,7 @@ flsc_set_dma_mode(sc, mode) int flsc_setup_dma(sc, ptr, len, mode) struct sfas_softc *sc; - void *ptr; + vm_offset_t ptr; int len; int mode; { @@ -331,7 +337,7 @@ flsc_setup_dma(sc, ptr, len, mode) int flsc_need_bump(sc, ptr, len) struct sfas_softc *sc; - void *ptr; + vm_offset_t ptr; int len; { int p; @@ -358,7 +364,7 @@ flsc_build_dma_chain(sc, chain, p, l) { vm_offset_t pa, lastpa; char *ptr; - int len, prelen, postlen, max_t, n; + int len, prelen, max_t, n; if (l == 0) return(0); diff --git a/sys/arch/amiga/dev/flscreg.h b/sys/arch/amiga/dev/flscreg.h index 2a74ec9c834..226fb4d1383 100644 --- a/sys/arch/amiga/dev/flscreg.h +++ b/sys/arch/amiga/dev/flscreg.h @@ -1,3 +1,6 @@ +/* $OpenBSD: flscreg.h,v 1.2 1996/05/02 06:43:40 niklas Exp $ */ +/* $NetBSD: flscreg.h,v 1.2 1996/04/21 21:11:04 veego Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * diff --git a/sys/arch/amiga/dev/flscvar.h b/sys/arch/amiga/dev/flscvar.h index 16623540fe5..f0e2d50c82c 100644 --- a/sys/arch/amiga/dev/flscvar.h +++ b/sys/arch/amiga/dev/flscvar.h @@ -1,3 +1,6 @@ +/* $OpenBSD: flscvar.h,v 1.2 1996/05/02 06:43:41 niklas Exp $ */ +/* $NetBSD: flscvar.h,v 1.2 1996/04/21 21:11:06 veego Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * diff --git a/sys/arch/amiga/dev/grf.c b/sys/arch/amiga/dev/grf.c index 7979bd4de62..473fb36d936 100644 --- a/sys/arch/amiga/dev/grf.c +++ b/sys/arch/amiga/dev/grf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf.c,v 1.3 1996/04/21 22:15:08 deraadt Exp $ */ -/* $NetBSD: grf.c,v 1.25 1996/03/17 01:17:09 thorpej Exp $ */ +/* $OpenBSD: grf.c,v 1.4 1996/05/02 06:43:42 niklas Exp $ */ +/* $NetBSD: grf.c,v 1.26 1996/04/21 21:11:07 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -55,7 +55,6 @@ #include <sys/device.h> #include <sys/file.h> #include <sys/malloc.h> -#include <sys/conf.h> #include <sys/systm.h> #include <sys/vnode.h> #include <sys/mman.h> @@ -69,12 +68,15 @@ #include <amiga/dev/grfioctl.h> #include <amiga/dev/grfvar.h> #include <amiga/dev/itevar.h> +#include <amiga/dev/viewioctl.h> -#include "view.h" +#include <sys/conf.h> +#include <machine/conf.h> +#include "view.h" #include "grf.h" -#if NGRF > 0 +#if NGRF > 0 #include "ite.h" #if NITE == 0 #define ite_on(u,f) @@ -82,12 +84,6 @@ #define ite_reinit(d) #endif -int grfopen __P((dev_t, int, int, struct proc *)); -int grfclose __P((dev_t, int)); -int grfioctl __P((dev_t, u_long, caddr_t, int, struct proc *)); -int grfselect __P((dev_t, int)); -int grfmmap __P((dev_t, int, int)); - int grfon __P((dev_t)); int grfoff __P((dev_t)); int grfsinfo __P((dev_t, struct grfdyninfo *)); @@ -207,9 +203,11 @@ grfopen(dev, flags, devtype, p) /*ARGSUSED*/ int -grfclose(dev, flags) +grfclose(dev, flags, mode, p) dev_t dev; int flags; + int mode; + struct proc *p; { struct grf_softc *gp; @@ -252,14 +250,14 @@ grfioctl(dev, cmd, data, flag, p) error = grfsinfo(dev, (struct grfdyninfo *) data); break; case GRFGETVMODE: - return(gp->g_mode(gp, GM_GRFGETVMODE, data)); + return(gp->g_mode(gp, GM_GRFGETVMODE, data, 0, 0)); case GRFSETVMODE: - error = gp->g_mode(gp, GM_GRFSETVMODE, data); + error = gp->g_mode(gp, GM_GRFSETVMODE, data, 0, 0); if (error == 0 && gp->g_itedev && !(gp->g_flags & GF_GRFON)) ite_reinit(gp->g_itedev); break; case GRFGETNUMVM: - return(gp->g_mode(gp, GM_GRFGETNUMVM, data)); + return(gp->g_mode(gp, GM_GRFGETNUMVM, data, 0, 0)); /* * these are all hardware dependant, and have to be resolved * in the respective driver. @@ -280,7 +278,7 @@ grfioctl(dev, cmd, data, flag, p) * We need the minor dev number to get the overlay/image * information for grf_ul. */ - return(gp->g_mode(gp, GM_GRFIOCTL, cmd, data, dev)); + return(gp->g_mode(gp, GM_GRFIOCTL, data, cmd, dev)); default: #if NVIEW > 0 /* @@ -300,9 +298,10 @@ grfioctl(dev, cmd, data, flag, p) /*ARGSUSED*/ int -grfselect(dev, rw) +grfselect(dev, rw, p) dev_t dev; int rw; + struct proc *p; { if (rw == FREAD) return(0); @@ -360,7 +359,8 @@ grfon(dev) if (gp->g_itedev != NODEV) ite_off(gp->g_itedev, 3); - return(gp->g_mode(gp, (dev & GRFOVDEV) ? GM_GRFOVON : GM_GRFON)); + return(gp->g_mode(gp, (dev & GRFOVDEV) ? GM_GRFOVON : GM_GRFON, + NULL, 0, 0)); } int @@ -376,7 +376,8 @@ grfoff(dev) return(0); gp->g_flags &= ~GF_GRFON; - error = gp->g_mode(gp, (dev & GRFOVDEV) ? GM_GRFOVOFF : GM_GRFOFF); + error = gp->g_mode(gp, (dev & GRFOVDEV) ? GM_GRFOVOFF : GM_GRFOFF, + NULL, 0, 0); /* * Closely tied together no X's @@ -396,7 +397,7 @@ grfsinfo(dev, dyninfo) int error; gp = grfsp[GRFUNIT(dev)]; - error = gp->g_mode(gp, GM_GRFCONFIG, dyninfo); + error = gp->g_mode(gp, GM_GRFCONFIG, dyninfo, 0, 0); /* * Closely tied together no X's @@ -438,7 +439,7 @@ grfbanked_cur (dev) gp = grfsp[GRFUNIT(dev)]; - error = gp->g_mode(gp, GM_GRFGETCURBANK, &bank); + error = gp->g_mode(gp, GM_GRFGETCURBANK, &bank, 0, 0); return(error ? -1 : bank); } @@ -450,7 +451,7 @@ grfbanked_set (dev, bank) struct grf_softc *gp; gp = grfsp[GRFUNIT(dev)]; - return(gp->g_mode(gp, GM_GRFSETBANK, bank) ? -1 : 0); + return(gp->g_mode(gp, GM_GRFSETBANK, &bank, 0, 0) ? -1 : 0); } #endif /* BANKEDDEVPAGER */ diff --git a/sys/arch/amiga/dev/grf_cc.c b/sys/arch/amiga/dev/grf_cc.c index fbf57ad92e3..28a979d4c8a 100644 --- a/sys/arch/amiga/dev/grf_cc.c +++ b/sys/arch/amiga/dev/grf_cc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_cc.c,v 1.2 1996/04/21 22:15:09 deraadt Exp $ */ -/* $NetBSD: grf_cc.c,v 1.18 1996/03/17 01:17:10 thorpej Exp $ */ +/* $OpenBSD: grf_cc.c,v 1.3 1996/05/02 06:43:42 niklas Exp $ */ +/* $NetBSD: grf_cc.c,v 1.19 1996/04/21 21:11:08 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -38,10 +38,12 @@ */ #include <sys/param.h> +#include <sys/proc.h> #include <sys/errno.h> #include <sys/ioctl.h> #include <sys/queue.h> #include <sys/device.h> +#include <sys/systm.h> #include <vm/vm_param.h> #include <machine/cpu.h> #include <amiga/amiga/color.h> /* DEBUG */ @@ -54,6 +56,10 @@ #include <amiga/dev/grfabs_reg.h> #include <amiga/dev/viewioctl.h> +#include <sys/conf.h> +#include <machine/conf.h> + +#include "view.h" int grfccmatch __P((struct device *, void *, void *)); int grfccprint __P((void *, char *)); @@ -100,7 +106,7 @@ grfccmatch(pdp, match, auxp) /* * XXX nasty hack. opens view[0] and never closes. */ - if (viewopen(0, 0)) + if (viewopen(0, 0, 0, NULL)) return(0); if (amiga_realconfig == 0) { ccconunit = cfp->cf_unit; @@ -119,7 +125,6 @@ grfccattach(pdp, dp, auxp) void *auxp; { static struct grf_softc congrf; - static int coninited; struct grf_softc *gp; if (dp == NULL) @@ -170,15 +175,18 @@ grfccprint(auxp, pnp) int cc_mode(gp, cmd, arg, a2, a3) struct grf_softc *gp; - int cmd, a2, a3; + u_long cmd; void *arg; + u_long a2; + int a3; { + switch (cmd) { case GM_GRFON: grf_cc_on(gp); return(0); case GM_GRFOFF: - viewioctl(0, VIOCREMOVE, NULL, 0, -1); + viewioctl(0, VIOCREMOVE, NULL, -1, NULL); return(0); case GM_GRFCONFIG: default: @@ -197,7 +205,7 @@ grf_cc_on(gp) gi = &gp->g_display; - viewioctl(0, VIOCGBMAP, &bm, 0, -1); + viewioctl(0, VIOCGBMAP, (caddr_t)&bm, -1, NULL); /* XXX type of bm ? */ gp->g_data = (caddr_t) 0xDeadBeaf; /* not particularly clean.. */ @@ -206,7 +214,8 @@ grf_cc_on(gp) gi->gd_fbaddr = bm.hardware_address; gi->gd_fbsize = bm.depth*bm.bytes_per_row*bm.rows; - if (viewioctl (0, VIOCGSIZE, &vs, 0, -1)) { + if (viewioctl (0, VIOCGSIZE, (caddr_t)&vs, -1, NULL)) { + /* XXX type of vs ? */ /* fill in some default values... XXX */ vs.width = 640; vs.height = 400; @@ -227,7 +236,7 @@ grf_cc_on(gp) gp->g_regkva = (void *)0xDeadBeaf; /* builtin */ gp->g_fbkva = NULL; /* not needed, view internal */ - viewioctl(0, VIOCDISPLAY, NULL, 0, -1); + viewioctl(0, VIOCDISPLAY, NULL, -1, NULL); } #endif diff --git a/sys/arch/amiga/dev/grf_ccreg.h b/sys/arch/amiga/dev/grf_ccreg.h index fd01541c90f..116fdb48c7e 100644 --- a/sys/arch/amiga/dev/grf_ccreg.h +++ b/sys/arch/amiga/dev/grf_ccreg.h @@ -1,4 +1,5 @@ -/* $NetBSD: grf_ccreg.h,v 1.8 1995/02/16 21:57:35 chopps Exp $ */ +/* $OpenBSD: grf_ccreg.h,v 1.2 1996/05/02 06:43:43 niklas Exp $ */ +/* $NetBSD: grf_ccreg.h,v 1.9 1996/04/21 21:11:10 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -31,4 +32,4 @@ */ int grfcc_cnprobe __P((void)); void grfcc_iteinit __P((struct grf_softc *)); -int cc_mode __P((struct grf_softc *, int, void *, int, int)); +int cc_mode __P((struct grf_softc *, u_long, void *, u_long, int)); diff --git a/sys/arch/amiga/dev/grf_cl.c b/sys/arch/amiga/dev/grf_cl.c index 16fec232a85..bd378751cf6 100644 --- a/sys/arch/amiga/dev/grf_cl.c +++ b/sys/arch/amiga/dev/grf_cl.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_cl.c,v 1.3 1996/04/21 22:15:10 deraadt Exp $ */ -/* $NetBSD: grf_cl.c,v 1.8 1996/03/17 05:58:35 mhitch Exp $ */ +/* $OpenBSD: grf_cl.c,v 1.4 1996/05/02 06:43:44 niklas Exp $ */ +/* $NetBSD: grf_cl.c,v 1.10 1996/04/28 06:31:47 mhitch Exp $ */ /* * Copyright (c) 1995 Ezra Story @@ -71,35 +71,40 @@ #include <machine/cpu.h> #include <dev/cons.h> +#include <amiga/dev/itevar.h> #include <amiga/amiga/device.h> #include <amiga/dev/grfioctl.h> #include <amiga/dev/grfvar.h> #include <amiga/dev/grf_clreg.h> #include <amiga/dev/zbusvar.h> -static int cl_mondefok __P((struct grfvideo_mode * gv)); -static void cl_boardinit(); -static void CompFQ __P((u_int fq, u_char * num, u_char * denom)); -static int cl_getvmode __P((struct grf_softc * gp, struct grfvideo_mode * vm)); -static int cl_setvmode __P((struct grf_softc * gp, unsigned int mode)); -static int cl_toggle __P((struct grf_softc * gp, unsigned short)); -static int cl_getcmap __P((struct grf_softc * gfp, struct grf_colormap * cmap)); -static int cl_putcmap __P((struct grf_softc * gfp, struct grf_colormap * cmap)); -static void cl_off __P((struct grf_softc * gp)); -static void cl_inittextmode __P((struct grf_softc * gp)); -static int cl_ioctl __P((register struct grf_softc * gp, int cmd, void *data)); -static int cl_getmousepos __P((struct grf_softc * gp, struct grf_position * data)); -static int cl_setmousepos __P((struct grf_softc * gp, struct grf_position * data)); -static int cl_setspriteinfo __P((struct grf_softc * gp, struct grf_spriteinfo * data)); -static int cl_getspriteinfo __P((struct grf_softc * gp, struct grf_spriteinfo * data)); -static int cl_getspritemax __P((struct grf_softc * gp, struct grf_position * data)); -static int cl_blank __P((struct grf_softc * gp, int * on)); - +static int cl_mondefok __P((struct grfvideo_mode *)); +static void cl_boardinit __P((struct grf_softc *)); +static void CompFQ __P((u_int, u_char *, u_char *)); +static int cl_getvmode __P((struct grf_softc *, struct grfvideo_mode *)); +static int cl_setvmode __P((struct grf_softc *, unsigned int)); +static int cl_toggle __P((struct grf_softc *, unsigned short)); +static int cl_getcmap __P((struct grf_softc *, struct grf_colormap *)); +static int cl_putcmap __P((struct grf_softc *, struct grf_colormap *)); +#ifndef CL5426CONSOLE +static void cl_off __P((struct grf_softc *)); +#endif +static void cl_inittextmode __P((struct grf_softc *)); +static int cl_ioctl __P((register struct grf_softc *, u_long, void *)); +static int cl_getmousepos __P((struct grf_softc *, struct grf_position *)); +static int cl_setmousepos __P((struct grf_softc *, struct grf_position *)); +static int cl_setspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); +static int cl_getspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); +static int cl_getspritemax __P((struct grf_softc *, struct grf_position *)); +static int cl_blank __P((struct grf_softc *, int *)); +int cl_setmonitor __P((struct grf_softc *, struct grfvideo_mode *)); +void cl_writesprpos __P((volatile char *, short, short)); +void writeshifted __P((volatile char *, char, char)); void grfclattach __P((struct device *, struct device *, void *)); int grfclprint __P((void *, char *)); int grfclmatch __P((struct device *, void *, void *)); -void cl_memset __P((unsigned char *d, unsigned char c, int l)); +void cl_memset __P((unsigned char *, unsigned char, int)); /* Graphics display definitions. * These are filled by 'grfconfig' using GRFIOCSETMON. @@ -177,7 +182,9 @@ grfclmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { +#ifdef CL5426CONSOLE struct cfdata *cfp = match; +#endif struct zbus_args *zap; static int regprod, fbprod; @@ -248,7 +255,6 @@ grfclattach(pdp, dp, auxp) static struct grf_softc congrf; struct zbus_args *zap; struct grf_softc *gp; - int x; static char attachflag = 0; zap = auxp; @@ -336,7 +342,6 @@ cl_boardinit(gp) { unsigned char *ba = gp->g_regkva; int x; - void *bah; /* wakeup board and flip passthru OFF */ @@ -482,6 +487,7 @@ cl_setvmode(gp, mode) return (0); } +#ifndef CL5426CONSOLE void cl_off(gp) struct grf_softc *gp; @@ -494,6 +500,7 @@ cl_off(gp) RegOnpass(ba); WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x21); } +#endif int cl_blank(gp, on) @@ -508,11 +515,13 @@ cl_blank(gp, on) * Change the mode of the display. * Return a UNIX error number or 0 for success. */ +int cl_mode(gp, cmd, arg, a2, a3) register struct grf_softc *gp; - int cmd; - void *arg; - int a2, a3; + u_long cmd; + void *arg; + u_long a2; + int a3; { int error; @@ -548,7 +557,7 @@ cl_mode(gp, cmd, arg, a2, a3) return (0); case GM_GRFIOCTL: - return (cl_ioctl(gp, (int) arg, (caddr_t) a2)); + return (cl_ioctl(gp, a2, arg)); default: break; @@ -560,7 +569,7 @@ cl_mode(gp, cmd, arg, a2, a3) int cl_ioctl(gp, cmd, data) register struct grf_softc *gp; - int cmd; + u_long cmd; void *data; { switch (cmd) { @@ -635,7 +644,7 @@ cl_writesprpos(ba, x, y) void writeshifted(to, shiftx, shifty) - unsigned char *to; + volatile char *to; char shiftx; char shifty; { @@ -676,9 +685,11 @@ cl_setmousepos(gp, data) struct grf_position *data; { volatile char *ba = gp->g_regkva; + short rx, ry, prx, pry; +#ifdef CL_SHIFTSPRITE volatile char *fb = gp->g_fbkva; volatile char *sprite = fb + (cl_fbsize - 1024); - short rx, ry, prx, pry; +#endif /* no movement */ if (cl_cursprite.pos.x == data->x && cl_cursprite.pos.y == data->y) @@ -950,6 +961,9 @@ cl_getcmap(gfp, cmap) gp = green + cmap->index; bp = blue + cmap->index; break; + default: + rp = gp = bp = 0; + break; } do { @@ -1002,6 +1016,9 @@ cl_putcmap(gfp, cmap) gp = green + cmap->index; bp = blue + cmap->index; break; + default: + rp = gp = bp = 0; + break; } do { @@ -1061,7 +1078,7 @@ CompFQ(fq, num, denom) #define OSC 14318180 #define count(n,d,p) ((OSC * n)/(d * (1+p))) - unsigned char n, d, p, minn, mind, minp; + unsigned char n, d, p, minn, mind, minp = 0; unsigned long err, minerr; /* @@ -1094,7 +1111,7 @@ denom = 0x00 - 0x1f (1) 0x20 - 0x3e (even) *num = minn; *denom = (mind << 1) | minp; if (minerr > 500000) - printf("Warning: CompFQ minimum error = %d\n", minerr); + printf("Warning: CompFQ minimum error = %ld\n", minerr); return; } @@ -1139,12 +1156,12 @@ cl_load_mon(gp, md) struct grfvideo_mode *gv; struct grfinfo *gi; volatile unsigned char *ba; - volatile unsigned char *fb; + volatile caddr_t fb; unsigned char num0, denom0; unsigned short HT, HDE, HBS, HBE, HSS, HSE, VDE, VBS, VBE, VSS, VSE, VT; char LACE, DBLSCAN, TEXT; - unsigned short clkdiv, clksel; + unsigned short clkdiv; int uplim, lowlim; /* identity */ @@ -1265,7 +1282,7 @@ cl_load_mon(gp, md) WCrt(ba, CRT_ID_CURSOR_START, 0x00); WCrt(ba, CRT_ID_CURSOR_END, md->fy & 0x1f); #endif - WCrt(ba, CRT_ID_UNDERLINE_LOC, md->fy - 1 & 0x1f); + WCrt(ba, CRT_ID_UNDERLINE_LOC, (md->fy - 1) & 0x1f); WCrt(ba, CRT_ID_CURSOR_LOC_HIGH, 0x00); WCrt(ba, CRT_ID_CURSOR_LOC_LOW, 0x00); @@ -1303,6 +1320,10 @@ cl_load_mon(gp, md) case 24: clkdiv = 2; break; + default: + clkdiv = 0; + panic("grfcl: Unsuported depth: %i", gv->depth); + break; } WGfx(ba, GCT_ID_GRAPHICS_MODE, diff --git a/sys/arch/amiga/dev/grf_clreg.h b/sys/arch/amiga/dev/grf_clreg.h index 10f550aad22..a55a0c74fa6 100644 --- a/sys/arch/amiga/dev/grf_clreg.h +++ b/sys/arch/amiga/dev/grf_clreg.h @@ -1,4 +1,5 @@ -/* $OpenBSD: grf_clreg.h,v 1.2 1996/03/30 22:18:14 niklas Exp $ */ +/* $OpenBSD: grf_clreg.h,v 1.3 1996/05/02 06:43:45 niklas Exp $ */ +/* $NetBSD: grf_clreg.h,v 1.3 1996/04/21 21:11:13 veego Exp $ */ /* * Copyright (c) 1995 Ezra Story @@ -297,7 +298,6 @@ struct grfcltext_mode { */ static inline void RegWakeup(volatile void *ba) { extern int cltype; - extern unsigned char pass_toggle; switch (cltype) { case SPECTRUM: @@ -372,7 +372,8 @@ static inline unsigned char RGfx(volatile void * ba, short idx) { return vgar (ba, GCT_ADDRESS_R); } -int cl_mode __P((register struct grf_softc *gp, int cmd, void *arg, int a2, int a3)); +int cl_mode __P((register struct grf_softc *gp, u_long cmd, void *arg, + u_long a2, int a3)); int cl_load_mon __P((struct grf_softc *gp, struct grfcltext_mode *gv)); int grfcl_cnprobe __P((void)); void grfcl_iteinit __P((struct grf_softc *gp)); diff --git a/sys/arch/amiga/dev/grf_cv.c b/sys/arch/amiga/dev/grf_cv.c index f1114344dc6..b7f19ad71de 100644 --- a/sys/arch/amiga/dev/grf_cv.c +++ b/sys/arch/amiga/dev/grf_cv.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_cv.c,v 1.7 1996/04/21 22:15:11 deraadt Exp $ */ -/* $NetBSD: grf_cv.c,v 1.11 1996/03/17 05:58:36 mhitch Exp $ */ +/* $OpenBSD: grf_cv.c,v 1.8 1996/05/02 06:43:46 niklas Exp $ */ +/* $NetBSD: grf_cv.c,v 1.12 1996/04/21 21:11:15 veego Exp $ */ /* * Copyright (c) 1995 Michael Teske @@ -39,14 +39,18 @@ * * Modified for CV64 from * Kari Mettinen's Cirrus driver by Michael Teske 10/95 - * For questions mail me at teske@dice2.desy.de + * For questions mail me at teske@mail.desy.de * * Thanks to Tekelec Airtronic for providing me with a S3 Trio64 documentation. * Thanks to Bernd 'the fabulous bug-finder' Ernesti for bringing my messy * source to NetBSD style :) * * TODO: - * Hardware Cursor support + * Bugfree Hardware Cursor support. + * The HWC routines provided here are buggy in 16/24 bit + * and may cause a Vertical Bar Crash of the Trio64. + * On the other hand it's better to put the routines in the Xserver, + * so please don't put CV_HARDWARE_CURSOR in your config file. */ #include <sys/param.h> @@ -74,8 +78,8 @@ void cv_boardinit __P((struct grf_softc *)); int cv_getvmode __P((struct grf_softc *, struct grfvideo_mode *)); int cv_setvmode __P((struct grf_softc *, unsigned int)); int cv_blank __P((struct grf_softc *, int *)); -int cv_mode __P((register struct grf_softc *, int, void *, int, int)); -int cv_ioctl __P((register struct grf_softc *gp, int cmd, void *data)); +int cv_mode __P((register struct grf_softc *, u_long, void *, u_long, int)); +int cv_ioctl __P((register struct grf_softc *gp, u_long cmd, void *data)); int cv_setmonitor __P((struct grf_softc *, struct grfvideo_mode *)); int cv_getcmap __P((struct grf_softc *, struct grf_colormap *)); int cv_putcmap __P((struct grf_softc *, struct grf_colormap *)); @@ -83,11 +87,21 @@ int cv_toggle __P((struct grf_softc *)); int cv_mondefok __P((struct grfvideo_mode *)); int cv_load_mon __P((struct grf_softc *, struct grfcvtext_mode *)); void cv_inittextmode __P((struct grf_softc *)); -void cv_memset __P((unsigned char *, unsigned char, int)); static inline void cv_write_port __P((unsigned short, volatile caddr_t)); static inline void cvscreen __P((int, volatile caddr_t)); static inline void gfx_on_off __P((int, volatile caddr_t)); +#ifdef CV_HARDWARE_CURSOR +int cv_getspritepos __P((struct grf_softc *, struct grf_position *)); +int cv_setspritepos __P((struct grf_softc *, struct grf_position *)); +int cv_getspriteinfo __P((struct grf_softc *,struct grf_spriteinfo *)); +void cv_setup_hwc __P((struct grf_softc *, + unsigned char, unsigned char, unsigned char, unsigned char, + const unsigned long *)); +int cv_setspriteinfo __P((struct grf_softc *,struct grf_spriteinfo *)); +int cv_getspritemax __P((struct grf_softc *,struct grf_position *)); +#endif /* CV_HARDWARE_CURSOR */ + /* Graphics display definitions. * These are filled by 'grfconfig' using GRFIOCSETMON. */ @@ -138,8 +152,24 @@ struct grfcvtext_mode cvconsole_mode = { }; /* Console colors */ -unsigned char cvconscolors[4][3] = { /* background, foreground, hilite */ - {0x30, 0x30, 0x30}, {0, 0, 0}, {0x18, 0x20, 0x34}, {0x2a, 0x2a, 0x2a} +unsigned char cvconscolors[16][3] = { /* background, foreground, hilite */ + /* R G B */ + {0x30, 0x30, 0x30}, + {0x00, 0x00, 0x00}, + {0x80, 0x00, 0x00}, + {0x00, 0x80, 0x00}, + {0x00, 0x00, 0x80}, + {0x80, 0x80, 0x00}, + {0x00, 0x80, 0x80}, + {0x80, 0x00, 0x80}, + {0xff, 0xff, 0xff}, + {0x40, 0x40, 0x40}, + {0xff, 0x00, 0x00}, + {0x00, 0xff, 0x00}, + {0x00, 0x00, 0xff}, + {0xff, 0xff, 0x00}, + {0x00, 0xff, 0xff}, + {0xff, 0x00, 0xff} }; static unsigned char clocks[]={ @@ -214,7 +244,7 @@ static int cv_fbsize; /* * Memory clock (binpatchable). - * Let's be defensive: 45 MHz runs on all boards I know of. + * Let's be defensive: 50 MHz runs on all boards I know of. * 55 MHz runs on most boards. But you should know what you're doing * if you set this flag. Again: This flag may destroy your CV Board. * Use it at your own risk!!! @@ -224,7 +254,7 @@ static int cv_fbsize; #ifdef CV_AGGRESSIVE_TIMING long cv_memclk = 55000000; #else -long cv_memclk = 45000000; +long cv_memclk = 50000000; #endif /* standard driver stuff */ @@ -313,7 +343,7 @@ grfcvattach(pdp, dp, auxp) static struct grf_softc congrf; struct zbus_args *zap; struct grf_softc *gp; - static char attachflag = 0; + static char attachflag = 0; zap = auxp; @@ -461,10 +491,10 @@ cv_boardinit(gp) /* Wakeup Chip */ vgaw(ba, SREG_VIDEO_SUBS_ENABLE, 0x10); - vgaw(ba, SREG_OPTION_SELECT, 0x1); - vgaw(ba, SREG_VIDEO_SUBS_ENABLE, 0x8); + vgaw(ba, SREG_OPTION_SELECT, 0x01); + vgaw(ba, SREG_VIDEO_SUBS_ENABLE, 0x08); - vgaw(ba, GREG_MISC_OUTPUT_W, 0x23); + vgaw(ba, GREG_MISC_OUTPUT_W, 0x03); WCrt(ba, CRT_ID_REGISTER_LOCK_1, 0x48); /* unlock S3 VGA regs */ WCrt(ba, CRT_ID_REGISTER_LOCK_2, 0xA5); /* unlock syscontrol */ @@ -478,25 +508,25 @@ cv_boardinit(gp) * bit 1=1: enable enhanced mode functions * bit 4=1: enable linear adressing * bit 5=1: enable MMIO - */ + */ vgaw(ba, ECR_ADV_FUNC_CNTL, 0x31); /* enable cpu acess, color mode, high 64k page */ vgaw(ba, GREG_MISC_OUTPUT_W, 0x23); /* Cpu base addr */ - WCrt(ba, CRT_ID_EXT_SYS_CNTL_4, 0x0); + WCrt(ba, CRT_ID_EXT_SYS_CNTL_4, 0x00); /* Reset. This does nothing, but everyone does it:) */ - WSeq(ba, SEQ_ID_RESET, 0x3); + WSeq(ba, SEQ_ID_RESET, 0x03); - WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x1); /* 8 Dot Clock */ - WSeq(ba, SEQ_ID_MAP_MASK, 0xF); /* Enable write planes */ - WSeq(ba, SEQ_ID_CHAR_MAP_SELECT, 0x0); /* Character Font */ + WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x01); /* 8 Dot Clock */ + WSeq(ba, SEQ_ID_MAP_MASK, 0x0f); /* Enable write planes */ + WSeq(ba, SEQ_ID_CHAR_MAP_SELECT, 0x00); /* Character Font */ - WSeq(ba, SEQ_ID_MEMORY_MODE, 0x2); /* Complete mem access */ + WSeq(ba, SEQ_ID_MEMORY_MODE, 0x02); /* Complete mem access */ - WSeq(ba, SEQ_ID_UNLOCK_EXT, 0x6); /* Unlock extensions */ + WSeq(ba, SEQ_ID_UNLOCK_EXT, 0x06); /* Unlock extensions */ test = RSeq(ba, SEQ_ID_BUS_REQ_CNTL); /* Bus Request */ /* enable 4MB fast Page Mode */ @@ -509,7 +539,7 @@ cv_boardinit(gp) /* immediately Clkload bit clear */ test = test & 0xDF; - + /* 2 MCLK Memory Write.... */ if (cv_memclk >= 55000000) test |= 0x80; @@ -520,12 +550,13 @@ cv_boardinit(gp) clockpar = compute_clock(cv_memclk); test = (clockpar & 0xFF00) >> 8; WSeq(ba, SEQ_ID_MCLK_HI, test); /* PLL N-Divider Value */ - if (RCrt(ba, CRT_ID_REVISION) == 0x10) /* bugfix for new S3 chips */ - WSeq(ba, SEQ_ID_MORE_MAGIC, test); test = clockpar & 0xFF; WSeq(ba, SEQ_ID_MCLK_LO, test); /* PLL M-Divider Value */ + if (RCrt(ba, CRT_ID_REVISION) == 0x10) /* bugfix for new S3 chips */ + WSeq(ba, SEQ_ID_MORE_MAGIC, test); + /* We now load an 25 MHz, 31 kHz, 640x480 standard VGA Mode. */ /* DCLK */ WSeq(ba, SEQ_ID_DCLK_HI, 0x13); @@ -543,7 +574,7 @@ cv_boardinit(gp) vgaw(ba, 0x3c2, test); /* Clear bit 5 again, prevent further loading. */ - WSeq(ba, SEQ_ID_CLKSYN_CNTL_2, 0x2); + WSeq(ba, SEQ_ID_CLKSYN_CNTL_2, 0x02); WCrt(ba, CRT_ID_HOR_TOTAL, 0x5F); WCrt(ba, CRT_ID_HOR_DISP_ENA_END, 0x4F); @@ -555,7 +586,7 @@ cv_boardinit(gp) WCrt(ba, CRT_ID_OVERFLOW, 0x1F); /* overflow reg */ - WCrt(ba, CRT_ID_PRESET_ROW_SCAN, 0x0); /* no panning */ + WCrt(ba, CRT_ID_PRESET_ROW_SCAN, 0x00); /* no panning */ WCrt(ba, CRT_ID_MAX_SCAN_LINE, 0x40); /* vscan */ @@ -602,11 +633,11 @@ cv_boardinit(gp) /* N Parameter for Display FIFO */ WCrt(ba, CRT_ID_EXT_MEM_CNTL_3, 0xFF); - WGfx(ba, GCT_ID_SET_RESET, 0x0); - WGfx(ba, GCT_ID_ENABLE_SET_RESET, 0x0); - WGfx(ba, GCT_ID_COLOR_COMPARE, 0x0); - WGfx(ba, GCT_ID_DATA_ROTATE, 0x0); - WGfx(ba, GCT_ID_READ_MAP_SELECT, 0x0); + WGfx(ba, GCT_ID_SET_RESET, 0x00); + WGfx(ba, GCT_ID_ENABLE_SET_RESET, 0x00); + WGfx(ba, GCT_ID_COLOR_COMPARE, 0x00); + WGfx(ba, GCT_ID_DATA_ROTATE, 0x00); + WGfx(ba, GCT_ID_READ_MAP_SELECT, 0x00); WGfx(ba, GCT_ID_GRAPHICS_MODE, 0x40); WGfx(ba, GCT_ID_MISC, 0x01); WGfx(ba, GCT_ID_COLOR_XCARE, 0x0F); @@ -619,8 +650,8 @@ cv_boardinit(gp) WAttr(ba, ACT_ID_ATTR_MODE_CNTL, 0x41); WAttr(ba, ACT_ID_OVERSCAN_COLOR, 0x01); WAttr(ba, ACT_ID_COLOR_PLANE_ENA, 0x0F); - WAttr(ba, ACT_ID_HOR_PEL_PANNING, 0x0); - WAttr(ba, ACT_ID_COLOR_SELECT, 0x0); + WAttr(ba, ACT_ID_HOR_PEL_PANNING, 0x00); + WAttr(ba, ACT_ID_COLOR_SELECT, 0x00); vgaw(ba, VDAC_MASK, 0xFF); /* DAC Mask */ @@ -651,6 +682,42 @@ cv_boardinit(gp) WCrt(ba, CRT_ID_LAW_CNTL, 0x12); /* 2 MB */ } + /* Initialize graphics engine */ + GfxBusyWait(ba); + vgaw16(ba, ECR_FRGD_MIX, 0x27); + vgaw16(ba, ECR_BKGD_MIX, 0x07); + + vgaw16(ba, ECR_READ_REG_DATA, 0x1000); + delay(200000); + vgaw16(ba, ECR_READ_REG_DATA, 0x2000); + GfxBusyWait(ba); + vgaw16(ba, ECR_READ_REG_DATA, 0x3fff); + GfxBusyWait(ba); + delay(200000); + vgaw16(ba, ECR_READ_REG_DATA, 0x4fff); + GfxBusyWait(ba); + + vgaw16(ba, ECR_BITPLANE_WRITE_MASK, ~0); + + GfxBusyWait (ba); + vgaw16(ba, ECR_READ_REG_DATA, 0xe000); + vgaw16(ba, ECR_CURRENT_Y_POS2, 0x00); + vgaw16(ba, ECR_CURRENT_X_POS2, 0x00); + vgaw16(ba, ECR_READ_REG_DATA, 0xa000); + vgaw16(ba, ECR_DEST_Y__AX_STEP, 0x00); + vgaw16(ba, ECR_DEST_Y2__AX_STEP2, 0x00); + vgaw16(ba, ECR_DEST_X__DIA_STEP, 0x00); + vgaw16(ba, ECR_DEST_X2__DIA_STEP2, 0x00); + vgaw16(ba, ECR_SHORT_STROKE, 0x00); + vgaw16(ba, ECR_DRAW_CMD, 0x01); + GfxBusyWait (ba); + + /* It ain't easy to write here, so let's do it again */ + vgaw16(ba, ECR_READ_REG_DATA, 0x4fff); + + vgaw16(ba, ECR_BKGD_COLOR, 0x01); + vgaw16(ba, ECR_FRGD_COLOR, 0x00); + /* Enable Video Display (Set Bit 5) */ WAttr(ba, 0x33, 0); @@ -737,19 +804,20 @@ cv_blank(gp, on) int cv_mode(gp, cmd, arg, a2, a3) register struct grf_softc *gp; - int cmd; + u_long cmd; void *arg; - int a2, a3; + u_long a2; + int a3; { int error; switch (cmd) { - case GM_GRFON: + case GM_GRFON: error = cv_load_mon (gp, (struct grfcvtext_mode *) monitor_current) ? 0 : EINVAL; return (error); - case GM_GRFOFF: + case GM_GRFOFF: #ifndef CV64CONSOLE (void)cv_toggle(gp); #else @@ -758,68 +826,87 @@ cv_mode(gp, cmd, arg, a2, a3) #endif return (0); - case GM_GRFCONFIG: + case GM_GRFCONFIG: return (0); - case GM_GRFGETVMODE: + case GM_GRFGETVMODE: return (cv_getvmode (gp, (struct grfvideo_mode *) arg)); - case GM_GRFSETVMODE: + case GM_GRFSETVMODE: error = cv_setvmode (gp, *(unsigned *) arg); if (!error && (gp->g_flags & GF_GRFON)) cv_load_mon(gp, (struct grfcvtext_mode *) monitor_current); return (error); - case GM_GRFGETNUMVM: + case GM_GRFGETNUMVM: *(int *)arg = monitor_def_max; return (0); - case GM_GRFIOCTL: - return (cv_ioctl (gp, (int) arg, (caddr_t) a2)); + case GM_GRFIOCTL: + return (cv_ioctl (gp, a2, arg)); - default: + default: break; } return (EINVAL); } + int cv_ioctl (gp, cmd, data) register struct grf_softc *gp; - int cmd; + u_long cmd; void *data; { switch (cmd) { - case GRFIOCGSPRITEPOS: - case GRFIOCSSPRITEPOS: - case GRFIOCSSPRITEINF: - case GRFIOCGSPRITEINF: - case GRFIOCGSPRITEMAX: +#ifdef CV_HARDWARE_CURSOR + case GRFIOCGSPRITEPOS: + return(cv_getspritepos (gp, (struct grf_position *) data)); + + case GRFIOCSSPRITEPOS: + return(cv_setspritepos (gp, (struct grf_position *) data)); + + case GRFIOCSSPRITEINF: + return(cv_setspriteinfo (gp, (struct grf_spriteinfo *) data)); + + case GRFIOCGSPRITEINF: + return(cv_getspriteinfo (gp, (struct grf_spriteinfo *) data)); + + case GRFIOCGSPRITEMAX: + return(cv_getspritemax (gp, (struct grf_position *) data)); +#else /* CV_HARDWARE_CURSOR */ + case GRFIOCGSPRITEPOS: + case GRFIOCSSPRITEPOS: + case GRFIOCSSPRITEINF: + case GRFIOCGSPRITEINF: + case GRFIOCGSPRITEMAX: break; +#endif /* CV_HARDWARE_CURSOR */ - case GRFIOCGETCMAP: + case GRFIOCGETCMAP: return (cv_getcmap (gp, (struct grf_colormap *) data)); - case GRFIOCPUTCMAP: + case GRFIOCPUTCMAP: return (cv_putcmap (gp, (struct grf_colormap *) data)); - case GRFIOCBITBLT: + case GRFIOCBITBLT: break; - case GRFTOGGLE: + case GRFTOGGLE: return (cv_toggle (gp)); - case GRFIOCSETMON: + case GRFIOCSETMON: return (cv_setmonitor (gp, (struct grfvideo_mode *)data)); - case GRFIOCBLANK: + case GRFIOCBLANK: return (cv_blank (gp, (int *)data)); } return (EINVAL); } + int cv_setmonitor(gp, gv) struct grf_softc *gp; @@ -862,6 +949,7 @@ cv_setmonitor(gp, gv) return (0); } + int cv_getcmap(gfp, cmap) struct grf_softc *gfp; @@ -901,6 +989,7 @@ cv_getcmap(gfp, cmap) return (error); } + int cv_putcmap(gfp, cmap) struct grf_softc *gfp; @@ -963,24 +1052,16 @@ cv_mondefok(gv) if (gv->mode_num < 1 || gv->mode_num > monitor_def_max) { if (gv->mode_num != 255 || (gv->depth != 4 && gv->depth != 8)) return (0); - else - /* - * We have 8 bit console modes. This _is_ - * a hack but necessary to be compatible. - */ - gv->depth = 8; } switch(gv->depth) { - case 1: case 4: - return (0); case 8: maxpix = MAXPIXELCLOCK; break; case 15: case 16: -#ifdef CV_AGGRESSIVE_TIMING +#ifdef CV_AGGRESSIVE_TIMING maxpix = MAXPIXELCLOCK - 35000000; #else maxpix = MAXPIXELCLOCK - 55000000; @@ -988,7 +1069,7 @@ cv_mondefok(gv) break; case 24: case 32: -#ifdef CV_AGGRESSIVE_TIMING +#ifdef CV_AGGRESSIVE_TIMING maxpix = MAXPIXELCLOCK - 75000000; #else maxpix = MAXPIXELCLOCK - 85000000; @@ -1030,9 +1111,7 @@ cv_mondefok(gv) if (widthok) return (1); else { if (gv->mode_num == 255) { /* console mode */ - printf ("This display width is not supported by the CV64 console.\n"); - printf ("Use one of 640 800 1024 1152 1280 1600!\n"); - return (0); + return (1); } else { printf ("Warning for mode %d:\n", (int) gv->mode_num); printf ("Don't use a blitter-suporting Xserver with this display width\n"); @@ -1043,6 +1122,7 @@ cv_mondefok(gv) return (1); } + int cv_load_mon(gp, md) struct grf_softc *gp; @@ -1063,11 +1143,7 @@ cv_load_mon(gp, md) /* identity */ gv = &md->gv; - /* - * No way to get text modes to work. - * Blame phase5, not me! - */ - TEXT = 0; /* (gv->depth == 4); */ + TEXT = (gv->depth == 4); CONSOLE = (gv->mode_num == 255); if (!cv_mondefok(gv)) { @@ -1108,7 +1184,7 @@ cv_load_mon(gp, md) break; default: hmul = 1; - break; + break; } HBS = gv->hblank_start * hmul; @@ -1122,6 +1198,10 @@ cv_load_mon(gp, md) VBE = gv->vblank_stop; VT = gv->vtotal - 2; + /* Disable enhanced Mode for text display */ + + vgaw(ba, ECR_ADV_FUNC_CNTL, (TEXT ? 0x00 : 0x31)); + if (TEXT) HDE = ((gv->disp_width + md->fx - 1) / md->fx) - 1; else @@ -1140,6 +1220,9 @@ cv_load_mon(gp, md) if (LACE) VDE /= 2; + /* GFx hardware cursor off */ + WCrt(ba, CRT_ID_HWGC_MODE, 0x00); + WSeq(ba, SEQ_ID_MEMORY_MODE, (TEXT || (gv->depth == 1)) ? 0x06 : 0x0e); WGfx(ba, GCT_ID_READ_MAP_SELECT, 0x00); WSeq(ba, SEQ_ID_MAP_MASK, (gv->depth == 1) ? 0x01 : 0xff); @@ -1148,7 +1231,7 @@ cv_load_mon(gp, md) /* Set clock */ mnr = compute_clock(gv->pixel_clock); - WSeq(ba, SEQ_ID_DCLK_HI, ((mnr & 0xFF00) >> 8) ); + WSeq(ba, SEQ_ID_DCLK_HI, ((mnr & 0xFF00) >> 8)); WSeq(ba, SEQ_ID_DCLK_LO, (mnr & 0xFF)); /* load display parameters into board */ @@ -1196,8 +1279,7 @@ cv_load_mon(gp, md) ((VBS & 0x200) ? 0x20 : 0x00) | (TEXT ? ((md->fy - 1) & 0x1f) : 0x00)); - WCrt(ba, CRT_ID_MODE_CONTROL, - ((TEXT || (gv->depth == 1)) ? 0xc3 : 0xe3)); + WCrt(ba, CRT_ID_MODE_CONTROL, 0xe3); /* text cursor */ @@ -1295,6 +1377,8 @@ cv_load_mon(gp, md) WCrt(ba, CRT_ID_BACKWAD_COMP_2, cr33); WCrt(ba, CRT_ID_SCREEN_OFFSET, HDE); + WCrt(ba, CRT_ID_MISC_1, (TEXT ? 0x05 : 0x35)); + test = RCrt(ba, CRT_ID_EXT_SYS_CNTL_2); test &= ~0x30; /* HDE Overflow in bits 4-5 */ @@ -1328,7 +1412,7 @@ cv_load_mon(gp, md) WCrt(ba, CRT_ID_EXT_SYS_CNTL_1, cr50); delay(100000); - WAttr(ba, ACT_ID_ATTR_MODE_CNTL, (TEXT ? 0x0a : 0x41)); + WAttr(ba, ACT_ID_ATTR_MODE_CNTL, (TEXT ? 0x08 : 0x41)); delay(100000); WAttr(ba, ACT_ID_COLOR_PLANE_ENA, (gv->depth == 1) ? 0x01 : 0x0f); @@ -1363,6 +1447,8 @@ cv_load_mon(gp, md) } m = (temptym - tfillm - 9) / 2; + if (m < 0) + m = 0; /* prevent underflow */ m = (m & 0x1f) << 3; if (m < 0x18) m = 0x18; @@ -1381,7 +1467,7 @@ cv_load_mon(gp, md) if (CONSOLE) { int i; vgaw(ba, VDAC_ADDRESS_W, 0); - for (i = 0; i < 4; i++) { + for (i = 0; i < 16; i++) { vgaw(ba, VDAC_DATA, cvconscolors[i][0]); vgaw(ba, VDAC_DATA, cvconscolors[i][1]); vgaw(ba, VDAC_DATA, cvconscolors[i][2]); @@ -1400,6 +1486,7 @@ cv_load_mon(gp, md) return (1); } + void cv_inittextmode(gp) struct grf_softc *gp; @@ -1414,54 +1501,44 @@ cv_inittextmode(gp) /* load text font into beginning of display memory. * Each character cell is 32 bytes long (enough for 4 planes) + * In linear adressing text mode, the memory is organized + * so, that the Bytes of all 4 planes are interleaved. + * 1st byte plane 0, 1st byte plane 1, 1st byte plane 2, + * 1st byte plane 3, 2nd byte plane 0, 2nd byte plane 1,... + * The font is loaded in plane 2. */ - SetTextPlane(ba, 0x02); - cv_memset(fb, 0, 256 * 32); - c = (unsigned char *) (fb) + (32 * tm->fdstart); - f = tm->fdata; - for (z = tm->fdstart; z <= tm->fdend; z++, c += (32 - tm->fy)) - for (y = 0; y < tm->fy; y++) - *c++ = *f++; + c = (unsigned char *) fb; - /* clear out text/attr planes (three screens worth) */ + /* clear screen */ + for (z = 0; z < tm->cols * tm->rows * 3; z++) { + *c++ = 0x20; + *c++ = 0x07; + *c++ = 0; + *c++ = 0; + } - SetTextPlane(ba, 0x01); - cv_memset(fb, 0x07, tm->cols * tm->rows * 3); - SetTextPlane(ba, 0x00); - cv_memset(fb, 0x20, tm->cols * tm->rows * 3); + c = (unsigned char *) (fb) + (32 * tm->fdstart * 4 + 2); + f = tm->fdata; + for (z = tm->fdstart; z <= tm->fdend; z++, c += (32 - tm->fy) * 4) + for (y = 0; y < tm->fy; y++) { + *c = *f++; + c += 4; + } /* print out a little init msg */ - - c = (unsigned char *)(fb) + (tm->cols-16); - strcpy(c, "CV64"); - c[6] = 0x20; - - /* set colors (B&W) */ - - vgaw(ba, VDAC_ADDRESS_W, 0); - for (z=0; z<256; z++) { - unsigned char r, g, b; - - y = (z & 1) ? ((z > 7) ? 2 : 1) : 0; - - r = cvconscolors[y][0]; - g = cvconscolors[y][1]; - b = cvconscolors[y][2]; - vgaw(ba, VDAC_DATA, r >> 2); - vgaw(ba, VDAC_DATA, g >> 2); - vgaw(ba, VDAC_DATA, b >> 2); - } -} - -void -cv_memset(d, c, l) - unsigned char *d; - unsigned char c; - int l; -{ - for(; l > 0; l--) - *d++ = c; + c = (unsigned char *)(fb) + (tm->cols - 6) * 4; + *c++ = 'C'; + *c++ = 0x0a; + c +=2; + *c++ = 'V'; + *c++ = 0x0b; + c +=2; + *c++ = '6'; + *c++ = 0x0c; + c +=2; + *c++ = '4'; + *c++ = 0x0d; } @@ -1504,6 +1581,7 @@ cvscreen(toggle, ba) cv_write_port (0x8010, ba); } + /* 0 = on, 1= off */ /* ba= registerbase */ static inline void @@ -1522,4 +1600,364 @@ gfx_on_off(toggle, ba) WSeq(ba, SEQ_ID_CLOCKING_MODE, r | toggle); } + +#ifdef CV_HARDWARE_CURSOR + +static unsigned char cv_hotx = 0, cv_hoty = 0; + +/* Hardware Cursor handling routines */ + +int +cv_getspritepos (gp, pos) + struct grf_softc *gp; + struct grf_position *pos; +{ + int hi,lo; + volatile caddr_t ba = gp->g_regkva; + + hi = RCrt (ba, CRT_ID_HWGC_ORIGIN_Y_HI); + lo = RCrt (ba, CRT_ID_HWGC_ORIGIN_Y_LO); + + pos->y = (hi << 8) + lo; + hi = RCrt (ba, CRT_ID_HWGC_ORIGIN_X_HI); + lo = RCrt (ba, CRT_ID_HWGC_ORIGIN_X_LO); + pos->x = (hi << 8) + lo; + return (0); +} + + +int +cv_setspritepos (gp, pos) + struct grf_softc *gp; + struct grf_position *pos; +{ + volatile caddr_t ba = gp->g_regkva; + short x = pos->x, y = pos->y; + short xoff, yoff; + + x -= cv_hotx; + y -= cv_hoty; + if (x < 0) { + xoff = ((-x) & 0xFE); + x = 0; + } else { + xoff = 0; + } + + if (y < 0) { + yoff = ((-y) & 0xFE); + y = 0; + } else { + yoff = 0; + } + + WCrt (ba, CRT_ID_HWGC_ORIGIN_X_HI, (x >> 8)); + WCrt (ba, CRT_ID_HWGC_ORIGIN_X_LO, (x & 0xff)); + + WCrt (ba, CRT_ID_HWGC_ORIGIN_Y_LO, (y & 0xff)); + WCrt (ba, CRT_ID_HWGC_DSTART_X, xoff); + WCrt (ba, CRT_ID_HWGC_DSTART_Y, yoff); + WCrt (ba, CRT_ID_HWGC_ORIGIN_Y_HI, (y >> 8)); + + return(0); +} + +#define M2I(val) \ + asm volatile (" rorw #8,%0 ; \ + swap %0 ; \ + rorw #8,%0 ; " : "=d" (val) : "0" (val)); + +#define M2INS(val) \ + asm volatile (" rorw #8,%0 ; \ + swap %0 ; \ + rorw #8,%0 ; \ + swap %0 ; " : "=d" (val) : "0" (val)); + +#define HWC_OFF (cv_fbsize - 1024*2) +#define HWC_SIZE 1024 + + +int +cv_getspriteinfo (gp, info) + struct grf_softc *gp; + struct grf_spriteinfo *info; +{ + volatile caddr_t ba, fb; + + ba = gp->g_regkva; + fb = gp->g_fbkva; + + if (info->set & GRFSPRSET_ENABLE) + info->enable = RCrt(ba, CRT_ID_HWGC_MODE) & 0x01; + + if (info->set & GRFSPRSET_POS) + cv_getspritepos (gp, &info->pos); + +#if 0 /* XXX */ + if (info->set & GRFSPRSET_SHAPE) { + u_char image[512], mask[512]; + volatile u_long *hwp; + u_char *imp, *mp; + short row; + info->size.x = 64; + info->size.y = 64; + for (row = 0, hwp = (u_long *)(fb + HWC_OFF), + mp = mask, imp = image; + row < 64; + row++) { + u_long bp10, bp20, bp11, bp21; + bp10 = *hwp++; + bp20 = *hwp++; + bp11 = *hwp++; + bp21 = *hwp++; + M2I (bp10); + M2I (bp20); + M2I (bp11); + M2I (bp21); + *imp++ = (~bp10) & bp11; + *imp++ = (~bp20) & bp21; + *mp++ = (~bp10) | (bp10 & ~bp11); + *mp++ = (~bp20) & (bp20 & ~bp21); + } + copyout (image, info->image, sizeof (image)); + copyout (mask, info->mask, sizeof (mask)); + } +#endif + return(0); +} + + +void +cv_setup_hwc (gp, col1, col2, hsx, hsy, data) + struct grf_softc *gp; + unsigned char col1; + unsigned char col2; + unsigned char hsx; + unsigned char hsy; + const unsigned long *data; +{ + volatile unsigned char *ba = gp->g_regkva; + unsigned long *c = (unsigned long *)(gp->g_fbkva + HWC_OFF); + const unsigned long *s = data; + int test; + + short x = (HWC_SIZE / (4*4)) - 1; + /* copy only, if there is a data pointer. */ + if (data) do { + *c++ = *s++; + *c++ = *s++; + *c++ = *s++; + *c++ = *s++; + } while (x-- > 0); + + /* reset colour stack */ + test = RCrt(ba, CRT_ID_HWGC_MODE); + asm volatile("nop"); + WCrt (ba, CRT_ID_HWGC_FG_STACK, 0); + WCrt (ba, CRT_ID_HWGC_FG_STACK, 0); + WCrt (ba, CRT_ID_HWGC_FG_STACK, 0); + + test = RCrt(ba, CRT_ID_HWGC_MODE); + asm volatile("nop"); + WCrt (ba, CRT_ID_HWGC_BG_STACK, 0x1); + WCrt (ba, CRT_ID_HWGC_BG_STACK, 0x1); + WCrt (ba, CRT_ID_HWGC_BG_STACK, 0x1); + + test = HWC_OFF / HWC_SIZE; + WCrt (ba, CRT_ID_HWGC_START_AD_HI, (test >> 8)); + WCrt (ba, CRT_ID_HWGC_START_AD_LO, (test & 0xff)); + + WCrt (ba, CRT_ID_HWGC_DSTART_X , 0); + WCrt (ba, CRT_ID_HWGC_DSTART_Y , 0); + + WCrt (ba, CRT_ID_EXT_DAC_CNTL, 0x10); /* Cursor X11 Mode */ + + WCrt (ba, CRT_ID_HWGC_MODE, 0x01); +} + + +/* This is the reason why you shouldn't use the HGC in the Kernel:( */ + +#define VerticalRetraceWait(ba) \ +{ \ + while (vgar(ba, GREG_INPUT_STATUS1_R) == 0x00) ; \ + while ((vgar(ba, GREG_INPUT_STATUS1_R) & 0x08) == 0x08) ; \ + while ((vgar(ba, GREG_INPUT_STATUS1_R) & 0x08) == 0x00) ; \ +} + + +int +cv_setspriteinfo (gp, info) + struct grf_softc *gp; + struct grf_spriteinfo *info; +{ + volatile caddr_t ba, fb; + + ba = gp->g_regkva; + fb = gp->g_fbkva; + + if (info->set & GRFSPRSET_SHAPE) { + /* + * For an explanation of these weird actions here, see above + * when reading the shape. We set the shape directly into + * the video memory, there's no reason to keep 1k on the + * kernel stack just as template + */ + u_char *image, *mask; + volatile u_short *hwp; + u_char *imp, *mp; + unsigned short row; + + /* Cursor off */ + WCrt (ba, CRT_ID_HWGC_MODE, 0x00); + /* move cursor off-screen */ + WCrt (ba, CRT_ID_HWGC_ORIGIN_X_HI, 0x7); + WCrt (ba, CRT_ID_HWGC_ORIGIN_X_LO, 0xff); + WCrt (ba, CRT_ID_HWGC_ORIGIN_Y_LO, 0xff); + WCrt (ba, CRT_ID_HWGC_DSTART_X, 0x3f); + WCrt (ba, CRT_ID_HWGC_DSTART_Y, 0x3f); + WCrt (ba, CRT_ID_HWGC_ORIGIN_Y_HI, 0x7); + + if (info->size.y > 64) + info->size.y = 64; + if (info->size.x > 64) + info->size.x = 64; + if (info->size.x < 32) + info->size.x = 32; + + image = malloc(HWC_SIZE, M_TEMP, M_WAITOK); + mask = image + HWC_SIZE/2; + + copyin(info->image, image, info->size.y * info->size.x / 8); + copyin(info->mask, mask, info->size.y * info->size.x / 8); + + hwp = (u_short *)(fb +HWC_OFF); + + /* + * setting it is slightly more difficult, because we can't + * force the application to not pass a *smaller* than + * supported bitmap + */ + + for (row = 0, mp = mask, imp = image; + row < info->size.y; row++) { + u_short im1, im2, im3, im4, m1, m2, m3, m4; + + im1 = *(unsigned short *)imp; + imp += 2; + m1 = *(unsigned short *)mp; + mp += 2; + + im2 = *(unsigned short *)imp; + imp += 2; + m2 = *(unsigned short *)mp; + mp += 2; + + if (info->size.x > 32) { + im3 = *(unsigned long *)imp; + imp += 4; + m3 = *(unsigned long *)mp; + mp += 4; + im4 = *(unsigned long *)imp; + imp += 4; + m4 = *(unsigned long *)mp; + mp += 4; + } + else + im3 = m3 = im4 = m4 = 0; + + *hwp++ = m1; + *hwp++ = im1; + *hwp++ = m2; + *hwp++ = im2; + *hwp++ = m3; + *hwp++ = im3; + *hwp++ = m4; + *hwp++ = im4; + } + for (; row < 64; row++) { + *hwp++ = 0x0000; + *hwp++ = 0x0000; + *hwp++ = 0x0000; + *hwp++ = 0x0000; + *hwp++ = 0x0000; + *hwp++ = 0x0000; + *hwp++ = 0x0000; + *hwp++ = 0x0000; + } + free(image, M_TEMP); + cv_setup_hwc(gp, 1, 0, 0, 0, NULL); + cv_hotx = info->hot.x; + cv_hoty = info->hot.y; + + /* One must not write twice per vertical blank :-( */ + VerticalRetraceWait(ba); + + cv_setspritepos (gp, &info->pos); + } + if (info->set & GRFSPRSET_CMAP) { + int test; + int depth = gp->g_display.gd_planes; + + /* reset colour stack */ + test = RCrt(ba, CRT_ID_HWGC_MODE); + asm volatile("nop"); + switch (depth) { + case 24: case 32: + WCrt (ba, CRT_ID_HWGC_FG_STACK, 0); + case 8: case 16: + /* info->cmap.green[1] */ + WCrt (ba, CRT_ID_HWGC_FG_STACK, 0); + WCrt (ba, CRT_ID_HWGC_FG_STACK, 0); + } + + test = RCrt(ba, CRT_ID_HWGC_MODE); + asm volatile("nop"); + switch (depth) { + case 8: + WCrt (ba, CRT_ID_HWGC_BG_STACK, 1); + WCrt (ba, CRT_ID_HWGC_BG_STACK, 1); + break; + case 32: case 24: + WCrt (ba, CRT_ID_HWGC_BG_STACK, 0xff); + case 16: + WCrt (ba, CRT_ID_HWGC_BG_STACK, 0xff); + WCrt (ba, CRT_ID_HWGC_BG_STACK, 0xff); + } + } + + if (info->set & GRFSPRSET_ENABLE) { +#if 0 + if (info->enable) + control = 0x85; + else + control = 0; + WSeq(ba, SEQ_ID_CURSOR_CONTROL, control); +#endif + } + if (info->set & GRFSPRSET_POS) + cv_setspritepos(gp, &info->pos); + if (info->set & GRFSPRSET_HOT) { + + cv_hotx = info->hot.x; + cv_hoty = info->hot.y; + cv_setspritepos (gp, &info->pos); + } + return(0); +} + + +int +cv_getspritemax (gp, pos) + struct grf_softc *gp; + struct grf_position *pos; +{ + + pos->x = 64; + pos->y = 64; + return(0); +} + +#endif /* CV_HARDWARE_CURSOR */ + #endif /* NGRFCV */ diff --git a/sys/arch/amiga/dev/grf_rh.c b/sys/arch/amiga/dev/grf_rh.c index 0ce33cc0238..77abac737c5 100644 --- a/sys/arch/amiga/dev/grf_rh.c +++ b/sys/arch/amiga/dev/grf_rh.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_rh.c,v 1.4 1996/04/21 22:15:13 deraadt Exp $ */ -/* $NetBSD: grf_rh.c,v 1.13 1996/03/17 05:58:39 mhitch Exp $ */ +/* $OpenBSD: grf_rh.c,v 1.5 1996/05/02 06:43:48 niklas Exp $ */ +/* $NetBSD: grf_rh.c,v 1.14 1996/04/21 21:11:17 veego Exp $ */ /* * Copyright (c) 1994 Markus Wild @@ -40,6 +40,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/errno.h> #include <sys/ioctl.h> #include <sys/device.h> @@ -89,7 +90,7 @@ extern unsigned char kernel_font_8x11[]; * initial driver, has made an agreement with MS not to document * the driver source (see also his comment below). * -> ALL comments after - * -> "/* -------------- START OF CODE -------------- * /" + * -> " -------------- START OF CODE -------------- " * -> have been added by myself (mw) from studying the publically * -> available "NCR 77C32BLT" Data Manual */ @@ -741,9 +742,9 @@ rh_load_mon(gp, md) struct MonDef *md; { struct grfinfo *gi = &gp->g_display; - volatile unsigned char *ba; - volatile unsigned char *fb; - short FW, clksel, HDE, VDE; + volatile caddr_t ba; + volatile caddr_t fb; + short FW, clksel, HDE = 0, VDE; unsigned short *c, z; const unsigned char *f; @@ -1415,7 +1416,7 @@ int rh_default_gfx = 4; static struct MonDef *current_mon; -int rh_mode __P((struct grf_softc *, int, void *, int, int)); +int rh_mode __P((struct grf_softc *, u_long, void *, u_long, int)); void grfrhattach __P((struct device *, struct device *, void *)); int grfrhprint __P((void *, char *)); int grfrhmatch __P((struct device *, void *, void *)); @@ -1449,7 +1450,7 @@ grfrhmatch(pdp, match, auxp) #endif return(0); if (zap->manid != 18260 || - (zap->prodid != 16) && (zap->prodid != 19)) + ((zap->prodid != 16) && (zap->prodid != 19))) return(0); #ifdef RETINACONSOLE if (amiga_realconfig == 0 || rhconunit != cfp->cf_unit) { @@ -1476,7 +1477,6 @@ grfrhattach(pdp, dp, auxp) void *auxp; { static struct grf_softc congrf; - static int coninited; struct zbus_args *zap; struct grf_softc *gp; @@ -1534,7 +1534,7 @@ rh_getvmode(gp, vm) vm->mode_num = (current_mon - monitor_defs) + 1; md = monitor_defs + (vm->mode_num - 1); - strncpy (vm->mode_descr, monitor_descr + (vm->mode_num - 1), + strncpy (vm->mode_descr, monitor_descr[vm->mode_num - 1], sizeof (vm->mode_descr)); vm->pixel_clock = md->FQ; vm->disp_width = (md->DEP == 4) ? md->MW : md->TX; @@ -1587,7 +1587,6 @@ rh_setvmode(gp, mode, type) unsigned mode; enum mode_type type; { - struct MonDef *md; int error; if (!mode || mode > rh_mon_max) @@ -1609,11 +1608,13 @@ rh_setvmode(gp, mode, type) * Change the mode of the display. * Return a UNIX error number or 0 for success. */ +int rh_mode(gp, cmd, arg, a2, a3) register struct grf_softc *gp; - int cmd; + u_long cmd; void *arg; - int a2, a3; + u_long a2; + int a3; { switch (cmd) { case GM_GRFON: @@ -1645,7 +1646,7 @@ rh_mode(gp, cmd, arg, a2, a3) return(EINVAL); #endif case GM_GRFIOCTL: - return(rh_ioctl (gp, (u_long) arg, (caddr_t) a2)); + return(rh_ioctl (gp, a2, arg)); default: break; @@ -1892,7 +1893,9 @@ rh_setspriteinfo (gp, info) struct grf_spriteinfo *info; { volatile unsigned char *ba, *fb; +#if 0 u_char control; +#endif ba = gp->g_regkva; fb = gp->g_fbkva; @@ -2042,5 +2045,7 @@ rh_bitblt (gp, bb) RZ3BitBlit16(gp, bb); else RZ3BitBlit24(gp, bb); + + return(0); } #endif /* NGRF */ diff --git a/sys/arch/amiga/dev/grf_rhreg.h b/sys/arch/amiga/dev/grf_rhreg.h index 4c09f60cb43..9e47b1d000c 100644 --- a/sys/arch/amiga/dev/grf_rhreg.h +++ b/sys/arch/amiga/dev/grf_rhreg.h @@ -1,4 +1,5 @@ -/* $NetBSD: grf_rhreg.h,v 1.5 1995/08/20 02:54:36 chopps Exp $ */ +/* $OpenBSD: grf_rhreg.h,v 1.2 1996/05/02 06:43:49 niklas Exp $ */ +/* $NetBSD: grf_rhreg.h,v 1.6 1996/04/21 21:11:19 veego Exp $ */ /* * Copyright (c) 1994 Markus Wild @@ -678,12 +679,13 @@ void RZ3AlphaErase __P((struct grf_softc *gp, short unsigned int xd, short unsig void RZ3AlphaCopy __P((struct grf_softc *gp, short unsigned int xs, short unsigned int ys, short unsigned int xd, short unsigned int yd, short unsigned int w, short unsigned int h)); void RZ3BitBlit __P((struct grf_softc *gp, struct grf_bitblt *gbb)); void RZ3BitBlit16 __P((struct grf_softc *gp, struct grf_bitblt *gbb)); +void RZ3BitBlit24 __P((struct grf_softc *gp, struct grf_bitblt *gbb)); void RZ3SetCursorPos __P((struct grf_softc *gp, short unsigned int pos)); void RZ3LoadPalette __P((struct grf_softc *gp, unsigned char *pal, unsigned char firstcol, unsigned char colors)); void RZ3SetPalette __P((struct grf_softc *gp, unsigned char colornum, unsigned char red, unsigned char green, unsigned char blue)); void RZ3SetPanning __P((struct grf_softc *gp, short unsigned int xoff, short unsigned int yoff)); void RZ3SetHWCloc __P((struct grf_softc *gp, short unsigned int x, short unsigned int y)); -int rh_mode __P((register struct grf_softc *gp, int cmd, void *arg, int a2, int a3)); +int rh_mode __P((register struct grf_softc *gp, u_long cmd, void *arg, u_long a2, int a3)); int rh_ioctl __P((register struct grf_softc *gp, u_long cmd, void *data)); int rh_getcmap __P((struct grf_softc *gfp, struct grf_colormap *cmap)); int rh_putcmap __P((struct grf_softc *gfp, struct grf_colormap *cmap)); @@ -694,7 +696,6 @@ int rh_setspriteinfo __P((struct grf_softc *gp, struct grf_spriteinfo *info)); int rh_getspritemax __P((struct grf_softc *gp, struct grf_position *pos)); int rh_bitblt __P((struct grf_softc *gp, struct grf_bitblt *bb)); - struct ite_softc; void rh_init __P((struct ite_softc *)); void rh_cursor __P((struct ite_softc *, int)); @@ -703,4 +704,7 @@ void rh_putc __P((struct ite_softc *, int, int, int, int)); void rh_clear __P((struct ite_softc *, int, int, int, int)); void rh_scroll __P((struct ite_softc *, int, int, int, int)); +int grfrh_cnprobe __P((void)); +void grfrh_iteinit __P((struct grf_softc *)); + #endif /* _GRF_RHREG_H */ diff --git a/sys/arch/amiga/dev/grf_rt.c b/sys/arch/amiga/dev/grf_rt.c index 3fc46f63b83..244065e1bfd 100644 --- a/sys/arch/amiga/dev/grf_rt.c +++ b/sys/arch/amiga/dev/grf_rt.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_rt.c,v 1.3 1996/04/21 22:15:15 deraadt Exp $ */ -/* $NetBSD: grf_rt.c,v 1.24 1996/03/17 01:17:18 thorpej Exp $ */ +/* $OpenBSD: grf_rt.c,v 1.4 1996/05/02 06:43:50 niklas Exp $ */ +/* $NetBSD: grf_rt.c,v 1.25 1996/04/21 21:11:21 veego Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -38,6 +38,7 @@ using the NCR 77C22E+ VGA controller. */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/errno.h> #include <sys/ioctl.h> #include <sys/device.h> @@ -64,7 +65,7 @@ int retina_inited; * initial driver, has made an agreement with MS not to document * the driver source (see also his comment below). * -> ALL comments after - * -> "/* -------------- START OF CODE -------------- * /" + * -> " -------------- START OF CODE -------------- " * -> have been added by myself (mw) from studying the publically * -> available "NCR 77C22E+" Data Manual */ @@ -257,6 +258,10 @@ static const long FQTab[16] = static struct MonDef *default_monitor = &DEFAULT_MONDEF; #endif +int retina_alive __P((struct MonDef *)); +static int rt_load_mon __P((struct grf_softc *, struct MonDef *)); + + /* * used to query the retina to see if its alive (?) */ @@ -285,8 +290,7 @@ rt_load_mon(gp, md) struct MonDef *md; { struct grfinfo *gi = &gp->g_display; - volatile unsigned char *ba; - volatile unsigned char *fb; + volatile caddr_t ba, fb; short FW, clksel, HDE, VDE; for (clksel = 15; clksel; clksel--) { @@ -619,7 +623,7 @@ rt_load_mon(gp, md) /* first set the whole font memory to a test-pattern, so we can see if something that shouldn't be drawn IS drawn.. */ { - volatile unsigned char * c = fb; + volatile caddr_t c = fb; long x; Map(2); @@ -629,7 +633,7 @@ rt_load_mon(gp, md) } { - volatile unsigned char * c = fb; + volatile caddr_t c = fb; long x; Map(3); @@ -641,7 +645,7 @@ rt_load_mon(gp, md) { /* ok, now position at first defined character, and copy over the images */ - volatile unsigned char * c = fb + md->FLo * 32; + volatile caddr_t c = fb + md->FLo * 32; const unsigned char * f = md->FData; unsigned short z; @@ -760,11 +764,21 @@ rt_load_mon(gp, md) return(1); } -int rt_mode __P((struct grf_softc *, int, void *, int , int)); - void grfrtattach __P((struct device *, struct device *, void *)); int grfrtprint __P((void *, char *)); int grfrtmatch __P((struct device *, void *, void *)); + +int rt_mode __P((struct grf_softc *, u_long, void *, u_long, int)); +static int rt_getvmode __P((struct grf_softc *, struct grfvideo_mode *)); +static int rt_setvmode __P((struct grf_softc *, unsigned, int)); +int rt_getspritepos __P((struct grf_softc *, struct grf_position *)); +int rt_setspritepos __P((struct grf_softc *, struct grf_position *)); +int rt_getspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); +int rt_setspriteinfo __P((struct grf_softc *, struct grf_spriteinfo *)); +int rt_getspritemax __P((struct grf_softc *, struct grf_position *)); +int rt_getcmap __P((struct grf_softc *, struct grf_colormap *)); +int rt_putcmap __P((struct grf_softc *, struct grf_colormap *)); +int rt_bitblt __P((struct grf_softc *, struct grf_bitblt *)); struct cfattach grfrt_ca = { sizeof(struct grf_softc), grfrtmatch, grfrtattach @@ -839,7 +853,6 @@ grfrtattach(pdp, dp, auxp) void *auxp; { static struct grf_softc congrf; - static int coninited; struct zbus_args *zap; struct grf_softc *gp; @@ -900,7 +913,7 @@ rt_getvmode (gp, vm) vm->mode_num = (current_mon - monitor_defs) + 1; md = monitor_defs + (vm->mode_num - 1); - strncpy (vm->mode_descr, monitor_descr + (vm->mode_num - 1), + strncpy (vm->mode_descr, monitor_descr[vm->mode_num - 1], sizeof (vm->mode_descr)); vm->pixel_clock = md->FQ; vm->disp_width = md->MW; @@ -951,7 +964,6 @@ rt_setvmode (gp, mode, txtonly) unsigned mode; int txtonly; { - struct MonDef *md; int error; if (!mode || mode > retina_mon_max) @@ -975,9 +987,10 @@ rt_setvmode (gp, mode, txtonly) int rt_mode(gp, cmd, arg, a2, a3) struct grf_softc *gp; - int cmd; + u_long cmd; void *arg; - int a2, a3; + u_long a2; + int a3; { /* implement these later... */ @@ -1017,7 +1030,7 @@ rt_mode(gp, cmd, arg, a2, a3) return rt_setbank (gp, arg); #endif case GM_GRFIOCTL: - return rt_ioctl (gp, (u_long)arg, (void *)a2); + return rt_ioctl (gp, a2, arg); default: break; @@ -1070,7 +1083,7 @@ rt_ioctl (gp, cmd, data) int rt_getbank (gp, offs, prot) struct grf_softc *gp; - off_t offs; + u_long offs; int prot; { /* XXX */ @@ -1233,7 +1246,7 @@ rt_getspriteinfo (gp, info) struct grf_softc *gp; struct grf_spriteinfo *info; { - volatile unsigned char *ba, *fb; + volatile caddr_t ba, fb; ba = gp->g_regkva; fb = gp->g_fbkva; @@ -1281,6 +1294,7 @@ rt_getspriteinfo (gp, info) info->size.y = (RSeq (ba, SEQ_ID_CURSOR_CONTROL) & 6) << 4; } + return 0; } int @@ -1288,7 +1302,7 @@ rt_setspriteinfo (gp, info) struct grf_softc *gp; struct grf_spriteinfo *info; { - volatile unsigned char *ba, *fb; + volatile caddr_t ba, fb; u_char control; ba = gp->g_regkva; @@ -1371,7 +1385,7 @@ rt_bitblt (gp, bb) #if 0 - volatile unsigned char *ba, *fb; + volatile caddr_t ba, fb; u_char control; u_char saved_bank_lo; u_char saved_bank_hi; diff --git a/sys/arch/amiga/dev/grf_rtreg.h b/sys/arch/amiga/dev/grf_rtreg.h index 790d3e0213f..0ac39922455 100644 --- a/sys/arch/amiga/dev/grf_rtreg.h +++ b/sys/arch/amiga/dev/grf_rtreg.h @@ -1,4 +1,5 @@ -/* $NetBSD: grf_rtreg.h,v 1.6 1995/02/16 21:57:41 chopps Exp $ */ +/* $OpenBSD: grf_rtreg.h,v 1.2 1996/05/02 06:43:51 niklas Exp $ */ +/* $NetBSD: grf_rtreg.h,v 1.7 1996/04/21 21:11:23 veego Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -41,7 +42,7 @@ * initial driver, has made an agreement with MS not to document * the driver source (see also his comment below). * -> ALL comments and register defines after - * -> "/* -------------- START OF CODE -------------- * /" + * -> " -------------- START OF CODE -------------- " * -> have been added by myself (mw) from studying the publically * -> available "NCR 77C22E+" Data Manual */ diff --git a/sys/arch/amiga/dev/grf_ul.c b/sys/arch/amiga/dev/grf_ul.c index 43ddbf1e3fb..71bcf41740e 100644 --- a/sys/arch/amiga/dev/grf_ul.c +++ b/sys/arch/amiga/dev/grf_ul.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf_ul.c,v 1.6 1996/04/21 22:15:16 deraadt Exp $ */ -/* $NetBSD: grf_ul.c,v 1.14 1996/03/17 05:58:41 mhitch Exp $ */ +/* $OpenBSD: grf_ul.c,v 1.7 1996/05/02 06:43:52 niklas Exp $ */ +/* $NetBSD: grf_ul.c,v 1.15 1996/04/21 21:11:24 veego Exp $ */ #define UL_DEBUG @@ -63,6 +63,14 @@ int ul_putcmap __P((struct grf_softc *, struct grf_colormap *, dev_t)); int ul_bitblt __P((struct grf_softc *, struct grf_bitblt *, dev_t)); int ul_blank __P((struct grf_softc *, int *, dev_t)); +static int ulisr __P((void *)); +int ulowell_alive __P((struct grfvideo_mode *)); +static void ul_load_code __P((struct grf_softc *)); +static int ul_load_mon __P((struct grf_softc *, struct grfvideo_mode *)); +static int ul_getvmode __P((struct grf_softc *, struct grfvideo_mode *)); +static int ul_setvmode __P((struct grf_softc *, unsigned)); +static __inline void ul_setfb __P((struct grf_softc *, u_long)); + /* * marked true early so that ulowell_cnprobe() can tell if we are alive. */ @@ -160,9 +168,10 @@ static struct grfvideo_mode *current_mon; */ static int -ulisr(gp) -struct grf_softc *gp; +ulisr(arg) + void *arg; { + struct grf_softc *gp = arg; struct gspregs *ba; u_int16_t thebits; @@ -205,8 +214,10 @@ ul_load_code(gp) struct grf_ul_softc *gup; struct gspregs *ba; struct grfinfo *gi; - struct grf_colormap gcm; int i,j; +#if 0 + struct grf_colormap gcm; +#endif gup = (struct grf_ul_softc *)gp; ba = (struct gspregs *)gp->g_regkva; @@ -220,7 +231,7 @@ ul_load_code(gp) gi->gd_fbheight = 1024; gi->gd_colors = 256; - ba->ctrl = (ba->ctrl & ~INCR) | (LBL|INCW); + ba->ctrl = (ba->ctrl & ~INCR) | (LBL | INCW); ba->hstadrh = 0xC000; ba->hstadrl = 0x0080; ba->data = 0x0; /* disable screen refresh and video output */ @@ -375,7 +386,7 @@ ul_load_mon(gp, md) gi->gd_dyn.gdi_dx = 0; gi->gd_dyn.gdi_dy = 0; - ba->ctrl = (ba->ctrl & ~INCR) | (LBL|INCW); + ba->ctrl = (ba->ctrl & ~INCR) | (LBL | INCW); /* XXX */ ba->hstadrh = 0xC000; ba->hstadrl = 0x0000; @@ -403,7 +414,7 @@ ul_load_mon(gp, md) md->pixel_clock = ulowell_clock[0]; } - ba->ctrl |= LBL|INCW; + ba->ctrl |= LBL | INCW; ba->hstadrh = 0xC000; ba->hstadrl = 0x0080; ba->data = (md->vblank_start - md->vblank_stop == md->disp_height ? @@ -426,7 +437,7 @@ ul_load_mon(gp, md) return(1); } -int ul_mode __P((struct grf_softc *, int, void *, int , int)); +int ul_mode __P((struct grf_softc *, u_long, void *, u_long, int)); void grfulattach __P((struct device *, struct device *, void *)); int grfulprint __P((void *, char *)); @@ -637,7 +648,7 @@ ul_setvmode (gp, mode) static __inline void ul_setfb(gp, cmd) struct grf_softc *gp; - int cmd; + u_long cmd; { struct grf_ul_softc *gup; struct gspregs *ba; @@ -675,9 +686,10 @@ ul_setfb(gp, cmd) int ul_mode(gp, cmd, arg, a2, a3) struct grf_softc *gp; - int cmd; + u_long cmd; void *arg; - int a2, a3; + u_long a2; + int a3; { int i; struct grfdyninfo *gd; @@ -710,7 +722,7 @@ ul_mode(gp, cmd, arg, a2, a3) return 0; case GM_GRFIOCTL: - return ul_ioctl (gp, (u_long)arg, (void *)a2, (dev_t)a3); + return ul_ioctl (gp, a2, arg, (dev_t)a3); default: break; @@ -896,7 +908,7 @@ ul_blank(gp, onoff, dev) { struct gspregs *gsp; gsp = (struct gspregs *)gp->g_regkva; - gsp->ctrl = (gsp->ctrl & ~(INCR|INCW) | LBL); + gsp->ctrl = (gsp->ctrl & ~(INCR | INCW)) | LBL; gsp->hstadrh = 0xC000; gsp->hstadrl = 0x0080; if (*onoff) diff --git a/sys/arch/amiga/dev/grfabs.c b/sys/arch/amiga/dev/grfabs.c index 26888d36e06..d9d32b49a51 100644 --- a/sys/arch/amiga/dev/grfabs.c +++ b/sys/arch/amiga/dev/grfabs.c @@ -1,4 +1,5 @@ -/* $NetBSD: grfabs.c,v 1.4 1994/10/26 02:03:21 cgd Exp $ */ +/* $OpenBSD: grfabs.c,v 1.2 1996/05/02 06:43:53 niklas Exp $ */ +/* $NetBSD: grfabs.c,v 1.5 1996/04/21 21:11:25 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -60,6 +61,10 @@ struct vbl_node grf_vbl_node; #define ABS(type, val) \ (type) (((int)(val) < 0) ? -(val) : (val)) +void grf_vbl_function __P((void *data)); +dmode_t *get_best_display_mode __P((u_long, u_long, u_char)); + + void grf_vbl_function(data) void *data; @@ -112,7 +117,7 @@ get_best_display_mode(width, height, depth) monitor_t *m; dmode_t *d, *save; dimen_t dim; - long dx, dy, ct, dt; + long dx, dy, ct, dt = 0; save = NULL; for (m = monitors->lh_first; m != NULL; m = m->link.le_next) { diff --git a/sys/arch/amiga/dev/grfabs_cc.c b/sys/arch/amiga/dev/grfabs_cc.c index 645bbea9aa2..9a097ee7cd4 100644 --- a/sys/arch/amiga/dev/grfabs_cc.c +++ b/sys/arch/amiga/dev/grfabs_cc.c @@ -1,4 +1,5 @@ -/* $NetBSD: grfabs_cc.c,v 1.10 1995/10/05 12:41:12 chopps Exp $ */ +/* $OpenBSD: grfabs_cc.c,v 1.2 1996/05/02 06:43:55 niklas Exp $ */ +/* $NetBSD: grfabs_cc.c,v 1.11 1996/04/21 21:11:28 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -138,6 +139,8 @@ dmdata_t *h_this_data; #define AGA_VGA31KHZ 0x0020 int aga_enable = 0; /* set by start_c(), or can be patched */ +colormap_t *cc_alloc_aga_colormap __P((int)); +int cc_use_aga_colormap __P((view_t *, colormap_t *)); #endif /* monitor functions. */ @@ -231,7 +234,7 @@ get_best_mode(size, depth) { dmode_t *save; dmode_t *dm; - long dt, dx, dy, ct; + long dt = 0, dx, dy, ct; dmdata_t *dmd; save = NULL; @@ -312,7 +315,8 @@ alloc_bitmap(width, height, depth, flags) bm->flags = flags; bm->plane = (u_char **) & bm[1]; bm->blit_temp = ((u_char *) bm->plane) + array_size; - bm->plane[0] = (u_char *) amiga_round_page((u_long) (bm->blit_temp + temp_size)); + bm->plane[0] = (u_char *) amiga_round_page((u_long) + (bm->blit_temp + temp_size)); if (flags & BMF_INTERLEAVED) { bm->row_mod = bm->bytes_per_row * (depth - 1); for (i = 1; i < depth; i++) { @@ -421,7 +425,6 @@ cc_alloc_view(mode, dim, depth) bmap_t *bm = cc_monitor->alloc_bitmap(dim->width, dim->height, depth, BMF_CLEAR | (DMDATA(mode)->max_depth == 8 ? BMF_ALIGN64 : 0)); if (bm) { - int i; box_t box; v->data = &v[1]; /* at the end of view */ @@ -496,7 +499,8 @@ cc_colormap_checkvals(vcm, cm, use) /* check to see if its the view's colormap, if so just do * update. */ if (vcm != cm) { - if (cm->first >= vcm->size || (cm->first + cm->size) > (cm->first + vcm->size) || + if (cm->first >= vcm->size || + (cm->first + cm->size) > (cm->first + vcm->size) || cm->type != vcm->type) { return (0); } @@ -516,7 +520,8 @@ cc_colormap_checkvals(vcm, cm, use) } } } else { - if (cm->first >= vcm->size || (cm->first + cm->size) > (cm->first + vcm->size)) { + if (cm->first >= vcm->size || + (cm->first + cm->size) > (cm->first + vcm->size)) { return (0); } } @@ -591,7 +596,8 @@ cc_use_colormap(v, cm) tmp -= 7; for (j = 0; j < 32; j++) { - CMOVE(tmp, R_COLOR00 + (j << 1), CM_LTOW(vcm->entry[j])); + CMOVE(tmp, (R_COLOR00 + (j << 1)), + CM_LTOW(vcm->entry[j])); } } } @@ -639,12 +645,14 @@ cc_use_aga_colormap(v, cm) for (k = 0; k < 32; k++) { int ce = vcm->entry[j + k] >> 4; - CMOVE(tmp, R_COLOR00 + (k << 1), CM_LTOW(ce)); + CMOVE(tmp, (R_COLOR00 + (k << 1)), + CM_LTOW(ce)); } tmp++; for (k = 0; k < 32; k++) { int ce =vcm->entry[j + k]; - CMOVE(tmp, R_COLOR00 + (k << 1), CM_LTOW(ce)); + CMOVE(tmp, (R_COLOR00 + (k << 1)), + CM_LTOW(ce)); } tmp++; } @@ -722,7 +730,8 @@ cc_a2024_use_colormap(v, cm) tmp -= 7; for (j = 0; j < nregs; j++) { - CMOVE(tmp, R_COLOR00 + (j << 1), A2024_CM_TO_CR(vcm, j)); + CMOVE(tmp, (R_COLOR00 + (j << 1)), + A2024_CM_TO_CR(vcm, j)); } } } @@ -761,8 +770,6 @@ cc_free_view(v) view_t *v; { if (v) { - vdata_t *vd = VDATA(v); - dmode_t *md = vd->mode; v->remove_view(v); free_chipmem(VDATA(v)->colormap); cc_monitor->free_bitmap(v->bitmap); @@ -838,7 +845,6 @@ cc_init_ntsc_hires() /* this function should only be called once. */ if (!h_this) { u_short len = std_copper_list_len; - cop_t *cp; h_this = &hires_mode; h_this_data = &hires_mode_data; @@ -867,20 +873,25 @@ cc_init_ntsc_hires() h_this_data->monitor = cc_monitor; h_this_data->frames = hires_frames; - h_this_data->frames[F_LONG] = alloc_chipmem(std_copper_list_size * F_TOTAL); + h_this_data->frames[F_LONG] = + alloc_chipmem(std_copper_list_size * F_TOTAL); if (!h_this_data->frames[F_LONG]) { panic("couldn't get chipmem for copper list"); } - h_this_data->frames[F_STORE_LONG] = &h_this_data->frames[F_LONG][len]; + h_this_data->frames[F_STORE_LONG] = + &h_this_data->frames[F_LONG][len]; - bcopy(std_copper_list, h_this_data->frames[F_STORE_LONG], std_copper_list_size); - bcopy(std_copper_list, h_this_data->frames[F_LONG], std_copper_list_size); + bcopy(std_copper_list, h_this_data->frames[F_STORE_LONG], + std_copper_list_size); + bcopy(std_copper_list, h_this_data->frames[F_LONG], + std_copper_list_size); h_this_data->bplcon0 = 0x8200 | USE_CON3; /* hires, color * composite enable */ h_this_data->std_start_x = STANDARD_VIEW_X; h_this_data->std_start_y = STANDARD_VIEW_Y; - h_this_data->vbl_handler = (vbl_handler_func *) cc_mode_vbl_handler; + h_this_data->vbl_handler = + (vbl_handler_func *) cc_mode_vbl_handler; #if defined (GRF_ECS) || defined (GRF_AGA) h_this_data->beamcon0 = STANDARD_NTSC_BEAMCON; #endif @@ -896,7 +907,6 @@ display_hires_view(v) { if (h_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = h_this_data->monitor; cop_t *cp = h_this_data->frames[F_STORE_LONG], *tmp; int depth = v->bitmap->depth, i; int hstart, hstop, vstart, vstop, j; @@ -945,11 +955,12 @@ display_hires_view(v) /* correct the datafetch to proper limits. */ /* delay the actual display of the data until we need it. */ ddfstart &= 0xfffc; - con1 = ((hstart - 9) - (ddfstart << 1)) | (((hstart - 9) - (ddfstart << 1)) << 4); + con1 = ((hstart - 9) - (ddfstart << 1)) | + (((hstart - 9) - (ddfstart << 1)) << 4); if (h_this_data->current_view) { - VDATA(h_this_data->current_view)->flags &= ~VF_DISPLAY; /* mark as no longer */ - /* displayed. */ + VDATA(h_this_data->current_view)->flags &= + ~VF_DISPLAY; /* mark as no longer displayed. */ } h_this_data->current_view = v; @@ -982,8 +993,10 @@ display_hires_view(v) tmp = find_copper_inst(cp, CI_MOVE(R_BPL0PTH)); for (i = 0, j = 0; i < depth; j += 2, i++) { /* update the plane pointers */ - tmp[j].cp.inst.operand = HIADDR(PREP_DMA_MEM(v->bitmap->plane[i])); - tmp[j + 1].cp.inst.operand = LOADDR(PREP_DMA_MEM(v->bitmap->plane[i])); + tmp[j].cp.inst.operand = + HIADDR(PREP_DMA_MEM(v->bitmap->plane[i])); + tmp[j + 1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(v->bitmap->plane[i])); } /* set mods correctly. */ @@ -993,8 +1006,10 @@ display_hires_view(v) /* set next pointers correctly */ tmp = find_copper_inst(cp, CI_MOVE(R_COP1LCH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(h_this_data->frames[F_STORE_LONG])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(h_this_data->frames[F_STORE_LONG])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(h_this_data->frames[F_STORE_LONG])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(h_this_data->frames[F_STORE_LONG])); cp = h_this_data->frames[F_LONG]; h_this_data->frames[F_LONG] = h_this_data->frames[F_STORE_LONG]; @@ -1013,7 +1028,6 @@ cc_init_ntsc_hires_lace() /* this function should only be called once. */ if (!hl_this) { u_short len = std_copper_list_len; - cop_t *cp; hl_this = &hires_lace_mode; hl_this_data = &hires_lace_mode_data; @@ -1044,25 +1058,34 @@ cc_init_ntsc_hires_lace() hl_this_data->flags |= DMF_INTERLACE; hl_this_data->frames = hires_lace_frames; - hl_this_data->frames[F_LACE_LONG] = alloc_chipmem(std_copper_list_size * F_LACE_TOTAL); + hl_this_data->frames[F_LACE_LONG] = + alloc_chipmem(std_copper_list_size * F_LACE_TOTAL); if (!hl_this_data->frames[F_LACE_LONG]) { panic("couldn't get chipmem for copper list"); } - hl_this_data->frames[F_LACE_SHORT] = &hl_this_data->frames[F_LACE_LONG][len]; - hl_this_data->frames[F_LACE_STORE_LONG] = &hl_this_data->frames[F_LACE_SHORT][len]; - hl_this_data->frames[F_LACE_STORE_SHORT] = &hl_this_data->frames[F_LACE_STORE_LONG][len]; - - bcopy(std_copper_list, hl_this_data->frames[F_LACE_STORE_LONG], std_copper_list_size); - bcopy(std_copper_list, hl_this_data->frames[F_LACE_STORE_SHORT], std_copper_list_size); - bcopy(std_copper_list, hl_this_data->frames[F_LACE_LONG], std_copper_list_size); - bcopy(std_copper_list, hl_this_data->frames[F_LACE_SHORT], std_copper_list_size); + hl_this_data->frames[F_LACE_SHORT] = + &hl_this_data->frames[F_LACE_LONG][len]; + hl_this_data->frames[F_LACE_STORE_LONG] = + &hl_this_data->frames[F_LACE_SHORT][len]; + hl_this_data->frames[F_LACE_STORE_SHORT] = + &hl_this_data->frames[F_LACE_STORE_LONG][len]; + + bcopy(std_copper_list, hl_this_data->frames[F_LACE_STORE_LONG], + std_copper_list_size); + bcopy(std_copper_list, hl_this_data->frames[F_LACE_STORE_SHORT], + std_copper_list_size); + bcopy(std_copper_list, hl_this_data->frames[F_LACE_LONG], + std_copper_list_size); + bcopy(std_copper_list, hl_this_data->frames[F_LACE_SHORT], + std_copper_list_size); hl_this_data->bplcon0 = 0x8204 | USE_CON3; /* hires, color * composite enable, * lace. */ hl_this_data->std_start_x = STANDARD_VIEW_X; hl_this_data->std_start_y = STANDARD_VIEW_Y; - hl_this_data->vbl_handler = (vbl_handler_func *) cc_lace_mode_vbl_handler; + hl_this_data->vbl_handler = + (vbl_handler_func *) cc_lace_mode_vbl_handler; #if defined (GRF_ECS) || defined (GRF_AGA) hl_this_data->beamcon0 = STANDARD_NTSC_BEAMCON; #endif @@ -1078,7 +1101,6 @@ display_hires_lace_view(v) { if (hl_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = hl_this_data->monitor; cop_t *cp = hl_this_data->frames[F_LACE_STORE_LONG], *tmp; int depth = v->bitmap->depth, i; int hstart, hstop, vstart, vstop, j; @@ -1129,11 +1151,12 @@ display_hires_lace_view(v) /* correct the datafetch to proper limits. */ /* delay the actual display of the data until we need it. */ ddfstart &= 0xfffc; - con1 = ((hstart - 9) - (ddfstart << 1)) | (((hstart - 9) - (ddfstart << 1)) << 4); + con1 = ((hstart - 9) - (ddfstart << 1)) | + (((hstart - 9) - (ddfstart << 1)) << 4); if (hl_this_data->current_view) { - VDATA(hl_this_data->current_view)->flags &= ~VF_DISPLAY; /* mark as no longer */ - /* displayed. */ + VDATA(hl_this_data->current_view)->flags &= + ~VF_DISPLAY; /* mark as no longer displayed. */ } hl_this_data->current_view = v; @@ -1166,8 +1189,10 @@ display_hires_lace_view(v) tmp = find_copper_inst(cp, CI_MOVE(R_BPL0PTH)); for (i = 0, j = 0; i < depth; j += 2, i++) { /* update the plane pointers */ - tmp[j].cp.inst.operand = HIADDR(PREP_DMA_MEM(v->bitmap->plane[i])); - tmp[j + 1].cp.inst.operand = LOADDR(PREP_DMA_MEM(v->bitmap->plane[i])); + tmp[j].cp.inst.operand = + HIADDR(PREP_DMA_MEM(v->bitmap->plane[i])); + tmp[j + 1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(v->bitmap->plane[i])); } /* set mods correctly. */ @@ -1177,11 +1202,14 @@ display_hires_lace_view(v) /* set next pointers correctly */ tmp = find_copper_inst(cp, CI_MOVE(R_COP1LCH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_SHORT])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_SHORT])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_SHORT])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_SHORT])); - bcopy(hl_this_data->frames[F_LACE_STORE_LONG], hl_this_data->frames[F_LACE_STORE_SHORT], std_copper_list_size); + bcopy(hl_this_data->frames[F_LACE_STORE_LONG], + hl_this_data->frames[F_LACE_STORE_SHORT], std_copper_list_size); /* these are the only ones that are different from long frame. */ cp = hl_this_data->frames[F_LACE_STORE_SHORT]; @@ -1189,22 +1217,28 @@ display_hires_lace_view(v) for (i = 0, j = 0; i < depth; j += 2, i++) { u_short mod = v->bitmap->bytes_per_row + v->bitmap->row_mod; /* update plane pointers. high and low. */ - tmp[j].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[i][mod])); - tmp[j + 1].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[i][mod])); + tmp[j].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[i][mod])); + tmp[j + 1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[i][mod])); } /* set next pointers correctly */ tmp = find_copper_inst(cp, CI_MOVE(R_COP1LCH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_LONG])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_LONG])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_LONG])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(hl_this_data->frames[F_LACE_STORE_LONG])); cp = hl_this_data->frames[F_LACE_LONG]; - hl_this_data->frames[F_LACE_LONG] = hl_this_data->frames[F_LACE_STORE_LONG]; + hl_this_data->frames[F_LACE_LONG] = + hl_this_data->frames[F_LACE_STORE_LONG]; hl_this_data->frames[F_LACE_STORE_LONG] = cp; cp = hl_this_data->frames[F_LACE_SHORT]; - hl_this_data->frames[F_LACE_SHORT] = hl_this_data->frames[F_LACE_STORE_SHORT]; + hl_this_data->frames[F_LACE_SHORT] = + hl_this_data->frames[F_LACE_STORE_SHORT]; hl_this_data->frames[F_LACE_STORE_SHORT] = cp; vd->flags |= VF_DISPLAY; @@ -1221,7 +1255,6 @@ cc_init_ntsc_hires_dlace() /* this function should only be called once. */ if (!hdl_this) { u_short len = std_dlace_copper_list_len; - cop_t *cp; hdl_this = &hires_dlace_mode; hdl_this_data = &hires_dlace_mode_data; @@ -1252,25 +1285,38 @@ cc_init_ntsc_hires_dlace() hdl_this_data->flags |= DMF_INTERLACE; hdl_this_data->frames = hires_dlace_frames; - hdl_this_data->frames[F_LACE_LONG] = alloc_chipmem(std_dlace_copper_list_size * F_LACE_TOTAL); + hdl_this_data->frames[F_LACE_LONG] = + alloc_chipmem(std_dlace_copper_list_size * F_LACE_TOTAL); if (!hdl_this_data->frames[F_LACE_LONG]) { panic("couldn't get chipmem for copper list"); } - hdl_this_data->frames[F_LACE_SHORT] = &hdl_this_data->frames[F_LACE_LONG][len]; - hdl_this_data->frames[F_LACE_STORE_LONG] = &hdl_this_data->frames[F_LACE_SHORT][len]; - hdl_this_data->frames[F_LACE_STORE_SHORT] = &hdl_this_data->frames[F_LACE_STORE_LONG][len]; - - bcopy(std_dlace_copper_list, hdl_this_data->frames[F_LACE_STORE_LONG], std_dlace_copper_list_size); - bcopy(std_dlace_copper_list, hdl_this_data->frames[F_LACE_STORE_SHORT], std_dlace_copper_list_size); - bcopy(std_dlace_copper_list, hdl_this_data->frames[F_LACE_LONG], std_dlace_copper_list_size); - bcopy(std_dlace_copper_list, hdl_this_data->frames[F_LACE_SHORT], std_dlace_copper_list_size); + hdl_this_data->frames[F_LACE_SHORT] = + &hdl_this_data->frames[F_LACE_LONG][len]; + hdl_this_data->frames[F_LACE_STORE_LONG] = + &hdl_this_data->frames[F_LACE_SHORT][len]; + hdl_this_data->frames[F_LACE_STORE_SHORT] = + &hdl_this_data->frames[F_LACE_STORE_LONG][len]; + + bcopy(std_dlace_copper_list, + hdl_this_data->frames[F_LACE_STORE_LONG], + std_dlace_copper_list_size); + bcopy(std_dlace_copper_list, + hdl_this_data->frames[F_LACE_STORE_SHORT], + std_dlace_copper_list_size); + bcopy(std_dlace_copper_list, + hdl_this_data->frames[F_LACE_LONG], + std_dlace_copper_list_size); + bcopy(std_dlace_copper_list, + hdl_this_data->frames[F_LACE_SHORT], + std_dlace_copper_list_size); hdl_this_data->bplcon0 = 0x8204 | USE_CON3; /* hires, color * composite enable, * dlace. */ hdl_this_data->std_start_x = STANDARD_VIEW_X; hdl_this_data->std_start_y = STANDARD_VIEW_Y; - hdl_this_data->vbl_handler = (vbl_handler_func *) cc_lace_mode_vbl_handler; + hdl_this_data->vbl_handler = + (vbl_handler_func *) cc_lace_mode_vbl_handler; #if defined (GRF_ECS) || defined (GRF_AGA) hdl_this_data->beamcon0 = STANDARD_NTSC_BEAMCON; #endif @@ -1285,10 +1331,9 @@ display_hires_dlace_view(v) { if (hdl_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = hdl_this_data->monitor; cop_t *cp = hdl_this_data->frames[F_LACE_STORE_LONG], *tmp; - int depth = v->bitmap->depth, i; - int hstart, hstop, vstart, vstop, j; + int depth = v->bitmap->depth; + int hstart, hstop, vstart, vstop; int x, y, w = v->display.width, h = v->display.height; u_short ddfstart, ddfwidth, con1; u_short mod1l, mod2l; @@ -1337,11 +1382,12 @@ display_hires_dlace_view(v) /* correct the datafetch to proper limits. */ /* delay the actual display of the data until we need it. */ ddfstart &= 0xfffc; - con1 = ((hstart - 9) - (ddfstart << 1)) | (((hstart - 9) - (ddfstart << 1)) << 4); + con1 = ((hstart - 9) - (ddfstart << 1)) | + (((hstart - 9) - (ddfstart << 1)) << 4); if (hdl_this_data->current_view) { - VDATA(hdl_this_data->current_view)->flags &= ~VF_DISPLAY; /* mark as no longer */ - /* displayed. */ + VDATA(hdl_this_data->current_view)->flags &= + ~VF_DISPLAY; /* mark as no longer displayed. */ } hdl_this_data->current_view = v; @@ -1359,7 +1405,8 @@ display_hires_dlace_view(v) tmp->cp.inst.operand = CALC_DIWHIGH(hstart, vstart, hstop, vstop); #endif /* ECS */ tmp = find_copper_inst(cp, CI_MOVE(R_BPLCON0)); - tmp->cp.inst.operand = hdl_this_data->bplcon0 | ((depth & 0x7) << 13); /* times two. */ + tmp->cp.inst.operand = + hdl_this_data->bplcon0 | ((depth & 0x7) << 13); /* times two. */ tmp = find_copper_inst(cp, CI_MOVE(R_BPLCON1)); tmp->cp.inst.operand = con1; tmp = find_copper_inst(cp, CI_MOVE(R_DIWSTART)); @@ -1376,15 +1423,23 @@ display_hires_dlace_view(v) /* update plane pointers. */ tmp = find_copper_inst(cp, CI_MOVE(R_BPL0PTH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][0])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][0])); - tmp[2].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod1l])); - tmp[3].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod1l])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][0])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][0])); + tmp[2].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod1l])); + tmp[3].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod1l])); if (depth == 2) { - tmp[4].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][0])); - tmp[5].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][0])); - tmp[6].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod1l])); - tmp[7].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod1l])); + tmp[4].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][0])); + tmp[5].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][0])); + tmp[6].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod1l])); + tmp[7].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod1l])); } /* set modulos. */ tmp = find_copper_inst(cp, CI_MOVE(R_BPL1MOD)); @@ -1394,37 +1449,52 @@ display_hires_dlace_view(v) /* set next coper list pointers */ tmp = find_copper_inst(cp, CI_MOVE(R_COP1LCH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_SHORT])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_SHORT])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_SHORT])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_SHORT])); - bcopy(hdl_this_data->frames[F_LACE_STORE_LONG], hdl_this_data->frames[F_LACE_STORE_SHORT], - std_dlace_copper_list_size); + bcopy(hdl_this_data->frames[F_LACE_STORE_LONG], + hdl_this_data->frames[F_LACE_STORE_SHORT], + std_dlace_copper_list_size); /* these are the only ones that are different from long frame. */ cp = hdl_this_data->frames[F_LACE_STORE_SHORT]; /* update plane pointers. */ tmp = find_copper_inst(cp, CI_MOVE(R_BPL0PTH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l])); - tmp[2].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l + mod1l])); - tmp[3].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l + mod1l])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l])); + tmp[2].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l + mod1l])); + tmp[3].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[0][mod2l + mod1l])); if (depth == 2) { - tmp[4].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l])); - tmp[5].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l])); - tmp[6].cp.inst.operand = HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l + mod1l])); - tmp[7].cp.inst.operand = LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l + mod1l])); + tmp[4].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l])); + tmp[5].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l])); + tmp[6].cp.inst.operand = + HIADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l + mod1l])); + tmp[7].cp.inst.operand = + LOADDR(PREP_DMA_MEM(&v->bitmap->plane[1][mod2l + mod1l])); } /* set next copper list pointers */ tmp = find_copper_inst(cp, CI_MOVE(R_COP1LCH)); - tmp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_LONG])); - tmp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_LONG])); + tmp[0].cp.inst.operand = + HIADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_LONG])); + tmp[1].cp.inst.operand = + LOADDR(PREP_DMA_MEM(hdl_this_data->frames[F_LACE_STORE_LONG])); cp = hdl_this_data->frames[F_LACE_LONG]; - hdl_this_data->frames[F_LACE_LONG] = hdl_this_data->frames[F_LACE_STORE_LONG]; + hdl_this_data->frames[F_LACE_LONG] = + hdl_this_data->frames[F_LACE_STORE_LONG]; hdl_this_data->frames[F_LACE_STORE_LONG] = cp; cp = hdl_this_data->frames[F_LACE_SHORT]; - hdl_this_data->frames[F_LACE_SHORT] = hdl_this_data->frames[F_LACE_STORE_SHORT]; + hdl_this_data->frames[F_LACE_SHORT] = + hdl_this_data->frames[F_LACE_STORE_SHORT]; hdl_this_data->frames[F_LACE_STORE_SHORT] = cp; vd->flags |= VF_DISPLAY; @@ -1472,7 +1542,8 @@ cc_init_ntsc_a2024() a24_this_data->flags |= DMF_HEDLEY_EXP; a24_this_data->frames = a2024_frames; - a24_this_data->frames[F_QD_QUAD0] = alloc_chipmem(std_a2024_copper_list_size * F_QD_TOTAL); + a24_this_data->frames[F_QD_QUAD0] = + alloc_chipmem(std_a2024_copper_list_size * F_QD_TOTAL); if (!a24_this_data->frames[F_QD_QUAD0]) { panic("couldn't get chipmem for copper list"); } @@ -1486,20 +1557,25 @@ cc_init_ntsc_a2024() hedley_init[0] = 0x03; /* copy image of standard copper list. */ - bcopy(std_a2024_copper_list, a24_this_data->frames[0], std_a2024_copper_list_size); + bcopy(std_a2024_copper_list, a24_this_data->frames[0], + std_a2024_copper_list_size); /* set the init plane pointer. */ - cp = find_copper_inst(a24_this_data->frames[F_QD_QUAD0], CI_MOVE(R_BPL0PTH)); + cp = find_copper_inst(a24_this_data->frames[F_QD_QUAD0], + CI_MOVE(R_BPL0PTH)); cp[0].cp.inst.operand = HIADDR(PREP_DMA_MEM(hedley_init)); cp[1].cp.inst.operand = LOADDR(PREP_DMA_MEM(hedley_init)); for (i = 1; i < F_QD_TOTAL; i++) { a24_this_data->frames[i] = &a24_this_data->frames[i - 1][len]; - bcopy(a24_this_data->frames[0], a24_this_data->frames[i], std_a2024_copper_list_size); + bcopy(a24_this_data->frames[0], + a24_this_data->frames[i], + std_a2024_copper_list_size); } a24_this_data->bplcon0 = 0x8200; /* hires */ - a24_this_data->vbl_handler = (vbl_handler_func *) a2024_mode_vbl_handler; + a24_this_data->vbl_handler = + (vbl_handler_func *) a2024_mode_vbl_handler; LIST_INSERT_HEAD(&MDATA(cc_monitor)->modes, a24_this, link); @@ -1513,14 +1589,12 @@ display_a2024_view(v) { if (a24_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = a24_this_data->monitor; cop_t *cp, *tmp; u_char *inst_plane[2]; u_char **plane = inst_plane; u_long full_line = v->bitmap->bytes_per_row + v->bitmap->row_mod; u_long half_plane = full_line * v->bitmap->rows / 2; - int line_mod = 0xbc; /* standard 2024 15khz mod. */ int depth = v->bitmap->depth, i, j; plane[0] = v->bitmap->plane[0]; @@ -1528,28 +1602,38 @@ display_a2024_view(v) plane[1] = v->bitmap->plane[1]; } if (a24_this_data->current_view) { - VDATA(a24_this_data->current_view)->flags &= ~VF_DISPLAY; /* mark as no longer - * displayed. */ + VDATA(a24_this_data->current_view)->flags &= + ~VF_DISPLAY; /* mark as no longer displayed. */ } cp = a24_this_data->frames[F_QD_STORE_QUAD0]; tmp = find_copper_inst(cp, CI_MOVE(R_COLOR1F)); - tmp = find_copper_inst(tmp, CI_MOVE(R_BPLCON0)); /* grab third one. */ - tmp->cp.inst.operand = a24_this_data->bplcon0 | ((depth & 0x7) << 13); /* times 2 */ - - bcopy(a24_this_data->frames[F_QD_STORE_QUAD0], a24_this_data->frames[F_QD_STORE_QUAD1], std_a2024_copper_list_size); - bcopy(a24_this_data->frames[F_QD_STORE_QUAD0], a24_this_data->frames[F_QD_STORE_QUAD2], std_a2024_copper_list_size); - bcopy(a24_this_data->frames[F_QD_STORE_QUAD0], a24_this_data->frames[F_QD_STORE_QUAD3], std_a2024_copper_list_size); + tmp = find_copper_inst(tmp, CI_MOVE(R_BPLCON0)); /* grab third one. */ + tmp->cp.inst.operand = a24_this_data->bplcon0 | + ((depth & 0x7) << 13); /* times 2 */ + + bcopy(a24_this_data->frames[F_QD_STORE_QUAD0], + a24_this_data->frames[F_QD_STORE_QUAD1], + std_a2024_copper_list_size); + bcopy(a24_this_data->frames[F_QD_STORE_QUAD0], + a24_this_data->frames[F_QD_STORE_QUAD2], + std_a2024_copper_list_size); + bcopy(a24_this_data->frames[F_QD_STORE_QUAD0], + a24_this_data->frames[F_QD_STORE_QUAD3], + std_a2024_copper_list_size); /* * Mark Id's */ - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD1], CI_WAIT(126, 21)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD1], + CI_WAIT(126, 21)); CBUMP(tmp); CMOVE(tmp, R_COLOR01, QUAD1_ID); - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD2], CI_WAIT(126, 21)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD2], + CI_WAIT(126, 21)); CBUMP(tmp); CMOVE(tmp, R_COLOR01, QUAD2_ID); - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD3], CI_WAIT(126, 21)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD3], + CI_WAIT(126, 21)); CBUMP(tmp); CMOVE(tmp, R_COLOR01, QUAD3_ID); @@ -1562,7 +1646,8 @@ display_a2024_view(v) /* * Set bitplane pointers. */ - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD0], CI_MOVE(R_BPLMOD2)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD0], + CI_MOVE(R_BPLMOD2)); CBUMP(tmp); CMOVE(tmp, R_BPL0PTH, HIADDR(PREP_DMA_MEM(&plane[0][0]))); CMOVE(tmp, R_BPL0PTL, LOADDR(PREP_DMA_MEM(&plane[0][0]))); @@ -1577,68 +1662,103 @@ display_a2024_view(v) #if defined (GRF_ECS) || defined (GRF_AGA) CMOVE(tmp, R_DIWHIGH, 0x2000); #endif - CMOVE(tmp, R_COP1LCH, HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD1]))); - CMOVE(tmp, R_COP1LCL, LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD1]))); + CMOVE(tmp, R_COP1LCH, + HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD1]))); + CMOVE(tmp, R_COP1LCL, + LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD1]))); CEND(tmp); CEND(tmp); - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD1], CI_MOVE(R_BPLMOD2)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD1], + CI_MOVE(R_BPLMOD2)); CBUMP(tmp); - CMOVE(tmp, R_BPL0PTH, HIADDR(PREP_DMA_MEM(&plane[0][HALF_2024_LINE]))); - CMOVE(tmp, R_BPL0PTL, LOADDR(PREP_DMA_MEM(&plane[0][HALF_2024_LINE]))); - CMOVE(tmp, R_BPL1PTH, HIADDR(PREP_DMA_MEM(&plane[0][full_line + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL1PTL, LOADDR(PREP_DMA_MEM(&plane[0][full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL0PTH, + HIADDR(PREP_DMA_MEM(&plane[0][HALF_2024_LINE]))); + CMOVE(tmp, R_BPL0PTL, + LOADDR(PREP_DMA_MEM(&plane[0][HALF_2024_LINE]))); + CMOVE(tmp, R_BPL1PTH, + HIADDR(PREP_DMA_MEM(&plane[0][full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL1PTL, + LOADDR(PREP_DMA_MEM(&plane[0][full_line + HALF_2024_LINE]))); if (depth == 2) { - CMOVE(tmp, R_BPL2PTH, HIADDR(PREP_DMA_MEM(&plane[1][HALF_2024_LINE]))); - CMOVE(tmp, R_BPL2PTL, LOADDR(PREP_DMA_MEM(&plane[1][HALF_2024_LINE]))); - CMOVE(tmp, R_BPL3PTH, HIADDR(PREP_DMA_MEM(&plane[1][full_line + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL3PTL, LOADDR(PREP_DMA_MEM(&plane[1][full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL2PTH, + HIADDR(PREP_DMA_MEM(&plane[1][HALF_2024_LINE]))); + CMOVE(tmp, R_BPL2PTL, + LOADDR(PREP_DMA_MEM(&plane[1][HALF_2024_LINE]))); + CMOVE(tmp, R_BPL3PTH, + HIADDR(PREP_DMA_MEM(&plane[1][full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL3PTL, + LOADDR(PREP_DMA_MEM(&plane[1][full_line + HALF_2024_LINE]))); } #if defined (GRF_ECS) || defined (GRF_AGA) CMOVE(tmp, R_DIWHIGH, 0x2000); #endif - CMOVE(tmp, R_COP1LCH, HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD2]))); - CMOVE(tmp, R_COP1LCL, LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD2]))); + CMOVE(tmp, R_COP1LCH, + HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD2]))); + CMOVE(tmp, R_COP1LCL, + LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD2]))); CEND(tmp); CEND(tmp); - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD2], CI_MOVE(R_BPLMOD2)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD2], + CI_MOVE(R_BPLMOD2)); CBUMP(tmp); - CMOVE(tmp, R_BPL0PTH, HIADDR(PREP_DMA_MEM(&plane[0][half_plane]))); - CMOVE(tmp, R_BPL0PTL, LOADDR(PREP_DMA_MEM(&plane[0][half_plane]))); - CMOVE(tmp, R_BPL1PTH, HIADDR(PREP_DMA_MEM(&plane[0][half_plane + full_line]))); - CMOVE(tmp, R_BPL1PTL, LOADDR(PREP_DMA_MEM(&plane[0][half_plane + full_line]))); + CMOVE(tmp, R_BPL0PTH, + HIADDR(PREP_DMA_MEM(&plane[0][half_plane]))); + CMOVE(tmp, R_BPL0PTL, + LOADDR(PREP_DMA_MEM(&plane[0][half_plane]))); + CMOVE(tmp, R_BPL1PTH, + HIADDR(PREP_DMA_MEM(&plane[0][half_plane + full_line]))); + CMOVE(tmp, R_BPL1PTL, + LOADDR(PREP_DMA_MEM(&plane[0][half_plane + full_line]))); if (depth == 2) { - CMOVE(tmp, R_BPL2PTH, HIADDR(PREP_DMA_MEM(&plane[1][half_plane]))); - CMOVE(tmp, R_BPL2PTL, LOADDR(PREP_DMA_MEM(&plane[1][half_plane]))); - CMOVE(tmp, R_BPL3PTH, HIADDR(PREP_DMA_MEM(&plane[1][half_plane + full_line]))); - CMOVE(tmp, R_BPL3PTL, LOADDR(PREP_DMA_MEM(&plane[1][half_plane + full_line]))); + CMOVE(tmp, R_BPL2PTH, + HIADDR(PREP_DMA_MEM(&plane[1][half_plane]))); + CMOVE(tmp, R_BPL2PTL, + LOADDR(PREP_DMA_MEM(&plane[1][half_plane]))); + CMOVE(tmp, R_BPL3PTH, + HIADDR(PREP_DMA_MEM(&plane[1][half_plane + full_line]))); + CMOVE(tmp, R_BPL3PTL, + LOADDR(PREP_DMA_MEM(&plane[1][half_plane + full_line]))); } #if defined (GRF_ECS) || defined (GRF_AGA) CMOVE(tmp, R_DIWHIGH, 0x2000); #endif - CMOVE(tmp, R_COP1LCH, HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD3]))); - CMOVE(tmp, R_COP1LCL, LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD3]))); + CMOVE(tmp, R_COP1LCH, + HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD3]))); + CMOVE(tmp, R_COP1LCL, + LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD3]))); CEND(tmp); CEND(tmp); - tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD3], CI_MOVE(R_BPLMOD2)); + tmp = find_copper_inst(a24_this_data->frames[F_QD_STORE_QUAD3], + CI_MOVE(R_BPLMOD2)); CBUMP(tmp); - CMOVE(tmp, R_BPL0PTH, HIADDR(PREP_DMA_MEM(&plane[0][half_plane + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL0PTL, LOADDR(PREP_DMA_MEM(&plane[0][half_plane + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL1PTH, HIADDR(PREP_DMA_MEM(&plane[0][half_plane + full_line + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL1PTL, LOADDR(PREP_DMA_MEM(&plane[0][half_plane + full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL0PTH, HIADDR(PREP_DMA_MEM( + &plane[0][half_plane + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL0PTL, LOADDR(PREP_DMA_MEM( + &plane[0][half_plane + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL1PTH, HIADDR(PREP_DMA_MEM( + &plane[0][half_plane + full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL1PTL, LOADDR(PREP_DMA_MEM( + &plane[0][half_plane + full_line + HALF_2024_LINE]))); if (depth == 2) { - CMOVE(tmp, R_BPL2PTH, HIADDR(PREP_DMA_MEM(&plane[1][half_plane + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL2PTL, LOADDR(PREP_DMA_MEM(&plane[1][half_plane + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL3PTH, HIADDR(PREP_DMA_MEM(&plane[1][half_plane + full_line + HALF_2024_LINE]))); - CMOVE(tmp, R_BPL3PTL, LOADDR(PREP_DMA_MEM(&plane[1][half_plane + full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL2PTH, HIADDR(PREP_DMA_MEM( + &plane[1][half_plane + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL2PTL, LOADDR(PREP_DMA_MEM( + &plane[1][half_plane + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL3PTH, HIADDR(PREP_DMA_MEM( + &plane[1][half_plane + full_line + HALF_2024_LINE]))); + CMOVE(tmp, R_BPL3PTL, LOADDR(PREP_DMA_MEM( + &plane[1][half_plane + full_line + HALF_2024_LINE]))); } #if defined (GRF_ECS) || defined (GRF_AGA) CMOVE(tmp, R_DIWHIGH, 0x2000); #endif - CMOVE(tmp, R_COP1LCH, HIADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD0]))); - CMOVE(tmp, R_COP1LCL, LOADDR(PREP_DMA_MEM(a24_this_data->frames[F_QD_STORE_QUAD0]))); + CMOVE(tmp, R_COP1LCH, HIADDR(PREP_DMA_MEM( + a24_this_data->frames[F_QD_STORE_QUAD0]))); + CMOVE(tmp, R_COP1LCL, LOADDR(PREP_DMA_MEM( + a24_this_data->frames[F_QD_STORE_QUAD0]))); CEND(tmp); CEND(tmp); @@ -1665,7 +1785,8 @@ a2024_mode_vbl_handler(d) u_short vp = ((custom.vposr & 0x0007) << 8) | ((custom.vhposr) >> 8); if (vp < 12) { - custom.cop1lc = PREP_DMA_MEM(a24_this_data->frames[a24_this_data->hedley_current]); + custom.cop1lc = + PREP_DMA_MEM(a24_this_data->frames[a24_this_data->hedley_current]); custom.copjmp1 = 0; } a24_this_data->hedley_current++; @@ -1682,7 +1803,6 @@ cc_init_ntsc_aga() if (!aga_this && (custom.deniseid & 0xff) == 0xf8 && aga_enable & AGA_ENABLE) { u_short len = aga_copper_list_len; - cop_t *cp; aga_this = &aga_mode; aga_this_data = &aga_mode_data; @@ -1754,7 +1874,6 @@ display_aga_view(v) { if (aga_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = aga_this_data->monitor; cop_t *cp = aga_this_data->frames[F_STORE_LONG], *tmp; int depth = v->bitmap->depth, i; int hstart, hstop, vstart, vstop, j; @@ -1763,7 +1882,7 @@ display_aga_view(v) #ifdef DEBUG if (aga_enable & AGA_TRACE) - printf("display_aga_view(%dx%dx%d) %x\n", w, h, + printf("display_aga_view(%dx%dx%d) %p\n", w, h, depth, v); #endif /* round down to nearest even width */ @@ -1938,7 +2057,7 @@ display_aga_view(v) tmp[j + 1].cp.inst.operand = LOADDR(PREP_DMA_MEM(v->bitmap->plane[i])); #ifdef DEBUG if (aga_enable & AGA_TRACE2) - printf (" bpl%dpth %08x", i, v->bitmap->plane[i]); + printf (" bpl%dpth %p", i, v->bitmap->plane[i]); #endif } @@ -1986,7 +2105,6 @@ cc_init_pal_hires() /* this function should only be called once. */ if (!ph_this) { u_short len = std_copper_list_len; - cop_t *cp; ph_this = &pal_hires_mode; ph_this_data = &pal_hires_mode_data; @@ -2045,7 +2163,6 @@ display_pal_hires_view(v) { if (ph_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = ph_this_data->monitor; cop_t *cp = ph_this_data->frames[F_STORE_LONG], *tmp; int depth = v->bitmap->depth, i; int hstart, hstop, vstart, vstop, j; @@ -2158,7 +2275,6 @@ cc_init_pal_hires_lace() /* this function should only be called once. */ if (!phl_this) { u_short len = std_copper_list_len; - cop_t *cp; phl_this = &pal_hires_lace_mode; phl_this_data = &pal_hires_lace_mode_data; @@ -2223,7 +2339,6 @@ display_pal_hires_lace_view(v) { if (phl_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = phl_this_data->monitor; cop_t *cp = phl_this_data->frames[F_LACE_STORE_LONG], *tmp; int depth = v->bitmap->depth, i; int hstart, hstop, vstart, vstop, j; @@ -2361,7 +2476,6 @@ cc_init_pal_hires_dlace() /* this function should only be called once. */ if (!phdl_this) { u_short len = std_dlace_copper_list_len; - cop_t *cp; phdl_this = &pal_hires_dlace_mode; phdl_this_data = &pal_hires_dlace_mode_data; @@ -2426,10 +2540,9 @@ display_pal_hires_dlace_view(v) { if (phdl_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = phdl_this_data->monitor; cop_t *cp = phdl_this_data->frames[F_LACE_STORE_LONG], *tmp; - int depth = v->bitmap->depth, i; - int hstart, hstop, vstart, vstop, j; + int depth = v->bitmap->depth; + int hstart, hstop, vstart, vstop; int x, y, w = v->display.width, h = v->display.height; u_short ddfstart, ddfwidth, con1; u_short mod1l, mod2l; @@ -2654,14 +2767,12 @@ display_pal_a2024_view(v) { if (p24_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = p24_this_data->monitor; cop_t *cp, *tmp; u_char *inst_plane[2]; u_char **plane = inst_plane; u_long full_line = v->bitmap->bytes_per_row + v->bitmap->row_mod; u_long half_plane = full_line * v->bitmap->rows / 2; - int line_mod = 0xbc; /* standard 2024 15khz mod. */ int depth = v->bitmap->depth, i, j; plane[0] = v->bitmap->plane[0]; @@ -2823,7 +2934,6 @@ cc_init_pal_aga() if (!paga_this && (custom.deniseid & 0xff) == 0xf8 && aga_enable & AGA_ENABLE) { u_short len = aga_copper_list_len; - cop_t *cp; paga_this = &paga_mode; paga_this_data = &paga_mode_data; @@ -2895,7 +3005,6 @@ display_pal_aga_view(v) { if (paga_this_data->current_view != v) { vdata_t *vd = VDATA(v); - monitor_t *monitor = paga_this_data->monitor; cop_t *cp = paga_this_data->frames[F_STORE_LONG], *tmp; int depth = v->bitmap->depth, i; int hstart, hstop, vstart, vstop, j; @@ -2904,7 +3013,7 @@ display_pal_aga_view(v) #ifdef DEBUG if (aga_enable & AGA_TRACE) - printf("display_aga_view(%dx%dx%d) %x\n", w, h, + printf("display_aga_view(%dx%dx%d) %p\n", w, h, depth, v); #endif /* round down to nearest even width */ @@ -3079,7 +3188,7 @@ display_pal_aga_view(v) tmp[j + 1].cp.inst.operand = LOADDR(PREP_DMA_MEM(v->bitmap->plane[i])); #ifdef DEBUG if (aga_enable & AGA_TRACE2) - printf (" bpl%dpth %08x", i, v->bitmap->plane[i]); + printf (" bpl%dpth %p", i, v->bitmap->plane[i]); #endif } diff --git a/sys/arch/amiga/dev/grfabs_ccglb.c b/sys/arch/amiga/dev/grfabs_ccglb.c index f68e9cdf530..a6d2009ace5 100644 --- a/sys/arch/amiga/dev/grfabs_ccglb.c +++ b/sys/arch/amiga/dev/grfabs_ccglb.c @@ -1,4 +1,5 @@ -/* $NetBSD: grfabs_ccglb.c,v 1.7 1995/10/05 12:41:16 chopps Exp $ */ +/* $OpenBSD: grfabs_ccglb.c,v 1.2 1996/05/02 06:43:57 niklas Exp $ */ +/* $NetBSD: grfabs_ccglb.c,v 1.8 1996/04/28 06:33:58 mhitch Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -41,46 +42,54 @@ monitor_t *cc_monitor; cop_t std_copper_list[] = { - { CI_WAIT (0, 12), 0xfffe }, + {{{ CI_WAIT (0, 12), 0xfffe }}}, #if defined (GRF_ECS) || defined (GRF_AGA) #if defined (GRF_AGA) - { R_FMODE, 0x0000 }, + {{{ R_FMODE, 0x0000 }}}, #endif - { R_BEAMCON0, 0x0000 }, - { R_BPLCON3, 0x0020 }, /* enable border blank */ + {{{ R_BEAMCON0, 0x0000 }}}, + {{{ R_BPLCON3, 0x0020 }}}, /* enable border blank */ #endif /* bit plane pointers */ - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, - { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 }, - { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 }, - { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 }, - { R_BPL4PTH, 0x0000 }, { R_BPL4PTL, 0x0000 }, - { R_BPL5PTH, 0x0000 }, { R_BPL5PTL, 0x0000 }, - { R_BPL6PTH, 0x0000 }, { R_BPL6PTL, 0x0000 }, - { R_BPL7PTH, 0x0000 }, { R_BPL7PTL, 0x0000 }, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, + {{{ R_BPL1PTH, 0x0000 }}}, {{{ R_BPL1PTL, 0x0000 }}}, + {{{ R_BPL2PTH, 0x0000 }}}, {{{ R_BPL2PTL, 0x0000 }}}, + {{{ R_BPL3PTH, 0x0000 }}}, {{{ R_BPL3PTL, 0x0000 }}}, + {{{ R_BPL4PTH, 0x0000 }}}, {{{ R_BPL4PTL, 0x0000 }}}, + {{{ R_BPL5PTH, 0x0000 }}}, {{{ R_BPL5PTL, 0x0000 }}}, + {{{ R_BPL6PTH, 0x0000 }}}, {{{ R_BPL6PTL, 0x0000 }}}, + {{{ R_BPL7PTH, 0x0000 }}}, {{{ R_BPL7PTL, 0x0000 }}}, /* view specific stuff. */ - { R_BPL1MOD, 0x0000 }, - { R_BPL2MOD, 0x0000 }, - { R_DIWSTRT, 0xffff }, - { R_BPLCON0, 0x0000 }, - { R_DIWSTOP, 0x0000 }, + {{{ R_BPL1MOD, 0x0000 }}}, + {{{ R_BPL2MOD, 0x0000 }}}, + {{{ R_DIWSTRT, 0xffff }}}, + {{{ R_BPLCON0, 0x0000 }}}, + {{{ R_DIWSTOP, 0x0000 }}}, #if defined (GRF_ECS) || defined (GRF_AGA) - { R_DIWHIGH, 0x0000 }, + {{{ R_DIWHIGH, 0x0000 }}}, #endif - { R_DDFSTRT, 0x0000 }, - { R_DDFSTOP, 0x0000 }, - { R_BPLCON1, 0x0000 }, + {{{ R_DDFSTRT, 0x0000 }}}, + {{{ R_DDFSTOP, 0x0000 }}}, + {{{ R_BPLCON1, 0x0000 }}}, /* colors */ - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, - { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 }, - { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */ + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, + {{{ R_COP1LCH, 0x0000 }}}, {{{ R_COP1LCL, 0x0000 }}}, + {{{ 0xffff, 0xfffe }}}, {{{ 0xffff, 0xfffe }}} /* COPEND, COPEND */ }; /* standard custom chips copper list. */ @@ -90,203 +99,331 @@ int std_copper_list_size = sizeof (std_copper_list); #ifdef GRF_AGA cop_t aga_copper_list[] = { - { CI_WAIT (0, 12), 0xfffe }, - { R_FMODE, 0x0000 }, - { R_HTOTAL, 0x0071 }, - { R_HBSTRT, 0x0008 }, - { R_HBSTOP, 0x001c }, - { R_HSSTRT, 0x000c }, - { R_HSSTOP, 0x001e }, - { R_HCENTER, 0x0046 }, - { R_VSSTRT, 0x0001 }, - { R_VSSTOP, 0x0003 }, - { R_VBSTRT, 0x0000 }, - { R_VBSTOP, 0x000f }, - { R_VTOTAL, 0x020c }, - { R_BEAMCON0, 0x0000 }, + {{{ CI_WAIT (0, 12), 0xfffe }}}, + {{{ R_FMODE, 0x0000 }}}, + {{{ R_HTOTAL, 0x0071 }}}, + {{{ R_HBSTRT, 0x0008 }}}, + {{{ R_HBSTOP, 0x001c }}}, + {{{ R_HSSTRT, 0x000c }}}, + {{{ R_HSSTOP, 0x001e }}}, + {{{ R_HCENTER, 0x0046 }}}, + {{{ R_VSSTRT, 0x0001 }}}, + {{{ R_VSSTOP, 0x0003 }}}, + {{{ R_VBSTRT, 0x0000 }}}, + {{{ R_VBSTOP, 0x000f }}}, + {{{ R_VTOTAL, 0x020c }}}, + {{{ R_BEAMCON0, 0x0000 }}}, /* bit plane pointers */ - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, - { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 }, - { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 }, - { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 }, - { R_BPL4PTH, 0x0000 }, { R_BPL4PTL, 0x0000 }, - { R_BPL5PTH, 0x0000 }, { R_BPL5PTL, 0x0000 }, - { R_BPL6PTH, 0x0000 }, { R_BPL6PTL, 0x0000 }, - { R_BPL7PTH, 0x0000 }, { R_BPL7PTL, 0x0000 }, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, + {{{ R_BPL1PTH, 0x0000 }}}, {{{ R_BPL1PTL, 0x0000 }}}, + {{{ R_BPL2PTH, 0x0000 }}}, {{{ R_BPL2PTL, 0x0000 }}}, + {{{ R_BPL3PTH, 0x0000 }}}, {{{ R_BPL3PTL, 0x0000 }}}, + {{{ R_BPL4PTH, 0x0000 }}}, {{{ R_BPL4PTL, 0x0000 }}}, + {{{ R_BPL5PTH, 0x0000 }}}, {{{ R_BPL5PTL, 0x0000 }}}, + {{{ R_BPL6PTH, 0x0000 }}}, {{{ R_BPL6PTL, 0x0000 }}}, + {{{ R_BPL7PTH, 0x0000 }}}, {{{ R_BPL7PTL, 0x0000 }}}, /* view specific stuff. */ - { R_BPL1MOD, 0x0000 }, - { R_BPL2MOD, 0x0000 }, - { R_DIWSTRT, 0xffff }, - { R_BPLCON0, 0x0000 }, - { R_DIWSTOP, 0x0000 }, - { R_DIWHIGH, 0x0000 }, - { R_DDFSTRT, 0x0000 }, - { R_DDFSTOP, 0x0000 }, - { R_BPLCON1, 0x0000 }, + {{{ R_BPL1MOD, 0x0000 }}}, + {{{ R_BPL2MOD, 0x0000 }}}, + {{{ R_DIWSTRT, 0xffff }}}, + {{{ R_BPLCON0, 0x0000 }}}, + {{{ R_DIWSTOP, 0x0000 }}}, + {{{ R_DIWHIGH, 0x0000 }}}, + {{{ R_DDFSTRT, 0x0000 }}}, + {{{ R_DDFSTOP, 0x0000 }}}, + {{{ R_BPLCON1, 0x0000 }}}, /* colors - bank 0 high */ - { R_BPLCON3, 0x0020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x0020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 0 low */ - { R_BPLCON3, 0x0220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x0220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 1 high */ - { R_BPLCON3, 0x2020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x2020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 1 low */ - { R_BPLCON3, 0x2220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x2220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 2 high */ - { R_BPLCON3, 0x4020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x4020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 2 low */ - { R_BPLCON3, 0x4220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x4220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 3 high */ - { R_BPLCON3, 0x6020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x6020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 3 low */ - { R_BPLCON3, 0x6220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x6220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 4 high */ - { R_BPLCON3, 0x8020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x8020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 4 low */ - { R_BPLCON3, 0x8220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0x8220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 5 high */ - { R_BPLCON3, 0xa020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0xa020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 5 low */ - { R_BPLCON3, 0xa220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0xa220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 6 high */ - { R_BPLCON3, 0xc020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0xc020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 6 low */ - { R_BPLCON3, 0xc220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0xc220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 7 high */ - { R_BPLCON3, 0xe020 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0xe020 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - bank 7 low */ - { R_BPLCON3, 0xe220 }, - { R_COLOR00, 0x0779 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0FFF }, { R_COLOR03, 0x068B }, - { R_COLOR04, 0x000f }, { R_COLOR05, 0x0f0f }, { R_COLOR06, 0x00ff }, { R_COLOR07, 0x0fff }, - { R_COLOR08, 0x0620 }, { R_COLOR09, 0x0e50 }, { R_COLOR0A, 0x09f1 }, { R_COLOR0B, 0x0eb0 }, - { R_COLOR0C, 0x055f }, { R_COLOR0D, 0x092f }, { R_COLOR0E, 0x00f8 }, { R_COLOR0F, 0x0ccc }, - { R_COLOR10, 0x0e44 }, { R_COLOR11, 0x0e44 }, { R_COLOR12, 0x0000 }, { R_COLOR13, 0x0eec }, - { R_COLOR14, 0x0444 }, { R_COLOR15, 0x0555 }, { R_COLOR16, 0x0666 }, { R_COLOR17, 0x0777 }, - { R_COLOR18, 0x0888 }, { R_COLOR19, 0x0999 }, { R_COLOR1A, 0x0aaa }, { R_COLOR1B, 0x0bbb }, - { R_COLOR1C, 0x0ccc }, { R_COLOR1D, 0x0ddd }, { R_COLOR1E, 0x0eee }, { R_COLOR1F, 0x0fff }, + {{{ R_BPLCON3, 0xe220 }}}, + {{{ R_COLOR00, 0x0779 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0FFF }}}, {{{ R_COLOR03, 0x068B }}}, + {{{ R_COLOR04, 0x000f }}}, {{{ R_COLOR05, 0x0f0f }}}, + {{{ R_COLOR06, 0x00ff }}}, {{{ R_COLOR07, 0x0fff }}}, + {{{ R_COLOR08, 0x0620 }}}, {{{ R_COLOR09, 0x0e50 }}}, + {{{ R_COLOR0A, 0x09f1 }}}, {{{ R_COLOR0B, 0x0eb0 }}}, + {{{ R_COLOR0C, 0x055f }}}, {{{ R_COLOR0D, 0x092f }}}, + {{{ R_COLOR0E, 0x00f8 }}}, {{{ R_COLOR0F, 0x0ccc }}}, + {{{ R_COLOR10, 0x0e44 }}}, {{{ R_COLOR11, 0x0e44 }}}, + {{{ R_COLOR12, 0x0000 }}}, {{{ R_COLOR13, 0x0eec }}}, + {{{ R_COLOR14, 0x0444 }}}, {{{ R_COLOR15, 0x0555 }}}, + {{{ R_COLOR16, 0x0666 }}}, {{{ R_COLOR17, 0x0777 }}}, + {{{ R_COLOR18, 0x0888 }}}, {{{ R_COLOR19, 0x0999 }}}, + {{{ R_COLOR1A, 0x0aaa }}}, {{{ R_COLOR1B, 0x0bbb }}}, + {{{ R_COLOR1C, 0x0ccc }}}, {{{ R_COLOR1D, 0x0ddd }}}, + {{{ R_COLOR1E, 0x0eee }}}, {{{ R_COLOR1F, 0x0fff }}}, /* colors - whew! */ - { R_BPLCON3, 0x0020 }, /* enable border blank */ - { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 }, - { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */ + {{{ R_BPLCON3, 0x0020 }}}, /* enable border blank */ + {{{ R_COP1LCH, 0x0000 }}}, {{{ R_COP1LCL, 0x0000 }}}, + {{{ 0xffff, 0xfffe }}}, {{{ 0xffff, 0xfffe }}} /* COPEND, COPEND */ }; /* AGA custom chips copper list. */ @@ -296,152 +433,178 @@ int aga_copper_list_size = sizeof (aga_copper_list); #if defined (GRF_A2024) cop_t std_dlace_copper_list[] = { - { CI_WAIT(0,12), 0xfffe }, /* WAIT (0, 12) */ + {{{ CI_WAIT(0,12), 0xfffe }}}, /* WAIT (0, 12) */ #if defined (GRF_ECS) || defined (GRF_AGA) - { R_BEAMCON0, 0x0000 }, - { R_BPLCON3, 0x0020 }, /* enable border blank */ + {{{ R_BEAMCON0, 0x0000 }}}, + {{{ R_BPLCON3, 0x0020 }}}, /* enable border blank */ #endif /* colors */ - { R_COLOR00, 0x0000 }, { R_COLOR01, 0x0000 }, { R_COLOR02, 0x0000 }, { R_COLOR03, 0x0000 }, - { R_COLOR04, 0x0000 }, { R_COLOR05, 0x0000 }, { R_COLOR06, 0x0000 }, { R_COLOR07, 0x0000 }, - { R_COLOR08, 0x0000 }, { R_COLOR09, 0x0000 }, { R_COLOR0A, 0x0000}, { R_COLOR0B, 0x0000 }, - { R_COLOR0C, 0x0000 }, { R_COLOR0D, 0x0000 }, { R_COLOR0E, 0x0000}, { R_COLOR0F, 0x0000 }, - { R_COLOR10, 0x0009 }, { R_COLOR11, 0x0009 }, { R_COLOR12, 0x0001 }, { R_COLOR13, 0x0809 }, - { R_COLOR14, 0x0009 }, { R_COLOR15, 0x0009 }, { R_COLOR16, 0x0001 }, { R_COLOR17, 0x0809 }, - { R_COLOR18, 0x0008 }, { R_COLOR19, 0x0008 }, { R_COLOR1A, 0x0000 }, { R_COLOR1B, 0x0808 }, - { R_COLOR1C, 0x0089 }, { R_COLOR1D, 0x0089 }, { R_COLOR1E, 0x0081 }, { R_COLOR1F, 0x0889 }, + {{{ R_COLOR00, 0x0000 }}}, {{{ R_COLOR01, 0x0000 }}}, + {{{ R_COLOR02, 0x0000 }}}, {{{ R_COLOR03, 0x0000 }}}, + {{{ R_COLOR04, 0x0000 }}}, {{{ R_COLOR05, 0x0000 }}}, + {{{ R_COLOR06, 0x0000 }}}, {{{ R_COLOR07, 0x0000 }}}, + {{{ R_COLOR08, 0x0000 }}}, {{{ R_COLOR09, 0x0000 }}}, + {{{ R_COLOR0A, 0x0000 }}}, {{{ R_COLOR0B, 0x0000 }}}, + {{{ R_COLOR0C, 0x0000 }}}, {{{ R_COLOR0D, 0x0000 }}}, + {{{ R_COLOR0E, 0x0000 }}}, {{{ R_COLOR0F, 0x0000 }}}, + {{{ R_COLOR10, 0x0009 }}}, {{{ R_COLOR11, 0x0009 }}}, + {{{ R_COLOR12, 0x0001 }}}, {{{ R_COLOR13, 0x0809 }}}, + {{{ R_COLOR14, 0x0009 }}}, {{{ R_COLOR15, 0x0009 }}}, + {{{ R_COLOR16, 0x0001 }}}, {{{ R_COLOR17, 0x0809 }}}, + {{{ R_COLOR18, 0x0008 }}}, {{{ R_COLOR19, 0x0008 }}}, + {{{ R_COLOR1A, 0x0000 }}}, {{{ R_COLOR1B, 0x0808 }}}, + {{{ R_COLOR1C, 0x0089 }}}, {{{ R_COLOR1D, 0x0089 }}}, + {{{ R_COLOR1E, 0x0081 }}}, {{{ R_COLOR1F, 0x0889 }}}, /* set the registers up. */ - { R_DIWSTRT, 0xffff }, - { R_BPLCON0, 0x0000 }, - { R_DIWSTOP, 0x0000 }, + {{{ R_DIWSTRT, 0xffff }}}, + {{{ R_BPLCON0, 0x0000 }}}, + {{{ R_DIWSTOP, 0x0000 }}}, #if defined (GRF_ECS) || defined (GRF_AGA) - { R_DIWHIGH, 0x0000 }, + {{{ R_DIWHIGH, 0x0000 }}}, #endif - { R_DDFSTRT, 0x0000 }, - { R_DDFSTOP, 0x0000 }, - { R_BPLCON1, 0x0000 }, + {{{ R_DDFSTRT, 0x0000 }}}, + {{{ R_DDFSTOP, 0x0000 }}}, + {{{ R_BPLCON1, 0x0000 }}}, /* view specific stuff. */ - { R_BPL1MOD, 0x0000 }, - { R_BPL2MOD, 0x0000 }, + {{{ R_BPL1MOD, 0x0000 }}}, + {{{ R_BPL2MOD, 0x0000 }}}, /* bit plane pointers */ - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, - { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 }, - { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 }, - { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 }, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, + {{{ R_BPL1PTH, 0x0000 }}}, {{{ R_BPL1PTL, 0x0000 }}}, + {{{ R_BPL2PTH, 0x0000 }}}, {{{ R_BPL2PTL, 0x0000 }}}, + {{{ R_BPL3PTH, 0x0000 }}}, {{{ R_BPL3PTL, 0x0000 }}}, #if defined (GRF_AGA) - { R_FMODE, 0x0000}, + {{{ R_FMODE, 0x0000}}}, #endif - { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 }, - { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */ + {{{ R_COP1LCH, 0x0000 }}}, {{{ R_COP1LCL, 0x0000 }}}, + {{{ 0xffff, 0xfffe }}}, {{{ 0xffff, 0xfffe }}} /* COPEND, COPEND */ }; int std_dlace_copper_list_len = sizeof (std_dlace_copper_list) / sizeof (cop_t); int std_dlace_copper_list_size = sizeof (std_dlace_copper_list); cop_t std_a2024_copper_list[] = { - { CI_WAIT(0,12), 0xfffe }, /* WAIT (0, 12) */ + {{{ CI_WAIT(0,12), 0xfffe }}}, /* WAIT (0, 12) */ #if defined (GRF_ECS) || defined (GRF_AGA) - { R_BEAMCON0, 0x0000 }, + {{{ R_BEAMCON0, 0x0000 }}}, #endif /* hedley card init setup section */ - { R_COLOR00, 0x0f00 }, - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, /* init plane of 1's with first set for centering */ - { R_DIWSTRT, 0x1561 }, { R_DIWSTOP, 0x16d1 }, + {{{ R_COLOR00, 0x0f00 }}}, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, /* init plane of 1's with first set for centering */ + {{{ R_DIWSTRT, 0x1561 }}}, {{{ R_DIWSTOP, 0x16d1 }}}, #if defined (GRF_ECS) || defined (GRF_AGA) - { R_DIWHIGH, 0x2000 }, + {{{ R_DIWHIGH, 0x2000 }}}, #endif - { R_DDFSTRT, 0x0040 }, { R_DDFSTOP, 0x00d0 }, - { R_BPLCON0, 0x9200 }, + {{{ R_DDFSTRT, 0x0040 }}}, {{{ R_DDFSTOP, 0x00d0 }}}, + {{{ R_BPLCON0, 0x9200 }}}, /* actual data that will be latched by hedley card. */ - { R_COLOR01, 0x0001 }, /* Stuff1 */ - { CI_WAIT(126,21), 0xfffe }, { R_COLOR01, 0x0001 }, /* Display Quadrent */ - { CI_WAIT(158,21), 0xfffe }, { R_COLOR01, 0x08f0 }, /* Stuff */ - { CI_WAIT(190,21), 0xfffe }, { R_COLOR01, 0x0ff1 }, /* Stuff2 */ - { CI_WAIT(0,22), 0xfffe }, - { R_COLOR00, 0x0000 }, { R_BPLCON0, 0x0000 }, - { CI_WAIT(0,43), 0xfffe }, + {{{ R_COLOR01, 0x0001 }}}, /* Stuff1 */ + {{{ CI_WAIT(126,21), 0xfffe }}}, {{{ R_COLOR01, 0x0001 }}}, /* Display Quadrent */ + {{{ CI_WAIT(158,21), 0xfffe }}}, {{{ R_COLOR01, 0x08f0 }}}, /* Stuff */ + {{{ CI_WAIT(190,21), 0xfffe }}}, {{{ R_COLOR01, 0x0ff1 }}}, /* Stuff2 */ + {{{ CI_WAIT(0,22), 0xfffe }}}, + {{{ R_COLOR00, 0x0000 }}}, {{{ R_BPLCON0, 0x0000 }}}, + {{{ CI_WAIT(0,43), 0xfffe }}}, /* set the registers up. */ - { R_COLOR00, 0x0009 }, { R_COLOR01, 0x0001 }, { R_COLOR02, 0x0008 }, { R_COLOR03, 0x0000 }, - { R_COLOR04, 0x0809 }, { R_COLOR05, 0x0801 }, { R_COLOR06, 0x0808 }, { R_COLOR07, 0x0800 }, - { R_COLOR08, 0x0089 }, { R_COLOR09, 0x0081 }, { R_COLOR0A, 0x0088 }, { R_COLOR0B, 0x0080 }, - { R_COLOR0C, 0x0889 }, { R_COLOR0D, 0x0881 }, { R_COLOR0E, 0x0888 }, { R_COLOR0F, 0x0880 }, - { R_COLOR10, 0x0009 }, { R_COLOR11, 0x0009 }, { R_COLOR12, 0x0001 }, { R_COLOR13, 0x0809 }, - { R_COLOR14, 0x0009 }, { R_COLOR15, 0x0009 }, { R_COLOR16, 0x0001 }, { R_COLOR17, 0x0809 }, - { R_COLOR18, 0x0008 }, { R_COLOR19, 0x0008 }, { R_COLOR1A, 0x0000 }, { R_COLOR1B, 0x0808 }, - { R_COLOR1C, 0x0089 }, { R_COLOR1D, 0x0089 }, { R_COLOR1E, 0x0081 }, { R_COLOR1F, 0x0889 }, + {{{ R_COLOR00, 0x0009 }}}, {{{ R_COLOR01, 0x0001 }}}, + {{{ R_COLOR02, 0x0008 }}}, {{{ R_COLOR03, 0x0000 }}}, + {{{ R_COLOR04, 0x0809 }}}, {{{ R_COLOR05, 0x0801 }}}, + {{{ R_COLOR06, 0x0808 }}}, {{{ R_COLOR07, 0x0800 }}}, + {{{ R_COLOR08, 0x0089 }}}, {{{ R_COLOR09, 0x0081 }}}, + {{{ R_COLOR0A, 0x0088 }}}, {{{ R_COLOR0B, 0x0080 }}}, + {{{ R_COLOR0C, 0x0889 }}}, {{{ R_COLOR0D, 0x0881 }}}, + {{{ R_COLOR0E, 0x0888 }}}, {{{ R_COLOR0F, 0x0880 }}}, + {{{ R_COLOR10, 0x0009 }}}, {{{ R_COLOR11, 0x0009 }}}, + {{{ R_COLOR12, 0x0001 }}}, {{{ R_COLOR13, 0x0809 }}}, + {{{ R_COLOR14, 0x0009 }}}, {{{ R_COLOR15, 0x0009 }}}, + {{{ R_COLOR16, 0x0001 }}}, {{{ R_COLOR17, 0x0809 }}}, + {{{ R_COLOR18, 0x0008 }}}, {{{ R_COLOR19, 0x0008 }}}, + {{{ R_COLOR1A, 0x0000 }}}, {{{ R_COLOR1B, 0x0808 }}}, + {{{ R_COLOR1C, 0x0089 }}}, {{{ R_COLOR1D, 0x0089 }}}, + {{{ R_COLOR1E, 0x0081 }}}, {{{ R_COLOR1F, 0x0889 }}}, /* window size. */ - { R_DIWSTRT, 0x2c81 }, { R_BPLCON0, 0x0000 }, { R_DIWSTOP, 0xf481 }, + {{{ R_DIWSTRT, 0x2c81 }}}, {{{ R_BPLCON0, 0x0000 }}}, + {{{ R_DIWSTOP, 0xf481 }}}, /* datafetch */ - { R_DDFSTRT, 0x0038 }, { R_DDFSTOP, 0x00b8 }, - { R_BPLCON1, 0x0000 }, - { R_BPL1MOD, 0x00bc }, { R_BPL2MOD, 0x00bc }, + {{{ R_DDFSTRT, 0x0038 }}}, {{{ R_DDFSTOP, 0x00b8 }}}, + {{{ R_BPLCON1, 0x0000 }}}, + {{{ R_BPL1MOD, 0x00bc }}}, {{{ R_BPL2MOD, 0x00bc }}}, /* bitplanes */ - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, - { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 }, - { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 }, - { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 }, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, + {{{ R_BPL1PTH, 0x0000 }}}, {{{ R_BPL1PTL, 0x0000 }}}, + {{{ R_BPL2PTH, 0x0000 }}}, {{{ R_BPL2PTL, 0x0000 }}}, + {{{ R_BPL3PTH, 0x0000 }}}, {{{ R_BPL3PTL, 0x0000 }}}, #if defined (GRF_ECS) || defined (GRF_AGA) - { R_DIWHIGH, 0x2000 }, + {{{ R_DIWHIGH, 0x2000 }}}, #if defined (GRF_AGA) - { R_FMODE, 0x0000}, + {{{ R_FMODE, 0x0000}}}, #endif #endif - { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 }, - { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */ + {{{ R_COP1LCH, 0x0000 }}}, {{{ R_COP1LCL, 0x0000 }}}, + {{{ 0xffff, 0xfffe }}}, {{{ 0xffff, 0xfffe }}} /* COPEND, COPEND */ }; int std_a2024_copper_list_len = sizeof (std_a2024_copper_list) / sizeof (cop_t); int std_a2024_copper_list_size = sizeof (std_a2024_copper_list); cop_t std_pal_a2024_copper_list[] = { - { CI_WAIT(0,20), 0xfffe }, /* WAIT (0, 12) */ + {{{ CI_WAIT(0,20), 0xfffe }}}, /* WAIT (0, 12) */ #if defined (GRF_ECS) || defined (GRF_AGA) - { R_BEAMCON0, STANDARD_PAL_BEAMCON }, + {{{ R_BEAMCON0, STANDARD_PAL_BEAMCON }}}, #endif /* hedley card init setup section */ - { R_COLOR00, 0x0f00 }, - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, /* init plane of 1's with first set for centering */ - { R_DIWSTRT, 0x1d61 }, { R_DIWSTOP, 0x1ed1 }, + {{{ R_COLOR00, 0x0f00 }}}, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, /* init plane of 1's with first set for centering */ + {{{ R_DIWSTRT, 0x1d61 }}}, {{{ R_DIWSTOP, 0x1ed1 }}}, #if defined (GRF_ECS) || defined (GRF_AGA) - { R_DIWHIGH, 0x2000 }, + {{{ R_DIWHIGH, 0x2000 }}}, #endif - { R_DDFSTRT, 0x0040 }, { R_DDFSTOP, 0x00d0 }, - { R_BPLCON0, 0x9200 }, + {{{ R_DDFSTRT, 0x0040 }}}, {{{ R_DDFSTOP, 0x00d0 }}}, + {{{ R_BPLCON0, 0x9200 }}}, /* actual data that will be latched by hedley card. */ - { R_COLOR01, 0x0001 }, /* Stuff1 */ - { CI_WAIT(126,29), 0xfffe }, { R_COLOR01, 0x0001 }, /* Display Quadrent */ - { CI_WAIT(158,29), 0xfffe }, { R_COLOR01, 0x08f0 }, /* Stuff */ - { CI_WAIT(190,29), 0xfffe }, { R_COLOR01, 0x0ff1 }, /* Stuff2 */ - { CI_WAIT(0,30), 0xfffe }, - { R_COLOR00, 0x0000 }, { R_BPLCON0, 0x0000 }, - { CI_WAIT(0,43), 0xfffe }, + {{{ R_COLOR01, 0x0001 }}}, /* Stuff1 */ + {{{ CI_WAIT(126,29), 0xfffe }}}, {{{ R_COLOR01, 0x0001 }}}, /* Display Quadrent */ + {{{ CI_WAIT(158,29), 0xfffe }}}, {{{ R_COLOR01, 0x08f0 }}}, /* Stuff */ + {{{ CI_WAIT(190,29), 0xfffe }}}, {{{ R_COLOR01, 0x0ff1 }}}, /* Stuff2 */ + {{{ CI_WAIT(0,30), 0xfffe }}}, + {{{ R_COLOR00, 0x0000 }}}, {{{ R_BPLCON0, 0x0000 }}}, + {{{ CI_WAIT(0,43), 0xfffe }}}, /* set the registers up. */ - { R_COLOR00, 0x0009 }, { R_COLOR01, 0x0001 }, { R_COLOR02, 0x0008 }, { R_COLOR03, 0x0000 }, - { R_COLOR04, 0x0809 }, { R_COLOR05, 0x0801 }, { R_COLOR06, 0x0808 }, { R_COLOR07, 0x0800 }, - { R_COLOR08, 0x0089 }, { R_COLOR09, 0x0081 }, { R_COLOR0A, 0x0088 }, { R_COLOR0B, 0x0080 }, - { R_COLOR0C, 0x0889 }, { R_COLOR0D, 0x0881 }, { R_COLOR0E, 0x0888 }, { R_COLOR0F, 0x0880 }, - { R_COLOR10, 0x0009 }, { R_COLOR11, 0x0009 }, { R_COLOR12, 0x0001 }, { R_COLOR13, 0x0809 }, - { R_COLOR14, 0x0009 }, { R_COLOR15, 0x0009 }, { R_COLOR16, 0x0001 }, { R_COLOR17, 0x0809 }, - { R_COLOR18, 0x0008 }, { R_COLOR19, 0x0008 }, { R_COLOR1A, 0x0000 }, { R_COLOR1B, 0x0808 }, - { R_COLOR1C, 0x0089 }, { R_COLOR1D, 0x0089 }, { R_COLOR1E, 0x0081 }, { R_COLOR1F, 0x0889 }, + {{{ R_COLOR00, 0x0009 }}}, {{{ R_COLOR01, 0x0001 }}}, + {{{ R_COLOR02, 0x0008 }}}, {{{ R_COLOR03, 0x0000 }}}, + {{{ R_COLOR04, 0x0809 }}}, {{{ R_COLOR05, 0x0801 }}}, + {{{ R_COLOR06, 0x0808 }}}, {{{ R_COLOR07, 0x0800 }}}, + {{{ R_COLOR08, 0x0089 }}}, {{{ R_COLOR09, 0x0081 }}}, + {{{ R_COLOR0A, 0x0088 }}}, {{{ R_COLOR0B, 0x0080 }}}, + {{{ R_COLOR0C, 0x0889 }}}, {{{ R_COLOR0D, 0x0881 }}}, + {{{ R_COLOR0E, 0x0888 }}}, {{{ R_COLOR0F, 0x0880 }}}, + {{{ R_COLOR10, 0x0009 }}}, {{{ R_COLOR11, 0x0009 }}}, + {{{ R_COLOR12, 0x0001 }}}, {{{ R_COLOR13, 0x0809 }}}, + {{{ R_COLOR14, 0x0009 }}}, {{{ R_COLOR15, 0x0009 }}}, + {{{ R_COLOR16, 0x0001 }}}, {{{ R_COLOR17, 0x0809 }}}, + {{{ R_COLOR18, 0x0008 }}}, {{{ R_COLOR19, 0x0008 }}}, + {{{ R_COLOR1A, 0x0000 }}}, {{{ R_COLOR1B, 0x0808 }}}, + {{{ R_COLOR1C, 0x0089 }}}, {{{ R_COLOR1D, 0x0089 }}}, + {{{ R_COLOR1E, 0x0081 }}}, {{{ R_COLOR1F, 0x0889 }}}, /* window size. */ - { R_DIWSTRT, 0x2c81 }, { R_BPLCON0, 0x0000 }, { R_DIWSTOP, 0x2c81 }, + {{{ R_DIWSTRT, 0x2c81 }}}, {{{ R_BPLCON0, 0x0000 }}}, + {{{ R_DIWSTOP, 0x2c81 }}}, /* datafetch */ - { R_DDFSTRT, 0x0038 }, { R_DDFSTOP, 0x00b8 }, - { R_BPLCON1, 0x0000 }, - { R_BPL1MOD, 0x00bc }, { R_BPL2MOD, 0x00bc }, + {{{ R_DDFSTRT, 0x0038 }}}, {{{ R_DDFSTOP, 0x00b8 }}}, + {{{ R_BPLCON1, 0x0000 }}}, + {{{ R_BPL1MOD, 0x00bc }}}, {{{ R_BPL2MOD, 0x00bc }}}, /* bitplanes */ - { R_BPL0PTH, 0x0000 }, { R_BPL0PTL, 0x0000 }, - { R_BPL1PTH, 0x0000 }, { R_BPL1PTL, 0x0000 }, - { R_BPL2PTH, 0x0000 }, { R_BPL2PTL, 0x0000 }, - { R_BPL3PTH, 0x0000 }, { R_BPL3PTL, 0x0000 }, + {{{ R_BPL0PTH, 0x0000 }}}, {{{ R_BPL0PTL, 0x0000 }}}, + {{{ R_BPL1PTH, 0x0000 }}}, {{{ R_BPL1PTL, 0x0000 }}}, + {{{ R_BPL2PTH, 0x0000 }}}, {{{ R_BPL2PTL, 0x0000 }}}, + {{{ R_BPL3PTH, 0x0000 }}}, {{{ R_BPL3PTL, 0x0000 }}}, #if defined (GRF_ECS) || defined (GRF_AGA) - { R_DIWHIGH, 0x2100 }, + {{{ R_DIWHIGH, 0x2100 }}}, #if defined (GRF_AGA) - { R_FMODE, 0x0000}, + {{{ R_FMODE, 0x0000}}}, #endif #endif - { R_COP1LCH, 0x0000 }, { R_COP1LCL, 0x0000 }, - { 0xffff, 0xfffe }, { 0xffff, 0xfffe } /* COPEND, COPEND */ + {{{ R_COP1LCH, 0x0000 }}}, {{{ R_COP1LCL, 0x0000 }}}, + {{{ 0xffff, 0xfffe }}}, {{{ 0xffff, 0xfffe }}} /* COPEND, COPEND */ }; int std_pal_a2024_copper_list_len = sizeof (std_pal_a2024_copper_list) / sizeof (cop_t); int std_pal_a2024_copper_list_size = sizeof (std_pal_a2024_copper_list); diff --git a/sys/arch/amiga/dev/grfabs_reg.h b/sys/arch/amiga/dev/grfabs_reg.h index d1677c94724..7f38b00b8f5 100644 --- a/sys/arch/amiga/dev/grfabs_reg.h +++ b/sys/arch/amiga/dev/grfabs_reg.h @@ -1,4 +1,5 @@ -/* $NetBSD: grfabs_reg.h,v 1.4 1994/10/26 02:03:29 cgd Exp $ */ +/* $OpenBSD: grfabs_reg.h,v 1.2 1996/05/02 06:43:58 niklas Exp $ */ +/* $NetBSD: grfabs_reg.h,v 1.5 1996/04/21 21:11:31 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -280,24 +281,27 @@ struct monitor { * Prototypes */ -#if defined (__STDC__) /* views */ -view_t * grf_alloc_view (dmode_t *d, dimen_t *dim, u_char depth); -void grf_display_view (view_t *v); -void grf_remove_view (view_t *v); -void grf_free_view (view_t *v); -dmode_t *grf_get_display_mode (view_t *v); -int grf_get_colormap (view_t *v, colormap_t *cm); -int grf_use_colormap (view_t *v, colormap_t *cm); +view_t * grf_alloc_view __P((dmode_t *d, dimen_t *dim, u_char depth)); +void grf_display_view __P((view_t *v)); +void grf_remove_view __P((view_t *v)); +void grf_free_view __P((view_t *v)); +dmode_t *grf_get_display_mode __P((view_t *v)); +int grf_get_colormap __P((view_t *v, colormap_t *cm)); +int grf_use_colormap __P((view_t *v, colormap_t *cm)); + /* modes */ -view_t *grf_get_current_view (dmode_t *d); -monitor_t *grf_get_monitor (dmode_t *d); +view_t *grf_get_current_view __P((dmode_t *d)); +monitor_t *grf_get_monitor __P((dmode_t *d)); + /* monitors */ -dmode_t * grf_get_next_mode (monitor_t *m, dmode_t *d); -dmode_t * grf_get_current_mode (monitor_t *); -dmode_t * grf_get_best_mode (monitor_t *m, dimen_t *size, u_char depth); -bmap_t * grf_alloc_bitmap (monitor_t *m, u_short w, u_short h, u_short d, u_short f); -void grf_free_bitmap (monitor_t *m, bmap_t *bm); -#endif /* __STDC__ */ +dmode_t * grf_get_next_mode __P((monitor_t *m, dmode_t *d)); +dmode_t * grf_get_current_mode __P((monitor_t *)); +dmode_t * grf_get_best_mode __P((monitor_t *m, dimen_t *size, u_char depth)); +bmap_t * grf_alloc_bitmap __P((monitor_t *m, u_short w, u_short h, + u_short d, u_short f)); +void grf_free_bitmap __P((monitor_t *m, bmap_t *bm)); + +int grfcc_probe __P((void)); #endif /* _GRFABS_REG_H */ diff --git a/sys/arch/amiga/dev/grfvar.h b/sys/arch/amiga/dev/grfvar.h index 8a6cdb6b911..14c30895992 100644 --- a/sys/arch/amiga/dev/grfvar.h +++ b/sys/arch/amiga/dev/grfvar.h @@ -1,4 +1,5 @@ -/* $NetBSD: grfvar.h,v 1.12 1995/10/09 02:08:48 chopps Exp $ */ +/* $OpenBSD: grfvar.h,v 1.2 1996/05/02 06:43:59 niklas Exp $ */ +/* $NetBSD: grfvar.h,v 1.13 1996/04/21 21:11:33 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -59,7 +60,8 @@ struct grf_softc { dev_t g_itedev; /* ite device number */ dev_t g_grfdev; /* grf device number */ caddr_t g_data; /* device dependent data */ - int (*g_mode)(); + int (*g_mode) __P((struct grf_softc *, u_long, void *, + u_long, int)); int g_conpri; /* priority of ite as console */ void (*g_iteinit) __P((struct ite_softc *)); void (*g_itedeinit) __P((struct ite_softc *)); @@ -91,7 +93,7 @@ struct grf_softc { #define GM_GRFSETBANK 10 #define GM_GRFGETCURBANK 11 #define GM_GRFIOCTL 12 -#define GM_GRFTOGGLE 13 +#define GM_GRFTOGGLE 13 /* minor device interpretation */ #define GRFOVDEV 0x10 /* used by grf_ul, overlay planes */ diff --git a/sys/arch/amiga/dev/gtsc.c b/sys/arch/amiga/dev/gtsc.c index 55a3de1b297..a4b2551a3ae 100644 --- a/sys/arch/amiga/dev/gtsc.c +++ b/sys/arch/amiga/dev/gtsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: gtsc.c,v 1.2 1996/04/21 22:15:17 deraadt Exp $ */ -/* $NetBSD: gtsc.c,v 1.14 1996/03/17 01:17:22 thorpej Exp $ */ +/* $OpenBSD: gtsc.c,v 1.3 1996/05/02 06:44:00 niklas Exp $ */ +/* $NetBSD: gtsc.c,v 1.15 1996/04/21 21:11:34 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -60,9 +60,13 @@ int gtscprint __P((void *auxp, char *)); void gtsc_enintr __P((struct sbic_softc *)); void gtsc_dmastop __P((struct sbic_softc *)); int gtsc_dmanext __P((struct sbic_softc *)); -int gtsc_dmaintr __P((struct sbic_softc *)); +int gtsc_dmaintr __P((void *)); int gtsc_dmago __P((struct sbic_softc *, char *, int, int)); +#ifdef DEBUG +void gtsc_dump __P((void)); +#endif + struct scsi_adapter gtsc_scsiswitch = { sbic_scsicmd, sbic_minphys, @@ -99,7 +103,6 @@ gtscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct gvpbus_args *gap; gap = auxp; @@ -146,7 +149,7 @@ gtscattach(pdp, dp, auxp) sc->sc_dmamask = ~0x01ffffff; else sc->sc_dmamask = ~0x07ffffff; - printf(": dmamask 0x%x", ~sc->sc_dmamask); + printf(": dmamask 0x%lx", ~sc->sc_dmamask); if ((gap->flags & GVP_NOBANK) == 0) sc->gtsc_bankmask = (~sc->sc_dmamask >> 18) & 0x01c0; @@ -183,7 +186,7 @@ gtscattach(pdp, dp, auxp) sc->sc_sbicp = (sbic_regmap_p) ((int)rp + 0x61); sc->sc_clkfreq = gtsc_clock_override ? gtsc_clock_override : ((gap->flags & GVP_14MHZ) ? 143 : 72); - printf("sc_clkfreg: %d.%dMhz\n", sc->sc_clkfreq / 10, sc->sc_clkfreq % 10); + printf("sc_clkfreg: %ld.%ldMhz\n", sc->sc_clkfreq / 10, sc->sc_clkfreq % 10); sc->sc_link.adapter_softc = sc; sc->sc_link.adapter_target = 7; @@ -253,7 +256,7 @@ gtsc_dmago(dev, addr, count, flags) sdp->CNTR = dev->sc_dmacmd; if((u_int)dev->sc_cur->dc_addr & dev->sc_dmamask) { #if 1 - printf("gtsc_dmago: pa %08x->%08x dmacmd %x", + printf("gtsc_dmago: pa %p->%lx dmacmd %x", dev->sc_cur->dc_addr, (u_int)dev->sc_cur->dc_addr & ~dev->sc_dmamask, dev->sc_dmacmd); @@ -273,7 +276,7 @@ gtsc_dmago(dev, addr, count, flags) dev->sc_tcnt = gtsc_maxdma; #if 1 if((u_int)dev->sc_cur->dc_addr & dev->sc_dmamask) - printf(" tcnt %d\n", dev->sc_tcnt); + printf(" tcnt %ld\n", dev->sc_tcnt); #endif return(dev->sc_tcnt); } @@ -304,9 +307,10 @@ gtsc_dmastop(dev) } int -gtsc_dmaintr(dev) - struct sbic_softc *dev; +gtsc_dmaintr(arg) + void *arg; { + struct sbic_softc *dev = arg; volatile struct sdmac *sdp; int stat; @@ -330,7 +334,6 @@ gtsc_dmanext(dev) struct sbic_softc *dev; { volatile struct sdmac *sdp; - int i, stat; sdp = dev->sc_cregs; @@ -358,7 +361,7 @@ gtsc_dmanext(dev) dev->sc_tcnt = gtsc_maxdma; #ifdef DEBUG if (gtsc_debug & DDB_FOLLOW) - printf("gtsc_dmanext ret: %d\n", dev->sc_tcnt); + printf("gtsc_dmanext ret: %ld\n", dev->sc_tcnt); #endif return(dev->sc_tcnt); } diff --git a/sys/arch/amiga/dev/gvpbus.c b/sys/arch/amiga/dev/gvpbus.c index fded8d442b2..caa3e222354 100644 --- a/sys/arch/amiga/dev/gvpbus.c +++ b/sys/arch/amiga/dev/gvpbus.c @@ -1,5 +1,5 @@ -/* $OpenBSD: gvpbus.c,v 1.2 1996/04/21 22:15:18 deraadt Exp $ */ -/* $NetBSD: gvpbus.c,v 1.10 1996/03/17 01:17:23 thorpej Exp $ */ +/* $OpenBSD: gvpbus.c,v 1.3 1996/05/02 06:44:00 niklas Exp $ */ +/* $NetBSD: gvpbus.c,v 1.11 1996/04/21 21:11:36 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -32,6 +32,7 @@ */ #include <sys/param.h> #include <sys/device.h> +#include <sys/systm.h> #include <amiga/amiga/device.h> #include <amiga/dev/zbusvar.h> #include <amiga/dev/gvpbusvar.h> @@ -55,7 +56,6 @@ gvpbusmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -79,7 +79,6 @@ gvpbusattach(pdp, dp, auxp) { struct zbus_args *zap; struct gvpbus_args ga; - u_char *idreg; zap = auxp; bcopy(zap, &ga.zargs, sizeof(struct zbus_args)); diff --git a/sys/arch/amiga/dev/idesc.c b/sys/arch/amiga/dev/idesc.c index 0d83dd598b6..77d9e5598ea 100644 --- a/sys/arch/amiga/dev/idesc.c +++ b/sys/arch/amiga/dev/idesc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: idesc.c,v 1.3 1996/04/21 22:15:20 deraadt Exp $ */ -/* $NetBSD: idesc.c,v 1.18 1996/03/24 04:12:27 mhitch Exp $ */ +/* $OpenBSD: idesc.c,v 1.4 1996/05/02 06:44:01 niklas Exp $ */ +/* $NetBSD: idesc.c,v 1.20 1996/04/28 06:36:16 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -251,7 +251,7 @@ int idereset __P((struct idec_softc *)); void idesetdelay __P((int)); void ide_scsidone __P((struct idec_softc *, int)); void ide_donextcmd __P((struct idec_softc *)); -int idesc_intr __P((struct idec_softc *)); +int idesc_intr __P((void *)); struct scsi_adapter idesc_scsiswitch = { ide_scsicmd, @@ -296,6 +296,8 @@ struct { int idecommand __P((struct ide_softc *, int, int, int, int, int)); int idewait __P((struct idec_softc *, int)); int idegetctlr __P((struct ide_softc *)); +int ideiread __P((struct ide_softc *, long, u_char *, int)); +int ideiwrite __P((struct ide_softc *, long, u_char *, int)); #define wait_for_drq(ide) idewait(ide, IDES_DRQ) #define wait_for_ready(ide) idewait(ide, IDES_READY | IDES_SEEKCMPLT) @@ -304,6 +306,7 @@ int idegetctlr __P((struct ide_softc *)); int ide_no_int = 0; #ifdef DEBUG +void ide_dump_regs __P((ide_regmap_p)); int ide_debug = 0; @@ -315,7 +318,7 @@ int ide_debug = 0; #define TRACE0(arg) #define TRACE1(arg1,arg2) -#define QPRINTF +#define QPRINTF(a) #endif /* !DEBUG */ @@ -353,7 +356,7 @@ idescattach(pdp, dp, auxp) sc->sc_cregs = rp = (ide_regmap_p) ztwomap(0xda0000); sc->sc_a1200 = ztwomap(0xda8000 + 0x1000); sc->sc_flags |= IDECF_A1200; - printf(" A1200 @ %x:%x", rp, sc->sc_a1200); + printf(" A1200 @ %p:%p", rp, sc->sc_a1200); } #ifdef DEBUG @@ -362,8 +365,10 @@ idescattach(pdp, dp, auxp) #endif rp->ide_error = 0x5a; rp->ide_cyl_lo = 0xa5; - if (rp->ide_error == 0x5a || rp->ide_cyl_lo != 0xa5) + if (rp->ide_error == 0x5a || rp->ide_cyl_lo != 0xa5) { + printf ("\n"); return; + } /* test if controller will reset */ if (idereset(sc) != 0) { delay (500000); @@ -491,7 +496,7 @@ ide_donextcmd(dev) { struct scsi_xfer *xs; struct scsi_link *slp; - int flags, phase, stat; + int flags, stat; xs = dev->sc_xs; slp = xs->sc_link; @@ -508,7 +513,7 @@ ide_donextcmd(dev) } if (flags & SCSI_POLL || ide_no_int) stat = ideicmd(dev, slp->target, xs->cmd, xs->cmdlen, - xs->data, xs->datalen/*, phase*/); + xs->data, xs->datalen); else if (idego(dev, xs) == 0) return; else @@ -550,7 +555,7 @@ ide_scsidone(dev, stat) else { switch(stat) { case SCSI_CHECK: - if (stat = idegetsense(dev, xs)) + if ((stat = idegetsense(dev, xs)) != 0) goto bad_sense; xs->error = XS_SENSE; break; @@ -595,7 +600,6 @@ idegetsense(dev, xs) { struct scsi_sense rqs; struct scsi_link *slp; - int stat; slp = xs->sc_link; @@ -615,6 +619,7 @@ idegetsense(dev, xs) } #ifdef DEBUG +void ide_dump_regs(regs) ide_regmap_p regs; { @@ -978,8 +983,6 @@ idego(dev, xs) struct scsi_xfer *xs; { struct ide_softc *ide = &dev->sc_ide[xs->sc_link->target]; - char *addr; - int count; long lba; int nblks; @@ -1077,12 +1080,10 @@ idestart(dev) int -idesc_intr(dev) - struct idec_softc *dev; +idesc_intr(arg) + void *arg; { -#if 0 - struct idec_softc *dev; -#endif + struct idec_softc *dev = arg; ide_regmap_p regs; struct ide_softc *ide; short dummy; @@ -1141,7 +1142,7 @@ printf("idesc_intr: error %02x, %02x\n", dev->sc_stat[1], dummy); ide->sc_mbcount -= DEV_BSIZE; #ifdef DEBUG if (ide_debug) - printf ("idesc_intr: sc_bcount %d\n", ide->sc_bcount); + printf ("idesc_intr: sc_bcount %ld\n", ide->sc_bcount); #endif if (ide->sc_bcount == 0) ide_scsidone(dev, dev->sc_stat[0]); diff --git a/sys/arch/amiga/dev/if_ae.c b/sys/arch/amiga/dev/if_ae.c index e9f98cf8503..c0c91a3b30c 100644 --- a/sys/arch/amiga/dev/if_ae.c +++ b/sys/arch/amiga/dev/if_ae.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_ae.c,v 1.4 1996/04/21 22:15:21 deraadt Exp $ */ -/* $NetBSD: if_ae.c,v 1.6 1996/03/17 01:17:28 thorpej Exp $ */ +/* $OpenBSD: if_ae.c,v 1.5 1996/05/02 06:44:02 niklas Exp $ */ +/* $NetBSD: if_ae.c,v 1.7 1996/04/21 21:11:40 veego Exp $ */ /* * Copyright (c) 1995 Bernd Ernesti and Klaus Burkert. All rights reserved. @@ -92,7 +92,13 @@ #if defined(CCITT) && defined(LLC) #include <sys/socketvar.h> #include <netccitt/x25.h> -extern llc_ctlinput(), cons_rtrequest(); +#include <net/if_dl.h> +#include <net/if_llc.h> +#include <netccitt/dll.h> +#include <netccitt/llc_var.h> +#include <netccitt/pk.h> +#include <netccitt/pk_var.h> +#include <netccitt/pk_extern.h> #endif #if NBPFILTER > 0 @@ -138,7 +144,7 @@ void aememinit __P((struct ae_softc *)); void aereset __P((struct ae_softc *)); void aeinit __P((struct ae_softc *)); void aestart __P((struct ifnet *)); -int aeintr __P((struct ae_softc *)); +int aeintr __P((void *)); void aetint __P((struct ae_softc *)); void aerint __P((struct ae_softc *)); void aeread __P((struct ae_softc *, u_char *, int)); @@ -146,7 +152,7 @@ static void wcopyfrom __P((char *, char *, int)); static void wcopyto __P((char *, char *, int)); static void wzero __P((char *, int)); int aeput __P((char *, struct mbuf *)); -struct mbuf *aeget __P((struct ae_softc *,u_char *, int)); +struct mbuf *aeget __P((struct ae_softc *, u_char *, int)); int aeioctl __P((struct ifnet *, u_long, caddr_t)); void aesetladrf __P((struct arpcom *, u_int16_t *)); @@ -256,7 +262,7 @@ aeattach(parent, self, aux) void aewatchdog(unit) - short unit; + int unit; { struct ae_softc *sc = ae_cd.cd_devs[unit]; @@ -495,9 +501,10 @@ aestart(ifp) } int -aeintr(sc) - register struct ae_softc *sc; +aeintr(arg) + void *arg; { + register struct ae_softc *sc = arg; register struct aereg1 *aer1; register struct ifnet *ifp = &sc->sc_arpcom.ac_if; register u_int16_t stat; @@ -823,7 +830,7 @@ wcopyto(a1, a2, length) /* bcopy() word-wise */ *b2++ = *b1++; if (length & 0x0001) { - i = (*b2 & 0x00ff) | (*b1 & 0xff00); /* copy trailing byte */ + i = (*b2 & 0x00ff) | (a1[length-1] & 0x00ff)<<8; /* copy trailing byte */ *b2 = i; } } @@ -997,7 +1004,7 @@ aeioctl(ifp, cmd, data) #if defined(CCITT) && defined(LLC) case SIOCSIFCONF_X25: ifp->if_flags |= IFF_UP; - ifa->ifa_rtrequest = (void (*)())cons_rtrequest; /* XXX */ + ifa->ifa_rtrequest = cons_rtrequest; /* XXX */ error = x25_llcglue(PRC_IFUP, ifa->ifa_addr); if (error == 0) aeinit(sc); diff --git a/sys/arch/amiga/dev/if_bah.c b/sys/arch/amiga/dev/if_bah.c index b3e86d21518..cc6913b2bb3 100644 --- a/sys/arch/amiga/dev/if_bah.c +++ b/sys/arch/amiga/dev/if_bah.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_bah.c,v 1.4 1996/04/21 22:15:23 deraadt Exp $ */ -/* $NetBSD: if_bah.c,v 1.16 1996/03/20 13:28:50 is Exp $ */ +/* $OpenBSD: if_bah.c,v 1.5 1996/05/02 06:44:03 niklas Exp $ */ +/* $NetBSD: if_bah.c,v 1.17 1996/04/21 21:11:42 veego Exp $ */ /* * Copyright (c) 1994, 1995 Ignatios Souvatzis @@ -182,17 +182,15 @@ void bah_init __P((struct bah_softc *)); void bah_reset __P((struct bah_softc *)); void bah_stop __P((struct bah_softc *)); void bah_start __P((struct ifnet *)); -int bahintr __P((struct bah_softc *sc)); +int bahintr __P((void *)); int bah_ioctl __P((struct ifnet *, unsigned long, caddr_t)); void bah_watchdog __P((int)); void movepout __P((u_char *from, u_char __volatile *to, int len)); void movepin __P((u_char __volatile *from, u_char *to, int len)); void bah_srint __P((void *vsc, void *dummy)); void callstart __P((void *vsc, void *dummy)); +static void bah_tint __P((struct bah_softc *, int)); -#ifdef BAHTIMINGS -int clkread(); -#endif struct cfattach bah_zbus_ca = { sizeof(struct bah_softc), bah_zbus_match, bah_zbus_attach @@ -252,7 +250,7 @@ bah_zbus_attach(parent, self, aux) printf(": link addr 0x%02x(%ld), with timer\n", linkaddress, linkaddress); #else - printf(": link addr 0x%02x(%ld)\n", linkaddress, linkaddress); + printf(": link addr 0x%02x(%d)\n", linkaddress, linkaddress); #endif sc->sc_arccom.ac_anaddr = linkaddress; @@ -767,7 +765,7 @@ bah_srint(vsc, dummy) void *vsc, *dummy; { struct bah_softc *sc; - int buffer, len, len1, amount, offset, s, i, type; + int buffer, len, len1, amount, offset, s, type; u_char __volatile *bah_ram_ptr; struct mbuf *m, *dst, *head; struct arc_header *ah; @@ -1016,9 +1014,10 @@ bah_tint(sc, isr) * Our interrupt routine */ int -bahintr(sc) - struct bah_softc *sc; +bahintr(arg) + void *arg; { + struct bah_softc *sc = arg; u_char isr, maskedisr; int buffer; u_long newsec; diff --git a/sys/arch/amiga/dev/if_ed.c b/sys/arch/amiga/dev/if_ed.c index 95ae95e7091..e38ac42f46f 100644 --- a/sys/arch/amiga/dev/if_ed.c +++ b/sys/arch/amiga/dev/if_ed.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_ed.c,v 1.3 1996/04/21 22:15:25 deraadt Exp $ */ -/* $NetBSD: if_ed.c,v 1.19 1996/03/21 21:00:21 is Exp $ */ +/* $OpenBSD: if_ed.c,v 1.4 1996/05/02 06:44:04 niklas Exp $ */ +/* $NetBSD: if_ed.c,v 1.20 1996/04/21 21:11:44 veego Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -98,10 +98,10 @@ struct ed_softc { int ed_zbus_match __P((struct device *, void *, void *)); void ed_zbus_attach __P((struct device *, struct device *, void *)); -int edintr __P((struct ed_softc *)); +int edintr __P((void *)); int ed_ioctl __P((struct ifnet *, u_long, caddr_t)); void ed_start __P((struct ifnet *)); -void ed_watchdog __P((/* short */)); +void ed_watchdog __P((int)); void ed_reset __P((struct ed_softc *)); void ed_init __P((struct ed_softc *)); void ed_stop __P((struct ed_softc *)); @@ -110,11 +110,16 @@ u_short ed_put __P((struct ed_softc *, struct mbuf *, caddr_t)); #define inline /* XXX for debugging porpoises */ -void ed_get_packet __P((/* struct ed_softc *, caddr_t, u_short */)); +void ed_get_packet __P((struct ed_softc *, caddr_t, u_short)); static inline void ed_rint __P((struct ed_softc *)); static inline void ed_xmit __P((struct ed_softc *)); -static inline caddr_t ed_ring_copy __P((/* struct ed_softc *, caddr_t, caddr_t, - u_short */)); +static inline caddr_t ed_ring_copy __P((struct ed_softc *, caddr_t, caddr_t, + u_short)); + +static inline void NIC_PUT __P((struct ed_softc *, int, u_char)); +static inline u_char NIC_GET __P((struct ed_softc *, int)); +static inline void word_copy __P((caddr_t, caddr_t, int)); +struct mbuf *ed_ring_to_mbuf __P((struct ed_softc *, caddr_t, struct mbuf *, u_short)); struct cfattach ed_zbus_ca = { sizeof(struct ed_softc), ed_zbus_match, ed_zbus_attach @@ -323,7 +328,7 @@ ed_stop(sc) */ void ed_watchdog(unit) - short unit; + int unit; { struct ed_softc *sc = ed_cd.cd_devs[unit]; @@ -342,7 +347,6 @@ ed_init(sc) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; int i, s; - u_char command; u_long mcaf[2]; /* @@ -684,9 +688,10 @@ loop: /* Ethernet interface interrupt processor. */ int -edintr(sc) - struct ed_softc *sc; +edintr(arg) + void *arg; { + struct ed_softc *sc = arg; u_char isr; /* Set NIC to page 0 registers. */ @@ -885,7 +890,7 @@ ed_ioctl(ifp, command, data) if (ns_nullhost(*ina)) ina->x_host = - *(union ns_host *)(sc->sc_arpcom.sc_enaddr); + *(union ns_host *)(sc->sc_arpcom.ac_enaddr); else bcopy(ina->x_host.c_host, sc->sc_arpcom.ac_enaddr, @@ -964,7 +969,7 @@ ed_get_packet(sc, buf, len) u_short len; { struct ether_header *eh; - struct mbuf *m, *ed_ring_to_mbuf(); + struct mbuf *m; /* round length to word boundry */ len = (len + 1) & ~1; diff --git a/sys/arch/amiga/dev/if_es.c b/sys/arch/amiga/dev/if_es.c index 078430b9f5c..7878d299583 100644 --- a/sys/arch/amiga/dev/if_es.c +++ b/sys/arch/amiga/dev/if_es.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_es.c,v 1.3 1996/04/21 22:15:26 deraadt Exp $ */ -/* $NetBSD: if_es.c,v 1.10 1996/03/17 05:58:45 mhitch Exp $ */ +/* $OpenBSD: if_es.c,v 1.4 1996/05/02 06:44:05 niklas Exp $ */ +/* $NetBSD: if_es.c,v 1.11 1996/04/21 21:11:46 veego Exp $ */ /* * Copyright (c) 1995 Michael L. Hitch @@ -111,9 +111,10 @@ int estxint2 = 0; /* IST_TX active after IST_TX_EMPTY */ int estxint3 = 0; /* IST_TX interrupt processed */ int estxint4 = 0; /* ~TEMPTY counts */ int estxint5 = 0; /* IST_TX_EMPTY interrupts */ +void es_dump_smcregs __P((char *, union smcregs *)); #endif -int esintr __P((struct es_softc *)); +int esintr __P((void *)); void esstart __P((struct ifnet *)); void eswatchdog __P((int)); int esioctl __P((struct ifnet *, u_long, caddr_t)); @@ -121,6 +122,7 @@ void esrint __P((struct es_softc *)); void estint __P((struct es_softc *)); void esinit __P((struct es_softc *)); void esreset __P((struct es_softc *)); +void esstop __P((struct es_softc *)); int esmatch __P((struct device *, void *, void *)); void esattach __P((struct device *, struct device *, void *)); @@ -225,7 +227,7 @@ es_dump_smcregs(where, smc) { u_short cur_bank = smc->b0.bsr & 0x0300; - printf("SMC registers %08x from %s bank %04x\n", smc, where, + printf("SMC registers %p from %s bank %04x\n", smc, where, smc->b0.bsr); smc->b0.bsr = BSR_BANK0; printf("TCR %04x EPHSR %04x RCR %04x ECR %04x MIR %04x MCR %04x\n", @@ -287,7 +289,7 @@ esinit(sc) smc->b2.mmucr = MMUCR_RESET; smc->b0.bsr = BSR_BANK0; /* Select bank 0 */ smc->b0.mcr = SWAP(0x0020); /* reserve 8K for transmit buffers */ - smc->b0.tcr = TCR_PAD_EN | TCR_TXENA + TCR_MON_CSN; + smc->b0.tcr = TCR_PAD_EN | (TCR_TXENA + TCR_MON_CSN); smc->b0.rcr = RCR_FILT_CAR | RCR_STRIP_CRC | RCR_RXEN; /* XXX add multicast/promiscuous flags */ smc->b2.bsr = BSR_BANK2; /* Select bank 2 */ @@ -304,10 +306,10 @@ esinit(sc) } int -esintr(sc) - struct es_softc *sc; +esintr(arg) + void *arg; { - int i; + struct es_softc *sc = arg; u_short intsts, intact; union smcregs *smc; int s = splnet(); @@ -534,9 +536,11 @@ esrint(sc) u_short len; short cnt; u_short pktctlw, pktlen, *buf; - u_long *lbuf; volatile u_short *data; +#if 0 + u_long *lbuf; volatile u_long *ldata; +#endif struct ifnet *ifp; struct mbuf *top, **mp, *m; struct ether_header *eh; @@ -549,7 +553,7 @@ esrint(sc) printf ("%s: esrint fifo %04x", sc->sc_dev.dv_xname, smc->b2.fifo); if (sc->sc_smcbusy++) { - printf("%s: esrint re-entered\n"); + printf("%s: esrint re-entered\n", sc->sc_dev.dv_xname); panic("esrint re-entered"); } while ((smc->b2.bsr & 0x0300) != BSR_BANK2) { @@ -571,7 +575,7 @@ esrint(sc) if (esdebug) printf (" length %d", len); #endif - smc->b2.ptr = PTR_RCV | PTR_AUTOINCR + PTR_READ | SWAP(0x0000); + smc->b2.ptr = PTR_RCV | (PTR_AUTOINCR + PTR_READ) | SWAP(0x0000); (void) smc->b2.mmucr; pktctlw = *data; pktlen = *data; @@ -766,8 +770,10 @@ esstart(ifp) u_short pktctlw, pktlen; u_short *buf; volatile u_short *data; +#if 0 u_long *lbuf; volatile u_long *ldata; +#endif short cnt; int i; u_char active_pnr; @@ -798,7 +804,7 @@ int xxx; break; #ifdef ESDEBUG if (esdebug && (m->m_next || m->m_len & 1)) - printf("%s: esstart m_next %x m_len %d\n", sc->sc_dev.dv_xname, + printf("%s: esstart m_next %p m_len %d\n", sc->sc_dev.dv_xname, m->m_next, m->m_len); #endif for (m0 = m, pktlen = 0; m0; m0 = m0->m_next) @@ -968,6 +974,7 @@ esioctl(ifp, command, data) /* Set new address. */ esinit(sc); break; + } #endif default: esinit(sc); diff --git a/sys/arch/amiga/dev/if_le.c b/sys/arch/amiga/dev/if_le.c index f4c4bf5fe8a..39316f21869 100644 --- a/sys/arch/amiga/dev/if_le.c +++ b/sys/arch/amiga/dev/if_le.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_le.c,v 1.3 1996/04/21 22:15:28 deraadt Exp $ */ -/* $NetBSD: if_le.c,v 1.17 1996/03/17 01:17:35 thorpej Exp $ */ +/* $OpenBSD: if_le.c,v 1.4 1996/05/02 06:44:06 niklas Exp $ */ +/* $NetBSD: if_le.c,v 1.20 1996/04/22 02:33:08 christos Exp $ */ /*- * Copyright (c) 1995 Charles M. Hannum. All rights reserved. @@ -86,6 +86,12 @@ struct cfdriver le_cd = { }; integrate void +lehwinit(sc) + struct le_softc *sc; +{ +} + +integrate void lewrcsr(sc, port, val) struct le_softc *sc; u_int16_t port, val; @@ -134,18 +140,16 @@ le_zbus_attach(parent, self, aux) { struct le_softc *sc = (void *)self; struct zbus_args *zap = aux; - char *cp; - int i; u_long ser; sc->sc_r1 = (struct lereg1 *)(lestd[1] + (int)zap->va); sc->sc_mem = (void *)(lestd[2] + (int)zap->va); - sc->sc_copytodesc = copytobuf_contig; - sc->sc_copyfromdesc = copyfrombuf_contig; - sc->sc_copytobuf = copytobuf_contig; - sc->sc_copyfrombuf = copyfrombuf_contig; - sc->sc_zerobuf = zerobuf_contig; + sc->sc_copytodesc = am7990_copytobuf_contig; + sc->sc_copyfromdesc = am7990_copyfrombuf_contig; + sc->sc_copytobuf = am7990_copytobuf_contig; + sc->sc_copyfrombuf = am7990_copyfrombuf_contig; + sc->sc_zerobuf = am7990_zerobuf_contig; sc->sc_conf3 = LE_C3_BSWP; sc->sc_addr = 0x8000; diff --git a/sys/arch/amiga/dev/if_le_zbus.c b/sys/arch/amiga/dev/if_le_zbus.c index 75a0c5b694a..8d65f391e63 100644 --- a/sys/arch/amiga/dev/if_le_zbus.c +++ b/sys/arch/amiga/dev/if_le_zbus.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_le_zbus.c,v 1.3 1996/04/21 22:15:28 deraadt Exp $ */ -/* $NetBSD: if_le.c,v 1.17 1996/03/17 01:17:35 thorpej Exp $ */ +/* $OpenBSD: if_le_zbus.c,v 1.4 1996/05/02 06:44:06 niklas Exp $ */ +/* $NetBSD: if_le.c,v 1.20 1996/04/22 02:33:08 christos Exp $ */ /*- * Copyright (c) 1995 Charles M. Hannum. All rights reserved. @@ -86,6 +86,12 @@ struct cfdriver le_cd = { }; integrate void +lehwinit(sc) + struct le_softc *sc; +{ +} + +integrate void lewrcsr(sc, port, val) struct le_softc *sc; u_int16_t port, val; @@ -134,18 +140,16 @@ le_zbus_attach(parent, self, aux) { struct le_softc *sc = (void *)self; struct zbus_args *zap = aux; - char *cp; - int i; u_long ser; sc->sc_r1 = (struct lereg1 *)(lestd[1] + (int)zap->va); sc->sc_mem = (void *)(lestd[2] + (int)zap->va); - sc->sc_copytodesc = copytobuf_contig; - sc->sc_copyfromdesc = copyfrombuf_contig; - sc->sc_copytobuf = copytobuf_contig; - sc->sc_copyfrombuf = copyfrombuf_contig; - sc->sc_zerobuf = zerobuf_contig; + sc->sc_copytodesc = am7990_copytobuf_contig; + sc->sc_copyfromdesc = am7990_copyfrombuf_contig; + sc->sc_copytobuf = am7990_copytobuf_contig; + sc->sc_copyfrombuf = am7990_copyfrombuf_contig; + sc->sc_zerobuf = am7990_zerobuf_contig; sc->sc_conf3 = LE_C3_BSWP; sc->sc_addr = 0x8000; diff --git a/sys/arch/amiga/dev/if_levar.h b/sys/arch/amiga/dev/if_levar.h index 2cd785c03a8..42268bfe37d 100644 --- a/sys/arch/amiga/dev/if_levar.h +++ b/sys/arch/amiga/dev/if_levar.h @@ -1,4 +1,5 @@ -/* $NetBSD: if_levar.h,v 1.1 1995/09/30 17:18:22 chopps Exp $ */ +/* $OpenBSD: if_levar.h,v 1.2 1996/05/02 06:44:07 niklas Exp $ */ +/* $NetBSD: if_levar.h,v 1.2 1996/04/21 21:11:48 veego Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -52,12 +53,16 @@ struct le_softc { struct device sc_dev; /* base structure */ struct arpcom sc_arpcom; /* Ethernet common part */ - void (*sc_copytodesc)(); /* Copy to descriptor */ - void (*sc_copyfromdesc)(); /* Copy from descriptor */ - - void (*sc_copytobuf)(); /* Copy to buffer */ - void (*sc_copyfrombuf)(); /* Copy from buffer */ - void (*sc_zerobuf)(); /* and Zero bytes in buffer */ + void (*sc_copytodesc) /* Copy to descriptor */ + __P((struct le_softc *, void *, int, int)); + void (*sc_copyfromdesc) /* Copy from descriptor */ + __P((struct le_softc *, void *, int, int)); + void (*sc_copytobuf) /* Copy to buffer */ + __P((struct le_softc *, void *, int, int)); + void (*sc_copyfrombuf) /* Copy from buffer */ + __P((struct le_softc *, void *, int, int)); + void (*sc_zerobuf) /* and Zero bytes in buffer */ + __P((struct le_softc *, int, int)); u_int16_t sc_conf3; /* CSR3 value */ diff --git a/sys/arch/amiga/dev/if_qn.c b/sys/arch/amiga/dev/if_qn.c index 7f40c0fb277..a34342e1802 100644 --- a/sys/arch/amiga/dev/if_qn.c +++ b/sys/arch/amiga/dev/if_qn.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_qn.c,v 1.4 1996/04/21 22:15:29 deraadt Exp $ */ -/* $NetBSD: if_qn.c,v 1.4 1996/03/17 01:17:37 thorpej Exp $ */ +/* $OpenBSD: if_qn.c,v 1.5 1996/05/02 06:44:08 niklas Exp $ */ +/* $NetBSD: if_qn.c,v 1.5 1996/04/21 21:11:50 veego Exp $ */ /* * Copyright (c) 1995 Mika Kortelainen @@ -158,7 +158,7 @@ struct qn_softc { int qnmatch __P((struct device *, void *, void *)); void qnattach __P((struct device *, struct device *, void *)); -int qnintr __P((struct qn_softc *sc)); +int qnintr __P((void *)); int qnioctl __P((struct ifnet *, u_long, caddr_t)); void qnstart __P((struct ifnet *)); void qnwatchdog __P((int)); @@ -168,6 +168,9 @@ void qnstop __P((struct qn_softc *)); static u_short qn_put __P((u_short volatile *, struct mbuf *)); static void qn_rint __P((struct qn_softc *, u_short)); static void qn_flush __P((struct qn_softc *)); +static void inline word_copy_from_card __P((u_short volatile *, u_short *, u_short)); +static void inline word_copy_to_card __P((u_short *, u_short volatile *, u_short)); +static void qn_get_packet __P((struct qn_softc *, u_short)); #ifdef QN_DEBUG1 static void qn_dump __P((struct qn_softc *)); #endif @@ -210,7 +213,6 @@ qnattach(parent, self, aux) struct zbus_args *zap; struct qn_softc *sc = (struct qn_softc *)self; struct ifnet *ifp = &sc->sc_arpcom.ac_if; - int i; zap = (struct zbus_args *)aux; @@ -478,8 +480,9 @@ word_copy_from_card(card, b, len) static void inline word_copy_to_card(a, card, len) - u_short *a, len; + u_short *a; u_short volatile *card; + u_short len; { register u_short l = len/2; @@ -499,14 +502,14 @@ qn_put(addr, m) u_short volatile *addr; struct mbuf *m; { - u_char *data, savebyte[2]; + u_short *data, savebyte[2]; int len, wantbyte; u_short totlen; totlen = wantbyte = 0; for (; m != NULL; m = m->m_next) { - data = mtod(m, u_char *); + data = mtod(m, u_short *); len = m->m_len; totlen += len; if (len > 0) { @@ -768,9 +771,10 @@ qn_rint(sc, rstat) * Our interrupt routine */ int -qnintr(sc) - struct qn_softc *sc; +qnintr(arg) + void *arg; { + struct qn_softc *sc = arg; u_short tint, rint, tintmask; char return_tintmask = 0; @@ -893,7 +897,7 @@ qnioctl(ifp, command, data) if (ns_nullhost(*ina)) ina->x_host = - *(union ns_host *)(sc->sc_arpcom.sc_enaddr); + *(union ns_host *)(sc->sc_arpcom.ac_enaddr); else bcopy(ina->x_host.c_host, sc->sc_arpcom.ac_enaddr, diff --git a/sys/arch/amiga/dev/ite.c b/sys/arch/amiga/dev/ite.c index 4293975c9b2..177e93306d3 100644 --- a/sys/arch/amiga/dev/ite.c +++ b/sys/arch/amiga/dev/ite.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ite.c,v 1.5 1996/04/21 22:15:30 deraadt Exp $ */ -/* $NetBSD: ite.c,v 1.38 1996/03/17 05:58:48 mhitch Exp $ */ +/* $OpenBSD: ite.c,v 1.6 1996/05/02 06:44:09 niklas Exp $ */ +/* $NetBSD: ite.c,v 1.39 1996/04/21 21:11:52 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,7 +50,6 @@ #include <sys/param.h> #include <sys/kernel.h> -#include <sys/conf.h> #include <sys/device.h> #include <sys/malloc.h> #include <sys/ioctl.h> @@ -70,7 +69,11 @@ #include <amiga/dev/grfioctl.h> #include <amiga/dev/grfvar.h> +#include <sys/conf.h> +#include <machine/conf.h> + #include "grfcc.h" +#include "ite.h" /* * XXX go ask sys/kern/tty.c:ttselect() @@ -118,6 +121,31 @@ void iteattach __P((struct device *, struct device *, void *)); int itematch __P((struct device *, void *, void *)); static void iteprecheckwrap __P((struct ite_softc *)); static void itecheckwrap __P((struct ite_softc *)); +struct ite_softc *getitesp __P((dev_t)); +void init_bell __P((void)); +void ite_bell __P((void)); +void itecnpollc __P((dev_t, int)); +static void repeat_handler __P((void *)); +inline static void ite_sendstr __P((char *)); +static void alignment_display __P((struct ite_softc *)); +inline static void snap_cury __P((struct ite_softc *)); +inline static void ite_dnchar __P((struct ite_softc *, int)); +inline static void ite_inchar __P((struct ite_softc *, int)); +inline static void ite_clrtoeol __P((struct ite_softc *)); +inline static void ite_clrtobol __P((struct ite_softc *)); +inline static void ite_clrline __P((struct ite_softc *)); +inline static void ite_clrtoeos __P((struct ite_softc *)); +inline static void ite_clrtobos __P((struct ite_softc *)); +inline static void ite_clrscreen __P((struct ite_softc *)); +inline static void ite_dnline __P((struct ite_softc *, int)); +inline static void ite_inline __P((struct ite_softc *, int)); +inline static void ite_lf __P((struct ite_softc *)); +inline static void ite_crlf __P((struct ite_softc *)); +inline static void ite_cr __P((struct ite_softc *)); +inline static void ite_rlf __P((struct ite_softc *)); +inline static int atoi __P((const char *)); +inline static int ite_argnum __P((struct ite_softc *)); +inline static int ite_zargnum __P((struct ite_softc *)); struct cfattach ite_ca = { sizeof(struct ite_softc), itematch, iteattach @@ -373,11 +401,15 @@ iteinit(dev) dev_t dev; { struct ite_softc *ip; + static int kbdmap_loaded = 0; ip = getitesp(dev); if (ip->flags & ITE_INITED) return; - bcopy(&ascii_kbdmap, &kbdmap, sizeof(struct kbdmap)); + if (kbdmap_loaded == 0) { + bcopy(&ascii_kbdmap, &kbdmap, sizeof(struct kbdmap)); + kbdmap_loaded = 1; + } ip->cursorx = 0; ip->cursory = 0; @@ -795,7 +827,7 @@ ite_cnfilter(c, caller) /* handle dead keys */ if (key.mode & KBD_MODE_DEAD) { /* if entered twice, send accent itself */ - if (last_dead == key.mode & KBD_MODE_ACCMASK) + if (last_dead == (key.mode & KBD_MODE_ACCMASK)) last_dead = 0; else { last_dead = key.mode & KBD_MODE_ACCMASK; @@ -951,7 +983,7 @@ ite_filter(c, caller) /* handle dead keys */ if (key.mode & KBD_MODE_DEAD) { /* if entered twice, send accent itself */ - if (last_dead == key.mode & KBD_MODE_ACCMASK) + if (last_dead == (key.mode & KBD_MODE_ACCMASK)) last_dead = 0; else { last_dead = key.mode & KBD_MODE_ACCMASK; diff --git a/sys/arch/amiga/dev/ite_cc.c b/sys/arch/amiga/dev/ite_cc.c index 87388bf730e..ada8711ce77 100644 --- a/sys/arch/amiga/dev/ite_cc.c +++ b/sys/arch/amiga/dev/ite_cc.c @@ -1,4 +1,5 @@ -/* $NetBSD: ite_cc.c,v 1.24 1995/05/07 15:37:08 chopps Exp $ */ +/* $OpenBSD: ite_cc.c,v 1.2 1996/05/02 06:44:10 niklas Exp $ */ +/* $NetBSD: ite_cc.c,v 1.25 1996/04/21 21:11:54 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -123,6 +124,24 @@ int ite_default_height = 512; /* def PAL height */ int ite_default_height = 400; /* def NON-PAL/NTSC height (?) */ #endif +int ite_newsize __P((struct ite_softc *, struct itewinsize *)); +static void putc_nm __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_in __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_ul __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_ul_in __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_bd __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_bd_in __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_bd_ul __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); +static void putc_bd_ul_in __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); + /* * called from grf_cc to return console priority */ @@ -156,7 +175,7 @@ ite_newsize(ip, winsz) extern struct view_softc views[]; struct view_size vs; ipriv_t *cci = ip->priv; - u_long fbp, i; + u_long i; int error; vs.x = winsz->x; @@ -164,7 +183,7 @@ ite_newsize(ip, winsz) vs.width = winsz->width; vs.height = winsz->height; vs.depth = winsz->depth; - error = viewioctl(0, VIOCSSIZE, &vs, 0, -1); + error = viewioctl(0, VIOCSSIZE, (caddr_t)&vs, -1, NULL); /* XXX type of vs ? */ /* * Reinitialize our structs @@ -322,7 +341,7 @@ ite_grf_ioctl (ip, cmd, addr, flag, p) * XXX watchout for that -1 its not really the kernel talking * XXX these two commands don't use the proc pointer though */ - error = viewioctl(0, cmd, addr, flag, -1); + error = viewioctl(0, cmd, addr, -1, p); break; default: error = -1; @@ -344,7 +363,7 @@ static void cursor32(struct ite_softc *ip, int flag) { int cend, ofs, h, cstart, dr_plane; - u_char *pl, opclr, opset; + u_char *pl; ipriv_t *cci; bmap_t *bm; view_t *v; @@ -661,7 +680,8 @@ putc_bd_ul_in (cci,p,f,co,ro,fw,fh) } -typedef void cc_putc_func (); +typedef void cc_putc_func __P((ipriv_t *, u_char *, u_char *, u_int, u_int, + u_int, u_int)); cc_putc_func *put_func[ATTR_ALL+1] = { putc_nm, @@ -708,7 +728,6 @@ static void clear8(struct ite_softc *ip, int sy, int sx, int h, int w) { ipriv_t *cci = (ipriv_t *) ip->priv; - view_t *v = cci->view; bmap_t *bm = cci->view->bitmap; if ((sx == 0) && (w == ip->cols)) @@ -765,8 +784,6 @@ scroll8(ip, sy, sx, count, dir) if (dir == SCROLL_UP) { int dy = sy - count; - int height = ip->bottom_margin - sy + 1; - int i; /*FIX: add scroll bitmap call */ cursor32(ip, ERASE_CURSOR); @@ -779,9 +796,6 @@ scroll8(ip, sy, sx, count, dir) } else if (dir == SCROLL_DOWN) { - int dy = sy + count; - int height = ip->bottom_margin - dy + 1; - int i; /* FIX: add scroll bitmap call */ cursor32(ip, ERASE_CURSOR); diff --git a/sys/arch/amiga/dev/ite_cl.c b/sys/arch/amiga/dev/ite_cl.c index d766df0bdda..bb77741be02 100644 --- a/sys/arch/amiga/dev/ite_cl.c +++ b/sys/arch/amiga/dev/ite_cl.c @@ -1,3 +1,5 @@ +/* $OpenBSD: ite_cl.c,v 1.2 1996/05/02 06:44:11 niklas Exp $ */ +/* $NetBSD: ite_cl.c,v 1.2 1996/04/21 21:11:57 veego Exp $ */ /* * Copyright (c) 1995 Ezra Story diff --git a/sys/arch/amiga/dev/ite_cv.c b/sys/arch/amiga/dev/ite_cv.c index 7ac4157a90f..8157fc796e7 100644 --- a/sys/arch/amiga/dev/ite_cv.c +++ b/sys/arch/amiga/dev/ite_cv.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ite_cv.c,v 1.1 1996/03/30 22:18:21 niklas Exp $ */ -/* $NetBSD: ite_cv.c,v 1.1 1996/03/02 14:28:51 veego Exp $ */ +/* $OpenBSD: ite_cv.c,v 1.2 1996/05/02 06:44:12 niklas Exp $ */ +/* $NetBSD: ite_cv.c,v 1.2 1996/04/21 21:11:59 veego Exp $ */ /* * Copyright (c) 1995 Michael Teske @@ -15,8 +15,9 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by Christian E. Hopps - * and Michael Teske. + * This product includes software developed by Christian E. Hopps, + * Ezra Story, Kari Mettinen, Markus Wild, Lutz Vieweg + * and Michael Teske. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * @@ -31,14 +32,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /* - * This code is based on ite_cc.c from Christian E. Hopps. + * The text console is based on ite_cl.c and ite_rh.c by + * Ezra Story, Kari Mettinen, Markus Wild, Lutz Vieweg. + * The gfx console is based on ite_cc.c from Christian E. Hopps. */ - + #include "grfcv.h" #if NGRFCV > 0 - + #include <sys/param.h> #include <sys/conf.h> #include <sys/proc.h> @@ -57,82 +60,28 @@ #include <amiga/dev/grfioctl.h> #include <amiga/dev/grfvar.h> #include <amiga/dev/grf_cvreg.h> - - -#ifndef KFONT_CUSTOM -#ifdef KFONT_8X11 -#define kernel_font_width kernel_font_width_8x11 -#define kernel_font_height kernel_font_height_8x11 -#define kernel_font_baseline kernel_font_baseline_8x11 -#define kernel_font_boldsmear kernel_font_boldsmear_8x11 -#define kernel_font_lo kernel_font_lo_8x11 -#define kernel_font_hi kernel_font_hi_8x11 -#define kernel_font kernel_font_8x11 -#define kernel_cursor kernel_cursor_8x11 -#else -#define kernel_font_width kernel_font_width_8x8 -#define kernel_font_height kernel_font_height_8x8 -#define kernel_font_baseline kernel_font_baseline_8x8 -#define kernel_font_boldsmear kernel_font_boldsmear_8x8 -#define kernel_font_lo kernel_font_lo_8x8 -#define kernel_font_hi kernel_font_hi_8x8 -#define kernel_font kernel_font_8x8 -#define kernel_cursor kernel_cursor_8x8 -#endif -#endif - -extern u_char kernel_font_width, kernel_font_height, kernel_font_baseline; -extern short kernel_font_boldsmear; -extern u_char kernel_font_lo, kernel_font_hi; -extern u_char kernel_font[], kernel_cursor[]; - - -/* - * This is what ip->priv points to; - * it contains local variables for CV64 ite in gfx mode. - */ -#define MAXCOLS 200 /* Does someone use more than this? */ -#define MAXROWS 200 -struct ite_priv { - u_int rowc[MAXROWS]; /* row coordinates */ - u_int colc[MAXCOLS]; /* column coods */ - u_long row_bytes; - u_long cursor_opt; - u_int row_offset; /* the row offset */ - u_short width; /* the framebuffer width */ - u_short height; - u_short underline; /* where the underline goes */ - u_short ft_x; /* the font width */ - u_short ft_y; /* the font height */ - u_short font_srcx[256]; /* the font source */ - u_short font_srcy[256]; -}; -typedef struct ite_priv ipriv_t; - -void cv_load_font __P((struct ite_softc *)); void cv_ite_init __P((struct ite_softc *)); void cv_ite_deinit __P((struct ite_softc *)); -void cv_inv_rect __P((volatile caddr_t, u_short, u_short, u_short, u_short)); static void cv_cursor __P((struct ite_softc *, int)); -static inline void cv_blt_font __P((volatile caddr_t, int, int, int, - int, int, int, int, int, int, int)); -void cv_uline __P((volatile caddr_t, int, int, int, int)); -void cv_putc_nm __P((struct ite_softc *, int, int, int)); -void cv_putc_ul __P((struct ite_softc *, int, int, int)); -void cv_putc_bd __P((struct ite_softc *, int, int, int)); -void cv_putc_bd_ul __P((struct ite_softc *, int, int, int)); -void cv_putc_in __P((struct ite_softc *, int, int, int)); -void cv_putc_ul_in __P((struct ite_softc *, int, int, int)); -void cv_putc_bd_in __P((struct ite_softc *, int, int, int)); -void cv_putc_bd_ul_in __P((struct ite_softc *, int, int, int)); static void cv_putc __P((struct ite_softc *, int, int, int, int)); -void cv_clr_rect __P((volatile caddr_t, u_short, u_short, u_short, u_short)); static void cv_clear __P((struct ite_softc *, int, int, int, int)); -void cv_bitblt __P((volatile caddr_t, int, int, int, int, int, int)); static void cv_scroll __P((struct ite_softc *, int, int, int, int)); - - + +#define MAXROWS 200 +#define MAXCOLS 200 +static unsigned short cv_rowc[MAXROWS]; + +#ifndef CV_DONT_USE_CONBUFFER + +/* + * Console buffer to avoid the slow reading from gfx mem. + * this takes up 40k but it makes scrolling 3 times faster. + * I'd like to alocate it dynamically. + */ +static unsigned short console_buffer[MAXCOLS*MAXROWS]; +#endif + /* * called from grf_cv to return console priority */ @@ -141,10 +90,10 @@ grfcv_cnprobe() { static int done; int rv; - - if (done == 0) + + if (done == 0) #ifdef CV64CONSOLE - rv = CN_INTERNAL; + rv = CN_INTERNAL; #else rv = CN_DEAD; #endif @@ -157,7 +106,7 @@ grfcv_cnprobe() done = 1; return(rv); } - + /* * called from grf_cv to init ite portion of @@ -174,567 +123,232 @@ grfcv_iteinit(gp) gp->g_iteinit = cv_ite_init; gp->g_itedeinit = cv_ite_deinit; } - -/* - * Load font into display memory (behind visible area!) - * Could be faster, but it's called only on ite init, so who cares? - */ + void -cv_load_font(ip) - register struct ite_softc *ip; +cv_ite_deinit(ip) + struct ite_softc *ip; { - int w, h; - int i,j,k,l; - int ncol; - volatile caddr_t a, font_loc, ba, fb; - ipriv_t *cvi; - - ba = (volatile caddr_t)ip->grf->g_regkva; - fb = (volatile caddr_t)ip->grf->g_fbkva; - - cvi = ip->priv; - w = cvi->width; - h = cvi->height + 30; /* 30 lines space, to be sure:-) */ - - font_loc = (volatile caddr_t)ip->grf->g_fbkva + w*h; - ncol = ip->cols; - - if (ncol == 0) - return; - a = font_loc; - j=0; - for (i = 0 ;i <= ip->font_hi - ip->font_lo; i++) { - - /* Font location in memory */ - a = font_loc+(i%ncol)*ip->ftwidth+(i/ncol)*w*ip->ftheight; - - /* P2C conversion */ - for (k=0; k < ip->ftheight; k++) { - for (l = ip->ftwidth - 1; l >= 0; l--) { - /* XXX depends on fwidth = 8 !!!!! */ - if (ip->font[i*ip->ftheight+k] & (1 << l)) - *a++ = 1; - else - *a++ = 0; - } - a += w - ip->ftwidth; /* next line */ - } - } - - /* set up the font source */ - for (i = 0; i <= ip->font_hi; i++) { - j = i - ip->font_lo; - if (i < ip->font_lo) { - cvi->font_srcx[i] = 0; - cvi->font_srcy[i] = h ; - } else { - cvi->font_srcx[i] = (j%ncol) * ip->ftwidth; - cvi->font_srcy[i] = h + (j/ncol)*ip->ftheight; - } - } - - /* set up column and row coordinates */ - - if (ip->cols > MAXCOLS) - panic ("ite_cv: too many columns"); - if (ip->rows > MAXROWS) - panic ("ite_cv: too many rows"); - - for (i = 0; i <= ip->cols; i++) - cvi->colc[i] = i * ip->ftwidth; - for (i = 0; i <= ip->rows; i++) - cvi->rowc[i] = i * ip->ftheight; + ip->flags &= ~ITE_INITED; } - - + + void cv_ite_init(ip) register struct ite_softc *ip; { - struct grfcvtext_mode *md; - static ipriv_t cv_priv; - volatile caddr_t vgaba, fb; - - ipriv_t *cvi; + struct grfcvtext_mode *md; int i; - - cvi = ip->priv ; - if (cvi == NULL) { /* first time */ - cvi = &cv_priv; - ip->priv = cvi; - } - + + ip->priv = ip->grf->g_data; md = (struct grfcvtext_mode *) ip->grf->g_data; - - ip->font = md->fdata; /*kernel_font;*/ - ip->font_lo = md->fdstart; /*kernel_font_lo;*/ - ip->font_hi = md->fdend; /* kernel_font_hi;*/ - ip->ftwidth = md->fx; /*kernel_font_width;*/ - ip->ftheight = md->fy; /*kernel_font_height;*/ - - ip->ftbaseline = kernel_font_baseline; - ip->ftboldsmear = kernel_font_boldsmear; - - /* Find the correct set of rendering routines for this font. */ - if (ip->ftwidth > 8) - panic("kernel font size not supported"); - - cvi->cursor_opt = 0; - + ip->cols = md->cols; ip->rows = md->rows; - - cvi->width = md->gv.disp_width; - cvi->height = md->gv.disp_height; - cvi->underline = ip->ftbaseline + 1; - cvi->row_offset = md->gv.disp_width; - cvi->ft_x = ip->ftwidth; - cvi->ft_y = ip->ftheight; - cvi->row_bytes = cvi->row_offset * ip->ftheight; - - vgaba = (volatile caddr_t)ip->grf->g_regkva; - - vgaw16(vgaba, ECR_READ_REG_DATA, 0x1000); - delay(200000); - vgaw16(vgaba, ECR_READ_REG_DATA, 0x2000); - GfxBusyWait(vgaba); - vgaw16(vgaba, ECR_READ_REG_DATA, 0x3fff); - GfxBusyWait(vgaba); - delay(200000); - vgaw16(vgaba, ECR_READ_REG_DATA, 0x4fff); - vgaw16(vgaba, ECR_READ_REG_DATA, 0xe000); - vgaw16(vgaba, ECR_CURRENT_Y_POS2, 0x0); - vgaw16(vgaba, ECR_CURRENT_X_POS2, 0x0); - vgaw16(vgaba, ECR_DEST_Y__AX_STEP, 0x0); - vgaw16(vgaba, ECR_DEST_Y2__AX_STEP2, 0x0); - vgaw16(vgaba, ECR_DEST_X__DIA_STEP, 0x0); - vgaw16(vgaba, ECR_DEST_X2__DIA_STEP2, 0x0); - vgaw16(vgaba, ECR_SHORT_STROKE, 0x0); - vgaw16(vgaba, ECR_DRAW_CMD, 0x01); - - /* It ain't easy to write here, so let's do it again */ - vgaw16(vgaba, ECR_READ_REG_DATA, 0x4fff); - - /* Clear with brute force... */ - fb = (volatile caddr_t) ip->grf->g_fbkva; - for (i = 0; i < cvi->width * cvi->height; i++) - *fb++=0; - cv_clr_rect (vgaba, 0, 0, cvi->width, cvi->height); - cv_load_font(ip); -} - - -void -cv_ite_deinit(ip) - struct ite_softc *ip; -{ - ip->flags &= ~ITE_INITED; -} - + if (ip->rows > MAXROWS) + panic ("ite_cv.c: Too many rows!"); -/* Draws inverted rectangle (cursor) */ -void -cv_inv_rect(vgaba, x, y, w, h) - volatile caddr_t vgaba; - u_short x, y, w, h; -{ - GfxBusyWait(vgaba); - vgaw16 (vgaba, ECR_FRGD_MIX, 0x0025); - vgaw32 (vgaba, ECR_FRGD_COLOR, 0x02); - - vgaw16 (vgaba, ECR_READ_REG_DATA, 0xA000); - vgaw16 (vgaba, ECR_CURRENT_Y_POS , y); - vgaw16 (vgaba, ECR_CURRENT_X_POS , x); - vgaw16 (vgaba, ECR_READ_REG_DATA, h - 1); - vgaw16 (vgaba, ECR_MAJ_AXIS_PIX_CNT, w - 1); - vgaw16 (vgaba, ECR_DRAW_CMD, 0x40B1); - + for (i = 0; i < ip->rows; i++) + cv_rowc[i] = i * ip->cols; +#ifndef CV_DONT_USE_CONBUFFER + for (i = 0; i < MAXCOLS*MAXROWS; i++) + console_buffer[i] = 0x2007; +#endif } - -/*** (M<8)-by-N routines ***/ -static void + +void cv_cursor(ip, flag) struct ite_softc *ip; int flag; { - int cend, cstart; - struct grfcvtext_mode *md; - volatile caddr_t ba, fb; - ipriv_t *cvi; - - ba = ip->grf->g_regkva; - fb = ip->grf->g_fbkva; - - md = (struct grfcvtext_mode *) ip->grf->g_data; - - cvi = ip->priv; - - if (flag == END_CURSOROPT) - cvi->cursor_opt--; - else if (flag == START_CURSOROPT) { - if (!cvi->cursor_opt) - cv_cursor (ip, ERASE_CURSOR); - cvi->cursor_opt++; - return; /* if we are already opted. */ - } - - if (cvi->cursor_opt) - return; /* if we are still nested. */ - /* else we draw the cursor. */ - cstart = 0; - cend = ip->ftheight; - - if (flag != DRAW_CURSOR && flag != END_CURSOROPT) { - /* - * erase the cursor by drawing again - */ - cv_inv_rect (ba, ip->cursorx * ip->ftwidth, - ip->cursory * ip->ftheight + cstart, - ip->ftwidth, cend); + volatile caddr_t ba = ip->grf->g_regkva; + + switch (flag) { + case DRAW_CURSOR: + /*WCrt(ba, CRT_ID_CURSOR_START, & ~0x20); */ + case MOVE_CURSOR: + flag = ip->curx + ip->cury * ip->cols; + WCrt(ba, CRT_ID_CURSOR_LOC_LOW, flag & 0xff); + WCrt(ba, CRT_ID_CURSOR_LOC_HIGH, flag >> 8); + ip->cursorx = ip->curx; + ip->cursory = ip->cury; + break; + case ERASE_CURSOR: + /*WCrt(ba, CRT_ID_CURSOR_START, | 0x20); */ + case START_CURSOROPT: + case END_CURSOROPT: + default: + break; } - - if (flag != DRAW_CURSOR && flag != MOVE_CURSOR && - flag != END_CURSOROPT) - return; - - /* - * draw the cursor - */ - - ip->cursorx = min(ip->curx, ip->cols-1); - ip->cursory = ip->cury; - cstart = 0; - cend = ip->ftheight; - - cv_inv_rect (ba, ip->cursorx * ip->ftwidth, - ip->cursory * ip->ftheight + cstart, - ip->ftwidth, cend); - } - - -static inline void -cv_blt_font(vgaba, sx, sy, dx, dy, fw, fh, fg, bg, fmix, bmix) - register volatile caddr_t vgaba; - register int sx, sy, dx, dy, fw, fh; - int fg, bg, fmix, bmix; -{ - - GfxBusyWait(vgaba); - - vgaw16 (vgaba, ECR_READ_REG_DATA, 0xA0C0); - vgaw16 (vgaba, ECR_BKGD_MIX, bmix); - vgaw16 (vgaba, ECR_FRGD_MIX, fmix); - vgaw16 (vgaba, ECR_BKGD_COLOR, bg); - vgaw16 (vgaba, ECR_FRGD_COLOR, fg); - vgaw16 (vgaba, ECR_BITPLANE_READ_MASK, 0x1); - vgaw16 (vgaba, ECR_BITPLANE_WRITE_MASK, 0xfff); - vgaw16 (vgaba, ECR_CURRENT_Y_POS , sy); - vgaw16 (vgaba, ECR_CURRENT_X_POS , sx); - vgaw16 (vgaba, ECR_DEST_Y__AX_STEP, dy); - vgaw16 (vgaba, ECR_DEST_X__DIA_STEP, dx); - vgaw16 (vgaba, ECR_READ_REG_DATA, fh); - vgaw16 (vgaba, ECR_MAJ_AXIS_PIX_CNT, fw); - vgaw16 (vgaba, ECR_DRAW_CMD, 0xc0f1); -} - -/* Draws horizontal line */ -void -cv_uline(vgaba, x, y, x2, fgcol) - volatile caddr_t vgaba; - int x, y, x2, fgcol; -{ - GfxBusyWait(vgaba); - vgaw16 (vgaba, ECR_FRGD_MIX, 0x27); - vgaw16 (vgaba, ECR_FRGD_COLOR, fgcol); - vgaw16 (vgaba, ECR_READ_REG_DATA, 0xA000); - vgaw16 (vgaba, ECR_CURRENT_Y_POS , y); - vgaw16 (vgaba, ECR_CURRENT_X_POS , x); - vgaw16 (vgaba, ECR_DEST_Y__AX_STEP, y); - vgaw16 (vgaba, ECR_DEST_X__DIA_STEP, x2); - GfxBusyWait(vgaba); - vgaw16 (vgaba, ECR_DRAW_CMD, 0x2811); -} - - -void -cv_putc_nm(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx], cvi->rowc[dy], - cvi->ft_x-1, cvi->ft_y-1, 1, 0, 0x27, 0x7); -} - - void -cv_putc_ul(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx], cvi->rowc[dy], - cvi->ft_x-1, cvi->ft_y-1, 1, 0, 0x27, 0x7); - - cv_uline (ip->grf->g_regkva,cvi->colc[dx], cvi->rowc[dy] + - cvi->underline, cvi->colc[dx] + cvi->ft_x-1, 1); -} - - -void -cv_putc_bd(ip, c, dy, dx) +cv_putc(ip, c, dy, dx, mode) struct ite_softc *ip; - int c, dy, dx; + int c; + int dy; + int dx; + int mode; { - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx], cvi->rowc[dy], - cvi->ft_x-1, cvi->ft_y-1, 1, 0, 0x27,0x7); - /* smear bold with OR mix */ - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx]+1, cvi->rowc[dy], - cvi->ft_x-2, cvi->ft_y-1, 1, 0, 0x2b,0x5); -} - + caddr_t fb = ip->grf->g_fbkva; + unsigned char attr; + unsigned char *cp; -void -cv_putc_bd_ul(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_putc_bd(ip, c, dy, dx); - cv_uline (ip->grf->g_regkva,cvi->colc[dx], cvi->rowc[dy] + - cvi->underline, cvi->colc[dx] + cvi->ft_x-1, 1); -} - - -void -cv_putc_in(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx], cvi->rowc[dy], - cvi->ft_x-1, cvi->ft_y-1, 0, 1, 0x27,0x7); -} - + attr = (unsigned char) ((mode & ATTR_INV) ? (0x70) : (0x07)); + if (mode & ATTR_UL) attr = 0x01; + if (mode & ATTR_BOLD) attr |= 0x08; + if (mode & ATTR_BLINK) attr |= 0x80; -void -cv_putc_ul_in(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx], cvi->rowc[dy], - cvi->ft_x-1, cvi->ft_y-1, 0, 1, 0x27,0x7); - - cv_uline (ip->grf->g_regkva,cvi->colc[dx], cvi->rowc[dy] + - cvi->underline, cvi->colc[dx] + cvi->ft_x-1, 0); -} - - -void -cv_putc_bd_in(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx], cvi->rowc[dy], - cvi->ft_x-1, cvi->ft_y-1, 0, 1, 0x27,0x7); - - /* smear bold with AND mix */ - cv_blt_font (ip->grf->g_regkva, cvi->font_srcx[c], - cvi->font_srcy[c], cvi->colc[dx]+1, cvi->rowc[dy], - cvi->ft_x-2, cvi->ft_y-1, 0, 1, 0x27, 0xc); + cp = fb + ((cv_rowc[dy] + dx) << 2); /* *4 */ + *cp++ = (unsigned char) c; + *cp = (unsigned char) attr; +#ifndef CV_DONT_USE_CONBUFFER + cp = (unsigned char *) &console_buffer[cv_rowc[dy]+dx]; + *cp++ = (unsigned char) c; + *cp = (unsigned char) attr; +#endif } - - + + void -cv_putc_bd_ul_in(ip, c, dy, dx) - struct ite_softc *ip; - int c, dy, dx; -{ - ipriv_t *cvi = (ipriv_t *)ip->priv; - - cv_putc_bd_in(ip, c, dy, dx); - - cv_uline(ip->grf->g_regkva,cvi->colc[dx], cvi->rowc[dy] + - cvi->underline, cvi->colc[dx] + cvi->ft_x-1, 0); -} - - -typedef void cv_putc_func (); - -cv_putc_func *cv_put_func[ATTR_ALL+1] = { - cv_putc_nm, - cv_putc_in, - cv_putc_ul, - cv_putc_ul_in, - cv_putc_bd, - cv_putc_bd_in, - cv_putc_bd_ul, - cv_putc_bd_ul_in, -/* no support for blink */ - cv_putc_nm, - cv_putc_in, - cv_putc_ul, - cv_putc_ul_in, - cv_putc_bd, - cv_putc_bd_in, - cv_putc_bd_ul, - cv_putc_bd_ul_in -}; - - -static void -cv_putc(ip, c, dy, dx, mode) +cv_clear(ip, sy, sx, h, w) struct ite_softc *ip; - int c, dy, dx, mode; + int sy; + int sx; + int h; + int w; { + /* cv_clear and cv_scroll both rely on ite passing arguments + * which describe continuous regions. For a VT200 terminal, + * this is safe behavior. + */ + unsigned short *dst; + int len; - c = (u_char)c; - if (c < ip->font_lo || c > ip->font_hi) - c = ip->font_hi; - cv_put_func[mode](ip, c, dy, dx); -} - - -void -cv_clr_rect (vgaba, x, y, w, h) - volatile caddr_t vgaba; - u_short x, y, w, h; -{ + dst = (unsigned short *) (ip->grf->g_fbkva + (((sy * ip->cols) + sx) << 2)); - GfxBusyWait(vgaba); - vgaw16 (vgaba, ECR_FRGD_MIX, 0x0027); - vgaw32 (vgaba, ECR_FRGD_COLOR, 0x00); - vgaw16 (vgaba, ECR_READ_REG_DATA, 0xA000); - vgaw16 (vgaba, ECR_CURRENT_Y_POS , y); - vgaw16 (vgaba, ECR_CURRENT_X_POS , x); - vgaw16 (vgaba, ECR_READ_REG_DATA, h - 1); - vgaw16 (vgaba, ECR_MAJ_AXIS_PIX_CNT, w - 1); - vgaw16 (vgaba, ECR_DRAW_CMD, 0x40B1); -} - + for (len = w*h; len > 0 ; len--) { + *dst = 0x2007; + dst +=2; + } -static void -cv_clear(ip, sy, sx, h, w) - struct ite_softc *ip; - int sy, sx, h, w; -{ - - cv_clr_rect (ip->grf->g_regkva, sx*ip->ftwidth, - sy*ip->ftheight, w*ip->ftwidth, - h*ip->ftheight); +#ifndef CV_DONT_USE_CONBUFFER + dst = &console_buffer[(sy * ip->cols) + sx]; + for (len = w*h; len > 0 ; len--) { + *dst++ = 0x2007; + } +#endif } - void -cv_bitblt(vgaba, sx, sy, dx, dy, fw, fh) - volatile caddr_t vgaba; - int sx, sy, dx, dy, fw, fh; -{ - unsigned short drawdir = 0; - - /* Assume overlap */ - if (sx > dx) - drawdir |=1<<5; /* X positive */ - else { - sx += fw -1; - dx += fw -1; - } - if (sy > dy) - drawdir |=1<<7; /* Y positive */ - else { - sy += fh - 1; - dy += fh - 1; - } - GfxBusyWait (vgaba); - vgaw16 (vgaba, ECR_READ_REG_DATA, 0xA000); - vgaw16 (vgaba, ECR_BKGD_MIX, 0x7); - vgaw16 (vgaba, ECR_FRGD_MIX, 0x67); - vgaw16 (vgaba, ECR_BKGD_COLOR, 0x0); - vgaw16 (vgaba, ECR_FRGD_COLOR, 0x1); - - vgaw16 (vgaba, ECR_BITPLANE_READ_MASK, 0x1); - vgaw16 (vgaba, ECR_BITPLANE_WRITE_MASK, 0xfff); - vgaw16 (vgaba, ECR_CURRENT_Y_POS , sy); - vgaw16 (vgaba, ECR_CURRENT_X_POS , sx); - vgaw16 (vgaba, ECR_DEST_Y__AX_STEP, dy); - vgaw16 (vgaba, ECR_DEST_X__DIA_STEP, dx); - vgaw16 (vgaba, ECR_READ_REG_DATA, fh - 1); - vgaw16 (vgaba, ECR_MAJ_AXIS_PIX_CNT, fw - 1); - vgaw16 (vgaba, ECR_DRAW_CMD, 0xc051 | drawdir); -} - - -/* Note: sx is only relevant for SCROLL_LEFT or SCROLL_RIGHT. */ -static void cv_scroll(ip, sy, sx, count, dir) - register struct ite_softc *ip; - register int sy; - int dir, sx, count; - + struct ite_softc *ip; + int sy; + int sx; + int count; + int dir; { - int dy, dx; - ipriv_t *cvi = (ipriv_t *) ip->priv; - - cv_cursor(ip, ERASE_CURSOR); + unsigned short *src, *dst, *dst2; + int i; + int len; + + src = (unsigned short *)(ip->grf->g_fbkva + ((sy * ip->cols) << 2)); + switch (dir) { - case SCROLL_UP: - dy = sy - count; - - cv_bitblt(ip->grf->g_regkva, - 0,sy*ip->ftheight, - 0, dy*ip->ftheight, - cvi->width, - (ip->bottom_margin-dy+1)*ip->ftheight); - - break; - case SCROLL_DOWN: - dy = sy + count; - - cv_bitblt(ip->grf->g_regkva, - 0,sy*ip->ftheight, - 0, dy*ip->ftheight, - cvi->width, - (ip->bottom_margin-dy+1)*ip->ftheight); + case SCROLL_UP: + dst = src - ((count * ip->cols)<<1); +#ifdef CV_DONT_USE_CONBUFFER + for (i = 0; i < (ip->bottom_margin + 1 - sy) * ip->cols; i++) { + *dst++ = *src++; /* copy only plane 0 and 1 */ + dst++; src++; + } +#else + len = (ip->bottom_margin + 1 - sy) * ip->cols; + src = &console_buffer[sy*ip->cols]; +#if 0 + if (count > sy) { /* boundary checks */ + dst2 = console_buffer; + len -= (count - sy) * ip->cols; + src += (count - sy) * ip->cols; + } else +#endif + dst2 = &console_buffer[(sy-count)*ip->cols]; + bcopy (src, dst2, len << 1); + + for (i = 0; i < len; i++) { + *dst++ = *dst2++; + dst++; + } +#endif break; - case SCROLL_RIGHT: /* one line */ - dx = sx + count; - cv_bitblt(ip->grf->g_regkva, - sx*ip->ftwidth, sy*ip->ftheight, - dx*ip->ftwidth, sy*ip->ftheight, - (ip->cols-dx-1)*ip->ftwidth, - ip->ftheight); + case SCROLL_DOWN: + dst = src + ((count * ip->cols)<<1); +#ifdef CV_DONT_USE_CONBUFFER + len= (ip->bottom_margin + 1 - (sy + count)) * ip->cols; + dst += len << 1; + src += len << 1; + for (i = 0; i < len; i++) { + *dst-- = *src--; + dst--; src--; + } +#else + len = (ip->bottom_margin + 1 - (sy + count)) * ip->cols; + src = &console_buffer[sy*ip->cols]; + dst2 = &console_buffer[(sy+count)*ip->cols]; + bcopy (src, dst2, len << 1); + + for (i = 0; i < len; i++) { + *dst++ = *dst2++; + dst++; + } +#endif break; - case SCROLL_LEFT: - dx = sx - count; - cv_bitblt(ip->grf->g_regkva, - sx*ip->ftwidth, sy*ip->ftheight, - dx*ip->ftwidth, sy*ip->ftheight, - (ip->cols-dx-1)*ip->ftwidth, - ip->ftheight); + case SCROLL_RIGHT: + dst = src + ((sx+count)<<1); +#ifdef CV_DONT_USE_CONBUFFER + src += sx << 1; + len = (ip->cols - (sx + count)); + dst += (len-1) << 1; + src += (len-1) << 1; + + for (i = 0; i < len ; i++) { + *dst-- = *src--; + dst--; src--; + } +#else + src = &console_buffer[sy*ip->cols + sx]; + len = ip->cols - (sx + count); + dst2 = &console_buffer[sy*ip->cols + sx + count]; + bcopy (src, dst2, len << 1); + + for (i = 0; i < len; i++) { + *dst++ = *dst2++; + dst++; + } +#endif break; + case SCROLL_LEFT: + dst = src + ((sx - count)<<1); +#ifdef CV_DONT_USE_CONBUFFER + src += sx << 1; + for (i = 0; i < (ip->cols - sx) ; i++) { + *dst++ = *src++; + dst++; src++; + } +#else + src = &console_buffer[sy*ip->cols + sx]; + len = ip->cols - sx; + dst2 = &console_buffer[sy*ip->cols + sx - count]; + bcopy (src, dst2, len << 1); + + for (i = 0; i < len; i++) { + *dst++ = *dst2++; + dst++; + } +#endif } } - + #endif /* NGRFCV */ diff --git a/sys/arch/amiga/dev/ite_rh.c b/sys/arch/amiga/dev/ite_rh.c index f35ad97bc07..caf4c4c681b 100644 --- a/sys/arch/amiga/dev/ite_rh.c +++ b/sys/arch/amiga/dev/ite_rh.c @@ -1,4 +1,5 @@ -/* $NetBSD: ite_rh.c,v 1.5 1995/04/06 19:19:45 chopps Exp $ */ +/* $OpenBSD: ite_rh.c,v 1.2 1996/05/02 06:44:13 niklas Exp $ */ +/* $NetBSD: ite_rh.c,v 1.7 1996/04/23 22:53:05 veego Exp $ */ /* * Copyright (c) 1994 Markus Wild @@ -48,6 +49,10 @@ #include <amiga/dev/grf_rhreg.h> #include <amiga/dev/itevar.h> +#ifdef RETINA_SPEED_HACK +static void screen_up __P((struct ite_softc *, int, int, int)); +static void screen_down __P((struct ite_softc *, int, int, int)); +#endif /* * grfrh_cnprobe is called when the console is being initialized @@ -69,6 +74,7 @@ grfrh_cnprobe() return(rv); } + void grfrh_iteinit(gp) struct grf_softc *gp; @@ -81,12 +87,12 @@ grfrh_iteinit(gp) gp->g_itecursor = rh_cursor; } + void rh_init(ip) struct ite_softc *ip; { struct MonDef *md; - extern unsigned char RZ3StdPalette[]; #if 0 /* Not in ite_rt.c - DC */ if (ip->grf == 0) @@ -106,7 +112,9 @@ rh_cursor(ip, flag) struct ite_softc *ip; int flag; { +#if 0 volatile u_char *ba = ip->grf->g_regkva; +#endif if (flag == START_CURSOROPT || flag == END_CURSOROPT) return; @@ -134,7 +142,7 @@ rh_cursor(ip, flag) } - +#ifdef RETINA_SPEED_HACK static void screen_up(ip, top, bottom, lines) struct ite_softc *ip; @@ -142,8 +150,6 @@ screen_up(ip, top, bottom, lines) int bottom; int lines; { - volatile u_char * ba = ip->grf->g_regkva; - volatile u_char * fb = ip->grf->g_fbkva; /* do some bounds-checking here.. */ if (top >= bottom) @@ -158,6 +164,7 @@ screen_up(ip, top, bottom, lines) RZ3AlphaErase(ip->grf, 0, bottom - lines + 1, ip->cols, lines); } + static void screen_down (ip, top, bottom, lines) struct ite_softc *ip; @@ -165,8 +172,6 @@ screen_down (ip, top, bottom, lines) int bottom; int lines; { - volatile u_char * ba = ip->grf->g_regkva; - volatile u_char * fb = ip->grf->g_fbkva; /* do some bounds-checking here.. */ if (top >= bottom) @@ -180,6 +185,8 @@ screen_down (ip, top, bottom, lines) RZ3AlphaCopy(ip->grf, 0, top, 0, top+lines, ip->cols, bottom-top-lines+1); RZ3AlphaErase(ip->grf, 0, top, ip->cols, lines); } +#endif /* RETINA_SPEED_HACK */ + void rh_deinit(ip) @@ -197,7 +204,6 @@ rh_putc(ip, c, dy, dx, mode) int dx; int mode; { - volatile u_char * ba = ip->grf->g_regkva; volatile u_char * fb = ip->grf->g_fbkva; register u_char attr; @@ -210,6 +216,7 @@ rh_putc(ip, c, dy, dx, mode) *fb++ = c; *fb = attr; } + void rh_clear(ip, sy, sx, h, w) struct ite_softc *ip; @@ -221,6 +228,7 @@ rh_clear(ip, sy, sx, h, w) RZ3AlphaErase (ip->grf, sx, sy, w, h); } + /* * RETINA_SPEED_HACK code seems to work on some boards and on others * it causes text to smear horizontally @@ -233,9 +241,9 @@ rh_scroll(ip, sy, sx, count, dir) int count; int dir; { - volatile u_char * ba = ip->grf->g_regkva; +#ifndef RETINA_SPEED_HACK u_long * fb = (u_long *) ip->grf->g_fbkva; - register int height, dy, i; +#endif rh_cursor(ip, ERASE_CURSOR); @@ -265,7 +273,7 @@ rh_scroll(ip, sy, sx, count, dir) RZ3AlphaErase(ip->grf, ip->cols - count, sy, count, 1); } #ifndef RETINA_SPEED_HACK - retina_cursor(ip, !ERASE_CURSOR); + rh_cursor(ip, !ERASE_CURSOR); #endif } #endif /* NGRFRH */ diff --git a/sys/arch/amiga/dev/ite_rt.c b/sys/arch/amiga/dev/ite_rt.c index c02ea9d0be1..f4ba9cebb94 100644 --- a/sys/arch/amiga/dev/ite_rt.c +++ b/sys/arch/amiga/dev/ite_rt.c @@ -1,4 +1,5 @@ -/* $NetBSD: ite_rt.c,v 1.14 1995/04/08 05:30:58 chopps Exp $ */ +/* $OpenBSD: ite_rt.c,v 1.2 1996/05/02 06:44:14 niklas Exp $ */ +/* $NetBSD: ite_rt.c,v 1.16 1996/04/23 22:53:12 veego Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -57,6 +58,11 @@ void retina_clear __P((struct ite_softc *,int,int,int,int)); void retina_putc __P((struct ite_softc *,int,int,int,int)); void retina_init __P((struct ite_softc *)); +#ifdef RETINA_SPEED_HACK +static void screen_up __P((struct ite_softc *, int, int, int)); +static void screen_down __P((struct ite_softc *, int, int, int)); +#endif + /* * this function is called from grf_rt to init the grf_softc->g_conpri * field each time a retina is attached. @@ -91,6 +97,7 @@ grfrt_iteinit(gp) gp->g_itecursor = retina_cursor; } + void retina_init(ip) struct ite_softc *ip; @@ -99,15 +106,18 @@ retina_init(ip) ip->priv = ip->grf->g_data; md = (struct MonDef *) ip->priv; - + ip->cols = md->TX; ip->rows = md->TY; } -void retina_cursor(struct ite_softc *ip, int flag) +void +retina_cursor(ip, flag) + struct ite_softc *ip; + int flag; { - volatile u_char *ba = ip->grf->g_regkva; + volatile caddr_t ba = ip->grf->g_regkva; if (flag == ERASE_CURSOR) { @@ -132,10 +142,16 @@ void retina_cursor(struct ite_softc *ip, int flag) -static void screen_up (struct ite_softc *ip, int top, int bottom, int lines) +#ifdef RETINA_SPEED_HACK +static void +screen_up(ip, top, bottom, lines) + struct ite_softc *ip; + int top; + int bottom; + int lines; { - volatile u_char * ba = ip->grf->g_regkva; - volatile u_char * fb = ip->grf->g_fbkva; + volatile caddr_t ba = ip->grf->g_regkva; + volatile caddr_t fb = ip->grf->g_fbkva; const struct MonDef * md = (struct MonDef *) ip->priv; #ifdef BANKEDDEVPAGER int bank; @@ -171,13 +187,15 @@ static void screen_up (struct ite_softc *ip, int top, int bottom, int lines) by the NCR chip, it just replicates what it just read. */ /* write to primary, read from secondary */ - WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0 ); + WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, + (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0 ); /* clear extended chain4 mode */ WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR, RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) & ~0x02); /* set write mode 1, "[...] data in the read latches is written to memory during CPU memory write cycles. [...]" */ - WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 1); + WGfx (ba, GCT_ID_GRAPHICS_MODE, + (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 1); { /* write to line TOP */ @@ -192,7 +210,7 @@ static void screen_up (struct ite_softc *ip, int top, int bottom, int lines) WSeq (ba, SEQ_ID_SEC_HOST_OFF_HI, ((unsigned char)(fromloc >> 8))) ; } { - unsigned char * p = (unsigned char *) fb; + caddr_t p = (caddr_t)fb; /* transfer all characters but LINES lines, unroll by 16 */ short x = (1 + bottom - (top + lines)) * (md->TX / 16) - 1; do { @@ -221,38 +239,38 @@ static void screen_up (struct ite_softc *ip, int top, int bottom, int lines) WSeq (ba, SEQ_ID_PRIM_HOST_OFF_HI, 0); WSeq (ba, SEQ_ID_PRIM_HOST_OFF_LO, 0); /* write mode 0 */ - WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0); + WGfx (ba, GCT_ID_GRAPHICS_MODE, + (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0); /* extended chain4 enable */ - WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR , RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) | 0x02); + WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR, + RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) | 0x02); /* read/write to primary on A0, secondary on B0 */ - WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0x40 ); - - + WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, + (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0x40); + + /* fill the free lines with spaces */ - + { /* feed latches with value */ unsigned short * f = (unsigned short *) fb; - + f += (1 + bottom - lines) * md->TX * 2; *f = 0x2010; - { - volatile unsigned short dummy = *((volatile unsigned short *)f); - } } - + /* clear extended chain4 mode */ WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR, RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) & ~0x02); /* set write mode 1, "[...] data in the read latches is written to memory during CPU memory write cycles. [...]" */ WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 1); - + { unsigned long * p = (unsigned long *) fb; short x = (lines * (md->TX/16)) - 1; const unsigned long dummyval = 0; - + p += (1 + bottom - lines) * (md->TX/4); - + do { *p++ = dummyval; *p++ = dummyval; @@ -260,7 +278,7 @@ static void screen_up (struct ite_softc *ip, int top, int bottom, int lines) *p++ = dummyval; } while (x--); } - + /* write mode 0 */ WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0); /* extended chain4 enable */ @@ -274,10 +292,16 @@ static void screen_up (struct ite_softc *ip, int top, int bottom, int lines) #endif }; -static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) -{ - volatile u_char * ba = ip->grf->g_regkva; - volatile u_char * fb = ip->grf->g_fbkva; + +static void +screen_down(ip, top, bottom, lines) + struct ite_softc *ip; + int top; + int bottom; + int lines; +{ + volatile caddr_t ba = ip->grf->g_regkva; + volatile caddr_t fb = ip->grf->g_fbkva; const struct MonDef * md = (struct MonDef *) ip->priv; #ifdef BANKEDDEVPAGER int bank; @@ -286,7 +310,7 @@ static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) /* do some bounds-checking here.. */ if (top >= bottom) return; - + if (top + lines >= bottom) { retina_clear (ip, top, 0, bottom - top, ip->cols); @@ -302,14 +326,15 @@ static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) /* see screen_up() for explanation of chip-tricks */ /* write to primary, read from secondary */ - WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0 ); + WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, + (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0 ); /* clear extended chain4 mode */ WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR, RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) & ~0x02); - + /* set write mode 1, "[...] data in the read latches is written to memory during CPU memory write cycles. [...]" */ WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 1); - + { /* write to line TOP + LINES */ long toloc = (top + lines) * (md->TX / 16); @@ -322,9 +347,9 @@ static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) WSeq (ba, SEQ_ID_SEC_HOST_OFF_LO, ((unsigned char)fromloc)); WSeq (ba, SEQ_ID_SEC_HOST_OFF_HI, ((unsigned char)(fromloc >> 8))) ; } - + { - unsigned char * p = (unsigned char *) fb; + caddr_t p = (caddr_t)fb; short x = (1 + bottom - (top + lines)) * (md->TX / 16) - 1; p += (1 + bottom - (top + lines)) * md->TX; do { @@ -346,44 +371,43 @@ static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) asm volatile("addqb #1,%0@-" : "=a" (p) : "0" (p)); } while (x--); } - + WSeq (ba, SEQ_ID_PRIM_HOST_OFF_HI, 0); WSeq (ba, SEQ_ID_PRIM_HOST_OFF_LO, 0); WSeq (ba, SEQ_ID_SEC_HOST_OFF_HI, 0); WSeq (ba, SEQ_ID_SEC_HOST_OFF_LO, 0); - + /* write mode 0 */ - WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0); + WGfx (ba, GCT_ID_GRAPHICS_MODE, + (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0); /* extended chain4 enable */ WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR , RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) | 0x02); /* read/write to primary on A0, secondary on B0 */ - WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0x40 ); - + WSeq (ba, SEQ_ID_EXTENDED_MEM_ENA, + (RSeq(ba, SEQ_ID_EXTENDED_MEM_ENA) & 0x1f) | 0x40 ); + /* fill the free lines with spaces */ - + { /* feed latches with value */ unsigned short * f = (unsigned short *) fb; - + f += top * md->TX * 2; *f = 0x2010; - { - volatile unsigned short dummy = *((volatile unsigned short *)f); - } } - + /* clear extended chain4 mode */ WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR, RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) & ~0x02); /* set write mode 1, "[...] data in the read latches is written to memory during CPU memory write cycles. [...]" */ WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 1); - + { unsigned long * p = (unsigned long *) fb; short x = (lines * (md->TX/16)) - 1; const unsigned long dummyval = 0; - + p += top * (md->TX/4); - + do { *p++ = dummyval; *p++ = dummyval; @@ -391,12 +415,12 @@ static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) *p++ = dummyval; } while (x--); } - + /* write mode 0 */ WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0); /* extended chain4 enable */ WSeq (ba, SEQ_ID_EXT_VIDEO_ADDR , RSeq(ba, SEQ_ID_EXT_VIDEO_ADDR) | 0x02); - + #ifdef BANKEDDEVPAGER /* restore former bank */ WSeq (ba, SEQ_ID_PRIM_HOST_OFF_LO, (unsigned char) bank); @@ -404,34 +428,50 @@ static void screen_down (struct ite_softc *ip, int top, int bottom, int lines) WSeq (ba, SEQ_ID_PRIM_HOST_OFF_HI, (unsigned char) bank); #endif }; +#endif /* RETINA_SPEED_HACK */ + -void retina_deinit(struct ite_softc *ip) +void +retina_deinit(ip) + struct ite_softc *ip; { - ip->flags &= ~ITE_INITED; + ip->flags &= ~ITE_INITED; } -void retina_putc(struct ite_softc *ip, int c, int dy, int dx, int mode) +void +retina_putc(ip, c, dy, dx, mode) + struct ite_softc *ip; + int c; + int dy; + int dx; + int mode; { - volatile u_char * ba = ip->grf->g_regkva; - volatile u_char * fb = ip->grf->g_fbkva; + volatile caddr_t fb = ip->grf->g_fbkva; register u_char attr; - + attr = (mode & ATTR_INV) ? 0x21 : 0x10; if (mode & ATTR_UL) attr = 0x01; /* ???????? */ if (mode & ATTR_BOLD) attr |= 0x08; if (mode & ATTR_BLINK) attr |= 0x80; - + fb += 4 * (dy * ip->cols + dx); *fb++ = c; *fb = attr; } -void retina_clear(struct ite_softc *ip, int sy, int sx, int h, int w) + +void +retina_clear(ip, sy, sx, h, w) + struct ite_softc *ip; + int sy; + int sx; + int h; + int w; { - volatile u_char * ba = ip->grf->g_regkva; u_short * fb = (u_short *) ip->grf->g_fbkva; short x; const u_short fillval = 0x2010; + /* could probably be optimized just like the scrolling functions !! */ fb += 2 * (sy * ip->cols + sx); while (h--) @@ -442,20 +482,25 @@ void retina_clear(struct ite_softc *ip, int sy, int sx, int h, int w) } } + /* * RETINA_SPEED_HACK code seems to work on some boards and on others * it causes text to smear horizontally */ void -retina_scroll(struct ite_softc *ip, int sy, int sx, int count, int dir) +retina_scroll(ip, sy, sx, count, dir) + struct ite_softc *ip; + int sy; + int sx; + int count; + int dir; { - register int height, dy, i; - volatile u_char *ba; + volatile caddr_t ba; u_long *fb; ba = ip->grf->g_regkva; fb = (u_long *)ip->grf->g_fbkva; - + retina_cursor(ip, ERASE_CURSOR); if (dir == SCROLL_UP) { diff --git a/sys/arch/amiga/dev/itevar.h b/sys/arch/amiga/dev/itevar.h index 0b9a4434673..6cf75a023a9 100644 --- a/sys/arch/amiga/dev/itevar.h +++ b/sys/arch/amiga/dev/itevar.h @@ -1,4 +1,5 @@ -/* $NetBSD: itevar.h,v 1.11.2.2 1995/10/20 11:01:11 chopps Exp $ */ +/* $OpenBSD: itevar.h,v 1.3 1996/05/02 06:44:14 niklas Exp $ */ +/* $NetBSD: itevar.h,v 1.14 1996/04/21 21:12:03 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -212,5 +213,6 @@ int ite_param __P((struct tty *, struct termios *)); void ite_reset __P((struct ite_softc *)); int ite_cnfilter __P((u_char, enum caller)); void ite_filter __P((u_char ,enum caller)); +int ite_grf_ioctl __P((struct ite_softc *, u_long, caddr_t, int, struct proc *)); #endif /* _ITEVAR_H */ diff --git a/sys/arch/amiga/dev/ivsc.c b/sys/arch/amiga/dev/ivsc.c index 8e816465f9c..24aeff78995 100644 --- a/sys/arch/amiga/dev/ivsc.c +++ b/sys/arch/amiga/dev/ivsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ivsc.c,v 1.2 1996/04/21 22:15:32 deraadt Exp $ */ -/* $NetBSD: ivsc.c,v 1.14 1996/03/28 19:23:34 is Exp $ */ +/* $OpenBSD: ivsc.c,v 1.3 1996/05/02 06:44:15 niklas Exp $ */ +/* $NetBSD: ivsc.c,v 1.15 1996/04/21 21:12:04 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -53,7 +53,7 @@ int ivscprint __P((void *auxp, char *)); void ivscattach __P((struct device *, struct device *, void *)); int ivscmatch __P((struct device *, void *, void *)); -int ivsc_intr __P((struct sci_softc *)); +int ivsc_intr __P((void *)); int ivsc_dma_xfer_in __P((struct sci_softc *dev, int len, register u_char *buf, int phase)); int ivsc_dma_xfer_out __P((struct sci_softc *dev, int len, @@ -73,10 +73,12 @@ struct scsi_device ivsc_scsidev = { NULL, /* Use default done routine */ }; -#define QPRINTF #ifdef DEBUG extern int sci_debug; +#define QPRINTF(a) if (sci_debug > 1) printf a +#else +#define QPRINTF(a) #endif extern int sci_data_wait; @@ -189,10 +191,11 @@ ivsc_dma_xfer_in (dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_idata + 0x20; volatile register u_char *sci_csr = dev->sci_csr; +#ifdef DEBUG + u_char *obp = buf; +#endif QPRINTF(("ivsc_dma_in %d, csr=%02x\n", len, *dev->sci_bus_csr)); @@ -210,7 +213,7 @@ ivsc_dma_xfer_in (dev, len, buf, phase) #ifdef DEBUG if (sci_debug) printf("ivsc_dma_in2 fail: l%d i%x w%d\n", - len, csr, wait); + len, *dev->sci_bus_csr, wait); #endif *dev->sci_mode &= ~SCI_MODE_DMA; return 0; @@ -247,7 +250,7 @@ ivsc_dma_xfer_in (dev, len, buf, phase) #ifdef DEBUG if (sci_debug) printf("ivsc_dma_in1 fail: l%d i%x w%d\n", - len, csr, wait); + len, *dev->sci_bus_csr, wait); #endif *dev->sci_mode &= ~SCI_MODE_DMA; return 0; @@ -274,8 +277,6 @@ ivsc_dma_xfer_out (dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_data + 0x20; volatile register u_char *sci_csr = dev->sci_csr; @@ -299,7 +300,7 @@ ivsc_dma_xfer_out (dev, len, buf, phase) #ifdef DEBUG if (sci_debug) printf("ivsc_dma_out fail: l%d i%x w%d\n", - len, csr, wait); + len, *dev->sci_bus_csr, wait); #endif *dev->sci_mode &= ~SCI_MODE_DMA; return 0; @@ -320,9 +321,10 @@ ivsc_dma_xfer_out (dev, len, buf, phase) } int -ivsc_intr(dev) - struct sci_softc *dev; +ivsc_intr(arg) + void *arg; { + struct sci_softc *dev = arg; u_char stat; if ((*dev->sci_csr & SCI_CSR_INT) == 0) diff --git a/sys/arch/amiga/dev/kbd.c b/sys/arch/amiga/dev/kbd.c index 3d031f9f972..fc6fa59d678 100644 --- a/sys/arch/amiga/dev/kbd.c +++ b/sys/arch/amiga/dev/kbd.c @@ -1,5 +1,5 @@ -/* $OpenBSD: kbd.c,v 1.2 1996/04/21 22:15:33 deraadt Exp $ */ -/* $NetBSD: kbd.c,v 1.17 1996/03/17 05:58:50 mhitch Exp $ */ +/* $OpenBSD: kbd.c,v 1.3 1996/05/02 06:44:16 niklas Exp $ */ +/* $NetBSD: kbd.c,v 1.18 1996/04/21 21:12:05 veego Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -41,10 +41,10 @@ #include <sys/ioctl.h> #include <sys/tty.h> #include <sys/proc.h> -#include <sys/conf.h> #include <sys/file.h> #include <sys/kernel.h> #include <sys/syslog.h> +#include <sys/signalvar.h> #include <dev/cons.h> #include <machine/cpu.h> #include <amiga/amiga/device.h> @@ -52,10 +52,14 @@ #include <amiga/amiga/cia.h> #include <amiga/dev/itevar.h> #include <amiga/dev/kbdreg.h> +#include <amiga/dev/kbdmap.h> #include <amiga/dev/event_var.h> #include <amiga/dev/vuid_event.h> #include "kbd.h" +#include <sys/conf.h> +#include <machine/conf.h> + struct kbd_softc { int k_event_mode; /* if true, collect events, else pass to ite */ struct evvar k_events; /* event queue state */ @@ -64,6 +68,7 @@ struct kbd_softc kbd_softc; int kbdmatch __P((struct device *, void *, void *)); void kbdattach __P((struct device *, struct device *, void *)); +void kbdintr __P((int)); struct cfattach kbd_ca = { sizeof(struct device), kbdmatch, kbdattach @@ -79,7 +84,6 @@ kbdmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cfp = match; if (matchname((char *)auxp, "kbd")) return(1); @@ -100,7 +104,7 @@ kbdattach(pdp, dp, auxp) #define KEY_UP(c) ((c) & 0x80) void -kbdenable () +kbdenable() { int s; @@ -119,184 +123,194 @@ kbdenable () int -kbdopen (dev_t dev, int flags, int mode, struct proc *p) +kbdopen(dev, flags, mode, p) + dev_t dev; + int flags, mode; + struct proc *p; { - int s, error; - if (kbd_softc.k_events.ev_io) - return EBUSY; + if (kbd_softc.k_events.ev_io) + return EBUSY; - kbd_softc.k_events.ev_io = p; - ev_init(&kbd_softc.k_events); - return (0); + kbd_softc.k_events.ev_io = p; + ev_init(&kbd_softc.k_events); + return (0); } int -kbdclose (dev_t dev, int flags, int mode, struct proc *p) +kbdclose(dev, flags, mode, p) + dev_t dev; + int flags, mode; + struct proc *p; { - /* Turn off event mode, dump the queue */ - kbd_softc.k_event_mode = 0; - ev_fini(&kbd_softc.k_events); - kbd_softc.k_events.ev_io = NULL; - return (0); + + /* Turn off event mode, dump the queue */ + kbd_softc.k_event_mode = 0; + ev_fini(&kbd_softc.k_events); + kbd_softc.k_events.ev_io = NULL; + return (0); } int -kbdread (dev_t dev, struct uio *uio, int flags) +kbdread(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { - return ev_read (&kbd_softc.k_events, uio, flags); + return ev_read (&kbd_softc.k_events, uio, flags); } int -kbdioctl(dev_t dev, u_long cmd, register caddr_t data, int flag, struct proc *p) +kbdioctl(dev, cmd, data, flag, p) + dev_t dev; + u_long cmd; + register caddr_t data; + int flag; + struct proc *p; { - register struct kbd_softc *k = &kbd_softc; - - switch (cmd) - { - case KIOCTRANS: - if (*(int *)data == TR_UNTRANS_EVENT) - return 0; - break; - - case KIOCGTRANS: - /* - * Get translation mode - */ - *(int *)data = TR_UNTRANS_EVENT; - return 0; - - case KIOCSDIRECT: - k->k_event_mode = *(int *)data; - return 0; - - case FIONBIO: /* we will remove this someday (soon???) */ - return 0; - - case FIOASYNC: - k->k_events.ev_async = *(int *)data != 0; - return 0; - - case TIOCSPGRP: - if (*(int *)data != k->k_events.ev_io->p_pgid) - return EPERM; - return 0; - - default: - return ENOTTY; - } - - /* - * We identified the ioctl, but we do not handle it. - */ - return EOPNOTSUPP; /* misuse, but what the heck */ + register struct kbd_softc *k = &kbd_softc; + + switch (cmd) { + case KIOCTRANS: + if (*(int *)data == TR_UNTRANS_EVENT) + return 0; + break; + + case KIOCGTRANS: + /* Get translation mode */ + *(int *)data = TR_UNTRANS_EVENT; + return 0; + + case KIOCSDIRECT: + k->k_event_mode = *(int *)data; + return 0; + + case FIONBIO: /* we will remove this someday (soon???) */ + return 0; + + case FIOASYNC: + k->k_events.ev_async = *(int *)data != 0; + return 0; + + case TIOCSPGRP: + if (*(int *)data != k->k_events.ev_io->p_pgid) + return EPERM; + return 0; + + default: + return ENOTTY; + } + + /* We identified the ioctl, but we do not handle it. */ + return EOPNOTSUPP; /* misuse, but what the heck */ } int -kbdselect (dev_t dev, int rw, struct proc *p) +kbdselect(dev, rw, p) + dev_t dev; + int rw; + struct proc *p; { - return ev_select (&kbd_softc.k_events, rw, p); + return ev_select (&kbd_softc.k_events, rw, p); } -int -kbdintr (mask) - int mask; +void +kbdintr(mask) + int mask; { - u_char c; - struct kbd_softc *k = &kbd_softc; - struct firm_event *fe; - int put; + u_char c; + struct kbd_softc *k = &kbd_softc; + struct firm_event *fe; + int put; #ifdef KBDRESET - static int reset_warn; + static int reset_warn; #endif - /* now only invoked from generic CIA interrupt handler if there *is* - a keyboard interrupt pending */ + /* now only invoked from generic CIA interrupt handler if there *is* + * a keyboard interrupt pending + */ - c = ~ciaa.sdr; /* keyboard data is inverted */ - /* ack */ - ciaa.cra |= (1 << 6); /* serial line output */ + c = ~ciaa.sdr; /* keyboard data is inverted */ + /* ack */ + ciaa.cra |= (1 << 6); /* serial line output */ #ifdef KBDRESET - if (reset_warn && c == 0xf0) { + if (reset_warn && c == 0xf0) { #ifdef DEBUG - printf ("kbdintr: !!!! Reset Warning !!!!\n"); + printf ("kbdintr: !!!! Reset Warning !!!!\n"); #endif - bootsync(); - reset_warn = 0; - DELAY(30000000); - } + bootsync(); + reset_warn = 0; + DELAY(30000000); + } #endif - /* wait 200 microseconds (for bloody Cherry keyboards..) */ - DELAY(2000); /* fudge delay a bit for some keyboards */ - ciaa.cra &= ~(1 << 6); + /* wait 200 microseconds (for bloody Cherry keyboards..) */ + DELAY(2000); /* fudge delay a bit for some keyboards */ + ciaa.cra &= ~(1 << 6); - /* process the character */ - - c = (c >> 1) | (c << 7); /* rotate right once */ + /* process the character */ + c = (c >> 1) | (c << 7); /* rotate right once */ - #ifdef KBDRESET - if (c == 0x78) { + if (c == 0x78) { #ifdef DEBUG - printf ("kbdintr: Reset Warning started\n"); + printf ("kbdintr: Reset Warning started\n"); #endif - ++reset_warn; - return; - } + ++reset_warn; + return; + } #endif - /* if not in event mode, deliver straight to ite to process key stroke */ - if (! k->k_event_mode) - { - ite_filter (c, ITEFILT_TTY); - return; - } - - /* Keyboard is generating events. Turn this keystroke into an - event and put it in the queue. If the queue is full, the - keystroke is lost (sorry!). */ - - put = k->k_events.ev_put; - fe = &k->k_events.ev_q[put]; - put = (put + 1) % EV_QSIZE; - if (put == k->k_events.ev_get) - { - log(LOG_WARNING, "keyboard event queue overflow\n"); /* ??? */ - return; - } - fe->id = KEY_CODE(c); - fe->value = KEY_UP(c) ? VKEY_UP : VKEY_DOWN; - fe->time = time; - k->k_events.ev_put = put; - EV_WAKEUP(&k->k_events); + /* if not in event mode, deliver straight to ite to process key stroke */ + if (! k->k_event_mode) { + ite_filter (c, ITEFILT_TTY); + return; + } + + /* Keyboard is generating events. Turn this keystroke into an + * event and put it in the queue. If the queue is full, the + * keystroke is lost (sorry!). + */ + + put = k->k_events.ev_put; + fe = &k->k_events.ev_q[put]; + put = (put + 1) % EV_QSIZE; + if (put == k->k_events.ev_get) { + log(LOG_WARNING, "keyboard event queue overflow\n"); /* ??? */ + return; + } + fe->id = KEY_CODE(c); + fe->value = KEY_UP(c) ? VKEY_UP : VKEY_DOWN; + fe->time = time; + k->k_events.ev_put = put; + EV_WAKEUP(&k->k_events); } int -kbdgetcn () +kbdgetcn() { - int s = spltty (); - u_char ints, mask, c, in; - - for (ints = 0; ! ((mask = ciaa.icr) & CIA_ICR_SP); ints |= mask) ; - - in = ciaa.sdr; - c = ~in; - - /* ack */ - ciaa.cra |= (1 << 6); /* serial line output */ - ciaa.sdr = 0xff; /* ack */ - /* wait 200 microseconds */ - DELAY(2000); /* XXXX only works as long as DELAY doesn't use a timer and waits.. */ - ciaa.cra &= ~(1 << 6); - ciaa.sdr = in; - - splx (s); - c = (c >> 1) | (c << 7); - - /* take care that no CIA-interrupts are lost */ - if (ints) - dispatch_cia_ints (0, ints); - - return c; + int s = spltty (); + u_char ints, mask, c, in; + + for (ints = 0; ! ((mask = ciaa.icr) & CIA_ICR_SP); ints |= mask) ; + + in = ciaa.sdr; + c = ~in; + + /* ack */ + ciaa.cra |= (1 << 6); /* serial line output */ + ciaa.sdr = 0xff; /* ack */ + /* wait 200 microseconds */ + DELAY(2000); /* XXXX only works as long as DELAY doesn't use a timer and waits.. */ + ciaa.cra &= ~(1 << 6); + ciaa.sdr = in; + + splx (s); + c = (c >> 1) | (c << 7); + + /* take care that no CIA-interrupts are lost */ + if (ints) + dispatch_cia_ints (0, ints); + + return c; } diff --git a/sys/arch/amiga/dev/kbdmap.c b/sys/arch/amiga/dev/kbdmap.c index e8a00e85d1f..e9d83f402d6 100644 --- a/sys/arch/amiga/dev/kbdmap.c +++ b/sys/arch/amiga/dev/kbdmap.c @@ -1,4 +1,5 @@ -/* $NetBSD: kbdmap.c,v 1.8 1995/02/16 21:57:46 chopps Exp $ */ +/* $OpenBSD: kbdmap.c,v 1.2 1996/05/02 06:44:17 niklas Exp $ */ +/* $NetBSD: kbdmap.c,v 1.9 1996/04/21 21:12:06 veego Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -48,399 +49,399 @@ struct kbdmap kbdmap; struct kbdmap ascii_kbdmap = { /* normal map */ { - 0, '`', /* 0x00 */ - 0, '1', - 0, '2', - 0, '3', - 0, '4', - 0, '5', - 0, '6', - 0, '7', - 0, '8', /* 0x08 */ - 0, '9', - 0, '0', - 0, '-', - 0, '=', - 0, '\\', - 0, 0, - K, '0', - C, 'q', /* 0x10 */ - C, 'w', - C, 'e', - C, 'r', - C, 't', - C, 'y', - C, 'u', - C, 'i', - C, 'o', /* 0x18 */ - C, 'p', - 0, '[', - 0, ']', - 0, 0, - K, '1', - K, '2', - K, '3', - C, 'a', /* 0x20 */ - C, 's', - C, 'd', - C, 'f', - C, 'g', - C, 'h', - C, 'j', - C, 'k', - C, 'l', /* 0x28 */ - 0, ';', - 0, '\'', - 0, 0, - 0, 0, - K, '4', - K, '5', - K, '6', - 0, 0, /* 0x30 */ - C, 'z', - C, 'x', - C, 'c', - C, 'v', - C, 'b', - C, 'n', - C, 'm', - 0, ',', /* 0x38 */ - 0, '.', - 0, '/', - 0, 0, - K, '.', - K, '7', - K, '8', - K, '9', - 0, ' ', /* 0x40 */ - 0, DEL, /* really BS, DEL & BS swapped */ - 0, '\t', - K, '\r', /* enter */ - 0, '\r', /* return */ - 0, ESC, - 0, '\b', /* really DEL, BS & DEL swapped */ - 0, 0, - 0, 0, /* 0x48 */ - 0, 0, - K, '-', - 0, 0, - S, 0x00, /* now it gets hairy.. CRSR UP */ - S, 0x04, /* CRSR DOWN */ - S, 0x08, /* CRSR RIGHT */ - S, 0x0C, /* CRSR LEFT */ - S, 0x10, /* 0x50 F1 */ - S, 0x15, /* F2 */ - S, 0x1A, /* F3 */ - S, 0x1F, /* F4 */ - S, 0x24, /* F5 */ - S, 0x29, /* F6 */ - S, 0x2E, /* F7 */ - S, 0x33, /* 0x58 F8 */ - S, 0x38, /* F9 */ - S, 0x3D, /* F10 */ - K, '(', - K, ')', - K, '/', - K, '*', - S, 0x42, /* HELP */ + { 0, '`' }, /* 0x00 */ + { 0, '1' }, + { 0, '2' }, + { 0, '3' }, + { 0, '4' }, + { 0, '5' }, + { 0, '6' }, + { 0, '7' }, + { 0, '8' }, /* 0x08 */ + { 0, '9' }, + { 0, '0' }, + { 0, '-' }, + { 0, '=' }, + { 0, '\\' }, + { 0, 0 }, + { K, '0' }, + { C, 'q' }, /* 0x10 */ + { C, 'w' }, + { C, 'e' }, + { C, 'r' }, + { C, 't' }, + { C, 'y' }, + { C, 'u' }, + { C, 'i' }, + { C, 'o' }, /* 0x18 */ + { C, 'p' }, + { 0, '[' }, + { 0, ']' }, + { 0, 0 }, + { K, '1' }, + { K, '2' }, + { K, '3' }, + { C, 'a' }, /* 0x20 */ + { C, 's' }, + { C, 'd' }, + { C, 'f' }, + { C, 'g' }, + { C, 'h' }, + { C, 'j' }, + { C, 'k' }, + { C, 'l' }, /* 0x28 */ + { 0, ';' }, + { 0, '\'' }, + { 0, 0 }, + { 0, 0 }, + { K, '4' }, + { K, '5' }, + { K, '6' }, + { 0, 0 }, /* 0x30 */ + { C, 'z' }, + { C, 'x' }, + { C, 'c' }, + { C, 'v' }, + { C, 'b' }, + { C, 'n' }, + { C, 'm' }, + { 0, ',' }, /* 0x38 */ + { 0, '.' }, + { 0, '/' }, + { 0, 0 }, + { K, '.' }, + { K, '7' }, + { K, '8' }, + { K, '9' }, + { 0, ' ' }, /* 0x40 */ + { 0, DEL }, /* really BS, DEL & BS swapped */ + { 0, '\t' }, + { K, '\r' }, /* enter */ + { 0, '\r' }, /* return */ + { 0, ESC }, + { 0, '\b' }, /* really DEL, BS & DEL swapped */ + { 0, 0 }, + { 0, 0 }, /* 0x48 */ + { 0, 0 }, + { K, '-' }, + { 0, 0 }, + { S, 0x00 }, /* now it gets hairy.. CRSR UP */ + { S, 0x04 }, /* CRSR DOWN */ + { S, 0x08 }, /* CRSR RIGHT */ + { S, 0x0C }, /* CRSR LEFT */ + { S, 0x10 }, /* 0x50 F1 */ + { S, 0x15 }, /* F2 */ + { S, 0x1A }, /* F3 */ + { S, 0x1F }, /* F4 */ + { S, 0x24 }, /* F5 */ + { S, 0x29 }, /* F6 */ + { S, 0x2E }, /* F7 */ + { S, 0x33 }, /* 0x58 F8 */ + { S, 0x38 }, /* F9 */ + { S, 0x3D }, /* F10 */ + { K, '(' }, + { K, ')' }, + { K, '/' }, + { K, '*' }, + { S, 0x42 } /* HELP */ }, /* shifted map */ { - 0, '~', /* 0x00 */ - 0, '!', - 0, '@', - 0, '#', - 0, '$', - 0, '%', - 0, '^', - 0, '&', - 0, '*', /* 0x08 */ - 0, '(', - 0, ')', - 0, '_', - 0, '+', - 0, '|', - 0, 0, - K, '0', - C, 'Q', /* 0x10 */ - C, 'W', - C, 'E', - C, 'R', - C, 'T', - C, 'Y', - C, 'U', - C, 'I', - C, 'O', /* 0x18 */ - C, 'P', - 0, '{', - 0, '}', - 0, 0, - K, '1', - K, '2', - K, '3', - C, 'A', /* 0x20 */ - C, 'S', - C, 'D', - C, 'F', - C, 'G', - C, 'H', - C, 'J', - C, 'K', - C, 'L', /* 0x28 */ - 0, ':', - 0, '\"', - 0, 0, - 0, 0, - K, '4', - K, '5', - K, '6', - 0, 0, /* 0x30 */ - C, 'Z', - C, 'X', - C, 'C', - C, 'V', - C, 'B', - C, 'N', - C, 'M', - 0, '<', /* 0x38 */ - 0, '>', - 0, '?', - 0, 0, - K, '.', - K, '7', - K, '8', - K, '9', - 0, ' ', /* 0x40 */ - 0, DEL, /* really BS, DEL & BS swapped */ - S, 0x99, /* shift TAB */ - K, '\r', /* enter */ - 0, '\r', /* return */ - 0, ESC, - 0, '\b', /* really DEL, BS & DEL swapped */ - 0, 0, - 0, 0, /* 0x48 */ - 0, 0, - K, '-', - 0, 0, - S, 0x47, /* shift CRSR UP */ - S, 0x4C, /* shift CRSR DOWN */ - S, 0x51, /* shift CRSR RIGHT */ - S, 0x57, /* shift CRSR LEFT */ - S, 0x5D, /* 0x50 shift F1 */ - S, 0x63, /* shift F2 */ - S, 0x69, /* shift F3 */ - S, 0x6F, /* shift F4 */ - S, 0x75, /* shift F5 */ - S, 0x7B, /* shift F6 */ - S, 0x81, /* shift F7 */ - S, 0x87, /* 0x58 shift F8 */ - S, 0x8D, /* shift F9 */ - S, 0x93, /* shift F10 */ - K, '(', - K, ')', - K, '/', - K, '*', - S, 0x42, /* HELP (no special shift code) */ + { 0, '~' }, /* 0x00 */ + { 0, '!' }, + { 0, '@' }, + { 0, '#' }, + { 0, '$' }, + { 0, '%' }, + { 0, '^' }, + { 0, '&' }, + { 0, '*' }, /* 0x08 */ + { 0, '(' }, + { 0, ')' }, + { 0, '_' }, + { 0, '+' }, + { 0, '|' }, + { 0, 0 }, + { K, '0' }, + { C, 'Q' }, /* 0x10 */ + { C, 'W' }, + { C, 'E' }, + { C, 'R' }, + { C, 'T' }, + { C, 'Y' }, + { C, 'U' }, + { C, 'I' }, + { C, 'O' }, /* 0x18 */ + { C, 'P' }, + { 0, '{' }, + { 0, '}' }, + { 0, 0 }, + { K, '1' }, + { K, '2' }, + { K, '3' }, + { C, 'A' }, /* 0x20 */ + { C, 'S' }, + { C, 'D' }, + { C, 'F' }, + { C, 'G' }, + { C, 'H' }, + { C, 'J' }, + { C, 'K' }, + { C, 'L' }, /* 0x28 */ + { 0, ':' }, + { 0, '\"' }, + { 0, 0 }, + { 0, 0 }, + { K, '4' }, + { K, '5' }, + { K, '6' }, + { 0, 0 }, /* 0x30 */ + { C, 'Z' }, + { C, 'X' }, + { C, 'C' }, + { C, 'V' }, + { C, 'B' }, + { C, 'N' }, + { C, 'M' }, + { 0, '<' }, /* 0x38 */ + { 0, '>' }, + { 0, '?' }, + { 0, 0 }, + { K, '.' }, + { K, '7' }, + { K, '8' }, + { K, '9' }, + { 0, ' ' }, /* 0x40 */ + { 0, DEL }, /* really BS, DEL & BS swapped */ + { S, 0x99 }, /* shift TAB */ + { K, '\r' }, /* enter */ + { 0, '\r' }, /* return */ + { 0, ESC }, + { 0, '\b' }, /* really DEL, BS & DEL swapped */ + { 0, 0 }, + { 0, 0 }, /* 0x48 */ + { 0, 0 }, + { K, '-' }, + { 0, 0 }, + { S, 0x47 }, /* shift CRSR UP */ + { S, 0x4C }, /* shift CRSR DOWN */ + { S, 0x51 }, /* shift CRSR RIGHT */ + { S, 0x57 }, /* shift CRSR LEFT */ + { S, 0x5D }, /* 0x50 shift F1 */ + { S, 0x63 }, /* shift F2 */ + { S, 0x69 }, /* shift F3 */ + { S, 0x6F }, /* shift F4 */ + { S, 0x75 }, /* shift F5 */ + { S, 0x7B }, /* shift F6 */ + { S, 0x81 }, /* shift F7 */ + { S, 0x87 }, /* 0x58 shift F8 */ + { S, 0x8D }, /* shift F9 */ + { S, 0x93 }, /* shift F10 */ + { K, '(' }, + { K, ')' }, + { K, '/' }, + { K, '*' }, + { S, 0x42 } /* HELP (no special shift code) */ }, /* alt map */ { - 0, '`', /* 0x00 */ - 0, '¹', - 0, '²', - 0, '³', - 0, '¢', - 0, '¼', - 0, '½', - 0, '¾', - 0, '·', /* 0x08 */ - 0, '«', - 0, '»', - 0, '-', - 0, '=', - 0, '\\', - 0, 0, - K, '0', - C, 'å', /* 0x10 */ - 0, '°', - 0, '©', - 0, '®', - C, 'þ', - 0, '¤', - 0, 'µ', - 0, '¡', - C, 'ø', /* 0x18 */ - 0, '¶', - 0, '[', - 0, ']', - 0, 0, - K, '1', - K, '2', - K, '3', - C, 'æ', /* 0x20 */ - 0, 'ß', - C, 'ð', - DA, '´', - DG, '`', - DC, '^', - DT, '~', - DD, '¨', - 0, '£', /* 0x28 */ - 0, ';', - 0, '\'', - 0, 0, - 0, 0, - K, '4', - K, '5', - K, '6', - 0, 0, /* 0x30 */ - 0, '±', - 0, '×', - C, 'ç', - 0, 'ª', - 0, 'º', - 0, '', - 0, '¸', - 0, ',', /* 0x38 */ - 0, '.', - 0, '/', - 0, 0, - K, '.', - K, '7', - K, '8', - K, '9', - 0, ' ', /* 0x40 */ - 0, DEL, /* really BS, DEL & BS swapped */ - 0, '\t', - K, '\r', /* enter */ - 0, '\r', /* return */ - S, 0x9d, /* CSI */ - 0, '\b', /* really DEL, BS & DEL swapped */ - 0, 0, - 0, 0, /* 0x48 */ - 0, 0, - K, '-', - 0, 0, - S, 0x00, /* now it gets hairy.. CRSR UP */ - S, 0x04, /* CRSR DOWN */ - S, 0x08, /* CRSR RIGHT */ - S, 0x0C, /* CRSR LEFT */ - S, 0x10, /* 0x50 F1 */ - S, 0x15, /* F2 */ - S, 0x1A, /* F3 */ - S, 0x1F, /* F4 */ - S, 0x24, /* F5 */ - S, 0x29, /* F6 */ - S, 0x2E, /* F7 */ - S, 0x33, /* 0x58 F8 */ - S, 0x38, /* F9 */ - S, 0x3D, /* F10 */ - K, '(', - K, ')', - K, '/', - K, '*', - S, 0x42, /* HELP */ + { 0, '`' }, /* 0x00 */ + { 0, '¹' }, + { 0, '²' }, + { 0, '³' }, + { 0, '¢' }, + { 0, '¼' }, + { 0, '½' }, + { 0, '¾' }, + { 0, '·' }, /* 0x08 */ + { 0, '«' }, + { 0, '»' }, + { 0, '-' }, + { 0, '=' }, + { 0, '\\' }, + { 0, 0 }, + { K, '0' }, + { C, 'å' }, /* 0x10 */ + { 0, '°' }, + { 0, '©' }, + { 0, '®' }, + { C, 'þ' }, + { 0, '¤' }, + { 0, 'µ' }, + { 0, '¡' }, + { C, 'ø' }, /* 0x18 */ + { 0, '¶' }, + { 0, '[' }, + { 0, ']' }, + { 0, 0 }, + { K, '1' }, + { K, '2' }, + { K, '3' }, + { C, 'æ' }, /* 0x20 */ + { 0, 'ß' }, + { C, 'ð' }, + { DA, '´' }, + { DG, '`' }, + { DC, '^' }, + { DT, '~' }, + { DD, '¨' }, + { 0, '£' }, /* 0x28 */ + { 0, ';' }, + { 0, '\'' }, + { 0, 0 }, + { 0, 0 }, + { K, '4' }, + { K, '5' }, + { K, '6' }, + { 0, 0 }, /* 0x30 */ + { 0, '±' }, + { 0, '×' }, + { C, 'ç' }, + { 0, 'ª' }, + { 0, 'º' }, + { 0, '' }, + { 0, '¸' }, + { 0, ',' }, /* 0x38 */ + { 0, '.' }, + { 0, '/' }, + { 0, 0 }, + { K, '.' }, + { K, '7' }, + { K, '8' }, + { K, '9' }, + { 0, ' ' }, /* 0x40 */ + { 0, DEL }, /* really BS, DEL & BS swapped */ + { 0, '\t' }, + { K, '\r' }, /* enter */ + { 0, '\r' }, /* return */ + { S, 0x9d }, /* CSI */ + { 0, '\b' }, /* really DEL, BS & DEL swapped */ + { 0, 0 }, + { 0, 0 }, /* 0x48 */ + { 0, 0 }, + { K, '-' }, + { 0, 0 }, + { S, 0x00 }, /* now it gets hairy.. CRSR UP */ + { S, 0x04 }, /* CRSR DOWN */ + { S, 0x08 }, /* CRSR RIGHT */ + { S, 0x0C }, /* CRSR LEFT */ + { S, 0x10 }, /* 0x50 F1 */ + { S, 0x15 }, /* F2 */ + { S, 0x1A }, /* F3 */ + { S, 0x1F }, /* F4 */ + { S, 0x24 }, /* F5 */ + { S, 0x29 }, /* F6 */ + { S, 0x2E }, /* F7 */ + { S, 0x33 }, /* 0x58 F8 */ + { S, 0x38 }, /* F9 */ + { S, 0x3D }, /* F10 */ + { K, '(' }, + { K, ')' }, + { K, '/' }, + { K, '*' }, + { S, 0x42 } /* HELP */ }, /* shift alt map */ { - 0, '~', /* 0x00 */ - 0, '!', - 0, '@', - 0, '#', - 0, '$', - 0, '%', - 0, '^', - 0, '&', - 0, '*', /* 0x08 */ - 0, '(', - 0, ')', - 0, '_', - 0, '+', - 0, '|', - 0, 0, - K, '0', - C, 'Å', /* 0x10 */ - 0, '°', - 0, '©', - 0, '®', - C, 'Þ', - 0, '¥', - 0, 'µ', - 0, '¦', - C, 'Ø', /* 0x18 */ - 0, '¶', - 0, '[', - 0, ']', - 0, 0, - K, '1', - K, '2', - K, '3', - C, 'Æ', /* 0x20 */ - 0, '§', - C, 'Ð', - DA, '´', - DG, '`', - DC, '^', - DT, '~', - DD, '¨', - 0, '£', /* 0x28 */ - 0, ';', - 0, '\'', - 0, 0, - 0, 0, - K, '4', - K, '5', - K, '6', - 0, 0, /* 0x30 */ - 0, '±', - 0, '×', - C, 'ç', - 0, 'ª', - 0, 'º', - 0, '', - 0, '¸', - 0, ',', /* 0x38 */ - 0, '.', - 0, '/', - 0, 0, - K, '.', - K, '7', - K, '8', - K, '9', - 0, ' ', /* 0x40 */ - 0, DEL, /* really BS, DEL & BS swapped */ - 0, '\t', - K, '\r', /* enter */ - 0, '\r', /* return */ - S, 0x9d, /* CSI */ - 0, '\b', /* really DEL, BS & DEL swapped */ - 0, 0, - 0, 0, /* 0x48 */ - 0, 0, - K, '-', - 0, 0, - S, 0x00, /* now it gets hairy.. CRSR UP */ - S, 0x04, /* CRSR DOWN */ - S, 0x08, /* CRSR RIGHT */ - S, 0x0C, /* CRSR LEFT */ - S, 0x10, /* 0x50 F1 */ - S, 0x15, /* F2 */ - S, 0x1A, /* F3 */ - S, 0x1F, /* F4 */ - S, 0x24, /* F5 */ - S, 0x29, /* F6 */ - S, 0x2E, /* F7 */ - S, 0x33, /* 0x58 F8 */ - S, 0x38, /* F9 */ - S, 0x3D, /* F10 */ - K, '(', - K, ')', - K, '/', - K, '*', - S, 0x42, /* HELP */ + { 0, '~' }, /* 0x00 */ + { 0, '!' }, + { 0, '@' }, + { 0, '#' }, + { 0, '$' }, + { 0, '%' }, + { 0, '^' }, + { 0, '&' }, + { 0, '*' }, /* 0x08 */ + { 0, '(' }, + { 0, ')' }, + { 0, '_' }, + { 0, '+' }, + { 0, '|' }, + { 0, 0 }, + { K, '0' }, + { C, 'Å' }, /* 0x10 */ + { 0, '°' }, + { 0, '©' }, + { 0, '®' }, + { C, 'Þ' }, + { 0, '¥' }, + { 0, 'µ' }, + { 0, '¦' }, + { C, 'Ø' }, /* 0x18 */ + { 0, '¶' }, + { 0, '[' }, + { 0, ']' }, + { 0, 0 }, + { K, '1' }, + { K, '2' }, + { K, '3' }, + { C, 'Æ' }, /* 0x20 */ + { 0, '§' }, + { C, 'Ð' }, + { DA, '´' }, + { DG, '`' }, + { DC, '^' }, + { DT, '~' }, + { DD, '¨' }, + { 0, '£' }, /* 0x28 */ + { 0, ';' }, + { 0, '\'' }, + { 0, 0 }, + { 0, 0 }, + { K, '4' }, + { K, '5' }, + { K, '6' }, + { 0, 0 }, /* 0x30 */ + { 0, '±' }, + { 0, '×' }, + { C, 'ç' }, + { 0, 'ª' }, + { 0, 'º' }, + { 0, '' }, + { 0, '¸' }, + { 0, ',' }, /* 0x38 */ + { 0, '.' }, + { 0, '/' }, + { 0, 0 }, + { K, '.' }, + { K, '7' }, + { K, '8' }, + { K, '9' }, + { 0, ' ' }, /* 0x40 */ + { 0, DEL }, /* really BS, DEL & BS swapped */ + { 0, '\t' }, + { K, '\r' }, /* enter */ + { 0, '\r' }, /* return */ + { S, 0x9d }, /* CSI */ + { 0, '\b' }, /* really DEL, BS & DEL swapped */ + { 0, 0 }, + { 0, 0 }, /* 0x48 */ + { 0, 0 }, + { K, '-' }, + { 0, 0 }, + { S, 0x00 }, /* now it gets hairy.. CRSR UP */ + { S, 0x04 }, /* CRSR DOWN */ + { S, 0x08 }, /* CRSR RIGHT */ + { S, 0x0C }, /* CRSR LEFT */ + { S, 0x10 }, /* 0x50 F1 */ + { S, 0x15 }, /* F2 */ + { S, 0x1A }, /* F3 */ + { S, 0x1F }, /* F4 */ + { S, 0x24 }, /* F5 */ + { S, 0x29 }, /* F6 */ + { S, 0x2E }, /* F7 */ + { S, 0x33 }, /* 0x58 F8 */ + { S, 0x38 }, /* F9 */ + { S, 0x3D }, /* F10 */ + { K, '(' }, + { K, ')' }, + { K, '/' }, + { K, '*' }, + { S, 0x42 } /* HELP */ }, { diff --git a/sys/arch/amiga/dev/kbdmap.h b/sys/arch/amiga/dev/kbdmap.h index 8ea5a650320..6da31dca97a 100644 --- a/sys/arch/amiga/dev/kbdmap.h +++ b/sys/arch/amiga/dev/kbdmap.h @@ -1,4 +1,5 @@ -/* $NetBSD: kbdmap.h,v 1.9 1995/05/07 15:37:13 chopps Exp $ */ +/* $OpenBSD: kbdmap.h,v 1.2 1996/05/02 06:44:18 niklas Exp $ */ +/* $NetBSD: kbdmap.h,v 1.10 1996/04/21 21:12:08 veego Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -135,4 +136,7 @@ struct kbdmap { /* XXX: ITE interface */ extern struct kbdmap kbdmap, ascii_kbdmap; extern unsigned char acctable[KBD_NUM_ACC][64]; +#include <sys/cdefs.h> +void kbdenable __P((void)); +int kbdgetcn __P((void)); #endif diff --git a/sys/arch/amiga/dev/mfc.c b/sys/arch/amiga/dev/mfc.c index d519a9f0c1c..7d62df1c863 100644 --- a/sys/arch/amiga/dev/mfc.c +++ b/sys/arch/amiga/dev/mfc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: mfc.c,v 1.5 1996/04/21 22:15:34 deraadt Exp $ */ -/* $NetBSD: mfc.c,v 1.11 1996/03/17 05:58:52 mhitch Exp $ */ +/* $OpenBSD: mfc.c,v 1.6 1996/05/02 06:44:19 niklas Exp $ */ +/* $NetBSD: mfc.c,v 1.12 1996/04/21 21:12:09 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -41,7 +41,6 @@ #include <sys/device.h> #include <sys/tty.h> #include <sys/proc.h> -#include <sys/conf.h> #include <sys/file.h> #include <sys/malloc.h> #include <sys/uio.h> @@ -59,6 +58,9 @@ #include <dev/cons.h> +#include <sys/conf.h> +#include <machine/conf.h> + #include "mfcs.h" #ifndef SEROBUF_SIZE @@ -179,19 +181,27 @@ struct mfc_args { char unit; }; -int mfcprint __P((void *auxp, char *)); -void mfcattach __P((struct device *, struct device *, void *)); -int mfcmatch __P((struct device *, void *, void *)); +int mfcprint __P((void *auxp, char *)); +void mfcattach __P((struct device *, struct device *, void *)); +int mfcmatch __P((struct device *, void *, void *)); + #if NMFCS > 0 -void mfcsattach __P((struct device *, struct device *, void *)); -int mfcsmatch __P((struct device *, void *, void *)); +int mfcsmatch __P((struct device *, void *, void *)); +void mfcsattach __P((struct device *, struct device *, void *)); +int mfcsparam __P(( struct tty *, struct termios *)); +int mfcshwiflow __P((struct tty *, int)); +void mfcsstart __P((struct tty *)); +int mfcsmctl __P((dev_t, int, int)); +void mfcsxintr __P((int)); +void mfcseint __P((int, int)); +void mfcsmint __P((register int)); #endif + #if NMFCP > 0 void mfcpattach __P((struct device *, struct device *, void *)); int mfcpmatch __P((struct device *, void *, void *)); #endif -int mfcintr __P((struct mfc_softc *)); -void mfcsmint __P((register int unit)); +int mfcintr __P((void *)); struct cfattach mfc_ca = { sizeof(struct mfc_softc), mfcmatch, mfcattach @@ -221,7 +231,7 @@ struct cfdriver mfcp_cd = { }; #endif -int mfcsstart(), mfcsparam(), mfcshwiflow(); + int mfcs_active; int mfcsdefaultrate = 38400 /*TTYDEF_SPEED*/; #define SWFLAGS(dev) (sc->swflags | (((dev) & 0x80) == 0 ? TIOCFLAG_SOFTCAR : 0)) @@ -234,17 +244,17 @@ int mfcsdefaultrate = 38400 /*TTYDEF_SPEED*/; */ struct speedtab mfcs3speedtab1[] = { - 0, 0, - 100, 0x00, - 220, 0x11, - 600, 0x44, - 1200, 0x55, - 2400, 0x66, - 4800, 0x88, - 9600, 0x99, - 19200, 0xbb, - 115200, 0xcc, - -1, -1 + { 0, 0 }, + { 100, 0x00 }, + { 220, 0x11 }, + { 600, 0x44 }, + { 1200, 0x55 }, + { 2400, 0x66 }, + { 4800, 0x88 }, + { 9600, 0x99 }, + { 19200, 0xbb }, + { 115200, 0xcc }, + { -1, -1 } }; /* @@ -253,17 +263,17 @@ struct speedtab mfcs3speedtab1[] = { */ struct speedtab mfcs2speedtab1[] = { - 0, 0, - 50, 0x00, - 110, 0x11, - 300, 0x44, - 600, 0x55, - 1200, 0x66, - 2400, 0x88, - 4800, 0x99, - 9600, 0xbb, - 38400, 0xcc, - -1, -1 + { 0, 0 }, + { 50, 0x00 }, + { 110, 0x11 }, + { 300, 0x44 }, + { 600, 0x55 }, + { 1200, 0x66 }, + { 2400, 0x88 }, + { 4800, 0x99 }, + { 9600, 0xbb }, + { 38400, 0xcc }, + { -1, -1 } }; #endif @@ -274,18 +284,18 @@ struct speedtab mfcs2speedtab1[] = { */ struct speedtab mfcs3speedtab2[] = { - 0, 0, - 150, 0x00, - 200, 0x11, - 300, 0x33, - 600, 0x44, - 1200, 0x55, - 2400, 0x66, - 4800, 0x88, - 9600, 0x99, - 19200, 0xbb, - 38400, 0xcc, - -1, -1 + { 0, 0 }, + { 150, 0x00 }, + { 200, 0x11 }, + { 300, 0x33 }, + { 600, 0x44 }, + { 1200, 0x55 }, + { 2400, 0x66 }, + { 4800, 0x88 }, + { 9600, 0x99 }, + { 19200, 0xbb }, + { 38400, 0xcc }, + { -1, -1 } }; /* @@ -294,18 +304,18 @@ struct speedtab mfcs3speedtab2[] = { */ struct speedtab mfcs2speedtab2[] = { - 0, 0, - 75, 0x00, - 100, 0x11, - 150, 0x33, - 300, 0x44, - 600, 0x55, - 1200, 0x66, - 2400, 0x88, - 4800, 0x99, - 9600, 0xbb, - 19200, 0xcc, - -1, -1 + { 0, 0 }, + { 75, 0x00 }, + { 100, 0x11 }, + { 150, 0x33 }, + { 300, 0x44 }, + { 600, 0x55 }, + { 1200, 0x66 }, + { 2400, 0x88 }, + { 4800, 0x99 }, + { 9600, 0xbb }, + { 19200, 0xcc }, + { -1, -1 } }; /* @@ -316,7 +326,6 @@ mfcmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -401,7 +410,6 @@ mfcsmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct mfc_args *ma; ma = auxp; @@ -642,11 +650,12 @@ mfcstty(dev) int mfcsioctl(dev, cmd, data, flag, p) dev_t dev; + u_long cmd; caddr_t data; + int flag; struct proc *p; { register struct tty *tp; - register int unit = dev & 31; register int error; struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; @@ -719,7 +728,7 @@ mfcsparam(tp, t) struct tty *tp; struct termios *t; { - int cfcr, cflag, unit, ospeed; + int cflag, unit, ospeed; struct mfcs_softc *sc = mfcs_cd.cd_devs[tp->t_dev & 31]; struct mfc_softc *scc= sc->sc_mfc; @@ -784,7 +793,8 @@ mfcsparam(tp, t) return(0); } -int mfcshwiflow(tp, flag) +int +mfcshwiflow(tp, flag) struct tty *tp; int flag; { @@ -798,7 +808,7 @@ int mfcshwiflow(tp, flag) return 1; } -int +void mfcsstart(tp) struct tty *tp; { @@ -866,6 +876,7 @@ out: int mfcsstop(tp, flag) struct tty *tp; + int flag; { int s; @@ -875,6 +886,7 @@ mfcsstop(tp, flag) tp->t_state |= TS_FLUSH; } splx(s); + return 0; } int @@ -883,7 +895,7 @@ mfcsmctl(dev, bits, how) int bits, how; { int unit, s; - u_char ub; + u_char ub = 0; struct mfcs_softc *sc = mfcs_cd.cd_devs[dev & 31]; unit = dev & 1; @@ -893,7 +905,6 @@ mfcsmctl(dev, bits, how) * which is active low */ if (how != DMGET) { - ub = 0; /* * need to save current state of DTR & RTS ? */ @@ -945,9 +956,10 @@ mfcsmctl(dev, bits, how) */ int -mfcintr (scc) - struct mfc_softc *scc; +mfcintr(arg) + void *arg; { + struct mfc_softc *scc = arg; struct mfcs_softc *sc; struct mfc_regs *regs; struct tty *tp; @@ -1050,7 +1062,7 @@ mfcintr (scc) return(1); } -int +void mfcsxintr(unit) int unit; { @@ -1095,7 +1107,7 @@ mfcsxintr(unit) splx(s1); } -int +void mfcseint(unit, stat) int unit, stat; { diff --git a/sys/arch/amiga/dev/mgnsc.c b/sys/arch/amiga/dev/mgnsc.c index 6342d2f0fef..0d854c194f7 100644 --- a/sys/arch/amiga/dev/mgnsc.c +++ b/sys/arch/amiga/dev/mgnsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: mgnsc.c,v 1.5 1996/04/21 22:15:36 deraadt Exp $ */ -/* $NetBSD: mgnsc.c,v 1.17 1996/03/17 01:17:45 thorpej Exp $ */ +/* $OpenBSD: mgnsc.c,v 1.6 1996/05/02 06:44:19 niklas Exp $ */ +/* $NetBSD: mgnsc.c,v 1.18 1996/04/21 21:12:11 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -55,8 +55,10 @@ int mgnscprint __P((void *auxp, char *)); void mgnscattach __P((struct device *, struct device *, void *)); int mgnscmatch __P((struct device *, void *, void *)); -int siopintr __P((struct siop_softc *)); -int mgnsc_dmaintr __P((struct siop_softc *)); +int mgnsc_dmaintr __P((void *)); +#ifdef DEBUG +void mgnsc_dump __P((void)); +#endif struct scsi_adapter mgnsc_scsiswitch = { siop_scsicmd, @@ -92,7 +94,6 @@ mgnscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -169,9 +170,10 @@ mgnscprint(auxp, pnp) */ int -mgnsc_dmaintr(sc) - struct siop_softc *sc; +mgnsc_dmaintr(arg) + void *arg; { + struct siop_softc *sc = arg; siop_regmap_p rp; u_char istat; diff --git a/sys/arch/amiga/dev/mlhsc.c b/sys/arch/amiga/dev/mlhsc.c index a46a1c80669..e46f75b8886 100644 --- a/sys/arch/amiga/dev/mlhsc.c +++ b/sys/arch/amiga/dev/mlhsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: mlhsc.c,v 1.2 1996/04/21 22:15:38 deraadt Exp $ */ -/* $NetBSD: mlhsc.c,v 1.9 1996/03/17 01:17:46 thorpej Exp $ */ +/* $OpenBSD: mlhsc.c,v 1.3 1996/05/02 06:44:20 niklas Exp $ */ +/* $NetBSD: mlhsc.c,v 1.10 1996/04/21 21:12:12 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -71,10 +71,11 @@ struct scsi_device mlhsc_scsidev = { NULL, /* Use default done routine */ }; -#define QPRINTF - #ifdef DEBUG -extern int sci_debug; +extern int sci_debug; +#define QPRINTF(a) if (sci_debug > 1) printf a +#else +#define QPRINTF(a) #endif extern int sci_data_wait; @@ -178,10 +179,11 @@ mlhsc_dma_xfer_in (dev, len, buf, phase) { int wait = sci_data_wait; u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_data + 16; volatile register u_char *sci_csr = dev->sci_csr; - volatile register u_char *sci_icmd = dev->sci_icmd; +#ifdef DEBUG + u_char *obp = buf; +#endif csr = *dev->sci_bus_csr; @@ -265,10 +267,8 @@ mlhsc_dma_xfer_out (dev, len, buf, phase) { int wait = sci_data_wait; u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_data + 16; volatile register u_char *sci_csr = dev->sci_csr; - volatile register u_char *sci_icmd = dev->sci_icmd; csr = *dev->sci_bus_csr; diff --git a/sys/arch/amiga/dev/ms.c b/sys/arch/amiga/dev/ms.c index 27353a26602..39bee0431f9 100644 --- a/sys/arch/amiga/dev/ms.c +++ b/sys/arch/amiga/dev/ms.c @@ -1,4 +1,5 @@ -/* $NetBSD: ms.c,v 1.7 1995/04/10 09:10:21 mycroft Exp $ */ +/* $OpenBSD: ms.c,v 1.2 1996/05/02 06:44:21 niklas Exp $ */ +/* $NetBSD: ms.c,v 1.9 1996/04/24 11:41:16 is Exp $ */ /* * based on: @@ -53,40 +54,76 @@ */ #include <sys/param.h> -#include <sys/conf.h> +#include <sys/device.h> #include <sys/ioctl.h> #include <sys/kernel.h> #include <sys/proc.h> #include <sys/syslog.h> #include <sys/systm.h> #include <sys/tty.h> +#include <sys/signalvar.h> #include <amiga/dev/event_var.h> #include <amiga/dev/vuid_event.h> #include <amiga/amiga/custom.h> #include <amiga/amiga/cia.h> +#include <amiga/amiga/device.h> -#include "mouse.h" -#if NMOUSE > 0 +#include <sys/conf.h> +#include <machine/conf.h> -/* there's really no more physical ports on an amiga.. */ -#if NMOUSE > 2 -#undef NMOUSE -#define NMOUSE 2 -#endif +void msattach __P((struct device *, struct device *, void *)); +int msmatch __P((struct device *, void *, void *)); void msintr __P((void *)); void ms_enable __P((dev_t)); void ms_disable __P((dev_t)); +struct ms_softc { + struct device sc_dev; + + u_char ms_horc; /* horizontal counter on last scan */ + u_char ms_verc; /* vertical counter on last scan */ + char ms_mb; /* mouse button state */ + char ms_ub; /* user button state */ + int ms_dx; /* delta-x */ + int ms_dy; /* delta-y */ + volatile int ms_ready; /* event queue is ready */ + struct evvar ms_events; /* event queue state */ +}; + +struct cfattach ms_ca = { + sizeof(struct ms_softc), msmatch, msattach +}; + +struct cfdriver ms_cd = { + NULL, "ms", DV_DULL, NULL, 0 +}; + int -mouseattach(cnt) - int cnt; +msmatch(pdp, match, auxp) + struct device *pdp; + void *match, *auxp; +{ + struct cfdata *cfp = (struct cfdata *)match; + + if (matchname((char *)auxp, "ms") && + cfp->cf_unit >= 0 && cfp->cf_unit <= 1) /* only two units */ + return 1; + + return 0; +} + + +void +msattach(pdp, dp, auxp) + struct device *pdp, *dp; + void *auxp; { - printf("%d %s configured\n", NMOUSE, NMOUSE == 1 ? "mouse" : "mice"); - return(NMOUSE); + printf("\n"); } + /* * Amiga mice are hooked up to one of the two "game" ports, where @@ -95,17 +132,6 @@ mouseattach(cnt) * devices, /dev/mouse0 and /dev/mouse1 (with a link of /dev/mouse to * the device that represents the port of the mouse in use). */ -struct ms_softc { - u_char ms_horc; /* horizontal counter on last scan */ - u_char ms_verc; /* vertical counter on last scan */ - char ms_mb; /* mouse button state */ - char ms_ub; /* user button state */ - int ms_dx; /* delta-x */ - int ms_dy; /* delta-y */ - volatile int ms_ready; /* event queue is ready */ - struct evvar ms_events; /* event queue state */ -} ms_softc[NMOUSE]; - /* * enable scanner, called when someone opens the device. @@ -117,7 +143,7 @@ ms_enable(dev) { struct ms_softc *ms; - ms = &ms_softc[minor(dev)]; + ms = (struct ms_softc *)getsoftc(ms_cd, minor(dev)); /* * use this as flag to the "interrupt" to tell it when to * shut off (when it's reset to 0). @@ -138,7 +164,7 @@ ms_disable(dev) struct ms_softc *ms; int s; - ms = &ms_softc[minor(dev)]; + ms = (struct ms_softc *)getsoftc(ms_cd, minor(dev)); s = splhigh (); ms->ms_ready = 0; /* @@ -166,7 +192,7 @@ msintr(arg) short dx, dy; unit = (int)arg; - ms = &ms_softc[unit]; + ms = (struct ms_softc *)getsoftc(ms_cd, unit); horc = ((u_char *) &count) + 1; verc = (u_char *) &count; @@ -315,12 +341,12 @@ msopen(dev, flags, mode, p) struct proc *p; { struct ms_softc *ms; - int s, error, unit; + int unit; unit = minor(dev); - ms = &ms_softc[unit]; + ms = (struct ms_softc *)getsoftc(ms_cd, unit); - if (unit >= NMOUSE) + if (ms == NULL) return(EXDEV); if (ms->ms_events.ev_io) @@ -342,7 +368,7 @@ msclose(dev, flags, mode, p) struct ms_softc *ms; unit = minor (dev); - ms = &ms_softc[unit]; + ms = (struct ms_softc *)getsoftc(ms_cd, unit); ms_disable(dev); ev_fini(&ms->ms_events); @@ -358,7 +384,7 @@ msread(dev, uio, flags) { struct ms_softc *ms; - ms = &ms_softc[minor(dev)]; + ms = (struct ms_softc *)getsoftc(ms_cd, minor(dev)); return(ev_read(&ms->ms_events, uio, flags)); } @@ -374,7 +400,7 @@ msioctl(dev, cmd, data, flag, p) int unit; unit = minor(dev); - ms = &ms_softc[unit]; + ms = (struct ms_softc *)getsoftc(ms_cd, unit); switch (cmd) { case FIONBIO: /* we will remove this someday (soon???) */ @@ -405,7 +431,6 @@ msselect(dev, rw, p) { struct ms_softc *ms; - ms = &ms_softc[minor(dev)]; + ms = (struct ms_softc *)getsoftc(ms_cd, minor(dev)); return(ev_select(&ms->ms_events, rw, p)); } -#endif /* NMOUSE > 0 */ diff --git a/sys/arch/amiga/dev/msc.c b/sys/arch/amiga/dev/msc.c index fa93d077c83..15fb5d84db5 100644 --- a/sys/arch/amiga/dev/msc.c +++ b/sys/arch/amiga/dev/msc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: msc.c,v 1.3 1996/04/21 22:15:39 deraadt Exp $ */ -/* $NetBSD: msc.c,v 1.5 1996/03/17 05:58:54 mhitch Exp $ */ +/* $OpenBSD: msc.c,v 1.4 1996/05/02 06:44:22 niklas Exp $ */ +/* $NetBSD: msc.c,v 1.6 1996/04/21 21:12:15 veego Exp $ */ /* * Copyright (c) 1993 Zik. @@ -59,7 +59,6 @@ #include <sys/ioctl.h> #include <sys/tty.h> #include <sys/proc.h> -#include <sys/conf.h> #include <sys/file.h> #include <sys/malloc.h> #include <sys/uio.h> @@ -76,6 +75,9 @@ #include <amiga/amiga/cia.h> #include <amiga/amiga/cc.h> +#include <sys/conf.h> +#include <machine/conf.h> + /* 6502 code for A2232 card */ #include "msc6502.h" @@ -104,8 +106,8 @@ * you have three boards with minor device numbers from 0 to 45. */ -int mscparam(); -int mscstart __P((struct tty *)); +int mscparam __P((struct tty *, struct termios *)); +void mscstart __P((struct tty *)); int mschwiflow __P((struct tty *, int)); int mscinitcard __P((struct zbus_args *)); @@ -117,45 +119,45 @@ struct tty *msc_tty[MSCTTYS]; /* ttys for all lines */ struct vbl_node msc_vbl_node[NMSC]; /* vbl interrupt node per board */ struct speedtab mscspeedtab_normal[] = { - 0, 0, - 50, MSCPARAM_B50, - 75, MSCPARAM_B75, - 110, MSCPARAM_B110, - 134, MSCPARAM_B134, - 150, MSCPARAM_B150, - 300, MSCPARAM_B300, - 600, MSCPARAM_B600, - 1200, MSCPARAM_B1200, - 1800, MSCPARAM_B1800, - 2400, MSCPARAM_B2400, - 3600, MSCPARAM_B3600, - 4800, MSCPARAM_B4800, - 7200, MSCPARAM_B7200, - 9600, MSCPARAM_B9600, - 19200, MSCPARAM_B19200, - 115200, MSCPARAM_B115200, - -1, -1 + { 0, 0 }, + { 50, MSCPARAM_B50 }, + { 75, MSCPARAM_B75 }, + { 110, MSCPARAM_B110 }, + { 134, MSCPARAM_B134 }, + { 150, MSCPARAM_B150 }, + { 300, MSCPARAM_B300 }, + { 600, MSCPARAM_B600 }, + { 1200, MSCPARAM_B1200 }, + { 1800, MSCPARAM_B1800 }, + { 2400, MSCPARAM_B2400 }, + { 3600, MSCPARAM_B3600 }, + { 4800, MSCPARAM_B4800 }, + { 7200, MSCPARAM_B7200 }, + { 9600, MSCPARAM_B9600 }, + { 19200, MSCPARAM_B19200 }, + { 115200, MSCPARAM_B115200 }, + { -1, -1 } }; struct speedtab mscspeedtab_turbo[] = { - 0, 0, - 100, MSCPARAM_B50, - 150, MSCPARAM_B75, - 220, MSCPARAM_B110, - 269, MSCPARAM_B134, - 300, MSCPARAM_B150, - 600, MSCPARAM_B300, - 1200, MSCPARAM_B600, - 2400, MSCPARAM_B1200, - 3600, MSCPARAM_B1800, - 4800, MSCPARAM_B2400, - 7200, MSCPARAM_B3600, - 9600, MSCPARAM_B4800, - 14400, MSCPARAM_B7200, - 19200, MSCPARAM_B9600, - 38400, MSCPARAM_B19200, - 230400, MSCPARAM_B115200, - -1, -1 + { 0, 0 }, + { 100, MSCPARAM_B50 }, + { 150, MSCPARAM_B75 }, + { 220, MSCPARAM_B110 }, + { 269, MSCPARAM_B134 }, + { 300, MSCPARAM_B150 }, + { 600, MSCPARAM_B300 }, + { 1200, MSCPARAM_B600 }, + { 2400, MSCPARAM_B1200 }, + { 3600, MSCPARAM_B1800 }, + { 4800, MSCPARAM_B2400 }, + { 7200, MSCPARAM_B3600 }, + { 9600, MSCPARAM_B4800 }, + { 14400, MSCPARAM_B7200 }, + { 19200, MSCPARAM_B9600 }, + { 38400, MSCPARAM_B19200 }, + { 230400, MSCPARAM_B115200 }, + { -1, -1 } }; struct speedtab *mscspeedtab; @@ -207,7 +209,6 @@ mscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -818,7 +819,7 @@ NoRoomForYa: int mscioctl(dev, cmd, data, flag, p) dev_t dev; - int cmd; + u_long cmd; caddr_t data; int flag; struct proc *p; @@ -930,7 +931,7 @@ mscparam(tp, t) register struct tty *tp; register struct termios *t; { - register int cfcr, cflag = t->c_cflag; + register int cflag = t->c_cflag; int slot; struct mscdevice *msc; volatile struct mscstatus *ms; @@ -1043,7 +1044,7 @@ mschwiflow(tp, flag) } -int +void mscstart(tp) register struct tty *tp; { @@ -1159,12 +1160,14 @@ mscstop(tp, flag) int flag; /* defaulted to int anyway */ { register int s; +#if 0 struct mscdevice *msc; volatile struct mscstatus *ms; +#endif s = spltty(); if (tp->t_state & TS_BUSY) { - if (tp->t_state & TS_TTSTOP == 0) { + if ((tp->t_state & TS_TTSTOP) == 0) { tp->t_state |= TS_FLUSH; #if 0 msc = &mscdev[MSCSLOT(tp->t_dev)]; @@ -1175,6 +1178,7 @@ mscstop(tp, flag) } } splx(s); + return 0; } /* diff --git a/sys/arch/amiga/dev/otgsc.c b/sys/arch/amiga/dev/otgsc.c index 768dc520642..2878cf47a64 100644 --- a/sys/arch/amiga/dev/otgsc.c +++ b/sys/arch/amiga/dev/otgsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: otgsc.c,v 1.2 1996/04/21 22:15:40 deraadt Exp $ */ -/* $NetBSD: otgsc.c,v 1.10 1996/03/17 01:17:50 thorpej Exp $ */ +/* $OpenBSD: otgsc.c,v 1.3 1996/05/02 06:44:23 niklas Exp $ */ +/* $NetBSD: otgsc.c,v 1.11 1996/04/21 21:12:16 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -56,7 +56,7 @@ int otgsc_dma_xfer_in __P((struct sci_softc *dev, int len, register u_char *buf, int phase)); int otgsc_dma_xfer_out __P((struct sci_softc *dev, int len, register u_char *buf, int phase)); -int otgsc_intr __P((struct sci_softc *)); +int otgsc_intr __P((void *)); struct scsi_adapter otgsc_scsiswitch = { sci_scsicmd, @@ -72,10 +72,12 @@ struct scsi_device otgsc_scsidev = { NULL, /* Use default done routine */ }; -#define QPRINTF #ifdef DEBUG -extern int sci_debug; +extern int sci_debug; +#define QPRINTF(a) if (sci_debug > 1) printf a +#else +#define QPRINTF(a) #endif extern int sci_data_wait; @@ -183,11 +185,11 @@ otgsc_dma_xfer_in (dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_data + 0x100; volatile register u_char *sci_csr = dev->sci_csr; - volatile register u_char *sci_icmd = dev->sci_icmd; +#ifdef DEBUG + u_char *obp = buf; +#endif QPRINTF(("otgsc_dma_in %d, csr=%02x\n", len, *dev->sci_bus_csr)); @@ -205,7 +207,7 @@ otgsc_dma_xfer_in (dev, len, buf, phase) #ifdef DEBUG if (sci_debug) printf("otgsc_dma_in fail: l%d i%x w%d\n", - len, csr, wait); + len, *dev->sci_bus_csr, wait); #endif *dev->sci_mode &= ~SCI_MODE_DMA; return 0; @@ -232,11 +234,8 @@ otgsc_dma_xfer_out (dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_data + 0x100; volatile register u_char *sci_csr = dev->sci_csr; - volatile register u_char *sci_icmd = dev->sci_icmd; QPRINTF(("otgsc_dma_out %d, csr=%02x\n", len, *dev->sci_bus_csr)); @@ -258,7 +257,7 @@ otgsc_dma_xfer_out (dev, len, buf, phase) #ifdef DEBUG if (sci_debug) printf("otgsc_dma_out fail: l%d i%x w%d\n", - len, csr, wait); + len, *dev->sci_bus_csr, wait); #endif *dev->sci_mode &= ~SCI_MODE_DMA; return 0; @@ -279,9 +278,10 @@ otgsc_dma_xfer_out (dev, len, buf, phase) } int -otgsc_intr(dev) - struct sci_softc *dev; +otgsc_intr(arg) + void *arg; { + struct sci_softc *dev = arg; u_char stat; if ((*dev->sci_csr & SCI_CSR_INT) == 0) diff --git a/sys/arch/amiga/dev/par.c b/sys/arch/amiga/dev/par.c index 2021f3617e9..6ae89c2e069 100644 --- a/sys/arch/amiga/dev/par.c +++ b/sys/arch/amiga/dev/par.c @@ -1,5 +1,5 @@ -/* $OpenBSD: par.c,v 1.2 1996/04/21 22:15:41 deraadt Exp $ */ -/* $NetBSD: par.c,v 1.12 1996/03/17 01:17:51 thorpej Exp $ */ +/* $OpenBSD: par.c,v 1.3 1996/05/02 06:44:24 niklas Exp $ */ +/* $NetBSD: par.c,v 1.13 1996/04/21 21:12:18 veego Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -50,11 +50,14 @@ #include <sys/malloc.h> #include <sys/file.h> #include <sys/systm.h> +#include <sys/proc.h> #include <amiga/amiga/device.h> #include <amiga/amiga/cia.h> #include <amiga/dev/parioctl.h> +#include <sys/conf.h> +#include <machine/conf.h> struct par_softc { int sc_flags; @@ -85,6 +88,13 @@ int pardebug = 0; #define PDB_NOCHECK 0x80 #endif +int parrw __P((dev_t, struct uio *)); +int parhztoms __P((int)); +int parmstohz __P((int)); +int parsend __P((u_char *, int)); +int parreceive __P((u_char *, int)); +int parsendch __P((u_char)); + void partimo __P((void *)); void parstart __P((void *)); void parintr __P((void *)); @@ -127,8 +137,12 @@ parattach(pdp, dp, auxp) printf("\n"); } -paropen(dev, flags) +int +paropen(dev, flags, mode, p) dev_t dev; + int flags; + int mode; + struct proc *p; { int unit = UNIT(dev); struct par_softc *sc = getparsp(unit); @@ -164,8 +178,12 @@ paropen(dev, flags) return(0); } -parclose(dev, flags) - dev_t dev; +int +parclose(dev, flags, mode, p) + dev_t dev; + int flags; + int mode; + struct proc *p; { int unit = UNIT(dev); struct par_softc *sc = getparsp(unit); @@ -215,30 +233,37 @@ partimo(arg) wakeup(sc); } -parread(dev, uio) - dev_t dev; - struct uio *uio; +int +parread(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { #ifdef DEBUG - if (pardebug & PDB_FOLLOW) - printf("parread(%x, %x)\n", dev, uio); + if (pardebug & PDB_FOLLOW) + printf("parread(%x, %p)\n", dev, uio); #endif - return (parrw(dev, uio)); + return (parrw(dev, uio)); } -parwrite(dev, uio) - dev_t dev; - struct uio *uio; + +int +parwrite(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { #ifdef DEBUG - if (pardebug & PDB_FOLLOW) - printf("parwrite(%x, %x)\n", dev, uio); + if (pardebug & PDB_FOLLOW) + printf("parwrite(%x, %p)\n", dev, uio); #endif - return (parrw(dev, uio)); + return (parrw(dev, uio)); } + +int parrw(dev, uio) dev_t dev; register struct uio *uio; @@ -251,6 +276,8 @@ parrw(dev, uio) int buflen; char *buf; + len = 0; + cnt = 0; if (!!(sc->sc_flags & PARF_OREAD) ^ (uio->uio_rw == UIO_READ)) return EINVAL; @@ -259,7 +286,7 @@ parrw(dev, uio) #ifdef DEBUG if (pardebug & (PDB_FOLLOW|PDB_IO)) - printf("parrw(%x, %x, %c): burst %d, timo %d, resid %x\n", + printf("parrw(%x, %p, %c): burst %d, timo %d, resid %x\n", dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W', sc->sc_burst, sc->sc_timo, uio->uio_resid); #endif @@ -327,7 +354,7 @@ again: #endif #ifdef DEBUG if (pardebug & PDB_IO) - printf("parrw: %s(%x, %d) -> %d\n", + printf("parrw: %s(%p, %d) -> %d\n", uio->uio_rw == UIO_READ ? "recv" : "send", cp, len, cnt); #endif splx(s); @@ -367,7 +394,7 @@ again: { sc->sc_flags |= PARF_DELAY; timeout(parstart, (void *)unit, sc->sc_delay); - error = tsleep(sc, PCATCH|PZERO-1, "par-cdelay", 0); + error = tsleep(sc, PCATCH | (PZERO - 1), "par-cdelay", 0); if (error) { splx(s); @@ -556,7 +583,7 @@ parsendch (ch) /* it's quite important that a parallel putc can be interrupted, given the possibility to lock a printer in an offline condition.. */ - if (error = tsleep(parintr, PCATCH|PZERO-1, "parsendch", 0)) + if ((error = tsleep(parintr, PCATCH | (PZERO - 1), "parsendch", 0)) > 0) { #ifdef DEBUG if (pardebug & PDB_INTERRUPT) @@ -600,7 +627,7 @@ parsend (buf, len) ciaa.ddrb = 0xff; for (; len; len--, buf++) - if (err = parsendch (*buf)) + if ((err = parsendch (*buf)) != 0) return err < 0 ? -EINTR : -err; /* either all or nothing.. */ diff --git a/sys/arch/amiga/dev/rtc.h b/sys/arch/amiga/dev/rtc.h index 46f50a5e5c0..417a8146192 100644 --- a/sys/arch/amiga/dev/rtc.h +++ b/sys/arch/amiga/dev/rtc.h @@ -1,4 +1,5 @@ -/* $NetBSD: rtc.h,v 1.2 1994/10/26 02:04:32 cgd Exp $ */ +/* $OpenBSD: rtc.h,v 1.2 1996/05/02 06:44:25 niklas Exp $ */ +/* $NetBSD: rtc.h,v 1.3 1996/04/21 21:12:19 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -97,7 +98,7 @@ struct rtclock3000 { #define SECYR (SECDAY * 365) -#define leapyear(y) (((y)%4)==0 && ((y)%100)!=0 || ((y)%400) == 0) +#define leapyear(y) ((((y)%4)==0 && ((y)%100)!=0) || ((y)%400) == 0) #define range_test(n, l, h) ((n) < (l) || (n) > (h)) #define days_in_year(a) (leapyear(a) ? 366 : 365) #define days_in_month(a) (month_days[(a) - 1]) diff --git a/sys/arch/amiga/dev/sbic.c b/sys/arch/amiga/dev/sbic.c index 8e40232e6ed..650a57242d6 100644 --- a/sys/arch/amiga/dev/sbic.c +++ b/sys/arch/amiga/dev/sbic.c @@ -1,5 +1,5 @@ -/* $OpenBSD: sbic.c,v 1.4 1996/04/21 22:15:43 deraadt Exp $ */ -/* $NetBSD: sbic.c,v 1.22 1996/03/23 15:09:54 is Exp $ */ +/* $OpenBSD: sbic.c,v 1.5 1996/05/02 06:44:26 niklas Exp $ */ +/* $NetBSD: sbic.c,v 1.23 1996/04/21 21:12:21 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -85,8 +85,6 @@ #define b_cylin b_resid #define SBIC_WAIT(regs, until, timeo) sbicwait(regs, until, timeo, __LINE__) -extern u_int kvtop(); - int sbicicmd __P((struct sbic_softc *, int, int, void *, int, void *, int)); int sbicgo __P((struct sbic_softc *, struct scsi_xfer *)); int sbicdmaok __P((struct sbic_softc *, struct scsi_xfer *)); @@ -97,7 +95,6 @@ int sbicxfstart __P((sbic_regmap_p, int, u_char, int)); int sbicxfout __P((sbic_regmap_p regs, int, void *, int)); int sbicfromscsiperiod __P((struct sbic_softc *, sbic_regmap_p, int)); int sbictoscsiperiod __P((struct sbic_softc *, sbic_regmap_p, int)); -int sbicintr __P((struct sbic_softc *)); int sbicpoll __P((struct sbic_softc *)); int sbicnextstate __P((struct sbic_softc *, u_char, u_char)); int sbicmsgin __P((struct sbic_softc *)); @@ -111,6 +108,10 @@ void sbic_scsidone __P((struct sbic_acb *, int)); void sbic_sched __P((struct sbic_softc *)); void sbic_save_ptrs __P((struct sbic_softc *, sbic_regmap_p,int,int)); void sbic_load_ptrs __P((struct sbic_softc *, sbic_regmap_p,int,int)); +#ifdef DEBUG +void sbicdumpstate __P((void)); +void sbic_dump_acb __P((struct sbic_acb *)); +#endif /* * Synch xfer parameters, and timing conversions @@ -148,7 +149,6 @@ int report_sense = 0; int data_pointer_debug = 0; u_char debug_asr, debug_csr, routine; void sbictimeout __P((struct sbic_softc *dev)); -void sbic_dump __P((struct sbic_softc *dev)); #define CSR_TRACE_SIZE 32 #if CSR_TRACE_SIZE @@ -156,9 +156,9 @@ void sbic_dump __P((struct sbic_softc *dev)); int s = splbio(); \ csr_trace[csr_traceptr].whr = (w); csr_trace[csr_traceptr].csr = (c); \ csr_trace[csr_traceptr].asr = (a); csr_trace[csr_traceptr].xtn = (x); \ - dma_cachectl(&csr_trace[csr_traceptr], sizeof(csr_trace[0])); \ + dma_cachectl((caddr_t)&csr_trace[csr_traceptr], sizeof(csr_trace[0])); \ csr_traceptr = (csr_traceptr + 1) & (CSR_TRACE_SIZE - 1); \ -/* dma_cachectl(&csr_traceptr, sizeof(csr_traceptr));*/ \ +/* dma_cachectl((caddr_t)&csr_traceptr, sizeof(csr_traceptr));*/ \ splx(s); \ } while (0) int csr_traceptr; @@ -170,7 +170,7 @@ struct { u_char xtn; } csr_trace[CSR_TRACE_SIZE]; #else -#define CSR_TRACE +#define CSR_TRACE(w,c,a,x) #endif #define SBIC_TRACE_SIZE 0 @@ -196,14 +196,14 @@ struct { int csr; } sbic_trace[SBIC_TRACE_SIZE]; #else -#define SBIC_TRACE +#define SBIC_TRACE(dev) #endif -#else -#define QPRINTF -#define CSR_TRACE -#define SBIC_TRACE -#endif +#else /* DEBUG */ +#define QPRINTF(a) +#define CSR_TRACE(w,c,a,x) +#define SBIC_TRACE(dev) +#endif /* DEBUG */ /* * default minphys routine for sbic based controllers @@ -228,13 +228,9 @@ sbic_save_ptrs(dev, regs, target, lun) sbic_regmap_p regs; int target, lun; { - int count, asr, csr, s; - unsigned long ptr; - char *vptr; + int count, asr, s; struct sbic_acb* acb; - extern vm_offset_t vm_first_phys; - SBIC_TRACE(dev); if( !dev->sc_cur ) return; if( !(dev->sc_flags & SBICF_INDMA) ) return; /* DMA not active */ @@ -266,7 +262,7 @@ sbic_save_ptrs(dev, regs, target, lun) #ifdef DEBUG if(!count && sbic_debug) printf("%dcount0",target); if(data_pointer_debug == -1) - printf("SBIC saving target %d data pointers from (%x,%x)%xASR:%02x", + printf("SBIC saving target %d data pointers from (%p,%x)%xASR:%02x", target, dev->sc_cur->dc_addr, dev->sc_cur->dc_count, acb->sc_dmacmd, asr); #endif @@ -280,7 +276,7 @@ sbic_save_ptrs(dev, regs, target, lun) acb->sc_tcnt = dev->sc_tcnt = count; #ifdef DEBUG if(data_pointer_debug) - printf(" at (%x,%x):%x\n", + printf(" at (%p,%x):%x\n", dev->sc_cur->dc_addr, dev->sc_cur->dc_count,count); sbicdma_saves++; #endif @@ -297,7 +293,7 @@ void sbic_load_ptrs(dev, regs, target, lun) sbic_regmap_p regs; int target, lun; { - int i, s, asr, count; + int s, count; char* vaddr, * paddr; struct sbic_acb *acb; @@ -347,7 +343,7 @@ void sbic_load_ptrs(dev, regs, target, lun) #ifdef DEBUG if(data_pointer_debug) - printf("DMA recalc:kv(%x,%x)pa(%x,%x)\n", + printf("DMA recalc:kv(%p,%x)pa(%p,%lx)\n", acb->sc_kv.dc_addr, acb->sc_kv.dc_count, acb->sc_pa.dc_addr, @@ -357,7 +353,7 @@ void sbic_load_ptrs(dev, regs, target, lun) splx(s); #ifdef DEBUG if(data_pointer_debug) - printf("SBIC restoring target %d data pointers at (%x,%x)%x\n", + printf("SBIC restoring target %d data pointers at (%p,%x)%x\n", target, dev->sc_cur->dc_addr, dev->sc_cur->dc_count, dev->sc_dmacmd); #endif @@ -547,7 +543,7 @@ sbic_scsidone(acb, stat) struct scsi_xfer *xs; struct scsi_link *slp; struct sbic_softc *dev; - int s, dosched = 0; + int dosched = 0; xs = acb->xs; slp = xs->sc_link; @@ -600,7 +596,7 @@ sbic_scsidone(acb, stat) acb->clen = sizeof(*ss); acb->sc_kv.dc_addr = (char *)&xs->sense; acb->sc_kv.dc_count = sizeof(struct scsi_sense_data); - acb->pa_addr = (char *)kvtop(&xs->sense); /* XXX check */ + acb->pa_addr = (char *)kvtop((u_char *)&xs->sense); /* XXX check */ acb->flags = ACB_ACTIVE | ACB_CHKSENSE | ACB_DATAIN; TAILQ_INSERT_HEAD(&dev->ready_list, acb, chain); dev->sc_tinfo[slp->target].lubusy &= @@ -708,14 +704,14 @@ sbicdmaok(dev, xs) /* * try to get one */ - else if (dev->sc_tinfo[xs->sc_link->target].bounce - = (char *)alloc_z2mem(MAXPHYS)) { + else if ((dev->sc_tinfo[xs->sc_link->target].bounce + = (char *)alloc_z2mem(MAXPHYS))) { if (isztwomem(dev->sc_tinfo[xs->sc_link->target].bounce)) printf("alloc ZII target %d bounce pa 0x%x\n", xs->sc_link->target, kvtop(dev->sc_tinfo[xs->sc_link->target].bounce)); else if (dev->sc_tinfo[xs->sc_link->target].bounce) - printf("alloc CHIP target %d bounce pa 0x%x\n", + printf("alloc CHIP target %d bounce pa 0x%p\n", xs->sc_link->target, PREP_DMA_MEM(dev->sc_tinfo[xs->sc_link->target].bounce)); return(1); @@ -838,8 +834,7 @@ sbicinit(dev) struct sbic_softc *dev; { sbic_regmap_p regs; - u_int my_id, i, s; - u_char csr; + u_int i; struct sbic_acb *acb; u_int inhibit_sync; @@ -893,9 +888,12 @@ sbicreset(dev) struct sbic_softc *dev; { sbic_regmap_p regs; - u_int my_id, i, s; + u_int my_id, s; u_char csr; +#if 0 + u_int i; struct sbic_acb *acb; +#endif regs = dev->sc_sbicp; #if 0 @@ -1228,7 +1226,7 @@ sbicxfout(regs, len, bp, phase) void *bp; int phase; { - u_char orig_csr, csr, asr, *buf; + u_char orig_csr, asr, *buf; int wait; buf = bp; @@ -1282,7 +1280,7 @@ sbicxfin(regs, len, bp) int len; void *bp; { - int wait, read; + int wait; u_char *obp, *buf; u_char orig_csr, csr, asr; @@ -1363,12 +1361,9 @@ sbicicmd(dev, target, lun, cbuf, clen, buf, len) { sbic_regmap_p regs; u_char phase, csr, asr; - int wait, newtarget, cmd_sent, parity_err; + int wait, i; struct sbic_acb *acb; - int discon; - int i; - #define CSR_LOG_BUF_SIZE 0 #if CSR_LOG_BUF_SIZE int bufptr; @@ -1444,7 +1439,7 @@ sbicicmd(dev, target, lun, cbuf, clen, buf, len) if (phase == 0x60) { GET_SBIC_tlun (regs, dev->sc_stat[0]); i = 0; /* done */ -/* break; /* Bypass all the state gobldygook */ +/* break; */ /* Bypass all the state gobldygook */ } else { #ifdef DEBUG if(reselect_debug>1) @@ -1656,8 +1651,8 @@ sbicgo(dev, xs) struct sbic_softc *dev; struct scsi_xfer *xs; { - int i, dmaflags, count, wait, usedma; - u_char csr, asr, cmd, *addr; + int i, dmaflags, count, usedma; + u_char csr, asr, *addr; sbic_regmap_p regs; struct sbic_acb *acb; @@ -1712,7 +1707,7 @@ sbicgo(dev, xs) addr = acb->sc_kv.dc_addr; count = acb->sc_kv.dc_count; if (count && (char *)kvtop(addr) != acb->sc_pa.dc_addr) { /* XXXX check */ - printf("sbic: DMA buffer mapping changed %x->%x\n", + printf("sbic: DMA buffer mapping changed %p->%x\n", acb->sc_pa.dc_addr, kvtop(addr)); #ifdef DDB Debugger(); @@ -1735,7 +1730,7 @@ sbicgo(dev, xs) if(!dev->sc_tinfo[dev->target].bounce) { printf("sbicgo: HELP! no bounce allocated for %d\n", dev->target); - printf("xfer: (%x->%x,%x)\n", acb->sc_dmausrbuf, + printf("xfer: (%p->%p,%lx)\n", acb->sc_dmausrbuf, acb->sc_usrbufpa, acb->sc_dmausrlen); dev->sc_tinfo[xs->sc_link->target].bounce = (char *)alloc_z2mem(MAXPHYS); @@ -1744,7 +1739,7 @@ sbicgo(dev, xs) xs->sc_link->target, kvtop(dev->sc_tinfo[xs->sc_link->target].bounce)); else if (dev->sc_tinfo[xs->sc_link->target].bounce) - printf("alloc CHIP target %d bounce pa 0x%x\n", + printf("alloc CHIP target %d bounce pa 0x%p\n", xs->sc_link->target, PREP_DMA_MEM(dev->sc_tinfo[xs->sc_link->target].bounce)); @@ -1796,7 +1791,7 @@ sbicgo(dev, xs) } else dev->sc_dmacmd = 0; /* Don't use DMA */ dev->sc_flags |= SBICF_INDMA; -/* SBIC_TC_PUT(regs, dev->sc_tcnt); /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ +/* SBIC_TC_PUT(regs, dev->sc_tcnt); */ /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ SBIC_TRACE(dev); sbic_save_ptrs(dev, regs, dev->target, dev->lun); @@ -1816,7 +1811,7 @@ sbicgo(dev, xs) */ #ifdef DEBUG if( data_pointer_debug > 1 ) - printf("sbicgo dmago:%d(%x:%x)\n", + printf("sbicgo dmago:%d(%p:%lx)\n", dev->target,dev->sc_cur->dc_addr,dev->sc_tcnt); debug_asr = asr; debug_csr = csr; @@ -1865,11 +1860,8 @@ sbicintr(dev) struct sbic_softc *dev; { sbic_regmap_p regs; - struct dma_chain *df, *dl; - u_char asr, csr, *tmpaddr; - struct sbic_acb *acb; - int i, newtarget, newlun; - unsigned tcnt; + u_char asr, csr; + int i; regs = dev->sc_sbicp; @@ -1917,9 +1909,7 @@ sbicpoll(dev) { sbic_regmap_p regs; u_char asr, csr; - struct sbic_pending* pendp; int i; - unsigned tcnt; SBIC_TRACE(dev); regs = dev->sc_sbicp; @@ -2253,11 +2243,13 @@ sbicnextstate(dev, csr, asr) u_char csr, asr; { sbic_regmap_p regs; - struct dma_chain *df, *dl; struct sbic_acb *acb; int i, newtarget, newlun, wait; +#if 0 unsigned tcnt; +#endif + i = 0; SBIC_TRACE(dev); regs = dev->sc_sbicp; acb = dev->sc_nexus; @@ -2299,19 +2291,19 @@ sbicnextstate(dev, csr, asr) #endif #ifdef DEBUG if( data_pointer_debug > 1 ) - printf("next dmastop: %d(%x:%x)\n", + printf("next dmastop: %d(%p:%lx)\n", dev->target,dev->sc_cur->dc_addr,dev->sc_tcnt); dev->sc_dmatimo = 0; #endif dev->sc_dmastop(dev); /* was dmafree */ if (acb->flags & ACB_BBUF) { if ((u_char *)kvtop(acb->sc_dmausrbuf) != acb->sc_usrbufpa) - printf("%s: WARNING - buffer mapping changed %x->%x\n", + printf("%s: WARNING - buffer mapping changed %p->%x\n", dev->sc_dev.dv_xname, acb->sc_usrbufpa, kvtop(acb->sc_dmausrbuf)); #ifdef DEBUG if(data_pointer_debug) - printf("sbicgo:copying %x bytes from target %d bounce %x\n", + printf("sbicgo:copying %lx bytes from target %d bounce %x\n", acb->sc_dmausrlen, dev->target, kvtop(dev->sc_tinfo[dev->target].bounce)); @@ -2385,7 +2377,7 @@ sbicnextstate(dev, csr, asr) #endif #ifdef DEBUG if( data_pointer_debug > 1 ) - printf("next dmanext: %d(%x:%x)\n", + printf("next dmanext: %d(%p:%lx)\n", dev->target,dev->sc_cur->dc_addr, dev->sc_tcnt); dev->sc_dmatimo = 1; @@ -2483,9 +2475,9 @@ sbicnextstate(dev, csr, asr) } else { GET_SBIC_csr(regs,csr); CSR_TRACE('n',csr,asr,newtarget); - if (csr == SBIC_CSR_MIS|MESG_IN_PHASE || - csr == SBIC_CSR_MIS_1|MESG_IN_PHASE || - csr == SBIC_CSR_MIS_2|MESG_IN_PHASE) { + if (csr == (SBIC_CSR_MIS | MESG_IN_PHASE) || + csr == (SBIC_CSR_MIS_1 | MESG_IN_PHASE) || + csr == (SBIC_CSR_MIS_2 | MESG_IN_PHASE)) { sbicmsgin(dev); newlun = dev->sc_msg[0] & 7; } else { @@ -2535,7 +2527,7 @@ sbicnextstate(dev, csr, asr) break; } if (acb == NULL) { - printf("%s: reselect %s targ %d not in nexus_list %x\n", + printf("%s: reselect %s targ %d not in nexus_list %p\n", dev->sc_dev.dv_xname, csr == SBIC_CSR_RSLT_NI ? "NI" : "IFY", newtarget, &dev->nexus_list.tqh_first); @@ -2556,7 +2548,7 @@ sbicnextstate(dev, csr, asr) #endif #ifdef DEBUG if( data_pointer_debug > 1 ) - printf("next dmastop: %d(%x:%x)\n", + printf("next dmastop: %d(%p:%lx)\n", dev->target,dev->sc_cur->dc_addr,dev->sc_tcnt); dev->sc_dmatimo = 0; #endif @@ -2580,7 +2572,7 @@ sbicnextstate(dev, csr, asr) ~(SBICF_INDMA | SBICF_DCFLUSH); #ifdef DEBUG if( data_pointer_debug > 1 ) - printf("next dmastop: %d(%x:%x)\n", + printf("next dmastop: %d(%p:%lx)\n", dev->target,dev->sc_cur->dc_addr,dev->sc_tcnt); dev->sc_dmatimo = 0; #endif @@ -2674,7 +2666,8 @@ sbicfromscsiperiod(dev, regs, p) #ifdef DEBUG -void sbicdumpstate() +void +sbicdumpstate() { u_char csr, asr; @@ -2689,7 +2682,8 @@ void sbicdumpstate() } -void sbictimeout(dev) +void +sbictimeout(dev) struct sbic_softc *dev; { int s, asr; @@ -2721,7 +2715,7 @@ sbic_dump_acb(acb) u_char *b = (u_char *) &acb->cmd; int i; - printf("acb@%x ", acb); + printf("acb@%p ", acb); if (acb->xs == NULL) { printf("<unused>\n"); return; @@ -2731,10 +2725,10 @@ sbic_dump_acb(acb) for (i = acb->clen; i; --i) printf(" %02x", *b++); printf("\n"); - printf(" xs: %08x data %8x:%04x ", acb->xs, acb->xs->data, + printf(" xs: %8p data %8p:%04x ", acb->xs, acb->xs->data, acb->xs->datalen); - printf("va %8x:%04x ", acb->sc_kv.dc_addr, acb->sc_kv.dc_count); - printf("pa %8x:%04x tcnt %x\n", acb->sc_pa.dc_addr, acb->sc_pa.dc_count, + printf("va %8p:%04x ", acb->sc_kv.dc_addr, acb->sc_kv.dc_count); + printf("pa %8p:%04x tcnt %lx\n", acb->sc_pa.dc_addr, acb->sc_pa.dc_count, acb->sc_tcnt); } @@ -2857,23 +2851,23 @@ sbic_dump(dev) GET_SBIC_csr(regs, csr); else csr = 0; - printf("%s@%x regs %x asr %x csr %x\n", dev->sc_dev.dv_xname, + printf("%s@%p regs %x asr %x csr %x\n", dev->sc_dev.dv_xname, dev, regs, asr, csr); - if (acb = dev->free_list.tqh_first) { + if ((acb = dev->free_list.tqh_first)) { printf("Free list:\n"); while (acb) { sbic_dump_acb(acb); acb = acb->chain.tqe_next; } } - if (acb = dev->ready_list.tqh_first) { + if ((acb = dev->ready_list.tqh_first)) { printf("Ready list:\n"); while (acb) { sbic_dump_acb(acb); acb = acb->chain.tqe_next; } } - if (acb = dev->nexus_list.tqh_first) { + if ((acb = dev->nexus_list.tqh_first)) { printf("Nexus list:\n"); while (acb) { sbic_dump_acb(acb); @@ -2884,7 +2878,7 @@ sbic_dump(dev) printf("nexus:\n"); sbic_dump_acb(dev->sc_nexus); } - printf("sc_xs %x targ %d lun %d flags %x tcnt %x dmacmd %x mask %x\n", + printf("sc_xs %p targ %d lun %d flags %x tcnt %lx dmacmd %x mask %lx\n", dev->sc_xs, dev->target, dev->lun, dev->sc_flags, dev->sc_tcnt, dev->sc_dmacmd, dev->sc_dmamask); for (i = 0; i < 8; ++i) { diff --git a/sys/arch/amiga/dev/sbicvar.h b/sys/arch/amiga/dev/sbicvar.h index dc29ff114f8..b13ef2eeea4 100644 --- a/sys/arch/amiga/dev/sbicvar.h +++ b/sys/arch/amiga/dev/sbicvar.h @@ -1,4 +1,5 @@ -/* $NetBSD: sbicvar.h,v 1.9.2.1 1995/11/24 07:51:20 chopps Exp $ */ +/* $OpenBSD: sbicvar.h,v 1.3 1996/05/02 06:44:27 niklas Exp $ */ +/* $NetBSD: sbicvar.h,v 1.11 1996/04/21 21:12:23 veego Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -225,5 +226,10 @@ struct scsi_xfer; void sbic_minphys __P((struct buf *bp)); int sbic_scsicmd __P((struct scsi_xfer *)); +void sbicinit __P((struct sbic_softc *)); +int sbicintr __P((struct sbic_softc *)); +#ifdef DEBUG +void sbic_dump __P((struct sbic_softc *dev)); +#endif #endif /* _SBICVAR_H_ */ diff --git a/sys/arch/amiga/dev/sci.c b/sys/arch/amiga/dev/sci.c index 91cd5a1b78f..49de4b4cd19 100644 --- a/sys/arch/amiga/dev/sci.c +++ b/sys/arch/amiga/dev/sci.c @@ -1,4 +1,5 @@ -/* $NetBSD: sci.c,v 1.15 1996/01/07 22:01:56 thorpej Exp $ */ +/* $OpenBSD: sci.c,v 1.3 1996/05/02 06:44:28 niklas Exp $ */ +/* $NetBSD: sci.c,v 1.16 1996/04/21 21:12:24 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -78,10 +79,11 @@ int scigetsense __P((struct sci_softc *, struct scsi_xfer *)); int sciselectbus __P((struct sci_softc *, u_char, u_char)); void sciabort __P((struct sci_softc *, char *)); void scierror __P((struct sci_softc *, u_char)); -void scireset __P((struct sci_softc *)); void scisetdelay __P((int)); void sci_scsidone __P((struct sci_softc *, int)); void sci_donextcmd __P((struct sci_softc *)); +int sci_ixfer_out __P((struct sci_softc *, int, register u_char *, int)); +void sci_ixfer_in __P((struct sci_softc *, int, register u_char *, int)); int sci_cmd_wait = SCI_CMD_WAIT; int sci_data_wait = SCI_DATA_WAIT; @@ -93,7 +95,7 @@ int sci_no_dma = 0; #define QPRINTF(a) if (sci_debug > 1) printf a int sci_debug = 0; #else -#define QPRINTF +#define QPRINTF(a) #endif /* @@ -232,7 +234,8 @@ sci_scsidone(dev, stat) else { switch(stat) { case SCSI_CHECK: - if (stat = scigetsense(dev, xs)) + stat = scigetsense(dev, xs); + if (stat != 0) goto bad_sense; xs->error = XS_SENSE; break; @@ -277,7 +280,6 @@ scigetsense(dev, xs) { struct scsi_sense rqs; struct scsi_link *slp; - int stat; slp = xs->sc_link; @@ -346,8 +348,8 @@ void scireset(dev) struct sci_softc *dev; { - u_int i, s; - u_char my_id, csr; + u_int s; + u_char my_id; dev->sc_flags &= ~SCI_SELECTED; if (dev->sc_flags & SCI_ALIVE) @@ -494,11 +496,13 @@ sci_ixfer_in(dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char *obp = buf; u_char csr; volatile register u_char *sci_bus_csr = dev->sci_bus_csr; volatile register u_char *sci_data = dev->sci_data; volatile register u_char *sci_icmd = dev->sci_icmd; +#ifdef DEBUG + u_char *obp = buf; +#endif csr = *sci_bus_csr; @@ -554,7 +558,7 @@ sciicmd(dev, target, cbuf, clen, buf, len, xferphase) int clen, len; u_char xferphase; { - u_char phase, csr, asr; + u_char phase; register int wait; /* select the SCSI bus (it's an error if bus isn't free) */ @@ -645,9 +649,8 @@ scigo(dev, xs) struct sci_softc *dev; struct scsi_xfer *xs; { - int i, count, target; - u_char phase, csr, asr, cmd, *addr; - int wait; + int count, target; + u_char phase, *addr; target = xs->sc_link->target; count = xs->datalen; @@ -683,7 +686,7 @@ scigo(dev, xs) switch (phase) { case CMD_PHASE: - if (sci_ixfer_out (dev, xs->cmdlen, xs->cmd, phase)) + if (sci_ixfer_out (dev, xs->cmdlen, (u_char *) xs->cmd, phase)) goto abort; phase = xs->flags & SCSI_DATA_IN ? DATA_IN_PHASE : DATA_OUT_PHASE; break; diff --git a/sys/arch/amiga/dev/scivar.h b/sys/arch/amiga/dev/scivar.h index 622ee276d18..be32c553d11 100644 --- a/sys/arch/amiga/dev/scivar.h +++ b/sys/arch/amiga/dev/scivar.h @@ -1,4 +1,5 @@ -/* $NetBSD: scivar.h,v 1.8 1995/08/12 20:30:51 mycroft Exp $ */ +/* $OpenBSD: scivar.h,v 1.2 1996/05/02 06:44:29 niklas Exp $ */ +/* $NetBSD: scivar.h,v 1.10 1996/04/28 06:41:01 mhitch Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -45,6 +46,7 @@ struct sci_pending { struct scsi_xfer *xs; }; +struct sci_softc; struct sci_softc { struct device sc_dev; @@ -68,9 +70,10 @@ struct sci_softc { volatile u_char *sci_iack; /* r: Interrupt Acknowledge */ volatile u_char *sci_irecv; /* w: Start dma receive, initiator */ - int (*dma_xfer_in)(); /* psuedo DMA transfer */ - int (*dma_xfer_out)(); /* psuedo DMA transfer */ - int (*dma_intr)(); /* board-specific interrupt */ + /* psuedo DMA transfer */ + int (*dma_xfer_in) __P((struct sci_softc *, int, u_char *, int)); + /* psuedo DMA transfer */ + int (*dma_xfer_out) __P((struct sci_softc *, int, u_char *, int)); u_char sc_flags; u_char sc_lun; /* one for each target */ @@ -94,7 +97,7 @@ struct sci_softc { #define SYNC_START 0 /* no sync handshake started */ #define SYNC_SENT 1 /* we sent sync request, no answer yet */ #define SYNC_DONE 2 /* target accepted our (or inferior) settings, - or it rejected the request and we stay async * + or it rejected the request and we stay async */ #define PHASE 0x07 /* mask for psns/pctl phase */ #define DATA_OUT_PHASE 0x00 @@ -139,7 +142,8 @@ struct scsi_fmt_cdb { struct buf; struct scsi_xfer; -void sci_minphys __P((struct buf *bp)); +void sci_minphys __P((struct buf *)); int sci_scsicmd __P((struct scsi_xfer *)); +void scireset __P((struct sci_softc *)); #endif /* _SCIVAR_H_ */ diff --git a/sys/arch/amiga/dev/ser.c b/sys/arch/amiga/dev/ser.c index 9eaf8a5c653..39a22b35178 100644 --- a/sys/arch/amiga/dev/ser.c +++ b/sys/arch/amiga/dev/ser.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ser.c,v 1.3 1996/04/21 22:15:45 deraadt Exp $ */ -/* $NetBSD: ser.c,v 1.30 1996/03/17 05:58:58 mhitch Exp $ */ +/* $OpenBSD: ser.c,v 1.4 1996/05/02 06:44:30 niklas Exp $ */ +/* $NetBSD: ser.c,v 1.34 1996/04/27 20:53:31 veego Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ * @(#)ser.c 7.12 (Berkeley) 6/27/91 */ /* - * XXX This file needs major cleanup it will never ervice more than one + * XXX This file needs major cleanup it will never service more than one * XXX unit. */ @@ -46,7 +46,6 @@ #include <sys/device.h> #include <sys/tty.h> #include <sys/proc.h> -#include <sys/conf.h> #include <sys/file.h> #include <sys/malloc.h> #include <sys/uio.h> @@ -62,6 +61,9 @@ #include <dev/cons.h> +#include <sys/conf.h> +#include <machine/conf.h> + #include "ser.h" #if NSER > 0 @@ -90,7 +92,22 @@ struct cfdriver ser_cd = { #define splser() spl5() -int serstart(), serparam(), serintr(), serhwiflow(); +void serstart __P((struct tty *)); +int serparam __P((struct tty *, struct termios *)); +void serintr __P((int)); +int serhwiflow __P((struct tty *, int)); +int sermctl __P((dev_t dev, int, int)); +void ser_fastint __P((void)); +void sereint __P((int, int)); +static void ser_putchar __P((struct tty *, u_short)); +void ser_outintr __P((void)); +void sercnprobe __P((struct consdev *)); +void sercninit __P((struct consdev *)); +void serinit __P((int, int)); +int sercngetc __P((dev_t dev)); +void sercnputc __P((dev_t, int)); +void sercnpollc __P((dev_t, int)); + int ser_active; int ser_hasfifo; int nser = NSER; @@ -109,30 +126,6 @@ struct vbl_node ser_vbl_node[NSER]; struct tty ser_cons; struct tty *ser_tty[NSER]; -struct speedtab serspeedtab[] = { - 0, 0, - 50, SERBRD(50), - 75, SERBRD(75), - 110, SERBRD(110), - 134, SERBRD(134), - 150, SERBRD(150), - 200, SERBRD(200), - 300, SERBRD(300), - 600, SERBRD(600), - 1200, SERBRD(1200), - 1800, SERBRD(1800), - 2400, SERBRD(2400), - 4800, SERBRD(4800), - 9600, SERBRD(9600), - 19200, SERBRD(19200), - 38400, SERBRD(38400), - 57600, SERBRD(57600), - 76800, SERBRD(76800), - 115200, SERBRD(115200), - -1, -1 -}; - - /* * Since this UART is not particularly bright (to put it nicely), we'll * have to do parity stuff on our own. This table contains the 8th bit @@ -359,16 +352,11 @@ serclose(dev, flag, mode, p) if (dev != kgdb_dev) #endif custom.intena = INTF_RBF | INTF_TBE; /* disable interrups */ - custom.intreq = INTF_RBF | INTF_TBE; /* clear intr request */ + custom.intreq = INTF_RBF | INTF_TBE; /* clear int request */ - /* - * If the device is closed, it's close, no matter whether we deal with - * modem control signals nor not. - */ -#if 0 - if (tp->t_cflag & HUPCL || tp->t_state & TS_WOPEN || - (tp->t_state & TS_ISOPEN) == 0) -#endif + if ((tp->t_cflag & HUPCL) && + !(SWFLAGS(dev) & TIOCFLAG_SOFTCAR)) + /* XXX perhaps only clear DTR */ (void) sermctl(dev, 0, DMSET); ttyclose(tp); #if not_yet @@ -475,7 +463,7 @@ ser_fastint() } -int +void serintr(unit) int unit; { @@ -512,12 +500,14 @@ serintr(unit) log(LOG_WARNING, "ser0: %d ring buffer overflows.\n", ovfl); } + s2 = splser(); if (sbcnt == 0 && (tp->t_state & TS_TBLOCK) == 0) SETRTS(ciab.pra); /* start accepting data again */ + splx(s2); splx(s1); } -int +void sereint(unit, stat) int unit, stat; { @@ -702,13 +692,18 @@ serparam(tp, t) struct tty *tp; struct termios *t; { - int cfcr, cflag, unit, ospeed; + int cflag, unit, ospeed = 0; cflag = t->c_cflag; unit = SERUNIT(tp->t_dev); - ospeed = ttspeedtab(t->c_ospeed, serspeedtab); - if (ospeed < 0 || (t->c_ispeed && t->c_ispeed != t->c_ospeed)) + if (t->c_ospeed > 0) { + if (t->c_ospeed < 110) + return(EINVAL); + ospeed = SERBRD(t->c_ospeed); + } + + if (t->c_ispeed && t->c_ispeed != t->c_ospeed) return(EINVAL); /* @@ -724,7 +719,7 @@ serparam(tp, t) custom.intena = INTF_SETCLR | INTF_RBF | INTF_TBE; last_ciab_pra = ciab.pra; - if (ospeed == 0) + if (t->c_ospeed == 0) (void)sermctl(tp->t_dev, 0, DMSET); /* hang up line */ else { /* @@ -787,7 +782,6 @@ void ser_outintr() { struct tty *tp = ser_tty[0]; - u_short c; int s; tp = ser_tty[0]; @@ -826,7 +820,7 @@ out: splx(s); } -int +void serstart(tp) struct tty *tp; { @@ -894,6 +888,7 @@ out: int serstop(tp, flag) struct tty *tp; + int flag; { int s; @@ -903,6 +898,7 @@ serstop(tp, flag) tp->t_state |= TS_FLUSH; } splx(s); + return 0; } int @@ -911,7 +907,7 @@ sermctl(dev, bits, how) int bits, how; { int unit, s; - u_char ub; + u_char ub = 0; unit = SERUNIT(dev); @@ -977,7 +973,7 @@ sermctl(dev, bits, how) /* * Following are all routines needed for SER to act as console */ -int +void sercnprobe(cp) struct consdev *cp; { @@ -1005,6 +1001,7 @@ sercnprobe(cp) #endif } +void sercninit(cp) struct consdev *cp; { @@ -1017,6 +1014,7 @@ sercninit(cp) serconsinit = 1; } +void serinit(unit, rate) int unit, rate; { @@ -1026,11 +1024,13 @@ serinit(unit, rate) /* * might want to fiddle with the CIA later ??? */ - custom.serper = ttspeedtab(rate, serspeedtab); + custom.serper = (rate>=110 ? SERBRD(rate) : 0); splx(s); } +int sercngetc(dev) + dev_t dev; { u_short stat; int c, s; @@ -1053,12 +1053,12 @@ sercngetc(dev) /* * Console kernel output character routine. */ +void sercnputc(dev, c) dev_t dev; int c; { register int timo; - short stat; int s; s = splhigh(); diff --git a/sys/arch/amiga/dev/sfas.c b/sys/arch/amiga/dev/sfas.c index 06e483a5a04..644171be546 100644 --- a/sys/arch/amiga/dev/sfas.c +++ b/sys/arch/amiga/dev/sfas.c @@ -1,4 +1,6 @@ -/* $OpenBSD: sfas.c,v 1.4 1996/02/26 21:08:02 niklas Exp $ */ +/* $OpenBSD: sfas.c,v 1.5 1996/05/02 06:44:31 niklas Exp $ */ + +/* $NetBSD: sfas.c,v 1.9 1996/04/23 22:53:23 veego Exp $ */ /* * Copyright (c) 1995 Daniel Widenfalk @@ -67,16 +69,37 @@ void sfasinitialize __P((struct sfas_softc *)); void sfas_minphys __P((struct buf *bp)); int sfas_scsicmd __P((struct scsi_xfer *xs)); -int sfas_donextcmd __P((struct sfas_softc *dev, struct sfas_pending *pendp)); +void sfas_donextcmd __P((struct sfas_softc *dev, struct sfas_pending *pendp)); void sfas_scsidone __P((struct sfas_softc *dev, struct scsi_xfer *xs, int stat)); -void sfasintr __P((struct sfas_softc *dev)); -void sfasiwait __P((struct sfas_softc *dev)); -void sfasreset __P((struct sfas_softc *dev, int how)); -int sfasselect __P((struct sfas_softc *dev, struct sfas_pending *pendp, +void sfasiwait __P((struct sfas_softc *dev)); +void sfasreset __P((struct sfas_softc *dev, int how)); +int sfasselect __P((struct sfas_softc *dev, struct sfas_pending *pendp, unsigned char *cbuf, int clen, unsigned char *buf, int len, int mode)); -void sfasicmd __P((struct sfas_softc *dev, struct sfas_pending *pendp)); +void sfasicmd __P((struct sfas_softc *dev, struct sfas_pending *pendp)); +int sfas_postaction __P((struct sfas_softc *dev, sfas_regmap_p rp, + struct nexus *nexus)); +int sfas_midaction __P((struct sfas_softc *dev, sfas_regmap_p rp, + struct nexus *nexus)); +void sfas_init_nexus __P((struct sfas_softc *dev, struct nexus *nexus)); +int sfasgo __P((struct sfas_softc *dev, struct sfas_pending *pendp)); +void sfas_save_pointers __P((struct sfas_softc *dev)); +void sfas_restore_pointers __P((struct sfas_softc *dev)); +void sfas_ixfer __P((struct sfas_softc *dev)); +void sfas_build_sdtrm __P((struct sfas_softc *dev, int period, int offset)); +int sfas_select_unit __P((struct sfas_softc *dev, short target)); +struct nexus *sfas_arbitate_target __P((struct sfas_softc *dev, int target)); +void sfas_setup_nexus __P((struct sfas_softc *dev, struct nexus *nexus, + struct sfas_pending *pendp, unsigned char *cbuf, + int clen, unsigned char *buf, int len, int mode)); +void sfas_request_sense __P((struct sfas_softc *dev, struct nexus *nexus)); +int sfas_pretests __P((struct sfas_softc *dev, sfas_regmap_p rp)); +#ifdef SFAS_NEED_VM_PATCH +void sfas_unlink_vm_link __P((struct sfas_softc *dev)); +void sfas_link_vm_link __P((struct sfas_softc *dev, + struct vm_link_data *vm_link_data)); +#endif /* * Initialize these to make 'em patchable. Defaults to enable sync and discon. @@ -88,7 +111,7 @@ u_char sfas_inhibit_disc[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; #define QPRINTF(a) if (sfas_debug > 1) printf a int sfas_debug = 0; #else -#define QPRINTF +#define QPRINTF(a) #endif /* @@ -127,7 +150,6 @@ void sfasinitialize(dev) struct sfas_softc *dev; { - sfas_regmap_p rp; u_int *pte, page; int i; u_int inhibit_sync; @@ -226,7 +248,7 @@ sfasinitialize(dev) *pte = PG_V | PG_RW | PG_CI | page; TBIAS(); - printf(": dmabuf 0x%x", dev->sc_bump_pa); + printf(": dmabuf 0x%lx", dev->sc_bump_pa); /* * FIX @@ -251,7 +273,7 @@ sfasinitialize(dev) * to us during interrupt time. */ offset = (vm_offset_t)dev->sc_vm_link - VM_MIN_KERNEL_ADDRESS; - printf(" vmlnk %x", dev->sc_vm_link); + printf(" vmlnk %p", dev->sc_vm_link); vm_object_reference(kernel_object); vm_map_insert(kernel_map, kernel_object, offset, (vm_offset_t)dev->sc_vm_link, @@ -296,7 +318,7 @@ sfas_link_vm_link(dev, vm_link_data) if (vm_link_data->pages) { for(i=0; i<vm_link_data->pages; i++) - physaccess(dev->sc_vm_link+i*NBPG, vm_link_data->pa[i], + physaccess(dev->sc_vm_link+i*NBPG, (caddr_t)vm_link_data->pa[i], NBPG, PG_CI); dev->sc_flags |= SFAS_HAS_VM_LINK; @@ -314,9 +336,6 @@ sfas_scsicmd(struct scsi_xfer *xs) struct scsi_link *slp; struct sfas_pending *pendp; int flags, s, target; -#ifdef SFAS_NEED_VM_PATCH - struct vm_link_data vm_link_data; -#endif slp = xs->sc_link; dev = slp->adapter_softc; @@ -365,7 +384,7 @@ sfas_scsicmd(struct scsi_xfer *xs) sva)/NBPG; for(n=0; n<pendp->vm_link_data.pages; n++) - pendp->vm_link_data.pa[n] = kvtop(sva + n*NBPG); + pendp->vm_link_data.pa[n] = kvtop((caddr_t)(sva + n*NBPG)); } #endif @@ -384,7 +403,7 @@ sfas_scsicmd(struct scsi_xfer *xs) /* * Actually select the unit, whereby the whole scsi-process is started. */ -int +void sfas_donextcmd(dev, pendp) struct sfas_softc *dev; struct sfas_pending *pendp; @@ -810,7 +829,7 @@ sfas_setup_nexus(dev, nexus, pendp, cbuf, clen, buf, len, mode) int len; int mode; { - char sync, target, lun; + int sync, target, lun; target = pendp->xs->sc_link->target; lun = pendp->xs->sc_link->lun; @@ -957,7 +976,7 @@ sfas_request_sense(dev, nexus) struct scsi_xfer *xs; struct sfas_pending pend; struct scsi_sense rqs; - int stat, mode; + int mode; xs = nexus->xs; @@ -1393,7 +1412,7 @@ sfas_postaction(dev, rp, nexus) sfas_regmap_p rp; struct nexus *nexus; { - int i, left, len; + int i, len; u_char cmd; short offset, period; @@ -1724,7 +1743,6 @@ sfasintr(dev) { sfas_regmap_p rp; struct nexus *nexus; - int s; rp = dev->sc_fas; diff --git a/sys/arch/amiga/dev/sfasreg.h b/sys/arch/amiga/dev/sfasreg.h index 04238cf4b14..15d72be89ca 100644 --- a/sys/arch/amiga/dev/sfasreg.h +++ b/sys/arch/amiga/dev/sfasreg.h @@ -1,3 +1,6 @@ +/* $OpenBSD: sfasreg.h,v 1.2 1996/05/02 06:44:32 niklas Exp $ */ +/* $NetBSD: sfasreg.h,v 1.2 1996/04/21 21:12:31 veego Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * diff --git a/sys/arch/amiga/dev/sfasvar.h b/sys/arch/amiga/dev/sfasvar.h index 8eb5e6a87bd..05cfe88d74e 100644 --- a/sys/arch/amiga/dev/sfasvar.h +++ b/sys/arch/amiga/dev/sfasvar.h @@ -1,3 +1,6 @@ +/* $OpenBSD: sfasvar.h,v 1.2 1996/05/02 06:44:33 niklas Exp $ */ +/* $NetBSD: sfasvar.h,v 1.4 1996/04/21 21:12:33 veego Exp $ */ + /* * Copyright (c) 1995 Daniel Widenfalk * @@ -200,13 +203,20 @@ struct sfas_softc { u_char sc_config_flags; /* Generic DMA functions */ - int (*sc_setup_dma)(); - int (*sc_build_dma_chain)(); - int (*sc_need_bump)(); + int (*sc_setup_dma) + __P((struct sfas_softc *sc, + vm_offset_t ptr, int len, int mode)); + int (*sc_build_dma_chain) + __P((struct sfas_softc *sc, + struct sfas_dma_chain *chain, + void *p, int l)); + int (*sc_need_bump) + __P((struct sfas_softc *sc, + vm_offset_t ptr, int len)); /* Generic Led data */ int sc_led_status; - void (*sc_led)(); + void (*sc_led) __P((struct sfas_softc *sc, int mode)); /* Nexus list */ struct nexus sc_nexus[8]; @@ -291,5 +301,6 @@ struct sfas_softc { void sfasinitialize __P((struct sfas_softc *sc)); void sfas_minphys __P((struct buf *bp)); int sfas_scsicmd __P((struct scsi_xfer *)); +void sfasintr __P((struct sfas_softc *dev)); #endif /* _SFASVAR_H_ */ diff --git a/sys/arch/amiga/dev/siop.c b/sys/arch/amiga/dev/siop.c index cd95eeef8fa..fa6348db5e8 100644 --- a/sys/arch/amiga/dev/siop.c +++ b/sys/arch/amiga/dev/siop.c @@ -1,5 +1,5 @@ -/* $OpenBSD: siop.c,v 1.6 1996/03/30 22:18:23 niklas Exp $ */ -/* $NetBSD: siop.c,v 1.29 1996/03/15 22:11:15 mhitch Exp $ */ +/* $OpenBSD: siop.c,v 1.7 1996/05/02 06:44:34 niklas Exp $ */ +/* $NetBSD: siop.c,v 1.32 1996/04/28 06:28:24 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -59,8 +59,6 @@ #include <amiga/dev/siopreg.h> #include <amiga/dev/siopvar.h> -extern u_int kvtop(); - /* * SCSI delays * In u-seconds, primarily for state changes on the SPC. @@ -73,12 +71,16 @@ void siop_select __P((struct siop_softc *)); void siopabort __P((struct siop_softc *, siop_regmap_p, char *)); void sioperror __P((struct siop_softc *, siop_regmap_p, u_char)); void siopstart __P((struct siop_softc *)); +int siop_checkintr __P((struct siop_softc *, u_char, u_char, u_char, int *)); void siopreset __P((struct siop_softc *)); void siopsetdelay __P((int)); void siop_scsidone __P((struct siop_acb *, int)); void siop_sched __P((struct siop_softc *)); int siop_poll __P((struct siop_softc *, struct siop_acb *)); -int siopintr __P((struct siop_softc *)); +void siopintr __P((struct siop_softc *)); +void scsi_period_to_siop __P((struct siop_softc *, int)); +void siop_start __P((struct siop_softc *, int, int, u_char *, int, u_char *, int)); +void siop_dump_acb __P((struct siop_acb *)); /* 53C710 script */ const @@ -189,7 +191,7 @@ siop_scsicmd(xs) struct siop_acb *acb; struct siop_softc *sc; struct scsi_link *slp; - int flags, s, i; + int flags, s; slp = xs->sc_link; sc = slp->adapter_softc; @@ -264,7 +266,7 @@ siop_poll(sc, acb) (SIOP_ISTAT_SIP | SIOP_ISTAT_DIP)) == 0) { if (--i <= 0) { #ifdef DEBUG - printf ("waiting: tgt %d cmd %02x sbcl %02x dsp %x (+%x) dcmd %x ds %x timeout %d\n", + printf ("waiting: tgt %d cmd %02x sbcl %02x dsp %lx (+%lx) dcmd %lx ds %p timeout %d\n", xs->sc_link->target, acb->cmd.opcode, rp->siop_sbcl, rp->siop_dsp, rp->siop_dsp - sc->sc_scriptspa, @@ -308,11 +310,11 @@ siop_sched(sc) { struct scsi_link *slp; struct siop_acb *acb; - int stat, i; + int i; #ifdef DEBUG if (sc->sc_nexus) { - printf("%s: siop_sched- nexus %x/%d ready %x/%d\n", + printf("%s: siop_sched- nexus %p/%d ready %p/%d\n", sc->sc_dev.dv_xname, sc->sc_nexus, sc->sc_nexus->xs->sc_link->target, sc->ready_list.tqh_first, @@ -361,16 +363,17 @@ siop_scsidone(acb, stat) struct scsi_xfer *xs; struct scsi_link *slp; struct siop_softc *sc; - int s, dosched = 0; + int dosched = 0; -#ifdef DIAGNOSTIC if (acb == NULL || (xs = acb->xs) == NULL) { -/* panic("siop_scsidone"); */ - printf("siop_scsidone: sc_nexus NULL\n"); +#ifdef DIAGNOSTIC + printf("siop_scsidone: NULL acb or scsi_xfer\n"); +#if defined(DEBUG) && defined(DDB) Debugger(); +#endif +#endif return; } -#endif slp = xs->sc_link; sc = slp->adapter_softc; /* @@ -481,7 +484,9 @@ siopabort(sc, rp, where) siop_regmap_p rp; char *where; { +#ifdef fix_this int i; +#endif printf ("%s: abort %s: dstat %02x, sstat0 %02x sbcl %02x\n", sc->sc_dev.dv_xname, @@ -542,7 +547,7 @@ siopinitialize(sc) * Also should verify that dev doesn't span non-contiguous * physical pages. */ - sc->sc_scriptspa = kvtop(scripts); + sc->sc_scriptspa = kvtop((caddr_t)scripts); /* * malloc sc_acb to ensure that DS is on a long word boundary. @@ -668,7 +673,7 @@ siopreset(sc) sc->sc_nexus->xs->error = XS_DRIVER_STUFFUP; siop_scsidone(sc->sc_nexus, sc->sc_nexus->stat[0]); } - while (acb = sc->nexus_list.tqh_first) { + while ((acb = sc->nexus_list.tqh_first) > 0) { acb->xs->error = XS_DRIVER_STUFFUP; siop_scsidone(acb, acb->stat[0]); } @@ -700,15 +705,17 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) int len; { siop_regmap_p rp = sc->sc_siopp; - int i; int nchain; int count, tcount; char *addr, *dmaend; struct siop_acb *acb = sc->sc_nexus; +#ifdef DEBUG + int i; +#endif #ifdef DEBUG if (siop_debug & 0x100 && rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy: rp %x script %x dsa %x active %d\n", + printf ("ACK! siop was busy: rp %p script %p dsa %p active %ld\n", rp, &scripts, &acb->ds, sc->sc_active); printf ("istat %02x sfbr %02x lcrc %02x sien %02x dien %02x\n", rp->siop_istat, rp->siop_sfbr, rp->siop_lcrc, @@ -813,20 +820,20 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) if (nchain != 1 && len != 0 && siop_debug & 3) { printf ("DMA chaining set: %d\n", nchain); for (i = 0; i < nchain; ++i) { - printf (" [%d] %8x %4x\n", i, acb->ds.chain[i].databuf, + printf (" [%d] %8p %lx\n", i, acb->ds.chain[i].databuf, acb->ds.chain[i].datalen); } } #endif /* push data cache for all data the 53c710 needs to access */ - dma_cachectl (acb, sizeof (struct siop_acb)); + dma_cachectl ((caddr_t)acb, sizeof (struct siop_acb)); dma_cachectl (cbuf, clen); if (buf != NULL && len != 0) dma_cachectl (buf, len); #ifdef DEBUG if (siop_debug & 0x100 && rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy at start: rp %x script %x dsa %x active %d\n", + printf ("ACK! siop was busy at start: rp %p script %p dsa %p active %ld\n", rp, &scripts, &acb->ds, sc->sc_active); #ifdef DDB /*Debugger();*/ @@ -839,7 +846,7 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) sc->sc_dev.dv_xname); rp->siop_temp = 0; rp->siop_sbcl = sc->sc_sync[target].sbcl; - rp->siop_dsa = kvtop(&acb->ds); + rp->siop_dsa = kvtop((caddr_t)&acb->ds); rp->siop_dsp = sc->sc_scriptspa; SIOP_TRACE('s',1,0,0) } else { @@ -870,7 +877,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) { siop_regmap_p rp = sc->sc_siopp; struct siop_acb *acb = sc->sc_nexus; - int target; + int target = 0; int dfifo, dbc, sstat1; dfifo = rp->siop_dfifo; @@ -894,21 +901,23 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif if (rp->siop_dsp && (rp->siop_dsp < sc->sc_scriptspa || rp->siop_dsp >= sc->sc_scriptspa + sizeof(scripts))) { - printf ("%s: dsp not within script dsp %x scripts %x:%x", + printf ("%s: dsp not within script dsp %lx scripts %lx:%lx", sc->sc_dev.dv_xname, rp->siop_dsp, sc->sc_scriptspa, sc->sc_scriptspa + sizeof(scripts)); printf(" istat %x dstat %x sstat0 %x\n", istat, dstat, sstat0); +#ifdef DDB Debugger(); +#endif } #endif SIOP_TRACE('i',dstat,istat,(istat&SIOP_ISTAT_DIP)?rp->siop_dsps&0xff:sstat0); if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff00) { /* Normal completion status, or check condition */ #ifdef DEBUG - if (rp->siop_dsa != kvtop(&acb->ds)) { - printf ("siop: invalid dsa: %x %x\n", rp->siop_dsa, - kvtop(&acb->ds)); + if (rp->siop_dsa != kvtop((caddr_t)&acb->ds)) { + printf ("siop: invalid dsa: %lx %x\n", rp->siop_dsa, + kvtop((caddr_t)&acb->ds)); panic("*** siop DSA invalid ***"); } #endif @@ -998,31 +1007,31 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #ifdef DEBUG if (siop_debug & 0x100) { int i; - printf ("Phase mismatch: curbuf %x curlen %x dfifo %x dbc %x sstat1 %x adjust %x sbcl %x starts %d acb %x\n", + printf ("Phase mismatch: curbuf %lx curlen %lx dfifo %x dbc %x sstat1 %x adjust %x sbcl %x starts %d acb %p\n", acb->iob_curbuf, acb->iob_curlen, dfifo, dbc, sstat1, adjust, rp->siop_sbcl, siopstarts, acb); if (acb->ds.chain[1].datalen) { for (i = 0; acb->ds.chain[i].datalen; ++i) - printf("chain[%d] addr %x len %x\n", + printf("chain[%d] addr %p len %lx\n", i, acb->ds.chain[i].databuf, acb->ds.chain[i].datalen); } } #endif - dma_cachectl (acb, sizeof(*acb)); + dma_cachectl ((caddr_t)acb, sizeof(*acb)); } #ifdef DEBUG SIOP_TRACE('m',rp->siop_sbcl,(rp->siop_dsp>>8),rp->siop_dsp); if (siop_debug & 9) - printf ("Phase mismatch: %x dsp +%x dcmd %x\n", + printf ("Phase mismatch: %x dsp +%lx dcmd %lx\n", rp->siop_sbcl, rp->siop_dsp - sc->sc_scriptspa, *((long *)&rp->siop_dcmd)); #endif if ((rp->siop_sbcl & SIOP_REQ) == 0) { - printf ("Phase mismatch: REQ not asserted! %02x dsp %x\n", + printf ("Phase mismatch: REQ not asserted! %02x dsp %lx\n", rp->siop_sbcl, rp->siop_dsp); -#ifdef DEBUG +#if defined(DEBUG) && defined(DDB) Debugger(); #endif } @@ -1046,7 +1055,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) printf("%s: Select timeout with no active command?\n", sc->sc_dev.dv_xname); if (rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy at timeout: rp %x script %x dsa %x\n", + printf ("ACK! siop was busy at timeout: rp %p script %p dsa %p\n", rp, &scripts, &acb->ds); printf(" sbcl %x sdid %x istat %x dstat %x sstat0 %x\n", rp->siop_sbcl, rp->siop_sdid, istat, dstat, sstat0); @@ -1096,7 +1105,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) rp->siop_dsps == 0xff02)) { #ifdef DEBUG if (siop_debug & 0x100) - printf ("%s: ID %02x disconnected TEMP %x (+%x) curbuf %x curlen %x buf %x len %x dfifo %x dbc %x sstat1 %x starts %d acb %x\n", + printf ("%s: ID %02x disconnected TEMP %lx (+%lx) curbuf %lx curlen %lx buf %p len %lx dfifo %x dbc %x sstat1 %x starts %d acb %p\n", sc->sc_dev.dv_xname, 1 << target, rp->siop_temp, rp->siop_temp ? rp->siop_temp - sc->sc_scriptspa : 0, acb->iob_curbuf, acb->iob_curlen, @@ -1119,7 +1128,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) int n = rp->siop_temp - sc->sc_scriptspa; if (acb->iob_curlen && acb->iob_curlen != acb->ds.chain[0].datalen) - printf("%s: iob_curbuf/len already set? n %x iob %x/%x chain[0] %x/%x\n", + printf("%s: iob_curbuf/len already set? n %x iob %lx/%lx chain[0] %p/%lx\n", sc->sc_dev.dv_xname, n, acb->iob_curbuf, acb->iob_curlen, acb->ds.chain[0].databuf, acb->ds.chain[0].datalen); if (n < Ent_datain) @@ -1135,7 +1144,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #ifdef DEBUG if (siop_debug & 0x100) { printf("%s: TEMP offset %d", sc->sc_dev.dv_xname, n); - printf(" curbuf %x curlen %x\n", acb->iob_curbuf, + printf(" curbuf %lx curlen %lx\n", acb->iob_curbuf, acb->iob_curlen); } #endif @@ -1168,7 +1177,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) } if (i >= DMAMAXIO || acb->ds.chain[i].datalen == 0) { printf("couldn't find saved data pointer: "); - printf("curbuf %x curlen %x i %d\n", + printf("curbuf %lx curlen %lx i %d\n", acb->iob_curbuf, acb->iob_curlen, i); #ifdef DDB Debugger(); @@ -1176,7 +1185,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) } #ifdef DEBUG if (siop_debug & 0x100) - printf(" chain[0]: %x/%x -> %x/%x\n", + printf(" chain[0]: %p/%lx -> %lx/%lx\n", acb->ds.chain[0].databuf, acb->ds.chain[0].datalen, acb->iob_curbuf, @@ -1187,7 +1196,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) for (j = 1, ++i; i < DMAMAXIO && acb->ds.chain[i].datalen; ++i, ++j) { #ifdef DEBUG if (siop_debug & 0x100) - printf(" chain[%d]: %x/%x -> %x/%x\n", j, + printf(" chain[%d]: %p/%lx -> %p/%lx\n", j, acb->ds.chain[j].databuf, acb->ds.chain[j].datalen, acb->ds.chain[i].databuf, @@ -1198,7 +1207,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) } if (j < DMAMAXIO) acb->ds.chain[j].datalen = 0; - DCIAS(kvtop(&acb->ds.chain)); + DCIAS(kvtop((caddr_t)&acb->ds.chain)); } ++sc->sc_tinfo[target].dconns; /* @@ -1224,7 +1233,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) sc->sc_sstat1 = rp->siop_sbcl; /* XXXX save current SBCL */ #ifdef DEBUG if (siop_debug & 0x100) - printf ("%s: target ID %02x reselected dsps %x\n", + printf ("%s: target ID %02x reselected dsps %lx\n", sc->sc_dev.dv_xname, reselid, rp->siop_dsps); if ((rp->siop_sfbr & 0x80) == 0) @@ -1256,27 +1265,27 @@ siop_checkintr(sc, istat, dstat, sstat0, status) sc->sc_flags |= acb->status; acb->status = 0; DCIAS(kvtop(&acb->stat[0])); - rp->siop_dsa = kvtop(&acb->ds); + rp->siop_dsa = kvtop((caddr_t)&acb->ds); rp->siop_sxfer = sc->sc_sync[acb->xs->sc_link->target].sxfer; rp->siop_sbcl = sc->sc_sync[acb->xs->sc_link->target].sbcl; break; } if (acb == NULL) { - printf("%s: target ID %02x reselect nexus_list %x\n", + printf("%s: target ID %02x reselect nexus_list %p\n", sc->sc_dev.dv_xname, reselid, sc->nexus_list.tqh_first); panic("unable to find reselecting device"); } - dma_cachectl (acb, sizeof(*acb)); + dma_cachectl ((caddr_t)acb, sizeof(*acb)); rp->siop_temp = 0; rp->siop_dcntl |= SIOP_DCNTL_STD; return (0); } if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff04) { +#ifdef DEBUG u_short ctest2 = rp->siop_ctest2; /* reselect was interrupted (by Sig_P or select) */ -#ifdef DEBUG if (siop_debug & 0x100 || (ctest2 & SIOP_CTEST2_SIGP) == 0) printf ("%s: reselect interrupted (Sig_P?) scntl1 %x ctest2 %x sfbr %x istat %x/%x\n", @@ -1285,6 +1294,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif /* XXX assumes it was not select */ if (sc->sc_nexus == NULL) { +#ifdef DEBUG printf("%s: reselect interrupted, sc_nexus == NULL\n", sc->sc_dev.dv_xname); #if 0 @@ -1293,12 +1303,13 @@ siop_checkintr(sc, istat, dstat, sstat0, status) Debugger(); #endif #endif +#endif rp->siop_dcntl |= SIOP_DCNTL_STD; return(0); } target = sc->sc_nexus->xs->sc_link->target; rp->siop_temp = 0; - rp->siop_dsa = kvtop(&sc->sc_nexus->ds); + rp->siop_dsa = kvtop((caddr_t)&sc->sc_nexus->ds); rp->siop_sxfer = sc->sc_sync[target].sxfer; rp->siop_sbcl = sc->sc_sync[target].sbcl; rp->siop_dsp = sc->sc_scriptspa; @@ -1330,7 +1341,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) if (sstat0 == 0 && dstat & SIOP_DSTAT_SIR) { dma_cachectl (&acb->stat[0], 1); dma_cachectl (&acb->msg[0], 1); - printf ("SIOP interrupt: %x sts %x msg %x %x sbcl %x\n", + printf ("SIOP interrupt: %lx sts %x msg %x %x sbcl %x\n", rp->siop_dsps, acb->stat[0], acb->msg[0], acb->msg[1], rp->siop_sbcl); siopreset (sc); @@ -1350,11 +1361,11 @@ bad_phase: * then panics. * XXXX need to clean this up to print out the info, reset, and continue */ - printf ("siopchkintr: target %x ds %x\n", target, &acb->ds); - printf ("scripts %x ds %x rp %x dsp %x dcmd %x\n", sc->sc_scriptspa, - kvtop(&acb->ds), kvtop(rp), rp->siop_dsp, + printf ("siopchkintr: target %x ds %p\n", target, &acb->ds); + printf ("scripts %lx ds %x rp %x dsp %lx dcmd %lx\n", sc->sc_scriptspa, + kvtop((caddr_t)&acb->ds), kvtop((caddr_t)rp), rp->siop_dsp, *((long *)&rp->siop_dcmd)); - printf ("siopchkintr: istat %x dstat %x sstat0 %x dsps %x dsa %x sbcl %x sts %x msg %x %x sfbr %x\n", + printf ("siopchkintr: istat %x dstat %x sstat0 %x dsps %lx dsa %lx sbcl %x sts %x msg %x %x sfbr %x\n", istat, dstat, sstat0, rp->siop_dsps, rp->siop_dsa, rp->siop_sbcl, acb->stat[0], acb->msg[0], acb->msg[1], rp->siop_sfbr); #ifdef DEBUG @@ -1400,13 +1411,13 @@ siop_select(sc) } #ifdef DEBUG if (siop_debug & 1) - printf ("siop_select: target %x cmd %02x ds %x\n", + printf ("siop_select: target %x cmd %02x ds %p\n", acb->xs->sc_link->target, acb->cmd.opcode, &sc->sc_nexus->ds); #endif siop_start(sc, acb->xs->sc_link->target, acb->xs->sc_link->lun, - &acb->cmd, acb->clen, acb->daddr, acb->dleft); + (u_char *)&acb->cmd, acb->clen, acb->daddr, acb->dleft); return; } @@ -1415,7 +1426,7 @@ siop_select(sc) * 53C710 interrupt handler */ -int +void siopintr (sc) register struct siop_softc *sc; { @@ -1442,7 +1453,7 @@ siopintr (sc) printf ("%s: intr istat %x dstat %x sstat0 %x\n", sc->sc_dev.dv_xname, istat, dstat, sstat0); if (!sc->sc_active) { - printf ("%s: spurious interrupt? istat %x dstat %x sstat0 %x nexus %x status %x\n", + printf ("%s: spurious interrupt? istat %x dstat %x sstat0 %x nexus %p status %x\n", sc->sc_dev.dv_xname, istat, dstat, sstat0, sc->sc_nexus, sc->sc_nexus ? sc->sc_nexus->stat[0] : 0); } @@ -1451,7 +1462,7 @@ siopintr (sc) #ifdef DEBUG if (siop_debug & 5) { DCIAS(kvtop(&sc->sc_nexus->stat[0])); - printf ("%s: intr istat %x dstat %x sstat0 %x dsps %x sbcl %x sts %x msg %x\n", + printf ("%s: intr istat %x dstat %x sstat0 %x dsps %lx sbcl %x sts %x msg %x\n", sc->sc_dev.dv_xname, istat, dstat, sstat0, rp->siop_dsps, rp->siop_sbcl, sc->sc_nexus->stat[0], sc->sc_nexus->msg[0]); @@ -1490,10 +1501,15 @@ siopintr (sc) * not be correct for other 53c710 boards. * */ +void scsi_period_to_siop (sc, target) struct siop_softc *sc; + int target; { - int period, offset, i, sxfer, sbcl; + int period, offset, sxfer, sbcl = 0; +#ifdef DEBUG_SYNC + int i; +#endif period = sc->sc_nexus->msg[4]; offset = sc->sc_nexus->msg[5]; @@ -1564,7 +1580,7 @@ siop_dump_acb(acb) u_char *b = (u_char *) &acb->cmd; int i; - printf("acb@%x ", acb); + printf("acb@%p ", acb); if (acb->xs == NULL) { printf("<unused>\n"); return; @@ -1574,10 +1590,10 @@ siop_dump_acb(acb) for (i = acb->clen; i; --i) printf(" %02x", *b++); printf("\n"); - printf(" xs: %08x data %8x:%04x ", acb->xs, acb->xs->data, + printf(" xs: %p data %p:%04x ", acb->xs, acb->xs->data, acb->xs->datalen); - printf("va %8x:%04x ", acb->iob_buf, acb->iob_len); - printf("cur %8x:%04x\n", acb->iob_curbuf, acb->iob_curlen); + printf("va %p:%lx ", acb->iob_buf, acb->iob_len); + printf("cur %lx:%lx\n", acb->iob_curbuf, acb->iob_curlen); } void @@ -1593,23 +1609,23 @@ siop_dump(sc) #if SIOP_TRACE_SIZE siop_dump_trace(); #endif - printf("%s@%x regs %x istat %x\n", + printf("%s@%p regs %p istat %x\n", sc->sc_dev.dv_xname, sc, rp, rp->siop_istat); - if (acb = sc->free_list.tqh_first) { + if ((acb = sc->free_list.tqh_first) > 0) { printf("Free list:\n"); while (acb) { siop_dump_acb(acb); acb = acb->chain.tqe_next; } } - if (acb = sc->ready_list.tqh_first) { + if ((acb = sc->ready_list.tqh_first) > 0) { printf("Ready list:\n"); while (acb) { siop_dump_acb(acb); acb = acb->chain.tqe_next; } } - if (acb = sc->nexus_list.tqh_first) { + if ((acb = sc->nexus_list.tqh_first) > 0) { printf("Nexus list:\n"); while (acb) { siop_dump_acb(acb); diff --git a/sys/arch/amiga/dev/siopreg.h b/sys/arch/amiga/dev/siopreg.h index 0a083589384..57dfa43d3e9 100644 --- a/sys/arch/amiga/dev/siopreg.h +++ b/sys/arch/amiga/dev/siopreg.h @@ -1,4 +1,5 @@ -/* $NetBSD: siopreg.h,v 1.7 1995/08/18 15:28:13 chopps Exp $ */ +/* $OpenBSD: siopreg.h,v 1.2 1996/05/02 06:44:35 niklas Exp $ */ +/* $NetBSD: siopreg.h,v 1.8 1996/04/21 21:12:37 veego Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -289,7 +290,7 @@ typedef volatile siop_regmap_t *siop_regmap_p; #define SIOP_ISTAT_SIP 0x02 /* SCSI Interrupt pending */ #define SIOP_ISTAT_DIP 0x01 /* DMA Interrupt pending */ -/* Chip test register 8 (ctest8) +/* Chip test register 8 (ctest8) */ #define SIOP_CTEST8_V 0xf0 /* Chip revision level */ #define SIOP_CTEST8_FLF 0x08 /* Flush DMA FIFO */ diff --git a/sys/arch/amiga/dev/siopvar.h b/sys/arch/amiga/dev/siopvar.h index b4c55e4e84a..40ccd69a11d 100644 --- a/sys/arch/amiga/dev/siopvar.h +++ b/sys/arch/amiga/dev/siopvar.h @@ -1,4 +1,5 @@ -/* $NetBSD: siopvar.h,v 1.12 1995/09/16 16:11:31 chopps Exp $ */ +/* $OpenBSD: siopvar.h,v 1.3 1996/05/02 06:44:36 niklas Exp $ */ +/* $NetBSD: siopvar.h,v 1.14 1996/04/21 21:12:38 veego Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -197,5 +198,10 @@ struct siop_softc { void siop_minphys __P((struct buf *bp)); int siop_scsicmd __P((struct scsi_xfer *)); +void siopinitialize __P((struct siop_softc *)); +void siopintr __P((struct siop_softc *)); +#ifdef DEBUG +void siop_dump __P((struct siop_softc *)); +#endif #endif /* _SIOPVAR_H */ diff --git a/sys/arch/amiga/dev/view.c b/sys/arch/amiga/dev/view.c index ee216071d75..f6a00f1e9be 100644 --- a/sys/arch/amiga/dev/view.c +++ b/sys/arch/amiga/dev/view.c @@ -1,4 +1,5 @@ -/* $NetBSD: view.c,v 1.12 1995/04/10 09:12:46 mycroft Exp $ */ +/* $OpenBSD: view.c,v 1.2 1996/05/02 06:44:36 niklas Exp $ */ +/* $NetBSD: view.c,v 1.13 1996/04/21 21:12:39 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -38,6 +39,7 @@ * a interface to graphics. */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/proc.h> #include <sys/ioctl.h> #include <sys/file.h> @@ -48,21 +50,20 @@ #include <amiga/dev/grfabs_reg.h> #include <amiga/dev/viewioctl.h> #include <amiga/dev/viewvar.h> + +#include <sys/conf.h> +#include <machine/conf.h> + #include "view.h" static void view_display __P((struct view_softc *)); static void view_remove __P((struct view_softc *)); static int view_setsize __P((struct view_softc *, struct view_size *)); -void viewclose __P((dev_t, int)); -int viewioctl __P((dev_t, u_long, caddr_t, int, struct proc *)); -int viewopen __P((dev_t, int)); -int viewmmap __P((dev_t, int, int)); - int view_get_colormap __P((struct view_softc *, colormap_t *)); int view_set_colormap __P((struct view_softc *, colormap_t *)); -int viewprobe (); +void viewattach __P((int)); struct view_softc views[NVIEW]; int view_inited; /* also checked in ite_cc.c */ @@ -77,6 +78,7 @@ int view_default_depth = 2; * functions for probeing. */ +void viewattach(cnt) int cnt; { @@ -85,12 +87,13 @@ viewattach(cnt) } /* this function is called early to set up a display. */ +void viewprobe() { int i; if (view_inited) - return(1); + return; view_inited = 1; @@ -98,7 +101,7 @@ viewprobe() views[i].view = NULL; views[i].flags = 0; } - return(1); + return; } @@ -225,9 +228,10 @@ view_setsize(vu, vs) /*ARGSUSED*/ int -viewopen(dev, flags) +viewopen(dev, flags, mode, p) dev_t dev; - int flags; + int flags, mode; + struct proc *p; { dimen_t size; struct view_softc *vu; @@ -262,23 +266,25 @@ viewopen(dev, flags) } /*ARGSUSED*/ -void -viewclose (dev, flags) +int +viewclose (dev, flags, mode, p) dev_t dev; - int flags; + int flags, mode; + struct proc *p; { struct view_softc *vu; vu = &views[minor(dev)]; if ((vu->flags & VUF_OPEN) == 0) - return; + return(0); view_remove (vu); grf_free_view (vu->view); vu->flags = 0; vu->view = NULL; vu->mode = NULL; vu->monitor = NULL; + return(0); } @@ -292,7 +298,6 @@ viewioctl (dev, cmd, data, flag, p) struct proc *p; { struct view_softc *vu; - colormap_t *cm; bmap_t *bm; int error; @@ -315,7 +320,7 @@ viewioctl (dev, cmd, data, flag, p) case VIOCGBMAP: bm = (bmap_t *)data; bcopy(vu->view->bitmap, bm, sizeof(bmap_t)); - if ((int)p != -1) { + if (flag != -1) { bm->plane = 0; bm->blit_temp = 0; bm->hardware_address = 0; @@ -408,9 +413,10 @@ viewmmap(dev, off, prot) /*ARGSUSED*/ int -viewselect(dev, rw) +viewselect(dev, rw, p) dev_t dev; int rw; + struct proc *p; { if (rw == FREAD) return(0); diff --git a/sys/arch/amiga/dev/viewioctl.h b/sys/arch/amiga/dev/viewioctl.h index ab33c162e88..ca88ef965c8 100644 --- a/sys/arch/amiga/dev/viewioctl.h +++ b/sys/arch/amiga/dev/viewioctl.h @@ -1,4 +1,5 @@ -/* $NetBSD: viewioctl.h,v 1.5 1994/10/26 02:05:07 cgd Exp $ */ +/* $OpenBSD: viewioctl.h,v 1.2 1996/05/02 06:44:37 niklas Exp $ */ +/* $NetBSD: viewioctl.h,v 1.6 1996/04/21 21:12:40 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -55,3 +56,8 @@ struct view_size { #define VIOCSCMAP _IOW('V', 0x5, colormap_t) #define VIOCGCMAP _IOWR('V', 0x6, colormap_t) +#ifdef _KERNEL +int viewioctl __P((dev_t, u_long, caddr_t, int, struct proc *)); +void viewprobe __P((void)); +#endif + diff --git a/sys/arch/amiga/dev/wesc.c b/sys/arch/amiga/dev/wesc.c index f76ca1491fc..087bf5e0dd2 100644 --- a/sys/arch/amiga/dev/wesc.c +++ b/sys/arch/amiga/dev/wesc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: wesc.c,v 1.3 1996/04/21 22:15:47 deraadt Exp $ */ -/* $NetBSD: wesc.c,v 1.12 1996/03/17 01:17:55 thorpej Exp $ */ +/* $OpenBSD: wesc.c,v 1.4 1996/05/02 06:44:38 niklas Exp $ */ +/* $NetBSD: wesc.c,v 1.13 1996/04/21 21:12:42 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -54,7 +54,10 @@ int wescprint __P((void *auxp, char *)); void wescattach __P((struct device *, struct device *, void *)); int wescmatch __P((struct device *, void *, void *)); -int wesc_dmaintr __P((struct siop_softc *)); +int wesc_dmaintr __P((void *)); +#ifdef DEBUG +void wesc_dump __P((void)); +#endif struct scsi_adapter wesc_scsiswitch = { siop_scsicmd, @@ -90,7 +93,6 @@ wescmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -156,9 +158,10 @@ wescprint(auxp, pnp) int -wesc_dmaintr(sc) - struct siop_softc *sc; +wesc_dmaintr(arg) + void *arg; { + struct siop_softc *sc = arg; siop_regmap_p rp; u_char istat; diff --git a/sys/arch/amiga/dev/wstsc.c b/sys/arch/amiga/dev/wstsc.c index 760c4fb6613..6e63210e5a5 100644 --- a/sys/arch/amiga/dev/wstsc.c +++ b/sys/arch/amiga/dev/wstsc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: wstsc.c,v 1.2 1996/04/21 22:15:48 deraadt Exp $ */ -/* $NetBSD: wstsc.c,v 1.10 1996/03/17 01:17:56 thorpej Exp $ */ +/* $OpenBSD: wstsc.c,v 1.3 1996/05/02 06:44:39 niklas Exp $ */ +/* $NetBSD: wstsc.c,v 1.12 1996/04/28 06:49:35 mhitch Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -60,7 +60,7 @@ int wstsc_dma_xfer_in2 __P((struct sci_softc *dev, int len, register u_short *buf, int phase)); int wstsc_dma_xfer_out2 __P((struct sci_softc *dev, int len, register u_short *buf, int phase)); -int wstsc_intr __P((struct sci_softc *)); +int wstsc_intr __P((void *)); struct scsi_adapter wstsc_scsiswitch = { sci_scsicmd, @@ -76,10 +76,11 @@ struct scsi_device wstsc_scsidev = { NULL, /* Use default done routine */ }; -#define QPRINTF - #ifdef DEBUG extern int sci_debug; +#define QPRINTF(a) if (sci_debug > 1) printf a +#else +#define QPRINTF(a) #endif extern int sci_data_wait; @@ -102,7 +103,6 @@ wstscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -153,8 +153,8 @@ wstscattach(pdp, dp, auxp) sc->sci_irecv = rp + 14; if (supradma_pseudo == 2) { - sc->dma_xfer_in = wstsc_dma_xfer_in2; - sc->dma_xfer_out = wstsc_dma_xfer_out2; + sc->dma_xfer_in = (int(*)(struct sci_softc *, int, u_char *, int))wstsc_dma_xfer_in2; + sc->dma_xfer_out = (int(*)(struct sci_softc *, int, u_char *, int))wstsc_dma_xfer_out2; } else if (supradma_pseudo == 1) { sc->dma_xfer_in = wstsc_dma_xfer_in; @@ -202,10 +202,11 @@ wstsc_dma_xfer_in (dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char csr; - u_char *obp = (u_char *) buf; volatile register u_char *sci_dma = dev->sci_idata; volatile register u_char *sci_csr = dev->sci_csr; +#ifdef DEBUG + u_char *obp = (u_char *) buf; +#endif QPRINTF(("supradma_in %d, csr=%02x\n", len, *dev->sci_bus_csr)); @@ -288,8 +289,6 @@ wstsc_dma_xfer_out (dev, len, buf, phase) int phase; { int wait = sci_data_wait; - u_char csr; - u_char *obp = buf; volatile register u_char *sci_dma = dev->sci_data; volatile register u_char *sci_csr = dev->sci_csr; @@ -313,7 +312,7 @@ wstsc_dma_xfer_out (dev, len, buf, phase) #ifdef DEBUG if (sci_debug) printf("supradma_out fail: l%d i%x w%d\n", - len, csr, wait); + len, *dev->sci_bus_csr, wait); #endif *dev->sci_mode = 0; return 0; @@ -342,11 +341,14 @@ wstsc_dma_xfer_in2 (dev, len, buf, phase) register u_short *buf; int phase; { - int wait = sci_data_wait; - u_char csr; - u_char *obp = (u_char *) buf; volatile register u_short *sci_dma = (u_short *)(dev->sci_idata + 0x10); volatile register u_char *sci_csr = dev->sci_csr + 0x10; +#ifdef DEBUG + u_char *obp = (u_char *) buf; +#endif +#if 0 + int wait = sci_data_wait; +#endif QPRINTF(("supradma_in2 %d, csr=%02x\n", len, *dev->sci_bus_csr)); @@ -429,11 +431,14 @@ wstsc_dma_xfer_out2 (dev, len, buf, phase) register u_short *buf; int phase; { - int wait = sci_data_wait; - u_char csr; - u_char *obp = (u_char *) buf; volatile register u_short *sci_dma = (ushort *)(dev->sci_data + 0x10); volatile register u_char *sci_bus_csr = dev->sci_bus_csr; +#ifdef DEBUG + u_char *obp = (u_char *) buf; +#endif +#if 0 + int wait = sci_data_wait; +#endif QPRINTF(("supradma_out2 %d, csr=%02x\n", len, *dev->sci_bus_csr)); @@ -526,10 +531,10 @@ wstsc_dma_xfer_out2 (dev, len, buf, phase) } int -wstsc_intr(dev) - struct sci_softc *dev; +wstsc_intr(arg) + void *arg; { - int i, found; + struct sci_softc *dev = arg; u_char stat; if ((*(dev->sci_csr + 0x10) & SCI_CSR_INT) == 0) diff --git a/sys/arch/amiga/dev/zssc.c b/sys/arch/amiga/dev/zssc.c index b3fde4eb260..9ffdf9e9413 100644 --- a/sys/arch/amiga/dev/zssc.c +++ b/sys/arch/amiga/dev/zssc.c @@ -1,5 +1,5 @@ -/* $OpenBSD: zssc.c,v 1.6 1996/04/27 18:38:51 niklas Exp $ */ -/* $NetBSD: zssc.c,v 1.15 1996/03/17 01:18:00 thorpej Exp $ */ +/* $OpenBSD: zssc.c,v 1.7 1996/05/02 06:44:39 niklas Exp $ */ +/* $NetBSD: zssc.c,v 1.16 1996/04/21 21:12:45 veego Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -51,11 +51,13 @@ #include <amiga/dev/siopvar.h> #include <amiga/dev/zbusvar.h> -int zsscprint __P((void *auxp, char *)); +int zsscprint __P((void *auxp, char *)); void zsscattach __P((struct device *, struct device *, void *)); -int zsscmatch __P((struct device *, void *, void *)); -int siopintr __P((struct siop_softc *)); -int zssc_dmaintr __P((struct siop_softc *)); +int zsscmatch __P((struct device *, void *, void *)); +int zssc_dmaintr __P((void *)); +#ifdef DEBUG +void zssc_dump __P((void)); +#endif struct scsi_adapter zssc_scsiswitch = { siop_scsicmd, @@ -91,7 +93,6 @@ zsscmatch(pdp, match, auxp) struct device *pdp; void *match, *auxp; { - struct cfdata *cdp = match; struct zbus_args *zap; zap = auxp; @@ -170,9 +171,10 @@ zsscprint(auxp, pnp) */ int -zssc_dmaintr(sc) - struct siop_softc *sc; +zssc_dmaintr(arg) + void *arg; { + struct siop_softc *sc = arg; siop_regmap_p rp; int istat; diff --git a/sys/arch/amiga/include/conf.h b/sys/arch/amiga/include/conf.h new file mode 100644 index 00000000000..9aeacd83f46 --- /dev/null +++ b/sys/arch/amiga/include/conf.h @@ -0,0 +1,88 @@ +/* $OpenBSD: conf.h,v 1.1 1996/05/02 06:44:43 niklas Exp $ */ +/* $NetBSD: conf.h,v 1.1 1996/04/21 21:13:16 veego Exp $ */ + +/* + * Copyright (c) 1996 Bernd Ernesti. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bernd Ernesti. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define mmread mmrw +#define mmwrite mmrw +cdev_decl(mm); + +cdev_decl(ctty); + +bdev_decl(fd); +cdev_decl(fd); + +/* 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 } + +/* open, close, read, ioctl */ +#define cdev_ss_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ + (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ + (dev_type_stop((*))) enodev, 0, seltrue, \ + (dev_type_mmap((*))) enodev } + +cdev_decl(ms); + +cdev_decl(grf); + +cdev_decl(kbd); + +cdev_decl(ite); + +cdev_decl(par); + +cdev_decl(ser); + +cdev_decl(msc); + +cdev_decl(mfcs); + +cdev_decl(view); + +bdev_decl(sw); +cdev_decl(sw); diff --git a/sys/arch/amiga/include/cpu.h b/sys/arch/amiga/include/cpu.h index c500a5e565b..0af76a980da 100644 --- a/sys/arch/amiga/include/cpu.h +++ b/sys/arch/amiga/include/cpu.h @@ -1,5 +1,5 @@ -/* $OpenBSD: cpu.h,v 1.5 1996/04/21 22:15:55 deraadt Exp $ */ -/* $NetBSD: cpu.h,v 1.28 1996/03/30 16:22:55 is Exp $ */ +/* $OpenBSD: cpu.h,v 1.6 1996/05/02 06:44:44 niklas Exp $ */ +/* $NetBSD: cpu.h,v 1.31 1996/04/27 20:55:08 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -214,4 +214,100 @@ int machineid, mmutype, fputype; { "console_device", CTLTYPE_STRUCT }, \ } +#ifdef _KERNEL +/* + * Prototypes from amiga_init.c + */ +void *alloc_z2mem __P((long)); + +/* + * Prototypes from autoconf.c + */ +void configure __P((void)); +int is_a1200 __P((void)); +int is_a3000 __P((void)); +int is_a4000 __P((void)); + +/* + * Prototypes from clock.c + */ +u_long clkread __P((void)); + +/* + * Prototypes from locore.s + */ +struct fpframe; +struct user; +struct pcb; + +void clearseg __P((vm_offset_t)); +void doboot __P((void)) __attribute__((__noreturn__)); +u_long getdfc __P((void)); +u_long getsfc __P((void)); +void loadustp __P((int)); +#ifdef FPCOPROC +void m68881_save __P((struct fpframe *)); +void m68881_restore __P((struct fpframe *)); +#endif +void physcopyseg __P((vm_offset_t, vm_offset_t)); +u_int probeva __P((u_int, u_int)); +void proc_trampoline __P((void)); +void savectx __P((struct pcb *)); +void switch_exit __P((struct proc *)); +void DCIAS __P((vm_offset_t)); +void DCIS __P((void)); +void DCIU __P((void)); +void ICIA __P((void)); +void ICPA __P((void)); +void PCIA __P((void)); +void TBIA __P((void)); +void TBIS __P((vm_offset_t)); +void TBIAS __P((void)); +void TBIAU __P((void)); +#ifdef M68040 +void DCFA __P((void)); +void DCFP __P((vm_offset_t)); +void DCFL __P((vm_offset_t)); +void DCPL __P((vm_offset_t)); +void DCPP __P((vm_offset_t)); +void ICPL __P((vm_offset_t)); +void ICPP __P((vm_offset_t)); +#endif + +/* + * Prototypes from machdep.c + */ +int badaddr __P((caddr_t)); +int badbaddr __P((caddr_t)); +void bootsync __P((void)); +void dumpconf __P((void)); +struct frame; +void regdump __P((struct frame *, int)); + +/* + * Prototypes from sys_machdep.c: + */ +int cachectl __P((int, caddr_t, int)); +int dma_cachectl __P((caddr_t, int)); + +/* + * Prototypes from vm_machdep.c + */ +int kvtop __P((caddr_t)); +void physaccess __P((caddr_t, caddr_t, int, int)); +void physunaccess __P((caddr_t, int)); +void setredzone __P((u_int *, caddr_t)); + +/* + * Prototypes from swapgeneric.c: + */ +void setconf __P((void)); + +/* + * Prototypes from pmap.c: + */ +void pmap_bootstrap __P((vm_offset_t, vm_offset_t)); + +#endif /* _KERNEL */ + #endif /* !_MACHINE_CPU_H_ */ diff --git a/sys/arch/amiga/include/disklabel.h b/sys/arch/amiga/include/disklabel.h index bdf472442f3..7372aaf43ee 100644 --- a/sys/arch/amiga/include/disklabel.h +++ b/sys/arch/amiga/include/disklabel.h @@ -1,4 +1,5 @@ -/* $NetBSD: disklabel.h,v 1.5 1995/07/04 18:06:47 chopps Exp $ */ +/* $OpenBSD: disklabel.h,v 1.2 1996/05/02 06:44:45 niklas Exp $ */ +/* $NetBSD: disklabel.h,v 1.6 1996/04/21 21:13:19 veego Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -198,7 +199,7 @@ struct lsegblock { struct cpu_disklabel { u_long rdblock; /* may be RDBNULL which invalidates */ u_long pblist[MAXPARTITIONS]; /* partblock number (RDB list order) */ - char pbindex[MAXPARTITIONS]; /* index of pblock (partition order) */ + int pbindex[MAXPARTITIONS]; /* index of pblock (partition order) */ int valid; /* essential that this is valid */ }; diff --git a/sys/arch/amiga/include/param.h b/sys/arch/amiga/include/param.h index dd7bef3737c..a7172d18c77 100644 --- a/sys/arch/amiga/include/param.h +++ b/sys/arch/amiga/include/param.h @@ -1,5 +1,5 @@ -/* $OpenBSD: param.h,v 1.5 1996/03/30 22:18:27 niklas Exp $ */ -/* $NetBSD: param.h,v 1.28 1996/03/04 05:04:14 cgd Exp $ */ +/* $OpenBSD: param.h,v 1.6 1996/05/02 06:44:45 niklas Exp $ */ +/* $NetBSD: param.h,v 1.29 1996/04/21 21:13:20 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -97,8 +97,8 @@ * of the hardware page size. */ #define MSIZE 128 /* size of an mbuf */ -#define MCLBYTES 1024 -#define MCLSHIFT 10 +#define MCLSHIFT 11 +#define MCLBYTES (1 << MCLSHIFT) #define MCLOFSET (MCLBYTES - 1) #ifndef NMBCLUSTERS #ifdef GATEWAY @@ -145,110 +145,11 @@ #define amiga_btop(x) ((unsigned)(x) >> PGSHIFT) #define amiga_ptob(x) ((unsigned)(x) << PGSHIFT) -/* - * spl functions; all are normally done in-line - */ -#include <machine/psl.h> - #ifdef _KERNEL - -static __inline int -splraise(npsl) - register int npsl; -{ - register int opsl; - - __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : "&=d" (opsl) : - "di" (npsl)); - return opsl; -} - -#ifdef IPL_REMAP_1 - -extern int isr_exter_ipl; -extern void walk_ipls __P((int, int)); - -static __inline int -splx(npsl) - register int npsl; -{ - register int opsl; - - __asm __volatile ("clrl %0; movew sr,%0" : "=d" (opsl)); - if ((isr_exter_ipl << 8) > (npsl & PSL_IPL)) - walk_ipls(isr_exter_ipl, npsl); - __asm __volatile("movew %0,sr" : : "di" (npsl)); - return opsl; -} +#ifndef _LOCORE +void delay __P((u_int)); +void DELAY __P((u_int)); #endif - -#ifndef IPL_REMAP_2 -#define splx splraise -#else - -extern int walk_ipls __P((int)); - -static __inline int -splx(npsl) - register int npsl; -{ - register int opsl; - - /* We should maybe have a flag telling if this is needed. */ - opsl = walk_ipls(npsl); - __asm __volatile("movew %0,sr" : : "di" (npsl)); - return opsl; -} - -#endif - -/* - * Shortcuts - */ -#define spl1() splraise(PSL_S|PSL_IPL1) -#define spl2() splraise(PSL_S|PSL_IPL2) -#define spl3() splraise(PSL_S|PSL_IPL3) -#define spl4() splraise(PSL_S|PSL_IPL4) -#define spl5() splraise(PSL_S|PSL_IPL5) -#define spl6() splraise(PSL_S|PSL_IPL6) -#define spl7() splraise(PSL_S|PSL_IPL7) - -/* - * Hardware interrupt masks - */ -#define splbio() spl3() -#define splnet() spl3() -#define spltty() spl4() -#define splimp() spl4() -#if defined(LEV6_DEFER) || defined(IPL_REMAP_1) || defined(IPL_REMAP_2) -#define splclock() spl4() -#else -#define splclock() spl6() -#endif -#define splstatclock() splclock() - -/* - * Software interrupt masks - * - * NOTE: splsoftclock() is used by hardclock() to lower the priority from - * clock to softclock before it calls softclock(). - */ -#define splsoftclock() splx(PSL_S|PSL_IPL1) -#define splsoftnet() spl1() -#define splsofttty() spl1() - -/* - * Miscellaneous - */ -#if defined(LEV6_DEFER) || defined(IPL_REMAP_1) || defined(IPL_REMAP_2) -#define splhigh() spl4() -#else -#define splhigh() spl7() -#endif -#define spl0() splx(PSL_S|PSL_IPL0) - -void delay __P((unsigned)); -void DELAY __P((unsigned)); #endif #endif /* !_MACHINE_PARAM_H_ */ diff --git a/sys/arch/amiga/include/psl.h b/sys/arch/amiga/include/psl.h index ff340b33085..130934c5a93 100644 --- a/sys/arch/amiga/include/psl.h +++ b/sys/arch/amiga/include/psl.h @@ -1,8 +1,114 @@ -/* $NetBSD: psl.h,v 1.7 1994/10/26 02:06:31 cgd Exp $ */ +/* $OpenBSD: psl.h,v 1.4 1996/05/02 06:44:46 niklas Exp $ */ +/* $NetBSD: psl.h,v 1.8 1996/04/21 21:13:22 veego Exp $ */ #ifndef _MACHINE_PSL_H_ #define _MACHINE_PSL_H_ #include <m68k/psl.h> +#if defined(_KERNEL) && !defined(_LOCORE) + +/* + * spl functions; all are normally done in-line + */ +#include <machine/psl.h> + +#ifdef _KERNEL + +static __inline int +splraise(npsl) + register int npsl; +{ + register int opsl; + + __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : "&=d" (opsl) : + "di" (npsl)); + return opsl; +} + +#ifdef IPL_REMAP_1 + +extern int isr_exter_ipl; +extern void walk_ipls __P((int, int)); + +static __inline int +splx(npsl) + register int npsl; +{ + register int opsl; + + __asm __volatile ("clrl %0; movew sr,%0" : "=d" (opsl)); + if ((isr_exter_ipl << 8) > (npsl & PSL_IPL)) + walk_ipls(isr_exter_ipl, npsl); + __asm __volatile("movew %0,sr" : : "di" (npsl)); + return opsl; +} #endif + +#ifndef IPL_REMAP_2 +#define splx splraise +#else + +extern int walk_ipls __P((int)); + +static __inline int +splx(npsl) + register int npsl; +{ + register int opsl; + + /* We should maybe have a flag telling if this is needed. */ + opsl = walk_ipls(npsl); + __asm __volatile("movew %0,sr" : : "di" (npsl)); + return opsl; +} + +#endif + +/* + * Shortcuts + */ +#define spl1() splraise(PSL_S|PSL_IPL1) +#define spl2() splraise(PSL_S|PSL_IPL2) +#define spl3() splraise(PSL_S|PSL_IPL3) +#define spl4() splraise(PSL_S|PSL_IPL4) +#define spl5() splraise(PSL_S|PSL_IPL5) +#define spl6() splraise(PSL_S|PSL_IPL6) +#define spl7() splraise(PSL_S|PSL_IPL7) + +/* + * Hardware interrupt masks + */ +#define splbio() spl3() +#define splnet() spl3() +#define spltty() spl4() +#define splimp() spl4() +#if defined(LEV6_DEFER) || defined(IPL_REMAP_1) || defined(IPL_REMAP_2) +#define splclock() spl4() +#else +#define splclock() spl6() +#endif +#define splstatclock() splclock() + +/* + * Software interrupt masks + * + * NOTE: splsoftclock() is used by hardclock() to lower the priority from + * clock to softclock before it calls softclock(). + */ +#define splsoftclock() splx(PSL_S|PSL_IPL1) +#define splsoftnet() spl1() +#define splsofttty() spl1() + +/* + * Miscellaneous + */ +#if defined(LEV6_DEFER) || defined(IPL_REMAP_1) || defined(IPL_REMAP_2) +#define splhigh() spl4() +#else +#define splhigh() spl7() +#endif +#define spl0() splx(PSL_S|PSL_IPL0) + +#endif /* KERNEL && !_LOCORE */ +#endif /* _MACHINE_PSL_H_ */ diff --git a/sys/arch/amiga/include/vmparam.h b/sys/arch/amiga/include/vmparam.h index 2234a56fadc..a6ae61969cb 100644 --- a/sys/arch/amiga/include/vmparam.h +++ b/sys/arch/amiga/include/vmparam.h @@ -1,4 +1,5 @@ -/* $NetBSD: vmparam.h,v 1.13 1994/10/26 02:06:47 cgd Exp $ */ +/* $OpenBSD: vmparam.h,v 1.2 1996/05/02 06:44:47 niklas Exp $ */ +/* $NetBSD: vmparam.h,v 1.14 1996/04/21 21:13:23 veego Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -75,13 +76,13 @@ #define DFLDSIZ (32*1024*1024) /* initial data size limit */ #endif #ifndef MAXDSIZ -#define MAXDSIZ (32*1024*1024) /* max data size */ +#define MAXDSIZ (128*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ #define DFLSSIZ (2*1024*1024) /* initial stack size limit */ #endif #ifndef MAXSSIZ -#define MAXSSIZ MAXDSIZ /* max stack size */ +#define MAXSSIZ (32*1024*1024) /* max stack size */ #endif /* |