Define single-instruction implementations of setsoft*() and siroff(),
and declare ssir as volatile. This avoids the problem of lost softints should a hard interrupt cause a softint to be flagged while we are clearing a different one. Idea from atari mtpr.h, modified/optimized by me.
This commit is contained in:
parent
b8b7d0ba0c
commit
d19b3500e3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.h,v 1.43 1996/10/15 14:42:49 scottr Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.44 1997/01/20 05:08:00 scottr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -134,16 +134,20 @@ int want_resched; /* resched() was called */
|
||||
/*
|
||||
* simulated software interrupt register
|
||||
*/
|
||||
extern unsigned char ssir;
|
||||
extern volatile u_int8_t ssir;
|
||||
|
||||
#define SIR_NET 0x1
|
||||
#define SIR_CLOCK 0x2
|
||||
#define SIR_SERIAL 0x4
|
||||
#define SIR_NET 0x01
|
||||
#define SIR_CLOCK 0x02
|
||||
#define SIR_SERIAL 0x04
|
||||
|
||||
#define siroff(x) ssir &= ~(x)
|
||||
#define setsoftnet() ssir |= SIR_NET
|
||||
#define setsoftclock() ssir |= SIR_CLOCK
|
||||
#define setsoftserial() ssir |= SIR_SERIAL
|
||||
#define siroff(mask) \
|
||||
__asm __volatile ( "andb %0,_ssir" : : "ir" (~(mask)));
|
||||
#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 CPU_CONSDEV 1
|
||||
#define CPU_MAXID 2
|
||||
|
Loading…
Reference in New Issue
Block a user