Deleted Added
full compact
intpm.c (168870) intpm.c (172667)
1/*-
2 * Copyright (c) 1998, 1999 Takanori Watanabe
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998, 1999 Takanori Watanabe
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/pci/intpm.c 168870 2007-04-19 17:14:06Z jhb $");
28__FBSDID("$FreeBSD: head/sys/pci/intpm.c 172667 2007-10-15 16:18:20Z jhb $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/module.h>
36#include <sys/mutex.h>

--- 394 unchanged lines hidden (view full) ---

431 int error, status;
432
433 INTSMB_LOCK_ASSERT(sc);
434
435 if (cold)
436 /* So that it can use device during device probe on SMBus. */
437 return (intsmb_stop_poll(sc));
438
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/module.h>
36#include <sys/mutex.h>

--- 394 unchanged lines hidden (view full) ---

431 int error, status;
432
433 INTSMB_LOCK_ASSERT(sc);
434
435 if (cold)
436 /* So that it can use device during device probe on SMBus. */
437 return (intsmb_stop_poll(sc));
438
439 error = tsleep(sc, PWAIT | PCATCH, "SMBWAI", hz / 8);
439 error = msleep(sc, &sc->lock, PWAIT | PCATCH, "SMBWAI", hz / 8);
440 if (error == 0) {
441 status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
442 if (!(status & PIIX4_SMBHSTSTAT_BUSY)) {
443 error = intsmb_error(status);
444 if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR))
445 device_printf(sc->dev, "unknown cause why?\n");
446#ifdef ENABLE_ALART
447 bus_write_1(sc->io_res, PIIX4_SMBSLVCNT,

--- 333 unchanged lines hidden ---
440 if (error == 0) {
441 status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
442 if (!(status & PIIX4_SMBHSTSTAT_BUSY)) {
443 error = intsmb_error(status);
444 if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR))
445 device_printf(sc->dev, "unknown cause why?\n");
446#ifdef ENABLE_ALART
447 bus_write_1(sc->io_res, PIIX4_SMBSLVCNT,

--- 333 unchanged lines hidden ---