add idc and remove massbus drivers for 730 (need space)
[unix-history] / usr / src / sys / vax / stand / srt0.c
CommitLineData
d54f1867 1/* srt0.c 4.8 81/04/03 */
99fe9747
BJ
2
3#include "../h/mtpr.h"
10899d3a
BJ
4#define LOCORE
5#include "../h/cpu.h"
3a30f6d7 6
92e3eb9d
BJ
7/*
8 * Startup code for standalone system
9 * Non-relocating version -- for programs which are loaded by boot
10 */
3a30f6d7 11
10899d3a 12 .globl _end
1a6aead8 13 .globl _edata
3a30f6d7
BJ
14 .globl _main
15 .globl __rtt
99fe9747 16 .globl _configure
10899d3a
BJ
17 .globl _cpu
18 .globl _openfirst
3a30f6d7
BJ
19
20 .set HIGH,31 # mask for total disable
21
80e3badb 22entry: .globl entry
3a30f6d7
BJ
23 .word 0x0
24 mtpr $HIGH,$IPL # just in case
10899d3a
BJ
25#ifdef REL
26 movl $RELOC,sp
27#else
28 movl $RELOC-0x2400,sp
29#endif
80e3badb 30start:
10899d3a 31 movl aedata,r0
784de51c
BJ
32clr:
33 clrl (r0)+
34 cmpl r0,sp
35 jlss clr
10899d3a
BJ
36#ifdef REL
37 movc3 aend,*$0,(sp)
38 jmp *abegin
39begin:
40#endif
41 mtpr $0,$SCBB
99fe9747 42 calls $0,_configure
10899d3a 43 movl $1,_openfirst
3a30f6d7 44 calls $0,_main
10899d3a 45#ifndef TP
3a30f6d7 46 jmp start
10899d3a
BJ
47#else
48 ret
49#endif
50
51 .data
52#ifdef REL
53abegin: .long begin
54aend: .long _end-RELOC
55aedata: .long _edata-RELOC
56#else
57aedata: .long _edata
58#endif
3a30f6d7
BJ
59
60__rtt:
61 .word 0x0
62 jmp start
10899d3a
BJ
63
64 .globl _badloc
65_badloc:
66 .word 0
67 movl $1,r0
68 movl 4(ap),r3
69 movl $4,r2
70 movab 9f,(r2)
71 tstl (r3)
721: clrl r0 # made it w/o machine checks
732: movl $4,r2
74 clrl (r2)
75 ret
76 .align 2
779:
78 casel _cpu,$1,$VAX_MAX
790:
80 .word 8f-0b # 1 is 780
81 .word 5f-0b # 2 is 750
d54f1867 82 .word 5f-0b # 3 is 7ZZ
10899d3a
BJ
835:
84 mtpr $0xf,$MCESR
85 brb 1f
868:
87 mtpr $0,$SBIFS
881:
89 addl2 (sp)+,sp # discard mchchk trash
90 movab 2b,(sp)
91 rei