summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/cy.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-08-11 17:01:32 +0000
committerbde <bde@FreeBSD.org>1998-08-11 17:01:32 +0000
commitd22b2d54d1fee5411a395664783e84a200544832 (patch)
tree70d48400c4443b9a298b28c95a94509882503277 /sys/i386/isa/cy.c
parent51ac0ee7af9186216e90f801948d7e6783502d3f (diff)
downloadFreeBSD-src-d22b2d54d1fee5411a395664783e84a200544832.zip
FreeBSD-src-d22b2d54d1fee5411a395664783e84a200544832.tar.gz
Register tty software interrupt handlers at run time using register_swi()
instead of at compile time using ifdefs. Use _swi_null instead of dummycamisr. CAM and dpt should call register_swi() instead of hacking on ihandlers[] directly.
Diffstat (limited to 'sys/i386/isa/cy.c')
-rw-r--r--sys/i386/isa/cy.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 38bac42..afeeb52 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.64 1998/07/15 12:18:12 bde Exp $
+ * $Id: cy.c,v 1.65 1998/07/29 18:48:20 bde Exp $
*/
#include "opt_compat.h"
@@ -78,6 +78,7 @@
#include <sys/conf.h>
#include <sys/dkstat.h>
#include <sys/fcntl.h>
+#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/syslog.h>
@@ -86,6 +87,7 @@
#endif
#include <machine/clock.h>
+#include <machine/ipl.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/cyreg.h>
@@ -118,6 +120,7 @@
#define comhardclose cyhardclose
#define commctl cymctl
#define comparam cyparam
+#define siopoll_registered cypoll_registered
#define comspeed cyspeed
#define comstart cystart
#define comwakeup cywakeup
@@ -325,19 +328,6 @@ struct com_s {
#endif
};
-/*
- * XXX public functions in drivers should be declared in headers produced
- * by `config', not here.
- */
-
-/* Interrupt handling entry point. */
-void siopoll __P((void));
-
-/* Device switch entry points. */
-#define sioreset noreset
-#define siommap nommap
-#define siostrategy nostrategy
-
/* PCI driver entry point. */
int cyattach_common __P((cy_addr cy_iobase, int cy_align));
@@ -351,6 +341,7 @@ static void siointr1 __P((struct com_s *com));
#endif
static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
+static swihand_t siopoll;
static int sioprobe __P((struct isa_device *dev));
static void siosettimeout __P((void));
static int comspeed __P((speed_t speed, int *prescaler_io));
@@ -392,6 +383,7 @@ static struct cdevsw sio_cdevsw = {
static int comconsole = -1;
static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
+static bool_t siopoll_registered;
static int sio_timeout;
static int sio_timeouts_until_log;
static struct callout_handle sio_timeout_handle
@@ -622,6 +614,10 @@ cyattach_common(cy_iobase, cy_align)
#endif
}
}
+ if (!siopoll_registered) {
+ register_swi(SWI_TTY, siopoll);
+ siopoll_registered = TRUE;
+ }
/* ensure an edge for the next interrupt */
cd_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
@@ -1538,7 +1534,7 @@ sioioctl(dev, cmd, data, flag, p)
return (0);
}
-void
+static void
siopoll()
{
int unit;
OpenPOWER on IntegriCloud