new copyright; att/bsd/shared
[unix-history] / usr / src / sys / tahoe / stand / machdep.c
CommitLineData
05e3da35
KB
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Computer Consoles Inc.
7 *
8 * %sccs.include.proprietary.c%
9 *
10 * @(#)machdep.c 1.6 (Berkeley) %G%
11 */
bca8fd8b 12
b28b3a13
KB
13#include "../tahoe/mem.h"
14#include "../include/mtpr.h"
15#include "../tahoe/SYS.h"
bca8fd8b 16
a05e383f 17 .set _scb, 0x0
bca8fd8b
SL
18 .set HIGH, 0x1f # mask for total disable
19 .set BERVEC, 0x80 # offset into scb of the bus error vector
20 .set RESTVEC, 0x8 # offset into scb of the restart vector
21
22ENTRY(mtpr, 0)
23 mtpr 8(fp),4(fp)
24 ret
25
26ENTRY(mfpr, 0)
27 mfpr 4(fp),r0
28 ret
29
30ENTRY(bcopy, R2|R1|R0)
31 movl 4(fp),r0
32 movl 8(fp),r1
33 movl 12(fp),r2
34 movblk
35 ret
36
37/*
38 * badaddr(addr, len)
39 * see if access addr with a len type instruction causes a machine check
40 * len is length of access (1=byte, 2=short, 4=long)
41 * r0 = 0 means good(exists); r0 =1 means does not exist.
42 */
43ENTRY(badaddr, R5|R4|R3|R2|R1)
44 mfpr $IPL,r1
45 mtpr $HIGH,$IPL
46 mfpr $SCBB,r5
47 mtpr $0,$SCBB
48 movl *$BERVEC,r2
49 movl 4(fp),r3
50 movl 8(fp),r4
51 movab 9f,*$BERVEC
52 bbc $0,r4,1f; tstb (r3)
531: bbc $1,r4,1f; tstw (r3)
541: bbc $2,r4,1f; tstl (r3)
551: clrl r0 # made it w/o machine checks
73861197
KB
562: movl r2,*$BERVEC
57 mtpr r1,$IPL
58 mtpr r5,$SCBB
59 ret
60
61/*
62 * wbadaddr(addr, len, value)
63 * see if write of value to addr with a len type instruction causes
64 * a machine check
65 * len is length of access (1=byte, 2=short, 4=long)
66 * r0 = 0 means good(exists); r0 =1 means does not exist.
67 */
68ENTRY(wbadaddr, R5|R4|R3|R2|R1)
69 mfpr $IPL,r1
70 mtpr $HIGH,$IPL
71 mfpr $SCBB,r5
72 mtpr $0,$SCBB
73 movl *$BERVEC,r2
74 movl 4(fp),r3
75 movl 8(fp),r4
76 movab 9f,*$BERVEC
77 bbc $0,r4,1f; movb 15(fp), (r3)
781: bbc $1,r4,1f; movw 14(fp), (r3)
791: bbc $2,r4,1f; movl 12(fp), (r3)
801: clrl r0 # made it w/o machine checks
bca8fd8b
SL
812: movl r2,*$BERVEC
82 mtpr r1,$IPL
83 mtpr r5,$SCBB
84 ret
85
86 .align 2
879: # Here we catch buss error (if it comes)
88 andl3 4(sp),$ERRCD,r0
89 cmpl r0,$APE
90 jneq 1f
91 halt # Address parity error !!!
921: cmpl r0,$VBE
93 jneq 1f
94 halt # Versabus error
951:
96 movl $1,r0 # Anything else = bad address
97 movab 8(sp),sp # discard buss error trash
98 movab 2b,(sp) # new program counter on stack.
99 rei
100
101ENTRY(movow, 0)
102 movow 10(fp),*4(fp)
103 ret
104
105ENTRY(movob, 0)
a05e383f 106 movob 11(fp),*4(fp)
bca8fd8b 107 ret