2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 * Implements osl_[increment|decrement]InterlockedCount:
22 * sparcv9/sparcv8plus architecture: use the "cas" instruction
24 * 32 bit mode with v8plus support or 64 bit mode:
25 * sparcv9 mode is implied. Assemble with -xarch=v8plus (32 bit) or
30 #if !defined(__sparcv8plus) && !defined(__sparcv9) && !defined(__sparc_v9__)
32 #error LibreOffice requires SPARCv8plus or SPARCv9 CPU with "cas" instruction
37 .global osl_incrementInterlockedCount
40 ! Implements osl_
[increment|decrement
]InterlockedCount with sparcv9
(sparcv8plus
) "cas"
43 osl_incrementInterlockedCount
:
47 ! allow linux to build for v8
54 add %o2
, 1, %o0
! delay slot
56 .type osl_incrementInterlockedCount,#function
57 .size osl_incrementInterlockedCount,.-osl_incrementInterlockedCount
61 .global osl_decrementInterlockedCount
64 osl_decrementInterlockedCount
:
68 ! allow linux to build for v8
75 sub %o2
, 1, %o0
! delay slot
77 .type osl_decrementInterlockedCount,#function
78 .size osl_decrementInterlockedCount,.-osl_decrementInterlockedCount