Deleted Added
full compact
joy.c (89086) joy.c (97554)
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

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

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
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

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

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/joy/joy.c 89086 2002-01-08 18:27:49Z imp $
28 * $FreeBSD: head/sys/dev/joy/joy.c 97554 2002-05-30 07:13:40Z alfred $
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/conf.h>
34#include <sys/uio.h>
35#include <sys/kernel.h>
36#include <sys/module.h>

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

160{
161 struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
162 bus_space_handle_t port = joy->port;
163 bus_space_tag_t bt = joy->bt;
164 struct timespec t, start, end;
165 int state = 0;
166 struct timespec x, y;
167 struct joystick c;
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/conf.h>
34#include <sys/uio.h>
35#include <sys/kernel.h>
36#include <sys/module.h>

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

160{
161 struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
162 bus_space_handle_t port = joy->port;
163 bus_space_tag_t bt = joy->bt;
164 struct timespec t, start, end;
165 int state = 0;
166 struct timespec x, y;
167 struct joystick c;
168#ifndef i386
168#ifndef __i386__
169 int s;
170
171 s = splhigh();
172#else
173 disable_intr ();
174#endif
175 bus_space_write_1 (bt, port, 0, 0xff);
176 nanotime(&start);

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

187 nanotime(&t);
188 if (!timespecisset(&x) && !(state & 0x01))
189 x = t;
190 if (!timespecisset(&y) && !(state & 0x02))
191 y = t;
192 if (timespecisset(&x) && timespecisset(&y))
193 break;
194 }
169 int s;
170
171 s = splhigh();
172#else
173 disable_intr ();
174#endif
175 bus_space_write_1 (bt, port, 0, 0xff);
176 nanotime(&start);

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

187 nanotime(&t);
188 if (!timespecisset(&x) && !(state & 0x01))
189 x = t;
190 if (!timespecisset(&y) && !(state & 0x02))
191 y = t;
192 if (timespecisset(&x) && timespecisset(&y))
193 break;
194 }
195#ifndef i386
195#ifndef __i386__
196 splx(s);
197#else
198 enable_intr ();
199#endif
200 if (timespecisset(&x)) {
201 timespecsub(&x, &start);
202 c.x = joy->x_off[joypart(dev)] + x.tv_nsec / 1000;
203 } else

--- 46 unchanged lines hidden ---
196 splx(s);
197#else
198 enable_intr ();
199#endif
200 if (timespecisset(&x)) {
201 timespecsub(&x, &start);
202 c.x = joy->x_off[joypart(dev)] + x.tv_nsec / 1000;
203 } else

--- 46 unchanged lines hidden ---