133N/A#
1472N/A# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
133N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
133N/A#
133N/A# This code is free software; you can redistribute it and/or modify it
133N/A# under the terms of the GNU General Public License version 2 only, as
133N/A# published by the Free Software Foundation.
133N/A#
133N/A# This code is distributed in the hope that it will be useful, but WITHOUT
133N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
133N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
133N/A# version 2 for more details (a copy is included in the LICENSE file that
133N/A# accompanied this code).
133N/A#
133N/A# You should have received a copy of the GNU General Public License version
133N/A# 2 along with this work; if not, write to the Free Software Foundation,
133N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
133N/A#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A# or visit www.oracle.com if you need additional information or have any
1472N/A# questions.
133N/A#
133N/A
133N/A # Prototype: int SafeFetch32 (int * adr, int ErrValue)
133N/A # The "ld" at Fetch32 is potentially faulting instruction.
133N/A # If the instruction traps the trap handler will arrange
133N/A # for control to resume at Fetch32Resume.
133N/A # By convention with the trap handler we ensure there is a non-CTI
133N/A # instruction in the trap shadow.
133N/A
133N/A
133N/A .globl SafeFetch32, Fetch32PFI, Fetch32Resume
133N/A .globl SafeFetchN
133N/A .align 32
133N/A .type SafeFetch32,@function
133N/ASafeFetch32:
133N/A mov %o0, %g1
133N/A mov %o1, %o0
133N/AFetch32PFI:
133N/A # <-- Potentially faulting instruction
133N/A ld [%g1], %o0
133N/AFetch32Resume:
133N/A nop
133N/A retl
133N/A nop
133N/A
133N/A .globl SafeFetchN, FetchNPFI, FetchNResume
133N/A .type SafeFetchN,@function
133N/A .align 32
133N/ASafeFetchN:
133N/A mov %o0, %g1
133N/A mov %o1, %o0
133N/AFetchNPFI:
133N/A ldn [%g1], %o0
133N/AFetchNResume:
133N/A nop
133N/A retl
133N/A nop
133N/A
133N/A # Possibilities:
133N/A # -- membar
133N/A # -- CAS (SP + BIAS, G0, G0)
133N/A # -- wr %g0, %asi
133N/A
133N/A .globl SpinPause
133N/A .type SpinPause,@function
133N/A .align 32
133N/ASpinPause:
133N/A retl
133N/A mov %g0, %o0
133N/A
133N/A .globl _Copy_conjoint_jlongs_atomic
133N/A .type _Copy_conjoint_jlongs_atomic,@function
133N/A_Copy_conjoint_jlongs_atomic:
133N/A cmp %o0, %o1
133N/A bleu 4f
133N/A sll %o2, 3, %o4
133N/A ba 2f
133N/A 1:
133N/A subcc %o4, 8, %o4
133N/A std %o2, [%o1]
133N/A add %o0, 8, %o0
133N/A add %o1, 8, %o1
133N/A 2:
133N/A bge,a 1b
133N/A ldd [%o0], %o2
133N/A ba 5f
133N/A nop
133N/A 3:
133N/A std %o2, [%o1+%o4]
133N/A 4:
133N/A subcc %o4, 8, %o4
133N/A bge,a 3b
133N/A ldd [%o0+%o4], %o2
133N/A 5:
133N/A retl
133N/A nop
133N/A
133N/A
133N/A .globl _flush_reg_windows
133N/A .align 32
133N/A _flush_reg_windows:
133N/A ta 0x03
133N/A retl
133N/A mov %fp, %o0