X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=geekos%2Fsrc%2Fgeekos%2Fsymbol.asm;fp=geekos%2Fsrc%2Fgeekos%2Fsymbol.asm;h=df9abf24c19d1ccb068f7ec0ba43d9279f12a9e2;hp=0000000000000000000000000000000000000000;hb=ddc16b0737cf58f7aa90a69c6652cdf4090aec51;hpb=626595465a2c6987606a6bc697df65130ad8c2d3 diff --git a/geekos/src/geekos/symbol.asm b/geekos/src/geekos/symbol.asm new file mode 100644 index 0000000..df9abf2 --- /dev/null +++ b/geekos/src/geekos/symbol.asm @@ -0,0 +1,43 @@ +; Symbol mangling macros +; Copyright (c) 2001, David H. Hovemeyer +; $Revision: 1.2 $ + +; This file defines macros for dealing with externally-visible +; symbols that must be mangled for some object file formats. +; For example, PECOFF requires a leading underscore, while +; ELF does not. + +; EXPORT defines a symbol as global +; IMPORT references a symbol defined in another module + +; Thanks to Christopher Giese for providing the NASM macros +; (thus saving me hours of frustration). + +%ifndef __VMM_SYMBOL_ASM +%define __VMM_SYMBOL_ASM + +%ifdef NEED_UNDERSCORE + +%macro EXPORT 1 +[GLOBAL _%1] +%define %1 _%1 +%endmacro + +%macro IMPORT 1 +[EXTERN _%1] +%define %1 _%1 +%endmacro + +%else + +%macro EXPORT 1 +[GLOBAL %1] +%endmacro + +%macro IMPORT 1 +[EXTERN %1] +%endmacro + +%endif + +%endif