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
88ba9b13
Commit
88ba9b13
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 0.99.14f
parent
1f5ed52f
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
122 additions
and
143 deletions
+122
-143
.depend~
.depend~
+0
-29
Makefile
Makefile
+7
-6
README
README
+27
-0
drivers/FPU-emu/fpu_entry.c
drivers/FPU-emu/fpu_entry.c
+4
-0
drivers/net/Makefile
drivers/net/Makefile
+2
-2
include/linux/ldt.h
include/linux/ldt.h
+5
-0
include/linux/major.h
include/linux/major.h
+1
-1
include/linux/sched.h
include/linux/sched.h
+2
-2
include/linux/sys.h
include/linux/sys.h
+8
-0
kernel/Makefile
kernel/Makefile
+6
-3
kernel/exit.c
kernel/exit.c
+1
-1
kernel/fork.c
kernel/fork.c
+4
-2
kernel/ldt.c
kernel/ldt.c
+11
-5
kernel/sched.c
kernel/sched.c
+7
-2
kernel/signal.c
kernel/signal.c
+4
-3
kernel/traps.c
kernel/traps.c
+29
-85
mm/memory.c
mm/memory.c
+4
-2
No files found.
.depend~
deleted
100644 → 0
View file @
1f5ed52f
init/main.o : init/main.c /usr/lib/gcc-lib/i486-linux/2.5.4/include/stdarg.h /usr/include/asm/system.h \
/usr/include/linux/segment.h /usr/include/asm/io.h /usr/include/linux/types.h \
/usr/include/linux/fcntl.h /usr/include/linux/config.h /usr/include/linux/autoconf.h \
/usr/include/linux/sched.h /usr/include/linux/tasks.h /usr/include/linux/head.h \
/usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
/usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
/usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
/usr/include/linux/xia_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
/usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
/usr/include/linux/mm.h /usr/include/linux/page.h /usr/include/linux/kernel.h \
/usr/include/linux/signal.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/math_emu.h \
/usr/include/linux/tty.h /usr/include/linux/termios.h /usr/include/linux/unistd.h \
/usr/include/linux/string.h /usr/include/linux/timer.h /usr/include/linux/ctype.h \
/usr/include/linux/delay.h /usr/include/linux/utsname.h /usr/include/linux/ioport.h
tools/build.o : tools/build.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.4/include/stddef.h \
/usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.4/include/float.h \
/usr/include/alloca.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/sys/stat.h \
/usr/include/linux/stat.h /usr/include/sys/sysmacros.h /usr/include/unistd.h \
/usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
/usr/include/linux/config.h /usr/include/linux/autoconf.h /usr/include/linux/a.out.h \
/usr/include/linux/page.h
tools/version.o : tools/version.c /usr/include/linux/config.h /usr/include/linux/autoconf.h \
/usr/include/linux/utsname.h tools/./version.h
Makefile
View file @
88ba9b13
VERSION
=
0.99
PATCHLEVEL
=
14
ALPHA
=
e
ALPHA
=
f
all
:
Version zImage
...
...
@@ -44,16 +44,17 @@ ROOT_DEV = CURRENT
# The number is the same as you would ordinarily press at bootup.
#
SVGA_MODE
=
-DSVGA_MODE
=
3
# Special options.
#OPTS = -pro
SVGA_MODE
=
-DSVGA_MODE
=
NORMAL_VGA
#
# standard CFLAGS
#
CFLAGS
=
-Wall
-Wstrict-prototypes
-O6
-fomit-frame-pointer
-pipe
# -x c++
CFLAGS
=
-Wall
-Wstrict-prototypes
-O6
-fomit-frame-pointer
-pipe
ifdef
CONFIG_CPP
CFLAGS
:=
$(CFLAGS)
-x
c++
endif
ifdef
CONFIG_M486
CFLAGS
:=
$(CFLAGS)
-m486
...
...
README
View file @
88ba9b13
...
...
@@ -87,6 +87,33 @@ COMPILING the kernel:
- keep a backup kernel handy in case something goes wrong.
- In order to boot your new kernel, you'
ll
need
to
copy
the
kernel
image
(
found
in
/
usr
/
src
/
linux
/
zImage
after
compilation
)
to
the
place
where
your
regular
bootable
kernel
is
found
.
For
some
,
this
is
on
a
floppy
disk
,
in
which
case
you
can
"cp
/usr/src/linux/zImage /dev/fd0"
to
make
a
bootable
floppy
.
If
you
boot
Linux
from
the
hard
drive
,
chances
are
you
use
LILO
uses
the
kernel
image
as
specified
in
the
file
/
etc
/
lilo
/
config
.
The
kernel
image
file
is
usually
/
vmlinux
,
or
/
Image
,
or
/
etc
/
Image
.
To
use
the
new
kernel
,
copy
the
new
image
over
the
old
one
(
save
a
backup
of
the
original
!). Then, you MUST REINSTALL LILO!! If you
don
't, you won'
t
be
able
to
boot
the
new
kernel
image
.
Reinstalling
LILO
is
usually
a
matter
of
running
/
etc
/
lilo
/
install
.
You
may
wish
to
edit
/
etc
/
lilo
/
config
to
specify
an
entry
for
your
old
kernel
image
(
say
,
/
vmlinux
.
old
)
in
case
the
new
one
does
not
work
.
See
the
LILO
docs
for
more
information
.
After
reinstalling
LILO
,
you
should
be
all
set
.
Shutdown
the
system
,
reboot
,
and
enjoy
!
If
you
ever
need
to
change
the
default
root
device
,
video
mode
,
ramdisk
size
,
etc
.
in
the
kernel
image
,
use
the
'rdev'
program
(
or
alternatively
the
LILO
boot
options
when
appropriate
).
No
need
to
recompile
the
kernel
to
change
these
parameters
.
-
reboot
with
the
new
kernel
and
enjoy
.
IF
SOMETHING
GOES
WRONG
:
...
...
drivers/FPU-emu/fpu_entry.c
View file @
88ba9b13
...
...
@@ -282,6 +282,8 @@ asmlinkage void math_emulate(long arg)
}
RE_ENTRANT_CHECK_OFF
;
current
->
tss
.
trap_no
=
16
;
current
->
tss
.
error_code
=
0
;
send_sig
(
SIGFPE
,
current
,
1
);
return
;
}
...
...
@@ -611,6 +613,8 @@ static int valid_prefix(unsigned char byte)
void
__math_abort
(
struct
info
*
info
,
unsigned
int
signal
)
{
FPU_EIP
=
FPU_ORIG_EIP
;
current
->
tss
.
trap_no
=
16
;
current
->
tss
.
error_code
=
0
;
send_sig
(
signal
,
current
,
1
);
RE_ENTRANT_CHECK_OFF
;
__asm__
(
"movl %0,%%esp ; ret"
:
:
"g"
(((
long
)
info
)
-
4
));
...
...
drivers/net/Makefile
View file @
88ba9b13
...
...
@@ -14,10 +14,10 @@ CPP := $(CPP) -I../../net/inet
# The point of the makefile...
all
:
net.a
Space.o
:
Space.c
/usr
/include/linux/autoconf.h
Space.o
:
Space.c
../..
/include/linux/autoconf.h
$(CC)
$(CFLAGS)
$(OPTS)
$(DL_OPTS)
-c
$<
-o
$@
net_init.o
:
/usr
/include/linux/autoconf.h
net_init.o
:
../..
/include/linux/autoconf.h
ifdef
CONFIG_WD80x3
NETDRV_OBJS
:=
$(NETDRV_OBJS)
net.a
(
wd.o
)
...
...
include/linux/ldt.h
View file @
88ba9b13
...
...
@@ -6,6 +6,11 @@
#ifndef _LINUX_LDT_H
#define _LINUX_LDT_H
/* Maximum number of LDT entries supported. */
#define LDT_ENTRIES 8192
/* The size of each LDT entry. */
#define LDT_ENTRY_SIZE 8
struct
modify_ldt_ldt_s
{
unsigned
int
entry_number
;
unsigned
long
base_addr
;
...
...
include/linux/major.h
View file @
88ba9b13
...
...
@@ -67,7 +67,7 @@
#define SCSI_GENERIC_MAJOR 21
/* unused: 22 */
#define MITSUMI_CDROM_MAJOR 23
#define
SONY
535_CDROM_MAJOR 24
#define
CDU
535_CDROM_MAJOR 24
/*
* Tests for SCSI devices.
...
...
include/linux/sched.h
View file @
88ba9b13
...
...
@@ -145,7 +145,7 @@ struct tss_struct {
unsigned
short
trace
,
bitmap
;
unsigned
long
io_bitmap
[
IO_BITMAP_SIZE
+
1
];
unsigned
long
tr
;
unsigned
long
cr2
;
unsigned
long
cr2
,
trap_no
,
error_code
;
union
i387_union
i387
;
};
...
...
@@ -277,7 +277,7 @@ struct task_struct {
_LDT(0),0, \
0, 0x8000, \
/* ioperm */
{~0, }, \
_TSS(0), 0, \
_TSS(0), 0,
0,0,
\
/* 387 state */
{ { 0, }, } \
} \
}
...
...
include/linux/sys.h
View file @
88ba9b13
...
...
@@ -139,6 +139,7 @@ extern int sys_create_module();
extern
int
sys_init_module
();
extern
int
sys_delete_module
();
extern
int
sys_get_kernel_syms
();
/* 130 */
extern
int
sys_quotactl
();
/*
* These are system calls that will be removed at some time
...
...
@@ -156,6 +157,13 @@ extern int sys_get_kernel_syms(); /* 130 */
#define sys_ssetmask sys_old_syscall
/* sig_sigprocmask */
#endif
/*
* These are system calls that haven't been implemented yet
* but have an entry in the table for future expansion..
*/
#define sys_quotactl sys_ni_syscall
typedef
int
(
*
fn_ptr
)();
#ifdef __cplusplus
...
...
kernel/Makefile
View file @
88ba9b13
...
...
@@ -34,11 +34,14 @@ sys_call.o: sys_call.s
sched.o
:
sched.c
$(CC)
$(CFLAGS)
$(PROFILING)
-fno-omit-frame-pointer
-c
$<
ksyms.
o
:
ksyms.S ksyms.sh /usr
/include/linux/autoconf.h
ksyms.
lst
:
ksyms.S ..
/include/linux/autoconf.h
$(CPP)
$(CFLAGS)
ksyms.S
>
ksyms.lst
sh ksyms.sh
>
ksyms.s
$(AS)
-o
ksyms.o ksyms.s
ksyms.s
:
ksyms.lst ksyms.sh
sh ksyms.sh
>
ksyms.s
ksyms.o
:
ksyms.s
dep
:
$(CPP)
-M
*
.c
>
.depend
...
...
kernel/exit.c
View file @
88ba9b13
...
...
@@ -385,7 +385,7 @@ NORET_TYPE void do_exit(long code)
}
if
(
current
->
ldt
)
{
free_page
((
unsigned
long
)
current
->
ldt
);
vfree
(
current
->
ldt
);
current
->
ldt
=
NULL
;
for
(
i
=
1
;
i
<
NR_TASKS
;
i
++
)
{
if
(
task
[
i
]
==
current
)
{
...
...
kernel/fork.c
View file @
88ba9b13
...
...
@@ -20,6 +20,7 @@
#include <linux/segment.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/ldt.h>
#include <asm/segment.h>
#include <asm/system.h>
...
...
@@ -182,8 +183,9 @@ asmlinkage int sys_fork(struct pt_regs regs)
p
->
exit_signal
=
clone_flags
&
CSIGNAL
;
p
->
tss
.
ldt
=
_LDT
(
nr
);
if
(
p
->
ldt
)
{
if
((
p
->
ldt
=
(
struct
desc_struct
*
)
__get_free_page
(
GFP_KERNEL
))
!=
NULL
)
memcpy
(
p
->
ldt
,
current
->
ldt
,
PAGE_SIZE
);
p
->
ldt
=
(
struct
desc_struct
*
)
vmalloc
(
LDT_ENTRIES
*
LDT_ENTRY_SIZE
);
if
(
p
->
ldt
!=
NULL
)
memcpy
(
p
->
ldt
,
current
->
ldt
,
LDT_ENTRIES
*
LDT_ENTRY_SIZE
);
}
p
->
tss
.
bitmap
=
offsetof
(
struct
tss_struct
,
io_bitmap
);
for
(
i
=
0
;
i
<
IO_BITMAP_SIZE
+
1
;
i
++
)
/* IO bitmap is actually SIZE+1 */
...
...
kernel/ldt.c
View file @
88ba9b13
...
...
@@ -20,7 +20,7 @@ static int read_ldt(void * ptr, unsigned long bytecount)
if
(
!
ptr
)
return
-
EINVAL
;
size
=
PAGE
_SIZE
;
size
=
LDT_ENTRIES
*
LDT_ENTRY
_SIZE
;
if
(
!
address
)
{
address
=
&
default_ldt
;
size
=
sizeof
(
default_ldt
);
...
...
@@ -49,7 +49,7 @@ static int write_ldt(void * ptr, unsigned long bytecount)
memcpy_fromfs
(
&
ldt_info
,
ptr
,
sizeof
(
ldt_info
));
if
(
ldt_info
.
contents
==
3
||
ldt_info
.
entry_number
>=
512
)
if
(
ldt_info
.
contents
==
3
||
ldt_info
.
entry_number
>=
LDT_ENTRIES
)
return
-
EINVAL
;
limit
=
ldt_info
.
limit
;
...
...
@@ -64,16 +64,22 @@ static int write_ldt(void * ptr, unsigned long bytecount)
if
(
!
current
->
ldt
)
{
for
(
i
=
1
;
i
<
NR_TASKS
;
i
++
)
{
if
(
task
[
i
]
==
current
)
{
if
(
!
(
current
->
ldt
=
(
struct
desc_struct
*
)
get_free_page
(
GFP_KERNEL
)))
if
(
!
(
current
->
ldt
=
(
struct
desc_struct
*
)
vmalloc
(
LDT_ENTRIES
*
LDT_ENTRY_SIZE
)))
return
-
ENOMEM
;
set_ldt_desc
(
gdt
+
(
i
<<
1
)
+
FIRST_LDT_ENTRY
,
current
->
ldt
,
512
);
set_ldt_desc
(
gdt
+
(
i
<<
1
)
+
FIRST_LDT_ENTRY
,
current
->
ldt
,
LDT_ENTRIES
);
load_ldt
(
i
);
}
}
}
lp
=
(
unsigned
long
*
)
&
current
->
ldt
[
ldt_info
.
entry_number
];
*
lp
=
((
ldt_info
.
base_addr
&
0x0000ffff
)
<<
16
)
|
/* Allow LDTs to be cleared by the user. */
if
(
ldt_info
.
base_addr
==
0
&&
ldt_info
.
limit
==
0
)
{
*
lp
=
0
;
*
(
lp
+
1
)
=
0
;
return
0
;
}
*
lp
=
((
ldt_info
.
base_addr
&
0x0000ffff
)
<<
16
)
|
(
ldt_info
.
limit
&
0x0ffff
);
*
(
lp
+
1
)
=
(
ldt_info
.
base_addr
&
0xff000000
)
|
((
ldt_info
.
base_addr
&
0x00ff0000
)
>>
16
)
|
...
...
kernel/sched.c
View file @
88ba9b13
...
...
@@ -103,6 +103,11 @@ struct {
extern
"C"
{
#endif
int
sys_ni_syscall
(
void
)
{
return
-
EINVAL
;
}
fn_ptr
sys_call_table
[]
=
{
sys_setup
,
sys_exit
,
sys_fork
,
sys_read
,
sys_write
,
sys_open
,
sys_close
,
sys_waitpid
,
sys_creat
,
sys_link
,
sys_unlink
,
sys_execve
,
sys_chdir
,
sys_time
,
sys_mknod
,
sys_chmod
,
...
...
@@ -126,8 +131,8 @@ sys_syslog, sys_setitimer, sys_getitimer, sys_newstat, sys_newlstat,
sys_newfstat
,
sys_uname
,
sys_iopl
,
sys_vhangup
,
sys_idle
,
sys_vm86
,
sys_wait4
,
sys_swapoff
,
sys_sysinfo
,
sys_ipc
,
sys_fsync
,
sys_sigreturn
,
sys_clone
,
sys_setdomainname
,
sys_newuname
,
sys_modify_ldt
,
sys_adjtimex
,
sys_mprotect
,
sys_sigprocmask
,
sys_
create_module
,
sys_init_module
,
sys_delete_module
,
sys_get_kernel_syms
};
sys_adjtimex
,
sys_mprotect
,
sys_sigprocmask
,
sys_create_module
,
sys_
init_module
,
sys_delete_module
,
sys_get_kernel_syms
,
sys_quotactl
};
/* So we don't have to do any more manual updating.... */
int
NR_syscalls
=
sizeof
(
sys_call_table
)
/
sizeof
(
fn_ptr
);
...
...
kernel/signal.c
View file @
88ba9b13
...
...
@@ -268,8 +268,8 @@ static void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned lon
put_fs_long
(
regs
->
edx
,
frame
+
11
);
put_fs_long
(
regs
->
ecx
,
frame
+
12
);
put_fs_long
(
regs
->
eax
,
frame
+
13
);
put_fs_long
(
0
,
frame
+
14
);
/* trapno - not implemented */
put_fs_long
(
0
,
frame
+
15
);
/* err - not implemented */
put_fs_long
(
current
->
tss
.
trap_no
,
frame
+
14
);
put_fs_long
(
current
->
tss
.
error_code
,
frame
+
15
);
put_fs_long
(
eip
,
frame
+
16
);
put_fs_long
(
regs
->
cs
,
frame
+
17
);
put_fs_long
(
regs
->
eflags
,
frame
+
18
);
...
...
@@ -407,6 +407,7 @@ asmlinkage int do_signal(unsigned long oldmask, struct pt_regs * regs)
oldmask
|=
sa
->
sa_mask
;
}
regs
->
esp
=
(
unsigned
long
)
frame
;
regs
->
eip
=
eip
;
/* "return" to the first handler */
regs
->
eip
=
eip
;
/* "return" to the first handler */
current
->
tss
.
trap_no
=
current
->
tss
.
error_code
=
0
;
return
1
;
}
kernel/traps.c
View file @
88ba9b13
...
...
@@ -22,6 +22,17 @@
#include <asm/segment.h>
#include <asm/io.h>
#define DO_ERROR(trapnr, signr, str, name, tsk) \
asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
{ \
tsk->tss.error_code = error_code; \
tsk->tss.trap_no = trapnr; \
if (signr == SIGTRAP && current->flags & PF_PTRACED) \
current->blocked &= ~(1 << (SIGTRAP-1)); \
send_sig(signr, tsk, 1); \
die_if_kernel(str,regs,error_code); \
}
#define get_seg_byte(seg,addr) ({ \
register char __res; \
__asm__("push %%fs;mov %%ax,%%fs;movb %%fs:%2,%%al;pop %%fs" \
...
...
@@ -83,37 +94,20 @@ asmlinkage void alignment_check(void);
do_exit
(
SIGSEGV
);
}
asmlinkage
void
do_double_fault
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"double fault"
,
regs
,
error_code
);
}
asmlinkage
void
do_general_protection
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"general protection"
,
regs
,
error_code
);
}
asmlinkage
void
do_alignment_check
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"alignment check"
,
regs
,
error_code
);
}
asmlinkage
void
do_divide_error
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGFPE
,
current
,
1
);
die_if_kernel
(
"divide error"
,
regs
,
error_code
);
}
asmlinkage
void
do_int3
(
struct
pt_regs
*
regs
,
long
error_code
)
{
if
(
current
->
flags
&
PF_PTRACED
)
current
->
blocked
&=
~
(
1
<<
(
SIGTRAP
-
1
));
send_sig
(
SIGTRAP
,
current
,
1
);
die_if_kernel
(
"int3"
,
regs
,
error_code
);
}
DO_ERROR
(
0
,
SIGFPE
,
"divide error"
,
divide_error
,
current
)
DO_ERROR
(
3
,
SIGTRAP
,
"int3"
,
int3
,
current
)
DO_ERROR
(
4
,
SIGSEGV
,
"overflow"
,
overflow
,
current
)
DO_ERROR
(
5
,
SIGSEGV
,
"bounds"
,
bounds
,
current
)
DO_ERROR
(
6
,
SIGILL
,
"invalid operand"
,
invalid_op
,
current
)
DO_ERROR
(
7
,
SIGSEGV
,
"device not available"
,
device_not_available
,
current
)
DO_ERROR
(
8
,
SIGSEGV
,
"double fault"
,
double_fault
,
current
)
DO_ERROR
(
9
,
SIGFPE
,
"coprocessor segment overrun"
,
coprocessor_segment_overrun
,
last_task_used_math
)
DO_ERROR
(
10
,
SIGSEGV
,
"invalid TSS"
,
invalid_TSS
,
current
)
DO_ERROR
(
11
,
SIGSEGV
,
"segment not present"
,
segment_not_present
,
current
)
DO_ERROR
(
12
,
SIGSEGV
,
"stack segment"
,
stack_segment
,
current
)
DO_ERROR
(
13
,
SIGSEGV
,
"general protection"
,
general_protection
,
current
)
DO_ERROR
(
15
,
SIGSEGV
,
"reserved"
,
reserved
,
current
)
DO_ERROR
(
17
,
SIGSEGV
,
"alignment check"
,
alignment_check
,
current
)
asmlinkage
void
do_nmi
(
struct
pt_regs
*
regs
,
long
error_code
)
{
...
...
@@ -126,6 +120,8 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
if
(
current
->
flags
&
PF_PTRACED
)
current
->
blocked
&=
~
(
1
<<
(
SIGTRAP
-
1
));
send_sig
(
SIGTRAP
,
current
,
1
);
current
->
tss
.
trap_no
=
1
;
current
->
tss
.
error_code
=
error_code
;
if
((
regs
->
cs
&
3
)
==
0
)
{
/* If this is a kernel mode trap, then reset db7 and allow us to continue */
__asm__
(
"movl $0,%%edx
\n\t
"
\
...
...
@@ -138,54 +134,6 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
die_if_kernel
(
"debug"
,
regs
,
error_code
);
}
asmlinkage
void
do_overflow
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"overflow"
,
regs
,
error_code
);
}
asmlinkage
void
do_bounds
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"bounds"
,
regs
,
error_code
);
}
asmlinkage
void
do_invalid_op
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGILL
,
current
,
1
);
die_if_kernel
(
"invalid operand"
,
regs
,
error_code
);
}
asmlinkage
void
do_device_not_available
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"device not available"
,
regs
,
error_code
);
}
asmlinkage
void
do_coprocessor_segment_overrun
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGFPE
,
last_task_used_math
,
1
);
die_if_kernel
(
"coprocessor segment overrun"
,
regs
,
error_code
);
}
asmlinkage
void
do_invalid_TSS
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"invalid TSS"
,
regs
,
error_code
);
}
asmlinkage
void
do_segment_not_present
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"segment not present"
,
regs
,
error_code
);
}
asmlinkage
void
do_stack_segment
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"stack segment"
,
regs
,
error_code
);
}
/*
* Allow the process which triggered the interrupt to recover the error
* condition.
...
...
@@ -212,6 +160,8 @@ void math_error(void)
}
env
=
&
last_task_used_math
->
tss
.
i387
.
hard
;
send_sig
(
SIGFPE
,
last_task_used_math
,
1
);
current
->
tss
.
trap_no
=
16
;
current
->
tss
.
error_code
=
0
;
__asm__
__volatile__
(
"fnsave %0"
:
"=m"
(
*
env
));
last_task_used_math
=
NULL
;
stts
();
...
...
@@ -227,12 +177,6 @@ asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
math_error
();
}
asmlinkage
void
do_reserved
(
struct
pt_regs
*
regs
,
long
error_code
)
{
send_sig
(
SIGSEGV
,
current
,
1
);
die_if_kernel
(
"reserved (15,17-47) error"
,
regs
,
error_code
);
}
void
trap_init
(
void
)
{
int
i
;
...
...
mm/memory.c
View file @
88ba9b13
...
...
@@ -633,6 +633,8 @@ void do_wp_page(unsigned long error_code, unsigned long address,
if
(
!
(
page
&
PAGE_COW
))
{
if
(
user_esp
&&
tsk
==
current
)
{
current
->
tss
.
cr2
=
address
;
current
->
tss
.
error_code
=
error_code
;
current
->
tss
.
trap_no
=
14
;
send_sig
(
SIGSEGV
,
tsk
,
1
);
return
;
}
...
...
@@ -660,8 +662,6 @@ int verify_area(int type, void * addr, unsigned long size)
return
-
EFAULT
;
if
(
wp_works_ok
||
type
==
VERIFY_READ
||
!
size
)
return
0
;
if
(
!
size
)
return
0
;
size
--
;
size
+=
start
&
~
PAGE_MASK
;
size
>>=
PAGE_SHIFT
;
...
...
@@ -879,6 +879,8 @@ void do_no_page(unsigned long error_code, unsigned long address,
return
;
}
tsk
->
tss
.
cr2
=
address
;
current
->
tss
.
error_code
=
error_code
;
current
->
tss
.
trap_no
=
14
;
send_sig
(
SIGSEGV
,
tsk
,
1
);
return
;
}
...
...
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