diff options
| -rw-r--r-- | sys/amd64/include/atomic.h | 8 | ||||
| -rw-r--r-- | sys/amd64/include/cpufunc.h | 13 | ||||
| -rw-r--r-- | sys/i386/include/atomic.h | 8 | ||||
| -rw-r--r-- | sys/i386/include/cpufunc.h | 13 | ||||
| -rw-r--r-- | sys/i386/isa/ipl_funcs.c | 4 | ||||
| -rw-r--r-- | sys/sys/systm.h | 3 |
6 files changed, 14 insertions, 35 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index c8f65c630955..d4e371bdebdb 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: atomic.h,v 1.2 1999/07/13 03:32:17 alc Exp $ + * $Id: atomic.h,v 1.3 1999/07/13 06:35:25 alc Exp $ */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -68,11 +68,11 @@ */ #define ATOMIC_ASM(NAME, TYPE, OP, V) \ static __inline void \ -atomic_##NAME##_##TYPE(void *p, u_##TYPE v) \ +atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*(u_##TYPE *)p) \ - : "0" (*(u_##TYPE *)p), "ir" (V)); \ + : "=m" (*p) \ + : "0" (*p), "ir" (V)); \ } ATOMIC_ASM(set, char, "orb %2,%0", v) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 2733e72b21a2..c5ba2de5de53 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.86 1999/04/28 01:03:58 luoqi Exp $ + * $Id: cpufunc.h,v 1.87 1999/05/09 23:30:01 peter Exp $ */ /* @@ -399,16 +399,6 @@ rdtsc(void) } static __inline void -setbits(volatile u_int *addr, u_int bits) -{ - __asm __volatile( -#ifdef SMP - "lock; " -#endif - "orl %1,%0" : "=m" (*addr) : "ir" (bits)); -} - -static __inline void wbinvd(void) { __asm __volatile("wbinvd"); @@ -480,7 +470,6 @@ u_int64_t rdmsr __P((u_int msr)); u_int64_t rdpmc __P((u_int pmc)); u_int64_t rdtsc __P((void)); u_int read_eflags __P((void)); -void setbits __P((volatile u_int *addr, u_int bits)); void wbinvd __P((void)); void write_eflags __P((u_int ef)); void wrmsr __P((u_int msr, u_int64_t newval)); diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index c8f65c630955..d4e371bdebdb 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: atomic.h,v 1.2 1999/07/13 03:32:17 alc Exp $ + * $Id: atomic.h,v 1.3 1999/07/13 06:35:25 alc Exp $ */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -68,11 +68,11 @@ */ #define ATOMIC_ASM(NAME, TYPE, OP, V) \ static __inline void \ -atomic_##NAME##_##TYPE(void *p, u_##TYPE v) \ +atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*(u_##TYPE *)p) \ - : "0" (*(u_##TYPE *)p), "ir" (V)); \ + : "=m" (*p) \ + : "0" (*p), "ir" (V)); \ } ATOMIC_ASM(set, char, "orb %2,%0", v) diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 2733e72b21a2..c5ba2de5de53 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.86 1999/04/28 01:03:58 luoqi Exp $ + * $Id: cpufunc.h,v 1.87 1999/05/09 23:30:01 peter Exp $ */ /* @@ -399,16 +399,6 @@ rdtsc(void) } static __inline void -setbits(volatile u_int *addr, u_int bits) -{ - __asm __volatile( -#ifdef SMP - "lock; " -#endif - "orl %1,%0" : "=m" (*addr) : "ir" (bits)); -} - -static __inline void wbinvd(void) { __asm __volatile("wbinvd"); @@ -480,7 +470,6 @@ u_int64_t rdmsr __P((u_int msr)); u_int64_t rdpmc __P((u_int pmc)); u_int64_t rdtsc __P((void)); u_int read_eflags __P((void)); -void setbits __P((volatile u_int *addr, u_int bits)); void wbinvd __P((void)); void write_eflags __P((u_int ef)); void wrmsr __P((u_int msr, u_int64_t newval)); diff --git a/sys/i386/isa/ipl_funcs.c b/sys/i386/isa/ipl_funcs.c index 8f38f52de9a8..a4756d87dfc8 100644 --- a/sys/i386/isa/ipl_funcs.c +++ b/sys/i386/isa/ipl_funcs.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ipl_funcs.c,v 1.26 1999/07/17 18:34:32 alc Exp $ + * $Id: ipl_funcs.c,v 1.27 1999/07/20 06:09:53 alc Exp $ */ #include <sys/types.h> @@ -41,7 +41,7 @@ #define DO_SETBITS(name, var, bits) \ void name(void) \ { \ - setbits(var, bits); \ + atomic_set_int(var, bits); \ } DO_SETBITS(setdelayed, &ipending, loadandclear(&idelayed)) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 21bbc7ec120f..b3a3f60dacb9 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -36,12 +36,13 @@ * SUCH DAMAGE. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $Id: systm.h,v 1.92 1999/07/17 20:47:52 phk Exp $ + * $Id: systm.h,v 1.93 1999/07/20 21:29:01 green Exp $ */ #ifndef _SYS_SYSTM_H_ #define _SYS_SYSTM_H_ +#include <machine/atomic.h> #include <machine/cpufunc.h> #include <sys/callout.h> |
