Subversion Repositories HelenOS-historic

Rev

Rev 1113 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1113 Rev 1656
Line 24... Line 24...
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
-
 
29
 /** @addtogroup libcia32
-
 
30
 * @{
-
 
31
 */
-
 
32
/** @file
-
 
33
 */
-
 
34
 
29
#ifndef __ia32_ATOMIC_H__
35
#ifndef __ia32_ATOMIC_H__
30
#define __ia32_ATOMIC_H__
36
#define __ia32_ATOMIC_H__
31
 
37
 
32
static inline void atomic_inc(atomic_t *val) {
38
static inline void atomic_inc(atomic_t *val) {
33
    __asm__ volatile ("lock incl %0\n" : "=m" (val->count));
39
    __asm__ volatile ("lock incl %0\n" : "=m" (val->count));
Line 65... Line 71...
65
 
71
 
66
#define atomic_preinc(val) (atomic_postinc(val)+1)
72
#define atomic_preinc(val) (atomic_postinc(val)+1)
67
#define atomic_predec(val) (atomic_postdec(val)-1)
73
#define atomic_predec(val) (atomic_postdec(val)-1)
68
 
74
 
69
#endif
75
#endif
-
 
76
 
-
 
77
 
-
 
78
 /** @}
-
 
79
 */
-
 
80
 
-
 
81