+++ /dev/null
-/* $NetBSD: asm.h,v 1.30 2006/01/20 22:02:40 christos Exp $ */\r
-\r
-/*-\r
- * Copyright (c) 1990 The Regents of the University of California.\r
- * All rights reserved.\r
- *\r
- * This code is derived from software contributed to Berkeley by\r
- * William Jolitz.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. Neither the name of the University nor the names of its contributors\r
- * may be used to endorse or promote products derived from this software\r
- * without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- *\r
- * @(#)asm.h 5.5 (Berkeley) 5/7/91\r
- */\r
-\r
-#ifndef _I386_ASM_H_\r
-#define _I386_ASM_H_\r
-\r
-#ifdef _KERNEL_OPT\r
-#include "opt_multiprocessor.h"\r
-#endif\r
-\r
-#ifdef PIC\r
-#define PIC_PROLOGUE \\r
- pushl %ebx; \\r
- call 1f; \\r
-1: \\r
- popl %ebx; \\r
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx\r
-#define PIC_EPILOGUE \\r
- popl %ebx\r
-#define PIC_PLT(x) x@PLT\r
-#define PIC_GOT(x) x@GOT(%ebx)\r
-#define PIC_GOTOFF(x) x@GOTOFF(%ebx)\r
-#else\r
-#define PIC_PROLOGUE\r
-#define PIC_EPILOGUE\r
-#define PIC_PLT(x) x\r
-#define PIC_GOT(x) x\r
-#define PIC_GOTOFF(x) x\r
-#endif\r
-\r
-#ifdef __ELF__\r
-# define _C_LABEL(x) x\r
-#else\r
-# ifdef __STDC__\r
-# define _C_LABEL(x) _ ## x\r
-# else\r
-# define _C_LABEL(x) _/**/x\r
-# endif\r
-#endif\r
-#define _ASM_LABEL(x) x\r
-\r
-#define CVAROFF(x, y) _C_LABEL(x) + y\r
-\r
-#ifdef __STDC__\r
-# define __CONCAT(x,y) x ## y\r
-# define __STRING(x) #x\r
-#else\r
-# define __CONCAT(x,y) x/**/y\r
-# define __STRING(x) "x"\r
-#endif\r
-\r
-/* let kernels and others override entrypoint alignment */\r
-#if !defined(_ALIGN_TEXT) && !defined(_KERNEL)\r
-# ifdef __ELF__\r
-# define _ALIGN_TEXT .align 4\r
-# else\r
-# define _ALIGN_TEXT .align 2\r
-# endif\r
-#endif\r
-\r
-#define _ENTRY(x) \\r
- .text; _ALIGN_TEXT; .globl x; .type x,@function; x:\r
-\r
-#ifdef _KERNEL\r
-\r
-#if defined(MULTIPROCESSOR)\r
-#define CPUVAR(off) %fs:__CONCAT(CPU_INFO_,off)\r
-#else\r
-#define CPUVAR(off) _C_LABEL(cpu_info_primary)+__CONCAT(CPU_INFO_,off)\r
-#endif /* MULTIPROCESSOR */\r
-\r
-/* XXX Can't use __CONCAT() here, as it would be evaluated incorrectly. */\r
-#ifdef __ELF__\r
-#ifdef __STDC__\r
-#define IDTVEC(name) \\r
- ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:\r
-#else \r
-#define IDTVEC(name) \\r
- ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:\r
-#endif /* __STDC__ */ \r
-#else \r
-#ifdef __STDC__\r
-#define IDTVEC(name) \\r
- ALIGN_TEXT; .globl _X ## name; .type _X ## name,@function; _X ## name: \r
-#else\r
-#define IDTVEC(name) \\r
- ALIGN_TEXT; .globl _X/**/name; .type _X/**/name,@function; _X/**/name:\r
-#endif /* __STDC__ */\r
-#endif /* __ELF__ */\r
-\r
-#ifdef __ELF__\r
-#define ALIGN_DATA .align 4\r
-#define ALIGN_TEXT .align 4,0x90 /* 4-byte boundaries, NOP-filled */\r
-#define SUPERALIGN_TEXT .align 16,0x90 /* 16-byte boundaries better for 486 */\r
-#else\r
-#define ALIGN_DATA .align 2\r
-#define ALIGN_TEXT .align 2,0x90 /* 4-byte boundaries, NOP-filled */\r
-#define SUPERALIGN_TEXT .align 4,0x90 /* 16-byte boundaries better for 486 */\r
-#endif /* __ELF__ */\r
-\r
-#define _ALIGN_TEXT ALIGN_TEXT\r
-\r
-#ifdef GPROF\r
-#ifdef __ELF__\r
-#define MCOUNT_ASM call _C_LABEL(__mcount)\r
-#else /* __ELF__ */\r
-#define MCOUNT_ASM call _C_LABEL(mcount)\r
-#endif /* __ELF__ */\r
-#else /* GPROF */\r
-#define MCOUNT_ASM /* nothing */\r
-#endif /* GPROF */\r
-\r
-#endif /* _KERNEL */\r
-\r
-\r
-\r
-#ifdef GPROF\r
-# ifdef __ELF__\r
-# define _PROF_PROLOGUE \\r
- pushl %ebp; movl %esp,%ebp; call PIC_PLT(__mcount); popl %ebp\r
-# else \r
-# define _PROF_PROLOGUE \\r
- pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp\r
-# endif\r
-#else\r
-# define _PROF_PROLOGUE\r
-#endif\r
-\r
-#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE\r
-#define NENTRY(y) _ENTRY(_C_LABEL(y))\r
-#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE\r
-\r
-#define ASMSTR .asciz\r
-\r
-#ifdef __ELF__\r
-#define RCSID(x) .section ".ident"; .asciz x\r
-#else\r
-#define RCSID(x) .text; .asciz x\r
-#endif\r
-\r
-#ifdef NO_KERNEL_RCSIDS\r
-#define __KERNEL_RCSID(_n, _s) /* nothing */\r
-#else\r
-#define __KERNEL_RCSID(_n, _s) RCSID(_s)\r
-#endif\r
-\r
-#ifdef __ELF__\r
-#define WEAK_ALIAS(alias,sym) \\r
- .weak alias; \\r
- alias = sym\r
-#endif\r
-/*\r
- * STRONG_ALIAS: create a strong alias.\r
- */\r
-#define STRONG_ALIAS(alias,sym) \\r
- .globl alias; \\r
- alias = sym\r
-\r
-#ifdef __STDC__\r
-#define WARN_REFERENCES(sym,msg) \\r
- .stabs msg ## ,30,0,0,0 ; \\r
- .stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0\r
-#elif defined(__ELF__)\r
-#define WARN_REFERENCES(sym,msg) \\r
- .stabs msg,30,0,0,0 ; \\r
- .stabs __STRING(sym),1,0,0,0\r
-#else\r
-#define WARN_REFERENCES(sym,msg) \\r
- .stabs msg,30,0,0,0 ; \\r
- .stabs __STRING(_/**/sym),1,0,0,0\r
-#endif /* __STDC__ */\r
-\r
-\r
-\r
-#endif /* !_I386_ASM_H_ */\r