#define _C_LABEL(x) x
#define LLABEL(name,num) L ## name ## num
#if defined(GPROF)
#define MCOUNT \
alloc out0 = ar.pfs, 8, 0, 4, 0; \
mov out1 = r1; \
mov out2 = b0;; \
mov out3 = r0; \
br.call.sptk b0 = _mcount;;
#else
#define MCOUNT
#endif
#define ENTRY(_name_, _n_args_) \
.global _name_; \
.align 16; \
.proc _name_; \
_name_:; \
.regstk _n_args_, 0, 0, 0; \
MCOUNT
#define ENTRY_NOPROFILE(_name_, _n_args_) \
.global _name_; \
.align 16; \
.proc _name_; \
_name_:; \
.regstk _n_args_, 0, 0, 0
#define STATIC_ENTRY(_name_, _n_args_) \
.align 16; \
.proc _name_; \
_name_:; \
.regstk _n_args_, 0, 0, 0 \
MCOUNT
#define XENTRY(_name_) \
.globl _name_; \
_name_:
#define STATIC_XENTRY(_name_) \
_name_:
#define END(_name_) \
.endp _name_
#define EXPORT(_name_) \
.global _name_; \
_name_:
#define IMPORT(_name_, _size_) \
#define ABS(_name_, _value_) \
.globl _name_; \
_name_ = _value_
#define BSS(_name_,_numbytes_) \
.comm _name_,_numbytes_
#define ASCIZ .asciz
#define MSG(msg,reg,label) \
addl reg,@ltoff(label),gp;; \
ld8 reg=[reg];; \
.data; \
label: ASCIZ msg; \
.text;
#define SYSCALLNUM(name) ___CONCAT(SYS_,name)
#define CALLSYS_NOERROR(name) \
{ .mmi ; \
alloc r9 = ar.pfs, 0, 0, 8, 0 ; \
mov r31 = ar.k5 ; \
mov r10 = b0 ;; } \
{ .mib ; \
mov r8 = SYSCALLNUM(name) ; \
mov b7 = r31 ; \
br.call.sptk b0 = b7 ;; }
#define WEAK_ALIAS(alias,sym) \
.weak alias; \
alias = sym
#define STRONG_ALIAS(alias,sym) \
.globl alias; \
alias = sym
#ifdef __STDC__
#define WARN_REFERENCES(sym,msg) \
.pushsection .gnu.warning. ## sym; \
.ascii msg; \
.popsection
#else
#define WARN_REFERENCES(sym,msg) \
.pushsection .gnu.warning.sym; \
.ascii msg; \
.popsection
#endif
#ifdef __ELF__
#ifdef _NETBSD_REVISIONID
#define RCSID(x) .pushsection ".ident","MS",@progbits,1; \
.asciz x; \
.ascii "$"; .ascii "NetBSD: "; .ascii __FILE__; \
.ascii " "; .ascii _NETBSD_REVISIONID; \
.asciz " $"; \
.popsection
#else
#define RCSID(x) .pushsection ".ident","MS",@progbits,1; \
.asciz x; \
.popsection
#endif
#else
#define RCSID(name) .asciz name
#endif
#ifdef _KERNEL
#define __KERNEL_SECTIONSTRING(_sec, _str) \
.pushsection _sec ; .asciz _str ; .popsection
#ifdef _NETBSD_REVISIONID
#define __KERNEL_RCSID(_n, _s) __KERNEL_SECTIONSTRING(.ident, \
"$" "NetBSD: " __FILE__ " " \
_NETBSD_REVISIONID " $")
#else
#define __KERNEL_RCSID(_n, _s) __KERNEL_SECTIONSTRING(.ident, _s)
#endif
#define __KERNEL_COPYRIGHT(_n, _s) __KERNEL_SECTIONSTRING(.copyright, _s)
#ifdef NO_KERNEL_RCSIDS
#undef __KERNEL_RCSID
#define __KERNEL_RCSID(_n, _s)
#endif
#endif