Commit c968c37a authored by Linus Torvalds's avatar Linus Torvalds

Linux-2.1.125 ... pre-2.2 imminent

It seems that I've finally found the mysterious bug that caused some SMP
machines to lock up at bootup if they had no keyboard enabled. It turns
out that the keyboard was a complete red herring, and that it just changed
timings of bottom half handling in particular. The real culprit was some
misguided locking attempts by the console driver at a really bad time.

Anyway, that means that the last of my personal show-stopper bugs in 2.1.x
seems to be finally history. I still expect to sync up with Alan Cox's
patches in particular, but I'm mentally getting ready for a real 2.2.

I still haven't decided on whether I'll make the same kind of "pre-2.2"
that I did before the 2.0 release, but there are strong psychological
reasons to do so to get people to more actively test it out with a "this
really should be stable" mindset.

In the meantime, there's now 2.1.125. Most of 2.1.125 is driver updates
for various things, most notably perhaps joystick and the new 5.10 version
of the Adaptec aic7xxx driver by Doug Ledford (but there are various other
driver updates). The fix for the mysterious lock-up is a few embarrassing
lines removed, but makes me feel a lot better ;)

Go forth, multiply, and fill the earth
parent a972c494
......@@ -566,15 +566,11 @@ S: Oak Park, Illinois 60302
S: USA
N: Jim Freeman
E: jfree@caldera.com
E: jfree@sovereign.org
W: http://www.sovereign.org/
D: Initial GPL'd Frame Relay driver
D: Dynamic PPP devices
D: Sundry modularizations (PPP, IPX, ...) and fixes
S: Caldera, Inc.
S: 240 West Center Street
S: Orem, Utah 84059-1920
S: USA
N: Bob Frey
E: bobf@advansys.com
......@@ -1383,7 +1379,7 @@ E: orc@pell.chi.il.us
D: improved memory detection code.
N: Vojtech Pavlik
E: vojtech@atrey.karlin.mff.cuni.cz
E: vojtech@ucw.cz
D: Joystick driver
D: arcnet-hardware readme
D: Minor ARCnet hacking
......
......@@ -2196,7 +2196,7 @@ CONFIG_IP_TRANSPARENT_PROXY
server". This makes the local computers think they are talking to
the remote end, while in fact they are connected to the local
proxy. Redirection is activated by defining special input firewall
rules (using the ipfwadm utility) and/or by doing an appropriate
rules (using the ipchains utility) and/or by doing an appropriate
bind() system call.
IP: masquerading
......@@ -2839,12 +2839,12 @@ CONFIG_ROSE
Serial port KISS driver for AX.25
CONFIG_MKISS
KISS is a protocol used to send IP traffic over AX.25 radio
connections, somewhat similar to SLIP for telephone lines. Say Y
here if you intend to send Internet traffic over amateur radio,
using some device connected to your machine's serial port. In that
case, you also have to say Y to "Amateur Radio AX.25 Level 2"
support.
KISS is a protocol used for the exchange of data between a computer
and a Terminal Node Controller (a small embedded system commonly
used for networking over AX25 amateur radio connections).
Although KISS is less advanced than the 6pack protocol, it has
the advantage that it is already supported by most modern TNCs
without the need for a firmware upgrade.
If you want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
......@@ -5563,6 +5563,19 @@ CONFIG_LNE390
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
Novell/Eagle/Microdyne NE3210 EISA support
CONFIG_NE3210
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available via FTP (user: anonymous) in
ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO. Note that this driver
will NOT WORK for NE3200 cards as they are completely different.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called ne3210.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
Apricot Xen-II on board Ethernet
CONFIG_APRICOT
If you have a network (Ethernet) controller of this type, say Y and
......@@ -5680,6 +5693,12 @@ CONFIG_EPIC100
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
VIA Rhine support
CONFIG_VIA_RHINE
If you have a VIA "rhine" based network card (Rhine-I (3043) or
Rhine-2 (VT86c100A)), say Y here. To build this driver as a module
say M.
Zenith Z-Note support
CONFIG_ZNET
The Zenith Z-Note notebook computer has a built-in network
......@@ -8042,21 +8061,94 @@ CONFIG_NVRAM
The module will be called nvram.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
PC joystick support
Joystick support
CONFIG_JOYSTICK
If you have a PC compatible analog or digital joystick, you can say
Y here. If you then create a character special file under /dev with
major number 15 and minor number 0 or 1 (for the two joystick ports)
using mknod ("man mknod"), you can read the status of the buttons
and the x and y coordinates from that file. Please read the file
If you have a joystick, you can say Y here to enable generic
joystick support. You will also need to say Y or M to at least one
of the hardware specific joystick drivers. This will make the
joysticks available under /dev/jsX devices. Please read the file
Documentation/joystick.txt which contains more information and the
location of the joystick package that you'll need.
location of the joystick package that you'll need.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called joystick.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
Classic PC analog joysticks
CONFIG_JOY_ANALOG
Say Y here if you have an analog joystick or gamepad that connects
to the PC gameport. This supports many different types, including
joysticks with throttle control, and with CHF / FCS / 6-button
extensions. For more information on how to use the driver please
read Documentation/joystick.txt
FPGaming and MadCatz A3D controllers
CONFIG_JOY_ASSASIN
Say Y here if you have an FPGaming Assasin 3D, MadCatz Panther or
MadCatz Panther XL. For more information on how to use the driver
please read Documentation/joystick.txt
Gravis GrIP gamepads
CONFIG_JOY_GRAVIS
Say Y here if you have a Gravis GamePad Pro. For more information
on how to use the driver please read Documentation/joystick.txt
PDPI Lightning L4 gamecards
CONFIG_JOY_LIGHTNING
Say Y here if you have a PDPI Lightning L4 gamecard and an analog
joystick or gamepad connected to it. For more information on how to
use the driver please read Documentation/joystick.txt
Logitech Digital joysticks
CONFIG_JOY_LOGITECH
Say Y here if you have a Logitech WingMan Extreme Digital,
Logitech ThunderPad Digital or Logitech CyberMan 2. For more
information on how to use the driver please read
Documentation/joystick.txt
Microsoft SideWinder, Genius Digital joysticks
CONFIG_JOY_SIDEWINDER
Say Y here if you have a Microsoft SideWinder 3d Pro, Microsoft
SideWinder Precision Pro, Microsoft SideWinder Force Feedback Pro,
Microsoft Sidewinder GamePad or Genius Flight2000 F-23 Digital. For
more information on how to use the driver please read
Documentation/joystick.txt
ThrustMaster DirectConnect (BSP) joysticks
CONFIG_JOY_THRUSTMASTER
Say Y here if you have a ThrustMaster Millenium 3D Inceptor, ThrustMaster
3D Rage Pad, or ThrustMaster WCS III. For more information on how to use the
driver please read Documentation/joystick.txt
NES, SNES, PSX, Multisystem gamepads
CONFIG_JOY_CONSOLE
Say Y here if you have a Nintendo Entertainment System gamepad,
Super Nintendo Entertainment System gamepad, Sony PlayStation
gamepad or a Multisystem - Atari, Amiga, Commodore, Amstrad CPC
joystick. For more information on how to use the driver please read
Documentation/joystick.txt
Sega, Multisystem gamepads
CONFIG_JOY_DB9
Say Y here if you have a Sega Master System gamepad, Sega Genesis
gamepad, Sega Saturn gamepad, or a Multisystem - Atari, Amiga,
Commodore, Amstrad CPC joystick. For more information on how to use
the driver please read Documentation/joystick.txt
TurboGraFX Multisystem joystick interface
CONFIG_JOY_TURBOGRAFX
Say Y here if you have the TurboGraFX interface by Steffen Schwenke, and
want to use it with Multiststem - Atari, Amiga, Commodore, Amstrad CPC
joystick. For more information on how to use the driver please read
Documentation/joystick-parport.txt
Amiga joysticks
CONFIG_JOY_AMIGA
Say Y here if you have an Amiga with a digital joystick connected
to it. For more information on how to use the driver please read
Documentation/joystick.txt
Atomwide Serial Support
CONFIG_ATOMWIDE_SERIAL
If you have an Atomwide Serial card for an Acorn system, say Y to
......
Joystick API Documentation -*-Text-*-
Ragnar Hojland Espinosa
<ragnar@lightside.ddns.org>
7 Aug 1998
1. Initialization
~~~~~~~~~~~~~~~~~
Open the joystick device following the usual semantics (that is, with open).
Since the driver now reports events instead of polling for changes,
immediately after the open it will issue a series of synthetic events
(JS_EVENT_INIT) that you can read to check the initial state of the
joystick.
By default, the device is opened in blocking mode.
int fd = open ("/dev/js0", O_RDONLY);
2. Event Reading
~~~~~~~~~~~~~~~~
struct js_event e;
read (fd, &e, sizeof(struct js_event));
where js_event is defined as
struct js_event {
__u32 time; /* event timestamp in miliseconds */
__s16 value; /* value */
__u8 type; /* event type */
__u8 number; /* axis/button number */
};
If the read is successfull, it will return sizeof(struct js_event), unless
you wanted to read more than one event per read as described in section 3.1.
2.1 js_event.type
~~~~~~~~~~~~~~~~~
The possible values of ``type'' are
#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
#define JS_EVENT_AXIS 0x02 /* joystick moved */
#define JS_EVENT_INIT 0x80 /* initial state of device */
As mentioned above, the driver will issue synthetic JS_EVENT_INIT ORed
events on open. That is, if it's issuing a INIT BUTTON event, the
current type value will be
int type = JS_EVENT_BUTTON | JS_EVENT_INIT; /* 0x81 */
If you choose not to differentiate between synthetic or real events
you can turn off the JS_EVENT_INIT bits
type &= ~JS_EVENT_INIT; /* 0x01 */
2.2 js_event.number
~~~~~~~~~~~~~~~~~~~
The values of ``number'' correspond to the axis or button that
generated the event. Note that they carry separate numeration (that
is, you have both an axis 0 and a button 0). Generally,
number
1st Axis X 0
1st Axis Y 1
2nd Axis X 2
2nd Axis Y 3
...and so on
Hats vary from one joystick type to another. Some can be moved in 8
directions, some only in 4, however, the driver always reports a hat as two
independent axis, even if the hardware doesn't allow independent movement.
2.3 js_event.value
~~~~~~~~~~~~~~~~~~
For an axis, ``value'' is a signed integer between -32767 and +32767
representing the position of the joystick along that axis. If you
don't read a 0 when the joystick is `dead', or if it doesn't span the
full range, you should recalibrate (with, for example, jscal).
For a button, ``value'' for a press button event is 1 and for a release
button event is 0.
Though this
if (js_event.type == JS_EVENT_BUTTON) {
buttons_state ^= (1 << js_event.number);
}
may work well if you handle JS_EVENT_INIT events separately,
if (js_event.type & ~JS_EVENT_INIT == JS_EVENT_BUTTON) {
if (js_event.value)
buttons_state |= (1 << js_event.number);
else
buttons_state &= ~(1 << js_event.number);
}
is much safer since it can't lose sync with the driver. As you would
have to write a separate handler for JS_EVENT_INIT events in the first
snippet, this ends up being shorter.
2.4 js_event.time
~~~~~~~~~~~~~~~~~
The time an event was generated is stored in ``js_event.time''. It's a time
in miliseconds since ... well, since sometime in the past. This eases the
task of detecting double clicks, figuring out if movement of axis and button
presses happened at the same time, and similar.
3. Reading
~~~~~~~~~~
If you open the device in blocking mode, a read will block (that is,
wait) forever until an event is generated and effectively read. There
are two alternatives if you can't afford to wait forever (which is,
admittedly, a long time;)
a) use select to wait until there's data to be read on fd, or
until it timeouts. There's a good example on the select(2)
man page.
b) open the device in non-blocking mode (O_NONBLOCK)
3.1 O_NONBLOCK
~~~~~~~~~~~~~~
If read returns -1 when reading in O_NONBLOCK mode, this isn't
necessarily a "real" error (check errno(3)); it can just mean there
are no events pending to be read on the driver queue. You should read
all events on the queue (that is, until you get a -1).
For example,
while (1) {
while (read (fd, &e, sizeof(struct js_event)) > 0) {
process_event (e);
}
/* EAGAIN is returned when the queue is empty */
if (errno != EAGAIN) {
/* error */
}
/* do something interesting with processed events */
}
One reason for emptying the queue is that if it gets full you'll start
missing events since the queue is finite, and older events will get
overwritten.
The other reason is that you want to know all what happened, and not
delay the processing till later.
Why can get the queue full? Because you don't empty the queue as
mentioned, or because too much time elapses from one read to another
and too many events to store in the queue get generated. Note that
high system load may contribute to space those reads even more.
If time between reads is enough to fill the queue and loose an event,
the driver will switch to startup mode and next time you read it,
synthetic events (JS_EVENT_INIT) will be generated to inform you of
the actual state of the joystick.
[As for version 1.2.8, the queue is circular and able to hold 64
events. You can increment this size bumping up JS_BUFF_SIZE in
joystick.h and recompiling the driver.]
In the above code, you might as well want to read more than one event
at a time using the typical read(2) functionality. For that, you would
replace the read above with something like
struct js_event mybuffer[0xff];
int i = read (fd, mybuffer, sizeof(struct mybuffer));
In this case, read would return -1 if the queue was empty, or some
other value in which the number of events read would be i /
sizeof(js_event) Again, if the buffer was full, it's a good idea to
process the events and keep reading it until you empty the driver queue.
4. IOCTLs
~~~~~~~~~
The joystick driver defines the following ioctl(2) operations.
/* function 3rd arg */
#define JSIOCGAXES /* get number of axes char */
#define JSIOCGBUTTONS /* get number of buttons char */
#define JSIOCGVERSION /* get driver version int */
#define JSIOCGNAME(len) /* get identifier string char */
#define JSIOCSCORR /* set correction values &js_corr */
#define JSIOCGCORR /* get correction values &js_corr */
For example, to read the number of axes
char number_of_axes;
ioctl (fd, JSIOCGAXES, &number_of_axes);
4.1 JSIOGCVERSION
~~~~~~~~~~~~~~~~~
JSIOGCVERSION is a good way to check in run-time whether the running
driver is 1.0+ and supports the event interface. If it is not, the
IOCTL will fail. For a compile-time decision, you can test the
JS_VERSION symbol
#ifdef JS_VERSION
#if JS_VERSION > 0xsomething
4.2 JSIOCGNAME
~~~~~~~~~~~~~~
JSIOCGNAME(len) allows you to get the name string of the joystick - the same
as is being printed at boot time. The 'len' argument is the lenght of the
buffer provided by the application asking for the name. It is used to avoid
possible overrun should the name be too long.
char name[128];
if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
strncpy(name, "Unknown", sizeof(name));
printf("Name: %s\n", name);
4.3 JSIOC[SG]CORR
~~~~~~~~~~~~~~~~~
For usage on JSIOC[SG]CORR I suggest you to look into jscal.c They are
not needed in a normal program, only in joystick calibration software
such as jscal or kcmjoy. These IOCTLs and data types aren't considered
to be in the stable part of the API, and therefore may change without
warning in following releases of the driver.
Both JSIOCSCORR and JSIOCGCORR expect &js_corr to be able to hold
information for all axis. That is, struct js_corr corr[MAX_AXIS];
struct js_corr is defined as
struct js_corr {
__s32 coef[8];
__u16 prec;
__u16 type;
};
and ``type''
#define JS_CORR_NONE 0x00 /* returns raw values */
#define JS_CORR_BROKEN 0x01 /* broken line */
5. Backward compatibility
~~~~~~~~~~~~~~~~~~~~~~~~~
The 0.x joystick driver API is quite limited and its usage is deprecated.
The driver offers backward compatibility, though. Here's a quick summary:
struct JS_DATA_TYPE js;
while (1) {
if (read (fd, &js, JS_RETURN) != JS_RETURN) {
/* error */
}
usleep (1000);
}
As you can figure out from the example, the read returns immediately,
with the actual state of the joystick.
struct JS_DATA_TYPE {
int buttons; /* immediate button state */
int x; /* immediate x axis value */
int y; /* immediate y axis value */
};
and JS_RETURN is defined as
#define JS_RETURN sizeof(struct JS_DATA_TYPE)
To test the state of the buttons,
first_button_state = js.buttons & 1;
second_button_state = js.buttons & 2;
The axis values do not have a defined range in the original 0.x driver,
except for that the values are non-negative. The 1.2.8+ drivers use a
fixed range for reporting the values, 0 being the minimum, 128 the
center, and 255 maximum value.
6. Final Notes
~~~~~~~~~~~~~~
____/| Comments, additions, and specially corrections are welcome.
\ o.O| Documentation valid for at least version 1.2.8 of the joystick
=(_)= driver and as usual, the ultimate source for documentation is
U to "Use The Source Luke" or, at your convenience, Vojtech ;)
- Ragnar
EOF
This diff is collapsed.
This diff is collapsed.
......@@ -141,8 +141,8 @@ W: http://www.arm.uk.linux.org/~rmk/armlinux.html
S: Maintained
AX.25 NETWORK LAYER
P: Jon Naylor
M: jsn@cs.nott.ac.uk
P: Matthias Welwarsky
M: dg2fef@afthd.tu-darmstadt.de
L: linux-hams@vger.rutgers.edu
S: Maintained
......@@ -357,6 +357,12 @@ M: hpa@zytor.com
L: autofs@linux.kernel.org
S: Maintained
LAPB module
P: Henner Eisen
M: eis@baty.hanse.de
L: linux-x25@vger.rutgers.edu
S: Maintained
LINUX FOR POWERPC (PREP)
P: Cort Dougan
M: cort@cs.nmt.edu
......@@ -428,8 +434,8 @@ L: linware@sh.cvut.cz
S: Maintained
NETROM NETWORK LAYER
P: Jon Naylor
M: jsn@cs.nott.ac.uk
P: Tomi Manninen
M: Tomi.Manninen@hut.fi
L: linux-hams@vger.rutgers.edu
S: Maintained
......@@ -534,6 +540,12 @@ M gpg109@rsphy1.anu.edu.au
L: linux-kernel@vger.rutgers.edu
S: Maintained
ROSE NETWORK LAYER
P: Frederic Rible
M: frible@teaser.fr
L: linux-hams@vger.rutgers.edu
S: Maintained
RISCOM8 DRIVER:
P: Dmitry Gorodchanin
M: pgmdsg@ibi.com
......@@ -684,6 +696,12 @@ M: zaga@fly.cc.fer.hr
L: linux-scsi@vger.rutgers.edu
S: Maintained
X.25 NETWORK LAYER
P: Henner Eisen
M: eis@baty.hanse.de
L: linux-x25@vger.rutgers.edu
S: Maintained
Z8530 DRIVER FOR AX.25
P: Joerg Reuter
M: jreuter@poboxes.com
......
......@@ -21,17 +21,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>
void checksignals(void)
{
sigset_t *blocked = &current->blocked;
unsigned long mask = blocked->sig[0] | sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT);
mask &= blocked->sig[1];
if (~mask) {
printk("Bad signal mask\n");
__backtrace();
}
}
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
#define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn))
......
......@@ -193,6 +193,7 @@ CONFIG_NET_EISA=y
CONFIG_EEXPRESS_PRO100=y
# CONFIG_NE2K_PCI is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_DLCI is not set
......
......@@ -2,6 +2,8 @@
* APM BIOS driver for Linux
* Copyright 1994-1998 Stephen Rothwell
* (Stephen.Rothwell@canb.auug.org.au)
* Development of this driver was funded by NEC Australia P/L
* and NEC Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -27,6 +29,7 @@
* Feb 1998, Version 1.3
* Feb 1998, Version 1.4
* Aug 1998, Version 1.5
* Sep 1998, Version 1.6
*
* History:
* 0.6b: first version in official kernel, Linux 1.3.46
......@@ -51,7 +54,12 @@
* C. Scott Ananian <cananian@alumni.princeton.edu> Linux 2.1.87
* 1.5: Fix segment register reloading (in case of bad segments saved
* across BIOS call).
* Stephen ROthwell
* Stephen Rothwell
* 1.6: Cope with complier/assembler differences.
* Only try to turn off the first display device.
* Fix OOPS at power off with no APM BIOS by Jan Echternach
* <echter@informatik.uni-rostock.de>
* Stephen Rothwell
*
* APM 1.1 Reference:
*
......@@ -214,7 +222,8 @@ extern unsigned long get_cmos_time(void);
/*
* Save a segment register away
*/
#define savesegment(seg, where) __asm__ __volatile__("movl %%" #seg ",%0" : "=m" (where))
#define savesegment(seg, where) \
__asm__ __volatile__("movl %%" #seg ",%0" : "=m" (where))
/*
* Forward declarations
......@@ -264,7 +273,7 @@ static struct apm_bios_struct * user_list = NULL;
static struct timer_list apm_timer;
static char driver_version[] = "1.5"; /* no spaces */
static char driver_version[] = "1.6"; /* no spaces */
#ifdef APM_DEBUG
static char * apm_event_name[] = {
......@@ -350,105 +359,95 @@ static const lookup_t error_table[] = {
* can be zeroed before the call. Unfortunately, we can't do anything
* about the stack segment/pointer. Also, we tell the compiler that
* everything could change.
*
* Also, we KNOW that for the non error case of apm_bios_call, there
* is no useful data returned in the low order 8 bits of eax.
*/
static inline int apm_bios_call(u32 eax_in, u32 ebx_in, u32 ecx_in,
u32 *eax, u32 *ebx, u32 *ecx, u32 *edx, u32 *esi)
{
unsigned int old_fs, old_gs;
int error;
#ifdef APM_ZERO_SEGS
savesegment(fs, old_fs);
savesegment(gs, old_gs);
#endif
__asm__ __volatile__(
"pushfl\n\t"
#ifdef APM_NOINTS
"cli\n\t"
# define APM_DO_CLI __cli()
#else
# define APM_DO_CLI
#endif
#ifdef APM_ZERO_SEGS
"pushl %%ds\n\t"
"pushl %%es\n\t"
"movl %w9,%%ds\n\t"
"movl %w9,%%es\n\t"
"movl %w9,%%fs\n\t"
"movl %w9,%%gs\n\t"
# define APM_DO_SAVE_SEGS \
savesegment(fs, saved_fs); \
savesegment(gs, saved_gs)
# define APM_DO_ZERO_SEGS \
"pushl %%ds\n\t" \
"pushl %%es\n\t" \
"xorl %%edx, %%edx\n\t" \
"mov %%dx, %%ds\n\t" \
"mov %%dx, %%es\n\t" \
"mov %%dx, %%fs\n\t" \
"mov %%dx, %%gs\n\t"
# define APM_DO_POP_SEGS \
"popl %%es\n\t" \
"popl %%ds\n\t"
# define APM_DO_RESTORE_SEGS \
loadsegment(fs, saved_fs); \
loadsegment(gs, saved_gs)
#else
# define APM_DO_SAVE_SEGS
# define APM_DO_ZERO_SEGS
# define APM_DO_POP_SEGS
# define APM_DO_RESTORE_SEGS
#endif
static inline u8 apm_bios_call(u32 eax_in, u32 ebx_in, u32 ecx_in,
u32 *eax, u32 *ebx, u32 *ecx, u32 *edx, u32 *esi)
{
unsigned int saved_fs;
unsigned int saved_gs;
unsigned long flags;
__save_flags(flags);
APM_DO_CLI;
APM_DO_SAVE_SEGS;
__asm__ __volatile__(APM_DO_ZERO_SEGS
"lcall %%cs:" SYMBOL_NAME_STR(apm_bios_entry) "\n\t"
"movl $0, %%edi\n\t"
"jnc 1f\n\t"
"movl $1, %%edi\n"
"1:\tpopl %%es\n\t"
"popl %%ds\n\t"
"popfl\n\t"
"setc %%al\n\t"
APM_DO_POP_SEGS
: "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx),
"=S" (*esi), "=D" (error)
"=S" (*esi)
: "a" (eax_in), "b" (ebx_in), "c" (ecx_in)
#ifdef APM_ZERO_SEGS
, "r" (0)
#endif
: "ax", "bx", "cx", "dx", "si", "di", "bp", "memory");
#ifdef APM_ZERO_SEGS
loadsegment(fs, old_fs);
loadsegment(gs, old_gs);
#endif
return error;
: "ax", "bx", "cx", "dx", "si", "di", "bp", "memory", "cc");
APM_DO_RESTORE_SEGS;
__restore_flags(flags);
return *eax & 0xff;
}
/*
* This version only returns one value (usually an error code)
*/
static inline int apm_bios_call_simple(u32 eax_in, u32 ebx_in, u32 ecx_in, u32 *eax)
static inline u8 apm_bios_call_simple(u32 eax_in, u32 ebx_in, u32 ecx_in,
u32 *eax)
{
unsigned int old_fs, old_gs;
int error;
u8 error;
unsigned int saved_fs;
unsigned int saved_gs;
unsigned long flags;
#ifdef APM_ZERO_SEGS
savesegment(fs, old_fs);
savesegment(gs, old_gs);
#endif
__asm__ __volatile__(
"pushfl\n\t"
#ifdef APM_NOINTS
"cli\n\t"
#endif
#ifdef APM_ZERO_SEGS
"pushl %%ds\n\t"
"pushl %%es\n\t"
"movl %w5,%%ds\n\t"
"movl %w5,%%es\n\t"
"movl %w5,%%fs\n\t"
"movl %w5,%%gs\n\t"
#endif
__save_flags(flags);
APM_DO_CLI;
APM_DO_SAVE_SEGS;
__asm__ __volatile__(APM_DO_ZERO_SEGS
"lcall %%cs:" SYMBOL_NAME_STR(apm_bios_entry) "\n\t"
"movl $0, %%edi\n\t"
"jnc 1f\n\t"
"movl $1, %%edi\n"
"1:\tpopl %%es\n\t"
"popl %%ds\n\t"
"popfl\n\t"
: "=a" (*eax), "=D" (error)
"setc %%bl\n\t"
APM_DO_POP_SEGS
: "=a" (*eax), "=b" (error)
: "a" (eax_in), "b" (ebx_in), "c" (ecx_in)
#ifdef APM_ZERO_SEGS
, "r" (0)
#endif
: "ax", "bx", "cx", "dx", "si", "di", "bp", "memory");
#ifdef APM_ZERO_SEGS
loadsegment(fs, old_fs);
loadsegment(gs, old_gs);
#endif
: "ax", "bx", "cx", "dx", "si", "di", "bp", "memory", "cc");
APM_DO_RESTORE_SEGS;
__restore_flags(flags);
return error;
}
static int apm_driver_version(u_short *val)
{
int error;
u32 eax;
error = apm_bios_call_simple(0x530e, 0, *val, &eax);
if (error)
if (apm_bios_call_simple(0x530e, 0, *val, &eax))
return (eax >> 8) & 0xff;
*val = eax;
return APM_SUCCESS;
......@@ -456,14 +455,12 @@ static int apm_driver_version(u_short *val)
static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info)
{
int error;
u32 eax;
u32 ebx;
u32 ecx;
u32 dummy;
error = apm_bios_call(0x530b, 0, 0, &eax, &ebx, &ecx, &dummy, &dummy);
if (error)
if (apm_bios_call(0x530b, 0, 0, &eax, &ebx, &ecx, &dummy, &dummy))
return (eax >> 8) & 0xff;
*event = ebx;
if (apm_bios_info.version < 0x0102)
......@@ -473,27 +470,31 @@ static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info)
return APM_SUCCESS;
}
static int set_power_state(u_short what, u_short state)
static inline int set_power_state(u_short what, u_short state)
{
int error;
u32 eax;
error = apm_bios_call_simple(0x5307, what, state, &eax);
if (error)
if (apm_bios_call_simple(0x5307, what, state, &eax))
return (eax >> 8) & 0xff;
return APM_SUCCESS;
}
int apm_set_power_state(u_short state)
static int apm_set_power_state(u_short state)
{
return set_power_state(0x0001, state);
}
void apm_power_off(void)
{
if (apm_enabled)
(void) apm_set_power_state(APM_STATE_OFF);
}
#ifdef CONFIG_APM_DISPLAY_BLANK
/* Called by apm_display_blank and apm_display_unblank when apm_enabled. */
static int apm_set_display_power_state(u_short state)
{
return set_power_state(0x01ff, state);
return set_power_state(0x0100, state);
}
#endif
......@@ -501,12 +502,11 @@ static int apm_set_display_power_state(u_short state)
/* Called by apm_setup if apm_enabled will be true. */
static int apm_enable_power_management(void)
{
int error;
u32 eax;
error = apm_bios_call_simple(0x5308,
(apm_bios_info.version > 0x100) ? 0x0001 : 0xffff, 1, &eax);
if (error)
if (apm_bios_call_simple(0x5308,
(apm_bios_info.version > 0x100) ? 0x0001 : 0xffff,
1, &eax))
return (eax >> 8) & 0xff;
return APM_SUCCESS;
}
......@@ -514,15 +514,13 @@ static int apm_enable_power_management(void)
static int apm_get_power_status(u_short *status, u_short *bat, u_short *life)
{
int error;
u32 eax;
u32 ebx;
u32 ecx;
u32 edx;
u32 dummy;
error = apm_bios_call(0x530a, 1, 0, &eax, &ebx, &ecx, &edx, &dummy);
if (error)
if (apm_bios_call(0x530a, 1, 0, &eax, &ebx, &ecx, &edx, &dummy))
return (eax >> 8) & 0xff;
*status = ebx;
*bat = ecx;
......@@ -536,7 +534,6 @@ static int apm_get_battery_status(u_short which,
u_short *bat, u_short *life, u_short *nbat)
{
u_short status;
int error;
u32 eax;
u32 ebx;
u32 ecx;
......@@ -551,8 +548,8 @@ static int apm_get_battery_status(u_short which,
return apm_get_power_status(&status, bat, life);
}
error = apm_bios_call(0x530a, (0x8000 | (which)), 0, &eax, &ebx, &ecx, &edx, &esi);
if (error)
if (apm_bios_call(0x530a, (0x8000 | (which)), 0, &eax,
&ebx, &ecx, &edx, &esi))
return (eax >> 8) & 0xff;
*bat = ecx;
*life = edx;
......@@ -563,11 +560,9 @@ static int apm_get_battery_status(u_short which,
static int apm_engage_power_management(u_short device)
{
int error;
u32 eax;
error = apm_bios_call_simple(0x530f, device, 1, &eax);
if (error)
if (apm_bios_call_simple(0x530f, device, 1, &eax))
return (eax >> 8) & 0xff;
return APM_SUCCESS;
}
......@@ -875,14 +870,12 @@ static void do_apm_timer(unsigned long unused)
int apm_do_idle(void)
{
#ifdef CONFIG_APM_CPU_IDLE
int error;
u32 dummy;
if (!apm_enabled)
return 0;
error = apm_bios_call_simple(0x5305, 0, 0, &dummy);
if (error)
if (apm_bios_call_simple(0x5305, 0, 0, &dummy))
return 0;
clock_slowed = (apm_bios_info.flags & APM_IDLE_SLOWS_CLOCK) != 0;
......
......@@ -398,7 +398,7 @@ void machine_halt(void)
void machine_power_off(void)
{
#if defined(CONFIG_APM) && defined(CONFIG_APM_POWER_OFF)
apm_set_power_state(APM_STATE_OFF);
apm_power_off();
#endif
}
......
......@@ -103,8 +103,13 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
tsk = current;
mm = tsk->mm;
/*
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
if (in_interrupt() || mm == &init_mm)
die("page fault without a user context",regs,error_code);
goto no_context;
down(&mm->mmap_sem);
......@@ -194,6 +199,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
}
}
no_context:
/* Are we prepared to handle this kernel fault? */
if ((fixup = search_exception_table(regs->eip)) != 0) {
regs->eip = fixup;
......@@ -235,8 +241,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
printk(KERN_ALERT "*pte = %08lx\n", page);
}
lock_kernel();
die("Oops", regs, error_code);
do_exit(SIGKILL);
unlock_kernel();
}
......@@ -49,7 +49,6 @@ EXPORT_SYMBOL(local_irq_count);
EXPORT_SYMBOL(local_bh_count);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(checksignals);
/* Networking helper routines. */
EXPORT_SYMBOL(csum_partial_copy);
......
......@@ -95,9 +95,6 @@ void machine_halt(void)
void machine_power_off(void)
{
#if defined(CONFIG_APM) && defined(CONFIG_APM_POWER_OFF)
apm_set_power_state(APM_STATE_OFF);
#endif
}
void show_regs(struct pt_regs * regs)
......
......@@ -65,17 +65,6 @@ const int frame_extra_sizes[16] = {
-1, /* sizeof(((struct frame *)0)->un.fmtf), */
};
void checksignals(void)
{
sigset_t *blocked = &current->blocked;
unsigned long mask = blocked->sig[0] | sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGQUIT);
mask &= blocked->sig[1];
if (~mask) {
printk("Bad signal mask\n");
*(int *) 0 = 0;
}
}
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
......
......@@ -226,10 +226,7 @@ void machine_power_off(void)
case _MACH_prep:
machine_restart(NULL);
case _MACH_apus:
#if defined(CONFIG_APM) && defined(CONFIG_APM_POWER_OFF)
apm_set_power_state(APM_STATE_OFF);
for (;;);
#endif
}
for (;;);
#else /* CONFIG_MBX */
......
......@@ -45,7 +45,7 @@
* flag, can be configured by issuing an ioctl to the block device interface,
* as any other ide device.
*
* Our own ide-tape ioctl's can can be issued to either the block device or
* Our own ide-tape ioctl's can be issued to either the block device or
* the character device interface.
*
* Maximal throughput with minimal bus load will usually be achieved in the
......@@ -276,7 +276,7 @@
* loop which checks if the pipeline is empty, and if it is, we
* increase the maximum number of stages as necessary until we
* reach the optimum value which just manages to keep the tape
* busy with with minimum allocated memory or until we reach
* busy with minimum allocated memory or until we reach
* IDETAPE_MAX_PIPELINE_STAGES.
*
* Concerning (2):
......
......@@ -1434,9 +1434,9 @@ void ide_init_drive_cmd (struct request *rq)
* This function issues a special IDE device request
* onto the request queue.
*
* If action is ide_wait, then then rq is queued at the end of
* the request queue, and the function sleeps until it has been
* processed. This is for use when invoked from an ioctl handler.
* If action is ide_wait, then the rq is queued at the end of the
* request queue, and the function sleeps until it has been processed.
* This is for use when invoked from an ioctl handler.
*
* If action is ide_preempt, then the rq is queued at the head of
* the request queue, displacing the currently-being-processed
......
......@@ -611,9 +611,9 @@ typedef enum
* This function issues a special IDE device request
* onto the request queue.
*
* If action is ide_wait, then then rq is queued at the end of
* the request queue, and the function sleeps until it has been
* processed. This is for use when invoked from an ioctl handler.
* If action is ide_wait, then the rq is queued at the end of the
* request queue, and the function sleeps until it has been processed.
* This is for use when invoked from an ioctl handler.
*
* If action is ide_preempt, then the rq is queued at the head of
* the request queue, displacing the currently-being-processed
......
......@@ -124,8 +124,10 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
fi
fi
tristate '/dev/nvram support' CONFIG_NVRAM
tristate 'PC joystick support' CONFIG_JOYSTICK
tristate 'Joystick support' CONFIG_JOYSTICK
if [ "$CONFIG_JOYSTICK" != "n" ]; then
source drivers/char/joystick/Config.in
fi
mainmenu_option next_comment
comment 'Ftape, the floppy tape device driver'
tristate 'Ftape (QIC-80/Travan) support' CONFIG_FTAPE
......
......@@ -11,7 +11,7 @@
SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS) ftape
ALL_SUB_DIRS := $(SUB_DIRS) ftape joystick
#
# This file contains the font map for the default (hardware) font
......@@ -159,10 +159,12 @@ else
endif
ifeq ($(CONFIG_JOYSTICK),y)
L_OBJS += joystick.o
L_OBJS += joystick/js.o
SUB_DIRS += joystick
MOD_SUB_DIRS += joystick
else
ifeq ($(CONFIG_JOYSTICK),m)
M_OBJS += joystick.o
MOD_SUB_DIRS += joystick
endif
endif
......
......@@ -1954,11 +1954,17 @@ static void console_bh(void)
}
}
#ifdef CONFIG_VT_CONSOLE
/*
* Console on virtual terminal
*
* NOTE NOTE NOTE! This code can do no global locking. In particular,
* we can't disable interrupts or bottom half handlers globally, because
* we can be called from contexts that hold critical spinlocks, and
* trying do get a global lock at this point will lead to deadlocks.
*/
#ifdef CONFIG_VT_CONSOLE
void vt_console_print(struct console *co, const char * b, unsigned count)
{
int currcons = fg_console;
......@@ -1992,7 +1998,6 @@ void vt_console_print(struct console *co, const char * b, unsigned count)
/* Contrived structure to try to emulate original need_wrap behaviour
* Problems caused when we have need_wrap set on '\n' character */
disable_bh(CONSOLE_BH);
while (count--) {
c = *b++;
if (c == 10 || c == 13 || c == 8 || need_wrap) {
......@@ -2036,7 +2041,6 @@ void vt_console_print(struct console *co, const char * b, unsigned count)
need_wrap = 1;
}
}
enable_bh(CONSOLE_BH);
set_cursor(currcons);
poke_blanked_console();
......
This diff is collapsed.
#
# Joystick lowlevel driver configuration
#
dep_tristate ' Classic PC analog joysticks' CONFIG_JOY_ANALOG $CONFIG_JOYSTICK
dep_tristate ' FPGaming and MadCatz A3D controllers' CONFIG_JOY_ASSASIN $CONFIG_JOYSTICK
dep_tristate ' Gravis GrIP gamepads' CONFIG_JOY_GRAVIS $CONFIG_JOYSTICK
dep_tristate ' Logitech Digital joysticks' CONFIG_JOY_LOGITECH $CONFIG_JOYSTICK
dep_tristate ' Microsoft SideWinder, Genius Digital joysticks' CONFIG_JOY_SIDEWINDER $CONFIG_JOYSTICK
dep_tristate ' ThrustMaster DirectConnect (BSP) joysticks' CONFIG_JOY_THRUSTMASTER $CONFIG_JOYSTICK
dep_tristate ' PDPI Lightning L4 gamecards' CONFIG_JOY_LIGHTNING $CONFIG_JOYSTICK
if [ "$CONFIG_PARPORT" != "n" ]; then
dep_tristate ' NES, SNES, PSX, Multisystem gamepads' CONFIG_JOY_CONSOLE $CONFIG_JOYSTICK
dep_tristate ' Sega, Multisystem gamepads' CONFIG_JOY_DB9 $CONFIG_JOYSTICK
dep_tristate ' TurboGraFX Multisystem joystick interface' CONFIG_JOY_TURBOGRAFX $CONFIG_JOYSTICK
fi
if [ "$CONFIG_AMIGA" = "y" ]; then
dep_tristate ' Amiga joysticks' CONFIG_JOY_AMIGA $CONFIG_JOYSTICK
fi
#
# Makefile for the joystick drivers.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
#
O_TARGET := js.o
O_OBJS :=
M_OBJS :=
ifeq ($(CONFIG_JOYSTICK),y)
O_OBJS += joystick.o
else
ifeq ($(CONFIG_JOYSTICK),m)
M_OBJS += joystick.o
endif
endif
ifeq ($(CONFIG_JOY_AMIGA),y)
O_OBJS += joy-amiga.o
else
ifeq ($(CONFIG_JOY_AMIGA),m)
M_OBJS += joy-amiga.o
endif
endif
ifeq ($(CONFIG_JOY_ANALOG),y)
O_OBJS += joy-analog.o
else
ifeq ($(CONFIG_JOY_ANALOG),m)
M_OBJS += joy-analog.o
endif
endif
ifeq ($(CONFIG_JOY_ASSASIN),y)
O_OBJS += joy-assasin.o
else
ifeq ($(CONFIG_JOY_ASSASIN),m)
M_OBJS += joy-assasin.o
endif
endif
ifeq ($(CONFIG_JOY_CONSOLE),y)
O_OBJS += joy-console.o
else
ifeq ($(CONFIG_JOY_CONSOLE),m)
M_OBJS += joy-console.o
endif
endif
ifeq ($(CONFIG_JOY_DB9),y)
O_OBJS += joy-db9.o
else
ifeq ($(CONFIG_JOY_DB9),m)
M_OBJS += joy-db9.o
endif
endif
ifeq ($(CONFIG_JOY_GRAVIS),y)
O_OBJS += joy-gravis.o
else
ifeq ($(CONFIG_JOY_GRAVIS),m)
M_OBJS += joy-gravis.o
endif
endif
ifeq ($(CONFIG_JOY_LIGHTNING),y)
O_OBJS += joy-lightning.o
else
ifeq ($(CONFIG_JOY_LIGHTNING),m)
M_OBJS += joy-lightning.o
endif
endif
ifeq ($(CONFIG_JOY_LOGITECH),y)
O_OBJS += joy-logitech.o
else
ifeq ($(CONFIG_JOY_LOGITECH),m)
M_OBJS += joy-logitech.o
endif
endif
ifeq ($(CONFIG_JOY_SIDEWINDER),y)
O_OBJS += joy-sidewinder.o
else
ifeq ($(CONFIG_JOY_SIDEWINDER),m)
M_OBJS += joy-sidewinder.o
endif
endif
ifeq ($(CONFIG_JOY_THRUSTMASTER),y)
O_OBJS += joy-thrustmaster.o
else
ifeq ($(CONFIG_JOY_THRUSTMASTER),m)
M_OBJS += joy-thrustmaster.o
endif
endif
ifeq ($(CONFIG_JOY_TURBOGRAFX),y)
O_OBJS += joy-turbografx.o
else
ifeq ($(CONFIG_JOY_TURBOGRAFX),m)
M_OBJS += joy-turbografx.o
endif
endif
include $(TOPDIR)/Rules.make
/*
* joy-amiga.c Version 1.2
*
* Copyright (c) 1998 Vojtech Pavlik
*/
/*
* This is a module for the Linux joystick driver, supporting
* microswitch based joystick connected to Amiga joystick port.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
#include <asm/system.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/joystick.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/amigahw.h>
static struct js_port* js_am_port __initdata = NULL;
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_PARM(js_am, "1-2i");
static int js_am[]={0,0};
/*
* js_am_read() reads and Amiga joystick data.
*/
static int js_am_read(void *info, int **axes, int **buttons)
{
int data = 0;
switch (*(int*)info) {
case 0:
data = ~custom.joy0dat;
buttons[0][0] = (~ciaa.pra >> 6) & 1;
break;
case 1:
data = ~custom.joy1dat;
buttons[0][0] = (~ciaa.pra >> 7) & 1;
break;
default:
return -1;
}
axes[0][0] = ((data >> 1) & 1) - ((data >> 9) & 1);
data = ~(data ^ (data << 1));
axes[0][0] = ((data >> 1) & 1) - ((data >> 9) & 1);
return 0;
}
/*
* js_am_open() is a callback from the file open routine.
*/
static int js_am_open(struct js_dev *jd)
{
MOD_INC_USE_COUNT;
return 0;
}
/*
* js_am_close() is a callback from the file release routine.
*/
static int js_am_close(struct js_dev *jd)
{
MOD_DEC_USE_COUNT;
return 0;
}
/*
* js_am_init_corr() initializes correction values of
* Amiga joysticks.
*/
static void __init js_am_init_corr(struct js_corr **corr)
{
int i;
for (i = 0; i < 2; i++) {
corr[0][i].type = JS_CORR_BROKEN;
corr[0][i].prec = 0;
corr[0][i].coef[0] = 0;
corr[0][i].coef[1] = 0;
corr[0][i].coef[2] = (1 << 29);
corr[0][i].coef[3] = (1 << 29);
}
}
#ifndef MODULE
void __init js_am_setup(char *str, int *ints)
{
int i;
for (i = 0; i <= ints[0] && i < 2; i++) js_am[i] = ints[i+1];
}
#endif
#ifdef MODULE
int init_module(void)
#else
int __init js_am_init(void)
#endif
{
int i;
for (i = 0; i < 2; i++)
if (js_am[i]) {
js_am_port = js_register_port(js_am_port, &i, 1, sizeof(int), js_am_read);
printk(KERN_INFO "js%d: Amiga joystick at joy%ddat\n",
js_register_device(js_am_port, 0, 2, 1, "Amiga joystick", js_am_open, js_am_close), i);
js_am_init_corr(js_am_port->corr);
}
if (js_am_port) return 0;
#ifdef MODULE
printk(KERN_WARNING "joy-amiga: no joysticks specified\n");
#endif
return -ENODEV;
}
#ifdef MODULE
void cleanup_module(void)
{
while (js_am_port) {
if (js_am_port->devs[0])
js_unregister_device(js_am_port->devs[0]);
js_am_port = js_unregister_port(js_am_port);
}
}
#endif
/*
* joy-analog.c Version 1.2
*
* Copyright (c) 1996-1998 Vojtech Pavlik
*/
/*
* This is a module for the Linux joystick driver, supporting
* up to two analog (or CHF/FCS) joysticks on a single joystick port.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/joystick.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#define JS_AN_MAX_TIME 3000
static int js_an_port_list[] __initdata = {0x201, 0};
static struct js_port* js_an_port __initdata = NULL;
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_PARM(js_an, "2-24i");
static int js_an[]={-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0};
#include "joy-analog.h"
/*
* js_an_read() reads analog joystick data.
*/
static int js_an_read(void *xinfo, int **axes, int **buttons)
{
struct js_an_info *info = xinfo;
unsigned char buf[4];
int time[4];
unsigned char u, v, a;
unsigned int t, t1;
int i, j;
int timeout;
int io = info->io;
timeout = (JS_AN_MAX_TIME * js_time_speed_a) >> 10;
info->buttons = (~inb(io) & JS_AN_BUTTONS_STD) >> 4;
i = 0;
u = a = ((info->mask[0] | info->mask[1]) & JS_AN_AXES_STD) | (info->extensions & JS_AN_HAT_FCS)
| ((info->extensions & JS_AN_BUTTONS_PXY_XY) >> 2) | ((info->extensions & JS_AN_BUTTONS_PXY_UV) >> 4);
outb(inb(io),io);
t = js_get_time_a();
do {
v = inb(io) & a;
t1 = js_get_time_a();
if (u ^ v) {
time[i] = js_delta_a(t1,t);
buf[i] = u ^ v;
u = v;
i++;
}
} while (v && js_delta_a(t1,t) < timeout);
for (--i; i >= 0; i--)
for (j = 0; j < 4; j++)
if (buf[i] & (1 << j)) info->axes[j] = (time[i] << 10) / js_time_speed_a;
js_an_decode(info, axes, buttons);
return 0;
}
/*
* js_an_open() is a callback from the file open routine.
*/
static int js_an_open(struct js_dev *jd)
{
MOD_INC_USE_COUNT;
return 0;
}
/*
* js_an_close() is a callback from the file release routine.
*/
static int js_an_close(struct js_dev *jd)
{
MOD_DEC_USE_COUNT;
return 0;
}
/*
* js_an_probe() probes for analog joysticks.
*/
static struct js_port __init *js_an_probe(int io, int mask0, int mask1, struct js_port *port)
{
struct js_an_info info;
int i, numdev;
unsigned char u;
if (io < 0) return port;
if (check_region(io, 1)) return port;
if (((u = inb(io)) & 3) == 3) return port;
outb(u,io);
u = inb(io);
udelay(JS_AN_MAX_TIME);
u = (inb(io) ^ u) & u;
if (!u) return port;
if (u & 0xf0) return port;
if ((numdev = js_an_probe_devs(&info, u, mask0, mask1, port)) <= 0)
return port;
info.io = io;
request_region(info.io, 1, "joystick (analog)");
port = js_register_port(port, &info, numdev, sizeof(struct js_an_info), js_an_read);
for (i = 0; i < numdev; i++)
printk(KERN_INFO "js%d: %s at %#x\n",
js_register_device(port, i, js_an_axes(i, &info), js_an_buttons(i, &info),
js_an_name(i, &info), js_an_open, js_an_close),
js_an_name(i, &info), info.io);
js_an_read(port->info, port->axes, port->buttons);
js_an_init_corr(port->info, port->axes, port->corr, 8);
return port;
}
#ifndef MODULE
void __init js_an_setup(char *str, int *ints)
{
int i;
for (i = 0; i <= ints[0] && i < 24; i++) js_an[i] = ints[i+1];
}
#endif
#ifdef MODULE
int init_module(void)
#else
int __init js_an_init(void)
#endif
{
int i;
if (js_an[0] >= 0) {
for (i = 0; (js_an[i*3] >= 0) && i < 8; i++)
js_an_port = js_an_probe(js_an[i*3], js_an[i*3+1], js_an[i*3+2], js_an_port);
} else {
for (i = 0; js_an_port_list[i]; i++)
js_an_port = js_an_probe(js_an_port_list[i], 0, 0, js_an_port);
}
if (js_an_port) return 0;
#ifdef MODULE
printk(KERN_WARNING "joy-analog: no joysticks found\n");
#endif
return -ENODEV;
}
#ifdef MODULE
void cleanup_module(void)
{
int i;
struct js_an_info *info;
while (js_an_port) {
for (i = 0; i < js_an_port->ndevs; i++)
if (js_an_port->devs[i])
js_unregister_device(js_an_port->devs[i]);
info = js_an_port->info;
release_region(info->io, 1);
js_an_port = js_unregister_port(js_an_port);
}
}
#endif
/*
* joy-analog.h Version 1.2
*
* Copyright (c) 1996-1998 Vojtech Pavlik
*/
/*
* This file is designed to be included in any joystick driver
* that communicates with standard analog joysticks. This currently
* is: joy-analog.c, joy-assasin.c, and joy-lightning.c
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
#define JS_AN_AXES_STD 0x0f
#define JS_AN_BUTTONS_STD 0xf0
#define JS_AN_BUTTONS_CHF 0x01
#define JS_AN_HAT1_CHF 0x02
#define JS_AN_HAT2_CHF 0x04
#define JS_AN_ANY_CHF 0x07
#define JS_AN_HAT_FCS 0x08
#define JS_AN_HATS_ALL 0x0e
#define JS_AN_BUTTON_PXY_X 0x10
#define JS_AN_BUTTON_PXY_Y 0x20
#define JS_AN_BUTTON_PXY_U 0x40
#define JS_AN_BUTTON_PXY_V 0x80
#define JS_AN_BUTTONS_PXY_XY 0x30
#define JS_AN_BUTTONS_PXY_UV 0xc0
#define JS_AN_BUTTONS_PXY 0xf0
static struct {
int x;
int y;
} js_an_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1, 0}, { 0, 1}, {-1, 0}};
struct js_an_info {
int io;
unsigned char mask[2];
unsigned int extensions;
int axes[4];
int initial[4];
unsigned char buttons;
};
/*
* js_an_decode() decodes analog joystick data.
*/
static void js_an_decode(struct js_an_info *info, int **axes, int **buttons)
{
int i, j, k;
int hat1, hat2, hat3;
hat1 = hat2 = hat3 = 0;
if (info->mask[0] & JS_AN_BUTTONS_STD) buttons[0][0] = 0;
if (info->mask[1] & JS_AN_BUTTONS_STD) buttons[1][0] = 0;
if (info->extensions & JS_AN_ANY_CHF) {
switch (info->buttons) {
case 0x1: buttons[0][0] = 0x01; break;
case 0x2: buttons[0][0] = 0x02; break;
case 0x4: buttons[0][0] = 0x04; break;
case 0x8: buttons[0][0] = 0x08; break;
case 0x5: buttons[0][0] = 0x10; break;
case 0x9: buttons[0][0] = 0x20; break;
case 0xf: hat1 = 1; break;
case 0xb: hat1 = 2; break;
case 0x7: hat1 = 3; break;
case 0x3: hat1 = 4; break;
case 0xe: hat2 = 1; break;
case 0xa: hat2 = 2; break;
case 0x6: hat2 = 3; break;
case 0xc: hat2 = 4; break;
}
k = info->extensions & JS_AN_BUTTONS_CHF ? 6 : 4;
} else {
for (i = 1; i >= 0; i--)
for (j = k = 0; j < 4; j++)
if (info->mask[i] & (0x10 << j))
buttons[i][0] |= ((info->buttons >> j) & 1) << k++;
}
if (info->extensions & JS_AN_BUTTON_PXY_X)
buttons[0][0] |= (info->axes[2] < (info->initial[2] >> 1)) << k++;
if (info->extensions & JS_AN_BUTTON_PXY_Y)
buttons[0][0] |= (info->axes[3] < (info->initial[3] >> 1)) << k++;
if (info->extensions & JS_AN_BUTTON_PXY_U)
buttons[0][0] |= (info->axes[2] > (info->initial[2] + (info->initial[2] >> 1))) << k++;
if (info->extensions & JS_AN_BUTTON_PXY_V)
buttons[0][0] |= (info->axes[3] > (info->initial[3] + (info->initial[3] >> 1))) << k++;
if (info->extensions & JS_AN_HAT_FCS)
for (j = 0; j < 4; j++)
if (info->axes[3] < ((info->initial[3] * ((j << 1) + 1)) >> 3)) {
hat3 = j + 1;
break;
}
for (i = 1; i >= 0; i--)
for (j = k = 0; j < 4; j++)
if (info->mask[i] & (1 << j))
axes[i][k++] = info->axes[j];
if (info->extensions & JS_AN_HAT1_CHF) {
axes[0][k++] = js_an_hat_to_axis[hat1].x;
axes[0][k++] = js_an_hat_to_axis[hat1].y;
}
if (info->extensions & JS_AN_HAT2_CHF) {
axes[0][k++] = js_an_hat_to_axis[hat2].x;
axes[0][k++] = js_an_hat_to_axis[hat2].y;
}
if (info->extensions & JS_AN_HAT_FCS) {
axes[0][k++] = js_an_hat_to_axis[hat3].x;
axes[0][k++] = js_an_hat_to_axis[hat3].y;
}
}
/*
* js_an_count_bits() counts set bits in a byte.
*/
static inline int js_an_count_bits(unsigned long c)
{
int i = 0;
while (c) {
i += c & 1;
c >>= 1;
}
return i;
}
/*
* js_an_init_corr() initializes the correction values for
* analog joysticks.
*/
static void __init js_an_init_corr(struct js_an_info *info, int **axes, struct js_corr **corr, int prec)
{
int i, j, t;
for (i = 0; i < 2; i++)
for (j = 0; j < js_an_count_bits(info->mask[i] & 0xf); j++) {
if ((j == 2 && (info->mask[i] & 0xb) == 0xb) ||
(j == 3 && (info->mask[i] & 0xf) == 0xf)) {
t = (axes[i][0] + axes[i][1]) >> 1;
} else {
t = axes[i][j];
}
corr[i][j].type = JS_CORR_BROKEN;
corr[i][j].prec = prec;
corr[i][j].coef[0] = t - (t >> 3);
corr[i][j].coef[1] = t + (t >> 3);
corr[i][j].coef[2] = (1 << 29) / (t - (t >> 2) + 1);
corr[i][j].coef[3] = (1 << 29) / (t - (t >> 2) + 1);
}
i = js_an_count_bits(info->mask[0] & 0xf);
for (j = i; j < i + (js_an_count_bits(info->extensions & JS_AN_HATS_ALL) << 1); j++) {
corr[0][j].type = JS_CORR_BROKEN;
corr[0][j].prec = 0;
corr[0][j].coef[0] = 0;
corr[0][j].coef[1] = 0;
corr[0][j].coef[2] = (1 << 29);
corr[0][j].coef[3] = (1 << 29);
}
for (i = 0; i < 4; i++)
info->initial[i] = info->axes[i];
}
/*
* js_an_probe_devs() probes for analog joysticks.
*/
static int __init js_an_probe_devs(struct js_an_info *info, int exist, int mask0, int mask1, struct js_port *port)
{
info->mask[0] = info->mask[1] = info->extensions = 0;
if (mask0 || mask1) {
info->mask[0] = mask0 & (exist | 0xf0);
info->mask[1] = mask1 & (exist | 0xf0) & ~info->mask[0];
info->extensions = (mask0 >> 8) & ((exist & JS_AN_HAT_FCS) | ((exist << 2) & JS_AN_BUTTONS_PXY_XY) |
((exist << 4) & JS_AN_BUTTONS_PXY_UV) | JS_AN_ANY_CHF);
if (info->extensions & JS_AN_BUTTONS_PXY) {
info->mask[0] &= ~((info->extensions & JS_AN_BUTTONS_PXY_XY) >> 2);
info->mask[0] &= ~((info->extensions & JS_AN_BUTTONS_PXY_UV) >> 4);
info->mask[1] = 0;
}
if (info->extensions & JS_AN_HAT_FCS) {
info->mask[0] &= ~JS_AN_HAT_FCS;
info->mask[1] = 0;
info->extensions &= ~(JS_AN_BUTTON_PXY_Y | JS_AN_BUTTON_PXY_U);
}
if (info->extensions & JS_AN_ANY_CHF) {
info->mask[0] |= 0xf0;
info->mask[1] = 0;
}
if (!(info->mask[0] | info->mask[1])) return -1;
} else {
switch (exist) {
case 0x0:
return -1;
case 0x3:
info->mask[0] = 0xf3; /* joystick 0, assuming 4-button */
break;
case 0xb:
info->mask[0] = 0xfb; /* 3-axis, 4-button joystick */
break;
case 0xc:
info->mask[0] = 0xcc; /* joystick 1 */
break;
case 0xf:
info->mask[0] = 0x33; /* joysticks 0 and 1 */
info->mask[1] = 0xcc;
break;
default:
printk(KERN_WARNING "joy-analog: Unknown joystick device detected "
"(data=%#x), contact <vojtech@ucw.cz>\n", exist);
return -1;
}
}
return !!info->mask[0] + !!info->mask[1];
}
/*
* js_an_axes() returns the number of axes for an analog joystick.
*/
static inline int js_an_axes(int i, struct js_an_info *info)
{
return js_an_count_bits(info->mask[i] & 0x0f) + js_an_count_bits(info->extensions & JS_AN_HATS_ALL) * 2;
}
/*
* js_an_buttons() returns the number of buttons for an analog joystick.
*/
static inline int js_an_buttons(int i, struct js_an_info *info)
{
return js_an_count_bits(info->mask[i] & 0xf0) +
(info->extensions & JS_AN_BUTTONS_CHF) * 2 +
js_an_count_bits(info->extensions & JS_AN_BUTTONS_PXY);
}
/*
* js_an_name() constructs a name for an analog joystick.
*/
static char js_an_name_buf[128] __initdata = "";
static char __init *js_an_name(int i, struct js_an_info *info)
{
sprintf(js_an_name_buf, "Analog %d-axis %d-button",
js_an_count_bits(info->mask[i] & 0x0f),
js_an_buttons(i, info));
if (info->extensions & JS_AN_HATS_ALL)
sprintf(js_an_name_buf, "%s %d-hat",
js_an_name_buf,
js_an_count_bits(info->extensions & JS_AN_HATS_ALL));
strcat(js_an_name_buf, " joystick");
if (info->extensions)
sprintf(js_an_name_buf, "%s with%s%s%s extensions",
js_an_name_buf,
info->extensions & JS_AN_ANY_CHF ? " CHF" : "",
info->extensions & JS_AN_HAT_FCS ? " FCS" : "",
info->extensions & JS_AN_BUTTONS_PXY ? " XY-button" : "");
return js_an_name_buf;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -67,6 +67,7 @@
#include <asm/system.h>
#include <asm/segment.h>
#include <asm/bitops.h>
#include <asm/hwtest.h>
#include "mac_SCC.h"
......@@ -1300,6 +1301,12 @@ static void probe_sccs(void)
/* testing: fix up broken 24 bit addresses (ClassicII) */
if ((mac_bi_data.sccbase & 0x00FFFFFF) == mac_bi_data.sccbase)
mac_bi_data.sccbase |= 0x50000000;
if ( !hwreg_present((void *)mac_bi_data.sccbase))
{
printk(KERN_WARNING "z8530: Serial devices not accessible. Check serial switch.\n");
return;
}
for(n=0;n<2;n++)
{
......@@ -1459,11 +1466,7 @@ int mac_SCC_init(void)
printk("Mac68K Z8530 serial driver version 1.01\n");
/* SCC present at all? */
if (MACH_IS_ATARI || MACH_IS_AMIGA
#if 0
|| !(MACHW_PRESENT(SCC) || MACHW_PRESENT(ST_ESCC))
#endif
)
if (!MACH_IS_MAC)
return( -ENODEV );
if (zs_chain == 0)
......
......@@ -85,7 +85,7 @@ void handle_sysrq(int key, struct pt_regs *pt_regs,
#ifdef CONFIG_APM
case 'o': /* O -- power off */
printk("Power off\n");
apm_set_power_state(APM_STATE_OFF);
apm_power_off();
break;
#endif
case 's': /* S -- emergency sync */
......
......@@ -1255,8 +1255,9 @@ set_multicast_list(struct device *dev) {
/*************************************************************************/
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_elmc = {
" " /*"3c523"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, elmc_probe };
devicename /*"3c523"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, elmc_probe };
static int irq=0;
static int io=0;
......
......@@ -121,9 +121,11 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
tristate 'EtherExpressPro/100 support' CONFIG_EEXPRESS_PRO100
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Mylex EISA LNE390A/B support (EXPERIMENTAL)' CONFIG_LNE390
tristate 'Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210
fi
tristate 'PCI NE2000 support' CONFIG_NE2K_PCI
tristate 'TI ThunderLAN support' CONFIG_TLAN
tristate 'VIA Rhine support' CONFIG_VIA_RHINE
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210
tristate 'SMC EtherPower II (EXPERIMENTAL)' CONFIG_EPIC100
......@@ -143,6 +145,17 @@ if [ "$CONFIG_FDDI" = "y" ]; then
bool 'Digital DEFEA and DEFPA adapter support' CONFIG_DEFXX
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
bool 'HIPPI driver support (EXPERIMENTAL)' CONFIG_HIPPI
if [ "$CONFIG_HIPPI" = "y" ]; then
bool 'CERN HIPPI PCI adapter support' CONFIG_CERN_HIPPI
bool 'Essential RoadRunner HIPPI PCI adapter support' CONFIG_ROADRUNNER
if [ "$CONFIG_ROADRUNNER" != "n" ]; then
bool ' Use large TX/RX rings' CONFIG_ROADRUNNER_LARGE_RINGS
fi
fi
fi
tristate 'Frame relay DLCI support' CONFIG_DLCI
if [ "$CONFIG_DLCI" = "y" -o "$CONFIG_DLCI" = "m" ]; then
int ' Max open DLCI' CONFIG_DLCI_COUNT 24
......
This diff is collapsed.
This diff is collapsed.
......@@ -205,10 +205,10 @@ __initfunc(static int ac_probe1(int ioaddr, struct device *dev))
* the card mem within the region covered by `normal' RAM !!!
*/
if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */
if (dev->mem_start < (unsigned long)high_memory) {
if (dev->mem_start < virt_to_bus(high_memory)) {
printk(KERN_CRIT "ac3200.c: Card RAM overlaps with normal memory!!!\n");
printk(KERN_CRIT "ac3200.c: Use EISA SCU to set card memory below 1MB,\n");
printk(KERN_CRIT "ac3200.c: or to an address above %p.\n", high_memory);
printk(KERN_CRIT "ac3200.c: or to an address above 0x%lx.\n", virt_to_bus(high_memory));
printk(KERN_CRIT "ac3200.c: Driver NOT installed.\n");
free_irq(dev->irq, dev);
kfree(dev->priv);
......@@ -225,6 +225,7 @@ __initfunc(static int ac_probe1(int ioaddr, struct device *dev))
dev->priv = NULL;
return EAGAIN;
}
ei_status.reg0 = 1; /* Use as remap flag */
printk("ac3200.c: remapped %dkB card memory to virtual address %#lx\n",
AC_STOP_PG/4, dev->mem_start);
}
......@@ -404,6 +405,8 @@ cleanup_module(void)
/* Someday free_irq may be in ac_close_card() */
free_irq(dev->irq, dev);
release_region(dev->base_addr, AC_IO_EXTENT);
if (ei_status.reg0)
iounmap((void *)dev->mem_start);
dev->priv = NULL;
unregister_netdev(dev);
kfree(priv);
......
This diff is collapsed.
......@@ -140,7 +140,7 @@ static int irq = 0; /* Default IRQ */
* N.B.
*
* The Daystar Digital LT200 boards do not support interrupt-driven
* IO. You must specify 'io=0xff' as a module parameter to invoke
* IO. You must specify 'irq=0xff' as a module parameter to invoke
* polled mode. I also believe that the port probing logic is quite
* dangerous at best and certainly hopeless for a polled card. Best to
* specify both. - Steve H.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment