Annotation of sys/arch/vax/include/asm.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: asm.h,v 1.8 2003/06/02 23:27:57 millert Exp $ */
! 2: /* $NetBSD: asm.h,v 1.9 1999/01/15 13:31:28 bouyer Exp $ */
! 3: /*
! 4: * Copyright (c) 1982, 1993
! 5: * The Regents of the University of California. All rights reserved.
! 6: *
! 7: * Redistribution and use in source and binary forms, with or without
! 8: * modification, are permitted provided that the following conditions
! 9: * are met:
! 10: * 1. Redistributions of source code must retain the above copyright
! 11: * notice, this list of conditions and the following disclaimer.
! 12: * 2. Redistributions in binary form must reproduce the above copyright
! 13: * notice, this list of conditions and the following disclaimer in the
! 14: * documentation and/or other materials provided with the distribution.
! 15: * 3. Neither the name of the University nor the names of its contributors
! 16: * may be used to endorse or promote products derived from this software
! 17: * without specific prior written permission.
! 18: *
! 19: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 20: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 21: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 22: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 23: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 24: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 25: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 26: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 27: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 28: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 29: * SUCH DAMAGE.
! 30: *
! 31: * @(#)DEFS.h 8.1 (Berkeley) 6/4/93
! 32: */
! 33:
! 34: #ifndef _MACHINE_ASM_H_
! 35: #define _MACHINE_ASM_H_
! 36:
! 37: #define R0 0x001
! 38: #define R1 0x002
! 39: #define R2 0x004
! 40: #define R3 0x008
! 41: #define R4 0x010
! 42: #define R5 0x020
! 43: #define R6 0x040
! 44: #define R7 0x080
! 45: #define R8 0x100
! 46: #define R9 0x200
! 47: #define R10 0x400
! 48: #define R11 0x800
! 49:
! 50: #ifdef __ELF__
! 51: # define _C_LABEL(x) x
! 52: #else
! 53: # ifdef __STDC__
! 54: # define _C_LABEL(x) _ ## x
! 55: # else
! 56: # define _C_LABEL(x) _/**/x
! 57: # endif
! 58: #endif
! 59:
! 60: #define _ASM_LABEL(x) x
! 61:
! 62: #ifdef __STDC__
! 63: # define __CONCAT(x,y) x ## y
! 64: # define __STRING(x) #x
! 65: #else
! 66: # define __CONCAT(x,y) x/**/y
! 67: # define __STRING(x) "x"
! 68: #endif
! 69:
! 70: /* let kernels and others override entrypoint alignment */
! 71: #ifndef _ALIGN_TEXT
! 72: # ifdef __ELF__
! 73: # define _ALIGN_TEXT .align 4
! 74: # else
! 75: # define _ALIGN_TEXT .align 2
! 76: # endif
! 77: #endif
! 78:
! 79: #define _ENTRY(x, regs) \
! 80: .text; _ALIGN_TEXT; .globl x; .type x,@function; x: .word regs
! 81:
! 82: #ifdef GPROF
! 83: # ifdef __ELF__
! 84: # define _PROF_PROLOGUE \
! 85: .data; 1:; .long 0; .text; moval 1b,r0; jsb _ASM_LABEL(__mcount)
! 86: # else
! 87: # define _PROF_PROLOGUE \
! 88: .data; 1:; .long 0; .text; moval 1b,r0; jsb _ASM_LABEL(mcount)
! 89: # endif
! 90: #else
! 91: # define _PROF_PROLOGUE
! 92: #endif
! 93:
! 94: #define ENTRY(x, regs) _ENTRY(_C_LABEL(x), regs); _PROF_PROLOGUE
! 95: #define NENTRY(x, regs) _ENTRY(_C_LABEL(x), regs)
! 96: #define ASENTRY(x, regs) _ENTRY(_ASM_LABEL(x), regs); _PROF_PROLOGUE
! 97:
! 98: #define ALTENTRY(x) .globl _C_LABEL(x); _C_LABEL(x):
! 99: #define RCSID(x) .text; .asciz x
! 100:
! 101: #ifdef __ELF__
! 102: #define WEAK_ALIAS(alias,sym) \
! 103: .weak alias; \
! 104: alias = sym
! 105: #else
! 106: #ifdef __STDC__
! 107: #define WEAK_ALIAS(alias,sym) \
! 108: .weak _##alias; \
! 109: _##alias = _##sym
! 110: #else
! 111: #define WEAK_ALIAS(alias,sym) \
! 112: .weak _/**/alias; \
! 113: _/**/alias = _/**/sym
! 114: #endif
! 115: #endif
! 116:
! 117: #ifdef __STDC__
! 118: #define WARN_REFERENCES(sym,msg) \
! 119: .stabs msg ## ,30,0,0,0 ; \
! 120: .stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
! 121: #else
! 122: #define WARN_REFERENCES(sym,msg) \
! 123: .stabs msg,30,0,0,0 ; \
! 124: .stabs __STRING(_C_LABEL(sym)),1,0,0,0
! 125: #endif /* __STDC__ */
! 126:
! 127: #endif /* _MACHINE_ASM_H_ */
CVSweb