Print this page
de-linting of .s files


  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  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 /*
  26  * This is an assembly file that gets #include-ed into the brand-specific
  27  * assembly files (e.g. sn1_brand_asm.s) for Solaris-derived brands.
  28  * We can't make these into functions since in the trap context there's
  29  * no easy place to save the extra parameters that would be required, so
  30  * each brand module needs its own copy of this code.  We #include this and
  31  * use brand-specific #defines to replace the XXX_brand_... definitions.
  32  */ 
  33 
  34 #ifdef lint
  35 
  36 #include <sys/systm.h>
  37 
  38 void
  39 XXX_brand_syscall32_callback(void)
  40 {
  41 }
  42 
  43 void
  44 XXX_brand_syscall_callback(void)
  45 {
  46 }
  47 
  48 #else   /* !lint */
  49 
  50 #include <sys/asm_linkage.h>
  51 #include <sys/machthread.h>
  52 #include <sys/privregs.h>
  53 #include "assym.h"
  54 
  55 #ifdef _ASM     /* The remainder of this file is only for assembly files */
  56 
  57 #if defined(sun4v)
  58 
  59 #define GLOBALS_SWAP(reg)                               \
  60         rdpr    %gl, reg;                               \
  61         wrpr    reg, 1, %gl
  62 
  63 /*
  64  * The GLOBALS_RESTORE macro can only be one instruction since it's
  65  * used in a delay slot.
  66  */
  67 #define GLOBALS_RESTORE(reg)                            \
  68         wrpr    reg, 0, %gl
  69 


 282          * Note that %g2 should be loaded with the CPU struct addr and
 283          * %g1 should be loaded the address we're going to return to.
 284          */
 285 #if defined(sun4v)
 286         /* restore the alternate global registers after incrementing %gl */
 287         mov     %l2, %g1;               /* restore %g1 from %l2 */
 288         mov     %l3, %g2;               /* restore %g2 from %l3 */
 289 
 290         ldn     [%g2 + CPU_TMP4], %l3;  /* restore locals */
 291         ldn     [%g2 + CPU_TMP3], %l2;
 292 #endif /* sun4v */
 293 
 294         ldn     [%g2 + CPU_TMP2], %l1;  /* restore locals */
 295         ldn     [%g2 + CPU_TMP1], %l0;
 296 
 297         jmp     %g1;
 298         nop;
 299 SET_SIZE(XXX_brand_syscall_callback_common)
 300 
 301 #endif  /* _ASM */
 302 #endif  /* !lint */


  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  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 /*
  26  * This is an assembly file that gets #include-ed into the brand-specific
  27  * assembly files (e.g. sn1_brand_asm.s) for Solaris-derived brands.
  28  * We can't make these into functions since in the trap context there's
  29  * no easy place to save the extra parameters that would be required, so
  30  * each brand module needs its own copy of this code.  We #include this and
  31  * use brand-specific #defines to replace the XXX_brand_... definitions.
  32  */ 
  33 
















  34 #include <sys/asm_linkage.h>
  35 #include <sys/machthread.h>
  36 #include <sys/privregs.h>
  37 #include "assym.h"
  38 
  39 #ifdef _ASM     /* The remainder of this file is only for assembly files */
  40 
  41 #if defined(sun4v)
  42 
  43 #define GLOBALS_SWAP(reg)                               \
  44         rdpr    %gl, reg;                               \
  45         wrpr    reg, 1, %gl
  46 
  47 /*
  48  * The GLOBALS_RESTORE macro can only be one instruction since it's
  49  * used in a delay slot.
  50  */
  51 #define GLOBALS_RESTORE(reg)                            \
  52         wrpr    reg, 0, %gl
  53 


 266          * Note that %g2 should be loaded with the CPU struct addr and
 267          * %g1 should be loaded the address we're going to return to.
 268          */
 269 #if defined(sun4v)
 270         /* restore the alternate global registers after incrementing %gl */
 271         mov     %l2, %g1;               /* restore %g1 from %l2 */
 272         mov     %l3, %g2;               /* restore %g2 from %l3 */
 273 
 274         ldn     [%g2 + CPU_TMP4], %l3;  /* restore locals */
 275         ldn     [%g2 + CPU_TMP3], %l2;
 276 #endif /* sun4v */
 277 
 278         ldn     [%g2 + CPU_TMP2], %l1;  /* restore locals */
 279         ldn     [%g2 + CPU_TMP1], %l0;
 280 
 281         jmp     %g1;
 282         nop;
 283 SET_SIZE(XXX_brand_syscall_callback_common)
 284 
 285 #endif  /* _ASM */