/* machdep.c 1.3 87/10/27 */
#include "../tahoe/mem.h"
#include "../tahoe/mtpr.h"
#include "../tahoe/SYS.h"
.set HIGH
, 0x1f # mask for total disable
.set BERVEC
, 0x80 # offset into scb of the bus error vector
.set RESTVEC
, 0x8 # offset into scb of the restart vector
* see if access addr with a len type instruction causes a machine check
* len is length of access (1=byte, 2=short, 4=long)
* r0 = 0 means good(exists); r0 =1 means does not exist.
ENTRY(badaddr
, R5
|R4
|R3
|R2
|R1
)
1: bbc $
1,r4
,1f
; tstw (r3
)
1: bbc $
2,r4
,1f
; tstl (r3
)
1: clrl r0
# made it w/o machine checks
* wbadaddr(addr, len, value)
* see if write of value to addr with a len type instruction causes
* len is length of access (1=byte, 2=short, 4=long)
* r0 = 0 means good(exists); r0 =1 means does not exist.
ENTRY(wbadaddr
, R5
|R4
|R3
|R2
|R1
)
bbc $
0,r4
,1f
; movb
15(fp
), (r3
)
1: bbc $
1,r4
,1f
; movw
14(fp
), (r3
)
1: bbc $
2,r4
,1f
; movl
12(fp
), (r3
)
1: clrl r0
# made it w/o machine checks
9: # Here we catch buss error (if it comes)
halt
# Address parity error !!!
movl $
1,r0
# Anything else = bad address
movab
8(sp
),sp
# discard buss error trash
movab
2b
,(sp
) # new program counter on stack.