hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1 489c9b5090e2
child 360 21d113ecbf6a
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
!! Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
!! DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
!! This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
!! under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
!! published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
!! This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
!! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
!! FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
!! version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
!! accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
!! You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
!! 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
!! Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
!! Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
!! CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
!! have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
    !! Prototype: int SafeFetch32 (int * adr, int ErrValue)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
    !! The "ld" at Fetch32 is potentially faulting instruction.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
    !! If the instruction traps the trap handler will arrange
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
    !! for control to resume at Fetch32Resume.  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
    !! By convention with the trap handler we ensure there is a non-CTI
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
    !! instruction in the trap shadow.  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
    !!
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
    !! The reader might be tempted to move this service to .il.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
    !! Don't.  Sun's CC back-end reads and optimize code emitted 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
    !! by the .il "call", in some cases optimizing the code, completely eliding it,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
    !! or by moving the code from the "call site". 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
        
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    .globl  SafeFetch32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    .align  32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
    .global Fetch32PFI, Fetch32Resume 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
SafeFetch32:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    mov     %o0, %g1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    mov     %o1, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
Fetch32PFI:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
    ld      [%g1], %o0          !! <-- Potentially faulting instruction
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
Fetch32Resume:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    retl
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    .globl  SafeFetchN
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    .align  32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    .globl  FetchNPFI, FetchNResume
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
SafeFetchN:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
    mov     %o0, %g1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    mov     %o1, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
FetchNPFI:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    ldn     [%g1], %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
FetchNResume:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    retl
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    !! Possibilities:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
    !! -- membar
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    !! -- CAS (SP + BIAS, G0, G0)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    !! -- wr %g0, %asi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    .global SpinPause
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    .align  32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
SpinPause:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    retl
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    mov %g0, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    .globl _Copy_conjoint_jlongs_atomic
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    .align 32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    .global   _Copy_conjoint_jlongs_atomic
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
 _Copy_conjoint_jlongs_atomic:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
         cmp     %o0, %o1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
         bleu    4f
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
         sll     %o2, 3, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
         ba      2f
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    1:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
         subcc   %o4, 8, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
         std     %o2, [%o1]
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
         add     %o0, 8, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
         add     %o1, 8, %o1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    2:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
         bge,a   1b
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
         ldd     [%o0], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
         ba      5f
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
         nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    3:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
         std     %o2, [%o1+%o4]
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    4:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
         subcc   %o4, 8, %o4
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
         bge,a   3b
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
         ldd     [%o0+%o4], %o2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    5:      
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
         retl
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
         nop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    .globl _raw_thread_id
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
    .align 32
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
 _raw_thread_id:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
        retl
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
        mov     %g7, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    .globl _flush_reg_windows
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    .align 32
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
 _flush_reg_windows:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
        ta 0x03
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
        retl
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
        mov     %fp, %o0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120