1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

loadandclear() uses an atomic instruction (even on SMP, where it's an

implicitly LOCK'ed instruction), so there shouldn't be any harm in making
it volatile pointer compatable for one of the users of it.  It seems to
generate the same code regardless.
This commit is contained in:
Peter Wemm 1999-05-09 23:30:01 +00:00
parent 87e37dccb6
commit 0264a0ebd1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46846
3 changed files with 7 additions and 7 deletions

View File

@ -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.85 1999/01/09 13:00:27 bde Exp $
* $Id: cpufunc.h,v 1.86 1999/04/28 01:03:58 luoqi Exp $
*/
/*
@ -289,7 +289,7 @@ inw(u_int port)
}
static __inline u_int
loadandclear(u_int *addr)
loadandclear(volatile u_int *addr)
{
u_int result;

View File

@ -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.85 1999/01/09 13:00:27 bde Exp $
* $Id: cpufunc.h,v 1.86 1999/04/28 01:03:58 luoqi Exp $
*/
/*
@ -289,7 +289,7 @@ inw(u_int port)
}
static __inline u_int
loadandclear(u_int *addr)
loadandclear(volatile u_int *addr)
{
u_int result;

View File

@ -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.17 1999/04/28 01:04:15 luoqi Exp $
* $Id: ipl_funcs.c,v 1.18 1999/05/06 22:13:53 peter Exp $
*/
#include <sys/types.h>
@ -44,7 +44,7 @@ void name(void) \
setbits(var, bits); \
}
DO_SETBITS(setdelayed, &ipending, loadandclear((unsigned *)&idelayed))
DO_SETBITS(setdelayed, &ipending, loadandclear(&idelayed))
DO_SETBITS(setsoftast, &ipending, SWI_AST_PENDING)
DO_SETBITS(setsoftcamnet,&ipending, SWI_CAMNET_PENDING)
DO_SETBITS(setsoftcambio,&ipending, SWI_CAMBIO_PENDING)
@ -143,7 +143,7 @@ void name(void) \
IFCPL_UNLOCK(); \
}
DO_SETBITS(setdelayed, &ipending, loadandclear((unsigned *)&idelayed))
DO_SETBITS(setdelayed, &ipending, loadandclear(&idelayed))
DO_SETBITS(setsoftast, &ipending, SWI_AST_PENDING)
DO_SETBITS(setsoftcamnet,&ipending, SWI_CAMNET_PENDING)
DO_SETBITS(setsoftcambio,&ipending, SWI_CAMBIO_PENDING)