some video cards. Provided by Paul Goyette <paul@pgoyette.bdt.com>.
This introduces another simulated software interrupt.
-/* $OpenBSD: cpu.h,v 1.15 1997/03/12 13:29:39 briggs Exp $ */
+/* $OpenBSD: cpu.h,v 1.16 1997/03/30 21:53:23 briggs Exp $ */
/* $NetBSD: cpu.h,v 1.45 1997/02/10 22:13:40 scottr Exp $ */
/*
#define SIR_CLOCK 0x02
#define SIR_SERIAL 0x04
+/* Mac-specific SSIR(s) */
+#define SIR_DTMGR 0x80
+
#define siroff(mask) \
- __asm __volatile ( "andb %0,_ssir" : : "ir" (~(mask)));
+ __asm __volatile ( "andb %0,_ssir" : : "ir" (~(mask) & 0xff));
#define setsoftnet() \
__asm __volatile ( "orb %0,_ssir" : : "i" (SIR_NET))
#define setsoftclock() \
__asm __volatile ( "orb %0,_ssir" : : "i" (SIR_CLOCK))
#define setsoftserial() \
__asm __volatile ( "orb %0,_ssir" : : "i" (SIR_SERIAL))
+#define setsoftdtmgr() \
+ __asm __volatile ( "orb %0,_ssir" : : "i" (SIR_DTMGR))
#define CPU_CONSDEV 1
#define CPU_MAXID 2
-/* $OpenBSD: macrom.c,v 1.10 1997/03/08 16:17:05 briggs Exp $ */
+/* $OpenBSD: macrom.c,v 1.11 1997/03/30 21:53:25 briggs Exp $ */
/* $NetBSD: macrom.c,v 1.31 1997/03/01 17:20:34 scottr Exp $ */
/*-
#endif
void setup_egret __P((void));
-
+void mrg_execute_deferred __P((void));
+void mrg_DTInstall __P((void));
/*
* Last straw functions; we didn't set them up, so freak out!
* of ticks */
}
+/*
+ * Handle the Deferred Task manager here
+ */
+static caddr_t mrg_DTList = NULL;
+
+void
+mrg_DTInstall(void)
+{
+ caddr_t ptr, prev;
+
+ __asm(" movl a0, %0" : "=g" (ptr) );
+
+ (caddr_t *)prev = &mrg_DTList;
+ while (*prev != NULL)
+ prev = *(caddr_t *)prev;
+ *(caddr_t *)ptr = NULL;
+ *(caddr_t *)prev = ptr;
+ setsoftdtmgr();
+
+ __asm(" clrl d0" : : : "d0");
+}
+
+void
+mrg_execute_deferred(void)
+{
+ caddr_t ptr;
+ int s;
+
+ while (mrg_DTList != NULL) {
+ s = splhigh();
+ ptr = *(caddr_t *)mrg_DTList;
+ mrg_DTList = *(caddr_t *)ptr;
+ splx(s);
+
+ __asm(" moveml a0-a6/d1-d7,sp@-
+ movl %0, a0
+ movl a0@(8), a2
+ movl a0@(12), a1
+ jsr a2@
+ moveml sp@+,a0-a6/d1-d7" : : "g" (ptr) );
+ }
+}
void
mrg_VBLQueue()
[0x3b] (caddr_t)mrg_Delay,
[0x47] (caddr_t)mrg_SetTrapAddress,
[0x55] (caddr_t)mrg_StripAddress,
+ [0x82] (caddr_t)mrg_DTInstall,
#else
#error "Using a GNU C extension."
#endif
mrg_VIA2 = (caddr_t)(Via1Base + VIA2 * 0x2000); /* see via.h */
SCCRd = (caddr_t)(IOBase + sccA); /* ser.c ; we run before serinit */
+ jDTInstall = (caddr_t) mrg_DTInstall;
+
/* AV ROMs want this low memory vector to point to a jump table */
InitEgretJTVec = (u_int32_t **)&mrg_AVInitEgretJT;
-/* $OpenBSD: macrom.h,v 1.5 1997/02/23 06:05:02 briggs Exp $ */
+/* $OpenBSD: macrom.h,v 1.6 1997/03/30 21:53:26 briggs Exp $ */
/* $NetBSD: macrom.h,v 1.9 1996/05/25 14:45:35 briggs Exp $ */
/*-
extern u_int16_t VBLQueue; /* Vertical blanking Queue, unused ? */
extern caddr_t VBLQueue_head; /* Vertical blanking Queue, head */
extern caddr_t VBLQueue_tail; /* Vertical blanking Queue, tail */
+extern caddr_t jDTInstall; /* short-cut to deferred task mgr */
+ /* trap handler */
extern u_int32_t **InitEgretJTVec; /* pointer to a jump table for */
/* InitEgret on AV machines */
-/* $OpenBSD: macromasm.s,v 1.4 1997/02/23 06:05:03 briggs Exp $ */
+/* $OpenBSD: macromasm.s,v 1.5 1997/03/30 21:53:27 briggs Exp $ */
/* $NetBSD: macromasm.s,v 1.11 1996/05/25 14:45:37 briggs Exp $ */
/*-
loglob(VBLQueue, 0x160) /* Vertical blanking Queue, unused ? */
loglob(VBLQueue_head, 0x162) /* Vertical blanking Queue, head */
loglob(VBLQueue_tail, 0x166) /* Vertical blanking Queue, tail */
+ loglob(jDTInstall, 0x9dc) /* short-cut to deferred task mgr */
+ /* trap handler */
loglob(InitEgretJTVec, 0x2010) /* pointer to a jump table for */
/* InitEgret on AV machines */
-/* $OpenBSD: trap.c,v 1.8 1997/02/21 05:49:30 briggs Exp $ */
+/* $OpenBSD: trap.c,v 1.9 1997/03/30 21:53:27 briggs Exp $ */
/* $NetBSD: trap.c,v 1.45 1997/01/20 04:30:05 scottr Exp $ */
/*
cnt.v_soft++;
softclock();
}
+ if (ssir & SIR_DTMGR) {
+ void mrg_execute_deferred __P((void));
+ siroff(SIR_DTMGR);
+ cnt.v_soft++;
+ mrg_execute_deferred();
+ }
/*
* If this was not an AST trap, we are all done.
*/