Print this page
de-linting of .s files

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4/ml/locore.s
          +++ new/usr/src/uts/sun4/ml/locore.s
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29      -#if defined(lint)
  30      -#include <sys/types.h>
  31      -#include <sys/t_lock.h>
  32      -#include <sys/promif.h>
  33      -#include <sys/prom_isa.h>
  34      -#endif  /* lint */
  35      -
  36   27  #include <sys/asm_linkage.h>
  37   28  #include <sys/privregs.h>
  38   29  #include <sys/scb.h>
  39   30  #include <sys/machparam.h>
  40   31  #include <sys/machthread.h>
  41   32  
  42      -#if defined(lint)
  43      -
  44      -#include <sys/thread.h>
  45      -#include <sys/time.h>
  46      -
  47      -#else   /* lint */
  48      -
  49   33  #include "assym.h"
  50   34  
  51      -#endif  /* lint */
  52      -
  53   35  /*
  54   36   * void
  55   37   * reestablish_curthread(void)
  56   38   *    - reestablishes the invariant that THREAD_REG contains
  57   39   *      the same value as the cpu struct for this cpu (implicit from
  58   40   *      where we're running). This is needed for OBP callback routines.
  59   41   *      The CPU_ADDR macro figures out the cpuid by reading hardware registers.
  60   42   */
  61   43  
  62      -#if defined(lint)
  63      -
  64      -void
  65      -reestablish_curthread(void)
  66      -{}
  67      -
  68      -#else   /* lint */
  69      -
  70   44          ENTRY_NP(reestablish_curthread)
  71   45  
  72   46          CPU_ADDR(%o0, %o1)
  73   47          retl
  74   48          ldn     [%o0 + CPU_THREAD], THREAD_REG
  75   49          SET_SIZE(reestablish_curthread)
  76   50  
  77   51  
  78      -#endif  /* lint */
  79      -
  80   52  /*
  81   53   * Return the current THREAD pointer.
  82   54   * This is also available as an inline function.
  83   55   */
  84      -#if defined(lint)
  85   56  
  86      -kthread_id_t
  87      -threadp(void)
  88      -{ return ((kthread_id_t)0); }
  89      -
  90      -#else   /* lint */
  91      -
  92   57          ENTRY_NP(threadp)
  93   58          retl
  94   59          mov     THREAD_REG, %o0
  95   60          SET_SIZE(threadp)
  96   61  
  97      -#endif  /* lint */
  98   62  
  99      -
 100   63  /*
 101   64   * The IEEE 1275-1994 callback handler for a 64-bit SPARC V9 PROM calling
 102   65   * a 32 bit client program. The PROM calls us with a 64 bit stack and a
 103   66   * pointer to a client interface argument array in %o0.  The called code
 104   67   * returns 0 if the call succeeded (i.e. the service name exists) or -1
 105   68   * if the call failed. NOTE: All addresses are in the range 0..2^^32-1
 106   69   *
 107   70   * This code is called as trusted subroutine of the firmware, and is
 108   71   * called with %tba pointing to the boot firmware's trap table.  All of
 109   72   * the prom's window handlers are mixed mode handlers.
 110   73   */
 111   74  
 112      -#if defined(lint)
 113      -
 114      -int
 115      -callback_handler(cell_t *arg_array)
 116      -{
 117      -        extern int vx_handler(cell_t *arg_array);
 118      -
 119      -        return (vx_handler(arg_array));
 120      -}
 121      -
 122      -#else   /* lint */
 123      -
 124   75          ENTRY_NP(callback_handler)
 125   76          !
 126   77          ! We assume we are called with a 64 bit stack with PSTATE_AM clear
 127   78          !
 128   79          save    %sp, -SA64(MINFRAME64), %sp     ! 64 bit save
 129   80          rdpr    %wstate, %l5                    ! save %wstate
 130   81          andn    %l5, WSTATE_MASK, %l6
 131   82          wrpr    %l6, WSTATE_KMIX, %wstate
 132   83          rdpr    %pstate, %l0                    ! save %pstate
 133   84  
↓ open down ↓ 12 lines elided ↑ open up ↑
 146   97          sra     %o0, 0, %i0                     ! sign extend result
 147   98  
 148   99          mov     %l1, %fp                        ! restore %fp for return
 149  100  
 150  101  1:      wrpr    %g0, %l0, %pstate               ! restore %pstate
 151  102          wrpr    %g0, %l5, %wstate               ! restore %wstate
 152  103  
 153  104          ret                                     ! return result in %o0
 154  105          restore                                 ! back to a 64 bit stack
 155  106          SET_SIZE(callback_handler)
 156      -
 157      -#endif  /* lint */
 158  107  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX