Commit 057f54fb authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.54

parent 6e38a55b
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 53
SUBLEVEL = 54
ARCH = i386
......
......@@ -11,6 +11,7 @@ bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
bool 'Networking support' CONFIG_NET y
bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
bool 'System V IPC' CONFIG_SYSVIPC y
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
if [ "$CONFIG_NET" = "y" ]; then
......
......@@ -1135,7 +1135,7 @@ do_cdu31a_request(void)
unsigned int dev;
int nsect;
unsigned char params[10];
unsigned char res_reg[2];
unsigned char res_reg[12];
unsigned int res_size;
int copyoff;
int spin_up_retry;
......@@ -1263,6 +1263,14 @@ do_cdu31a_request(void)
* next block to read.
*/
copyoff = (block - sony_first_block) * 512;
/*
* Bugfix: get_data calls handle_sony_cd_attention
* there the buffer may be declared invalid
* if the CD ist changed by setting sony_first_block = -1
* This would cause a segfault in memcpy
*/
if(sony_first_block <0) goto cdu31a_request_startover;
memcpy(CURRENT->buffer, sony_buffer+copyoff, 512);
block += 1;
......
......@@ -1745,6 +1745,7 @@ static void redo_format(void)
raw_cmd.track = format_req.track << floppy->stretch;
buffer_track = -1;
setup_format_params();
clear_bit(current_drive, &changed_floppies);
floppy_start();
#ifdef DEBUGT
debugt("queue format request");
......
......@@ -132,6 +132,45 @@ void hd_setup(char *str, int *ints)
NR_HD = hdind+1;
}
static void dump_status (char *msg, unsigned int stat)
{
unsigned long flags;
char dev;
dev = CURRENT ? 'a' + DEVICE_NR(CURRENT->dev) : '?';
save_flags (flags);
sti();
printk("hd%c: %s: status=0x%02x { ", dev, msg, stat & 0xff);
if (stat & BUSY_STAT) printk("Busy ");
if (stat & READY_STAT) printk("DriveReady ");
if (stat & WRERR_STAT) printk("WriteFault ");
if (stat & SEEK_STAT) printk("SeekComplete ");
if (stat & DRQ_STAT) printk("DataRequest ");
if (stat & ECC_STAT) printk("CorrectedError ");
if (stat & INDEX_STAT) printk("Index ");
if (stat & ERR_STAT) printk("Error ");
printk("}\n");
if (stat & ERR_STAT) {
unsigned int err = inb(HD_ERROR);
printk("hd%c: %s: error=0x%02x { ", dev, msg, err & 0xff);
if (err & BBD_ERR) printk("BadSector ");
if (err & ECC_ERR) printk("UncorrectableError ");
if (err & ID_ERR) printk("SectorIdNotFound ");
if (err & ABRT_ERR) printk("DriveStatusError ");
if (err & TRK0_ERR) printk("TrackZeroNotFound ");
if (err & MARK_ERR) printk("AddrMarkNotFound ");
printk("}");
if (err & (BBD_ERR|ECC_ERR|ID_ERR|MARK_ERR)) {
if (CURRENT)
printk(", sector=%ld", CURRENT->sector);
printk(", CHS=%d/%d/%d", (inb(HD_HCYL)<<8) + inb(HD_LCYL),
inb(HD_CURRENT) & 0xf, inb(HD_SECTOR));
}
printk("\n");
}
restore_flags (flags);
}
static int win_result(void)
{
int i=inb_p(HD_STATUS);
......@@ -141,11 +180,7 @@ static int win_result(void)
hd_error = 0;
return 0; /* ok */
}
printk("HD: win_result: status = 0x%02x\n",i);
if (i&1) {
hd_error = inb(HD_ERROR);
printk("HD: win_result: error = 0x%02x\n",hd_error);
}
dump_status("win_result", i);
return 1;
}
......@@ -280,7 +315,7 @@ static void identify_intr(void)
if (unmask_intr[dev])
sti();
if (stat & (BUSY_STAT|ERR_STAT)) {
printk (" hd%c: non-IDE device, CHS=%d%d%d\n", dev+'a',
printk (" hd%c: non-IDE device, CHS=%d/%d/%d\n", dev+'a',
hd_info[dev].cyl, hd_info[dev].head, hd_info[dev].sect);
if (id != NULL) {
hd_ident_info[dev] = NULL;
......@@ -331,7 +366,7 @@ static void set_multmode_intr(void)
sti();
if (stat & (BUSY_STAT|ERR_STAT)) {
mult_req[dev] = mult_count[dev] = 0;
printk (" hd%c: set multiple mode failed\n", dev+'a');
dump_status("set multiple mode failed", stat);
} else {
if ((mult_count[dev] = mult_req[dev]))
printk (" hd%c: enabled %d-sector multiple mode\n",
......@@ -357,7 +392,7 @@ static int drive_busy(void)
if (c == (READY_STAT | SEEK_STAT))
return 0;
}
printk("HD controller times out, status = 0x%02x\n",c);
dump_status("reset timed out", c);
return 1;
}
......@@ -409,16 +444,24 @@ static void reset_hd(void)
hd_request();
}
/*
* Ok, don't know what to do with the unexpected interrupts: on some machines
* doing a reset and a retry seems to result in an eternal loop. Right now I
* ignore it, and just set the timeout.
*
* On laptops (and "green" PCs), an unexpected interrupt occurs whenever the
* drive enters "idle", "standby", or "sleep" mode, so if the status looks
* "good", we just ignore the interrupt completely.
*/
void unexpected_hd_interrupt(void)
{
sti();
printk(KERN_DEBUG "Unexpected HD interrupt\n");
SET_TIMER;
unsigned int stat = inb_p(HD_STATUS);
if (stat & (BUSY_STAT|DRQ_STAT|ECC_STAT|ERR_STAT)) {
dump_status ("unexpected interrupt", stat);
SET_TIMER;
}
}
/*
......@@ -445,11 +488,12 @@ static void bad_rw_intr(void)
static inline int wait_DRQ(void)
{
int retries = 100000;
int retries = 100000, stat;
while (--retries > 0)
if (inb_p(HD_STATUS) & DRQ_STAT)
if ((stat = inb_p(HD_STATUS)) & DRQ_STAT)
return 0;
dump_status("wait_DRQ", stat);
return -1;
}
......@@ -472,14 +516,8 @@ static void read_intr(void)
if (i & DRQ_STAT)
goto ok_to_read;
} while (--retries > 0);
sti();
printk("hd%c: read_intr: status = 0x%02x\n",dev+'a',i);
if (i & ERR_STAT) {
hd_error = (unsigned) inb(HD_ERROR);
printk("hd%c: read_intr: error = 0x%02x\n",dev+'a',hd_error);
}
dump_status("read_intr", i);
bad_rw_intr();
cli();
hd_request();
return;
ok_to_read:
......@@ -565,14 +603,8 @@ static void multwrite_intr(void)
}
}
}
sti();
printk("hd%c: multwrite_intr: status = 0x%02x\n",dev+'a',i);
if (i & ERR_STAT) {
hd_error = (unsigned) inb(HD_ERROR);
printk("hd:%c multwrite_intr: error = 0x%02x\n",dev+'a',hd_error);
}
dump_status("multwrite_intr", i);
bad_rw_intr();
cli();
hd_request();
}
......@@ -592,14 +624,8 @@ static void write_intr(void)
if ((CURRENT->nr_sectors <= 1) || (i & DRQ_STAT))
goto ok_to_write;
} while (--retries > 0);
sti();
printk("HD: write_intr: status = 0x%02x\n",i);
if (i & ERR_STAT) {
hd_error = (unsigned) inb(HD_ERROR);
printk("HD: write_intr: error = 0x%02x\n",hd_error);
}
dump_status("write_intr", i);
bad_rw_intr();
cli();
hd_request();
return;
ok_to_write:
......@@ -644,13 +670,13 @@ static void hd_times_out(void)
return;
reset = 1;
printk(KERN_DEBUG "HD timeout\n");
cli();
if (++CURRENT->errors >= MAX_ERRORS) {
#ifdef DEBUG
printk("hd : too many errors.\n");
#endif
end_request(0);
}
cli();
hd_request();
}
......@@ -763,7 +789,6 @@ static void hd_request(void)
CURRENT->sector+nsect-1, (long) CURRENT->buffer);
#endif
if (wait_DRQ()) {
printk("hd%c: hd_request: no DRQ\n", dev+'a');
bad_rw_intr();
goto repeat;
}
......
Sun Oct 9 23:46:03 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_io.c (do_tty_hangup): If the tty driver flags
TTY_DRIVER_RESET_TERMIOS is set, then reset the termios
settings back to the driver's initial configuration. This
allows the termios settings to be reset even if a process
has hung up file descriptors keeping a pty's termios from
being freed and reset.
* tty_io.c (release_dev): Fix memory leak. The pty's other
termios structure should also be freed.
* serial.c (rs_close, shutdown): Change how we wait for the
transmitter to completely drain before shutting down the
serial port. We now do it by scheduling in another
process instead of busy looping with the interrupts turned
on. This may eliminate some race condition problems that
some people seem to be reporting.
Sun Sep 25 14:18:14 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_io.c (release_dev): When freeing a tty make sure that both
the tty and the o_tty (if present) aren't a process's
controlling tty. (Previously, we only checked the tty.)
* serial.c (change_speed): Only enable the Modem Status
Interrupt for a port if CLOCAL is not set or CRTSCTS
is set. If we're not checking the carrier detect and
CTS line, there's no point in enabling the modem
status interrupt. This will save spurious interrupts
from slowing down systems who have terminals that
don't support either line. (Of course, if you want
only one of CD and CTS support, you will need a
properly wired serial cable.)
Thu Sep 22 08:32:48 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_io.c (do_SAK): Return if tty is null.
* tty_io.c (_tty_name): Return "NULL tty" if the passed in tty is
NULL.
Sat Sep 17 13:19:25 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_ioctl.c (n_tty_ioctl): Fix TIOCGLCKTRMIOS and
TIOCSLCKTRMIOS, which were totally broken. Remove
extra indirection from argument; it should be a struct
termios *, not a struct termios **.
&real_tty->termios_locked should have been
real_tty->termios_locked. This caused us to be
reading and writing the termios_locked structure to
random places in kernel memory.
* tty_io.c (release_dev): Oops! Forgot to delete a critical kfree
of the locked_termios. This leaves the locked_termios
structure pointed at a freed object.
Fri Sep 16 08:13:25 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_io.c (tty_open): Don't check for an exclusive open until
after the device specific open routine has been called.
Otherwise, the serial device ref counting will be screwed
up.
* serial.c (rs_open, block_til_ready): Don't set termios structure
until after block_til_ready has returned successfully.
Modify block_til_ready to check the normal_termios
structure directly, so it doesn't rely on termios being
set before its called.
Thu Sep 15 23:34:01 1994 Theodore Y. Ts'o (tytso@rt-11)
* serial.c (rs_close): Turn off interrupts during rs_close() to
prevent a race condition with the hangup code (which
runs during a software interrupt).
* tty_io.c (release_dev): Don't free the locked_termios structure;
its state must be retained across device opens.
* tty_io.c (tty_unregister_driver): Added function to unregister a
tty driver. (For loadable device drivers.)
......@@ -18,11 +18,11 @@
OBJS = tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o \
defkeymap.o
defkeymap.o uni_to_437.o
SRCS = tty_io.c n_tty.c console.c keyboard.c serial.c \
tty_ioctl.c pty.c vt.c mem.c \
defkeymap.c
defkeymap.c uni_to_437.c
ifdef CONFIG_ATIXL_BUSMOUSE
......
This diff is collapsed.
This diff is collapsed.
keycode 0 =
# Default kernel keymap. This uses 7 modifier combinations.
keymaps 0-2,4-5,8,12
# Change the above line into
# keymaps 0-2,4-6,8,12
# in case you want the entries
# altgr control keycode 83 = Boot
# altgr control keycode 111 = Boot
# below.
#
# In fact AltGr is used very little, and one more keymap can
# be saved by mapping AltGr to Alt (and adapting a few entries):
# keycode 100 = Alt
#
keycode 1 = Escape Escape
alt keycode 1 = Meta_Escape
keycode 2 = one exclam
alt keycode 2 = Meta_one
keycode 3 = two at at
control keycode 3 = nul
shift control keycode 3 = nul
alt keycode 3 = Meta_two
control keycode 3 = nul
shift control keycode 3 = nul
alt keycode 3 = Meta_two
keycode 4 = three numbersign
control keycode 4 = Escape
alt keycode 4 = Meta_three
......@@ -30,18 +42,20 @@ keycode 10 = nine parenleft bracketright
keycode 11 = zero parenright braceright
alt keycode 11 = Meta_zero
keycode 12 = minus underscore backslash
control keycode 12 = Control_underscore
shift control keycode 12 = Control_underscore
alt keycode 12 = Meta_minus
control keycode 12 = Control_underscore
shift control keycode 12 = Control_underscore
alt keycode 12 = Meta_minus
keycode 13 = equal plus
alt keycode 13 = Meta_equal
keycode 14 = Delete Delete
control keycode 14 = BackSpace
alt keycode 14 = Meta_Delete
keycode 15 = Tab Tab
alt keycode 15 = Meta_Tab
keycode 16 = q
keycode 17 = w
keycode 18 = e
keycode 18 = e
altgr keycode 18 = Hex_E
keycode 19 = r
keycode 20 = t
keycode 21 = y
......@@ -58,10 +72,13 @@ keycode 27 = bracketright braceright asciitilde
keycode 28 = Return
alt keycode 28 = Meta_Control_m
keycode 29 = Control
keycode 30 = a
keycode 30 = a
altgr keycode 30 = Hex_A
keycode 31 = s
keycode 32 = d
keycode 33 = f
keycode 32 = d
altgr keycode 32 = Hex_D
keycode 33 = f
altgr keycode 33 = Hex_F
keycode 34 = g
keycode 35 = h
keycode 36 = j
......@@ -81,15 +98,17 @@ keycode 43 = backslash bar
alt keycode 43 = Meta_backslash
keycode 44 = z
keycode 45 = x
keycode 46 = c
keycode 46 = c
altgr keycode 46 = Hex_C
keycode 47 = v
keycode 48 = b
keycode 48 = b
altgr keycode 48 = Hex_B
keycode 49 = n
keycode 50 = m
keycode 51 = comma less
alt keycode 51 = Meta_comma
keycode 52 = period greater
control keycode 52 = Compose
control keycode 52 = Compose
alt keycode 52 = Meta_period
keycode 53 = slash question
control keycode 53 = Delete
......@@ -104,61 +123,81 @@ keycode 58 = Caps_Lock
keycode 59 = F1 F11 Console_13
control keycode 59 = F1
alt keycode 59 = Console_1
control alt keycode 59 = Console_1
keycode 60 = F2 F12 Console_14
control keycode 60 = F2
alt keycode 60 = Console_2
control alt keycode 60 = Console_2
keycode 61 = F3 F13 Console_15
control keycode 61 = F3
alt keycode 61 = Console_3
control alt keycode 61 = Console_3
keycode 62 = F4 F14 Console_16
control keycode 62 = F4
alt keycode 62 = Console_4
control alt keycode 62 = Console_4
keycode 63 = F5 F15 Console_17
control keycode 63 = F5
alt keycode 63 = Console_5
control alt keycode 63 = Console_5
keycode 64 = F6 F16 Console_18
control keycode 64 = F6
alt keycode 64 = Console_6
control alt keycode 64 = Console_6
keycode 65 = F7 F17 Console_19
control keycode 65 = F7
alt keycode 65 = Console_7
control alt keycode 65 = Console_7
keycode 66 = F8 F18 Console_20
control keycode 66 = F8
alt keycode 66 = Console_8
control alt keycode 66 = Console_8
keycode 67 = F9 F19 Console_21
control keycode 67 = F9
alt keycode 67 = Console_9
control alt keycode 67 = Console_9
keycode 68 = F10 F20 Console_22
control keycode 68 = F10
alt keycode 68 = Console_10
control alt keycode 68 = Console_10
keycode 69 = Num_Lock
keycode 70 = Scroll_Lock Show_Memory Show_Registers
control keycode 70 = Show_State
alt keycode 70 = Scroll_Lock
keycode 71 = KP_7
alt keycode 71 = Ascii_7
altgr keycode 71 = Hex_7
keycode 72 = KP_8
alt keycode 72 = Ascii_8
altgr keycode 72 = Hex_8
keycode 73 = KP_9
alt keycode 73 = Ascii_9
altgr keycode 73 = Hex_9
keycode 74 = KP_Subtract
keycode 75 = KP_4
alt keycode 75 = Ascii_4
altgr keycode 75 = Hex_4
keycode 76 = KP_5
alt keycode 76 = Ascii_5
altgr keycode 76 = Hex_5
keycode 77 = KP_6
alt keycode 77 = Ascii_6
altgr keycode 77 = Hex_6
keycode 78 = KP_Add
keycode 79 = KP_1
alt keycode 79 = Ascii_1
altgr keycode 79 = Hex_1
keycode 80 = KP_2
alt keycode 80 = Ascii_2
altgr keycode 80 = Hex_2
keycode 81 = KP_3
alt keycode 81 = Ascii_3
altgr keycode 81 = Hex_3
keycode 82 = KP_0
alt keycode 82 = Ascii_0
altgr keycode 82 = Hex_0
keycode 83 = KP_Period
altgr control keycode 83 = Boot
# altgr control keycode 83 = Boot
control alt keycode 83 = Boot
keycode 84 = Last_Console
keycode 85 =
......@@ -167,9 +206,11 @@ keycode 86 = less greater bar
keycode 87 = F11 F11 Console_23
control keycode 87 = F11
alt keycode 87 = Console_11
control alt keycode 87 = Console_11
keycode 88 = F12 F12 Console_24
control keycode 88 = F12
alt keycode 88 = Console_12
control alt keycode 88 = Console_12
keycode 89 =
keycode 90 =
keycode 91 =
......@@ -190,14 +231,16 @@ keycode 103 = Up
keycode 104 = Prior
shift keycode 104 = Scroll_Backward
keycode 105 = Left
alt keycode 105 = Decr_Console
keycode 106 = Right
alt keycode 106 = Incr_Console
keycode 107 = Select
keycode 108 = Down
keycode 109 = Next
shift keycode 109 = Scroll_Forward
keycode 110 = Insert
keycode 111 = Remove
altgr control keycode 111 = Boot
# altgr control keycode 111 = Boot
control alt keycode 111 = Boot
keycode 112 = Macro
keycode 113 = F13
......@@ -206,7 +249,7 @@ keycode 115 = Help
keycode 116 = Do
keycode 117 = F17
keycode 118 = KP_MinPlus
keycode 119 = Pause
keycode 119 = Pause
keycode 120 =
keycode 121 =
keycode 122 =
......@@ -241,16 +284,8 @@ string Remove = "\033[3~"
string Select = "\033[4~"
string Prior = "\033[5~"
string Next = "\033[6~"
string Help = ""
string Do = ""
string Macro = "\033[M"
string Pause = "\033[P"
string F21 = ""
string F22 = ""
string F23 = ""
string F24 = ""
string F25 = ""
string F26 = ""
compose '`' 'A' to ''
compose '`' 'a' to ''
compose '\'' 'A' to ''
......
......@@ -6,6 +6,11 @@
#include <linux/keyboard.h>
extern char *func_table[MAX_NR_FUNC];
extern char func_buf[];
extern char *funcbufptr;
extern int funcbufsize, funcbufleft;
/*
* kbd->xxx contains the VC-local things (flag settings etc..)
*
......@@ -16,57 +21,59 @@
* Note: lockstate is used as index in the array key_map.
*/
struct kbd_struct {
unsigned char ledstate; /* 3 bits */
unsigned char default_ledstate;
#define VC_SCROLLOCK 0 /* scroll-lock mode */
#define VC_NUMLOCK 1 /* numeric lock mode */
#define VC_CAPSLOCK 2 /* capslock mode */
unsigned char lockstate; /* 4 bits - must be in 0..15 */
unsigned char lockstate;
/* 8 modifiers - the names do not have any meaning at all;
they can be associated to arbitrarily chosen keys */
#define VC_SHIFTLOCK KG_SHIFT /* shift lock mode */
#define VC_ALTGRLOCK KG_ALTGR /* altgr lock mode */
#define VC_CTRLLOCK KG_CTRL /* control lock mode */
#define VC_ALTLOCK KG_ALT /* alt lock mode */
#define VC_SHIFTLLOCK KG_SHIFTL /* shiftl lock mode */
#define VC_SHIFTRLOCK KG_SHIFTR /* shiftr lock mode */
#define VC_CTRLLLOCK KG_CTRLL /* ctrll lock mode */
#define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */
unsigned char ledmode:2; /* one 2-bit value */
#define LED_SHOW_FLAGS 0 /* traditional state */
#define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */
#define LED_SHOW_MEM 2 /* `heartbeat': peek into memory */
unsigned char ledflagstate:3; /* flags, not lights */
unsigned char default_ledflagstate:3;
#define VC_SCROLLOCK 0 /* scroll-lock mode */
#define VC_NUMLOCK 1 /* numeric lock mode */
#define VC_CAPSLOCK 2 /* capslock mode */
unsigned char kbdmode:2; /* one 2-bit value */
#define VC_XLATE 0 /* translate keycodes using keymap */
#define VC_MEDIUMRAW 1 /* medium raw (keycode) mode */
#define VC_RAW 2 /* raw (scancode) mode */
#define VC_UNICODE 3 /* Unicode mode */
unsigned char modeflags;
unsigned char modeflags:5;
#define VC_APPLIC 0 /* application key mode */
#define VC_CKMODE 1 /* cursor key mode */
#define VC_REPEAT 2 /* keyboard repeat */
#define VC_CRLF 3 /* 0 - enter sends CR, 1 - enter sends CRLF */
#define VC_META 4 /* 0 - meta, 1 - meta=prefix with ESC */
#define VC_PAUSE 5 /* pause key pressed - unused */
#define VC_RAW 6 /* raw (scancode) mode */
#define VC_MEDIUMRAW 7 /* medium raw (keycode) mode */
};
extern struct kbd_struct kbd_table[];
extern unsigned long kbd_init(unsigned long);
extern inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
{
return ((kbd->ledstate >> flag) & 1);
}
extern inline int vc_kbd_lock(struct kbd_struct * kbd, int flag)
{
return ((kbd->lockstate >> flag) & 1);
}
extern unsigned char getledstate(void);
extern void setledstate(struct kbd_struct *kbd, unsigned int led);
extern inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
{
return ((kbd->modeflags >> flag) & 1);
}
extern inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
{
kbd->ledstate |= 1 << flag;
}
extern inline void set_vc_kbd_lock(struct kbd_struct * kbd, int flag)
extern inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
{
kbd->lockstate |= 1 << flag;
return ((kbd->ledflagstate >> flag) & 1);
}
extern inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
......@@ -74,14 +81,9 @@ extern inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
kbd->modeflags |= 1 << flag;
}
extern inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
{
kbd->ledstate &= ~(1 << flag);
}
extern inline void clr_vc_kbd_lock(struct kbd_struct * kbd, int flag)
extern inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
{
kbd->lockstate &= ~(1 << flag);
kbd->ledflagstate |= 1 << flag;
}
extern inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
......@@ -89,9 +91,9 @@ extern inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
kbd->modeflags &= ~(1 << flag);
}
extern inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
extern inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
{
kbd->ledstate ^= 1 << flag;
kbd->ledflagstate &= ~(1 << flag);
}
extern inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
......@@ -104,4 +106,11 @@ extern inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
kbd->modeflags ^= 1 << flag;
}
extern inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
{
kbd->ledflagstate ^= 1 << flag;
}
#define U(x) ((x) ^ 0xf000)
#endif
This diff is collapsed.
/*
* linux/kernel/chr_drv/mem.c
* linux/drivers/char/mem.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
......
/*
* linux/kernel/chr_drv/mouse.c
* linux/drivers/char/mouse.c
*
* Generic mouse open routine by Johan Myreen
*
......
/*
* linux/kernel/chr_drv/psaux.c
* linux/drivers/char/psaux.c
*
* Driver for PS/2 type mouse by Johan Myreen.
*
......
/*
* linux/kernel/chr_drv/pty.c
* linux/drivers/char/pty.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
......
/*
* linux/kernel/serial.c
* linux/drivers/char/serial.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
......@@ -987,7 +987,6 @@ static int startup(struct async_struct * info)
static void shutdown(struct async_struct * info)
{
unsigned long flags;
unsigned long timeout;
int retval;
if (!(info->flags & ASYNC_INITIALIZED))
......@@ -1039,24 +1038,6 @@ static void shutdown(struct async_struct * info)
(void) inb((info->port & 0xFE0) | 0x01F);
}
/*
* Before we drop DTR, make sure the UART transmitter has
* completely drained; this is especially important if there
* is a transmit FIFO!
*
* We busy loop here, which is not great; unfortunately the
* UART does not provide an interrupt for TEMT, and putting it
* in the interrupt handler would slow down normal accesses
* anyway.
*/
sti();
timeout = jiffies + info->timeout;
while (!(serial_inp(info, UART_LSR) & UART_LSR_TEMT)) {
if (jiffies > timeout)
break;
}
cli();
if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) {
info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS);
info->MCR_noint &= ~(UART_MCR_DTR|UART_MCR_RTS);
......@@ -1142,15 +1123,20 @@ static void change_speed(struct async_struct *info)
} else
fcr = 0;
/* CTS flow control flag */
if (cflag & CRTSCTS)
/* CTS flow control flag and modem status interrupts */
info->IER &= ~UART_IER_MSI;
if (cflag & CRTSCTS) {
info->flags |= ASYNC_CTS_FLOW;
else
info->IER |= UART_IER_MSI;
} else
info->flags &= ~ASYNC_CTS_FLOW;
if (cflag & CLOCAL)
info->flags &= ~ASYNC_CHECK_CD;
else
else {
info->flags |= ASYNC_CHECK_CD;
info->IER |= UART_IER_MSI;
}
serial_out(info, UART_IER, info->IER);
/*
* Set up parity check flag
......@@ -1749,12 +1735,17 @@ static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
static void rs_close(struct tty_struct *tty, struct file * filp)
{
struct async_struct * info = (struct async_struct *)tty->driver_data;
unsigned long flags;
if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
return;
if (tty_hung_up_p(filp))
save_flags(flags); cli();
if (tty_hung_up_p(filp)) {
restore_flags(flags);
return;
}
#ifdef SERIAL_DEBUG_OPEN
printk("rs_close ttys%d, count = %d\n", info->line, info->count);
......@@ -1776,8 +1767,10 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
info->line, info->count);
info->count = 0;
}
if (info->count)
if (info->count) {
restore_flags(flags);
return;
}
info->flags |= ASYNC_CLOSING;
/*
* Save the termios structure, since this port may have
......@@ -1787,8 +1780,19 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
info->normal_termios = *tty->termios;
if (info->flags & ASYNC_CALLOUT_ACTIVE)
info->callout_termios = *tty->termios;
if (info->flags & ASYNC_INITIALIZED)
if (info->flags & ASYNC_INITIALIZED) {
wait_until_sent(tty, 3000); /* 30 seconds timeout */
/*
* Before we drop DTR, make sure the UART transmitter
* has completely drained; this is especially
* important if there is a transmit FIFO!
*/
while (!(serial_inp(info, UART_LSR) & UART_LSR_TEMT)) {
current->state = TASK_INTERRUPTIBLE;
current->timeout = jiffies + info->timeout;
schedule();
}
}
shutdown(info);
if (tty->driver.flush_buffer)
tty->driver.flush_buffer(tty);
......@@ -1815,6 +1819,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|
ASYNC_CLOSING);
wake_up_interruptible(&info->close_wait);
restore_flags(flags);
}
/*
......@@ -1845,7 +1850,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
{
struct wait_queue wait = { current, NULL };
int retval;
int do_clocal = C_CLOCAL(tty);
int do_clocal = 0;
/*
* If the device is in the middle of being closed, then block
......@@ -1893,6 +1898,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
return 0;
}
if (info->normal_termios.c_cflag & CLOCAL)
do_clocal = 1;
/*
* Block waiting for the carrier detect and the line to become
* free (i.e., not in use by the callout). While we are in
......@@ -1990,12 +1998,6 @@ int rs_open(struct tty_struct *tty, struct file * filp)
return -ENOMEM;
}
if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
*tty->termios = info->normal_termios;
else
*tty->termios = info->callout_termios;
}
/*
* Start up serial port
*/
......@@ -2012,6 +2014,14 @@ int rs_open(struct tty_struct *tty, struct file * filp)
return retval;
}
if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
*tty->termios = info->normal_termios;
else
*tty->termios = info->callout_termios;
change_speed(info);
}
info->session = current->session;
info->pgrp = current->pgrp;
......
/*
* linux/kernel/tty_io.c
* linux/drivers/char/tty_io.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
......@@ -109,9 +109,12 @@ static int tty_fasync(struct inode * inode, struct file * filp, int on);
*/
char *_tty_name(struct tty_struct *tty, char *buf)
{
sprintf(buf, "%s%d", tty->driver.name,
MINOR(tty->device) - tty->driver.minor_start +
tty->driver.name_base);
if (tty)
sprintf(buf, "%s%d", tty->driver.name,
MINOR(tty->device) - tty->driver.minor_start +
tty->driver.name_base);
else
strcpy(buf, "NULL tty");
return buf;
}
......@@ -363,6 +366,8 @@ void do_tty_hangup(struct tty_struct * tty, struct file_operations *fops)
if (p->tty == tty)
p->tty = NULL;
}
if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS)
*tty->termios = tty->driver.init_termios;
if (tty->driver.hangup)
(tty->driver.hangup)(tty);
}
......@@ -439,6 +444,19 @@ int vt_waitactive(void)
#define vt_wake_waitactive() wake_up(&vt_activate_queue)
void reset_vc(unsigned int new_console)
{
vt_cons[new_console]->vc_mode = KD_TEXT;
kbd_table[new_console].kbdmode = VC_XLATE;
vt_cons[new_console]->vt_mode.mode = VT_AUTO;
vt_cons[new_console]->vt_mode.waitv = 0;
vt_cons[new_console]->vt_mode.relsig = 0;
vt_cons[new_console]->vt_mode.acqsig = 0;
vt_cons[new_console]->vt_mode.frsig = 0;
vt_cons[new_console]->vt_pid = -1;
vt_cons[new_console]->vt_newvt = -1;
}
/*
* Performs the back end of a vt switch
*/
......@@ -446,15 +464,17 @@ void complete_change_console(unsigned int new_console)
{
unsigned char old_vc_mode;
if (new_console == fg_console || new_console >= NR_CONSOLES)
return;
if (new_console == fg_console)
return;
if (!vc_cons_allocated(new_console))
return;
/*
* If we're switching, we could be going from KD_GRAPHICS to
* KD_TEXT mode or vice versa, which means we need to blank or
* unblank the screen later.
*/
old_vc_mode = vt_cons[fg_console].vc_mode;
old_vc_mode = vt_cons[fg_console]->vc_mode;
update_screen(new_console);
/*
......@@ -462,15 +482,15 @@ void complete_change_console(unsigned int new_console)
* telling it that it has acquired. Also check if it has died and
* clean up (similar to logic employed in change_console())
*/
if (vt_cons[new_console].vt_mode.mode == VT_PROCESS)
if (vt_cons[new_console]->vt_mode.mode == VT_PROCESS)
{
/*
* Send the signal as privileged - kill_proc() will
* tell us if the process has gone or something else
* is awry
*/
if (kill_proc(vt_cons[new_console].vt_pid,
vt_cons[new_console].vt_mode.acqsig,
if (kill_proc(vt_cons[new_console]->vt_pid,
vt_cons[new_console]->vt_mode.acqsig,
1) != 0)
{
/*
......@@ -482,16 +502,7 @@ void complete_change_console(unsigned int new_console)
* this outside of VT_PROCESS but there is no single process
* to account for and tracking tty count may be undesirable.
*/
vt_cons[new_console].vc_mode = KD_TEXT;
clr_vc_kbd_mode(kbd_table + new_console, VC_RAW);
clr_vc_kbd_mode(kbd_table + new_console, VC_MEDIUMRAW);
vt_cons[new_console].vt_mode.mode = VT_AUTO;
vt_cons[new_console].vt_mode.waitv = 0;
vt_cons[new_console].vt_mode.relsig = 0;
vt_cons[new_console].vt_mode.acqsig = 0;
vt_cons[new_console].vt_mode.frsig = 0;
vt_cons[new_console].vt_pid = -1;
vt_cons[new_console].vt_newvt = -1;
reset_vc(new_console);
}
}
......@@ -499,9 +510,9 @@ void complete_change_console(unsigned int new_console)
* We do this here because the controlling process above may have
* gone, and so there is now a new vc_mode
*/
if (old_vc_mode != vt_cons[new_console].vc_mode)
if (old_vc_mode != vt_cons[new_console]->vc_mode)
{
if (vt_cons[new_console].vc_mode == KD_TEXT)
if (vt_cons[new_console]->vc_mode == KD_TEXT)
unblank_screen();
else {
timer_active &= ~(1<<BLANK_TIMER);
......@@ -521,7 +532,9 @@ void complete_change_console(unsigned int new_console)
*/
void change_console(unsigned int new_console)
{
if (new_console == fg_console || new_console >= NR_CONSOLES)
if (new_console == fg_console)
return;
if (!vc_cons_allocated(new_console))
return;
/*
......@@ -539,15 +552,15 @@ void change_console(unsigned int new_console)
* the user waits just the right amount of time :-) and revert the
* vt to auto control.
*/
if (vt_cons[fg_console].vt_mode.mode == VT_PROCESS)
if (vt_cons[fg_console]->vt_mode.mode == VT_PROCESS)
{
/*
* Send the signal as privileged - kill_proc() will
* tell us if the process has gone or something else
* is awry
*/
if (kill_proc(vt_cons[fg_console].vt_pid,
vt_cons[fg_console].vt_mode.relsig,
if (kill_proc(vt_cons[fg_console]->vt_pid,
vt_cons[fg_console]->vt_mode.relsig,
1) == 0)
{
/*
......@@ -555,7 +568,7 @@ void change_console(unsigned int new_console)
* return. The process needs to send us a
* VT_RELDISP ioctl to complete the switch.
*/
vt_cons[fg_console].vt_newvt = new_console;
vt_cons[fg_console]->vt_newvt = new_console;
return;
}
......@@ -568,16 +581,8 @@ void change_console(unsigned int new_console)
* this outside of VT_PROCESS but there is no single process
* to account for and tracking tty count may be undesirable.
*/
vt_cons[fg_console].vc_mode = KD_TEXT;
clr_vc_kbd_mode(kbd_table + fg_console, VC_RAW);
clr_vc_kbd_mode(kbd_table + fg_console, VC_MEDIUMRAW);
vt_cons[fg_console].vt_mode.mode = VT_AUTO;
vt_cons[fg_console].vt_mode.waitv = 0;
vt_cons[fg_console].vt_mode.relsig = 0;
vt_cons[fg_console].vt_mode.acqsig = 0;
vt_cons[fg_console].vt_mode.frsig = 0;
vt_cons[fg_console].vt_pid = -1;
vt_cons[fg_console].vt_newvt = -1;
reset_vc(fg_console);
/*
* Fall through to normal (VT_AUTO) handling of the switch...
*/
......@@ -586,7 +591,7 @@ void change_console(unsigned int new_console)
/*
* Ignore all switches in KD_GRAPHICS+VT_AUTO mode
*/
if (vt_cons[fg_console].vc_mode == KD_GRAPHICS)
if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS)
return;
complete_change_console(new_console);
......@@ -971,27 +976,31 @@ static void release_dev(struct file * filp)
if (tty->count)
return;
/*
* Make sure there aren't any processes that still think this
* tty is their controlling tty.
*/
for (p = &LAST_TASK ; p > &FIRST_TASK ; --p) {
if ((*p) && (*p)->tty == tty)
(*p)->tty = NULL;
}
if (o_tty) {
if (o_tty->count)
return;
tty->driver.other->table[idx] = NULL;
tty->driver.other->termios[idx] = NULL;
tty->driver.other->termios_locked[idx] = NULL;
kfree_s(o_tp, sizeof(struct termios));
}
#ifdef TTY_DEBUG_HANGUP
printk("freeing tty structure...");
#endif
/*
* Make sure there aren't any processes that still think this
* tty is their controlling tty.
*/
for (p = &LAST_TASK ; p > &FIRST_TASK ; --p) {
if (*p == 0)
continue;
if ((*p)->tty == tty)
(*p)->tty = NULL;
if (o_tty && (*p)->tty == o_tty)
(*p)->tty = NULL;
}
/*
* Shutdown the current line discipline, and reset it to
* N_TTY.
......@@ -1004,9 +1013,7 @@ static void release_dev(struct file * filp)
tty->driver.table[idx] = NULL;
if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) {
tty->driver.termios[idx] = NULL;
tty->driver.termios_locked[idx] = NULL;
kfree_s(tp, sizeof(struct termios));
kfree_s(ltp, sizeof(struct termios));
}
if (tty == redirect || o_tty == redirect)
redirect = NULL;
......@@ -1037,10 +1044,6 @@ static void release_dev(struct file * filp)
(*o_tty->driver.refcount)--;
free_page((unsigned long) o_tty);
}
if (o_tp)
kfree_s(o_tp, sizeof(struct termios));
if (o_ltp)
kfree_s(o_ltp, sizeof(struct termios));
}
/*
......@@ -1087,13 +1090,14 @@ static int tty_open(struct inode * inode, struct file * filp)
#ifdef TTY_DEBUG_HANGUP
printk("opening %s...", tty_name(tty));
#endif
if (test_bit(TTY_EXCLUSIVE, &tty->flags) && !suser())
retval = -EBUSY;
else if (tty->driver.open)
if (tty->driver.open)
retval = tty->driver.open(tty, filp);
else
retval = -ENODEV;
if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && !suser())
retval = -EBUSY;
if (retval) {
#ifdef TTY_DEBUG_HANGUP
printk("error %d in opening %s...", retval, tty_name(tty));
......@@ -1396,12 +1400,18 @@ static int tty_ioctl(struct inode * inode, struct file * file,
return set_selection(arg, tty);
case 3:
return paste_selection(tty);
#endif /* CONFIG_SELECTION */
case 4:
unblank_screen();
return 0;
#ifdef CONFIG_SELECTION
case 5:
return sel_loadlut(arg);
case 6:
/* Make it possible to react to Shift+Mousebutton */
/* Note that shift_state is an undocumented
kernel-internal variable; programs not closely
related to the kernel should not use this. */
put_fs_byte(shift_state,arg);
return 0;
case 7:
......@@ -1451,6 +1461,8 @@ void do_SAK( struct tty_struct *tty)
int i;
struct file *filp;
if (!tty)
return;
if (tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (tty->driver.flush_buffer)
......@@ -1563,6 +1575,44 @@ int tty_register_driver(struct tty_driver *driver)
return error;
}
/*
* Called by a tty driver to unregister itself.
*/
int tty_unregister_driver(struct tty_driver *driver)
{
int retval;
struct tty_driver *p;
int found = 0;
int major_inuse = 0;
if (driver->refcount)
return -EBUSY;
for (p = tty_drivers; p; p = p->next) {
if (p == driver)
found++;
else if (p->major == driver->major)
major_inuse++;
}
if (!major_inuse) {
retval = unregister_chrdev(driver->major, driver->name);
if (retval)
return retval;
}
if (driver->prev)
driver->prev->next = driver->next;
else
tty_drivers = driver->next;
if (driver->next)
driver->next = driver->next->prev;
return 0;
}
/*
* Initialize the console device. This is called *early*, so
* we can't necessarily depend on lots of kernel help here.
......
/*
* linux/kernel/drivers/char/tty_ioctl.c
* linux/drivers/char/tty_ioctl.c
*
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
*
......@@ -314,32 +314,22 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
(unsigned long *) arg);
return 0;
case TIOCGLCKTRMIOS:
retval = verify_area(VERIFY_READ, (void *) arg,
sizeof (unsigned long));
if (retval)
return retval;
arg = get_fs_long((unsigned long *) arg);
retval = verify_area(VERIFY_WRITE, (void *) arg,
sizeof (struct termios));
if (retval)
return retval;
memcpy_tofs((struct termios *) arg,
&real_tty->termios_locked,
real_tty->termios_locked,
sizeof (struct termios));
return 0;
case TIOCSLCKTRMIOS:
if (!suser())
return -EPERM;
retval = verify_area(VERIFY_READ, (void *) arg,
sizeof (unsigned long));
if (retval)
return retval;
arg = get_fs_long((unsigned long *) arg);
retval = verify_area(VERIFY_READ, (void *) arg,
sizeof (struct termios));
if (retval)
return retval;
memcpy_fromfs(&real_tty->termios_locked,
memcpy_fromfs(real_tty->termios_locked,
(struct termios *) arg,
sizeof (struct termios));
return 0;
......
/*
* non-Latin-1 (>0x00ff) Unicode -> IBM CP437 conversion hash table
* Markus Kuhn
*/
#define IBM_HASHSIZE 146
#define IBM_HASHSTEP 19
#define IBM_HASHLEVEL 4
static struct {
unsigned short ucs; /* a Unicode code */
unsigned char ibm437; /* the corresponding IBM code */
} ibm_hash[IBM_HASHSIZE] = {
{0x221a,0xfb}, {0x2580,0xdf}, {0x2524,0xb4}, {0xffff,0x00}, {0x221e,0xec},
{0x20a7,0x9e}, {0x2126,0xea}, {0x253c,0xc5}, {0xffff,0x00}, {0x2588,0xdb},
{0x2666,0x04}, {0x2190,0x1b}, {0x2193,0x19}, {0x2665,0x03}, {0x2195,0x12},
{0x2663,0x05}, {0x2660,0x06}, {0x2590,0xde}, {0x2022,0x07}, {0x2592,0xb1},
{0x266c,0x0e}, {0x2502,0xb3}, {0x266a,0x0d}, {0x250c,0xda}, {0x258c,0xdd},
{0xffff,0x00}, {0xffff,0x00}, {0xffff,0x00}, {0xffff,0x00}, {0x2191,0x18},
{0x2261,0xf0}, {0x2514,0xc0}, {0x2192,0x1a}, {0x2264,0xf3}, {0x2194,0x1d},
{0x2591,0xb0}, {0x0393,0xe2}, {0x2593,0xb2}, {0x2500,0xc4}, {0x251c,0xc3},
{0x2205,0xed}, {0xffff,0x00}, {0x266b,0x0e}, {0x2518,0xd9}, {0x203c,0x13},
{0xffff,0x00}, {0x2642,0x0b}, {0x2564,0xd1}, {0x2640,0x0c}, {0x2566,0xcb},
{0x2561,0xb5}, {0x2560,0xcc}, {0x2563,0xb9}, {0x2562,0xb6}, {0x2510,0xbf},
{0x256c,0xce}, {0x2008,0x00}, {0x03a6,0xe8}, {0x2569,0xca}, {0x2568,0xd0},
{0x256b,0xd7}, {0x256a,0xd8}, {0x03a9,0xea}, {0xffff,0x00}, {0xffff,0x00},
{0x25c0,0x11}, {0x0398,0xe9}, {0x2567,0xcf}, {0xffff,0x00}, {0x2248,0xf7},
{0x03b1,0xe0}, {0x03a3,0xe4}, {0x2265,0xf2}, {0xffff,0x00}, {0x25cb,0x09},
{0x03b4,0xeb}, {0x2320,0xf4}, {0xffff,0x00}, {0xffff,0x00}, {0xffff,0x00},
{0x25c4,0x11}, {0xffff,0x00}, {0xffff,0x00}, {0x03bc,0xe6}, {0x2565,0xd2},
{0xffff,0x00}, {0x22c5,0xf9}, {0x2302,0x7f}, {0x25d9,0x0a}, {0x25d8,0x08},
{0xffff,0x00}, {0x03c4,0xe7}, {0xffff,0x00}, {0xffff,0x00}, {0x2555,0xb8},
{0x2554,0xc9}, {0x2557,0xbb}, {0x2556,0xb7}, {0x2551,0xba}, {0x2550,0xcd},
{0x2553,0xd6}, {0x2552,0xd5}, {0x255d,0xbc}, {0x255c,0xbd}, {0x255f,0xc7},
{0x2310,0xa9}, {0x2559,0xd3}, {0x2558,0xd4}, {0x255b,0xbe}, {0x255a,0xc8},
{0xffff,0x00}, {0x0192,0x9f}, {0x2319,0x1c}, {0x2321,0xf5}, {0xffff,0x00},
{0x25a0,0xfe}, {0xffff,0x00}, {0x21a8,0x17}, {0x263c,0x0f}, {0x25ac,0x16},
{0x263a,0x01}, {0x263b,0x02}, {0x03c3,0xe5}, {0xffff,0x00}, {0x255e,0xc6},
{0x03c0,0xe3}, {0x03b2,0xe1}, {0x2300,0xed}, {0xffff,0x00}, {0x25b6,0x10},
{0x207f,0xfc}, {0xffff,0x00}, {0x2208,0xee}, {0x25b2,0x1e}, {0x220e,0xfe},
{0x25bc,0x1f}, {0x212b,0x8f}, {0x252c,0xc2}, {0xffff,0x00}, {0x2229,0xef},
{0xffff,0x00}, {0x25ba,0x10}, {0xffff,0x00}, {0x2584,0xdc}, {0xffff,0x00},
{0x2534,0xc1}
};
/*
* Find the correct PC character set (CP437) code for a
* UCS character outside Latin-1 by hash lookup in ibm_hash[].
* Return -1 if character not available, return -2 for zero-width
* space characters.
*/
int
conv_uni_to_pc(unsigned long ucs)
{
int c = -1;
int i, h;
if (ucs == 0xffff || ucs == 0xfffe)
return -1;
if (ucs == 0xfeff || (ucs >= 0x200a && ucs <= 0x200f))
return -2;
h = (ucs ^ (ucs >> 8)) % IBM_HASHSIZE;
for (i = 0; i < IBM_HASHLEVEL && c == -1; i++)
if (ibm_hash[h].ucs == ucs)
c = ibm_hash[h].ibm437;
else
if ((h += IBM_HASHSTEP) >= IBM_HASHSIZE)
h -= IBM_HASHSIZE;
return c;
}
#if 0
/*
* Conversion from unicode to ibm pc character set (code page 437)
*
* aeb@cwi.nl, Dec 1993
*/
#define NOTFOUND 254 /* small square */
static struct unipc {
long unicode;
unsigned char pc;
} uni_to_pc[255] = {
{0x0020, 0x20}, {0x0021, 0x21}, {0x0022, 0x22}, {0x0023, 0x23},
{0x0024, 0x24}, {0x0025, 0x25}, {0x0026, 0x26}, {0x0027, 0x27},
{0x0028, 0x28}, {0x0029, 0x29}, {0x002A, 0x2A}, {0x002B, 0x2B},
{0x002C, 0x2C}, {0x002D, 0x2D}, {0x002E, 0x2E}, {0x002F, 0x2F},
{0x0030, 0x30}, {0x0031, 0x31}, {0x0032, 0x32}, {0x0033, 0x33},
{0x0034, 0x34}, {0x0035, 0x35}, {0x0036, 0x36}, {0x0037, 0x37},
{0x0038, 0x38}, {0x0039, 0x39}, {0x003A, 0x3A}, {0x003B, 0x3B},
{0x003C, 0x3C}, {0x003D, 0x3D}, {0x003E, 0x3E}, {0x003F, 0x3F},
{0x0040, 0x40}, {0x0041, 0x41}, {0x0042, 0x42}, {0x0043, 0x43},
{0x0044, 0x44}, {0x0045, 0x45}, {0x0046, 0x46}, {0x0047, 0x47},
{0x0048, 0x48}, {0x0049, 0x49}, {0x004A, 0x4A}, {0x004B, 0x4B},
{0x004C, 0x4C}, {0x004D, 0x4D}, {0x004E, 0x4E}, {0x004F, 0x4F},
{0x0050, 0x50}, {0x0051, 0x51}, {0x0052, 0x52}, {0x0053, 0x53},
{0x0054, 0x54}, {0x0055, 0x55}, {0x0056, 0x56}, {0x0057, 0x57},
{0x0058, 0x58}, {0x0059, 0x59}, {0x005A, 0x5A}, {0x005B, 0x5B},
{0x005C, 0x5C}, {0x005D, 0x5D}, {0x005E, 0x5E}, {0x005F, 0x5F},
{0x0060, 0x60}, {0x0061, 0x61}, {0x0062, 0x62}, {0x0063, 0x63},
{0x0064, 0x64}, {0x0065, 0x65}, {0x0066, 0x66}, {0x0067, 0x67},
{0x0068, 0x68}, {0x0069, 0x69}, {0x006A, 0x6A}, {0x006B, 0x6B},
{0x006C, 0x6C}, {0x006D, 0x6D}, {0x006E, 0x6E}, {0x006F, 0x6F},
{0x0070, 0x70}, {0x0071, 0x71}, {0x0072, 0x72}, {0x0073, 0x73},
{0x0074, 0x74}, {0x0075, 0x75}, {0x0076, 0x76}, {0x0077, 0x77},
{0x0078, 0x78}, {0x0079, 0x79}, {0x007A, 0x7A}, {0x007B, 0x7B},
{0x007C, 0x7C}, {0x007D, 0x7D}, {0x007E, 0x7E}, {0x00A0, 0xFF},
{0x00A1, 0xAD}, {0x00A2, 0x9B}, {0x00A3, 0x9C}, {0x00A5, 0x9D},
{0x00A7, 0x15}, {0x00AA, 0xA6}, {0x00AB, 0xAE}, {0x00AC, 0xAA},
{0x00B0, 0xF8}, {0x00B1, 0xF1}, {0x00B2, 0xFD}, {0x00B5, 0xE6},
{0x00B6, 0x14}, {0x00B7, 0xFA}, {0x00BA, 0xA7}, {0x00BB, 0xAF},
{0x00BC, 0xAC}, {0x00BD, 0xAB}, {0x00BF, 0xA8}, {0x00C4, 0x8E},
{0x00C5, 0x8F}, {0x00C6, 0x92}, {0x00C7, 0x80}, {0x00C9, 0x90},
{0x00D1, 0xA5}, {0x00D6, 0x99}, {0x00DC, 0x9A}, {0x00DF, 0xE1},
{0x00E0, 0x85}, {0x00E1, 0xA0}, {0x00E2, 0x83}, {0x00E4, 0x84},
{0x00E5, 0x86}, {0x00E6, 0x91}, {0x00E7, 0x87}, {0x00E8, 0x8A},
{0x00E9, 0x82}, {0x00EA, 0x88}, {0x00EB, 0x89}, {0x00EC, 0x8D},
{0x00ED, 0xA1}, {0x00EE, 0x8C}, {0x00EF, 0x8B}, {0x00F1, 0xA4},
{0x00F2, 0x95}, {0x00F3, 0xA2}, {0x00F4, 0x93}, {0x00F6, 0x94},
{0x00F7, 0xF6}, {0x00F9, 0x97}, {0x00FA, 0xA3}, {0x00FB, 0x96},
{0x00FC, 0x81}, {0x00FF, 0x98}, {0x0192, 0x9F}, {0x0393, 0xE2},
{0x0398, 0xE9}, {0x03A3, 0xE4}, {0x03A6, 0xE8}, {0x03A9, 0xEA},
{0x03B1, 0xE0}, {0x03B4, 0xEB}, {0x03B5, 0xEE}, {0x03C0, 0xE3},
{0x03C3, 0xE5}, {0x03C4, 0xE7}, {0x03C6, 0xED}, {0x2022, 0x07},
{0x203C, 0x13}, {0x207F, 0xFC}, {0x20A7, 0x9E}, {0x2190, 0x1B},
{0x2191, 0x18}, {0x2192, 0x1A}, {0x2193, 0x19}, {0x2194, 0x1D},
{0x2195, 0x12}, {0x21A8, 0x17}, {0x2219, 0xF9}, {0x221A, 0xFB},
{0x221E, 0xEC}, {0x221F, 0x1C}, {0x2229, 0xEF}, {0x2248, 0xF7},
{0x2261, 0xF0}, {0x2264, 0xF3}, {0x2265, 0xF2}, {0x2302, 0x7F},
{0x2310, 0xA9}, {0x2320, 0xF4}, {0x2321, 0xF5}, {0x2500, 0xC4},
{0x2502, 0xB3}, {0x250C, 0xDA}, {0x2510, 0xBF}, {0x2514, 0xC0},
{0x2518, 0xD9}, {0x251C, 0xC3}, {0x2524, 0xB4}, {0x252C, 0xC2},
{0x2534, 0xC1}, {0x253C, 0xC5}, {0x2550, 0xCD}, {0x2551, 0xBA},
{0x2552, 0xD5}, {0x2553, 0xD6}, {0x2554, 0xC9}, {0x2555, 0xB8},
{0x2556, 0xB7}, {0x2557, 0xBB}, {0x2558, 0xD4}, {0x2559, 0xD3},
{0x255A, 0xC8}, {0x255B, 0xBE}, {0x255C, 0xBD}, {0x255D, 0xBC},
{0x255E, 0xC6}, {0x255F, 0xC7}, {0x2560, 0xCC}, {0x2561, 0xB5},
{0x2562, 0xB6}, {0x2563, 0xB9}, {0x2564, 0xD1}, {0x2565, 0xD2},
{0x2566, 0xCB}, {0x2567, 0xCF}, {0x2568, 0xD0}, {0x2569, 0xCA},
{0x256A, 0xD8}, {0x256B, 0xD7}, {0x256C, 0xCE}, {0x2580, 0xDF},
{0x2584, 0xDC}, {0x2588, 0xDB}, {0x258C, 0xDD}, {0x2590, 0xDE},
{0x2591, 0xB0}, {0x2592, 0xB1}, {0x2593, 0xB2}, {0x25A0, 0xFE},
{0x25AC, 0x16}, {0x25B2, 0x1E}, {0x25BA, 0x10}, {0x25BC, 0x1F},
{0x25C4, 0x11}, {0x25CB, 0x09}, {0x25D8, 0x08}, {0x25D9, 0x0A},
{0x263A, 0x01}, {0x263B, 0x02}, {0x263C, 0x0F}, {0x2640, 0x0C},
{0x2642, 0x0B}, {0x2660, 0x06}, {0x2663, 0x05}, {0x2665, 0x03},
{0x2666, 0x04}, {0x266A, 0x0D}, {0x266B, 0x0E}
};
unsigned char
conv_uni_to_pc(unsigned long u) {
/* Binary search - no doubt this can be sped up using hash codes */
/* (or by table lookup if we are in the first half) */
int step = 128;
struct unipc *up = uni_to_pc + step - 1;
while(1) {
if(up->unicode == u)
return up->pc;
step >>= 1;
if(!step)
return NOTFOUND;
if(up->unicode < u)
up += step;
else
up -= step;
}
}
#endif
This diff is collapsed.
......@@ -18,8 +18,12 @@ extern struct vt_struct {
int vt_pid;
int vt_newvt;
struct wait_queue *paste_wait;
} vt_cons[NR_CONSOLES];
} *vt_cons[MAX_NR_CONSOLES];
void kd_mksound(unsigned int count, unsigned int ticks);
int vc_allocate(unsigned int console);
int vc_cons_allocated(unsigned int console);
int vc_resize(unsigned long lines, unsigned long cols);
void vc_disallocate(unsigned int console);
#endif /* _VT_KERN_H */
......@@ -190,8 +190,14 @@ ifdef MODULES
modules:
echo $(MODULES) > ../../modules/NET_MODULES
$(MAKE) CFLAGS="$(CFLAGS) -DMODULE" $(MODULES)
(cd ../../modules;for i in $(MODULES); do ln -sf ../drivers/net/$$i .; done)
@(cd ../../modules; \
for i in $(MODULES:.o=.c); \
do ln -sf ../drivers/net/$$i .; \
done ; \
ln -sf ../drivers/net/CONFIG . ; \
$(MAKE) -f../drivers/net/Makefile -I../drivers/net \
CFLAGS="$(CFLAGS) -I../net/inet -I../drivers/net -DMODULE" $(MODULES); \
rm $(MODULES:.o=.c) CONFIG)
else
......
......@@ -160,11 +160,13 @@
0.351 30-apr-94 Added EISA support. Added DE422 recognition.
0.36 16-may-94 DE422 fix released.
0.37 22-jul-94 Added MODULE support
0.38 15-aug-94 Added DBR ROM switch in depca_close().
Multi DEPCA bug fix.
=========================================================================
*/
static char *version = "depca.c:v0.37 7/22/94 davies@wanton.lkg.dec.com\n";
static char *version = "depca.c:v0.38 8/15/94 davies@wanton.lkg.dec.com\n";
#include <stdarg.h>
#include <linux/config.h>
......@@ -289,7 +291,7 @@ struct depca_init {
};
struct depca_private {
char devname[8]; /* Not used */
char devname[8]; /* Device Product String */
struct depca_rx_head *rx_ring; /* Pointer to start of RX descriptor ring */
struct depca_tx_head *tx_ring; /* Pointer to start of TX descriptor ring */
struct depca_init init_block;/* Initialization block */
......@@ -338,7 +340,7 @@ static struct device *isa_probe(struct device *dev);
static struct device *eisa_probe(struct device *dev);
static struct device *alloc_device(struct device *dev, int ioaddr);
static int num_depcas = 0, num_eth = 0;;
static int num_depcas = 0, num_eth = 0, autoprobed = 0;
#else
int init_module(void);
......@@ -370,15 +372,20 @@ int depca_probe(struct device *dev)
}
} else if (base_addr > 0) { /* Don't probe at all. */
status = -ENXIO;
} else { /* First probe for the DEPCA test */
#ifdef MODULE /* pattern in ROM */
#ifdef MODULE
} else {
printk("Autoprobing is not supported when loading a module based driver.\n");
status = -EIO;
#else
} else if (!autoprobed) { /* First probe for the DEPCA test */
/* pattern in ROM */
eth0=isa_probe(dev);
eth0=eisa_probe(eth0);
if (dev->priv) status=0;
autoprobed = 1;
} else {
status = -ENXIO;
#endif /* MODULE */
}
......@@ -416,19 +423,18 @@ depca_probe1(struct device *dev, short ioaddr)
** shortens the search time a little for multiple DEPCAs.
*/
for (j = 0, i = 0; mem_base[i] && (j == 0);) {
for (j = 0, i = 0; mem_base[i] && (j == 0);i++) {
if (((mem_chkd >> i) & 0x01) == 0) { /* has the memory been checked? */
name = DepcaSignature(mem_base[i]);/* check for a DEPCA here */
mem_chkd |= (0x01 << i); /* mark location checked */
if (*name != '\0') { /* one found? */
if (*name != '\0') { /* one found? */
j = 1; /* set exit flag */
} else {
i++; /* increment search index */
--i;
}
}
}
if (*name != '\0') { /* found a DEPCA device */
if (*name != '\0') { /* found a DEPCA device */
mem_start = mem_base[i];
dev->base_addr = ioaddr;
......@@ -448,7 +454,7 @@ depca_probe1(struct device *dev, short ioaddr)
read the ROM info.
*/
if (strstr(name,"DE100") != NULL) {
if (strstr(name,"DE100")!= NULL) {
j = 1;
} else {
j = 0;
......@@ -471,7 +477,7 @@ depca_probe1(struct device *dev, short ioaddr)
/*
** Set up the maximum amount of network RAM(kB)
*/
if (strstr(name,"DEPCA") == NULL) {
if (strstr(name,"DEPCA")== NULL) {
netRAM=64;
} else {
netRAM=48;
......@@ -542,6 +548,7 @@ depca_probe1(struct device *dev, short ioaddr)
dev->priv = (void *)((mem_start + 0x07) & ~0x07);
lp = (struct depca_private *)dev->priv;
memset(dev->priv, 0, sizeof(struct depca_private));
strcpy(lp->devname,name);
/* Tx & Rx descriptors (aligned to a quadword boundary) */
mem_start = ((((unsigned long)dev->priv +
......@@ -675,6 +682,14 @@ depca_open(struct device *dev)
STOP_DEPCA;
nicsr = inb(DEPCA_NICSR);
/*
** Make sure the shadow RAM is enabled
*/
if (strstr(lp->devname,"DEPCA") == NULL) {
nicsr |= SHE;
outb(nicsr, DEPCA_NICSR);
}
/*
** Re-initialize the DEPCA...
*/
......@@ -721,9 +736,9 @@ depca_open(struct device *dev)
}
/*
** Enable DEPCA board interrupts
** Enable DEPCA board interrupts and turn off LED
*/
nicsr = ((nicsr & ~IM & ~LED)|SHE|IEN);
nicsr = ((nicsr & ~IM & ~LED)|IEN);
outb(nicsr, DEPCA_NICSR);
outw(CSR0,DEPCA_ADDR);
......@@ -1121,33 +1136,43 @@ depca_tx(struct device *dev)
static int
depca_close(struct device *dev)
{
int ioaddr = dev->base_addr;
struct depca_private *lp = (struct depca_private *)dev->priv;
int nicsr, ioaddr = dev->base_addr;
dev->start = 0;
dev->tbusy = 1;
dev->start = 0;
dev->tbusy = 1;
outw(CSR0, DEPCA_ADDR);
outw(CSR0, DEPCA_ADDR);
if (depca_debug > 1) {
printk("%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, inw(DEPCA_DATA));
}
if (depca_debug > 1) {
printk("%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, inw(DEPCA_DATA));
}
/*
** We stop the DEPCA here -- it occasionally polls
** memory if we don't.
*/
outw(STOP, DEPCA_DATA);
/*
** We stop the DEPCA here -- it occasionally polls
** memory if we don't.
*/
outw(STOP, DEPCA_DATA);
/*
** Give back the ROM in case the user wants to go to DOS
*/
if (strstr(lp->devname,"DEPCA") == NULL) {
nicsr = inb(DEPCA_NICSR);
nicsr &= ~SHE;
outb(nicsr, DEPCA_NICSR);
}
free_irq(dev->irq);
free_irq(dev->irq);
irq2dev_map[dev->irq] = 0;
irq2dev_map[dev->irq] = 0;
#ifdef MODULE
MOD_DEC_USE_COUNT;
MOD_DEC_USE_COUNT;
#endif
return 0;
return 0;
}
static void LoadCSRs(struct device *dev)
......@@ -1373,12 +1398,12 @@ static struct device *alloc_device(struct device *dev, int ioaddr)
*/
if ((dev->next != NULL) &&
(num_eth > 0) && (num_eth < 9999)) {
dev = dev->next; /* point to the new device */
dev = dev->next; /* point to the new device */
dev->name = (char *)(dev + 1);
sprintf(dev->name,"eth%d", num_eth);/* New device name */
dev->base_addr = ioaddr; /* assign the io address */
dev->next = NULL; /* mark the end of list */
dev->init = &depca_probe; /* initialisation routine */
dev->base_addr = ioaddr; /* assign the io address */
dev->next = NULL; /* mark the end of list */
dev->init = &depca_probe; /* initialisation routine */
num_depcas++;
}
......@@ -1401,10 +1426,10 @@ static char *DepcaSignature(unsigned long mem_addr)
for (i=0;i<16;i++) { /* copy the first 16 bytes of ROM to */
tmpstr[i] = *(unsigned char *)(mem_addr+0xc000+i); /* a temporary string */
}
tmpstr[i] = '\0';
tmpstr[i]='\0';
strcpy(thisName,"");
for (i = 0 ; *signatures[i] != '\0' && *thisName == '\0' ; i++) {
for (i=0;*signatures[i]!='\0' && *thisName=='\0';i++) {
for (j=0,k=0;j<16 && k<strlen(signatures[i]);j++) {
if (signatures[i][k] == tmpstr[j]) { /* track signature */
k++;
......@@ -1521,7 +1546,7 @@ static char asc2hex(char value)
#ifdef MODULE
char kernel_version[] = UTS_RELEASE;
static struct device thisDepca = {
" ", /* device name inserted by /linux/drivers/net/net_init.c */
" ", /* device name inserted by /linux/drivers/net/net_init.c */
0, 0, 0, 0,
0x200, 7, /* I/O address, IRQ <--- EDIT THIS LINE FOR YOUR CONFIGURATION */
0, 0, 0, NULL, depca_probe };
......@@ -1548,8 +1573,8 @@ cleanup_module(void)
/*
* Local variables:
* kernel-compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c depca.c"
* kernel-compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O2 -m486 -c depca.c"
*
* module-compile-command: "gcc -D__KERNEL__ -DMODULE -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c depca.c"
* module-compile-command: "gcc -D__KERNEL__ -DMODULE -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O2 -m486 -c depca.c"
* End:
*/
......@@ -282,7 +282,7 @@ struct pci_chip {
int min_revision;
};
static struct pci_chip pci_chip_ids[2] = {
static struct pci_chip pci_chip_ids[3] = {
{PCI_DEVICE_ID_NCR_53C810, 810, 1, 1},
{PCI_DEVICE_ID_NCR_53C820, 820, -1, -1},
{PCI_DEVICE_ID_NCR_53C825, 825, -1, -1},
......@@ -413,6 +413,7 @@ static int NCR53c7x0_init (struct Scsi_Host *host) {
switch (hostdata->chip) {
case 810:
case 815:
case 825:
hostdata->dstat_sir_intr = NCR53c8x0_dstat_sir_intr;
hostdata->init_save_regs = NULL;
hostdata->dsa_fixup = NCR53c8xx_dsa_fixup;
......
......@@ -19,7 +19,14 @@ const char *buslogic_info(void);
int buslogic_reset(Scsi_Cmnd *);
int buslogic_biosparam(Disk *, int, int *);
#define BUSLOGIC_CMDLUN 4 /* ??? */
#define BUSLOGIC_CMDLUN 1 /* Do not set this too high. It sucks
up lots of memory on machines with > 16Mb
because of the huge number of bounce
buffers that need to be allocated.
For boards that use non-ISA bus, we can
bump this in the board detect routine.
10/8/94 ERY */
#define BUSLOGIC { NULL, \
"BusLogic", \
......
......@@ -373,9 +373,9 @@ static void scan_scsis (struct Scsi_Host * shpnt)
#ifdef DEBUG
printk("scsi: unknown type %d\n", type);
print_inquiry(scsi_result);
#endif
#endif
type = -1;
#endif
}
SDpnt->soft_reset =
......
......@@ -515,7 +515,7 @@ extern int scsi_reset (Scsi_Cmnd *);
extern int max_scsi_hosts;
#if defined(MAJOR_NR) && (MAJOR_NR != SCSI_TAPE_MAJOR)
static void end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
static Scsi_Cmnd * end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
{
struct request * req;
struct buffer_head * bh;
......@@ -547,7 +547,7 @@ static void end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
} while(sectors && bh);
if (req->bh){
req->buffer = bh->b_data;
return;
return SCpnt;
};
DEVICE_OFF(req->dev);
if (req->sem != NULL) {
......@@ -555,7 +555,7 @@ static void end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
}
req->dev = -1;
wake_up(&SCpnt->device->device_wait);
return;
return NULL;
}
......
......@@ -226,7 +226,7 @@ static void rw_intr (Scsi_Cmnd *SCpnt)
SCpnt->request.sector, this_count);
}
}
end_scsi_request(SCpnt, 1, this_count);
SCpnt = end_scsi_request(SCpnt, 1, this_count);
requeue_sd_request(SCpnt);
return;
}
......@@ -284,7 +284,7 @@ static void rw_intr (Scsi_Cmnd *SCpnt)
/* further access. */
rscsi_disks[DEVICE_NR(SCpnt->request.dev)].device->changed = 1;
end_scsi_request(SCpnt, 0, this_count);
SCpnt = end_scsi_request(SCpnt, 0, this_count);
requeue_sd_request(SCpnt);
return;
}
......@@ -316,7 +316,7 @@ of the disk.
if (driver_byte(result) & DRIVER_SENSE)
print_sense("sd", SCpnt);
end_scsi_request(SCpnt, 0, SCpnt->request.current_nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.current_nr_sectors);
requeue_sd_request(SCpnt);
return;
}
......@@ -406,7 +406,7 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt)
repeat:
if(SCpnt->request.dev <= 0) {
if(!SCpnt || SCpnt->request.dev <= 0) {
do_sd_request();
return;
}
......@@ -423,7 +423,7 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt)
!rscsi_disks[DEVICE_NR(dev)].device ||
block + SCpnt->request.nr_sectors > sd[dev].nr_sects)
{
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
goto repeat;
}
......@@ -436,7 +436,7 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt)
* quietly refuse to do anything to a changed disc until the changed bit has been reset
*/
/* printk("SCSI disk has been changed. Prohibiting further I/O.\n"); */
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
goto repeat;
}
......@@ -449,7 +449,7 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt)
case WRITE :
if (!rscsi_disks[dev].device->writeable)
{
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
goto repeat;
}
cmd[0] = WRITE_6;
......
......@@ -195,7 +195,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
SCpnt->request.sector, this_count);
}
end_scsi_request(SCpnt, 1, this_count); /* All done */
SCpnt = end_scsi_request(SCpnt, 1, this_count); /* All done */
requeue_sr_request(SCpnt);
return;
} /* Normal completion */
......@@ -225,7 +225,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
/* further access. */
scsi_CDs[DEVICE_NR(SCpnt->request.dev)].device->changed = 1;
end_scsi_request(SCpnt, 0, this_count);
SCpnt = end_scsi_request(SCpnt, 0, this_count);
requeue_sr_request(SCpnt);
return;
}
......@@ -240,7 +240,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
return;
} else {
printk("CD-ROM error: Drive reports %d.\n", SCpnt->sense_buffer[2]);
end_scsi_request(SCpnt, 0, this_count);
SCpnt = end_scsi_request(SCpnt, 0, this_count);
requeue_sr_request(SCpnt); /* Do next request */
return;
}
......@@ -249,7 +249,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
if (SCpnt->sense_buffer[2] == NOT_READY) {
printk("CDROM not ready. Make sure you have a disc in the drive.\n");
end_scsi_request(SCpnt, 0, this_count);
SCpnt = end_scsi_request(SCpnt, 0, this_count);
requeue_sr_request(SCpnt); /* Do next request */
return;
};
......@@ -266,7 +266,7 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
if (status_byte(result) == CHECK_CONDITION)
print_sense("sr", SCpnt);
end_scsi_request(SCpnt, 0, SCpnt->request.current_nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.current_nr_sectors);
requeue_sr_request(SCpnt);
}
}
......@@ -369,7 +369,7 @@ void requeue_sr_request (Scsi_Cmnd * SCpnt)
tries = 2;
repeat:
if(SCpnt->request.dev <= 0) {
if(!SCpnt || SCpnt->request.dev <= 0) {
do_sr_request();
return;
}
......@@ -382,7 +382,7 @@ void requeue_sr_request (Scsi_Cmnd * SCpnt)
if (dev >= sr_template.nr_dev)
{
/* printk("CD-ROM request error: invalid device.\n"); */
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
tries = 2;
goto repeat;
}
......@@ -390,7 +390,7 @@ void requeue_sr_request (Scsi_Cmnd * SCpnt)
if (!scsi_CDs[dev].use)
{
/* printk("CD-ROM request error: device marked not in use.\n"); */
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
tries = 2;
goto repeat;
}
......@@ -401,7 +401,7 @@ void requeue_sr_request (Scsi_Cmnd * SCpnt)
* quietly refuse to do anything to a changed disc until the changed bit has been reset
*/
/* printk("CD-ROM has been changed. Prohibiting further I/O.\n"); */
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
tries = 2;
goto repeat;
}
......@@ -409,7 +409,7 @@ void requeue_sr_request (Scsi_Cmnd * SCpnt)
switch (SCpnt->request.cmd)
{
case WRITE:
end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
goto repeat;
break;
case READ :
......
......@@ -309,7 +309,7 @@ static inline int find_and_clear_bit_16(unsigned short *field)
static inline unsigned char xchgb(unsigned char reg,
volatile unsigned char *mem)
{
asm ("xchgb %0, (%2)" : "=q" (reg) : "0" (reg), "q" (mem) : "m");
__asm__ ("xchgb %0,%1" : "=q" (reg), "=m" (*mem) : "0" (reg));
return reg;
}
......
......@@ -71,8 +71,9 @@ static char irq2dev[16] =
{-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1};
static int ad_format_mask[2 /*devc->mode*/ ] =
static int ad_format_mask[3 /*devc->mode*/ ] =
{
0,
AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW,
AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_U16_LE | AFMT_IMA_ADPCM
};
......
......@@ -282,7 +282,6 @@ int
probe_sb16midi (struct address_info *hw_config)
{
int ok = 0;
int i;
extern int sbc_major;
if (sbc_major < 4)
......
......@@ -43,6 +43,12 @@ ifdef CONFIG_HPFS_FS
FS_SUBDIRS := $(FS_SUBDIRS) hpfs
endif
ifdef CONFIG_BINFMT_ELF
BINFMTS := $(BINFMTS) binfmt_elf.o
else
MODULES := $(MODULES) binfmt_elf.o
endif
.c.s:
$(CC) $(CFLAGS) -S $<
.c.o:
......@@ -54,7 +60,7 @@ OBJS= open.o read_write.o inode.o devices.o file_table.o buffer.o super.o \
block_dev.o stat.o exec.o pipe.o namei.o fcntl.o ioctl.o \
select.o fifo.o locks.o filesystems.o dcache.o $(BINFMTS)
all: fs.o filesystems.a
all: fs.o filesystems.a modules
fs.o: $(OBJS)
$(LD) -r -o fs.o $(OBJS)
......@@ -65,6 +71,18 @@ filesystems.a: dummy
test ! -d $$i || \
{ $(MAKE) -C $$i; $(AR) rcs filesystems.a $$i/$$i.o; }; done
ifdef MODULES
modules:
$(MAKE) CFLAGS="$(CFLAGS) -DMODULE" $(MODULES)
(cd ../modules;for i in $(MODULES); do ln -sf ../fs/$$i .; done)
else
modules:
endif
depend dep:
$(CPP) -M *.c > .depend
set -e; for i in $(SUBDIRS); do \
......
This diff is collapsed.
......@@ -60,9 +60,16 @@ static int aout_core_dump(long signr, struct pt_regs * regs);
* Here are the actual binaries that will be accepted:
* add more with "register_binfmt()"..
*/
extern struct linux_binfmt elf_format;
static struct linux_binfmt aout_format = {
NULL, NULL, load_aout_binary, load_aout_library, aout_core_dump
#ifndef CONFIG_BINFMT_ELF
NULL, NULL, load_aout_binary, load_aout_library, aout_core_dump
#else
&elf_format, NULL, load_aout_binary, load_aout_library, aout_core_dump
#endif
};
static struct linux_binfmt *formats = &aout_format;
int register_binfmt(struct linux_binfmt * fmt)
......
......@@ -7,7 +7,9 @@
* - Do not copy data too often around in the kernel.
* - In nfs_file_read the return value of kmalloc wasn't checked.
* - Put in a better version of read look-ahead buffering. Original idea
* and implementation by Wai S Kok elekokw@ee.nus.sg.
* and implementation by Wai S Kok elekokws@ee.nus.sg.
*
* Expire cache on write to a file by Wai S Kok (Oct 1994).
*
* nfs regular file handling functions
*/
......@@ -201,6 +203,14 @@ static int nfs_file_write(struct inode *inode, struct file *file, char *buf,
}
if (count <= 0)
return 0;
cli();
/* If hit, cache is dirty and must be expired. */
for (i = 0; i < READ_CACHE_SIZE; i++)
if(cache[i].inode_num == inode->i_ino)
cache[i].time -= EXPIRE_CACHE;
sti();
pos = file->f_pos;
if (file->f_flags & O_APPEND)
pos = inode->i_size;
......
......@@ -77,7 +77,7 @@ static int nfs_stat_to_errno(int stat);
static inline int *nfs_rpc_alloc(int size)
{
#if 1
#if 0
/* Allow for the NFS crap as well as buffer */
return (int *)kmalloc(size+NFS_SLACK_SPACE,GFP_KERNEL);
#else
......@@ -88,7 +88,7 @@ static inline int *nfs_rpc_alloc(int size)
so that other processes are run inbetween (and hopefully give
some memory back). Florian
*/
int i;
int *i;
while (!(i = (int *)kmalloc(size+NFS_SLACK_SPACE,GFP_KERNEL))) {
/* printk("NFS: call schedule\n"); */
......
......@@ -71,7 +71,7 @@ static int nfs_follow_link(struct inode *dir, struct inode *inode,
}
error = nfs_proc_readlink(NFS_SERVER(inode), NFS_FH(inode), &mem,
&res, &len, NFS_MAXPATHLEN);
#if 1
#if 0
if ((res2 = (char *) kmalloc(NFS_MAXPATHLEN + 1, GFP_KERNEL)) == NULL) {
printk("NFS: no memory in nfs_follow_link\n");
error = -EIO;
......
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