Home | History | Annotate | Line # | Download | only in common
start.S revision 1.3
      1  1.3  ross /* $NetBSD: start.S,v 1.3 1998/01/29 22:13:27 ross 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.1   cgd #ifndef PRIMARY_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 #endif
     55  1.1   cgd 
     56  1.1   cgd #ifdef ECOFF_COMPAT
     57  1.1   cgd 	lda	a0,_EDATA
     58  1.1   cgd #else
     59  1.1   cgd 	lda	a0,_edata
     60  1.1   cgd #endif
     61  1.1   cgd 	lda	a1,_end
     62  1.1   cgd 	subq	a1,a0,a1
     63  1.1   cgd 	CALL(bzero)
     64  1.1   cgd 
     65  1.1   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  1.1   cgd 
     72  1.1   cgd /*
     73  1.1   cgd  * Dummy routine for GCC2.
     74  1.1   cgd  */
     75  1.1   cgd LEAF(__main,0)
     76  1.1   cgd 	RET
     77  1.1   cgd END(__main)
     78  1.1   cgd 
     79  1.1   cgd /*
     80  1.1   cgd  * cpu_number
     81  1.1   cgd  *	Return the cpu number, using the whami instruction.
     82  1.1   cgd  */
     83  1.1   cgd LEAF(cpu_number, 0)
     84  1.1   cgd 	call_pal PAL_VMS_mfpr_whami
     85  1.1   cgd 	RET
     86  1.1   cgd END(cpu_number)
     87  1.3  ross /*
     88  1.3  ross  * Execute Instruction Memory Barrier operation from the Common
     89  1.3  ross  * Palcode Architecture. Establishes I-Cache coherency point.
     90  1.3  ross  */
     91  1.3  ross LEAF(alpha_pal_imb, 0)
     92  1.3  ross 	imb
     93  1.3  ross 	RET
     94  1.3  ross END(alpha_pal_imb);
     95