/*
* 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 (c) 1987 by Sun Microsystems, Inc.
*/
#ifndef _SYS_ASM_LINKAGE_H
#define _SYS_ASM_LINKAGE_H
#pragma ident "%Z%%M% %I% %E% SMI"
/* from SunOS 4.0 1.4 */
/* allow word aligned user stacks */
#define PARTIAL_ALIGN
/*
* A stack frame looks like:
*
* %fp->| |
* |-------------------------------|
* | Locals, temps, saved floats |
* |-------------------------------|
* | outgoing parameters past 6 |
* |-------------------------------|-\
* | 6 words for callee to dump | |
* | register arguments | |
* |-------------------------------| > minimum stack frame
* | One word struct-ret address | |
* |-------------------------------| |
* | 16 words to save IN and | |
* %sp->| LOCAL register on overflow | |
* |-------------------------------|-/
*/
/*
* Constants defining a stack frame.
*/
/*
* Stack alignment macros.
*/
#ifdef _ASM /* The remainder of this file is only for assembly files */
/*
* Symbolic section definitions.
*/
/*
* profiling causes defintions of the MCOUNT and RTMCOUNT
* particular to the type
*/
#ifdef GPROF
#define MCOUNT(x) \
nop ; \
restore ;
#endif /* GPROF */
#ifdef PROF
#define MCOUNT(x) \
restore; \
#endif /* PROF */
/*
* if we are not profiling, MCOUNT should be defined to nothing
*/
#define MCOUNT(x)
#endif /* !defined(PROF) && !defined(GPROF) */
/*
* Pre-ansi compiler versions prepended an underscore to function names.
* This macro provides this function.
*/
#ifndef __STDC__
#endif /* __STDC__ */
/*
* Macro to define weak symbol aliases. These are similar to the ANSI-C
* #pragma weak name = _name
* except a compiler can determine type. The assembler must be told. Hence,
* the second parameter must be the type of the symbol (i.e.: function,...)
*/
#ifdef __STDC__
#endif /* __STDC__ */
/*
* ENTRY provides a way to insert the calls to mcount for profiling.
*/
#ifdef __STDC__
#define ENTRY(x) \
.section ".text"; \
.align 4; \
.global x; \
x: MCOUNT(x)
#define RTENTRY(x) \
#else /* __STDC__ */
#define ENTRY(x) \
#define RTENTRY(x) \
#endif /* __STDC__ */
/*
* ENTRY2 is identical to ENTRY but provides two labels for the entry point.
*/
#ifdef __STDC__
#define ENTRY2(x,y) \
.section ".text"; \
.align 4; \
.global x, y; \
x: ; \
y: MCOUNT(x)
#else /* __STDC__ */
#define ENTRY2(x,y) \
NAME(x): ; \
#endif /* __STDC__ */
/*
* ALTENTRY provides for additional entry points.
*/
#ifdef __STDC__
#define ALTENTRY(x) \
.global x; \
x:
#else /* __STDC__ */
#define ALTENTRY(x) \
NAME(x):
#endif /* __STDC__ */
/*
* DGDEF and DGDEF2 provide global data declarations.
*/
#ifdef __STDC__
.section ".data"; \
name:
#else /* __STDC__ */
.section ".data"; \
name:
#endif /* __STDC__ */
/*
* SET_SIZE trails a function and set the size for the ELF symbol table.
*/
#ifdef __STDC__
#define SET_SIZE(x) \
.size x,(.-x)
#else /* __STDC__ */
#define SET_SIZE(x)
#endif /* __STDC__ */
#ifdef _KERNEL
/*
*/
#ifdef PARTIAL_ALIGN
#endif /* PARTIAL_ALIGN */
#endif /* _KERNEL */
#endif /* _ASM */
#endif /* _SYS_ASM_LINKAGE_H */