X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=hs-boehmgc.git;a=blobdiff_plain;f=gc-7.2%2Flibatomic_ops%2Fsrc%2Fatomic_ops%2Fsysdeps%2Fgcc%2Fsh.h;fp=gc-7.2%2Flibatomic_ops%2Fsrc%2Fatomic_ops%2Fsysdeps%2Fgcc%2Fsh.h;h=933037ab67300dc7ff6e1105af945e751f5333b6;hp=0000000000000000000000000000000000000000;hb=324587ba93dc77f37406d41fd2a20d0e0d94fb1d;hpb=2a4ea609491b225a1ceb06da70396e93916f137a diff --git a/gc-7.2/libatomic_ops/src/atomic_ops/sysdeps/gcc/sh.h b/gc-7.2/libatomic_ops/src/atomic_ops/sysdeps/gcc/sh.h new file mode 100644 index 0000000..933037a --- /dev/null +++ b/gc-7.2/libatomic_ops/src/atomic_ops/sysdeps/gcc/sh.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2009 by Takashi YOSHII. All rights reserved. + * + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program + * for any purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + */ + +#include "../all_atomic_load_store.h" +#include "../ordered.h" + +/* sh has tas.b(byte) only */ +#include "../test_and_set_t_is_char.h" + +AO_INLINE AO_TS_VAL_t +AO_test_and_set_full(volatile AO_TS_t *addr) +{ + int oldval; + __asm__ __volatile__( + "tas.b @%1; movt %0" + : "=r" (oldval) + : "r" (addr) + : "t", "memory"); + return oldval? AO_TS_CLEAR : AO_TS_SET; +} +#define AO_HAVE_test_and_set_full