asm.h (66486) | asm.h (66633) |
---|---|
1/* $FreeBSD: head/sys/ia64/include/asm.h 66486 2000-09-30 17:48:44Z dfr $ */ | 1/* $FreeBSD: head/sys/ia64/include/asm.h 66633 2000-10-04 17:53:03Z dfr $ */ |
2/* From: NetBSD: asm.h,v 1.18 1997/11/03 04:22:06 ross Exp */ 3 4/* 5 * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University 6 * All Rights Reserved. 7 * 8 * Permission to use, copy, modify and distribute this software and its 9 * documentation is hereby granted, provided that both the copyright --- 52 unchanged lines hidden (view full) --- 62#else 63#define MCOUNT \ 64 .set noat; \ 65 jsr at_reg,_mcount; \ 66 .set at 67#endif 68 69/* | 2/* From: NetBSD: asm.h,v 1.18 1997/11/03 04:22:06 ross Exp */ 3 4/* 5 * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University 6 * All Rights Reserved. 7 * 8 * Permission to use, copy, modify and distribute this software and its 9 * documentation is hereby granted, provided that both the copyright --- 52 unchanged lines hidden (view full) --- 62#else 63#define MCOUNT \ 64 .set noat; \ 65 jsr at_reg,_mcount; \ 66 .set at 67#endif 68 69/* |
70 * LEAF | 70 * ENTRY |
71 * Declare a global leaf function. 72 * A leaf function does not call other functions. 73 */ | 71 * Declare a global leaf function. 72 * A leaf function does not call other functions. 73 */ |
74#define LEAF(_name_, _n_args_) \ | 74#define ENTRY(_name_, _n_args_) \ |
75 .global _name_; \ | 75 .global _name_; \ |
76 .align 16; \ |
|
76 .proc _name_; \ 77_name_:; \ 78 .regstk _n_args_, 0, 0, 0 \ 79 MCOUNT 80 | 77 .proc _name_; \ 78_name_:; \ 79 .regstk _n_args_, 0, 0, 0 \ 80 MCOUNT 81 |
81#define LEAF_NOPROFILE(_name_, _n_args_) \ | 82#define ENTRY_NOPROFILE(_name_, _n_args_) \ |
82 .global _name_; \ | 83 .global _name_; \ |
84 .align 16; \ |
|
83 .proc _name_; \ 84_name_:; \ 85 .regstk _n_args_, 0, 0, 0 86 87/* | 85 .proc _name_; \ 86_name_:; \ 87 .regstk _n_args_, 0, 0, 0 88 89/* |
88 * STATIC_LEAF | 90 * STATIC_ENTRY |
89 * Declare a local leaf function. 90 */ | 91 * Declare a local leaf function. 92 */ |
91#define STATIC_LEAF(_name_, _n_args_) \ | 93#define STATIC_ENTRY(_name_, _n_args_) \ 94 .align 16; \ |
92 .proc _name_; \ 93_name_:; \ 94 .regstk _n_args_, 0, 0, 0 \ 95 MCOUNT 96/* | 95 .proc _name_; \ 96_name_:; \ 97 .regstk _n_args_, 0, 0, 0 \ 98 MCOUNT 99/* |
97 * XLEAF | 100 * XENTRY |
98 * Global alias for a leaf function, or alternate entry point 99 */ | 101 * Global alias for a leaf function, or alternate entry point 102 */ |
100#define XLEAF(_name_) \ | 103#define XENTRY(_name_) \ |
101 .globl _name_; \ 102_name_: 103 104/* | 104 .globl _name_; \ 105_name_: 106 107/* |
105 * STATIC_XLEAF | 108 * STATIC_XENTRY |
106 * Local alias for a leaf function, or alternate entry point 107 */ | 109 * Local alias for a leaf function, or alternate entry point 110 */ |
108#define STATIC_XLEAF(_name_) \ | 111#define STATIC_XENTRY(_name_) \ |
109_name_: 110 | 112_name_: 113 |
111/* 112 * NESTED 113 * Declare a (global) nested function 114 * A nested function calls other functions and needs 115 * to use alloc to save registers. 116 */ 117#define NESTED(_name_,_n_args_) \ 118 .globl _name_; \ 119 .proc _name_; \ 120_name_:; \ 121 .regstk _n_args_, 0, 0, 0 \ 122 MCOUNT | |
123 | 114 |
124#define NESTED_NOPROFILE(_name_,_n_args_) \ 125 .globl _name_; \ 126 .proc _name_; \ 127_name_:; \ 128 .regstk _n_args_, 0, 0, 0 129 | |
130/* | 115/* |
131 * STATIC_NESTED 132 * Declare a local nested function. 133 */ 134#define STATIC_NESTED(_name_,_n_args_) \ 135 .proc _name_; \ 136_name_:; \ 137 .regstk _n_args_, 0, 0, 0 \ 138 MCOUNT 139 140/* 141 * XNESTED 142 * Same as XLEAF, for a nested function. 143 */ 144#define XNESTED(_name_) \ 145 .globl _name_; \ 146_name_: 147 148 149/* 150 * STATIC_XNESTED 151 * Same as STATIC_XLEAF, for a nested function. 152 */ 153#define STATIC_XNESTED(_name_) \ 154_name_: 155 156 157/* | |
158 * END 159 * Function delimiter 160 */ 161#define END(_name_) \ 162 .endp _name_ 163 164 165/* --- 30 unchanged lines hidden (view full) --- 196 .comm _name_,_numbytes_ 197 198 199/* 200 * MSG 201 * Allocate space for a message (a read-only ascii string) 202 */ 203#define ASCIZ .asciz | 116 * END 117 * Function delimiter 118 */ 119#define END(_name_) \ 120 .endp _name_ 121 122 123/* --- 30 unchanged lines hidden (view full) --- 154 .comm _name_,_numbytes_ 155 156 157/* 158 * MSG 159 * Allocate space for a message (a read-only ascii string) 160 */ 161#define ASCIZ .asciz |
204#define MSG(msg,reg,label) \ 205 lda reg, label; \ 206 .data; \ 207label: ASCIZ msg; \ | 162#define MSG(msg,reg,label) \ 163 addl reg,@ltoff(label),gp;; \ 164 ld8 reg=[reg];; \ 165 .data; \ 166label: ASCIZ msg; \ |
208 .text; 209 210/* 211 * System call glue. 212 */ 213#define SYSCALLNUM(name) \ 214 SYS_ ## name 215 --- 36 unchanged lines hidden --- | 167 .text; 168 169/* 170 * System call glue. 171 */ 172#define SYSCALLNUM(name) \ 173 SYS_ ## name 174 --- 36 unchanged lines hidden --- |