summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/stand/old/bugcrt/bugcrt.c
blob: d01c20b6e2d924d95adaa96fc6ed4f3b0e5219b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "bug.h"

asm	("		text");
/*asm	("_stack:	word _stack0xFC0000;	stack");*/
asm	("stack:	word stack");
asm	("		word _start");
asm	("		align 8");

struct bugenv bugenv;
extern char *end, *edata;

start()
{
	register int dlun 	asm("r2");
	register int clun 	asm("r3");
	register int ipl  	asm("r4");
	register int (*entryptr)() asm("r6");
	register int *cfg	asm("r7");
	register char *strstr	asm("r8");
	register char *endstr	asm("r9");
	int i;
	char *str;
	
asm	(";	enable SFU1");
asm	("		ldcr	r10,cr1");
asm	("		xor	r10,r10,0x8");
asm	("		stcr	r10,cr1");

	bugenv.clun = clun;
	bugenv.dlun = dlun;
	bugenv.ipl  = ipl;
	bugenv.entry= entryptr;

	bzero(&edata,((char *)&end - (char *)&edata));
	for (str = strstr, i = 0; str <= strstr; str++, i++) {
		bugenv.bootargs[i] = *str;
	}
	bugenv.bootargs[i] = 0;

	main(&bugenv);	
	bugreturn();
}