1 /* 2 * Copyright (c) 1992 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Ralph Campbell. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)machAsmDefs.h 7.1 (Berkeley) 01/07/92 11 * 12 * machAsmDefs.h -- 13 * 14 * Macros used when writing assembler programs. 15 * 16 * Copyright (C) 1989 Digital Equipment Corporation. 17 * Permission to use, copy, modify, and distribute this software and 18 * its documentation for any purpose and without fee is hereby granted, 19 * provided that the above copyright notice appears in all copies. 20 * Digital Equipment Corporation makes no representations about the 21 * suitability of this software for any purpose. It is provided "as is" 22 * without express or implied warranty. 23 * 24 * from: $Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAsmDefs.h, 25 * v 1.2 89/08/15 18:28:24 rab Exp $ SPRITE (DECWRL) 26 */ 27 28 #ifndef _MACHASMDEFS 29 #define _MACHASMDEFS 30 31 /* 32 * LEAF(x) 33 * 34 * Declare a leaf routine. 35 */ 36 #define LEAF(x) \ 37 .globl x; \ 38 .ent x, 0; \ 39 x: ; \ 40 .frame sp, 0, ra 41 42 /* 43 * ALEAF -- declare alternate entry to leaf routine 44 */ 45 #define ALEAF(x) \ 46 .globl x; \ 47 .aent x,0; \ 48 x: 49 50 /* 51 * NON_LEAF(x) 52 * 53 * Declare a non-leaf routine (a routine that makes other C calls). 54 */ 55 #define NON_LEAF(x, fsize, retpc) \ 56 .globl x; \ 57 .ent x, 0; \ 58 x: ; \ 59 .frame sp, fsize, retpc 60 61 /* 62 * END(x) 63 * 64 * Mark end of a procedure. 65 */ 66 #define END(x) \ 67 .end x 68 69 #define STAND_FRAME_SIZE 24 70 #define STAND_RA_OFFSET 20 71 72 /* 73 * Macros to panic and printf from assembly language. 74 */ 75 #define PANIC(msg) \ 76 la a0, 9f; \ 77 jal panic; \ 78 MSG(msg) 79 80 #define PRINTF(msg) \ 81 la a0,9f; \ 82 jal printf; \ 83 MSG(msg) 84 85 #define MSG(msg) \ 86 .rdata; \ 87 9: .asciiz msg; \ 88 .text 89 90 #endif /* _MACHASMDEFS */ 91