]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/asm.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / i386 / asm.h
index a3a0d524bc1a23200954d92580196590b3d8dbd0..17b28bc9994e7a8d48166d2a347184613b3ef7e7 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- * 
+ *
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
  * unlawful or unlicensed copies of an Apple operating system, or to
  * circumvent, violate, or enable the circumvention or violation of, any
  * terms of an Apple operating system software license agreement.
- * 
+ *
  * Please obtain a copy of the License at
  * http://www.opensource.apple.com/apsl/ and read it before using this file.
- * 
+ *
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  * Please see the License for the specific language governing rights and
  * limitations under the License.
- * 
+ *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /*
  * @OSF_COPYRIGHT@
  */
-/* 
+/*
  * Mach Operating System
  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
  * All Rights Reserved.
- * 
+ *
  * Permission to use, copy, modify and distribute this software and its
  * documentation is hereby granted, provided that both the copyright
  * notice and this permission notice appear in all copies of the
  * software, derivative works or modified versions, and any portions
  * thereof, and that both notices appear in supporting documentation.
- * 
+ *
  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- * 
+ *
  * Carnegie Mellon requests users of this software to return to
- * 
+ *
  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  *  School of Computer Science
  *  Carnegie Mellon University
  *  Pittsburgh PA 15213-3890
- * 
+ *
  * any improvements or extensions that they make and grant Carnegie Mellon
  * the rights to redistribute these changes.
  */
 #ifndef        _I386_ASM_H_
 #define        _I386_ASM_H_
 
-#ifdef _KERNEL
-#include <gprof.h>
-#endif /* _KERNEL */
-
-#if    defined(MACH_KERNEL) || defined(_KERNEL)
-#include <gprof.h>
-#endif /* MACH_KERNEL || _KERNEL */
-
 #if defined(__i386__)
 
 #define S_PC    (%esp)
@@ -99,9 +91,9 @@
 #endif
 
 /* There is another definition of ALIGN for .c sources */
-#ifdef ASSEMBLER
+#ifdef __ASSEMBLER__
 #define ALIGN 4,0x90
-#endif /* ASSEMBLER */
+#endif /* __ASSEMBLER__ */
 
 #ifndef FALIGN
 #define FALIGN ALIGN
 #define data16 .byte 0x66
 #define addr16 .byte 0x67
 
-#if !GPROF
 #define MCOUNT
 
-#elif defined(__SHARED__)
+#if defined(__SHARED__)
 #define MCOUNT         ; .data;\
                        .align ALIGN;\
                        LBc(x, 8) .long 0;\
                        Egaddr(%eax,_mcount_ptr);\
                        Gpop;\
                        call *(%eax);
-
-#else  /* !GPROF, !__SHARED__ */
-#define MCOUNT         ; call mcount;
-#endif /* GPROF */
+#endif /* __SHARED__ */
 
 #ifdef __ELF__
 #define ELF_FUNC(x)    .type x,@function
 #define Lgmemload(lab,reg)     movl Lgotoff(lab),reg
 #define Lgmemstore(reg,lab,tmp)        movl reg,Lgotoff(lab)
 
-#ifndef ASSEMBLER
+#ifndef __ASSEMBLER__
 /* These defines are here for .c files that wish to reference global symbols
  * within __asm__ statements. 
  */
 #else
 #define CC_SYM_PREFIX ""
 #endif /* __NO_UNDERSCORES__ */
-#endif /* ASSEMBLER */
+#endif /* __ASSEMBLER__ */
 
 /*
  * The following macros make calls into C code.
        leaq    (%rsp), %rsi                    ;\
        call    EXT(fn)                         ;\
        mov     (%rsp), %rsp
-       
+
 #define CCALL(fn)                               \
        mov     %rsp, %r12                      ;\
        and     $0xFFFFFFFFFFFFFFF0, %rsp       ;\
 
 #define CCALL2(fn, arg1, arg2)                  \
        mov     arg1, %rdi                      ;\
+       mov     arg2, %rsi                      ;\
        CCALL(fn)
 
 #define CCALL3(fn, arg1, arg2, arg3)            \