Home | History | Annotate | Line # | Download | only in common
start.S revision 1.1
      1 /*	$NetBSD: start.S,v 1.1 1997/01/24 01:52:59 cgd Exp $	*/
      2 
      3 /*
      4  * Mach Operating System
      5  * Copyright (c) 1992 Carnegie Mellon University
      6  * All Rights Reserved.
      7  *
      8  * Permission to use, copy, modify and distribute this software and its
      9  * documentation is hereby granted, provided that both the copyright
     10  * notice and this permission notice appear in all copies of the
     11  * software, derivative works or modified versions, and any portions
     12  * thereof, and that both notices appear in supporting documentation.
     13  *
     14  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     15  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
     16  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     17  *
     18  * Carnegie Mellon requests users of this software to return to
     19  *
     20  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     21  *  School of Computer Science
     22  *  Carnegie Mellon University
     23  *  Pittsburgh PA 15213-3890
     24  *
     25  * any improvements or extensions that they make and grant Carnegie Mellon
     26  * the rights to redistribute these changes.
     27  */
     28 
     29 #include "include/asm.h"
     30 
     31 /*
     32  * start --
     33  *	Entry point for boot/standalone programs.
     34  *
     35  * Arguments:
     36  *	a0				long (first free physical page)
     37  *
     38  * This is where the prom comes to.  Leaves all exception and interrupts
     39  * to prom, runs off prom's stack too.  No return values.
     40  */
     41 	.text
     42 	.set	noreorder		/* don't reorder instructions */
     43 
     44 #define ENTRY_FRAME	32
     45 
     46 NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
     47 	br	pv,Lstartgp
     48 Lstartgp:
     49 	LDGP(pv)
     50 
     51 #ifndef PRIMARY_BOOTBLOCK
     52 	lda	sp,start		/* start stack below text */
     53 	lda	sp,-ENTRY_FRAME(sp)
     54 #endif
     55 
     56 #ifdef ECOFF_COMPAT
     57 	lda	a0,_EDATA
     58 #else
     59 	lda	a0,_edata
     60 #endif
     61 	lda	a1,_end
     62 	subq	a1,a0,a1
     63 	CALL(bzero)
     64 
     65 	CALL(main)			/* transfer to C */
     66 
     67 XLEAF(_rtt, 0)
     68 XLEAF(halt, 0)
     69 	call_pal PAL_halt		/* halt if we ever return */
     70 END(start)
     71 
     72 /*
     73  * Dummy routine for GCC2.
     74  */
     75 LEAF(__main,0)
     76 	RET
     77 END(__main)
     78 
     79 /*
     80  * cpu_number
     81  *	Return the cpu number, using the whami instruction.
     82  */
     83 LEAF(cpu_number, 0)
     84 	call_pal PAL_VMS_mfpr_whami
     85 	RET
     86 END(cpu_number)
     87