Home | History | Annotate | Line # | Download | only in libbug
      1  1.1  christos /*	$NetBSD: bugstart.S,v 1.1 2014/11/21 20:10:28 christos Exp $	*/
      2  1.1  christos 
      3  1.1  christos #define _LOCORE
      4  1.1  christos #include <machine/prom.h>
      5  1.1  christos #undef _LOCORE
      6  1.1  christos #include <machine/asm.h>
      7  1.1  christos 
      8  1.1  christos 	.data
      9  1.1  christos 	.even
     10  1.1  christos 
     11  1.1  christos GLOBAL(bugargs)
     12  1.1  christos 	.space	MVMEPROM_ARGS_MAX*4
     13  1.1  christos 
     14  1.1  christos 	.text
     15  1.1  christos 	.even
     16  1.1  christos 
     17  1.1  christos 	.long	_C_LABEL(start) - 0x10
     18  1.1  christos 	.long	_C_LABEL(start)
     19  1.1  christos 
     20  1.1  christos #define	BUG_ARG(which)	_C_LABEL(bugargs) + (which)
     21  1.1  christos 
     22  1.1  christos ENTRY_NOPROFILE(_start)
     23  1.1  christos ENTRY_NOPROFILE(start)
     24  1.1  christos 	moveml	%d0/%a0,%sp@-
     25  1.1  christos 	lea	_C_LABEL(edata),%a0
     26  1.1  christos 	movl	#_C_LABEL(end) - 4,%d0
     27  1.1  christos 	subl	%a0,%d0
     28  1.1  christos 	lsrl	#2,%d0
     29  1.1  christos 1:	clrl	%a0@+
     30  1.1  christos 	dbra	%d0,1b
     31  1.1  christos 	moveml	%sp@+,%d0/%a0
     32  1.1  christos 	movl	MVMEPROM_REG_DEVLUN, BUG_ARG(MVMEPROM_ARGS_DEVLUN)
     33  1.1  christos 	movl	MVMEPROM_REG_CTRLLUN, BUG_ARG(MVMEPROM_ARGS_CTRLLUN)
     34  1.1  christos 	movl	MVMEPROM_REG_FLAGS, BUG_ARG(MVMEPROM_ARGS_FLAGS)
     35  1.1  christos 	movl	MVMEPROM_REG_CTRLADDR, BUG_ARG(MVMEPROM_ARGS_CTRLADDR)
     36  1.1  christos 	movl	MVMEPROM_REG_ENTRY, BUG_ARG(MVMEPROM_ARGS_ENTRY)
     37  1.1  christos 	movl	MVMEPROM_REG_CONFBLK, BUG_ARG(MVMEPROM_ARGS_CONFBLK)
     38  1.1  christos 	movl	MVMEPROM_REG_NBARGSTART, BUG_ARG(MVMEPROM_ARGS_NBARGSTART)
     39  1.1  christos 	movl	MVMEPROM_REG_NBARGEND, BUG_ARG(MVMEPROM_ARGS_NBARGEND)
     40  1.1  christos 	movl	MVMEPROM_REG_ARGSTART, BUG_ARG(MVMEPROM_ARGS_ARGSTART)
     41  1.1  christos 	movl	MVMEPROM_REG_ARGEND, BUG_ARG(MVMEPROM_ARGS_ARGEND)
     42  1.1  christos 	jmp	_C_LABEL(_bugstart)
     43  1.1  christos 
     44  1.1  christos ENTRY_NOPROFILE(bugexec)
     45  1.1  christos 	addql	#4,%sp
     46  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_DEVLUN), MVMEPROM_REG_DEVLUN
     47  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_CTRLLUN), MVMEPROM_REG_CTRLLUN
     48  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_FLAGS), MVMEPROM_REG_FLAGS
     49  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_CTRLADDR), MVMEPROM_REG_CTRLADDR
     50  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_ENTRY), MVMEPROM_REG_ENTRY
     51  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_CONFBLK), MVMEPROM_REG_CONFBLK
     52  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_NBARGSTART), MVMEPROM_REG_NBARGSTART
     53  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_NBARGEND), MVMEPROM_REG_NBARGEND
     54  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_ARGSTART), MVMEPROM_REG_ARGSTART
     55  1.1  christos 	movl	BUG_ARG(MVMEPROM_ARGS_ARGEND), MVMEPROM_REG_ARGEND
     56  1.1  christos ENTRY_NOPROFILE(__main)
     57  1.1  christos 	rts
     58