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