-/* $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
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;
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;
/*
* 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);
/*
*/
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;
-/* $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
#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 *));
* basically this means start attaching the grfxx's that support
* the console. Kinda hacky but it works.
*/
-int
+void
config_console()
{
struct cfdata *cf;
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())
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 ||
-/* $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
alloc_chipmem(size)
u_long size;
{
- void *mem;
int s;
struct mem_node *mn, *new;
-/* $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
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 */
-/* $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.
#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 */
};
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[] =
{
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 */
/*
* Returns true if dev is /dev/mem or /dev/kmem.
*/
+int
iskmemdev(dev)
dev_t dev;
{
/*
* Convert a character device number to a block device number.
*/
+int
chrtoblk(dev)
dev_t dev;
{
-/* $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
#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
{
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);
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);
}
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;
-/* $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
* *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 *));
-/* $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
#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>
/*
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 */
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;
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 =
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,
/*
* store this partitions block number
*/
- clp->pblist[clp->pbindex[i] = cindex++];
+ clp->pblist[clp->pbindex[i] = cindex++] = nextb;
}
/*
* calulate new checksum.
* 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.
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;
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;
struct rdbmap *
getrdbmap(dev, strat, lp, clp)
dev_t dev;
- void (*strat)();
+ void (*strat)(struct buf *);
struct disklabel *lp;
struct cpu_disklabel *clp;
{
bp->b_dev = MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART);
/* XXX finish */
-bad:
brelse(bp);
return(NULL);
}
-/* $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.
#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;
-/* $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.
#include <sys/msgbuf.h>
#include <sys/syscall.h>
#include <sys/user.h>
+#include <sys/systm.h>
#include <vm/vm.h>
#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);
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);
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);
}
-/* $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.
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)
-/* $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.
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.
-/* $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.
#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>
#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>
#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.
*/
void
cpu_startup()
{
- extern long Usrptsize;
- extern struct map *useriomap;
register unsigned i;
register caddr_t v, firstaddr;
int base, residual;
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;
#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);
*/
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);
char cpu_model[120];
extern char version[];
+void
identifycpu()
{
/* there's alot of XXX in here... */
/*
* machine dependent system variables.
*/
+int
cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int *name;
u_int namelen;
(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) {
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
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
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);
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
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
}
}
+
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;
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)
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 ");
splx(s);
}
+void
initcpu()
{
}
+void
straytrap(pc, evec)
int pc;
u_short evec;
int *nofault;
+int
badaddr(addr)
register caddr_t addr;
{
return(0);
}
+int
badbaddr(addr)
register caddr_t addr;
{
return(0);
}
+static void
netintr()
{
#ifdef INET
do {
s = splhigh ();
- si = si_callbacks;
- if (si)
+ if ((si = si_callbacks) != 0)
si_callbacks = si->next;
splx(s);
#endif
}
+void
intrhand(sr)
int 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();
}
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;
}
#endif
-
+void
regdump(fp, sbytes)
struct frame *fp; /* must not be register */
int 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));
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)
printf("\n");
}
-char *
+static char *
hexstr(val, len)
register int val;
+ int len;
{
static char nbuf[9];
register int x, i;
* 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;
-/* $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.
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
+#include <sys/proc.h>
#include <machine/cpu.h>
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);
/*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);
}
switch (minor(dev)) {
-/* minor device 0 is physical memory */
+ /* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
#ifndef DEBUG
(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);
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;
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;
uio->uio_resid -= c;
}
if (minor(dev) == 0) {
+#ifndef DEBUG
unlock:
+#endif
if (physlock > 1)
wakeup((caddr_t)&physlock);
physlock = 0;
-/* $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.
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)
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
#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
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
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
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
#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
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
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
}
{
#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);
#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
#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
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_destroy(%x)\n", pmap);
+ printf("pmap_destroy(%p)\n", pmap);
#endif
if (pmap == NULL)
return;
#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... */
{
#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);
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)
*/
#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;
}
#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
#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));
}
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
}
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) &&
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,
#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;
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
#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;
#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)
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
/*
* 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);
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
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
/*
#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;
*/
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;
}
/*
*/
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
#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))
pa = (pa & PG_FRAME) | (va & ~PG_FRAME);
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("%x\n", pa);
+ printf("%lx\n", pa);
#endif
return(pa);
}
{
#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
}
#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();
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
#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;
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;
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
}
{
#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);
}
{
#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);
{
#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;
{
#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
/*
#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))
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;
}
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);
{
#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);
}
{
#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);
}
#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
#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
* Miscellaneous support routines follow
*/
-/* static */
+static void
amiga_protection_init()
{
register int *kp, prot;
return(FALSE);
}
-/* static */
+static void
pmap_changebit(pa, bit, setem)
register vm_offset_t pa;
int bit;
#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))
*/
#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);
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
/*
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
}
*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);
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
}
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);
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)
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
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
/*
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
}
}
#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;
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;
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
-/* $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.
#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
{ 0 },
};
+struct genericconf * getgenconf __P((char *));
+
struct genericconf *
getgenconf(bp)
char *bp;
return(gc);
}
+void
setconf()
{
struct disk *dkp;
rootdev = dumpdev;
}
+void
gets(cp)
char *cp;
{
-/* $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.
/* XXX end should be */
/*ARGSUSED1*/
+int
cachectl(req, addr, len)
int req;
caddr_t addr;
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;
*/
/*ARGSUSED1*/
+int
dma_cachectl(addr, len)
caddr_t addr;
int 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);
void *v;
register_t *retval;
{
+#ifdef notyet
struct sys_sysarch_args /* {
syscallarg(int) op;
syscallarg(char *) parms;
} */ *uap = v;
+#endif
return ENOSYS;
}
-/* $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.
#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)
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;
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 */
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
#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) {
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);
* 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
#ifdef DDB
if (type == T_TRACE || type == T_BREAKPOINT) {
- if (kdb_trap(type, &frame))
+ if (kdb_trap(type, (db_regs_t *)&frame))
return;
}
#endif
/*
* Process a system call.
*/
+void
syscall(code, frame)
register_t code;
struct frame 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 */
{
u_int wb_extra_page = 0;
u_int wb_rc, mmusr;
- void _wb_fault (); /* fault handler for write back */
#ifdef DEBUG
if (mmudebug)
/*
* fault handler for write back
*/
-void _wb_fault()
+void
+_wb_fault()
{
#ifdef DEBUG
printf ("trap: writeback fault\n");
-/* $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.
#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
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;
*/
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 */
}
* 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;
* 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;
TBIAS();
}
+void
physunaccess(vaddr, size)
caddr_t vaddr;
register int size;
* Look at _lev6intr in locore.s for more details.
*/
/*ARGSUSED*/
+void
setredzone(pte, vaddr)
u_int *pte;
caddr_t vaddr;
/*
* Convert kernel VA to physical address
*/
+int
kvtop(addr)
register caddr_t addr;
{
-# $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
#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
-# $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
#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
# 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
# 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.
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
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
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
-# $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!
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
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
-# $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
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
-/* $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
#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>
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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
siop_regmap_p rp;
u_long temp, scratch;
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;
}
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;
-/* $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
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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
char *mbusstr;
mbusstr = auxp;
}
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;
struct sbic_softc *dev;
{
volatile struct sdmac *sdp;
- int i, stat;
sdp = dev->sc_cregs;
-/* $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
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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = 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;
}
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;
struct sbic_softc *dev;
{
volatile struct sdmac *sdp;
- int i, stat;
sdp = dev->sc_cregs;
-/* $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
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;
}
/* 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);
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;
}
/* --------- */
-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;
}
/* 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;
}
/* 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;
}
/* 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;
}
/* 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;
} else {
char *ptr;
vm_offset_t pa, lastpa;
- int len, prelen, postlen, max_t;
+ int len, prelen, max_t;
ptr = p;
len = l;
}
/* Turn on led */
-void bzsc_led_dummy(struct sfas_softc *sc)
+void bzsc_led_dummy(sc, mode)
+ struct sfas_softc *sc;
+ int mode;
{
}
+/* $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
*
+/* $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
*
-/* $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.
#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>
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
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cfp = match;
if (matchname("clock", auxp))
return(1);
#endif
}
+void
setstatclockrate(hz)
int hz;
{
* Returns number of usec since last recorded clock "tick"
* (i.e. clock interrupt).
*/
+u_long
clkread()
{
u_char hi, hi2, lo;
u_int mic;
{
u_int temp;
- int s;
if (micspertick == 0)
setmicspertick();
* Initialize the time of day register, based on the time base which is, e.g.
* from a filesystem.
*/
+void
inittodr(base)
time_t 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
-/* $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 $ */
/*
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,
NULL, /* Use default done routine */
};
-#define QPRINTF
-
#ifdef DEBUG
extern int sci_debug;
#endif
}
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)
-/* $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
#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
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 };
void
fdcattach(pdp, dp, auxp)
- struct device *pdp, *dp;
+ struct device *pdp, *dp;
void *auxp;
{
struct fdcargs args;
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);
}
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);
/*
* 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;
* 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;
/*
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");
struct proc *p;
{
struct fd_softc *sc;
- void *data;
int error, wlab;
sc = getsoftc(fd_cd, FDUNIT(dev));
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;
}
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;
splx(s);
}
+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;
/*
* 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);
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 ||
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
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++)
void *arg;
{
struct fd_softc *sc;
- int unitmask, s;
+ int s;
sc = arg;
s = splbio();
}
#ifdef FDDEBUG
- printf(" hw turing unit off\n");
+ printf(" hw turning unit off\n");
#endif
sc->flags &= ~(FDF_MOTORON | FDF_MOTOROFF);
{
struct buf *dp, *bp;
char *data;
- int sz, blk;
+ int sz;
#ifdef FDDEBUG
printf("fddone: unit %d\n", sc->hwunit);
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;
}
}
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;
int len;
{
u_long *sdp, *edp, d, dtmp, correct;
- int i;
sdp = dp;
edp = dp + len;
}
int
-fddump()
+fddump(dev, blkno, va, size)
+ dev_t dev;
+ daddr_t blkno;
+ caddr_t va;
+ size_t size;
{
return (EINVAL);
}
-/* $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
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));
/*
}
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;
void
flsc_set_dma_adr(sc, ptr)
struct sfas_softc *sc;
- void *ptr;
+ vm_offset_t ptr;
{
flsc_regmap_p rp;
unsigned int *p;
int
flsc_setup_dma(sc, ptr, len, mode)
struct sfas_softc *sc;
- void *ptr;
+ vm_offset_t ptr;
int len;
int mode;
{
int
flsc_need_bump(sc, ptr, len)
struct sfas_softc *sc;
- void *ptr;
+ vm_offset_t ptr;
int len;
{
int p;
{
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);
+/* $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
*
+/* $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
*
-/* $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.
#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>
#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)
#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 *));
/*ARGSUSED*/
int
-grfclose(dev, flags)
+grfclose(dev, flags, mode, p)
dev_t dev;
int flags;
+ int mode;
+ struct proc *p;
{
struct grf_softc *gp;
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.
* 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
/*
/*ARGSUSED*/
int
-grfselect(dev, rw)
+grfselect(dev, rw, p)
dev_t dev;
int rw;
+ struct proc *p;
{
if (rw == FREAD)
return(0);
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
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
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
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);
}
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 */
-/* $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
*/
#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 */
#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 *));
/*
* 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;
void *auxp;
{
static struct grf_softc congrf;
- static int coninited;
struct grf_softc *gp;
if (dp == NULL)
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:
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.. */
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;
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
-/* $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
*/
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));
-/* $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
#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.
struct device *pdp;
void *match, *auxp;
{
+#ifdef CL5426CONSOLE
struct cfdata *cfp = match;
+#endif
struct zbus_args *zap;
static int regprod, fbprod;
static struct grf_softc congrf;
struct zbus_args *zap;
struct grf_softc *gp;
- int x;
static char attachflag = 0;
zap = auxp;
{
unsigned char *ba = gp->g_regkva;
int x;
- void *bah;
/* wakeup board and flip passthru OFF */
return (0);
}
+#ifndef CL5426CONSOLE
void
cl_off(gp)
struct grf_softc *gp;
RegOnpass(ba);
WSeq(ba, SEQ_ID_CLOCKING_MODE, 0x21);
}
+#endif
int
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;
return (0);
case GM_GRFIOCTL:
- return (cl_ioctl(gp, (int) arg, (caddr_t) a2));
+ return (cl_ioctl(gp, a2, arg));
default:
break;
int
cl_ioctl(gp, cmd, data)
register struct grf_softc *gp;
- int cmd;
+ u_long cmd;
void *data;
{
switch (cmd) {
void
writeshifted(to, shiftx, shifty)
- unsigned char *to;
+ volatile char *to;
char shiftx;
char shifty;
{
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)
gp = green + cmap->index;
bp = blue + cmap->index;
break;
+ default:
+ rp = gp = bp = 0;
+ break;
}
do {
gp = green + cmap->index;
bp = blue + cmap->index;
break;
+ default:
+ rp = gp = bp = 0;
+ break;
}
do {
#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;
/*
*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;
}
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 */
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);
case 24:
clkdiv = 2;
break;
+ default:
+ clkdiv = 0;
+ panic("grfcl: Unsuported depth: %i", gv->depth);
+ break;
}
WGfx(ba, GCT_ID_GRAPHICS_MODE,
-/* $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
*/
static inline void RegWakeup(volatile void *ba) {
extern int cltype;
- extern unsigned char pass_toggle;
switch (cltype) {
case SPECTRUM:
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));
-/* $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
*
* 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>
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 *));
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.
*/
};
/* 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[]={
/*
* 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!!!
#ifdef CV_AGGRESSIVE_TIMING
long cv_memclk = 55000000;
#else
-long cv_memclk = 45000000;
+long cv_memclk = 50000000;
#endif
/* standard driver stuff */
static struct grf_softc congrf;
struct zbus_args *zap;
struct grf_softc *gp;
- static char attachflag = 0;
+ static char attachflag = 0;
zap = auxp;
/* 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 */
* 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 */
/* immediately Clkload bit clear */
test = test & 0xDF;
-
+
/* 2 MCLK Memory Write.... */
if (cv_memclk >= 55000000)
test |= 0x80;
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);
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);
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 */
/* 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);
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 */
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);
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
#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;
return (0);
}
+
int
cv_getcmap(gfp, cmap)
struct grf_softc *gfp;
return (error);
}
+
int
cv_putcmap(gfp, cmap)
struct grf_softc *gfp;
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;
break;
case 24:
case 32:
-#ifdef CV_AGGRESSIVE_TIMING
+#ifdef CV_AGGRESSIVE_TIMING
maxpix = MAXPIXELCLOCK - 75000000;
#else
maxpix = MAXPIXELCLOCK - 85000000;
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");
return (1);
}
+
int
cv_load_mon(gp, md)
struct grf_softc *gp;
/* 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)) {
break;
default:
hmul = 1;
- break;
+ break;
}
HBS = gv->hblank_start * hmul;
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
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);
/* 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 */
((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 */
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 */
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);
}
m = (temptym - tfillm - 9) / 2;
+ if (m < 0)
+ m = 0; /* prevent underflow */
m = (m & 0x1f) << 3;
if (m < 0x18)
m = 0x18;
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]);
return (1);
}
+
void
cv_inittextmode(gp)
struct grf_softc *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;
}
cv_write_port (0x8010, ba);
}
+
/* 0 = on, 1= off */
/* ba= registerbase */
static inline void
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 */
-/* $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
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/device.h>
* 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
*/
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;
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 *));
#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) {
void *auxp;
{
static struct grf_softc congrf;
- static int coninited;
struct zbus_args *zap;
struct grf_softc *gp;
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;
unsigned mode;
enum mode_type type;
{
- struct MonDef *md;
int error;
if (!mode || mode > rh_mon_max)
* 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:
return(EINVAL);
#endif
case GM_GRFIOCTL:
- return(rh_ioctl (gp, (u_long) arg, (caddr_t) a2));
+ return(rh_ioctl (gp, a2, arg));
default:
break;
struct grf_spriteinfo *info;
{
volatile unsigned char *ba, *fb;
+#if 0
u_char control;
+#endif
ba = gp->g_regkva;
fb = gp->g_fbkva;
RZ3BitBlit16(gp, bb);
else
RZ3BitBlit24(gp, bb);
+
+ return(0);
}
#endif /* NGRF */
-/* $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
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));
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));
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 */
-/* $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
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>
* 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
*/
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 (?)
*/
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--) {
/* 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);
}
{
- volatile unsigned char * c = fb;
+ volatile caddr_t c = fb;
long x;
Map(3);
{
/* 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;
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
void *auxp;
{
static struct grf_softc congrf;
- static int coninited;
struct zbus_args *zap;
struct grf_softc *gp;
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;
unsigned mode;
int txtonly;
{
- struct MonDef *md;
int error;
if (!mode || mode > retina_mon_max)
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... */
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;
int
rt_getbank (gp, offs, prot)
struct grf_softc *gp;
- off_t offs;
+ u_long offs;
int prot;
{
/* XXX */
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;
info->size.y = (RSeq (ba, SEQ_ID_CURSOR_CONTROL) & 6) << 4;
}
+ return 0;
}
int
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;
#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;
-/* $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
* 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
*/
-/* $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
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.
*/
*/
static int
-ulisr(gp)
-struct grf_softc *gp;
+ulisr(arg)
+ void *arg;
{
+ struct grf_softc *gp = arg;
struct gspregs *ba;
u_int16_t thebits;
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;
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 */
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;
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 ?
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 *));
static __inline void
ul_setfb(gp, cmd)
struct grf_softc *gp;
- int cmd;
+ u_long cmd;
{
struct grf_ul_softc *gup;
struct gspregs *ba;
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;
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;
{
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)
-/* $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
#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;
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) {
-/* $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
#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. */
{
dmode_t *save;
dmode_t *dm;
- long dt, dx, dy, ct;
+ long dt = 0, dx, dy, ct;
dmdata_t *dmd;
save = NULL;
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++) {
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 */
/* 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);
}
}
}
} 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);
}
}
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]));
}
}
}
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++;
}
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));
}
}
}
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);
/* 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;
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
{
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;
/* 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;
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. */
/* 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];
/* 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;
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
{
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;
/* 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;
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. */
/* 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];
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;
/* 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;
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
{
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;
/* 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;
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));
/* 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));
/* 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;
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");
}
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);
{
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];
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);
/*
* 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])));
#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);
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++;
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;
{
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;
#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 */
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
}
/* 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;
{
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;
/* 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;
{
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;
/* 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;
{
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;
{
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];
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;
{
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;
#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 */
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
}
-/* $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
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. */
#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. */
#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);
-/* $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
* 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 */
-/* $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.
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 *));
#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 */
-/* $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
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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct gvpbus_args *gap;
gap = 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;
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;
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);
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);
}
}
int
-gtsc_dmaintr(dev)
- struct sbic_softc *dev;
+gtsc_dmaintr(arg)
+ void *arg;
{
+ struct sbic_softc *dev = arg;
volatile struct sdmac *sdp;
int stat;
struct sbic_softc *dev;
{
volatile struct sdmac *sdp;
- int i, stat;
sdp = dev->sc_cregs;
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);
}
-/* $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
*/
#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>
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = auxp;
{
struct zbus_args *zap;
struct gvpbus_args ga;
- u_char *idreg;
zap = auxp;
bcopy(zap, &ga.zargs, sizeof(struct zbus_args));
-/* $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
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,
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)
int ide_no_int = 0;
#ifdef DEBUG
+void ide_dump_regs __P((ide_regmap_p));
int ide_debug = 0;
#define TRACE0(arg)
#define TRACE1(arg1,arg2)
-#define QPRINTF
+#define QPRINTF(a)
#endif /* !DEBUG */
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
#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);
{
struct scsi_xfer *xs;
struct scsi_link *slp;
- int flags, phase, stat;
+ int flags, stat;
xs = dev->sc_xs;
slp = xs->sc_link;
}
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
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;
{
struct scsi_sense rqs;
struct scsi_link *slp;
- int stat;
slp = xs->sc_link;
}
#ifdef DEBUG
+void
ide_dump_regs(regs)
ide_regmap_p regs;
{
struct scsi_xfer *xs;
{
struct ide_softc *ide = &dev->sc_ide[xs->sc_link->target];
- char *addr;
- int count;
long lba;
int nblks;
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;
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]);
-/* $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.
#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
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));
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 *));
void
aewatchdog(unit)
- short unit;
+ int unit;
{
struct ae_softc *sc = ae_cd.cd_devs[unit];
}
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;
*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;
}
}
#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);
-/* $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
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
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;
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;
* 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;
-/* $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
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 *));
#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
*/
void
ed_watchdog(unit)
- short unit;
+ int unit;
{
struct ed_softc *sc = ed_cd.cd_devs[unit];
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
int i, s;
- u_char command;
u_long mcaf[2];
/*
/* 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. */
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,
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;
-/* $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
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));
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 *));
{
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",
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 */
}
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();
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;
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) {
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;
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;
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)
/* Set new address. */
esinit(sc);
break;
+ }
#endif
default:
esinit(sc);
-/* $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.
NULL, "le", DV_IFNET
};
+integrate void
+lehwinit(sc)
+ struct le_softc *sc;
+{
+}
+
integrate void
lewrcsr(sc, port, val)
struct le_softc *sc;
{
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;
-/* $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.
NULL, "le", DV_IFNET
};
+integrate void
+lehwinit(sc)
+ struct le_softc *sc;
+{
+}
+
integrate void
lewrcsr(sc, port, val)
struct le_softc *sc;
{
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;
-/* $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.
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 */
-/* $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
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));
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
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;
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;
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) {
* 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;
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,
-/* $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.
#include <sys/param.h>
#include <sys/kernel.h>
-#include <sys/conf.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/ioctl.h>
#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()
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
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;
/* 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;
/* 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;
-/* $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
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
*/
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;
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
* 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;
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;
}
-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,
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))
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);
}
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);
+/* $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
-/* $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
* 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
*
* (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>
#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
*/
{
static int done;
int rv;
-
- if (done == 0)
+
+ if (done == 0)
#ifdef CV64CONSOLE
- rv = CN_INTERNAL;
+ rv = CN_INTERNAL;
#else
rv = CN_DEAD;
#endif
done = 1;
return(rv);
}
-
+
/*
* called from grf_cv to init ite portion of
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 */
-/* $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
#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
return(rv);
}
+
void
grfrh_iteinit(gp)
struct grf_softc *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)
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;
}
-
+#ifdef RETINA_SPEED_HACK
static void
screen_up(ip, top, bottom, lines)
struct ite_softc *ip;
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)
RZ3AlphaErase(ip->grf, 0, bottom - lines + 1, ip->cols, lines);
}
+
static void
screen_down (ip, top, bottom, lines)
struct ite_softc *ip;
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)
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)
int dx;
int mode;
{
- volatile u_char * ba = ip->grf->g_regkva;
volatile u_char * fb = ip->grf->g_fbkva;
register u_char attr;
*fb++ = c; *fb = attr;
}
+
void
rh_clear(ip, sy, sx, h, w)
struct ite_softc *ip;
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
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);
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 */
-/* $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
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.
gp->g_itecursor = retina_cursor;
}
+
void
retina_init(ip)
struct ite_softc *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)
{
-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;
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 */
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 {
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;
*p++ = dummyval;
} while (x--);
}
-
+
/* write mode 0 */
WGfx (ba, GCT_ID_GRAPHICS_MODE, (RGfx(ba, GCT_ID_GRAPHICS_MODE) & 0xfc) | 0);
/* extended chain4 enable */
#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;
/* do some bounds-checking here.. */
if (top >= bottom)
return;
-
+
if (top + lines >= bottom)
{
retina_clear (ip, top, 0, bottom - top, ip->cols);
/* 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);
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 {
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;
*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);
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--)
}
}
+
/*
* 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) {
-/* $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
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 */
-/* $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
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,
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;
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));
#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;
#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;
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;
#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;
}
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)
-/* $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.
#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>
#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 */
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
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cfp = match;
if (matchname((char *)auxp, "kbd"))
return(1);
#define KEY_UP(c) ((c) & 0x80)
void
-kbdenable ()
+kbdenable()
{
int s;
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;
}
-/* $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
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 */
},
{
-/* $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
/* 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
-/* $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
#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>
#include <dev/cons.h>
+#include <sys/conf.h>
+#include <machine/conf.h>
+
#include "mfcs.h"
#ifndef SEROBUF_SIZE
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
};
#endif
-int mfcsstart(), mfcsparam(), mfcshwiflow();
+
int mfcs_active;
int mfcsdefaultrate = 38400 /*TTYDEF_SPEED*/;
#define SWFLAGS(dev) (sc->swflags | (((dev) & 0x80) == 0 ? TIOCFLAG_SOFTCAR : 0))
*/
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 }
};
/*
*/
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
*/
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 }
};
/*
*/
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 }
};
/*
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = auxp;
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct mfc_args *ma;
ma = auxp;
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];
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;
return(0);
}
-int mfcshwiflow(tp, flag)
+int
+mfcshwiflow(tp, flag)
struct tty *tp;
int flag;
{
return 1;
}
-int
+void
mfcsstart(tp)
struct tty *tp;
{
int
mfcsstop(tp, flag)
struct tty *tp;
+ int flag;
{
int s;
tp->t_state |= TS_FLUSH;
}
splx(s);
+ return 0;
}
int
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;
* which is active low
*/
if (how != DMGET) {
- ub = 0;
/*
* need to save current state of DTR & RTS ?
*/
*/
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;
return(1);
}
-int
+void
mfcsxintr(unit)
int unit;
{
splx(s1);
}
-int
+void
mfcseint(unit, stat)
int unit, stat;
{
-/* $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
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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = auxp;
*/
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;
-/* $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
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;
{
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;
{
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;
-/* $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:
*/
#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
* 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.
{
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).
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;
/*
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;
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)
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);
{
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));
}
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???) */
{
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 */
-/* $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.
#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>
#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"
* 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 *));
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;
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = auxp;
int
mscioctl(dev, cmd, data, flag, p)
dev_t dev;
- int cmd;
+ u_long cmd;
caddr_t data;
int flag;
struct proc *p;
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;
}
-int
+void
mscstart(tp)
register struct tty *tp;
{
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)];
}
}
splx(s);
+ return 0;
}
/*
-/* $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
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,
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;
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));
#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;
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));
#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;
}
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)
-/* $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.
#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;
#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 *));
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);
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);
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;
int buflen;
char *buf;
+ len = 0;
+ cnt = 0;
if (!!(sc->sc_flags & PARF_OREAD) ^ (uio->uio_rw == UIO_READ))
return EINVAL;
#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
#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);
{
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);
/* 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)
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.. */
-/* $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
#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])
-/* $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
#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 *));
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 *));
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
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
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;
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
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
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 */
#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
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
sbic_regmap_p regs;
int target, lun;
{
- int i, s, asr, count;
+ int s, count;
char* vaddr, * paddr;
struct sbic_acb *acb;
#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,
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
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;
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 &=
/*
* 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);
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;
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
void *bp;
int phase;
{
- u_char orig_csr, csr, asr, *buf;
+ u_char orig_csr, asr, *buf;
int wait;
buf = bp;
int len;
void *bp;
{
- int wait, read;
+ int wait;
u_char *obp, *buf;
u_char orig_csr, csr, asr;
{
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;
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)
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;
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();
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);
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));
} 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);
*/
#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;
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;
{
sbic_regmap_p regs;
u_char asr, csr;
- struct sbic_pending* pendp;
int i;
- unsigned tcnt;
SBIC_TRACE(dev);
regs = dev->sc_sbicp;
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;
#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));
#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;
} 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 {
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);
#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
~(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
#ifdef DEBUG
-void sbicdumpstate()
+void
+sbicdumpstate()
{
u_char csr, asr;
}
-void sbictimeout(dev)
+void
+sbictimeout(dev)
struct sbic_softc *dev;
{
int s, asr;
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;
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);
}
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);
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) {
-/* $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.
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_ */
-/* $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
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;
#define QPRINTF(a) if (sci_debug > 1) printf a
int sci_debug = 0;
#else
-#define QPRINTF
+#define QPRINTF(a)
#endif
/*
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;
{
struct scsi_sense rqs;
struct scsi_link *slp;
- int stat;
slp = xs->sc_link;
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)
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;
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) */
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;
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;
-/* $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.
struct scsi_xfer *xs;
};
+struct sci_softc;
struct sci_softc {
struct device sc_dev;
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 */
#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
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_ */
-/* $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.
* @(#)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.
*/
#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>
#include <dev/cons.h>
+#include <sys/conf.h>
+#include <machine/conf.h>
+
#include "ser.h"
#if NSER > 0
#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;
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
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
}
-int
+void
serintr(unit)
int 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;
{
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);
/*
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 {
/*
ser_outintr()
{
struct tty *tp = ser_tty[0];
- u_short c;
int s;
tp = ser_tty[0];
splx(s);
}
-int
+void
serstart(tp)
struct tty *tp;
{
int
serstop(tp, flag)
struct tty *tp;
+ int flag;
{
int s;
tp->t_state |= TS_FLUSH;
}
splx(s);
+ return 0;
}
int
int bits, how;
{
int unit, s;
- u_char ub;
+ u_char ub = 0;
unit = SERUNIT(dev);
/*
* Following are all routines needed for SER to act as console
*/
-int
+void
sercnprobe(cp)
struct consdev *cp;
{
#endif
}
+void
sercninit(cp)
struct consdev *cp;
{
serconsinit = 1;
}
+void
serinit(unit, rate)
int 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;
/*
* Console kernel output character routine.
*/
+void
sercnputc(dev, c)
dev_t dev;
int c;
{
register int timo;
- short stat;
int s;
s = splhigh();
-/* $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
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.
#define QPRINTF(a) if (sfas_debug > 1) printf a
int sfas_debug = 0;
#else
-#define QPRINTF
+#define QPRINTF(a)
#endif
/*
sfasinitialize(dev)
struct sfas_softc *dev;
{
- sfas_regmap_p rp;
u_int *pte, page;
int i;
u_int inhibit_sync;
*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
* 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,
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;
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;
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
/*
* 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;
int len;
int mode;
{
- char sync, target, lun;
+ int sync, target, lun;
target = pendp->xs->sc_link->target;
lun = pendp->xs->sc_link->lun;
struct scsi_xfer *xs;
struct sfas_pending pend;
struct scsi_sense rqs;
- int stat, mode;
+ int mode;
xs = nexus->xs;
sfas_regmap_p rp;
struct nexus *nexus;
{
- int i, left, len;
+ int i, len;
u_char cmd;
short offset, period;
{
sfas_regmap_p rp;
struct nexus *nexus;
- int s;
rp = dev->sc_fas;
+/* $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
*
+/* $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
*
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];
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_ */
-/* $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
#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.
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
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;
(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,
{
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,
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;
/*
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,
* 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.
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]);
}
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,
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();*/
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 {
{
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;
#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
#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
}
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);
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,
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)
#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
}
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();
}
#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,
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,
}
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;
/*
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)
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",
#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
#ifdef DDB
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;
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);
* 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
}
#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;
}
* 53C710 interrupt handler
*/
-int
+void
siopintr (sc)
register struct siop_softc *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);
}
#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]);
* 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];
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;
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
#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);
-/* $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.
#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 */
-/* $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.
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 */
-/* $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
* a interface to graphics. */
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#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 */
* functions for probeing.
*/
+void
viewattach(cnt)
int cnt;
{
}
/* this function is called early to set up a display. */
+void
viewprobe()
{
int i;
if (view_inited)
- return(1);
+ return;
view_inited = 1;
views[i].view = NULL;
views[i].flags = 0;
}
- return(1);
+ return;
}
/*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;
}
/*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);
}
struct proc *p;
{
struct view_softc *vu;
- colormap_t *cm;
bmap_t *bm;
int error;
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;
/*ARGSUSED*/
int
-viewselect(dev, rw)
+viewselect(dev, rw, p)
dev_t dev;
int rw;
+ struct proc *p;
{
if (rw == FREAD)
return(0);
-/* $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
#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
+
-/* $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
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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = auxp;
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;
-/* $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
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,
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;
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = 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;
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));
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;
#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;
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));
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));
}
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)
-/* $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
#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,
struct device *pdp;
void *match, *auxp;
{
- struct cfdata *cdp = match;
struct zbus_args *zap;
zap = auxp;
*/
int
-zssc_dmaintr(sc)
- struct siop_softc *sc;
+zssc_dmaintr(arg)
+ void *arg;
{
+ struct siop_softc *sc = arg;
siop_regmap_p rp;
int istat;
--- /dev/null
+/* $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);
-/* $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.
{ "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_ */
-/* $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
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 */
};
-/* $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.
* 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
#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_ */
-/* $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_ */
-/* $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.
#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
/*