summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/stand/bugcrt/m68k/bugcrt.c
blob: 37641e2e7e14e3fa9778e0323ec18d5c4f033100 (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
/*	$OpenBSD: bugcrt.c,v 1.3 1996/04/28 10:48:29 deraadt Exp $ */

#include <sys/types.h>
#include <machine/prom.h>

struct mvmeprom_args bugargs = { 1 };	/* not in BSS */

	asm (".text");
	asm (".long 0x003ffff8");
	asm (".long _start");
start()
{
	register int dev_lun asm ("d0");
	register int ctrl_lun asm ("d1");
	register int flags asm ("d4");
	register int ctrl_addr asm ("a0");
	register int entry asm ("a1");
	register int conf_blk asm ("a2");
	register char *arg_start asm ("a5");
	register char *arg_end asm ("a6");
	extern int edata, end;

	bugargs.dev_lun = dev_lun;
	bugargs.ctrl_lun = ctrl_lun;
	bugargs.flags = flags;
	bugargs.ctrl_addr = ctrl_addr;
	bugargs.entry = entry;
	bugargs.conf_blk = conf_blk;
	bugargs.arg_start = arg_start;
	bugargs.arg_end = arg_end;
	*arg_end = 0;

	bzero(&edata, (int)&end-(int)&edata);
	main();
	mvmeprom_return();
	/* NOTREACHED */
}

__main()
{
}