sbcp.s revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
.file "%M%"
#include <sys/asm_linkage.h>
#define PIC_SETUP(r) \
#define FUNC(x) \
.section ".text"; \
.align 4; \
x:
!
!
!
1:
ta 9
sethi %hi(0x2000), %o0
lduh [%o0 + A_MAGIC], %g1
cmp %g1, ZMAGIC ! is it a ZMAGIC executable?
be,a 1f ! yes,
ld [%o0 + A_ENTRY], %o0 ! get entry point
1: ! else, assume entry point is 0x2000
jmp %o0
nop
SET_SIZE(_start)
!
! trap0 - glue between 4.x syscall trap and 5.x BCP routine
!
! enter with:
! %g1 syscall number
! %g6 return address (after trap instruction)
!
! We used to use %g7, but that conflicts with threading code
! which uses %g7 as the curthread pointer. That is why we
! changed to using %g6 instead.
!
!
be 1f
ba,a 2f
1:
2:
bne 1f
1:
!
! nullsys
!
b,a trap0rtn
!
! nosys
!
b,a trap0rtn
!
!
#include "sysent.s"