#ifndef _DRIVER_H_c1045258_ #define _DRIVER_H_c1045258_ /* This file is in the public domain. */ #include "pdp11.h" typedef struct intrq INTRQ; typedef struct driver DRIVER; struct intrq { DRIVER *driver; word vec; word pri; int flags; #define IRQ_F_ACTIVE 1 INTRQ *pri_link; } ; struct driver { int flags; #define DVR_NORMW 0x00000001 const char *name; void (*init)(DRIVER *, char *); void (*tick)(DRIVER *); int (*io)(DRIVER *, int, int, int, void (*)(void *)); void (*busreset)(DRIVER *); void (*reset)(DRIVER *); int (*intchk)(INTRQ *); void (*intack)(INTRQ *); DRIVER *link; INTRQ irq[8]; char iomask[8192]; } ; #define IOMASK(n) (017777&(word)(n)) #define IO_OP 0x0f #define IO_BITS 0xf0 #define IO_R 0x01 #define IO_W 0x02 #define IO_RMW 0x03 #define IO_BYTE 0x10 #define BR4 4 #define BR5 5 #define BR6 6 #define BR7 7 extern void interrupt(DRIVER *, int, int); extern int reg_access(int, word *, int, word, word); #define UNUSED(x) x __attribute__((__unused__)) #endif