spic.c (111002) | spic.c (111748) |
---|---|
1/* 2 * Copyright (c) 2000 Nick Sayer 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 --- 33 unchanged lines hidden (view full) --- 42 * l = left, r = right -- that's the dial. 43 * "left" and "right" are rather caprecious. They actually represent 44 * ccw and cw, respectively 45 * 46 * What documentation exists is thanks to Andrew Tridge, and his page at 47 * http://samba.org/picturebook/ Special thanks also to Ian Dowse, who 48 * also provided sample code upon which this driver was based. 49 * | 1/* 2 * Copyright (c) 2000 Nick Sayer 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 --- 33 unchanged lines hidden (view full) --- 42 * l = left, r = right -- that's the dial. 43 * "left" and "right" are rather caprecious. They actually represent 44 * ccw and cw, respectively 45 * 46 * What documentation exists is thanks to Andrew Tridge, and his page at 47 * http://samba.org/picturebook/ Special thanks also to Ian Dowse, who 48 * also provided sample code upon which this driver was based. 49 * |
50 * $FreeBSD: head/sys/i386/isa/spic.c 111002 2003-02-16 14:13:23Z phk $ | 50 * $FreeBSD: head/sys/i386/isa/spic.c 111748 2003-03-02 16:54:40Z des $ |
51 */ 52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/kernel.h> 56#include <sys/bus.h> 57#include <machine/bus.h> 58#include <sys/rman.h> --- 372 unchanged lines hidden (view full) --- 431 /* No event. Wait some more */ 432 sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); 433 return; 434 } 435 436 if (sc->sc_count) { 437 if (sc->sc_sleeping) { 438 sc->sc_sleeping = 0; | 51 */ 52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/kernel.h> 56#include <sys/bus.h> 57#include <machine/bus.h> 58#include <sys/rman.h> --- 372 unchanged lines hidden (view full) --- 431 /* No event. Wait some more */ 432 sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); 433 return; 434 } 435 436 if (sc->sc_count) { 437 if (sc->sc_sleeping) { 438 sc->sc_sleeping = 0; |
439 wakeup((caddr_t) sc); | 439 wakeup( sc); |
440 } 441 selwakeup(&sc->sc_rsel); 442 } 443 spic_call2(sc, 0x81, 0xff); /* Clear event */ 444 445 sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); 446} 447 --- 38 unchanged lines hidden (view full) --- 486 sc = devclass_get_softc(spic_devclass, 0); 487 488 if (uio->uio_resid <= 0) /* What kind of a read is this?! */ 489 return 0; 490 491 s = spltty(); 492 while (!(sc->sc_count)) { 493 sc->sc_sleeping=1; | 440 } 441 selwakeup(&sc->sc_rsel); 442 } 443 spic_call2(sc, 0x81, 0xff); /* Clear event */ 444 445 sc->sc_timeout_ch = timeout(spictimeout, sc, spic_pollrate); 446} 447 --- 38 unchanged lines hidden (view full) --- 486 sc = devclass_get_softc(spic_devclass, 0); 487 488 if (uio->uio_resid <= 0) /* What kind of a read is this?! */ 489 return 0; 490 491 s = spltty(); 492 while (!(sc->sc_count)) { 493 sc->sc_sleeping=1; |
494 error = tsleep((caddr_t) sc, PZERO | PCATCH, "jogrea", 0); | 494 error = tsleep( sc, PZERO | PCATCH, "jogrea", 0); |
495 sc->sc_sleeping=0; 496 if (error) { 497 splx(s); 498 return error; 499 } 500 } 501 splx(s); 502 --- 55 unchanged lines hidden --- | 495 sc->sc_sleeping=0; 496 if (error) { 497 splx(s); 498 return error; 499 } 500 } 501 splx(s); 502 --- 55 unchanged lines hidden --- |