Print this page
de-linting of .s files


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #pragma ident   "%Z%%M% %I%     %E% SMI"
  28 
  29 #include <sys/asm_linkage.h>
  30 #include <sys/hypervisor.h>
  31 #include <sys/privregs.h>
  32 #include <sys/segments.h>
  33 #include <sys/traptrace.h>
  34 #include <sys/trap.h>
  35 #include <sys/psw.h>
  36 #include <sys/x86_archext.h>
  37 #include <sys/asm_misc.h>
  38 
  39 #if !defined(__lint)
  40 #include "assym.h"
  41 #endif
  42 
  43 #if defined(__lint)
  44 
  45 void
  46 xen_failsafe_callback(void)
  47 {}
  48 
  49 void
  50 xen_callback(void)
  51 {}
  52 
  53 #else   /* __lint */
  54 
  55         /*
  56          * The stack frame for events is exactly that of an x86 hardware
  57          * interrupt.
  58          *
  59          * The stack frame for a failsafe callback is augmented with saved
  60          * values for segment registers:
  61          *
  62          * i386
  63          *      %ds, %es, %fs, %gs, %eip, %cs, %eflags [, %oldesp, %oldss ]
  64          *
  65          * On amd64 the stack frame for events is exactly that of an hardware
  66          * interrupt with the addition of rcx and r11.
  67          * 
  68          * The stack frame for a failsafe callback is augmented with saved
  69          * values for segment registers:
  70          * 
  71          * amd64
  72          *      %rcx, %r11, %ds, %es, %fs, %gs, %rip, %cs, %rflags,
  73          *      [, %oldrsp, %oldss ]
  74          *


 229 
 230         TRACE_PTR(%edi, %ebx, %ebx, %ecx, $TT_EVENT) /* Uses labels 8 and 9 */
 231         TRACE_REGS(%edi, %esp, %ebx, %ecx)      /* Uses label 9 */
 232         TRACE_STAMP(%edi)               /* Clobbers %eax, %edx, uses 9 */
 233 
 234         movl    %esp, %ebp
 235 
 236         TRACE_STACK(%edi)
 237 
 238         pushl   %edi                    /* pass trap trace record pointer */
 239         pushl   %ebp                    /* pass struct regs pointer */
 240         call    xen_callback_handler
 241         addl    $8, %esp
 242 
 243         jmp     _sys_rtt_ints_disabled
 244         /*NOTREACHED*/
 245 
 246         SET_SIZE(xen_callback)
 247 
 248 #endif  /* __i386 */
 249 #endif  /* __lint */


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 


  27 #include <sys/asm_linkage.h>
  28 #include <sys/hypervisor.h>
  29 #include <sys/privregs.h>
  30 #include <sys/segments.h>
  31 #include <sys/traptrace.h>
  32 #include <sys/trap.h>
  33 #include <sys/psw.h>
  34 #include <sys/x86_archext.h>
  35 #include <sys/asm_misc.h>
  36 

  37 #include "assym.h"

  38 












  39         /*
  40          * The stack frame for events is exactly that of an x86 hardware
  41          * interrupt.
  42          *
  43          * The stack frame for a failsafe callback is augmented with saved
  44          * values for segment registers:
  45          *
  46          * i386
  47          *      %ds, %es, %fs, %gs, %eip, %cs, %eflags [, %oldesp, %oldss ]
  48          *
  49          * On amd64 the stack frame for events is exactly that of an hardware
  50          * interrupt with the addition of rcx and r11.
  51          * 
  52          * The stack frame for a failsafe callback is augmented with saved
  53          * values for segment registers:
  54          * 
  55          * amd64
  56          *      %rcx, %r11, %ds, %es, %fs, %gs, %rip, %cs, %rflags,
  57          *      [, %oldrsp, %oldss ]
  58          *


 213 
 214         TRACE_PTR(%edi, %ebx, %ebx, %ecx, $TT_EVENT) /* Uses labels 8 and 9 */
 215         TRACE_REGS(%edi, %esp, %ebx, %ecx)      /* Uses label 9 */
 216         TRACE_STAMP(%edi)               /* Clobbers %eax, %edx, uses 9 */
 217 
 218         movl    %esp, %ebp
 219 
 220         TRACE_STACK(%edi)
 221 
 222         pushl   %edi                    /* pass trap trace record pointer */
 223         pushl   %ebp                    /* pass struct regs pointer */
 224         call    xen_callback_handler
 225         addl    $8, %esp
 226 
 227         jmp     _sys_rtt_ints_disabled
 228         /*NOTREACHED*/
 229 
 230         SET_SIZE(xen_callback)
 231 
 232 #endif  /* __i386 */