Print this page
de-linting of .s files

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4/ml/swtch.s
          +++ new/usr/src/uts/sun4/ml/swtch.s
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24   
  25   25  /*
  26   26   * Process switching routines.
  27   27   */
  28   28  
  29      -#if !defined(lint)
  30   29  #include "assym.h"
  31      -#else   /* lint */
  32      -#include <sys/thread.h>
  33      -#endif  /* lint */
  34   30  
  35   31  #include <sys/param.h>
  36   32  #include <sys/asm_linkage.h>
  37   33  #include <sys/mmu.h>
  38   34  #include <sys/pcb.h>
  39   35  #include <sys/machthread.h>
  40   36  #include <sys/machclock.h>
  41   37  #include <sys/privregs.h>
  42   38  #include <sys/vtrace.h>
  43   39  #include <vm/hat_sfmmu.h>
↓ open down ↓ 18 lines elided ↑ open up ↑
  62   58   * resume_from_intr() is called when the thread being resumed was not 
  63   59   * passivated by resume (e.g. was interrupted).  This means that the
  64   60   * resume lock is already held and that a restore context is not needed.
  65   61   * Also, the MMU context is not changed on the resume in this case.
  66   62   *
  67   63   * resume_from_zombie() is the same as resume except the calling thread
  68   64   * is a zombie and must be put on the deathrow list after the CPU is
  69   65   * off the stack.
  70   66   */
  71   67  
  72      -#if defined(lint)
  73      -
  74      -/* ARGSUSED */
  75      -void
  76      -resume(kthread_id_t t)
  77      -{}
  78      -
  79      -#else   /* lint */
  80      -
  81   68          ENTRY(resume)
  82   69          save    %sp, -SA(MINFRAME), %sp         ! save ins and locals
  83   70  
  84   71          call    __dtrace_probe___sched_off__cpu ! DTrace probe
  85   72          mov     %i0, %o0                        ! arg for DTrace probe
  86   73  
  87   74          membar  #Sync                           ! flush writebuffers
  88   75          flushw                                  ! flushes all but this window
  89   76  
  90   77          stn     %i7, [THREAD_REG + T_PC]        ! save return address
↓ open down ↓ 356 lines elided ↑ open up ↑
 447  434          ! lock failed - spin with regular load to avoid cache-thrashing.
 448  435          !
 449  436  7:
 450  437          brnz,a,pt %o0, 7b               ! spin while locked
 451  438            ldub  [%i0 + T_LOCK], %o0
 452  439          ba      %xcc, 6b
 453  440            ldstub  [%i0 + T_LOCK], %o0   ! delay - lock curthread's mutex
 454  441          SET_SIZE(_resume_from_idle)
 455  442          SET_SIZE(resume)
 456  443  
 457      -#endif  /* lint */
 458      -
 459      -#if defined(lint)
 460      -
 461      -/* ARGSUSED */
 462      -void
 463      -resume_from_zombie(kthread_id_t t)
 464      -{}
 465      -
 466      -#else   /* lint */
 467      -
 468  444          ENTRY(resume_from_zombie)
 469  445          save    %sp, -SA(MINFRAME), %sp         ! save ins and locals
 470  446  
 471  447          call    __dtrace_probe___sched_off__cpu ! DTrace probe
 472  448          mov     %i0, %o0                        ! arg for DTrace probe
 473  449  
 474  450          ldn     [THREAD_REG + T_CPU], %i1       ! cpu pointer
 475  451                                          
 476  452          flushw                                  ! flushes all but this window
 477  453          ldn     [THREAD_REG + T_PROCP], %i2     ! old procp for mmu ctx
↓ open down ↓ 24 lines elided ↑ open up ↑
 502  478          ! resume_from_idle args:
 503  479          !       %i0 = new thread
 504  480          !       %i1 = cpu
 505  481          !       %i2 = old proc
 506  482          !       %i3 = new proc
 507  483          !       
 508  484          b       _resume_from_idle               ! finish job of resume
 509  485          ldn     [%i0 + T_PROCP], %i3            ! new process
 510  486          SET_SIZE(resume_from_zombie)
 511  487  
 512      -#endif  /* lint */
 513      -
 514      -#if defined(lint)
 515      -
 516      -/* ARGSUSED */
 517      -void
 518      -resume_from_intr(kthread_id_t t)
 519      -{}
 520      -
 521      -#else   /* lint */
 522      -
 523  488          ENTRY(resume_from_intr)
 524  489          save    %sp, -SA(MINFRAME), %sp         ! save ins and locals
 525  490  
 526  491          !
 527  492          ! We read in the fprs and call fp_save if FPRS_FEF is set
 528  493          ! to save the floating-point state if fprs has been
 529  494          ! modified by operations such as hw bcopy or fp_disabled.
 530  495          ! This is to resolve an issue where an interrupting thread
 531  496          ! doesn't retain their floating-point registers when
 532  497          ! switching out of the interrupt context.
↓ open down ↓ 74 lines elided ↑ open up ↑
 607  572  3:
 608  573          !
 609  574          ! We're a non-interrupt thread and cpu_kprunrun is set. call kpreempt.
 610  575          !
 611  576          call    kpreempt
 612  577          mov     KPREEMPT_SYNC, %o0
 613  578          ba,pt   %xcc, 1b
 614  579          nop
 615  580          SET_SIZE(resume_from_intr)
 616  581  
 617      -#endif /* lint */
 618  582  
 619      -
 620  583  /*
 621  584   * thread_start()
 622  585   *
 623  586   * the current register window was crafted by thread_run() to contain
 624  587   * an address of a procedure (in register %i7), and its args in registers
 625  588   * %i0 through %i5. a stack trace of this thread will show the procedure
 626  589   * that thread_start() invoked at the bottom of the stack. an exit routine
 627  590   * is stored in %l0 and called when started thread returns from its called
 628  591   * procedure.
 629  592   */
 630  593  
 631      -#if defined(lint)
 632      -
 633      -void
 634      -thread_start(void)
 635      -{}
 636      -
 637      -#else   /* lint */
 638      -
 639  594          ENTRY(thread_start)
 640  595          mov     %i0, %o0
 641  596          jmpl    %i7, %o7        ! call thread_run()'s start() procedure.
 642  597          mov     %i1, %o1
 643  598  
 644  599          call    thread_exit     ! destroy thread if it returns.
 645  600          nop
 646  601          unimp 0
 647  602          SET_SIZE(thread_start)
 648      -
 649      -#endif  /* lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX