Print this page
de-linting of .s files
first

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/ml/hypersubr.s
          +++ new/usr/src/uts/intel/ia32/ml/hypersubr.s
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  
  31   31  #include <sys/asm_linkage.h>
  32   32  #ifndef __xpv
  33   33  #include <sys/xpv_support.h>
  34   34  #endif
  35   35  #include <sys/hypervisor.h>
  36   36  
  37   37  /*
  38   38   * Hypervisor "system calls"
  39   39   *
  40      - * i386
  41      - *      %eax == call number
  42      - *      args in registers (%ebx, %ecx, %edx, %esi, %edi)
  43      - *
  44   40   * amd64
  45   41   *      %rax == call number
  46   42   *      args in registers (%rdi, %rsi, %rdx, %r10, %r8, %r9)
  47   43   *
  48      - * Note that for amd64 we use %r10 instead of %rcx for passing 4th argument
  49      - * as in C calling convention since the "syscall" instruction clobbers %rcx.
       44 + * Note that we use %r10 instead of %rcx for passing 4th argument as in
       45 + * C calling convention since the "syscall" instruction clobbers %rcx.
  50   46   *
  51   47   * (These calls can be done more efficiently as gcc-style inlines, but
  52   48   * for simplicity and help with initial debugging, we use these primitives
  53   49   * to build the hypervisor calls up from C wrappers.)
  54   50   */
  55   51  
  56      -#if defined(__lint)
  57      -
  58      -/*ARGSUSED*/
  59      -long
  60      -__hypercall0(int callnum)
  61      -{ return (0); }
  62      -
  63      -/*ARGSUSED*/
  64      -long
  65      -__hypercall1(int callnum, ulong_t a1)
  66      -{ return (0); }
  67      -
  68      -/*ARGSUSED*/
  69      -long
  70      -__hypercall2(int callnum, ulong_t a1, ulong_t a2)
  71      -{ return (0); }
  72      -
  73      -/*ARGSUSED*/
  74      -long
  75      -__hypercall3(int callnum, ulong_t a1, ulong_t a2, ulong_t a3)
  76      -{ return (0); }
  77      -
  78      -/*ARGSUSED*/
  79      -long
  80      -__hypercall4(int callnum, ulong_t a1, ulong_t a2, ulong_t a3, ulong_t a4)
  81      -{ return (0); }
  82      -
  83      -/*ARGSUSED*/
  84      -long
  85      -__hypercall5(int callnum,
  86      -    ulong_t a1, ulong_t a2, ulong_t a3, ulong_t a4, ulong_t a5)
  87      -{ return (0); }
  88      -
  89      -/*ARGSUSED*/
  90      -int
  91      -__hypercall0_int(int callnum)
  92      -{ return (0); }
  93      -
  94      -/*ARGSUSED*/
  95      -int
  96      -__hypercall1_int(int callnum, ulong_t a1)
  97      -{ return (0); }
  98      -
  99      -/*ARGSUSED*/
 100      -int
 101      -__hypercall2_int(int callnum, ulong_t a1, ulong_t a2)
 102      -{ return (0); }
 103      -
 104      -/*ARGSUSED*/
 105      -int
 106      -__hypercall3_int(int callnum, ulong_t a1, ulong_t a2, ulong_t a3)
 107      -{ return (0); }
 108      -
 109      -/*ARGSUSED*/
 110      -int
 111      -__hypercall4_int(int callnum, ulong_t a1, ulong_t a2, ulong_t a3, ulong_t a4)
 112      -{ return (0); }
 113      -
 114      -/*ARGSUSED*/
 115      -int
 116      -__hypercall5_int(int callnum,
 117      -    ulong_t a1, ulong_t a2, ulong_t a3, ulong_t a4, ulong_t a5)
 118      -{ return (0); }
 119      -
 120      -#else   /* __lint */
 121      -
 122   52  /*
 123   53   * XXPV grr - assembler can't deal with an instruction in a quoted string
 124   54   */
 125   55  #undef  TRAP_INSTR      /* cause it's currently "int $0x82" */
 126   56  
 127   57  /*
 128   58   * The method for issuing a hypercall (i.e. a system call to the
 129   59   * hypervisor) varies from platform to platform.  In 32-bit PV domains, an
 130   60   * 'int 82' triggers the call.  In 64-bit PV domains, a 'syscall' does the
 131   61   * trick.
↓ open down ↓ 25 lines elided ↑ open up ↑
 157   87  hypercall_shared_info_page:
 158   88          .skip   HYPERCALL_SHINFO_PAGESIZE
 159   89  
 160   90          .text
 161   91          .align  HYPERCALL_PAGESIZE
 162   92          .globl  hypercall_page
 163   93          .type   hypercall_page, @function
 164   94  hypercall_page:
 165   95          .skip   HYPERCALL_PAGESIZE
 166   96          .size   hypercall_page, HYPERCALL_PAGESIZE
 167      -#if defined(__amd64)
 168   97  #define TRAP_INSTR                      \
 169   98          shll    $5, %eax;               \
 170   99          addq    $hypercall_page, %rax;  \
 171  100          INDIRECT_JMP_REG(rax);
 172      -#else
 173      -#define TRAP_INSTR                      \
 174      -        shll    $5, %eax;               \
 175      -        addl    $hypercall_page, %eax;  \
 176      -        call    *%eax
 177      -#endif
 178  101  
 179  102  #else /* !_xpv */
 180  103  
 181      -#if defined(__amd64)
 182  104  #define TRAP_INSTR      syscall
 183      -#elif defined(__i386)
 184      -#define TRAP_INSTR      int $0x82
 185      -#endif
 186  105  #endif /* !__xpv */
 187  106  
 188  107  
 189      -#if defined(__amd64)
 190      -
 191  108          ENTRY_NP(__hypercall0)
 192  109          ALTENTRY(__hypercall0_int)
 193  110          movl    %edi, %eax
 194  111          TRAP_INSTR
 195  112          ret
 196  113          SET_SIZE(__hypercall0)
 197  114  
 198  115          ENTRY_NP(__hypercall1)
 199  116          ALTENTRY(__hypercall1_int)
 200  117          movl    %edi, %eax
↓ open down ↓ 37 lines elided ↑ open up ↑
 238  155          movl    %edi, %eax
 239  156          movq    %rsi, %rdi              /* arg 1 */
 240  157          movq    %rdx, %rsi              /* arg 2 */
 241  158          movq    %rcx, %rdx              /* arg 3 */
 242  159          movq    %r8, %r10               /* r10 = 4th arg */
 243  160          movq    %r9, %r8                /* arg 5 */
 244  161          TRAP_INSTR
 245  162          ret
 246  163          SET_SIZE(__hypercall5)
 247  164  
 248      -#elif defined(__i386)
 249      -
 250      -        ENTRY_NP(__hypercall0)
 251      -        ALTENTRY(__hypercall0_int)
 252      -        movl    4(%esp), %eax
 253      -        TRAP_INSTR
 254      -        ret
 255      -        SET_SIZE(__hypercall0)
 256      -
 257      -        ENTRY_NP(__hypercall1)
 258      -        ALTENTRY(__hypercall1_int)
 259      -        pushl   %ebx
 260      -        movl    8(%esp), %eax
 261      -        movl    12(%esp), %ebx
 262      -        TRAP_INSTR
 263      -        popl    %ebx
 264      -        ret
 265      -        SET_SIZE(__hypercall1)
 266      -
 267      -        ENTRY_NP(__hypercall2)
 268      -        ALTENTRY(__hypercall2_int)
 269      -        pushl   %ebx
 270      -        movl    8(%esp), %eax
 271      -        movl    12(%esp), %ebx
 272      -        movl    16(%esp), %ecx
 273      -        TRAP_INSTR
 274      -        popl    %ebx
 275      -        ret
 276      -        SET_SIZE(__hypercall2)
 277      -
 278      -        ENTRY_NP(__hypercall3)
 279      -        ALTENTRY(__hypercall3_int)
 280      -        pushl   %ebx
 281      -        movl    8(%esp), %eax
 282      -        movl    12(%esp), %ebx
 283      -        movl    16(%esp), %ecx
 284      -        movl    20(%esp), %edx
 285      -        TRAP_INSTR
 286      -        popl    %ebx
 287      -        ret
 288      -        SET_SIZE(__hypercall3)
 289      -
 290      -        ENTRY_NP(__hypercall4)
 291      -        ALTENTRY(__hypercall4_int)
 292      -        pushl   %ebx
 293      -        pushl   %esi
 294      -        movl    12(%esp), %eax
 295      -        movl    16(%esp), %ebx
 296      -        movl    20(%esp), %ecx
 297      -        movl    24(%esp), %edx
 298      -        movl    28(%esp), %esi
 299      -        TRAP_INSTR
 300      -        popl    %esi
 301      -        popl    %ebx
 302      -        ret
 303      -        SET_SIZE(__hypercall4)
 304      -
 305      -        ENTRY_NP(__hypercall5)
 306      -        ALTENTRY(__hypercall5_int)
 307      -        pushl   %ebx
 308      -        pushl   %esi
 309      -        pushl   %edi
 310      -        movl    16(%esp), %eax
 311      -        movl    20(%esp), %ebx
 312      -        movl    24(%esp), %ecx
 313      -        movl    28(%esp), %edx
 314      -        movl    32(%esp), %esi
 315      -        movl    36(%esp), %edi
 316      -        TRAP_INSTR
 317      -        popl    %edi
 318      -        popl    %esi
 319      -        popl    %ebx
 320      -        ret
 321      -        SET_SIZE(__hypercall5)
 322      -
 323      -#endif  /* __i386 */
 324      -
 325      -#endif  /* lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX