Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/sparc/include/lock.h,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/sparc/include/lock.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.18.6.3 retrieving revision 1.19 diff -u -p -r1.18.6.3 -r1.19 --- src/sys/arch/sparc/include/lock.h 2007/10/27 11:28:34 1.18.6.3 +++ src/sys/arch/sparc/include/lock.h 2005/12/11 12:19:05 1.19 @@ -1,11 +1,11 @@ -/* $NetBSD: lock.h,v 1.18.6.3 2007/10/27 11:28:34 yamt Exp $ */ +/* $NetBSD: lock.h,v 1.19 2005/12/11 12:19:05 christos Exp $ */ /*- - * Copyright (c) 1998, 1999, 2006 The NetBSD Foundation, Inc. + * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation - * by Paul Kranenburg and Andrew Doran. + * by Paul Kranenburg. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,12 +51,12 @@ #ifdef __lint__ #define __ldstub(__addr) (__addr) #else /* !__lint__ */ -static __inline int __ldstub(__cpu_simple_lock_t *addr); -static __inline int __ldstub(__cpu_simple_lock_t *addr) +static __inline__ int __ldstub(__cpu_simple_lock_t *addr); +static __inline__ int __ldstub(__cpu_simple_lock_t *addr) { int v; - __asm volatile("ldstub [%1],%0" + __asm __volatile("ldstub [%1],%0" : "=&r" (v) : "r" (addr) : "memory"); @@ -65,43 +65,19 @@ static __inline int __ldstub(__cpu_simpl } #endif /* __lint__ */ -static __inline void __cpu_simple_lock_init(__cpu_simple_lock_t *) +static __inline void __cpu_simple_lock_init __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline int __cpu_simple_lock_try(__cpu_simple_lock_t *) +static __inline int __cpu_simple_lock_try __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_unlock(__cpu_simple_lock_t *) +static __inline void __cpu_simple_unlock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); #ifndef __CPU_SIMPLE_LOCK_NOINLINE -static __inline void __cpu_simple_lock(__cpu_simple_lock_t *) +static __inline void __cpu_simple_lock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); #else -extern void __cpu_simple_lock(__cpu_simple_lock_t *); +extern void __cpu_simple_lock __P((__cpu_simple_lock_t *)); #endif -static __inline int -__SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr) -{ - return *__ptr == __SIMPLELOCK_LOCKED; -} - -static __inline int -__SIMPLELOCK_UNLOCKED_P(__cpu_simple_lock_t *__ptr) -{ - return *__ptr == __SIMPLELOCK_UNLOCKED; -} - -static __inline void -__cpu_simple_lock_clear(__cpu_simple_lock_t *__ptr) -{ - *__ptr = __SIMPLELOCK_UNLOCKED; -} - -static __inline void -__cpu_simple_lock_set(__cpu_simple_lock_t *__ptr) -{ - *__ptr = __SIMPLELOCK_LOCKED; -} - static __inline void __cpu_simple_lock_init(__cpu_simple_lock_t *alp) { @@ -147,46 +123,4 @@ __cpu_simple_unlock(__cpu_simple_lock_t *alp = __SIMPLELOCK_UNLOCKED; } -#if defined(__sparc_v9__) -static __inline void -mb_read(void) -{ - __asm __volatile("membar #LoadLoad" : : : "memory"); -} - -static __inline void -mb_write(void) -{ - __asm __volatile("" : : : "memory"); -} - -static __inline void -mb_memory(void) -{ - __asm __volatile("membar #MemIssue" : : : "memory"); -} -#else /* __sparc_v9__ */ -static __inline void -mb_read(void) -{ - static volatile int junk; - __asm volatile("st %%g0,[%0]" - : - : "r" (&junk) - : "memory"); -} - -static __inline void -mb_write(void) -{ - __insn_barrier(); -} - -static __inline void -mb_memory(void) -{ - mb_read(); -} -#endif /* __sparc_v9__ */ - #endif /* _MACHINE_LOCK_H */