1 /* 2 Copyright (c) 1990 The Regents of the University of California. 3 All rights reserved. 4 5 Redistribution and use in source and binary forms are permitted 6 provided that the above copyright notice and this paragraph are 7 duplicated in all such forms and that any documentation, 8 and/or other materials related to such 9 distribution and use acknowledge that the software was developed 10 by the University of California, Berkeley. The name of the 11 University may not be used to endorse or promote products derived 12 from this software without specific prior written permission. 13 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 */ 17 /* This file was based on the modified setjmp.S performed by 18 * Joel Sherill (joel@OARcorp.com) which specified the use 19 * of the __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ macros. 20 ** 21 ** This file is distributed WITHOUT ANY WARRANTY; without even the implied 22 ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23 */ 24 25 /* These are predefined by new versions of GNU cpp. */ 26 27 #ifndef __USER_LABEL_PREFIX__ 28 #define __USER_LABEL_PREFIX__ _ 29 #endif 30 31 #define __REG_PREFIX__ % 32 33 /* ANSI concatenation macros. */ 34 35 #define CONCAT1(a, b) CONCAT2(a, b) 36 #define CONCAT2(a, b) a##b 37 38 /* Use the right prefix for global labels. */ 39 40 #define SYM(x) CONCAT1(__USER_LABEL_PREFIX__, x) 41 42 /* Use the right prefix for registers. */ 43 44 #define REG(x) CONCAT1(__REG_PREFIX__, x) 45 46 #define eax REG(eax) 47 #define ebx REG(ebx) 48 #define ecx REG(ecx) 49 #define edx REG(edx) 50 #define esi REG(esi) 51 #define edi REG(edi) 52 #define ebp REG(ebp) 53 #define esp REG(esp) 54 55 #define st0 REG(st) 56 #define st1 REG(st(1)) 57 #define st2 REG(st(2)) 58 #define st3 REG(st(3)) 59 #define st4 REG(st(4)) 60 #define st5 REG(st(5)) 61 #define st6 REG(st(6)) 62 #define st7 REG(st(7)) 63 64 #define ax REG(ax) 65 #define bx REG(bx) 66 #define cx REG(cx) 67 #define dx REG(dx) 68 69 #define ah REG(ah) 70 #define bh REG(bh) 71 #define ch REG(ch) 72 #define dh REG(dh) 73 74 #define al REG(al) 75 #define bl REG(bl) 76 #define cl REG(cl) 77 #define dl REG(dl) 78 79 #define mm1 REG(mm1) 80 #define mm2 REG(mm2) 81 #define mm3 REG(mm3) 82 #define mm4 REG(mm4) 83 #define mm5 REG(mm5) 84 #define mm6 REG(mm6) 85 #define mm7 REG(mm7) 86 87 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION 88 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function 89 #else 90 #define SOTYPE_FUNCTION(sym) 91 #endif 92 93 #ifndef _I386MACH_DISABLE_HW_INTERRUPTS 94 #define __CLI 95 #define __STI 96 #else 97 #define __CLI cli 98 #define __STI sti 99 #endif 100