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 1999-05-09 23:30:01 +00:00
parent 1b1bfd57f3
commit 593dd5803d
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)