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
nexedi
linux
Commits
7f555b11
Commit
7f555b11
authored
Nov 15, 2002
by
Jeff Dike
Browse files
Options
Browse Files
Download
Plain Diff
Merged conflicts between 2.5.45 and my 2.5.44.
parents
b1b782f7
48a6f198
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
452 additions
and
245 deletions
+452
-245
arch/um/Makefile
arch/um/Makefile
+3
-3
arch/um/Makefile-i386
arch/um/Makefile-i386
+5
-2
arch/um/defconfig
arch/um/defconfig
+8
-0
arch/um/drivers/Makefile
arch/um/drivers/Makefile
+2
-2
arch/um/drivers/mconsole_kern.c
arch/um/drivers/mconsole_kern.c
+2
-0
arch/um/drivers/port_kern.c
arch/um/drivers/port_kern.c
+52
-18
arch/um/drivers/ssl.c
arch/um/drivers/ssl.c
+1
-0
arch/um/drivers/stdio_console.c
arch/um/drivers/stdio_console.c
+1
-0
arch/um/drivers/ubd_kern.c
arch/um/drivers/ubd_kern.c
+159
-180
arch/um/drivers/xterm.c
arch/um/drivers/xterm.c
+19
-7
arch/um/drivers/xterm.h
arch/um/drivers/xterm.h
+22
-0
arch/um/drivers/xterm_kern.c
arch/um/drivers/xterm_kern.c
+77
-0
arch/um/include/chan_user.h
arch/um/include/chan_user.h
+1
-0
arch/um/include/kern_util.h
arch/um/include/kern_util.h
+2
-0
arch/um/kernel/Makefile
arch/um/kernel/Makefile
+3
-1
arch/um/kernel/irq_user.c
arch/um/kernel/irq_user.c
+0
-1
arch/um/kernel/ksyms.c
arch/um/kernel/ksyms.c
+27
-0
arch/um/kernel/process_kern.c
arch/um/kernel/process_kern.c
+1
-1
arch/um/kernel/reboot.c
arch/um/kernel/reboot.c
+18
-1
arch/um/kernel/signal_user.c
arch/um/kernel/signal_user.c
+11
-13
arch/um/kernel/smp.c
arch/um/kernel/smp.c
+4
-0
arch/um/kernel/sys_call_table.c
arch/um/kernel/sys_call_table.c
+3
-1
arch/um/kernel/sysrq.c
arch/um/kernel/sysrq.c
+10
-0
arch/um/kernel/trap_kern.c
arch/um/kernel/trap_kern.c
+1
-0
arch/um/os-Linux/file.c
arch/um/os-Linux/file.c
+3
-4
arch/um/sys-i386/Makefile
arch/um/sys-i386/Makefile
+8
-3
arch/um/uml.lds.S
arch/um/uml.lds.S
+1
-1
include/asm-um/irq.h
include/asm-um/irq.h
+2
-1
include/asm-um/system-generic.h
include/asm-um/system-generic.h
+6
-6
No files found.
arch/um/Makefile
View file @
7f555b11
ARCH_DIR
=
arch
/um
OS
:=
$(
shell
uname
-s
)
include
$(ARCH_DIR)/Makefile-$(SUBARCH)
include
$(ARCH_DIR)/Makefile-os-$(OS)
EXTRAVERSION
:=
$(EXTRAVERSION)
-1um
include/linux/version.h
:
arch/$(ARCH)/Makefile
...
...
@@ -59,6 +56,9 @@ ARCH_SYMLINKS = include/asm-um/arch arch/um/include/sysdep arch/um/os \
GEN_HEADERS
=
$(ARCH_DIR)
/include/task.h
include
$(ARCH_DIR)/Makefile-$(SUBARCH)
include
$(ARCH_DIR)/Makefile-os-$(OS)
$(ARCH_DIR)/vmlinux.lds.S
:
touch
$@
...
...
arch/um/Makefile-i386
View file @
7f555b11
...
...
@@ -21,11 +21,14 @@ $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc
$(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread
$< > $@
$(SYS_UTIL_DIR)/mk_sc $(SYS_UTIL_DIR)/mk_thread: $(SYS_UTIL_DIR) FORCE ;
$(SYS_UTIL_DIR)/mk_sc: FORCE ;
@$(call descend,$(SYS_UTIL_DIR),$@)
$(SYS_UTIL_DIR)/mk_thread: $(ARCH_SYMLINKS) FORCE ;
@$(call descend,$(SYS_UTIL_DIR),$@)
$(SYS_UTIL_DIR): include/asm FORCE
@$(call descend,$@,)
sysclean :
rm -f $(SYS_HEADERS)
@$(call descend,$(SYS_DIR),clean)
arch/um/defconfig
View file @
7f555b11
...
...
@@ -219,13 +219,16 @@ CONFIG_EXT2_FS=y
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_NFS_FS is not set
# CONFIG_NFS_V3 is not set
# CONFIG_NFS_V4 is not set
# CONFIG_ROOT_NFS is not set
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
# CONFIG_NFSD_V4 is not set
# CONFIG_NFSD_TCP is not set
# CONFIG_SUNRPC is not set
# CONFIG_LOCKD is not set
# CONFIG_EXPORTFS is not set
# CONFIG_CIFS is not set
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
# CONFIG_NCPFS_PACKET_SIGNING is not set
...
...
@@ -236,6 +239,7 @@ CONFIG_EXT2_FS=y
# CONFIG_NCPFS_SMALLDOS is not set
# CONFIG_NCPFS_NLS is not set
# CONFIG_NCPFS_EXTRAS is not set
# CONFIG_AFS_FS is not set
# CONFIG_ZISOFS_FS is not set
#
...
...
@@ -332,7 +336,9 @@ CONFIG_SCSI_DEBUG=y
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_PARTITIONS is not set
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
#
# User Modules And Translation Layers
...
...
@@ -362,6 +368,8 @@ CONFIG_MTD_BLOCK=y
# Mapping drivers for chip access
#
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PCMCIA is not set
#
# Self-contained MTD device drivers
...
...
arch/um/drivers/Makefile
View file @
7f555b11
...
...
@@ -15,7 +15,7 @@ CHAN_OBJS := chan_kern.o chan_user.o line.o
# So, what this does is figure out by hand (crudely) what file -lpcap really
# is and just use it.
PCAP
=
$(
shell
for
f
in
echo
{
/lib,/usr/lib
}
/libpcap.
{
a,so
}
;
do
\
PCAP
=
$(
shell
for
f
in
echo
{
/lib,/usr/lib
}
/libpcap.
a
;
do
\
[
-f
$$
f
]
&&
echo
$$
f
;
done
|
head
-1
)
slip-objs
:=
slip_kern.o slip_user.o
...
...
@@ -47,7 +47,7 @@ obj-$(CONFIG_NULL_CHAN) += null.o
obj-$(CONFIG_PORT_CHAN)
+=
port.o
obj-$(CONFIG_PTY_CHAN)
+=
pty.o
obj-$(CONFIG_TTY_CHAN)
+=
tty.o
obj-$(CONFIG_XTERM_CHAN)
+=
xterm.o
obj-$(CONFIG_XTERM_CHAN)
+=
xterm.o
xterm_kern.o
obj-$(CONFIG_UML_WATCHDOG)
+=
harddog.o
CFLAGS_pcap_user.o
=
-I
/usr/include/pcap
...
...
arch/um/drivers/mconsole_kern.c
View file @
7f555b11
...
...
@@ -111,6 +111,8 @@ void mconsole_version(struct mc_request *req)
remove
<
dev
>
-
Remove
a
device
from
UML
sysrq
<
letter
>
-
Performs
the
SysRq
action
controlled
by
the
letter
cad
-
invoke
the
Ctl
-
Alt
-
Del
handler
stop
-
pause
the
UML
;
it
will
do
nothing
until
it
receives
a
'
go
'
go
-
continue
the
UML
after
a
'
stop
'
"
void mconsole_help(struct mc_request *req)
...
...
arch/um/drivers/port_kern.c
View file @
7f555b11
...
...
@@ -20,6 +20,7 @@
struct
port_list
{
struct
list_head
list
;
int
has_connection
;
struct
semaphore
sem
;
int
port
;
int
fd
;
...
...
@@ -49,28 +50,32 @@ static void pipe_interrupt(int irq, void *data, struct pt_regs *regs)
struct
connection
*
conn
=
data
;
int
fd
;
list_del
(
&
conn
->
list
);
fd
=
os_rcv_fd
(
conn
->
socket
[
0
],
&
conn
->
helper_pid
);
if
(
fd
<
0
){
if
(
fd
==
-
EAGAIN
)
return
;
printk
(
"os_rcv_fd returned %d
\n
"
,
-
fd
);
os_close_file
(
conn
->
fd
);
}
list_del
(
&
conn
->
list
);
conn
->
fd
=
fd
;
list_add
(
&
conn
->
list
,
&
conn
->
port
->
connections
);
up
(
&
conn
->
port
->
sem
);
}
static
void
port_interrupt
(
int
irq
,
void
*
data
,
struct
pt_regs
*
regs
)
static
int
port_accept
(
struct
port_list
*
port
)
{
struct
port_list
*
port
=
data
;
struct
connection
*
conn
;
int
fd
,
socket
[
2
],
pid
;
int
fd
,
socket
[
2
],
pid
,
ret
=
0
;
fd
=
port_connection
(
port
->
fd
,
socket
,
&
pid
);
if
(
fd
<
0
){
printk
(
"port_connection returned %d
\n
"
,
-
fd
);
if
(
fd
!=
-
EAGAIN
)
printk
(
"port_connection returned %d
\n
"
,
-
fd
);
goto
out
;
}
...
...
@@ -94,6 +99,7 @@ static void port_interrupt(int irq, void *data, struct pt_regs *regs)
}
list_add
(
&
conn
->
list
,
&
port
->
pending
);
ret
=
1
;
goto
out
;
out_free:
...
...
@@ -102,17 +108,45 @@ static void port_interrupt(int irq, void *data, struct pt_regs *regs)
os_close_file
(
fd
);
if
(
pid
!=
-
1
)
os_kill_process
(
pid
);
out:
re
activate_fd
(
port
->
fd
,
ACCEPT_IRQ
);
re
turn
(
ret
);
}
DECLARE_MUTEX
(
ports_sem
);
struct
list_head
ports
=
LIST_HEAD_INIT
(
ports
);
void
port_work_proc
(
void
*
unused
)
{
struct
port_list
*
port
;
struct
list_head
*
ele
;
unsigned
long
flags
;
local_irq_save
(
flags
);
list_for_each
(
ele
,
&
ports
){
port
=
list_entry
(
ele
,
struct
port_list
,
list
);
if
(
!
port
->
has_connection
)
continue
;
reactivate_fd
(
port
->
fd
,
ACCEPT_IRQ
);
while
(
port_accept
(
port
))
;
port
->
has_connection
=
0
;
}
local_irq_restore
(
flags
);
}
DECLARE_WORK
(
port_work
,
port_work_proc
,
NULL
);
static
void
port_interrupt
(
int
irq
,
void
*
data
,
struct
pt_regs
*
regs
)
{
struct
port_list
*
port
=
data
;
port
->
has_connection
=
1
;
schedule_work
(
&
port_work
);
}
void
*
port_data
(
int
port_num
)
{
struct
list_head
*
ele
;
struct
port_list
*
port
;
struct
port_dev
*
dev
;
struct
port_dev
*
dev
=
NULL
;
int
fd
;
down
(
&
ports_sem
);
...
...
@@ -140,13 +174,14 @@ void *port_data(int port_num)
}
*
port
=
((
struct
port_list
)
{
list
:
LIST_HEAD_INIT
(
port
->
list
),
sem
:
__SEMAPHORE_INITIALIZER
(
port
->
sem
,
0
),
lock
:
SPIN_LOCK_UNLOCKED
,
port
:
port_num
,
fd
:
fd
,
pending
:
LIST_HEAD_INIT
(
port
->
pending
),
connections
:
LIST_HEAD_INIT
(
port
->
connections
)
});
{
list
:
LIST_HEAD_INIT
(
port
->
list
),
has_connection
:
0
,
sem
:
__SEMAPHORE_INITIALIZER
(
port
->
sem
,
0
),
lock
:
SPIN_LOCK_UNLOCKED
,
port
:
port_num
,
fd
:
fd
,
pending
:
LIST_HEAD_INIT
(
port
->
pending
),
connections
:
LIST_HEAD_INIT
(
port
->
connections
)
});
list_add
(
&
port
->
list
,
&
ports
);
found:
...
...
@@ -159,8 +194,7 @@ void *port_data(int port_num)
*
dev
=
((
struct
port_dev
)
{
port
:
port
,
fd
:
-
1
,
helper_pid
:
-
1
});
up
(
&
ports_sem
);
return
(
dev
);
goto
out
;
out_free:
kfree
(
port
);
...
...
@@ -168,7 +202,7 @@ void *port_data(int port_num)
os_close_file
(
fd
);
out:
up
(
&
ports_sem
);
return
(
NULL
);
return
(
dev
);
}
void
port_remove_dev
(
void
*
d
)
...
...
arch/um/drivers/ssl.c
View file @
7f555b11
...
...
@@ -44,6 +44,7 @@ static struct chan_opts opts = {
xterm_title:
"Serial Line #%d"
,
raw:
1
,
tramp_stack
:
0
,
in_kernel
:
1
,
};
static
struct
line_driver
driver
=
{
...
...
arch/um/drivers/stdio_console.c
View file @
7f555b11
...
...
@@ -75,6 +75,7 @@ static struct chan_opts opts = {
xterm_title:
"Virtual Console #%d"
,
raw:
1
,
tramp_stack
:
0
,
in_kernel
:
1
,
};
static
struct
line_driver
driver
=
{
...
...
arch/um/drivers/ubd_kern.c
View file @
7f555b11
This diff is collapsed.
Click to expand it.
arch/um/drivers/xterm.c
View file @
7f555b11
...
...
@@ -19,6 +19,7 @@
#include "user_util.h"
#include "user.h"
#include "os.h"
#include "xterm.h"
struct
xterm_chan
{
int
pid
;
...
...
@@ -28,6 +29,7 @@ struct xterm_chan {
int
raw
;
struct
termios
tt
;
unsigned
long
stack
;
int
direct_rcv
;
};
void
*
xterm_init
(
char
*
str
,
int
device
,
struct
chan_opts
*
opts
)
...
...
@@ -40,7 +42,8 @@ void *xterm_init(char *str, int device, struct chan_opts *opts)
device
:
device
,
title
:
opts
->
xterm_title
,
raw
:
opts
->
raw
,
stack
:
opts
->
tramp_stack
}
);
stack
:
opts
->
tramp_stack
,
direct_rcv
:
!
opts
->
in_kernel
}
);
return
(
data
);
}
...
...
@@ -84,7 +87,7 @@ int xterm_open(int input, int output, int primary, void *d)
{
struct
xterm_chan
*
data
=
d
;
unsigned
long
stack
;
int
pid
,
fd
,
new
;
int
pid
,
fd
,
new
,
err
;
char
title
[
256
],
file
[]
=
"/tmp/xterm-pipeXXXXXX"
;
char
*
argv
[]
=
{
terminal_emulator
,
title_switch
,
title
,
exec_switch
,
"/usr/lib/uml/port-helper"
,
"-uml-socket"
,
...
...
@@ -105,21 +108,30 @@ int xterm_open(int input, int output, int primary, void *d)
fd
=
create_unix_socket
(
file
,
sizeof
(
file
));
if
(
fd
<
0
){
printk
(
"xterm_open : create_unix_socket failed, errno = %d
\n
"
,
errno
);
return
(
-
errno
);
-
fd
);
return
(
-
fd
);
}
sprintf
(
title
,
data
->
title
,
data
->
device
);
stack
=
data
->
stack
;
pid
=
run_helper
(
NULL
,
NULL
,
argv
,
&
stack
);
if
(
pid
<
0
){
printk
(
"xterm_open : run_helper failed
\n
"
);
return
(
-
1
);
printk
(
"xterm_open : run_helper failed
, errno = %d
\n
"
,
-
pid
);
return
(
pid
);
}
if
(
data
->
stack
==
0
)
free_stack
(
stack
,
0
);
new
=
os_rcv_fd
(
fd
,
&
data
->
helper_pid
);
if
(
data
->
direct_rcv
)
new
=
os_rcv_fd
(
fd
,
&
data
->
helper_pid
);
else
{
if
((
err
=
os_set_fd_block
(
fd
,
0
))
!=
0
){
printk
(
"xterm_open : failed to set descriptor "
"non-blocking, errno = %d
\n
"
,
err
);
return
(
err
);
}
new
=
xterm_fd
(
fd
,
&
data
->
helper_pid
);
}
if
(
new
<
0
){
printk
(
"xterm_open : os_rcv_fd failed, errno = %d
\n
"
,
-
new
);
return
(
new
);
...
...
arch/um/drivers/xterm.h
0 → 100644
View file @
7f555b11
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#ifndef __XTERM_H__
#define __XTERM_H__
extern
int
xterm_fd
(
int
socket
,
int
*
pid_out
);
#endif
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
arch/um/drivers/xterm_kern.c
0 → 100644
View file @
7f555b11
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#include "linux/errno.h"
#include "linux/slab.h"
#include "asm/semaphore.h"
#include "asm/irq.h"
#include "irq_user.h"
#include "kern_util.h"
#include "os.h"
#include "xterm.h"
struct
xterm_wait
{
struct
semaphore
sem
;
int
fd
;
int
pid
;
int
new_fd
;
};
static
void
xterm_interrupt
(
int
irq
,
void
*
data
,
struct
pt_regs
*
regs
)
{
struct
xterm_wait
*
xterm
=
data
;
xterm
->
new_fd
=
os_rcv_fd
(
xterm
->
fd
,
&
xterm
->
pid
);
if
(
xterm
->
new_fd
==
-
EAGAIN
)
return
;
up
(
&
xterm
->
sem
);
}
int
xterm_fd
(
int
socket
,
int
*
pid_out
)
{
struct
xterm_wait
*
data
;
int
err
,
ret
;
data
=
kmalloc
(
sizeof
(
*
data
),
GFP_KERNEL
);
if
(
data
==
NULL
){
printk
(
KERN_ERR
"xterm_fd - failed to allocate semaphore
\n
"
);
return
(
-
ENOMEM
);
}
*
data
=
((
struct
xterm_wait
)
{
sem
:
__SEMAPHORE_INITIALIZER
(
data
->
sem
,
0
),
fd
:
socket
,
pid
:
-
1
,
new_fd
:
-
1
});
err
=
um_request_irq
(
XTERM_IRQ
,
socket
,
IRQ_READ
,
xterm_interrupt
,
SA_INTERRUPT
|
SA_SHIRQ
|
SA_SAMPLE_RANDOM
,
"xterm"
,
data
);
if
(
err
){
printk
(
KERN_ERR
"Failed to get IRQ for xterm, err = %d
\n
"
,
err
);
return
(
err
);
}
down
(
&
data
->
sem
);
free_irq
(
XTERM_IRQ
,
data
);
ret
=
data
->
new_fd
;
*
pid_out
=
data
->
pid
;
kfree
(
data
);
return
(
ret
);
}
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
arch/um/include/chan_user.h
View file @
7f555b11
...
...
@@ -13,6 +13,7 @@ struct chan_opts {
char
*
xterm_title
;
int
raw
;
unsigned
long
tramp_stack
;
int
in_kernel
;
};
enum
chan_init_pri
{
INIT_STATIC
,
INIT_ALL
,
INIT_ONE
};
...
...
arch/um/include/kern_util.h
View file @
7f555b11
...
...
@@ -6,6 +6,7 @@
#ifndef __KERN_UTIL_H__
#define __KERN_UTIL_H__
#include "linux/threads.h"
#include "sysdep/ptrace.h"
extern
int
ncpus
;
...
...
@@ -14,6 +15,7 @@ extern char *gdb_init;
extern
int
kmalloc_ok
;
extern
int
timer_irq_inited
;
extern
int
jail
;
extern
struct
task_struct
*
idle_threads
[
NR_CPUS
];
#define ROUND_DOWN(addr) ((void *)(((unsigned long) addr) & PAGE_MASK))
#define ROUND_UP(addr) ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1)
...
...
arch/um/kernel/Makefile
View file @
7f555b11
EXTRA_TARGETS
:=
unmap_fin.o
obj-y
=
config.o exec_kern.o exec_user.o exitcode.o frame_kern.o frame.o
\
...
...
@@ -51,6 +50,9 @@ arch/um/kernel/unmap.o: arch/um/kernel/unmap.c
arch/um/kernel/unmap_fin.o
:
arch/um/kernel/unmap.o
ld
-r
-o
$@
$<
-lc
-L
/usr/lib
# This has to be separate because it needs be compiled with frame pointers
# regardless of how the rest of the kernel is built.
arch/um/kernel/frame.o
:
arch/um/kernel/frame.c
$(CC)
$
(
CFLAGS_
$(
notdir
$@
)
)
-c
-o
$@
$<
...
...
arch/um/kernel/irq_user.c
View file @
7f555b11
...
...
@@ -209,7 +209,6 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
out_unlock:
irq_unlock
(
flags
);
out_free:
kfree
(
new_fd
);
out:
return
(
err
);
...
...
arch/um/kernel/ksyms.c
View file @
7f555b11
#include "linux/config.h"
#include "linux/module.h"
#include "linux/string.h"
#include "linux/smp_lock.h"
#include "linux/spinlock.h"
#include <linux/highmem.h>
#include "asm/current.h"
#include "asm/delay.h"
#include "asm/processor.h"
...
...
@@ -36,12 +40,15 @@ EXPORT_SYMBOL(page_mem_map);
EXPORT_SYMBOL
(
get_signals
);
EXPORT_SYMBOL
(
page_to_phys
);
EXPORT_SYMBOL
(
phys_to_page
);
EXPORT_SYMBOL
(
high_physmem
);
EXPORT_SYMBOL
(
os_open_file
);
EXPORT_SYMBOL
(
os_read_file
);
EXPORT_SYMBOL
(
os_write_file
);
EXPORT_SYMBOL
(
os_seek_file
);
EXPORT_SYMBOL
(
os_pipe
);
EXPORT_SYMBOL
(
os_file_type
);
EXPORT_SYMBOL
(
os_close_file
);
EXPORT_SYMBOL
(
helper_wait
);
EXPORT_SYMBOL
(
os_shutdown_socket
);
EXPORT_SYMBOL
(
os_connect_socket
);
...
...
@@ -58,3 +65,23 @@ EXPORT_SYMBOL(sys_lseek);
EXPORT_SYMBOL
(
sys_read
);
EXPORT_SYMBOL
(
sys_wait4
);
#ifdef CONFIG_SMP
/* required for SMP */
extern
void
FASTCALL
(
__write_lock_failed
(
rwlock_t
*
rw
));
EXPORT_SYMBOL_NOVERS
(
__write_lock_failed
);
extern
void
FASTCALL
(
__read_lock_failed
(
rwlock_t
*
rw
));
EXPORT_SYMBOL_NOVERS
(
__read_lock_failed
);
#endif
#ifdef CONFIG_HIGHMEM
EXPORT_SYMBOL
(
kmap
);
EXPORT_SYMBOL
(
kunmap
);
EXPORT_SYMBOL
(
kmap_atomic
);
EXPORT_SYMBOL
(
kunmap_atomic
);
EXPORT_SYMBOL
(
kmap_atomic_to_page
);
#endif
arch/um/kernel/process_kern.c
View file @
7f555b11
...
...
@@ -767,8 +767,8 @@ void set_thread_sc(void *sc)
int
smp_sigio_handler
(
void
)
{
int
cpu
=
current
->
thread_info
->
cpu
;
#ifdef CONFIG_SMP
int
cpu
=
current
->
thread_info
->
cpu
;
IPI_handler
(
cpu
);
if
(
cpu
!=
0
)
return
(
1
);
...
...
arch/um/kernel/reboot.c
View file @
7f555b11
/*
* Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
* Copyright (C) 2000
, 2002
Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
...
...
@@ -9,6 +9,20 @@
#include "kern.h"
#include "os.h"
#ifdef CONFIG_SMP
static
void
kill_idlers
(
int
me
)
{
struct
task_struct
*
p
;
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
idle_threads
)
/
sizeof
(
idle_threads
[
0
]);
i
++
){
p
=
idle_threads
[
i
];
if
((
p
!=
NULL
)
&&
(
p
->
thread
.
extern_pid
!=
me
))
os_kill_process
(
p
->
thread
.
extern_pid
);
}
}
#endif
static
void
kill_off_processes
(
void
)
{
struct
task_struct
*
p
;
...
...
@@ -21,6 +35,9 @@ static void kill_off_processes(void)
}
if
(
init_task
.
thread
.
extern_pid
!=
me
)
os_kill_process
(
init_task
.
thread
.
extern_pid
);
#ifdef CONFIG_SMP
kill_idlers
(
me
);
#endif
}
void
uml_cleanup
(
void
)
...
...
arch/um/kernel/signal_user.c
View file @
7f555b11
...
...
@@ -84,13 +84,13 @@ void unblock_signals(void)
#define SIGIO_BIT 0
#define SIGVTALRM_BIT 1
static
int
dis
able_mask
(
sigset_t
*
mask
)
static
int
en
able_mask
(
sigset_t
*
mask
)
{
int
sigs
;
sigs
=
sigismember
(
mask
,
SIGIO
)
?
1
<<
SIGIO_BIT
:
0
;
sigs
|=
sigismember
(
mask
,
SIGVTALRM
)
?
1
<<
SIGVTALRM_BIT
:
0
;
sigs
|=
sigismember
(
mask
,
SIGALRM
)
?
1
<<
SIGVTALRM_BIT
:
0
;
sigs
=
sigismember
(
mask
,
SIGIO
)
?
0
:
1
<<
SIGIO_BIT
;
sigs
|=
sigismember
(
mask
,
SIGVTALRM
)
?
0
:
1
<<
SIGVTALRM_BIT
;
sigs
|=
sigismember
(
mask
,
SIGALRM
)
?
0
:
1
<<
SIGVTALRM_BIT
;
return
(
sigs
);
}
...
...
@@ -100,30 +100,28 @@ int get_signals(void)
if
(
sigprocmask
(
SIG_SETMASK
,
NULL
,
&
mask
)
<
0
)
panic
(
"Failed to get signal mask"
);
return
(
dis
able_mask
(
&
mask
));
return
(
en
able_mask
(
&
mask
));
}
int
set_signals
(
int
dis
able
)
int
set_signals
(
int
en
able
)
{
sigset_t
mask
;
int
ret
;
sigemptyset
(
&
mask
);
if
(
!
(
disable
&
(
1
<<
SIGIO_BIT
)))
if
(
enable
&
(
1
<<
SIGIO_BIT
))
sigaddset
(
&
mask
,
SIGIO
);
if
(
!
(
disable
&
(
1
<<
SIGVTALRM_BIT
)
)){
if
(
enable
&
(
1
<<
SIGVTALRM_BIT
)){
sigaddset
(
&
mask
,
SIGVTALRM
);
sigaddset
(
&
mask
,
SIGALRM
);
}
if
(
sigprocmask
(
SIG_UNBLOCK
,
&
mask
,
&
mask
)
<
0
)
panic
(
"Failed to enable signals"
);
ret
=
disable_mask
(
&
mask
);
ret
=
enable_mask
(
&
mask
);
sigemptyset
(
&
mask
);
if
(
disable
&
(
1
<<
SIGIO_BIT
))
if
(
(
enable
&
(
1
<<
SIGIO_BIT
))
==
0
)
sigaddset
(
&
mask
,
SIGIO
);
if
(
disable
&
(
1
<<
SIGVTALRM_BIT
)
){
if
(
(
enable
&
(
1
<<
SIGVTALRM_BIT
))
==
0
){
sigaddset
(
&
mask
,
SIGVTALRM
);
sigaddset
(
&
mask
,
SIGALRM
);
}
...
...
arch/um/kernel/smp.c
View file @
7f555b11
...
...
@@ -47,6 +47,9 @@ int num_reschedules_sent = 0;
/* Small, random number, never changed */
unsigned
long
cache_decay_ticks
=
5
;
/* Not changed after boot */
struct
task_struct
*
idle_threads
[
NR_CPUS
];
void
smp_send_reschedule
(
int
cpu
)
{
write
(
cpu_data
[
cpu
].
ipi_pipe
[
1
],
"R"
,
1
);
...
...
@@ -142,6 +145,7 @@ static struct task_struct *idle_thread(int cpu)
cpu_tasks
[
cpu
]
=
((
struct
cpu_task
)
{
.
pid
=
new_task
->
thread
.
extern_pid
,
.
task
=
new_task
}
);
idle_threads
[
cpu
]
=
new_task
;
write
(
new_task
->
thread
.
switch_pipe
[
1
],
&
c
,
sizeof
(
c
));
return
(
new_task
);
}
...
...
arch/um/kernel/sys_call_table.c
View file @
7f555b11
...
...
@@ -229,6 +229,7 @@ extern syscall_handler_t sys_io_getevents;
extern
syscall_handler_t
sys_io_submit
;
extern
syscall_handler_t
sys_io_cancel
;
extern
syscall_handler_t
sys_exit_group
;
extern
syscall_handler_t
sys_lookup_dcookie
;
#if CONFIG_NFSD
#define NFSSERVCTL sys_nfsserctl
...
...
@@ -240,7 +241,7 @@ extern syscall_handler_t um_mount;
extern
syscall_handler_t
um_time
;
extern
syscall_handler_t
um_stime
;
#define LAST_GENERIC_SYSCALL __NR_
exit_group
#define LAST_GENERIC_SYSCALL __NR_
lookup_dcookie
#if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
#define LAST_SYSCALL LAST_GENERIC_SYSCALL
...
...
@@ -479,6 +480,7 @@ syscall_handler_t *sys_call_table[] = {
[
__NR_alloc_hugepages
]
=
sys_ni_syscall
,
[
__NR_free_hugepages
]
=
sys_ni_syscall
,
[
__NR_exit_group
]
=
sys_exit_group
,
[
__NR_lookup_dcookie
]
=
sys_lookup_dcookie
,
ARCH_SYSCALLS
[
LAST_SYSCALL
+
1
...
NR_syscalls
]
=
...
...
arch/um/kernel/sysrq.c
View file @
7f555b11
...
...
@@ -76,6 +76,16 @@ void show_trace(unsigned long * stack)
printk
(
"
\n
"
);
}
/*
* The architecture-independent dump_stack generator
*/
void
dump_stack
(
void
)
{
unsigned
long
stack
;
show_trace
(
&
stack
);
}
void
show_trace_task
(
struct
task_struct
*
tsk
)
{
unsigned
long
esp
=
PT_REGS_SP
(
&
tsk
->
thread
.
regs
);
...
...
arch/um/kernel/trap_kern.c
View file @
7f555b11
...
...
@@ -211,6 +211,7 @@ static struct chan_opts opts = {
xterm_title
:
"UML kernel debugger"
,
raw
:
0
,
tramp_stack
:
0
,
in_kernel
:
0
,
};
/* Accessed by the tracing thread, which automatically serializes access */
...
...
arch/um/os-Linux/file.c
View file @
7f555b11
...
...
@@ -283,10 +283,9 @@ int os_rcv_fd(int fd, int *helper_pid_out)
msg
.
msg_flags
=
0
;
n
=
recvmsg
(
fd
,
&
msg
,
0
);
if
(
n
<
0
){
printk
(
"rcv_fd : recvmsg failed - errno = %d
\n
"
,
errno
);
return
(
-
1
);
}
if
(
n
<
0
)
return
(
-
errno
);
else
if
(
n
!=
sizeof
(
iov
.
iov_len
))
*
helper_pid_out
=
-
1
;
...
...
arch/um/sys-i386/Makefile
View file @
7f555b11
obj-y
=
bugs.o checksum.o extable.o fault.o ksyms.o ldt.o
old-checksum.o
\
obj-y
=
bugs.o checksum.o extable.o fault.o ksyms.o ldt.o
\
ptrace.o ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o
obj-$(CONFIG_HIGHMEM)
+=
highmem.o
export-objs
=
ksyms.o
USER_OBJS
:=
bugs.o ptrace_user.o sigcontext.o fault.o
USER_OBJS
:=
$(
foreach
file,
$(USER_OBJS)
,arch/um/sys-i386/
$(file)
)
SYMLINKS
=
semaphore.c
old-checksum.c checksum.S extable
.c
SYMLINKS
=
semaphore.c
checksum.S extable.c highmem
.c
include
$(TOPDIR)/Rules.make
$(USER_OBJS)
:
%.o: %.c
$(CC)
$
(
CFLAGS_
$@
)
$(USER_CFLAGS)
-c
-o
$@
$<
arch/um/sys-i386/checksum.S
arch/um/sys-i386/old-checksum.c
:
arch/um/sys-i386/checksum.S
:
-
rm
-f
$@
-
ln
-s
$(TOPDIR)
/arch/i386/lib/
$(
notdir
$@
)
$@
...
...
@@ -25,6 +27,9 @@ arch/um/sys-i386/extable.c:
-
rm
-f
$@
-
ln
-s
$(TOPDIR)
/arch/i386/mm/
$(
notdir
$@
)
$@
arch/um/sys-i386/highmem.c
:
-
rm
-f
$@
-
ln
-s
$(TOPDIR)
/arch/i386/mm/
$(
notdir
$@
)
$@
clean
:
$(MAKE)
-C
util clean
...
...
arch/um/uml.lds.S
View file @
7f555b11
...
...
@@ -65,7 +65,7 @@ SECTIONS
.
uml.postsetup.init
:
{
*(
.
uml
.
postsetup
.
init
)
}
__uml_postsetup_end
=
.
;
__setup_start
=
.
;
.
setup.init
:
{
*(
.
setup
.
init
)
}
.
init.setup
:
{
*(
.
init
.
setup
)
}
__setup_end
=
.
;
__per_cpu_start
=
.
;
.
data.percpu
:
{
*(
.
data
.
percpu
)
}
...
...
include/asm-um/irq.h
View file @
7f555b11
...
...
@@ -23,8 +23,9 @@ struct task_struct;
#define WINCH_IRQ 10
#define SIGIO_WRITE_IRQ 11
#define TELNETD_IRQ 12
#define XTERM_IRQ 13
#define LAST_IRQ
TELNETD
_IRQ
#define LAST_IRQ
XTERM
_IRQ
#define NR_IRQS (LAST_IRQ + 1)
extern
int
um_request_irq
(
unsigned
int
irq
,
int
fd
,
int
type
,
...
...
include/asm-um/system-generic.h
View file @
7f555b11
...
...
@@ -18,9 +18,9 @@
extern
void
*
switch_to
(
void
*
prev
,
void
*
next
,
void
*
last
);
extern
int
set_signals
(
int
enable
);
extern
int
get_signals
(
void
);
extern
void
block_signals
(
void
);
extern
void
unblock_signals
(
void
);
extern
int
get_signals
(
void
);
#define local_save_flags(flags) do { (flags) = get_signals(); } while(0)
#define local_irq_restore(flags) do { set_signals(flags); } while(0)
...
...
@@ -31,11 +31,11 @@ extern int get_signals(void);
#define local_irq_enable() unblock_signals()
#define local_irq_disable() block_signals()
#define irqs_disabled()
\
({
\
unsigned long flags;
\
local_save_flags(flags);
\
(flags != 0);
\
#define irqs_disabled()
\
({
\
unsigned long flags;
\
local_save_flags(flags);
\
(flags == 0);
\
})
#endif
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