Deleted Added
full compact
joy.c (47625) joy.c (47640)
1/*-
2 * Copyright (c) 1995 Jean-Marc Zucconi
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

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

115};
116
117static int get_tick __P((void));
118
119
120static int
121joyprobe (struct isa_device *dev)
122{
1/*-
2 * Copyright (c) 1995 Jean-Marc Zucconi
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

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

115};
116
117static int get_tick __P((void));
118
119
120static int
121joyprobe (struct isa_device *dev)
122{
123 static int once;
124
125 if (!once++)
126 cdevsw_add(&joy_cdevsw);
123#ifdef WANT_JOYSTICK_CONNECTED
124 outb (dev->id_iobase, 0xff);
125 DELAY (10000); /* 10 ms delay */
126 return (inb (dev->id_iobase) & 0x0f) != 0x0f;
127#else
128 return 1;
129#endif
130}

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

246
247 outb (TIMER_MODE, TIMER_SEL0);
248 low = inb (TIMER_CNTR0);
249 high = inb (TIMER_CNTR0);
250
251 return (high << 8) | low;
252}
253
127#ifdef WANT_JOYSTICK_CONNECTED
128 outb (dev->id_iobase, 0xff);
129 DELAY (10000); /* 10 ms delay */
130 return (inb (dev->id_iobase) & 0x0f) != 0x0f;
131#else
132 return 1;
133#endif
134}

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

250
251 outb (TIMER_MODE, TIMER_SEL0);
252 low = inb (TIMER_CNTR0);
253 high = inb (TIMER_CNTR0);
254
255 return (high << 8) | low;
256}
257
254
255static int joy_devsw_installed;
256
257static void joy_drvinit(void *unused)
258{
259 dev_t dev;
260
261 if( ! joy_devsw_installed ) {
262 dev = makedev(CDEV_MAJOR,0);
263 cdevsw_add(&dev,&joy_cdevsw,NULL);
264 joy_devsw_installed = 1;
265 }
266}
267
268SYSINIT(joydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,joy_drvinit,NULL)
269
270#ifdef JOY_MODULE
271
272#include <sys/exec.h>
273#include <sys/sysent.h>
274#include <sys/lkm.h>
275
276MOD_DEV (joy, LM_DT_CHAR, CDEV_MAJOR, &joy_cdevsw);
277

--- 40 unchanged lines hidden ---
258#ifdef JOY_MODULE
259
260#include <sys/exec.h>
261#include <sys/sysent.h>
262#include <sys/lkm.h>
263
264MOD_DEV (joy, LM_DT_CHAR, CDEV_MAJOR, &joy_cdevsw);
265

--- 40 unchanged lines hidden ---