Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a6686074
Commit
a6686074
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 1.1.42
parent
598a477a
Changes
60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
60 changed files
with
1072 additions
and
476 deletions
+1072
-476
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
fs/block_dev.c
fs/block_dev.c
+6
-5
fs/buffer.c
fs/buffer.c
+5
-5
fs/devices.c
fs/devices.c
+2
-2
fs/isofs/namei.c
fs/isofs/namei.c
+2
-2
fs/locks.c
fs/locks.c
+1
-1
fs/pipe.c
fs/pipe.c
+1
-1
fs/select.c
fs/select.c
+1
-1
ibcs/binfmt_coff.c
ibcs/binfmt_coff.c
+10
-10
ibcs/binfmt_elf.c
ibcs/binfmt_elf.c
+1
-1
include/asm/string.h
include/asm/string.h
+429
-0
include/linux/bios32.h
include/linux/bios32.h
+2
-1
include/linux/string.h
include/linux/string.h
+1
-1
include/linux/timex.h
include/linux/timex.h
+0
-1
init/main.c
init/main.c
+30
-16
ipc/shm.c
ipc/shm.c
+2
-2
kernel/bios32.c
kernel/bios32.c
+366
-315
kernel/exec_domain.c
kernel/exec_domain.c
+1
-1
kernel/exit.c
kernel/exit.c
+2
-2
kernel/irq.c
kernel/irq.c
+2
-2
kernel/ksyms.c
kernel/ksyms.c
+1
-2
kernel/module.c
kernel/module.c
+2
-2
kernel/panic.c
kernel/panic.c
+1
-1
kernel/ptrace.c
kernel/ptrace.c
+8
-8
kernel/sched.c
kernel/sched.c
+1
-1
kernel/splx.c
kernel/splx.c
+2
-2
kernel/sys.c
kernel/sys.c
+6
-6
kernel/sys_call.S
kernel/sys_call.S
+2
-2
kernel/time.c
kernel/time.c
+0
-1
kernel/traps.c
kernel/traps.c
+1
-1
mm/kmalloc.c
mm/kmalloc.c
+1
-1
mm/mmap.c
mm/mmap.c
+1
-1
mm/swap.c
mm/swap.c
+4
-9
net/inet/ipx.c
net/inet/ipx.c
+1
-1
net/inet/tcp.c
net/inet/tcp.c
+69
-8
net/inet/timer.c
net/inet/timer.c
+19
-2
net/protocols.c
net/protocols.c
+1
-1
net/socket.c
net/socket.c
+3
-3
zBoot/crypt.h
zBoot/crypt.h
+1
-1
zBoot/lzw.h
zBoot/lzw.h
+2
-2
zBoot/misc.c
zBoot/misc.c
+1
-1
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
se/absens
e of writers.
semantics in the presen
ce/absenc
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.
...
...
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
...
...
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
...
...
Makefile
View file @
a6686074
VERSION
=
1
PATCHLEVEL
=
1
SUBLEVEL
=
4
1
SUBLEVEL
=
4
2
all
:
Version zImage
...
...
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
...
...
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
mi
al
.
*
pointed
to
by
ss
:
bp
in
hexadec
im
al
.
*/
print_hex
:
...
...
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
...
...
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
);
...
...
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
;
}
...
...
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
)
{
...
...
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
);
...
...
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
...
...
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
;
...
...
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
;
}
...
...
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"
;
...
...
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
();
...
...
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
);
...
...
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
;
...
...
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
...
...
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
;
}
...
...
fs/block_dev.c
View file @
a6686074
...
...
@@ -175,14 +175,15 @@ int block_read(struct inode * inode, struct file * filp, char * buf, int count)
rblocks
=
blocks
=
(
left
+
offset
+
blocksize
-
1
)
>>
blocksize_bits
;
bhb
=
bhe
=
buflist
;
if
(
filp
->
f_reada
)
{
if
(
blocks
<
read_ahead
[
MAJOR
(
dev
)]
/
(
blocksize
>>
9
))
blocks
=
read_ahead
[
MAJOR
(
dev
)]
/
(
blocksize
>>
9
);
if
(
block
+
blocks
>
size
)
blocks
=
size
-
block
;
if
(
blocks
<
read_ahead
[
MAJOR
(
dev
)]
/
(
blocksize
>>
9
))
blocks
=
read_ahead
[
MAJOR
(
dev
)]
/
(
blocksize
>>
9
);
blocks
-=
(
block
%
blocks_per_cluster
);
if
(
rblocks
>
blocks
)
blocks
=
rblocks
;
if
(
rblocks
>
blocks
)
blocks
=
rblocks
;
}
if
(
block
+
blocks
>
size
)
blocks
=
size
-
block
;
/* We do this in a two stage process. We first try and request
as many blocks as we can, then we wait for the first one to
...
...
fs/buffer.c
View file @
a6686074
...
...
@@ -422,7 +422,7 @@ static struct buffer_head * find_buffer(dev_t dev, int block, int size)
/*
* Why like this, I hear you say... The reason is race-conditions.
* As we don't lock buffers (unless we are readin
t
them, that is),
* As we don't lock buffers (unless we are readin
g
them, that is),
* something might happen to it while we sleep (ie a read-error
* will force it bad). This shouldn't really happen currently, but
* the code is ready.
...
...
@@ -675,7 +675,7 @@ void refill_freelist(int size)
* race-conditions. Most of the code is seldom used, (ie repeating),
* so it should be much more efficient than it looks.
*
* The algoritm is changed: hopefully better, and an elusive bug removed.
* The algorit
h
m is changed: hopefully better, and an elusive bug removed.
*
* 14.02.92: changed it to sync dirty buffers a bit: better performance
* when the filesystem starts to get full of dirty blocks (I hope).
...
...
@@ -1465,7 +1465,7 @@ static inline int try_to_reassign(struct buffer_head * bh, struct buffer_head **
* pages for the buffer cache as much of the time as possible.
* This way the other buffers on a particular page are likely
* to be very near each other on the free list, and we will not
* be expiring data prematurely. For now we only canibalize buffers
* be expiring data prematurely. For now we only can
n
ibalize buffers
* of the same size to keep the code simpler.
*/
static
int
reassign_cluster
(
dev_t
dev
,
...
...
@@ -1619,7 +1619,7 @@ void buffer_init(void)
return
;
}
/* This is a simple kernel daemon, whose job it is to provide a dynamicly
/* This is a simple kernel daemon, whose job it is to provide a dynamic
al
ly
* response to dirty buffers. Once this process is activated, we write back
* a limited number of buffers to the disks and then go back to sleep again.
* In effect this is a process which never leaves kernel mode, and does not have
...
...
@@ -1645,7 +1645,7 @@ static void wakeup_bdflush(int wait)
/*
* Here we attempt to write back old buffers. We also try and flush in
do
es
* Here we attempt to write back old buffers. We also try and flush in
od
es
* and supers as well, since this function is essentially "update", and
* otherwise there would be no way of ensuring that these quantities ever
* get written back. Ideally, we would have a timestamp on the inodes
...
...
fs/devices.c
View file @
a6686074
...
...
@@ -66,7 +66,7 @@ int register_chrdev(unsigned int major, const char * name, struct file_operation
{
if
(
major
>=
MAX_CHRDEV
)
return
-
EINVAL
;
if
(
chrdevs
[
major
].
fops
)
if
(
chrdevs
[
major
].
fops
&&
chrdevs
[
major
].
fops
!=
fops
)
return
-
EBUSY
;
chrdevs
[
major
].
name
=
name
;
chrdevs
[
major
].
fops
=
fops
;
...
...
@@ -77,7 +77,7 @@ int register_blkdev(unsigned int major, const char * name, struct file_operation
{
if
(
major
>=
MAX_BLKDEV
)
return
-
EINVAL
;
if
(
blkdevs
[
major
].
fops
)
if
(
blkdevs
[
major
].
fops
&&
blkdevs
[
major
].
fops
!=
fops
)
return
-
EBUSY
;
blkdevs
[
major
].
name
=
name
;
blkdevs
[
major
].
fops
=
fops
;
...
...
fs/isofs/namei.c
View file @
a6686074
...
...
@@ -64,7 +64,7 @@ static int isofs_match(int len,const char * name, char * compare, int dlen)
* entry - you'll have to do that yourself if you want to.
*/
static
struct
buffer_head
*
isofs_find_entry
(
struct
inode
*
dir
,
const
char
*
name
,
int
namelen
,
int
*
ino
,
int
*
ino_back
)
const
char
*
name
,
int
namelen
,
unsigned
long
*
ino
,
unsigned
long
*
ino_back
)
{
unsigned
long
bufsize
=
ISOFS_BUFFER_SIZE
(
dir
);
unsigned
char
bufbits
=
ISOFS_BUFFER_BITS
(
dir
);
...
...
@@ -213,7 +213,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
int
isofs_lookup
(
struct
inode
*
dir
,
const
char
*
name
,
int
len
,
struct
inode
**
result
)
{
int
ino
,
ino_back
;
unsigned
long
ino
,
ino_back
;
struct
buffer_head
*
bh
;
#ifdef DEBUG
...
...
fs/locks.c
View file @
a6686074
...
...
@@ -358,7 +358,7 @@ static int lock_it(struct file *filp, struct file_lock *caller, unsigned int fd)
/*
* Replace the old lock with the new one. Wake up
* anybody waiting for the old one, as the change in
* lock type mig
th
satisfy his needs.
* lock type mig
ht
satisfy his needs.
*/
wake_up
(
&
fl
->
fl_wait
);
fl
->
fl_start
=
caller
->
fl_start
;
...
...
fs/pipe.c
View file @
a6686074
...
...
@@ -15,7 +15,7 @@
/* We don't use the head/tail construction any more. Now we use the start/len*/
/* contruction providing full use of PIPE_BUF (multiple of PAGE_SIZE) */
/* con
s
truction providing full use of PIPE_BUF (multiple of PAGE_SIZE) */
/* Florian Coosmann (FGC) ^ current = 1 */
/* Additionally, we now use locking technique. This prevents race condition */
/* in case of paging and multiple read/write on the same pipe. (FGC) */
...
...
fs/select.c
View file @
a6686074
...
...
@@ -191,7 +191,7 @@ __get_fd_set(nr, (unsigned long *) (fsp), (unsigned long *) (fdp))
__set_fd_set(nr, (unsigned long *) (fsp), (unsigned long *) (fdp))
/*
* We can actually return ERESTARTSYS ins
et
ad of EINTR, but I'd
* We can actually return ERESTARTSYS ins
te
ad of EINTR, but I'd
* like to be certain this leads to no problems. So I return
* EINTR just for safety.
*
...
...
ibcs/binfmt_coff.c
View file @
a6686074
...
...
@@ -4,13 +4,13 @@
* Compatibility Specification 2 or O'Rilley's book on COFF. The shared
* libraries are defined only the in the Intel book.
*
* This file is based upon code written by Eric Youndale for the ELF object
* This file is based upon code written by Eric Youn
g
dale for the ELF object
* file format.
*
* Author: Al Longyear (longyear@sii.com)
*
* Latest Revision:
* 3 Feb
ur
ary 1994
* 3 Feb
ru
ary 1994
* Al Longyear (longyear@sii.com)
* Cleared first page of bss section using put_fs_byte.
*/
...
...
@@ -162,7 +162,7 @@ load_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
sections
=
COFF_SHORT
(
coff_hdr
->
f_nscns
);
/* Number of sections */
aout_size
=
COFF_SHORT
(
coff_hdr
->
f_opthdr
);
/* Size of opt. headr */
/*
* If the file is not executable then reject the exec
t
ution. This means
* If the file is not executable then reject the execution. This means
* that there must not be external references.
*/
if
((
flags
&
COFF_F_EXEC
)
==
0
)
{
...
...
@@ -173,7 +173,7 @@ load_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
break
;
}
/*
* There must be atleast one section.
* There must be at
least one section.
*/
if
(
sections
==
0
)
{
#ifdef COFF_DEBUG
...
...
@@ -509,7 +509,7 @@ load_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
}
/*
* Construct the bss data for the process. The bss ranges from the
* end of the data (which may not be on a page boundry) to the end
* end of the data (which may not be on a page bound
a
ry) to the end
* of the bss section. Allocate any necessary pages for the data.
*/
if
(
status
>=
0
&&
bss_size
!=
0
)
{
...
...
@@ -531,8 +531,8 @@ load_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
int
nIndex
;
COFF_SCNHDR
*
sect_ptr
=
sect_bufr
;
/*
* Find the library sections. (There should be atleast one. It was counted
* earlier.) This will even
ut
ally recurse to our code and load the shared
* Find the library sections. (There should be at
least one. It was counted
* earlier.) This will even
tu
ally recurse to our code and load the shared
* library with our own procedures.
*/
for
(
nIndex
=
0
;
nIndex
<
sections
;
++
nIndex
)
{
...
...
@@ -581,7 +581,7 @@ load_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
/*
* This procedure will load the library listed in the file name given
* as the paramter. The result will be non-zero should something fail
* as the param
e
ter. The result will be non-zero should something fail
* to load.
*/
...
...
@@ -624,7 +624,7 @@ preload_library (struct linux_binprm *exe_bprm,
int
status
=
0
;
/* Completion status */
long
nbytes
;
/* Count of bytes in the header area */
/*
* Fetch the size of the section. There must be enough room for atleast
* Fetch the size of the section. There must be enough room for at
least
* one entry.
*/
nbytes
=
COFF_LONG
(
sect
->
s_size
);
...
...
@@ -659,7 +659,7 @@ preload_library (struct linux_binprm *exe_bprm,
nbytes
);
/* Byte count reqd. */
set_fs
(
old_fs
);
/* Restore the selector */
/*
* Check the result. The value returned is the byte count act
au
lly read.
* Check the result. The value returned is the byte count act
ua
lly read.
*/
if
(
status
>=
0
&&
status
!=
nbytes
)
{
#ifdef COFF_DEBUG
...
...
ibcs/binfmt_elf.c
View file @
a6686074
...
...
@@ -121,7 +121,7 @@ unsigned long * create_elf_tables(char * p,int argc,int envc,struct elfhdr * exe
/* This is much more generalized than the library routine read function,
so we keep this separate. Tech
in
cally the library read function
so we keep this separate. Tech
ni
cally the library read function
is only provided so that we can read a.out libraries that have
an ELF header */
...
...
include/asm/string.h
0 → 100644
View file @
a6686074
#ifndef _I386_STRING_H_
#define _I386_STRING_H_
/*
* This string-include defines all string functions as inline
* functions. Use gcc. It also assumes ds=es=data space, this should be
* normal. Most of the string-functions are rather heavily hand-optimized,
* see especially strtok,strstr,str[c]spn. They should work, but are not
* very easy to understand. Everything is done entirely within the register
* set, making the functions fast and clean. String instructions have been
* used through-out, making for "slightly" unclear code :-)
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
extern
inline
char
*
strcpy
(
char
*
dest
,
const
char
*
src
)
{
__asm__
__volatile__
(
"cld
\n
"
"1:
\t
lodsb
\n\t
"
"stosb
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b"
:
/* no output */
:
"S"
(
src
),
"D"
(
dest
)
:
"si"
,
"di"
,
"ax"
,
"memory"
);
return
dest
;
}
extern
inline
char
*
strncpy
(
char
*
dest
,
const
char
*
src
,
size_t
count
)
{
__asm__
__volatile__
(
"cld
\n
"
"1:
\t
decl %2
\n\t
"
"js 2f
\n\t
"
"lodsb
\n\t
"
"stosb
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b
\n\t
"
"rep
\n\t
"
"stosb
\n
"
"2:"
:
/* no output */
:
"S"
(
src
),
"D"
(
dest
),
"c"
(
count
)
:
"si"
,
"di"
,
"ax"
,
"cx"
,
"memory"
);
return
dest
;
}
extern
inline
char
*
strcat
(
char
*
dest
,
const
char
*
src
)
{
__asm__
__volatile__
(
"cld
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"decl %1
\n
"
"1:
\t
lodsb
\n\t
"
"stosb
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b"
:
/* no output */
:
"S"
(
src
),
"D"
(
dest
),
"a"
(
0
),
"c"
(
0xffffffff
)
:
"si"
,
"di"
,
"ax"
,
"cx"
);
return
dest
;
}
extern
inline
char
*
strncat
(
char
*
dest
,
const
char
*
src
,
size_t
count
)
{
__asm__
__volatile__
(
"cld
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"decl %1
\n\t
"
"movl %4,%3
\n
"
"1:
\t
decl %3
\n\t
"
"js 2f
\n\t
"
"lodsb
\n\t
"
"stosb
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b
\n
"
"2:
\t
xorl %2,%2
\n\t
"
"stosb"
:
/* no output */
:
"S"
(
src
),
"D"
(
dest
),
"a"
(
0
),
"c"
(
0xffffffff
),
"g"
(
count
)
:
"si"
,
"di"
,
"ax"
,
"cx"
,
"memory"
);
return
dest
;
}
extern
inline
int
strcmp
(
const
char
*
cs
,
const
char
*
ct
)
{
register
int
__res
;
__asm__
__volatile__
(
"cld
\n
"
"1:
\t
lodsb
\n\t
"
"scasb
\n\t
"
"jne 2f
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b
\n\t
"
"xorl %%eax,%%eax
\n\t
"
"jmp 3f
\n
"
"2:
\t
sbbl %%eax,%%eax
\n\t
"
"orb $1,%%eax
\n
"
"3:"
:
"=a"
(
__res
)
:
"S"
(
cs
),
"D"
(
ct
)
:
"si"
,
"di"
);
return
__res
;
}
extern
inline
int
strncmp
(
const
char
*
cs
,
const
char
*
ct
,
size_t
count
)
{
register
int
__res
;
__asm__
__volatile__
(
"cld
\n
"
"1:
\t
decl %3
\n\t
"
"js 2f
\n\t
"
"lodsb
\n\t
"
"scasb
\n\t
"
"jne 3f
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b
\n
"
"2:
\t
xorl %%eax,%%eax
\n\t
"
"jmp 4f
\n
"
"3:
\t
sbbl %%eax,%%eax
\n\t
"
"orb $1,%%al
\n
"
"4:"
:
"=a"
(
__res
)
:
"S"
(
cs
),
"D"
(
ct
),
"c"
(
count
)
:
"si"
,
"di"
,
"cx"
);
return
__res
;
}
extern
inline
char
*
strchr
(
const
char
*
s
,
char
c
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"movb %%al,%%ah
\n
"
"1:
\t
lodsb
\n\t
"
"cmpb %%ah,%%al
\n\t
"
"je 2f
\n\t
"
"testb %%al,%%al
\n\t
"
"jne 1b
\n\t
"
"movl $1,%1
\n
"
"2:
\t
movl %1,%0
\n\t
"
"decl %0"
:
"=a"
(
__res
)
:
"S"
(
s
),
"0"
(
c
)
:
"si"
);
return
__res
;
}
extern
inline
char
*
strrchr
(
const
char
*
s
,
char
c
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"movb %%al,%%ah
\n
"
"1:
\t
lodsb
\n\t
"
"cmpb %%ah,%%al
\n\t
"
"jne 2f
\n\t
"
"leal -1(%%esi),%0
\n
"
"2:
\t
testb %%al,%%al
\n\t
"
"jne 1b"
:
"=d"
(
__res
)
:
"0"
(
0
),
"S"
(
s
),
"a"
(
c
)
:
"ax"
,
"si"
);
return
__res
;
}
extern
inline
size_t
strspn
(
const
char
*
cs
,
const
char
*
ct
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"movl %4,%%edi
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"notl %%ecx
\n\t
"
"decl %%ecx
\n\t
"
"movl %%ecx,%%edx
\n
"
"1:
\t
lodsb
\n\t
"
"testb %%al,%%al
\n\t
"
"je 2f
\n\t
"
"movl %4,%%edi
\n\t
"
"movl %%edx,%%ecx
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"je 1b
\n
"
"2:
\t
decl %0"
:
"=S"
(
__res
)
:
"a"
(
0
),
"c"
(
0xffffffff
),
"0"
(
cs
),
"g"
(
ct
)
:
"ax"
,
"cx"
,
"dx"
,
"di"
);
return
__res
-
cs
;
}
extern
inline
size_t
strcspn
(
const
char
*
cs
,
const
char
*
ct
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"movl %4,%%edi
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"notl %%ecx
\n\t
"
"decl %%ecx
\n\t
"
"movl %%ecx,%%edx
\n
"
"1:
\t
lodsb
\n\t
"
"testb %%al,%%al
\n\t
"
"je 2f
\n\t
"
"movl %4,%%edi
\n\t
"
"movl %%edx,%%ecx
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"jne 1b
\n
"
"2:
\t
decl %0"
:
"=S"
(
__res
)
:
"a"
(
0
),
"c"
(
0xffffffff
),
"0"
(
cs
),
"g"
(
ct
)
:
"ax"
,
"cx"
,
"dx"
,
"di"
);
return
__res
-
cs
;
}
extern
inline
char
*
strpbrk
(
const
char
*
cs
,
const
char
*
ct
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"movl %4,%%edi
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"notl %%ecx
\n\t
"
"decl %%ecx
\n\t
"
"movl %%ecx,%%edx
\n
"
"1:
\t
lodsb
\n\t
"
"testb %%al,%%al
\n\t
"
"je 2f
\n\t
"
"movl %4,%%edi
\n\t
"
"movl %%edx,%%ecx
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"jne 1b
\n\t
"
"decl %0
\n\t
"
"jmp 3f
\n
"
"2:
\t
xorl %0,%0
\n
"
"3:"
:
"=S"
(
__res
)
:
"a"
(
0
),
"c"
(
0xffffffff
),
"0"
(
cs
),
"g"
(
ct
)
:
"ax"
,
"cx"
,
"dx"
,
"di"
);
return
__res
;
}
extern
inline
char
*
strstr
(
const
char
*
cs
,
const
char
*
ct
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
\
"movl %4,%%edi
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"notl %%ecx
\n\t
"
"decl %%ecx
\n\t
"
/* NOTE! This also sets Z if searchstring='' */
"movl %%ecx,%%edx
\n
"
"1:
\t
movl %4,%%edi
\n\t
"
"movl %%esi,%%eax
\n\t
"
"movl %%edx,%%ecx
\n\t
"
"repe
\n\t
"
"cmpsb
\n\t
"
"je 2f
\n\t
"
/* also works for empty string, see above */
"xchgl %%eax,%%esi
\n\t
"
"incl %%esi
\n\t
"
"cmpb $0,-1(%%eax)
\n\t
"
"jne 1b
\n\t
"
"xorl %%eax,%%eax
\n\t
"
"2:"
:
"=a"
(
__res
)
:
"0"
(
0
),
"c"
(
0xffffffff
),
"S"
(
cs
),
"g"
(
ct
)
:
"cx"
,
"dx"
,
"di"
,
"si"
);
return
__res
;
}
extern
inline
size_t
strlen
(
const
char
*
s
)
{
register
int
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"notl %0
\n\t
"
"decl %0"
:
"=c"
(
__res
)
:
"D"
(
s
),
"a"
(
0
),
"0"
(
0xffffffff
)
:
"di"
);
return
__res
;
}
extern
char
*
___strtok
;
extern
inline
char
*
strtok
(
char
*
s
,
const
char
*
ct
)
{
register
char
*
__res
;
__asm__
__volatile__
(
"testl %1,%1
\n\t
"
"jne 1f
\n\t
"
"testl %0,%0
\n\t
"
"je 8f
\n\t
"
"movl %0,%1
\n
"
"1:
\t
xorl %0,%0
\n\t
"
"movl $-1,%%ecx
\n\t
"
"xorl %%eax,%%eax
\n\t
"
"cld
\n\t
"
"movl %4,%%edi
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"notl %%ecx
\n\t
"
"decl %%ecx
\n\t
"
"je 7f
\n\t
"
/* empty delimeter-string */
"movl %%ecx,%%edx
\n
"
"2:
\t
lodsb
\n\t
"
"testb %%al,%%al
\n\t
"
"je 7f
\n\t
"
"movl %4,%%edi
\n\t
"
"movl %%edx,%%ecx
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"je 2b
\n\t
"
"decl %1
\n\t
"
"cmpb $0,(%1)
\n\t
"
"je 7f
\n\t
"
"movl %1,%0
\n
"
"3:
\t
lodsb
\n\t
"
"testb %%al,%%al
\n\t
"
"je 5f
\n\t
"
"movl %4,%%edi
\n\t
"
"movl %%edx,%%ecx
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"jne 3b
\n\t
"
"decl %1
\n\t
"
"cmpb $0,(%1)
\n\t
"
"je 5f
\n\t
"
"movb $0,(%1)
\n\t
"
"incl %1
\n\t
"
"jmp 6f
\n
"
"5:
\t
xorl %1,%1
\n
"
"6:
\t
cmpb $0,(%0)
\n\t
"
"jne 7f
\n\t
"
"xorl %0,%0
\n
"
"7:
\t
testl %0,%0
\n\t
"
"jne 8f
\n\t
"
"movl %0,%1
\n
"
"8:"
:
"=b"
(
__res
),
"=S"
(
___strtok
)
:
"0"
(
___strtok
),
"1"
(
s
),
"g"
(
ct
)
:
"ax"
,
"cx"
,
"dx"
,
"di"
,
"memory"
);
return
__res
;
}
extern
inline
void
*
memcpy
(
void
*
to
,
const
void
*
from
,
size_t
n
)
{
__asm__
__volatile__
(
"cld
\n\t
"
"movl %%edx, %%ecx
\n\t
"
"shrl $2,%%ecx
\n\t
"
"rep ; movsl
\n\t
"
"testb $1,%%dl
\n\t
"
"je 1f
\n\t
"
"movsb
\n
"
"1:
\t
testb $2,%%dl
\n\t
"
"je 2f
\n\t
"
"movsw
\n
"
"2:
\n
"
:
/* no output */
:
"d"
(
n
),
"D"
((
long
)
to
),
"S"
((
long
)
from
)
:
"cx"
,
"di"
,
"si"
,
"memory"
);
return
(
to
);
}
extern
inline
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
size_t
n
)
{
if
(
dest
<
src
)
__asm__
__volatile__
(
"cld
\n\t
"
"rep
\n\t
"
"movsb"
:
/* no output */
:
"c"
(
n
),
"S"
(
src
),
"D"
(
dest
)
:
"cx"
,
"si"
,
"di"
);
else
__asm__
__volatile__
(
"std
\n\t
"
"rep
\n\t
"
"movsb
\n\t
"
"cld"
:
/* no output */
:
"c"
(
n
),
"S"
(
n
-
1
+
(
const
char
*
)
src
),
"D"
(
n
-
1
+
(
char
*
)
dest
)
:
"cx"
,
"si"
,
"di"
,
"memory"
);
return
dest
;
}
extern
inline
int
memcmp
(
const
void
*
cs
,
const
void
*
ct
,
size_t
count
)
{
register
int
__res
;
__asm__
__volatile__
(
"cld
\n\t
"
"repe
\n\t
"
"cmpsb
\n\t
"
"je 1f
\n\t
"
"sbbl %%eax,%%eax
\n\t
"
"orb $1,%%al
\n
"
"1:"
:
"=a"
(
__res
)
:
"0"
(
0
),
"S"
(
cs
),
"D"
(
ct
),
"c"
(
count
)
:
"si"
,
"di"
,
"cx"
);
return
__res
;
}
extern
inline
void
*
memchr
(
const
void
*
cs
,
char
c
,
size_t
count
)
{
register
void
*
__res
;
if
(
!
count
)
return
NULL
;
__asm__
__volatile__
(
"cld
\n\t
"
"repne
\n\t
"
"scasb
\n\t
"
"je 1f
\n\t
"
"movl $1,%0
\n
"
"1:
\t
decl %0"
:
"=D"
(
__res
)
:
"a"
(
c
),
"D"
(
cs
),
"c"
(
count
)
:
"cx"
);
return
__res
;
}
extern
inline
void
*
memset
(
void
*
s
,
char
c
,
size_t
count
)
{
__asm__
__volatile__
(
"cld
\n\t
"
"rep
\n\t
"
"stosb"
:
/* no output */
:
"a"
(
c
),
"D"
(
s
),
"c"
(
count
)
:
"cx"
,
"di"
,
"memory"
);
return
s
;
}
#endif
include/linux/bios32.h
View file @
a6686074
...
...
@@ -22,7 +22,7 @@
#ifndef BIOS32_H
#define BIOS32_H
long
bios32_init
(
long
memory_start
,
long
memory_end
);
unsigned
long
bios32_init
(
unsigned
long
memory_start
,
unsigned
long
memory_end
);
extern
int
pcibios_find_class
(
unsigned
long
class_code
,
unsigned
short
index
,
unsigned
char
*
bus
,
unsigned
char
*
device_fn
);
...
...
@@ -41,4 +41,5 @@ extern int pcibios_write_config_word (unsigned char bus,
unsigned
char
device_fn
,
unsigned
char
where
,
unsigned
short
value
);
extern
pcibios_write_config_dword
(
unsigned
char
bus
,
unsigned
char
device_fn
,
unsigned
char
where
,
unsigned
long
value
);
#endif
/* ndef BIOS32_H */
include/linux/string.h
View file @
a6686074
...
...
@@ -11,7 +11,7 @@
extern
"C"
{
#endif
#include <
i386/string.h>
/* inline functions for i386.. */
#include <
asm/string.h>
/* inline functions for i386.. */
extern
char
*
strcpy
(
char
*
,
const
char
*
);
extern
char
*
strncpy
(
char
*
,
const
char
*
,
size_t
);
...
...
include/linux/timex.h
View file @
a6686074
...
...
@@ -117,7 +117,6 @@ struct timex {
*/
extern
long
tick
;
/* timer interrupt period */
extern
int
tickadj
;
/* amount of adjustment per tick */
extern
volatile
struct
timeval
xtime
;
/* The current time */
/*
* phase-lock loop variables
...
...
init/main.c
View file @
a6686074
...
...
@@ -71,7 +71,8 @@ extern char empty_zero_page[PAGE_SIZE];
extern
void
init
(
void
);
extern
void
init_IRQ
(
void
);
extern
void
init_modules
(
void
);
extern
long
kmalloc_init
(
long
,
long
);
extern
long
console_init
(
long
,
long
);
extern
long
kmalloc_init
(
long
,
long
);
extern
long
blk_dev_init
(
long
,
long
);
extern
long
chr_dev_init
(
long
,
long
);
extern
void
floppy_init
(
void
);
...
...
@@ -228,7 +229,7 @@ void ramdisk_setup(char *str, int *ints)
ramdisk_size
=
ints
[
1
];
}
int
checksetup
(
char
*
line
)
static
int
checksetup
(
char
*
line
)
{
int
i
=
0
;
int
ints
[
11
];
...
...
@@ -237,11 +238,11 @@ int checksetup(char *line)
int
n
=
strlen
(
bootsetups
[
i
].
str
);
if
(
!
strncmp
(
line
,
bootsetups
[
i
].
str
,
n
))
{
bootsetups
[
i
].
setup_func
(
get_options
(
line
+
n
,
ints
),
ints
);
return
(
0
)
;
return
1
;
}
i
++
;
}
return
(
1
)
;
return
0
;
}
unsigned
long
loops_per_sec
=
1
;
...
...
@@ -316,21 +317,33 @@ static void parse_options(char *line)
break
;
}
}
}
else
if
(
!
strcmp
(
line
,
"ro"
))
continue
;
}
if
(
!
strcmp
(
line
,
"ro"
))
{
root_mountflags
|=
MS_RDONLY
;
else
if
(
!
strcmp
(
line
,
"rw"
))
continue
;
}
if
(
!
strcmp
(
line
,
"rw"
))
{
root_mountflags
&=
~
MS_RDONLY
;
else
if
(
!
strcmp
(
line
,
"debug"
))
continue
;
}
if
(
!
strcmp
(
line
,
"debug"
))
{
console_loglevel
=
10
;
else
if
(
!
strcmp
(
line
,
"no-hlt"
))
continue
;
}
if
(
!
strcmp
(
line
,
"no-hlt"
))
{
hlt_works_ok
=
0
;
else
if
(
!
strcmp
(
line
,
"no387"
))
{
continue
;
}
if
(
!
strcmp
(
line
,
"no387"
))
{
hard_math
=
0
;
__asm__
(
"movl %%cr0,%%eax
\n\t
"
"orl $0xE,%%eax
\n\t
"
"movl %%eax,%%cr0
\n\t
"
:
:
:
"ax"
);
}
else
checksetup
(
line
);
continue
;
}
if
(
checksetup
(
line
))
continue
;
/*
* Then check if it's an environment variable or
* an option.
...
...
@@ -421,17 +434,13 @@ asmlinkage void start_kernel(void)
prof_len
>>=
2
;
memory_start
+=
prof_len
*
sizeof
(
unsigned
long
);
#endif
memory_start
=
console_init
(
memory_start
,
memory_end
);
memory_start
=
bios32_init
(
memory_start
,
memory_end
);
memory_start
=
kmalloc_init
(
memory_start
,
memory_end
);
memory_start
=
chr_dev_init
(
memory_start
,
memory_end
);
memory_start
=
blk_dev_init
(
memory_start
,
memory_end
);
sti
();
calibrate_delay
();
if
(
hlt_works_ok
)
{
printk
(
"Checking 'hlt' ..."
);
__asm__
__volatile__
(
"hlt"
);
printk
(
" ok
\n
"
);
}
#ifdef CONFIG_INET
memory_start
=
net_dev_init
(
memory_start
,
memory_end
);
#endif
...
...
@@ -477,6 +486,11 @@ asmlinkage void start_kernel(void)
printk
(
"Ok, fpu using %s error reporting.
\n
"
,
ignore_irq13
?
"exception 16"
:
"irq13"
);
}
if
(
hlt_works_ok
)
{
printk
(
"Checking 'hlt' instruction... "
);
__asm__
__volatile__
(
"hlt ; hlt ; hlt ; hlt"
);
printk
(
" Ok.
\n
"
);
}
#ifndef CONFIG_MATH_EMULATION
else
{
printk
(
"No coprocessor found and no math emulation present.
\n
"
);
...
...
ipc/shm.c
View file @
a6686074
...
...
@@ -389,7 +389,7 @@ static struct vm_operations_struct shm_vm_ops = {
/*
* This is really minimal support to make the shared mem stuff
*
v
e known by the general VM manager. It should add the vm_ops
*
b
e known by the general VM manager. It should add the vm_ops
* field so that 'munmap()' and friends work correctly on shared
* memory areas..
*/
...
...
@@ -636,7 +636,7 @@ static unsigned long shm_swap_in(struct vm_area_struct * vma, unsigned long code
id
=
(
code
>>
SHM_ID_SHIFT
)
&
SHM_ID_MASK
;
if
(
id
>
max_shmid
)
{
printk
(
"shm_no_page: id=%d too big. proc mem corruptedn"
,
id
);
printk
(
"shm_no_page: id=%d too big. proc mem corrupted
\
n
"
,
id
);
return
BAD_PAGE
|
PAGE_SHARED
;
}
shp
=
shm_segs
[
id
];
...
...
kernel/bios32.c
View file @
a6686074
This diff is collapsed.
Click to expand it.
kernel/exec_domain.c
View file @
a6686074
...
...
@@ -17,7 +17,7 @@ struct exec_domain default_exec_domain = {
"Linux"
,
/* name */
no_lcall7
,
/* lcall7 causes a seg fault. */
0
,
0xff
,
/* All personalities. */
ident_map
,
/* Identiy map signals. */
ident_map
,
/* Identi
f
y map signals. */
ident_map
,
/* - both ways. */
NULL
,
/* No usage counter. */
NULL
/* Nothing after this in the list. */
...
...
kernel/exit.c
View file @
a6686074
...
...
@@ -121,7 +121,7 @@ int bad_task_ptr(struct task_struct *p)
}
/*
* This routine scans the pid tree and make
sure the rep invarie
nt still
* This routine scans the pid tree and make
s sure the rep invaria
nt still
* holds. Used for debugging only, since it's very slow....
*
* It looks a lot scarier than it really is.... we're doing nothing more
...
...
@@ -198,7 +198,7 @@ void audit_ptree(void)
/*
* This checks not only the pgrp, but falls back on the pid if no
* satisfactory p
rg
p is found. I dunno - gdb doesn't work correctly
* satisfactory p
gr
p is found. I dunno - gdb doesn't work correctly
* without this...
*/
int
session_of_pgrp
(
int
pgrp
)
...
...
kernel/irq.c
View file @
a6686074
...
...
@@ -295,7 +295,7 @@ void free_irq(unsigned int irq)
/*
* Note that on a 486, we don't want to do a SIGFPE on a irq13
* as the irq is unreliable, and exception 16 works correctly
* (ie as explained in the intel lit
t
erature). On a 386, you
* (ie as explained in the intel literature). On a 386, you
* can't use exception 16 due to bad IBM design, so we have to
* rely on the less exact irq13.
*
...
...
@@ -331,7 +331,7 @@ void init_IRQ(void)
if
(
request_irq
(
13
,
math_error_irq
))
printk
(
"Unable to get IRQ13 for math-error handler
\n
"
);
/* intialize the bottom half routines. */
/* in
i
tialize the bottom half routines. */
for
(
i
=
0
;
i
<
32
;
i
++
)
{
bh_base
[
i
].
routine
=
NULL
;
bh_base
[
i
].
data
=
NULL
;
...
...
kernel/ksyms.c
View file @
a6686074
...
...
@@ -51,7 +51,6 @@ extern void (* iABI_hook)(struct pt_regs * regs);
#ifdef CONFIG_INET
extern
void
snarf_region
(
unsigned
int
,
unsigned
int
);
extern
void
dev_tint
(
struct
device
*
);
extern
struct
device
*
irq2dev_map
[];
#endif
...
...
@@ -188,7 +187,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
*/
{
NULL
,
NULL
}
/* mark end of table */
},
{
NULL
,
NULL
}
/* no module refs */
{
{
NULL
,
NULL
}
/* no module refs */
}
};
/*
...
...
kernel/module.c
View file @
a6686074
...
...
@@ -11,7 +11,7 @@
* This source is covered by the GNU GPL, the same as all kernel sources.
*
* Features:
* - Supports stacked modules (remov
eable only of there are no dependa
nts).
* - Supports stacked modules (remov
able only of there are no depende
nts).
* - Supports table of symbols defined by the modules.
* - Supports /proc/ksyms, showing value, name and owner of all
* the symbols defined by all modules (in stack order).
...
...
@@ -292,7 +292,7 @@ sys_delete_module(char *module_name)
* (as that format is quite handy for the kernel...)
*
* For every module, the first (pseudo)symbol copied is the module name
* and the adress of the module struct.
* and the ad
d
ress of the module struct.
* This lets "insmod" keep track of references, and build the array of
* struct module_refs in the symbol table.
* The format of the module name is "#module", so that "insmod" can easily
...
...
kernel/panic.c
View file @
a6686074
...
...
@@ -5,7 +5,7 @@
*/
/*
* This function is used through-out the kernel (includ
einh
mm and fs)
* This function is used through-out the kernel (includ
ing
mm and fs)
* to indicate a major problem.
*/
#include <stdarg.h>
...
...
kernel/ptrace.c
View file @
a6686074
...
...
@@ -45,9 +45,9 @@ static inline struct task_struct * get_task(int pid)
}
/*
* this routine will get a word off of the processes privile
d
ged stack.
* this routine will get a word off of the processes privileged stack.
* the offset is how far from the base addr as stored in the TSS.
* this routine assumes that all the privile
d
ged stacks are in our
* this routine assumes that all the privileged stacks are in our
* data space.
*/
static
inline
int
get_stack_long
(
struct
task_struct
*
task
,
int
offset
)
...
...
@@ -60,9 +60,9 @@ static inline int get_stack_long(struct task_struct *task, int offset)
}
/*
* this routine will put a word on the processes privile
d
ged stack.
* this routine will put a word on the processes privileged stack.
* the offset is how far from the base addr as stored in the TSS.
* this routine assumes that all the privile
d
ged stacks are in our
* this routine assumes that all the privileged stacks are in our
* data space.
*/
static
inline
int
put_stack_long
(
struct
task_struct
*
task
,
int
offset
,
...
...
@@ -280,7 +280,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
/* are we already being traced? */
if
(
current
->
flags
&
PF_PTRACED
)
return
-
EPERM
;
/* set the ptrace bit in the proc
c
ess flags. */
/* set the ptrace bit in the process flags. */
current
->
flags
|=
PF_PTRACED
;
return
0
;
}
...
...
@@ -319,7 +319,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
return
-
ESRCH
;
switch
(
request
)
{
/* when I and D space are sep
e
rate, these will need to be fixed. */
/* when I and D space are sep
a
rate, these will need to be fixed. */
case
PTRACE_PEEKTEXT
:
/* read word at location addr. */
case
PTRACE_PEEKDATA
:
{
unsigned
long
tmp
;
...
...
@@ -366,7 +366,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
return
0
;
}
/* when I and D space are sep
e
rate, this will have to be fixed. */
/* when I and D space are sep
a
rate, this will have to be fixed. */
case
PTRACE_POKETEXT
:
/* write the word at location addr. */
case
PTRACE_POKEDATA
:
return
write_long
(
child
,
addr
,
data
);
...
...
@@ -376,7 +376,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
addr
>
sizeof
(
struct
user
)
-
3
)
return
-
EIO
;
addr
=
addr
>>
2
;
/* temp
ro
ary hack. */
addr
=
addr
>>
2
;
/* temp
or
ary hack. */
if
(
addr
==
ORIG_EAX
)
return
-
EIO
;
...
...
kernel/sched.c
View file @
a6686074
...
...
@@ -161,7 +161,7 @@ unsigned long itimer_next = ~0;
* information in task[0] is never used.
*
* The "confuse_gcc" goto is used only to get better assembly code..
* D
ji
kstra probably hates me.
* D
ij
kstra probably hates me.
*/
asmlinkage
void
schedule
(
void
)
{
...
...
kernel/splx.c
View file @
a6686074
...
...
@@ -2,7 +2,7 @@
* splx.c - SYSV DDI/DKI ipl manipulation functions
*
* Internally, many unices use a range of different interrupt
* priv
eled
ge levels, ie from "allow all interrupts" (7) to
* priv
ile
ge levels, ie from "allow all interrupts" (7) to
* "allow no interrupts." (0) under SYSV.
*
* This a simple splx() function behaves as the SYSV DDI/DKI function does,
...
...
@@ -10,7 +10,7 @@
* level 7 (sti), this implementation only implements those levels.
*
* Also, unlike the current Linux routines, splx() also returns the
* old priv
eled
ge level so that it can be restored.
* old priv
ile
ge level so that it can be restored.
*/
#include <asm/system.h>
...
...
kernel/sys.c
View file @
a6686074
...
...
@@ -22,7 +22,7 @@
#include <asm/io.h>
/*
* this indicates wether you can reboot with ctrl-alt-del: the default is yes
* this indicates w
h
ether you can reboot with ctrl-alt-del: the default is yes
*/
static
int
C_A_D
=
1
;
...
...
@@ -181,7 +181,7 @@ asmlinkage int sys_reboot(int magic, int magic_too, int flag)
/*
* This function gets called by ctrl-alt-del - ie the keyboard interrupt.
* As it's called within an interrupt, it may NOT sync: the only choice
* is wether to reboot at once, or just ignore the ctrl-alt-del.
* is w
h
ether to reboot at once, or just ignore the ctrl-alt-del.
*/
void
ctrl_alt_del
(
void
)
{
...
...
@@ -237,7 +237,7 @@ asmlinkage int sys_setregid(gid_t rgid, gid_t egid)
}
/*
* setgid() is implemen
e
ted like SysV w/ SAVED_IDS
* setgid() is implemented like SysV w/ SAVED_IDS
*/
asmlinkage
int
sys_setgid
(
gid_t
gid
)
{
...
...
@@ -325,13 +325,13 @@ asmlinkage int sys_setreuid(uid_t ruid, uid_t euid)
}
/*
* setuid() is implemen
e
ted like SysV w/ SAVED_IDS
* setuid() is implemented like SysV w/ SAVED_IDS
*
* Note that SAVED_ID's is deficient in that a setuid root program
* like sendmail, for example, cannot set its uid to be a normal
* user and then switch back, because if you're root, setuid() sets
* the saved uid too. If you don't like this, blame the bright people
* in the POSIX comm
m
ittee and/or USG. Note that the BSD-style setreuid()
* in the POSIX committee and/or USG. Note that the BSD-style setreuid()
* will allow a root program to temporarily drop privileges and be able to
* regain them by swapping the real and effective uid.
*/
...
...
@@ -681,7 +681,7 @@ asmlinkage int sys_setrlimit(unsigned int resource, struct rlimit *rlim)
}
/*
* It would make sense to put struct rus
u
age in the task_struct,
* It would make sense to put struct rusage in the task_struct,
* except that would make the task_struct be *really big*. After
* task_struct gets moved into malloc'ed memory, it would
* make sense to do this. It will make moving the rest of the information
...
...
kernel/sys_call.S
View file @
a6686074
...
...
@@ -205,10 +205,10 @@ _system_call:
ret_from_sys_call
:
cmpl
$
0
,
_intr_count
jne
2
f
movl
_bh_mask
,%
eax
9
:
movl
_bh_mask
,%
eax
andl
_bh_active
,%
eax
jne
handle_bottom_half
9
:
movl
EFLAGS
(%
esp
),%
eax
#
check
VM86
flag
:
CS
/
SS
are
movl
EFLAGS
(%
esp
),%
eax
#
check
VM86
flag
:
CS
/
SS
are
testl
$
(
VM_MASK
),%
eax
#
different
then
jne
1
f
cmpw
$
(
KERNEL_CS
),
CS
(%
esp
)
#
was
old
code
segment
supervisor
?
...
...
kernel/time.c
View file @
a6686074
...
...
@@ -32,7 +32,6 @@
#define RTC_ALWAYS_BCD 1
#include <linux/timex.h>
extern
struct
timeval
xtime
;
/* converts date to days since 1/1/1970
* assumes year,mon,day in normal date format
...
...
kernel/traps.c
View file @
a6686074
...
...
@@ -188,7 +188,7 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
* which were in force when the exception condition arose.
*
* Note that we play around with the 'TS' bit to hopefully get
* the correct behaviour even in the presen
s
e of the asynchronous
* the correct behaviour even in the presen
c
e of the asynchronous
* IRQ13 behaviour
*/
void
math_error
(
void
)
...
...
mm/kmalloc.c
View file @
a6686074
...
...
@@ -255,7 +255,7 @@ while (tries --)
printk ("%d blocks per page\n",page->nfree);
#endif
/* Now we're going to muck with the "global" freelist for this size:
this should be uniterruptible */
this should be uni
n
terruptible */
cli
();
/*
* sizes[order].firstfree used to be NULL, otherwise we wouldn't be
...
...
mm/mmap.c
View file @
a6686074
...
...
@@ -430,7 +430,7 @@ void merge_segments(struct vm_area_struct *mpnt)
/*
* Map memory not associated with any file into a process
* address space. Adj
e
cent memory is merged.
* address space. Adj
a
cent memory is merged.
*/
static
int
anon_map
(
struct
inode
*
ino
,
struct
file
*
file
,
struct
vm_area_struct
*
vma
)
{
...
...
mm/swap.c
View file @
a6686074
...
...
@@ -102,11 +102,6 @@ static unsigned long init_swap_cache(unsigned long mem_start,
swap_cache
=
(
unsigned
long
*
)
mem_start
;
swap_cache_size
=
mem_end
>>
PAGE_SHIFT
;
memset
(
swap_cache
,
0
,
swap_cache_size
*
sizeof
(
unsigned
long
));
#ifdef SWAP_CACHE_INFO
printk
(
"%ld bytes for swap cache allocated
\n
"
,
swap_cache_size
*
sizeof
(
unsigned
long
));
#endif
return
(
unsigned
long
)
(
swap_cache
+
swap_cache_size
);
}
...
...
@@ -153,8 +148,8 @@ void rw_swap_page(int rw, unsigned long entry, char * buf)
It sounds like ll_rw_swap_file defined
it operation size (sector size) based on
PAGE_SIZE and the number of block to read.
So using bmap o
u
smap should work even if
smap will requi
ered
more blocks.
So using bmap o
r
smap should work even if
smap will requi
re
more blocks.
*/
int
j
;
unsigned
int
block
=
offset
<<
3
;
...
...
@@ -355,7 +350,7 @@ static inline int try_to_swap_out(unsigned long * table_ptr)
*/
/*
* These are the mi
min
um and maximum number of pages to swap from one process,
* These are the mi
nim
um and maximum number of pages to swap from one process,
* before proceeding to the next:
*/
#define SWAP_MIN 4
...
...
@@ -575,7 +570,7 @@ void free_pages(unsigned long addr, unsigned long order)
}
return
;
}
printk
(
"Trying to free free memory (%08lx): memory probab
ab
ly corrupted
\n
"
,
addr
);
printk
(
"Trying to free free memory (%08lx): memory probably corrupted
\n
"
,
addr
);
printk
(
"PC = %08lx
\n
"
,
*
(((
unsigned
long
*
)
&
addr
)
-
1
));
return
;
}
...
...
net/inet/ipx.c
View file @
a6686074
...
...
@@ -465,7 +465,7 @@ int ipx_rt_get_info(char *buffer, char **start, off_t offset, int length)
static
int
ipx_fcntl
(
struct
socket
*
sock
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
ipx_socket
*
sk
=
(
ipx_socket
*
)
sock
->
data
;
/* ipx_socket *sk=(ipx_socket *)sock->data; */
switch
(
cmd
)
{
default:
...
...
net/inet/tcp.c
View file @
a6686074
...
...
@@ -128,7 +128,7 @@
* shutdown. There may still be data in our
* buffer that we have to finish sending
*
* TCP_CLOSE
D
socket is finished
* TCP_CLOSE socket is finished
*/
#include <linux/types.h>
#include <linux/sched.h>
...
...
@@ -798,10 +798,11 @@ static void tcp_send_ack(unsigned long sequence, unsigned long ack,
if
(
sk
->
send_head
==
NULL
&&
skb_peek
(
&
sk
->
write_queue
)
==
NULL
&&
sk
->
timeout
==
TIME_WRITE
)
{
if
(
sk
->
keepopen
)
if
(
sk
->
keepopen
)
{
reset_timer
(
sk
,
TIME_KEEPOPEN
,
TCP_TIMEOUT_LEN
);
else
}
else
{
delete_timer
(
sk
);
}
}
}
t1
->
ack_seq
=
ntohl
(
ack
);
...
...
@@ -1672,8 +1673,8 @@ void tcp_shutdown(struct sock *sk, int how)
tcp_send_check
(
t1
,
sk
->
saddr
,
sk
->
daddr
,
sizeof
(
*
t1
),
sk
);
/*
*
Can't just queue this up.
*
It should go at the end of
the write queue.
*
If there is data in the write queue, the fin must be appended to
* the write queue.
*/
if
(
skb_peek
(
&
sk
->
write_queue
)
!=
NULL
)
...
...
@@ -2514,6 +2515,12 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int
{
if
(
sk
->
debug
)
printk
(
"Ack ignored %lu %lu
\n
"
,
ack
,
sk
->
sent_seq
);
/*
* What is all this crap? the ack sequence number is bad or
* old, we should return 0 to ignore the packet. XXX
*/
return
(
0
);
#ifdef NOTDEF
if
(
after
(
ack
,
sk
->
sent_seq
)
||
(
sk
->
state
!=
TCP_ESTABLISHED
&&
sk
->
state
!=
TCP_CLOSE_WAIT
))
{
...
...
@@ -2524,6 +2531,7 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int
reset_timer
(
sk
,
TIME_KEEPOPEN
,
TCP_TIMEOUT_LEN
);
}
return
(
1
);
#endif
}
if
(
len
!=
th
->
doff
*
4
)
...
...
@@ -2785,6 +2793,15 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int
}
}
/*
* XXX someone ought to look at this too.. at the moment, if skb_peek()
* returns non-NULL, we complete ignore the timer stuff in the else
* clause. We ought to organize the code so that else clause can
* (should) be executed regardless, possibly moving the PROBE timer
* reset over. The skb_peek() thing should only move stuff to the
* write queue, NOT also manage the timer functions.
*/
/*
* Maybe we can take some stuff off of the write queue,
* and put it onto the xmit queue.
...
...
@@ -2810,15 +2827,57 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int
}
else
{
/*
* from TIME_WAIT we stay in TIME_WAIT as long as we rx packets
* from TCP_CLOSE we don't do anything
*
* from anything else, if there is write data (or fin) pending,
* we use a TIME_WRITE timeout, else if keepalive we reset to
* a KEEPALIVE timeout, else we delete the timer.
*
* We do not set flag for nominal write data, otherwise we may
* force a state where we start to write itsy bitsy tidbits
* of data.
*/
switch
(
sk
->
state
)
{
case
TCP_TIME_WAIT
:
/*
* keep us in TIME_WAIT until we stop getting packets,
* reset the timeout.
*/
reset_timer
(
sk
,
TIME_CLOSE
,
TCP_TIMEWAIT_LEN
);
break
;
case
TCP_CLOSE
:
/*
* don't touch the timer.
*/
break
;
default:
/*
* must check send_head, write_queue, and ack_backlog
* to determine which timeout to use.
*/
if
(
sk
->
send_head
||
skb_peek
(
&
sk
->
write_queue
)
!=
NULL
||
sk
->
ack_backlog
)
{
reset_timer
(
sk
,
TIME_WRITE
,
sk
->
rto
);
}
else
if
(
sk
->
keepopen
)
{
reset_timer
(
sk
,
TIME_KEEPOPEN
,
TCP_TIMEOUT_LEN
);
}
else
{
delete_timer
(
sk
);
}
break
;
}
#ifdef NOTDEF
if
(
sk
->
send_head
==
NULL
&&
sk
->
ack_backlog
==
0
&&
sk
->
state
!=
TCP_TIME_WAIT
&&
!
sk
->
keepopen
)
{
if
(
!
sk
->
dead
)
sk
->
write_space
(
sk
);
if
(
sk
->
keepopen
)
if
(
sk
->
keepopen
)
{
reset_timer
(
sk
,
TIME_KEEPOPEN
,
TCP_TIMEOUT_LEN
);
else
}
else
{
delete_timer
(
sk
);
}
}
else
{
...
...
@@ -2831,6 +2890,7 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, unsigned long saddr, int
reset_timer
(
sk
,
TIME_CLOSE
,
TCP_TIMEWAIT_LEN
);
}
}
#endif
}
if
(
sk
->
packets_out
==
0
&&
sk
->
partial
!=
NULL
&&
...
...
@@ -3302,7 +3362,7 @@ static inline int tcp_urg(struct sock *sk, struct tcphdr *th,
* This deals with incoming fins. 'Linus at 9 O'clock' 8-)
*
* If we are ESTABLISHED, a received fin moves us to CLOSE-WAIT
* (and thence onto LAST-ACK and finally, CLOSE
D
, we never enter
* (and thence onto LAST-ACK and finally, CLOSE, we never enter
* TIME-WAIT)
*
* If we are in FINWAIT-1, a received FIN indicates simultanious
...
...
@@ -3362,6 +3422,7 @@ static int tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th,
* XXX timeout not set properly
*/
tcp_statistics
.
TcpCurrEstab
--
;
reset_timer
(
sk
,
TIME_CLOSE
,
TCP_TIMEWAIT_LEN
);
/*sk->fin_seq = th->seq+1;*/
sk
->
state
=
TCP_CLOSING
;
...
...
net/inet/timer.c
View file @
a6686074
...
...
@@ -86,7 +86,10 @@ void net_timer (unsigned long data)
{
struct
sock
*
sk
=
(
struct
sock
*
)
data
;
int
why
=
sk
->
timeout
;
/* timeout is overwritten by 'delete_timer' and 'reset_timer' */
/*
* only process if socket is not in use
*/
cli
();
if
(
sk
->
inuse
||
in_bh
)
...
...
@@ -100,6 +103,13 @@ void net_timer (unsigned long data)
sk
->
inuse
=
1
;
sti
();
#ifdef NOTDEF
/*
* what the hell is this doing here? this belongs in tcp.c.
* I believe that this code is the cause of a lot of timer
* screwups, especially during close (like FIN_WAIT1 states
* with a KEEPOPEN timeout rather then a WRITE timeout).
*/
if
(
skb_peek
(
&
sk
->
write_queue
)
&&
before
(
sk
->
window_seq
,
sk
->
write_queue
.
next
->
h
.
seq
)
&&
sk
->
send_head
==
NULL
&&
...
...
@@ -108,6 +118,7 @@ void net_timer (unsigned long data)
reset_timer
(
sk
,
TIME_PROBE0
,
sk
->
rto
);
else
if
(
sk
->
keepopen
)
reset_timer
(
sk
,
TIME_KEEPOPEN
,
TCP_TIMEOUT_LEN
);
#endif
/* Always see if we need to send an ack. */
...
...
@@ -216,7 +227,13 @@ void net_timer (unsigned long data)
break
;
}
case
TIME_KEEPOPEN
:
/* Send something to keep the connection open. */
/*
* this reset_timer() call is a hack, this is not
* how KEEPOPEN is supposed to work.
*/
reset_timer
(
sk
,
TIME_KEEPOPEN
,
TCP_TIMEOUT_LEN
);
/* Send something to keep the connection open. */
if
(
sk
->
prot
->
write_wakeup
)
sk
->
prot
->
write_wakeup
(
sk
);
sk
->
retransmits
++
;
...
...
net/protocols.c
View file @
a6686074
/*
* Protocol in
tialiser table. Here sepe
rately for convenience
* Protocol in
itializer table. Here sepa
rately for convenience
*
*/
...
...
net/socket.c
View file @
a6686074
...
...
@@ -363,7 +363,7 @@ static int sock_lseek(struct inode *inode, struct file *file, off_t offset, int
/*
* Read data from a socket. ubuf is a user mode pointer. We make sure the user
* area ubuf...ubuf+size-1 is writ
e
able before asking the protocol.
* area ubuf...ubuf+size-1 is writable before asking the protocol.
*/
static
int
sock_read
(
struct
inode
*
inode
,
struct
file
*
file
,
char
*
ubuf
,
int
size
)
...
...
@@ -934,7 +934,7 @@ static int sock_send(int fd, void * buff, int len, unsigned flags)
/*
* Send a datagram to a given address. We move the address into kernel
* space
e
and check the user space data area is readable before invoking
* space and check the user space data area is readable before invoking
* the protocol.
*/
...
...
@@ -1113,7 +1113,7 @@ int sock_fcntl(struct file *filp, unsigned int cmd, unsigned long arg)
* we have this level of indirection. Not a lot of overhead, since more of
* the work is done via read/write/select directly.
*
* I'm now expanding this up to a higher level to sep
e
rate the assorted
* I'm now expanding this up to a higher level to sep
a
rate the assorted
* kernel/user space manipulations and global assumptions from the protocol
* layers proper - AC.
*/
...
...
zBoot/crypt.h
View file @
a6686074
/* crypt.h (dummy version) -- do not perform encrytion
/* crypt.h (dummy version) -- do not perform encry
p
tion
* Hardly worth copyrighting :-)
*/
...
...
zBoot/lzw.h
View file @
a6686074
...
...
@@ -15,7 +15,7 @@
#define LZW_MAGIC "\037\235"
/* Magic header for lzw files, 1F 9D */
#define BIT_MASK 0x1f
/* Mask for 'number of compress
s
ion bits' */
#define BIT_MASK 0x1f
/* Mask for 'number of compression bits' */
/* Mask 0x20 is reserved to mean a fourth header byte, and 0x40 is free.
* It's a pity that old uncompress does not check bit 0x20. That makes
* extension of the format actually undesirable because old compress
...
...
@@ -26,7 +26,7 @@
*/
#define BLOCK_MODE 0x80
/* Block compress
s
ion: if table is full and compression rate is dropping,
/* Block compression: if table is full and compression rate is dropping,
* clear the dictionary.
*/
...
...
zBoot/misc.c
View file @
a6686074
...
...
@@ -94,7 +94,7 @@ void *malloc(int size)
free_mem_ptr
+=
size
;
/*
* The part of the compresed kernel which has already been expanded
* The part of the compres
s
ed kernel which has already been expanded
* is no longer needed. Therefore we can reuse it for malloc.
* With bigger kernels, this is necessary.
*/
...
...
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