110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/*	$OpenBSD: asm.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $	*/
210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/*	$NetBSD: asm.h,v 1.25 2006/01/20 22:02:40 christos Exp $	*/
310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/*-
510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * Copyright (c) 1990 The Regents of the University of California.
610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * All rights reserved.
710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *
810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * This code is derived from software contributed to Berkeley by
910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * William Jolitz.
1010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *
1110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * Redistribution and use in source and binary forms, with or without
1210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * modification, are permitted provided that the following conditions
1310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * are met:
1410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * 1. Redistributions of source code must retain the above copyright
1510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *    notice, this list of conditions and the following disclaimer.
1610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * 2. Redistributions in binary form must reproduce the above copyright
1710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *    notice, this list of conditions and the following disclaimer in the
1810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *    documentation and/or other materials provided with the distribution.
1910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * 3. Neither the name of the University nor the names of its contributors
2010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *    may be used to endorse or promote products derived from this software
2110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *    without specific prior written permission.
2210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *
2310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * SUCH DAMAGE.
3410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *
3510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	@(#)asm.h	5.5 (Berkeley) 5/7/91
3610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI */
3710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
3810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifndef _SH_ASM_H_
3910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	_SH_ASM_H_
4010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
4110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef __ELF__
4210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define _C_LABEL(x)	x
4310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else
4410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef __STDC__
4510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define _C_LABEL(x)	_ ## x
4610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else
4710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define _C_LABEL(x)	_/**/x
4810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif
4910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif
5010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	_ASM_LABEL(x)	x
5110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
5210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef __STDC__
5310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define __CONCAT(x,y)	x ## y
5410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define __STRING(x)	#x
5510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else
5610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define __CONCAT(x,y)	x/**/y
5710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define __STRING(x)	"x"
5810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif
5910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
6010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/* let kernels and others override entrypoint alignment */
6110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifndef _ALIGN_TEXT
6210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI# define _ALIGN_TEXT .align 2
6310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif
6410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
6510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef __ELF__
6610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	_ENTRY(x)							\
6710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.text								;\
6810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	_ALIGN_TEXT							;\
6910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.globl x							;\
7010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.type x,@function						;\
7110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	x:
7210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else /* !__ELF__ */
7310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	_ENTRY(x)							\
7410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.text								;\
7510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	_ALIGN_TEXT							;\
7610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.globl x							;\
7710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	x:
7810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif /* !__ELF__ */
7910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
8010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef GPROF
8110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	_PROF_PROLOGUE				  \
8210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	mov.l	1f,r1				; \
8310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	mova	2f,r0				; \
8410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	jmp	@r1				; \
8510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	 nop					; \
8610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.align	2				; \
8710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI1:	.long	__mcount			; \
8810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI2:
8910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else  /* !GPROF */
9010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	_PROF_PROLOGUE
9110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif /* !GPROF */
9210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
9310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	ENTRY(y)	_ENTRY(_C_LABEL(y)) _PROF_PROLOGUE
9410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	NENTRY(y)	_ENTRY(_C_LABEL(y))
9510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)) _PROF_PROLOGUE
9610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
9710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define SET_ENTRY_SIZE(y) \
9810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.size	_C_LABEL(y), . - _C_LABEL(y)
9910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
10010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define SET_ASENTRY_SIZE(y) \
10110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.size	_ASM_LABEL(y), . - _ASM_LABEL(y)
10210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
10310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef __ELF__
10410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	ALTENTRY(name)				 \
10510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.globl _C_LABEL(name)			;\
10610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.type _C_LABEL(name),@function		;\
10710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	_C_LABEL(name):
10810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else
10910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	ALTENTRY(name)				 \
11010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.globl _C_LABEL(name)			;\
11110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	_C_LABEL(name):
11210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif
11310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
11410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
11510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/*
11610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * Hide the gory details of PIC calls vs. normal calls.  Use as in the
11710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * following example:
11810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *
11910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	sts.l	pr, @-sp
12010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	PIC_PROLOGUE(.L_got, r0)	! saves old r12 on stack
12110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	...
12210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	mov.l	.L_function_1, r0
12310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * 1:	CALL	r0			! each call site needs a label
12410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	 nop
12510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *      ...
12610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	mov.l	.L_function_2, r0
12710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * 2:	CALL	r0
12810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	 nop
12910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	...
13010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	PIC_EPILOGUE			! restores r12 from stack
13110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	lds.l	@sp+, pr		!  so call in right order
13210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	rts
13310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	 nop
13410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *
13510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	.align 2
13610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * .L_got:
13710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	PIC_GOT_DATUM
13810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * .L_function_1:			! if you call the same function twice
13910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI *	CALL_DATUM(function, 1b)	!  provide call datum for each call
14010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * .L_function_2:
14110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * 	CALL_DATUM(function, 2b)
14210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI */
14310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
14410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef PIC
14510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
14610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_PLT(x)	x@PLT
14710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_GOT(x)	x@GOT
14810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_GOTOFF(x)	x@GOTOFF
14910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
15010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_PROLOGUE(got)			\
15110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI        	mov.l	r12, @-sp;		\
15210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		PIC_PROLOGUE_NOSAVE(got)
15310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
15410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/*
15510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * Functions that do non local jumps don't need to preserve r12,
15610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * so we can shave off two instructions to save/restore it.
15710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI */
15810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_PROLOGUE_NOSAVE(got)		\
15910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI        	mov.l	got, r12;		\
16010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI        	mova	got, r0;		\
16110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI        	add	r0, r12
16210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
16310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_EPILOGUE				\
16410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		mov.l	@sp+, r12
16510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
16610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define PIC_EPILOGUE_SLOT 			\
16710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		PIC_EPILOGUE
16810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
16910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define PIC_GOT_DATUM \
17010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		.long	_GLOBAL_OFFSET_TABLE_
17110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
17210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define CALL	bsrf
17310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define JUMP	braf
17410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
17510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define CALL_DATUM(function, lpcs) \
17610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		.long	PIC_PLT(function) - ((lpcs) + 4 - (.))
17710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
17810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI/*
17910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * This will result in text relocations in the shared library,
18010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * unless the function is local or has hidden or protected visibility.
18110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI * Does not require PIC prologue.
18210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI */
18310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define CALL_DATUM_LOCAL(function, lpcs) \
18410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		.long	function - ((lpcs) + 4)
18510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
18610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#else  /* !PIC */
18710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
18810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_PROLOGUE(label)
18910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_PROLOGUE_NOSAVE(label)
19010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_EPILOGUE
19110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	PIC_EPILOGUE_SLOT	nop
19210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define PIC_GOT_DATUM
19310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
19410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define CALL	jsr @
19510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define JUMP	jmp @
19610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
19710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define CALL_DATUM(function, lpcs) \
19810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		.long	function
19910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
20010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define CALL_DATUM_LOCAL(function, lpcs) \
20110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI		.long	function
20210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
20310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif /* !PIC */
20410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
20510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
20610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	ASMSTR		.asciz
20710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
20810093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#ifdef __ELF__
20910093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	WEAK_ALIAS(alias,sym)						\
21010093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.weak _C_LABEL(alias);						\
21110093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	_C_LABEL(alias) = _C_LABEL(sym)
21210093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif
21310093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
21410093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#define	WARN_REFERENCES(_sym,_msg)				\
21510093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI	.section .gnu.warning._sym; .ascii _msg; .previous
21610093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI
21710093276e98d26428875480c502a278dffe550c7Shin-ichiro KAWASAKI#endif /* !_SH_ASM_H_ */
218