diff options
author | mjacob <mjacob@cvs.openbsd.org> | 2001-01-09 02:23:13 +0000 |
---|---|---|
committer | mjacob <mjacob@cvs.openbsd.org> | 2001-01-09 02:23:13 +0000 |
commit | 6fd87538be7b5fa485d42b84d77f15c711aa0e99 (patch) | |
tree | 6fa403c08faa01d4ac7f9a27e33afe7545dbffc7 /sys/dev | |
parent | ba93cc69d27b8038934a624c4dfa3bff254628da (diff) |
This seems to correct the problem listed in kernel/1607 (returning from
syscall with non-zero priority). This doesn't seem to fix connecting
to a switch problems (which *used* to work... sigh...)...
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_wxvar.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_wxvar.h b/sys/dev/pci/if_wxvar.h index 6295268d5b1..c9caf58bc5a 100644 --- a/sys/dev/pci/if_wxvar.h +++ b/sys/dev/pci/if_wxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wxvar.h,v 1.3 2000/12/06 01:02:15 mjacob Exp $ */ +/* $OpenBSD: if_wxvar.h,v 1.4 2001/01/09 02:23:12 mjacob Exp $ */ /* * Copyright (c) 1999, Traakan Software * All rights reserved. @@ -288,6 +288,7 @@ struct wxmdvar { bus_space_handle_t sh; /* bus space handle */ struct ifmedia ifm; struct wx_softc * next; + int locked; int spl; }; #define wx_dev w.dev @@ -308,8 +309,11 @@ struct wxmdvar { #define VTIMEOUT(sc, func, arg, time) timeout(func, arg, time) #define UNTIMEOUT(f, arg, sc) untimeout(f, arg) #define INLINE inline -#define WX_LOCK(_sc) _sc->w.spl = splimp() -#define WX_UNLOCK(_sc) splx(_sc->w.spl) +#define WX_LOCK(wx) if (wx->w.locked++ == 0) wx->w.spl = splimp() +#define WX_UNLOCK(wx) if (wx->w.locked) { \ + if (--wx->w.locked == 0) \ + splx(wx->w.spl); \ + } #define WX_ILOCK(_sc) #define WX_IUNLK(_sc) |