1 /* 2 * Copyright (c) 1982 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 * 6 * @(#)srt0.c 6.4 (Berkeley) 11/08/85 7 */ 8 9 #include "../vax/mtpr.h" 10 #define LOCORE 11 #include "../vax/cpu.h" 12 13 /* 14 * Startup code for standalone system 15 * Non-relocating version -- for programs which are loaded by boot 16 * Relocating version for boot* 17 */ 18 19 .globl _end 20 .globl _edata 21 .globl _main 22 .globl __rtt 23 .globl _configure 24 .globl _cpu 25 .globl _openfirst 26 27 .set HIGH,31 # mask for total disable 28 29 entry: .globl entry 30 .word 0x0 31 mtpr $HIGH,$IPL # just in case 32 #ifdef REL 33 movl $RELOC,sp 34 #else 35 movl $RELOC-0x2400,sp 36 #endif 37 start: 38 movl aedata,r0 39 clr: 40 clrl (r0)+ 41 cmpl r0,sp 42 jlss clr 43 #ifdef REL 44 movc3 aedata,*$0,(sp) 45 /* 46 * Reclear bss segment separately from text and data 47 * since movc3 can't move more than 64K bytes 48 */ 49 dclr: 50 clrl (r3)+ 51 cmpl r3,$_end 52 jlss dclr 53 /* this loop shouldn't be necessary, but is when booting from an ra81 */ 54 xclr: 55 clrl (r3)+ 56 cmpl r3,$0x100000 57 jlss xclr 58 jmp *abegin 59 begin: 60 #endif 61 mtpr $0,$SCBB 62 calls $0,_configure 63 movl $1,_openfirst 64 calls $0,_main 65 #ifndef TP 66 jmp start 67 #else 68 ret 69 #endif 70 71 .data 72 #ifdef REL 73 abegin: .long begin 74 aedata: .long _edata-RELOC 75 #else 76 aedata: .long _edata 77 #endif 78 79 __rtt: 80 .word 0x0 81 #ifdef REL 82 halt 83 #else 84 jmp start 85 #endif 86 87 .globl _badloc 88 _badloc: 89 .word 0 90 movl $1,r0 91 movl 4(ap),r3 92 movl $4,r2 93 movab 9f,(r2) 94 tstl (r3) 95 1: clrl r0 # made it w/o machine checks 96 2: movl $4,r2 97 clrl (r2) 98 ret 99 .align 2 100 9: 101 casel _cpu,$1,$VAX_MAX 102 0: 103 .word 8f-0b # 1 is 780 104 .word 5f-0b # 2 is 750 105 .word 5f-0b # 3 is 730 106 .word 6f-0b # 4 is 8600 107 5: 108 mtpr $0xf,$MCESR 109 brb 1f 110 6: 111 mtpr $0,$EHSR 112 brb 1f 113 8: 114 mtpr $0,$SBIFS 115 1: 116 addl2 (sp)+,sp # discard mchchk trash 117 movab 2b,(sp) 118 rei 119