asmacros.h (225887) | asmacros.h (226054) |
---|---|
1/*- 2 * Copyright (c) 2001 Jake Burkholder. | 1/*- 2 * Copyright (c) 2001 Jake Burkholder. |
3 * Copyright (c) 2011 Marius Strobl <marius@FreeBSD.org> |
|
3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
26 * $FreeBSD: head/sys/sparc64/include/asmacros.h 225887 2011-09-30 20:13:51Z marius $ | 27 * $FreeBSD: head/sys/sparc64/include/asmacros.h 226054 2011-10-06 11:01:31Z marius $ |
27 */ 28 29#ifndef _MACHINE_ASMACROS_H_ 30#define _MACHINE_ASMACROS_H_ 31 32#ifdef _KERNEL 33 34/* --- 58 unchanged lines hidden (view full) --- 93/* 94 * Atomically clear a number of bits of a long in memory. 95 */ 96#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ 97 ldx [r1], r2 ; \ 989: andn r2, bits, r3 ; \ 99 casxa [r1] ASI_N, r2, r3 ; \ 100 cmp r2, r3 ; \ | 28 */ 29 30#ifndef _MACHINE_ASMACROS_H_ 31#define _MACHINE_ASMACROS_H_ 32 33#ifdef _KERNEL 34 35/* --- 58 unchanged lines hidden (view full) --- 94/* 95 * Atomically clear a number of bits of a long in memory. 96 */ 97#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ 98 ldx [r1], r2 ; \ 999: andn r2, bits, r3 ; \ 100 casxa [r1] ASI_N, r2, r3 ; \ 101 cmp r2, r3 ; \ |
102 bne,pn %xcc, 9b ; \ 103 mov r3, r2 104 105/* 106 * Atomically load an integer from memory. 107 */ 108#define ATOMIC_LOAD_INT(r1, val) \ 109 clr val ; \ 110 casa [r1] ASI_N, %g0, val 111 112/* 113 * Atomically load a long from memory. 114 */ 115#define ATOMIC_LOAD_LONG(r1, val) \ 116 clr val ; \ 117 casxa [r1] ASI_N, %g0, val 118 119/* 120 * Atomically set a number of bits of an integer in memory. 121 */ 122#define ATOMIC_SET_INT(r1, r2, r3, bits) \ 123 lduw [r1], r2 ; \ 1249: or r2, bits, r3 ; \ 125 casa [r1] ASI_N, r2, r3 ; \ 126 cmp r2, r3 ; \ |
|
101 bne,pn %icc, 9b ; \ 102 mov r3, r2 103 | 127 bne,pn %icc, 9b ; \ 128 mov r3, r2 129 |
130/* 131 * Atomically set a number of bits of a long in memory. 132 */ 133#define ATOMIC_SET_LONG(r1, r2, r3, bits) \ 134 ldx [r1], r2 ; \ 1359: or r2, bits, r3 ; \ 136 casxa [r1] ASI_N, r2, r3 ; \ 137 cmp r2, r3 ; \ 138 bne,pn %xcc, 9b ; \ 139 mov r3, r2 140 141/* 142 * Atomically store an integer in memory. 143 */ 144#define ATOMIC_STORE_INT(r1, r2, r3, val) \ 145 lduw [r1], r2 ; \ 1469: mov val, r3 ; \ 147 casa [r1] ASI_N, r2, r3 ; \ 148 cmp r2, r3 ; \ 149 bne,pn %icc, 9b ; \ 150 mov r3, r2 151 152/* 153 * Atomically store a long in memory. 154 */ 155#define ATOMIC_STORE_LONG(r1, r2, r3, val) \ 156 ldx [r1], r2 ; \ 1579: mov val, r3 ; \ 158 casxa [r1] ASI_N, r2, r3 ; \ 159 cmp r2, r3 ; \ 160 bne,pn %xcc, 9b ; \ 161 mov r3, r2 162 |
|
104#define PCPU(member) PCPU_REG + PC_ ## member 105#define PCPU_ADDR(member, reg) \ 106 add PCPU_REG, PC_ ## member, reg 107 108#define DEBUGGER() \ 109 ta %xcc, 1 110 111#define PANIC(msg, r1) \ --- 54 unchanged lines hidden --- | 163#define PCPU(member) PCPU_REG + PC_ ## member 164#define PCPU_ADDR(member, reg) \ 165 add PCPU_REG, PC_ ## member, reg 166 167#define DEBUGGER() \ 168 ta %xcc, 1 169 170#define PANIC(msg, r1) \ --- 54 unchanged lines hidden --- |