Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
linux
Commits
a6686074
Commit
a6686074
authored
17 years ago
by
Linus Torvalds
Browse files
Options
Download
Email Patches
Plain Diff
Import 1.1.42
parent
598a477a
Changes
60
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
81 additions
and
51 deletions
+81
-51
CHANGES
CHANGES
+3
-3
CREDITS
CREDITS
+2
-2
MAGIC
MAGIC
+3
-3
Makefile
Makefile
+1
-1
README
README
+2
-2
boot/bootsect.S
boot/bootsect.S
+2
-2
boot/setup.S
boot/setup.S
+3
-3
drivers/block/blk.h
drivers/block/blk.h
+0
-1
drivers/block/floppy.c
drivers/block/floppy.c
+2
-0
drivers/block/hd.c
drivers/block/hd.c
+2
-1
drivers/block/ll_rw_blk.c
drivers/block/ll_rw_blk.c
+1
-0
drivers/char/Makefile
drivers/char/Makefile
+1
-1
drivers/char/console.c
drivers/char/console.c
+5
-3
drivers/char/n_tty.c
drivers/char/n_tty.c
+2
-7
drivers/char/pty.c
drivers/char/pty.c
+26
-0
drivers/char/serial.c
drivers/char/serial.c
+1
-1
drivers/char/tty_io.c
drivers/char/tty_io.c
+7
-8
drivers/scsi/NCR5380.c
drivers/scsi/NCR5380.c
+1
-1
drivers/scsi/seagate.c
drivers/scsi/seagate.c
+10
-8
drivers/scsi/ultrastor.c
drivers/scsi/ultrastor.c
+7
-4
No files found.
CHANGES
View file @
a6686074
...
...
@@ -19,7 +19,7 @@ CHANGES since 0.99 patchlevel 13:
- readonly OS/2 filesystem support (HPFS) added (Chris Smith)
- NTP support (Philip Gladstone, Torsten Duwe, ??)
- fixed 16MB swap-area limit
- lots of minor cleanups, bu
x
fixes etc.
- lots of minor cleanups, bu
g
fixes etc.
CHANGES since 0.99 patchlevel 12 and earlier:
...
...
@@ -117,7 +117,7 @@ NOTABLE changes since patchlevel 10 or earlier:
it.
- named pipes and normal pipes should hopefully have the right select()
semantics in the presen
s
e/absen
s
e of writers.
semantics in the presen
c
e/absen
c
e of writers.
- QIC-02 tape driver by Hennus Bergman
...
...
@@ -135,7 +135,7 @@ NOTABLE changes since patchlevel 10 or earlier:
- udelay() function for short delays (busy-waiting) added. Used
currently only by the QIC driver.
- fork() and sheduler changes to make task switches happen only from
- fork() and s
c
heduler changes to make task switches happen only from
kernel mode to kernel mode. Cleaner and more portable than the old
code which counted on being able to task-switch directly into user
mode.
...
...
This diff is collapsed.
Click to expand it.
CREDITS
View file @
a6686074
...
...
@@ -129,7 +129,7 @@ D: Second extended file system co-designer
N: Thomas Dunbar
E: tdunbar@vtaix.cc.vt.edu
D: TeX & METAFONT hacking/maint
aine
nce
D: TeX & METAFONT hacking/maint
ena
nce
S: Dean, Graduate School
S: Virginia Tech
S: Blacksburg, Virginia 24061
...
...
@@ -581,7 +581,7 @@ D: HOWTO coordinator and writer
D: Maintainer of sunsite.unc.edu Linux doc archives
D: Moderator, comp.os.linux.announce
S: 205 Gray Street NE
S: Wilson, North Caro
i
lina 27893
S: Wilson, North Carolina 27893
S: USA
...
...
This diff is collapsed.
Click to expand it.
MAGIC
View file @
a6686074
...
...
@@ -6,7 +6,7 @@ are unique.
It is a *very* good idea to protect kernel data structures with magic
numbers. This allows you to check at run time whether (a) a structure
has been clobbered, or (b) you've passed the wrong structure to a
routine. This last is especially useful --- particlarly when you are
routine. This last is especially useful --- partic
u
larly when you are
passing pointers to structures via a void * pointer. The tty code,
for example, does this frequently to pass driver-specific and line
discipline-specific structures back and forth.
...
...
@@ -19,11 +19,11 @@ struct tty_ldisc {
...
};
Please follow this discpline when you are adding future enhancements
Please follow this disc
i
pline when you are adding future enhancements
to the kernel! It has saved me countless hours of debugging,
especially in the screw cases where an array has been overrun and
structures following the array have been overwritten. Using this
discpline, these cases get detected quickly and safely.
disc
i
pline, these cases get detected quickly and safely.
Theodore Ts'o
31-Mar-94
...
...
This diff is collapsed.
Click to expand it.
Makefile
View file @
a6686074
VERSION
=
1
PATCHLEVEL
=
1
SUBLEVEL
=
4
1
SUBLEVEL
=
4
2
all
:
Version zImage
...
...
This diff is collapsed.
Click to expand it.
README
View file @
a6686074
...
...
@@ -71,7 +71,7 @@ CONFIGURING the kernel:
but it should not hurt performance.
- A kernel with math-emulation compiled in will still use the
coprocessor if one is present: the math emulation will just
never get used in that case. The kernel will be slighly larger,
never get used in that case. The kernel will be sligh
t
ly larger,
but will work on different machines regardless of whether they
have a math coprocessor or not.
- the "kernel hacking" configuration details usually result in a
...
...
@@ -162,7 +162,7 @@ IF SOMETHING GOES WRONG:
important: it tells something about why the kernel dumped code (in
the above example it's due to a bad kernel pointer)
- in debugging dumps like the above, it helps eno
u
rmously if you can
- in debugging dumps like the above, it helps enormously if you can
look up what the EIP value means. The hex value as such doesn't help
me or anybody else very much: it will depend on your particular
kernel setup. What you should do is take the hex value from the EIP
...
...
This diff is collapsed.
Click to expand it.
boot/bootsect.S
View file @
a6686074
...
...
@@ -242,7 +242,7 @@ root_defined:
seg
cs
mov
root_dev
,
ax
!
after
that
(
everyting
loaded
),
we
jump
to
!
after
that
(
everyt
h
ing
loaded
),
we
jump
to
!
the
setup
-
routine
loaded
directly
after
!
the
bootblock
:
...
...
@@ -397,7 +397,7 @@ print_nl:
/*
*
print_hex
is
for
debugging
purposes
,
and
prints
the
word
*
pointed
to
by
ss
:
bp
in
hexadec
m
ial
.
*
pointed
to
by
ss
:
bp
in
hexadeci
m
al
.
*/
print_hex
:
...
...
This diff is collapsed.
Click to expand it.
boot/setup.S
View file @
a6686074
...
...
@@ -243,7 +243,7 @@ end_move:
!
we
let
the
gnu
-
compiled
32
-
bit
programs
do
that
.
We
just
jump
to
!
absolute
address
0x00000
,
in
32
-
bit
protected
mode
.
!
!
Note
that
the
short
jump
isn
't strictly needed, although
t
there are
!
Note
that
the
short
jump
isn
't strictly needed, although there are
!
reasons
why
it
might
be
a
good
idea
.
It
won
't hurt in any case.
!
xor
ax
,
ax
...
...
@@ -408,7 +408,7 @@ svga: cld
mov
bh
,
al
!
store
current
value
of
CRT
-
register
0x38
mov
ax
,#
0x0038
call
outidx
!
disable
writing
to
special
regs
movb
al
,
cl
!
check
wether
we
can
write
special
reg
0x35
movb
al
,
cl
!
check
w
h
ether
we
can
write
special
reg
0x35
call
inidx
movb
bl
,
al
!
save
the
current
value
of
CRT
reg
0x35
andb
al
,#
0xf0
!
clear
bits
0
-
3
...
...
@@ -436,7 +436,7 @@ s3_2: mov ax,cx ! load ah with 0xf and al with 0x35
je
no_s3
!
writing
is
allowed
=>
this
is
not
an
S3
s3_1
:
mov
ax
,#
0x4838
!
allow
writing
to
special
regs
by
putting
call
outidx
!
magic
number
into
CRT
-
register
0x38
movb
al
,
cl
!
check
wether
we
can
write
special
reg
0x35
movb
al
,
cl
!
check
w
h
ether
we
can
write
special
reg
0x35
call
inidx
movb
bl
,
al
andb
al
,#
0xf0
...
...
This diff is collapsed.
Click to expand it.
drivers/block/blk.h
View file @
a6686074
...
...
@@ -85,7 +85,6 @@ extern unsigned long mcd_init(unsigned long mem_start, unsigned long mem_end);
#ifdef CONFIG_SBPCD
extern
unsigned
long
sbpcd_init
(
unsigned
long
,
unsigned
long
);
#endif CONFIG_SBPCD
extern
int
is_read_only
(
int
dev
);
extern
void
set_device_ro
(
int
dev
,
int
flag
);
extern
void
rd_load
(
void
);
...
...
This diff is collapsed.
Click to expand it.
drivers/block/floppy.c
View file @
a6686074
...
...
@@ -1750,6 +1750,8 @@ static void rw_interrupt(void)
return
;
}
current_type
[
current_drive
]
=
floppy
;
floppy_sizes
[
DRIVE
(
current_drive
)
+
(
FDC
(
current_drive
)
<<
7
)]
=
floppy
->
size
>>
1
;
break
;
}
...
...
This diff is collapsed.
Click to expand it.
drivers/block/hd.c
View file @
a6686074
...
...
@@ -604,9 +604,10 @@ static void hd_times_out(void)
{
DEVICE_INTR
=
NULL
;
sti
();
special_op
[
DEVICE_NR
(
CURRENT
->
dev
)]
+=
reset
=
1
;
reset
=
1
;
if
(
!
CURRENT
)
return
;
special_op
[
DEVICE_NR
(
CURRENT
->
dev
)]
++
;
printk
(
KERN_DEBUG
"HD timeout
\n
"
);
cli
();
if
(
++
CURRENT
->
errors
>=
MAX_ERRORS
)
{
...
...
This diff is collapsed.
Click to expand it.
drivers/block/ll_rw_blk.c
View file @
a6686074
...
...
@@ -202,6 +202,7 @@ static void make_request(int major,int rw, struct buffer_head * bh)
if
(
blk_size
[
major
])
if
(
blk_size
[
major
][
MINOR
(
bh
->
b_dev
)]
<
(
sector
+
count
)
>>
1
)
{
bh
->
b_dirt
=
bh
->
b_uptodate
=
0
;
bh
->
b_req
=
0
;
return
;
}
lock_buffer
(
bh
);
...
...
This diff is collapsed.
Click to expand it.
drivers/char/Makefile
View file @
a6686074
...
...
@@ -20,7 +20,7 @@ OBJS = tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o
\
defkeymap.o
SRCS
=
tty_io.c console.c keyboard.c serial.c
\
SRCS
=
tty_io.c
n_tty.c
console.c keyboard.c serial.c
\
tty_ioctl.c pty.c vt.c mem.c
\
defkeymap.c
...
...
This diff is collapsed.
Click to expand it.
drivers/char/console.c
View file @
a6686074
...
...
@@ -9,7 +9,7 @@
*
* This module exports the console io functions:
*
* 'long con_init(long)'
* 'long con
sole
_init(
long,
long)'
* 'int con_open(struct tty_struct *tty, struct file * filp)'
* 'void update_screen(int new_console)'
* 'void blank_screen(void)'
...
...
@@ -801,6 +801,7 @@ static void cursor_report(int currcons, struct tty_struct * tty)
respond_string
(
buf
,
tty
);
}
#ifdef CONFIG_SELECTION
static
void
mouse_report
(
int
currcons
,
struct
tty_struct
*
tty
,
int
butt
,
int
mrx
,
int
mry
)
{
...
...
@@ -810,6 +811,7 @@ static void mouse_report(int currcons, struct tty_struct * tty,
(
char
)(
'!'
+
mry
));
respond_string
(
buf
,
tty
);
}
#endif
static
inline
void
status_report
(
int
currcons
,
struct
tty_struct
*
tty
)
{
...
...
@@ -1519,7 +1521,7 @@ static void con_unthrottle(struct tty_struct *tty)
}
/*
* long con_init(long);
* long con
sole
_init(
long,
long);
*
* This routine initalizes console interrupts, and does nothing
* else. If you want the screen to clear, call tty_write with
...
...
@@ -1528,7 +1530,7 @@ static void con_unthrottle(struct tty_struct *tty)
* Reads the information preserved by setup.s to determine the current display
* type and sets everything accordingly.
*/
long
con_init
(
long
kmem_start
)
long
con
sole
_init
(
long
kmem_start
,
long
kmem_end
)
{
char
*
display_desc
=
"????"
;
int
currcons
=
0
;
...
...
This diff is collapsed.
Click to expand it.
drivers/char/n_tty.c
View file @
a6686074
...
...
@@ -76,7 +76,8 @@ void n_tty_flush_buffer(struct tty_struct * tty)
if
(
!
tty
->
link
)
return
;
wake_up_interruptible
(
&
tty
->
link
->
write_wait
);
if
(
tty
->
driver
.
unthrottle
)
(
tty
->
driver
.
unthrottle
)(
tty
);
if
(
tty
->
link
->
packet
)
{
tty
->
ctrl_status
|=
TIOCPKT_FLUSHREAD
;
wake_up_interruptible
(
&
tty
->
link
->
read_wait
);
...
...
@@ -895,12 +896,6 @@ static int read_chan(struct tty_struct *tty, struct file *file,
current
->
state
=
TASK_RUNNING
;
current
->
timeout
=
0
;
/*
* Hack for PTY's; we need to wake up the other tty if there's
* enough space.
*/
if
(
tty
->
link
&&
tty
->
read_cnt
<=
TTY_THRESHOLD_UNTHROTTLE
)
wake_up_interruptible
(
&
tty
->
link
->
write_wait
);
return
(
b
-
buf
)
?
b
-
buf
:
retval
;
}
...
...
This diff is collapsed.
Click to expand it.
drivers/char/pty.c
View file @
a6686074
...
...
@@ -85,6 +85,30 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
}
}
/*
* The unthrottle routine is called by the line discipline to signal
* that it can receive more characters. For PTY's, the TTY_THROTTLED
* flag is always set, to force the line discpline to always call the
* unthrottle routine when there are fewer than TTY_THRESHOLD_UNTHROTTLE
* characters in the queue. This is necessary since each time this
* happens, we need to wake up any sleeping processes that could be
* (1) trying to send data to the pty, or (2) waiting in wait_until_sent()
* for the pty buffer to be drained.
*/
static
void
pty_unthrottle
(
struct
tty_struct
*
tty
)
{
struct
tty_struct
*
o_tty
=
tty
->
link
;
if
(
!
o_tty
)
return
;
if
((
o_tty
->
flags
&
(
1
<<
TTY_DO_WRITE_WAKEUP
))
&&
o_tty
->
ldisc
.
write_wakeup
)
(
o_tty
->
ldisc
.
write_wakeup
)(
o_tty
);
wake_up_interruptible
(
&
o_tty
->
write_wait
);
set_bit
(
TTY_THROTTLED
,
&
tty
->
flags
);
}
static
int
pty_write
(
struct
tty_struct
*
tty
,
int
from_user
,
unsigned
char
*
buf
,
int
count
)
{
...
...
@@ -177,6 +201,7 @@ int pty_open(struct tty_struct *tty, struct file * filp)
if
(
tty
->
driver
.
subtype
==
PTY_TYPE_SLAVE
)
clear_bit
(
TTY_SLAVE_CLOSED
,
&
tty
->
link
->
flags
);
wake_up_interruptible
(
&
pty
->
open_wait
);
set_bit
(
TTY_THROTTLED
,
&
tty
->
flags
);
if
(
filp
->
f_flags
&
O_NDELAY
)
return
0
;
while
(
!
tty
->
link
->
count
&&
!
(
current
->
signal
&
~
current
->
blocked
))
...
...
@@ -215,6 +240,7 @@ long pty_init(long kmem_start)
pty_driver
.
write_room
=
pty_write_room
;
pty_driver
.
flush_buffer
=
pty_flush_buffer
;
pty_driver
.
chars_in_buffer
=
pty_chars_in_buffer
;
pty_driver
.
unthrottle
=
pty_unthrottle
;
pty_slave_driver
=
pty_driver
;
pty_slave_driver
.
name
=
"ttyp"
;
...
...
This diff is collapsed.
Click to expand it.
drivers/char/serial.c
View file @
a6686074
...
...
@@ -1205,7 +1205,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
if
(
serial_paranoia_check
(
info
,
tty
->
device
,
"rs_put_char"
))
return
;
if
(
!
tty
||
tty
->
stopped
||
tty
->
hw_stopped
||
!
info
->
xmit_buf
)
if
(
!
tty
||
!
info
->
xmit_buf
)
return
;
save_flags
(
flags
);
cli
();
...
...
This diff is collapsed.
Click to expand it.
drivers/char/tty_io.c
View file @
a6686074
...
...
@@ -75,7 +75,7 @@ extern int shift_state;
extern
int
do_screendump
(
int
arg
);
struct
termios
tty_std_termios
;
/* for the benefit of tty drivers */
struct
tty_driver
*
tty_drivers
;
/* linked list of tty drivers */
struct
tty_driver
*
tty_drivers
=
NULL
;
/* linked list of tty drivers */
struct
tty_ldisc
ldiscs
[
NR_LDISCS
];
/* line disc dispatch table */
/*
...
...
@@ -1529,13 +1529,14 @@ void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
*/
int
tty_register_driver
(
struct
tty_driver
*
driver
)
{
int
error
;
if
(
driver
->
flags
&
TTY_DRIVER_INSTALLED
)
return
0
;
/*
* XXX need to check to see if major device already
* registered, and then handle error checking.
*/
(
void
)
register_chrdev
(
driver
->
major
,
driver
->
name
,
&
tty_fops
);
error
=
register_chrdev
(
driver
->
major
,
driver
->
name
,
&
tty_fops
);
if
(
error
)
return
error
;
if
(
!
driver
->
put_char
)
driver
->
put_char
=
tty_default_put_char
;
...
...
@@ -1555,7 +1556,6 @@ long tty_init(long kmem_start)
panic
(
"unable to get major %d for tty device"
,
TTY_MAJOR
);
if
(
register_chrdev
(
TTYAUX_MAJOR
,
"tty"
,
&
tty_fops
))
panic
(
"unable to get major %d for tty device"
,
TTYAUX_MAJOR
);
tty_drivers
=
0
;
/* Setup the default TTY line discipline. */
memset
(
ldiscs
,
0
,
sizeof
(
ldiscs
));
...
...
@@ -1573,7 +1573,6 @@ long tty_init(long kmem_start)
tty_std_termios
.
c_lflag
=
ISIG
|
ICANON
|
ECHO
|
ECHOE
|
ECHOK
|
ECHOCTL
|
ECHOKE
|
IEXTEN
;
kmem_start
=
con_init
(
kmem_start
);
kmem_start
=
kbd_init
(
kmem_start
);
kmem_start
=
rs_init
(
kmem_start
);
kmem_start
=
pty_init
(
kmem_start
);
...
...
This diff is collapsed.
Click to expand it.
drivers/scsi/NCR5380.c
View file @
a6686074
...
...
@@ -705,7 +705,7 @@ static void NCR5380_print_options (struct Scsi_Host *instance) {
* Inputs : instance, pointer to this instance.
*/
void
NCR5380_print_status
(
struct
Scsi_Host
*
instance
)
{
static
void
NCR5380_print_status
(
struct
Scsi_Host
*
instance
)
{
struct
NCR5380_hostdata
*
hostdata
=
(
struct
NCR5380_hostdata
*
)
instance
->
hostdata
;
Scsi_Cmnd
*
ptr
;
...
...
This diff is collapsed.
Click to expand it.
drivers/scsi/seagate.c
View file @
a6686074
...
...
@@ -670,18 +670,20 @@ static int internal_command(unsigned char target, unsigned char lun, const void
* target ID are asserted. A valid initator ID is not on the bus
* until IO is asserted, so we must wait for that.
*/
for
(
clock
=
jiffies
+
10
,
temp
=
0
;
(
jiffies
<
clock
)
&&
!
((
temp
=
STATUS
)
&
(
STAT_IO
|
STAT_BSY
)););
clock
=
jiffies
+
10
;
for
(;;)
{
temp
=
STATUS
;
if
((
temp
&
STAT_IO
)
&&
!
(
temp
&
STAT_BSY
))
break
;
if
(
jiffies
>=
clock
)
{
if
(
jiffies
>
clock
)
{
#if (DEBUG & PHASE_RESELECT)
printk
(
"scsi%d : RESELECT timed out while waiting for IO .
\n
"
,
hostno
);
printk
(
"scsi%d : RESELECT timed out while waiting for IO .
\n
"
,
hostno
);
#endif
return
(
DID_BAD_INTR
<<
16
);
return
(
DID_BAD_INTR
<<
16
);
}
}
/*
* After I/O is asserted by the target, we can read our ID and its
...
...
This diff is collapsed.
Click to expand it.
drivers/scsi/ultrastor.c
View file @
a6686074
...
...
@@ -298,15 +298,18 @@ static inline int find_and_clear_bit_16(unsigned short *field)
return
rv
;
}
/* This asm is fragile: it doesn't work without the casts and it may
/* This has been re-implemented with the help of Richard Earnshaw,
<rwe@pegasus.esprit.ec.org> and works with gcc-2.5.8 and gcc-2.6.0.
The instability noted by jfc below appears to be a bug in
gcc-2.5.x when compiling w/o optimization. --Caleb
This asm is fragile: it doesn't work without the casts and it may
not work without optimization. Maybe I should add a swap builtin
to gcc. --jfc */
static
inline
unsigned
char
xchgb
(
unsigned
char
reg
,
volatile
unsigned
char
*
mem
)
{
asm
(
"xchgb %0,%1"
:
"=q"
(
reg
),
"=m"
(
*
(
unsigned
char
*
)
mem
)
:
"0"
(
reg
),
"1"
(
*
(
unsigned
char
*
)
mem
));
asm
(
"xchgb %0, (%2)"
:
"=q"
(
reg
)
:
"0"
(
reg
),
"q"
(
mem
)
:
"m"
);
return
reg
;
}
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment