Commit 454f835d authored by Jeff Dike's avatar Jeff Dike

Merged a conflict in ptrace.h.

parents 1503e557 ee5ed0e4
......@@ -30,15 +30,11 @@ config RWSEM_GENERIC_SPINLOCK
bool
default y
config MODE_TT
bool
default y
config LOG_BUF_SHIFT
int
default 14
config MODE_SKAS
bool
default y
menu "Code maturity level options"
mmenu "Code maturity level options"
config EXPERIMENTAL
bool "Prompt for development and/or incomplete code/drivers"
......@@ -48,6 +44,37 @@ endmenu
menu "General Setup"
config MODE_TT
bool "Tracing thread support"
default y
help
This option controls whether tracing thread support is compiled
into UML. Normally, this should be set to Y. If you intend to
use only skas mode (and the host has the skas patch applied to it),
then it is OK to say N here.
config STATIC_LINK
bool "Force a static link"
default n
depends on !MODE_TT
help
If CONFIG_MODE_TT is disabled, then this option gives you the ability
to force a static link of UML. Normally, if only skas mode is built
in to UML, it will be linked as a shared binary. This is inconvenient
for use in a chroot jail. So, if you intend to run UML inside a
chroot, and you disable CONFIG_MODE_TT, you probably want to say Y
here.
config MODE_SKAS
bool "Separate Kernel Address Space support"
default y
help
This option controls whether skas (separate kernel address space)
support is compiled in. If you have applied the skas patch to the
host, then you certainly want to say Y here (and consider saying N
to CONFIG_MODE_TT). Otherwise, it is safe to say Y. Disabling this
option will shrink the UML binary slightly.
config NET
bool "Networking support"
......@@ -194,6 +221,10 @@ source "net/Kconfig"
source "fs/Kconfig"
source "security/Kconfig"
source "crypto/Kconfig"
source "lib/Kconfig"
menu "SCSI support"
......@@ -221,6 +252,9 @@ menu "Kernel hacking"
config DEBUG_SLAB
bool "Debug memory allocations"
config DEBUG_SPINLOCK
bool "Debug spinlocks usage"
config DEBUGSYM
bool "Enable kernel debugging symbols"
help
......@@ -232,6 +266,10 @@ config DEBUGSYM
If you're truly short on disk space or don't expect to report any
bugs back to the UML developers, say N, otherwise say Y.
config FRAME_POINTER
bool
default y if DEBUGSYM
config PT_PROXY
bool "Enable ptrace proxy"
depends on XTERM_CHAN && DEBUGSYM
......
......@@ -6,9 +6,6 @@
ARCH_DIR = arch/um
OS := $(shell uname -s)
EXTRAVERSION := $(EXTRAVERSION)-1um
include/linux/version.h: arch/$(ARCH)/Makefile
# Recalculate MODLIB to reflect the EXTRAVERSION changes (via KERNELRELEASE)
# The way the toplevel Makefile is written EXTRAVERSION is not supposed
# to be changed outside the toplevel Makefile, but recalculating MODLIB is
......@@ -21,17 +18,34 @@ CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS))
endif
CFLAGS-$(CONFIG_DEBUGSYM) += -g
CFLAGS-$(CONFIG_GCOV) += -fprofile-arcs -ftest-coverage
CFLAGS-$(CONFIG_GPROF) += $(PROFILE)
LINK-$(CONFIG_GPROF) += $(PROFILE) -Wl,--wrap,__monstartup
core-y += $(ARCH_DIR)/kernel/ \
$(ARCH_DIR)/drivers/ \
$(ARCH_DIR)/sys-$(SUBARCH)/
# Have to precede the include because the included Makefiles reference them.
SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \
include/asm-um/sigcontext.h include/asm-um/processor.h \
include/asm-um/ptrace.h include/asm-um/arch-signal.h
ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \
$(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h
GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h
include $(ARCH_DIR)/Makefile-$(SUBARCH)
include $(ARCH_DIR)/Makefile-os-$(OS)
MAKEFILE-$(CONFIG_MODE_TT) += Makefile-tt
MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas
ifneq ($(MAKEFILE-y),)
include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y))
endif
EXTRAVERSION := $(EXTRAVERSION)-1um
ARCH_INCLUDE = -I$(ARCH_DIR)/include
MODE_INCLUDE = -I$(ARCH_DIR)/kernel/tt/include \
-I$(ARCH_DIR)/kernel/skas/include
# -Derrno=kernel_errno - This turns all kernel references to errno into
# kernel_errno to separate them from the libc errno. This allows -fno-common
......@@ -46,23 +60,11 @@ LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \
include/asm-um/sigcontext.h include/asm-um/processor.h \
include/asm-um/ptrace.h include/asm-um/arch-signal.h
ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \
$(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h
ifeq ($(CONFIG_MODE_SKAS), y)
GEN_HEADERS = $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
$(SYS_HEADERS) : $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
endif
GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h
include $(ARCH_DIR)/Makefile-$(SUBARCH)
include $(ARCH_DIR)/Makefile-os-$(OS)
include/linux/version.h: arch/$(ARCH)/Makefile
$(ARCH_DIR)/vmlinux.lds.S :
touch $@
......@@ -73,16 +75,44 @@ LDFLAGS_vmlinux = -r
vmlinux: $(ARCH_DIR)/main.o
$(ARCH_DIR)/uml.lds.s : $(ARCH_DIR)/uml.lds.S scripts FORCE
$(call if_changed_dep,as_s_S)
# These aren't in Makefile-tt because they are needed in the !CONFIG_MODE_TT +
# CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case.
LINK_TT = -static
LD_SCRIPT_TT := uml.lds.s
ifeq ($(CONFIG_STATIC_LINK),y)
LINK-y += $(LINK_TT)
LD_SCRIPT-y := $(LD_SCRIPT_TT)
else
ifeq ($(CONFIG_MODE_TT),y)
LINK-y += $(LINK_TT)
LD_SCRIPT-y := $(LD_SCRIPT_TT)
else
ifeq ($(CONFIG_MODE_SKAS),y)
LINK-y += $(LINK_SKAS)
LD_SCRIPT-y := $(LD_SCRIPT_SKAS)
endif
endif
endif
AFLAGS_uml.lds.o = -U$(SUBARCH) -DSTART=$$(($(TOP_ADDR) - $(SIZE))) \
-DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT=\"$(ELF_FORMAT)\" -P -C -Uum
CPP_MODE_TT := $(shell [ "$(CONFIG_MODE_TT)" = "y" ] && echo -DMODE_TT)
CONFIG_KERNEL_STACK_ORDER ?= 2
STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
linux: $(ARCH_DIR)/uml.lds.s vmlinux
$(CC) -Wl,-T,$(ARCH_DIR)/uml.lds.s -static $(LINK-y) $(LINK_WRAPS) \
-o linux $(ARCH_DIR)/main.o vmlinux -L/usr/lib -lutil
AFLAGS_$(LD_SCRIPT-y:.s=).o = -U$(SUBARCH) \
-DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \
-DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \
-DKERNEL_STACK_SIZE=$(STACK_SIZE) -P -C -Uum
LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y)
$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE
$(call if_changed_dep,as_s_S)
linux: vmlinux $(LD_SCRIPT-y)
$(CC) -Wl,-T,$(LD_SCRIPT-y) $(LINK-y) $(LINK_WRAPS) \
-o linux $(ARCH_DIR)/main.o vmlinux -L/usr/lib -lutil
USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS))
......@@ -92,7 +122,8 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
# To get a definition of F_SETSIG
USER_CFLAGS += -D_GNU_SOURCE
CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/link.ld $(GEN_HEADERS)
CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \
$(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS)
$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c
$(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
......@@ -102,8 +133,7 @@ archmrproper:
do \
$(MAKE) -C $$d archmrproper; \
done
rm -f $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) include/asm \
$(ARCH_DIR)/link.ld \
rm -f $(CLEAN_FILES) $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) include/asm \
$(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS))
archclean: sysclean
......@@ -146,7 +176,4 @@ $(ARCH_DIR)/util/mk_task : $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h \
$(ARCH_DIR)/util: FORCE
@$(call descend,$@,)
$(ARCH_DIR)/kernel/skas/include/skas_ptregs.h :
$(MAKE) -C $(ARCH_DIR)/kernel/skas include/skas_ptregs.h
export SUBARCH USER_CFLAGS OS
#
# Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
# Licensed under the GPL
#
PROFILE += -pg
CFLAGS-$(CONFIG_GCOV) += -fprofile-arcs -ftest-coverage
CFLAGS-$(CONFIG_GPROF) += $(PROFILE)
LINK-$(CONFIG_GPROF) += $(PROFILE)
MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include
LINK_SKAS = -Wl,-rpath,/lib
LD_SCRIPT_SKAS = dyn.lds.s
GEN_HEADERS += $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
$(ARCH_DIR)/kernel/skas/include/skas_ptregs.h :
$(MAKE) -C $(ARCH_DIR)/kernel/skas include/skas_ptregs.h
#
# Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
# Licensed under the GPL
#
MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/tt/include
......@@ -2,11 +2,11 @@
# Automatically generated make config: don't edit
#
CONFIG_USERMODE=y
# CONFIG_ISA is not set
# CONFIG_SBUS is not set
# CONFIG_PCI is not set
CONFIG_MMU=y
CONFIG_SWAP=y
CONFIG_UID16=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_CONFIG_LOG_BUF_SHIFT=14
#
# Code maturity level options
......@@ -16,6 +16,8 @@ CONFIG_EXPERIMENTAL=y
#
# General Setup
#
CONFIG_MODE_TT=y
CONFIG_MODE_SKAS=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_BSD_PROCESS_ACCT=y
......@@ -32,6 +34,8 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_NEST_LEVEL=0
CONFIG_KERNEL_HALF_GIGS=1
# CONFIG_HIGHMEM is not set
CONFIG_PROC_MM=y
CONFIG_KERNEL_STACK_ORDER=2
#
# Loadable module support
......@@ -56,13 +60,9 @@ CONFIG_SSL_CHAN="pty"
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
# CONFIG_WATCHDOG is not set
# CONFIG_WATCHDOG_NOWAYOUT is not set
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_UML_WATCHDOG is not set
CONFIG_UML_SOUND=y
CONFIG_SOUND=y
CONFIG_HOSTAUDIO=y
# CONFIG_TTY_LOG is not set
#
# Block Devices
......@@ -87,13 +87,14 @@ CONFIG_UML_NET_SLIP=y
CONFIG_UML_NET_DAEMON=y
CONFIG_UML_NET_MCAST=y
# CONFIG_UML_NET_PCAP is not set
CONFIG_UML_NET_SLIRP=y
CONFIG_DUMMY=y
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
CONFIG_TUN=y
# CONFIG_ETHERTAP is not set
CONFIG_PPP=y
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_PPP_DEFLATE is not set
......@@ -104,6 +105,10 @@ CONFIG_SLIP=y
# CONFIG_SLIP_SMART is not set
# CONFIG_SLIP_MODE_SLIP6 is not set
#
# Networking support
#
#
# Networking options
#
......@@ -113,6 +118,7 @@ CONFIG_PACKET_MMAP=y
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
......@@ -122,6 +128,9 @@ CONFIG_INET=y
# CONFIG_ARPD is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_XFRM_USER is not set
# CONFIG_IPV6 is not set
#
......@@ -132,9 +141,6 @@ CONFIG_IPV6_SCTP__=y
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_DEV_APPLETALK is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_X25 is not set
......@@ -150,6 +156,35 @@ CONFIG_IPV6_SCTP__=y
#
# CONFIG_NET_SCHED is not set
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET is not set
#
# Ethernet (1000 Mbit)
#
#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set
#
# Token Ring devices (depends on LLC=y)
#
# CONFIG_SHAPER is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# File systems
#
......@@ -163,16 +198,14 @@ CONFIG_REISERFS_FS=m
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_ADFS_FS is not set
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
# CONFIG_JBD_DEBUG is not set
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
# CONFIG_UMSDOS_FS is not set
CONFIG_VFAT_FS=m
# CONFIG_EFS_FS is not set
CONFIG_JFFS_FS=y
......@@ -186,13 +219,9 @@ CONFIG_ISO9660_FS=m
# CONFIG_JOLIET is not set
# CONFIG_ZISOFS is not set
# CONFIG_JFS_FS is not set
# CONFIG_JFS_DEBUG is not set
# CONFIG_JFS_STATISTICS is not set
CONFIG_MINIX_FS=m
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
......@@ -200,17 +229,13 @@ CONFIG_DEVFS_MOUNT=y
# CONFIG_DEVFS_DEBUG is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UDF_FS is not set
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_XFS_FS is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_QUOTA is not set
#
# Network File Systems
......@@ -218,36 +243,18 @@ CONFIG_EXT2_FS=y
# CONFIG_CODA_FS is not set
# 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
# CONFIG_NCPFS_IOCTL_LOCKING is not set
# CONFIG_NCPFS_STRONG is not set
# CONFIG_NCPFS_NFS_NS is not set
# CONFIG_NCPFS_OS2_NS is not set
# 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
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_SMB_NLS is not set
CONFIG_NLS=y
#
......@@ -292,6 +299,21 @@ CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
#
# Security options
#
# CONFIG_SECURITY is not set
#
# Cryptographic options
#
# CONFIG_CRYPTO is not set
#
# Library routines
#
# CONFIG_CRC32 is not set
#
# SCSI support
#
......@@ -322,13 +344,6 @@ CONFIG_SCSI_DEBUG=y
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
# CONFIG_BLK_DEV_MD is not set
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID5 is not set
# CONFIG_MD_MULTIPATH is not set
# CONFIG_BLK_DEV_LVM is not set
#
# Memory Technology Devices (MTD)
......@@ -337,8 +352,6 @@ 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
......@@ -353,28 +366,18 @@ CONFIG_MTD_BLOCK=y
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
# CONFIG_MTD_GEN_PROBE is not set
# CONFIG_MTD_CFI_INTELEXT is not set
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_AMDSTD is not set
# CONFIG_MTD_SHARP is not set
# CONFIG_MTD_JEDEC is not set
#
# 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
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_MTDRAM is not set
CONFIG_MTD_BLKMTD=m
......@@ -385,7 +388,6 @@ CONFIG_MTD_BLKMTD=m
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOCPROBE is not set
#
# NAND Flash Device Drivers
......@@ -396,7 +398,9 @@ CONFIG_MTD_BLKMTD=m
# Kernel hacking
#
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
CONFIG_DEBUGSYM=y
CONFIG_FRAME_POINTER=y
CONFIG_PT_PROXY=y
# CONFIG_GPROF is not set
# CONFIG_GCOV is not set
......@@ -75,15 +75,15 @@ static void not_configged_free(void *data)
}
static struct chan_ops not_configged_ops = {
init: not_configged_init,
open: not_configged_open,
close: not_configged_close,
read: not_configged_read,
write: not_configged_write,
console_write: not_configged_console_write,
window_size: not_configged_window_size,
free: not_configged_free,
winch: 0,
.init = not_configged_init,
.open = not_configged_open,
.close = not_configged_close,
.read = not_configged_read,
.write = not_configged_write,
.console_write = not_configged_console_write,
.window_size = not_configged_window_size,
.free = not_configged_free,
.winch = 0,
};
static void tty_receive_char(struct tty_struct *tty, char ch)
......@@ -395,15 +395,15 @@ static struct chan *parse_chan(char *str, int pri, int device,
chan = kmalloc(sizeof(*chan), GFP_KERNEL);
if(chan == NULL) return(NULL);
*chan = ((struct chan) { list : LIST_HEAD_INIT(chan->list),
primary : 1,
input : 0,
output : 0,
opened : 0,
fd : -1,
pri : pri,
ops : ops,
data : data });
*chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list),
.primary = 1,
.input = 0,
.output = 0,
.opened = 0,
.fd = -1,
.pri = pri,
.ops = ops,
.data = data });
return(chan);
}
......
......@@ -159,9 +159,9 @@ static int winch_tramp(int fd, void *device_data, int *fd_out)
return(err);
}
data = ((struct winch_data) { pty_fd : fd,
pipe_fd : fds[1],
close_me : fds[0] } );
data = ((struct winch_data) { .pty_fd = fd,
.pipe_fd = fds[1],
.close_me = fds[0] } );
pid = run_helper_thread(winch_thread, &data, 0, &stack, 0);
if(pid < 0){
printk("fork of winch_thread failed - errno = %d\n", errno);
......
......@@ -28,14 +28,14 @@ void daemon_init(struct net_device *dev, void *data)
pri = dev->priv;
dpri = (struct daemon_data *) pri->user;
*dpri = ((struct daemon_data)
{ sock_type : init->sock_type,
ctl_sock : init->ctl_sock,
ctl_addr : NULL,
data_addr : NULL,
local_addr : NULL,
fd : -1,
control : -1,
dev : dev });
{ .sock_type = init->sock_type,
.ctl_sock = init->ctl_sock,
.ctl_addr = NULL,
.data_addr = NULL,
.local_addr = NULL,
.fd = -1,
.control = -1,
.dev = dev });
printk("daemon backend (uml_switch version %d) - %s:%s",
SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock);
......@@ -59,10 +59,10 @@ static int daemon_write(int fd, struct sk_buff **skb,
}
static struct net_kern_info daemon_kern_info = {
init: daemon_init,
protocol: eth_protocol,
read: daemon_read,
write: daemon_write,
.init = daemon_init,
.protocol = eth_protocol,
.read = daemon_read,
.write = daemon_write,
};
int daemon_setup(char *str, char **mac_out, void *data)
......@@ -71,8 +71,8 @@ int daemon_setup(char *str, char **mac_out, void *data)
char *remain;
*init = ((struct daemon_init)
{ sock_type : "unix",
ctl_sock : "/tmp/uml.ctl" });
{ .sock_type = "unix",
.ctl_sock = "/tmp/uml.ctl" });
remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock,
NULL);
......@@ -84,13 +84,13 @@ int daemon_setup(char *str, char **mac_out, void *data)
}
static struct transport daemon_transport = {
list : LIST_HEAD_INIT(daemon_transport.list),
name : "daemon",
setup : daemon_setup,
user : &daemon_user_info,
kern : &daemon_kern_info,
private_size : sizeof(struct daemon_data),
setup_size : sizeof(struct daemon_init),
.list = LIST_HEAD_INIT(daemon_transport.list),
.name = "daemon",
.setup = daemon_setup,
.user = &daemon_user_info,
.kern = &daemon_kern_info,
.private_size = sizeof(struct daemon_data),
.setup_size = sizeof(struct daemon_init),
};
static int register_daemon(void)
......
......@@ -173,14 +173,14 @@ static int daemon_set_mtu(int mtu, void *data)
}
struct net_user_info daemon_user_info = {
init: daemon_user_init,
open: daemon_open,
close: NULL,
remove: daemon_remove,
set_mtu: daemon_set_mtu,
add_address: NULL,
delete_address: NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER
.init = daemon_user_init,
.open = daemon_open,
.close = NULL,
.remove = daemon_remove,
.set_mtu = daemon_set_mtu,
.add_address = NULL,
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
};
/*
......
......@@ -36,8 +36,8 @@ void *fd_init(char *str, int device, struct chan_opts *opts)
return(NULL);
}
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct fd_chan) { fd : n,
raw : opts->raw });
*data = ((struct fd_chan) { .fd = n,
.raw = opts->raw });
return(data);
}
......@@ -72,16 +72,16 @@ int fd_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops fd_ops = {
type: "fd",
init: fd_init,
open: fd_open,
close: fd_close,
read: generic_read,
write: generic_write,
console_write: fd_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 1,
.type = "fd",
.init = fd_init,
.open = fd_open,
.close = fd_close,
.read = generic_read,
.write = generic_write,
.console_write = fd_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 1,
};
/*
......
......@@ -145,17 +145,17 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
}
static struct file_operations harddog_fops = {
owner: THIS_MODULE,
write: harddog_write,
ioctl: harddog_ioctl,
open: harddog_open,
release: harddog_release,
.owner = THIS_MODULE,
.write = harddog_write,
.ioctl = harddog_ioctl,
.open = harddog_open,
.release = harddog_release,
};
static struct miscdevice harddog_miscdev = {
minor: WATCHDOG_MINOR,
name: "watchdog",
fops: &harddog_fops,
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &harddog_fops,
};
static char banner[] __initdata = KERN_INFO "UML Watchdog Timer\n";
......
......@@ -195,23 +195,23 @@ static int hostmixer_release(struct inode *inode, struct file *file)
/* kernel module operations */
static struct file_operations hostaudio_fops = {
owner: THIS_MODULE,
llseek: no_llseek,
read: hostaudio_read,
write: hostaudio_write,
poll: hostaudio_poll,
ioctl: hostaudio_ioctl,
mmap: NULL,
open: hostaudio_open,
release: hostaudio_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = hostaudio_read,
.write = hostaudio_write,
.poll = hostaudio_poll,
.ioctl = hostaudio_ioctl,
.mmap = NULL,
.open = hostaudio_open,
.release = hostaudio_release,
};
static struct file_operations hostmixer_fops = {
owner: THIS_MODULE,
llseek: no_llseek,
ioctl: hostmixer_ioctl_mixdev,
open: hostmixer_open_mixdev,
release: hostmixer_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = hostmixer_ioctl_mixdev,
.open = hostmixer_open_mixdev,
.release = hostmixer_release,
};
struct {
......
......@@ -35,7 +35,7 @@ void line_timer_cb(void *arg)
line_interrupt(dev->driver->read_irq, dev, NULL);
}
void buffer_data(struct line *line, const char *buf, int len)
static void buffer_data(struct line *line, const char *buf, int len)
{
int end;
......@@ -452,11 +452,19 @@ void line_register_devfs(struct lines *set, struct line_driver *line_driver,
void lines_init(struct line *lines, int nlines)
{
struct line *line;
int i;
for(i = 0; i < nlines; i++){
INIT_LIST_HEAD(&lines[i].chan_list);
sema_init(&lines[i].sem, 1);
line = &lines[i];
INIT_LIST_HEAD(&line->chan_list);
sema_init(&line->sem, 1);
if(line->init_str != NULL){
line->init_str = uml_strdup(line->init_str);
if(line->init_str == NULL)
printk("lines_init - uml_strdup returned "
"NULL\n");
}
}
}
......@@ -511,11 +519,11 @@ void register_winch_irq(int fd, int tty_fd, int pid, void *line)
printk("register_winch_irq - kmalloc failed\n");
goto out;
}
*winch = ((struct winch) { list : LIST_HEAD_INIT(winch->list),
fd : fd,
tty_fd : tty_fd,
pid : pid,
line : line });
*winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list),
.fd = fd,
.tty_fd = tty_fd,
.pid = pid,
.line = line });
list_add(&winch->list, &winch_handlers);
if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
......@@ -533,7 +541,8 @@ static void winch_cleanup(void)
list_for_each(ele, &winch_handlers){
winch = list_entry(ele, struct winch, list);
close(winch->fd);
if(winch->pid != -1) os_kill_process(winch->pid, 0);
if(winch->pid != -1)
os_kill_process(winch->pid, 1);
}
}
......
......@@ -36,11 +36,11 @@ void mcast_init(struct net_device *dev, void *data)
pri = dev->priv;
dpri = (struct mcast_data *) pri->user;
*dpri = ((struct mcast_data)
{ addr : init->addr,
port : init->port,
ttl : init->ttl,
mcast_addr : NULL,
dev : dev });
{ .addr = init->addr,
.port = init->port,
.ttl = init->ttl,
.mcast_addr = NULL,
.dev = dev });
printk("mcast backend ");
printk("multicast adddress: %s:%u, TTL:%u ",
dpri->addr, dpri->port, dpri->ttl);
......@@ -64,10 +64,10 @@ static int mcast_write(int fd, struct sk_buff **skb,
}
static struct net_kern_info mcast_kern_info = {
init: mcast_init,
protocol: eth_protocol,
read: mcast_read,
write: mcast_write,
.init = mcast_init,
.protocol = eth_protocol,
.read = mcast_read,
.write = mcast_write,
};
int mcast_setup(char *str, char **mac_out, void *data)
......@@ -78,9 +78,9 @@ int mcast_setup(char *str, char **mac_out, void *data)
int n;
*init = ((struct mcast_init)
{ addr : "239.192.168.1",
port : 1102,
ttl : 1 });
{ .addr = "239.192.168.1",
.port = 1102,
.ttl = 1 });
remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str,
NULL);
......@@ -116,13 +116,13 @@ int mcast_setup(char *str, char **mac_out, void *data)
}
static struct transport mcast_transport = {
list : LIST_HEAD_INIT(mcast_transport.list),
name : "mcast",
setup : mcast_setup,
user : &mcast_user_info,
kern : &mcast_kern_info,
private_size : sizeof(struct mcast_data),
setup_size : sizeof(struct mcast_init),
.list = LIST_HEAD_INIT(mcast_transport.list),
.name = "mcast",
.setup = mcast_setup,
.user = &mcast_user_info,
.kern = &mcast_kern_info,
.private_size = sizeof(struct mcast_data),
.setup_size = sizeof(struct mcast_init),
};
static int register_mcast(void)
......
......@@ -153,14 +153,14 @@ static int mcast_set_mtu(int mtu, void *data)
}
struct net_user_info mcast_user_info = {
init: mcast_user_init,
open: mcast_open,
close: mcast_close,
remove: NULL,
set_mtu: mcast_set_mtu,
add_address: NULL,
delete_address: NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER
.init = mcast_user_init,
.open = mcast_open,
.close = mcast_close,
.remove = NULL,
.set_mtu = mcast_set_mtu,
.add_address = NULL,
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
};
/*
......
......@@ -36,8 +36,8 @@ static int do_unlink_socket(struct notifier_block *notifier,
static struct notifier_block reboot_notifier = {
notifier_call: do_unlink_socket,
priority: 0,
.notifier_call = do_unlink_socket,
.priority = 0,
};
/* Safe without explicit locking for now. Tasklets provide their own
......@@ -418,9 +418,9 @@ static int notify_panic(struct notifier_block *self, unsigned long unused1,
}
static struct notifier_block panic_exit_notifier = {
notifier_call : notify_panic,
next : NULL,
priority : 1
.notifier_call = notify_panic,
.next = NULL,
.priority = 1
};
static int add_notifier(void)
......
......@@ -106,13 +106,13 @@ mmapper_release(struct inode *inode, struct file *file)
}
static struct file_operations mmapper_fops = {
owner: THIS_MODULE,
read: mmapper_read,
write: mmapper_write,
ioctl: mmapper_ioctl,
mmap: mmapper_mmap,
open: mmapper_open,
release: mmapper_release,
.owner = THIS_MODULE,
.read = mmapper_read,
.write = mmapper_write,
.ioctl = mmapper_ioctl,
.mmap = mmapper_mmap,
.open = mmapper_open,
.release = mmapper_release,
};
static int __init mmapper_init(void)
......
......@@ -368,22 +368,22 @@ static int eth_configure(int n, void *init, char *mac,
*/
save = lp->user[0];
*lp = ((struct uml_net_private)
{ list : LIST_HEAD_INIT(lp->list),
lock : SPIN_LOCK_UNLOCKED,
dev : dev,
fd : -1,
mac : { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
have_mac : device->have_mac,
protocol : transport->kern->protocol,
open : transport->user->open,
close : transport->user->close,
remove : transport->user->remove,
read : transport->kern->read,
write : transport->kern->write,
add_address : transport->user->add_address,
delete_address : transport->user->delete_address,
set_mtu : transport->user->set_mtu,
user : { save } });
{ .list = LIST_HEAD_INIT(lp->list),
.lock = SPIN_LOCK_UNLOCKED,
.dev = dev,
.fd = -1,
.mac = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
.have_mac = device->have_mac,
.protocol = transport->kern->protocol,
.open = transport->user->open,
.close = transport->user->close,
.remove = transport->user->remove,
.read = transport->kern->read,
.write = transport->kern->write,
.add_address = transport->user->add_address,
.delete_address = transport->user->delete_address,
.set_mtu = transport->user->set_mtu,
.user = { save } });
init_timer(&lp->tl);
lp->tl.function = uml_net_user_timer_expire;
memset(&lp->stats, 0, sizeof(lp->stats));
......@@ -542,9 +542,9 @@ static int eth_setup(char *str)
printk("eth_init : alloc_bootmem failed\n");
return(1);
}
*new = ((struct eth_init) { list : LIST_HEAD_INIT(new->list),
index : n,
init : str });
*new = ((struct eth_init) { .list = LIST_HEAD_INIT(new->list),
.index = n,
.init = str });
list_add_tail(&new->list, &eth_cmd_line);
return(1);
}
......@@ -618,9 +618,10 @@ static int net_remove(char *str)
}
static struct mc_device net_mc = {
name: "eth",
config: net_config,
remove: net_remove,
.name = "eth",
.config = net_config,
.get_config = NULL,
.remove = net_remove,
};
static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
......@@ -662,7 +663,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
}
struct notifier_block uml_inetaddr_notifier = {
notifier_call: uml_inetaddr_event,
.notifier_call = uml_inetaddr_event,
};
static int uml_net_init(void)
......
......@@ -32,16 +32,16 @@ void null_free(void *data)
}
struct chan_ops null_ops = {
type: "null",
init: null_init,
open: null_open,
close: generic_close,
read: null_read,
write: generic_write,
console_write: generic_console_write,
window_size: generic_window_size,
free: null_free,
winch: 0,
.type = "null",
.init = null_init,
.open = null_open,
.close = generic_close,
.read = null_read,
.write = generic_write,
.console_write = generic_console_write,
.window_size = generic_window_size,
.free = null_free,
.winch = 0,
};
/*
......
......@@ -27,12 +27,12 @@ void pcap_init(struct net_device *dev, void *data)
pri = dev->priv;
ppri = (struct pcap_data *) pri->user;
*ppri = ((struct pcap_data)
{ host_if : init->host_if,
promisc : init->promisc,
optimize : init->optimize,
filter : init->filter,
compiled : NULL,
pcap : NULL });
{ .host_if = init->host_if,
.promisc = init->promisc,
.optimize = init->optimize,
.filter = init->filter,
.compiled = NULL,
.pcap = NULL });
}
static int pcap_read(int fd, struct sk_buff **skb,
......@@ -51,10 +51,10 @@ static int pcap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
}
static struct net_kern_info pcap_kern_info = {
init: pcap_init,
protocol: eth_protocol,
read: pcap_read,
write: pcap_write,
.init = pcap_init,
.protocol = eth_protocol,
.read = pcap_read,
.write = pcap_write,
};
int pcap_setup(char *str, char **mac_out, void *data)
......@@ -64,10 +64,10 @@ int pcap_setup(char *str, char **mac_out, void *data)
int i;
*init = ((struct pcap_init)
{ host_if : "eth0",
promisc : 1,
optimize : 0,
filter : NULL });
{ .host_if = "eth0",
.promisc = 1,
.optimize = 0,
.filter = NULL });
remain = split_if_spec(str, &host_if, &init->filter,
&options[0], &options[1], NULL);
......@@ -98,13 +98,13 @@ int pcap_setup(char *str, char **mac_out, void *data)
}
static struct transport pcap_transport = {
list : LIST_HEAD_INIT(pcap_transport.list),
name : "pcap",
setup : pcap_setup,
user : &pcap_user_info,
kern : &pcap_kern_info,
private_size : sizeof(struct pcap_data),
setup_size : sizeof(struct pcap_init),
.list = LIST_HEAD_INIT(pcap_transport.list),
.name = "pcap",
.setup = pcap_setup,
.user = &pcap_user_info,
.kern = &pcap_kern_info,
.private_size = sizeof(struct pcap_data),
.setup_size = sizeof(struct pcap_init),
};
static int register_pcap(void)
......
......@@ -106,8 +106,8 @@ static void handler(u_char *data, const struct pcap_pkthdr *header,
int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri)
{
struct pcap_handler_data hdata = ((struct pcap_handler_data)
{ buffer : buffer,
len : len });
{ .buffer = buffer,
.len = len });
int n;
n = pcap_dispatch(pri->pcap, 1, handler, (u_char *) &hdata);
......@@ -121,14 +121,14 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri)
}
struct net_user_info pcap_user_info = {
init: pcap_user_init,
open: pcap_open,
close: NULL,
remove: pcap_remove,
set_mtu: NULL,
add_address: NULL,
delete_address: NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER
.init = pcap_user_init,
.open = pcap_open,
.close = NULL,
.remove = pcap_remove,
.set_mtu = NULL,
.add_address = NULL,
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
};
/*
......
......@@ -31,7 +31,6 @@ struct port_list {
struct port_dev {
struct port_list *port;
int fd;
int helper_pid;
int telnetd_pid;
};
......@@ -55,7 +54,8 @@ static void pipe_interrupt(int irq, void *data, struct pt_regs *regs)
if(fd == -EAGAIN)
return;
printk("os_rcv_fd returned %d\n", -fd);
printk(KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n",
-fd);
os_close_file(conn->fd);
}
......@@ -75,26 +75,29 @@ static int port_accept(struct port_list *port)
fd = port_connection(port->fd, socket, &pid);
if(fd < 0){
if(fd != -EAGAIN)
printk("port_connection returned %d\n", -fd);
printk(KERN_ERR "port_accept : port_connection "
"returned %d\n", -fd);
goto out;
}
conn = kmalloc(sizeof(*conn), GFP_ATOMIC);
if(conn == NULL){
printk("port_interrupt : failed to allocate connection\n");
printk(KERN_ERR "port_accept : failed to allocate "
"connection\n");
goto out_close;
}
*conn = ((struct connection)
{ list : LIST_HEAD_INIT(conn->list),
fd : fd,
socket : { socket[0], socket[1] },
telnetd_pid : pid,
port : port });
{ .list = LIST_HEAD_INIT(conn->list),
.fd = fd,
.socket = { socket[0], socket[1] },
.telnetd_pid = pid,
.port = port });
if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
"telnetd", conn)){
printk(KERN_ERR "Failed to get IRQ for telnetd\n");
printk(KERN_ERR "port_accept : failed to get IRQ for "
"telnetd\n");
goto out_free;
}
......@@ -106,7 +109,8 @@ static int port_accept(struct port_list *port)
kfree(conn);
out_close:
os_close_file(fd);
if(pid != -1) os_kill_process(pid, 0);
if(pid != -1)
os_kill_process(pid, 1);
out:
return(ret);
}
......@@ -174,14 +178,15 @@ void *port_data(int port_num)
}
*port = ((struct port_list)
{ 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 = 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:
......@@ -191,9 +196,9 @@ void *port_data(int port_num)
goto out;
}
*dev = ((struct port_dev) { port : port,
fd : -1,
helper_pid : -1 });
*dev = ((struct port_dev) { .port = port,
.helper_pid = -1,
.telnetd_pid = -1 });
goto out;
out_free:
......@@ -205,38 +210,16 @@ void *port_data(int port_num)
return(dev);
}
void port_remove_dev(void *d)
{
struct port_dev *dev = d;
if(dev->helper_pid != -1)
os_kill_process(dev->helper_pid, 0);
if(dev->telnetd_pid != -1)
os_kill_process(dev->telnetd_pid, 0);
dev->helper_pid = -1;
}
static void free_port(void)
{
struct list_head *ele;
struct port_list *port;
list_for_each(ele, &ports){
port = list_entry(ele, struct port_list, list);
os_close_file(port->fd);
}
}
__uml_exitcall(free_port);
int port_wait(void *data)
{
struct port_dev *dev = data;
struct connection *conn;
struct port_list *port = dev->port;
int fd;
while(1){
if(down_interruptible(&port->sem)) return(-ERESTARTSYS);
if(down_interruptible(&port->sem))
return(-ERESTARTSYS);
spin_lock(&port->lock);
......@@ -263,21 +246,48 @@ int port_wait(void *data)
kfree(conn);
}
dev->fd = conn->fd;
fd = conn->fd;
dev->helper_pid = conn->helper_pid;
dev->telnetd_pid = conn->telnetd_pid;
kfree(conn);
return(dev->fd);
return(fd);
}
void port_remove_dev(void *d)
{
struct port_dev *dev = d;
if(dev->helper_pid != -1)
os_kill_process(dev->helper_pid, 0);
if(dev->telnetd_pid != -1)
os_kill_process(dev->telnetd_pid, 1);
dev->helper_pid = -1;
dev->telnetd_pid = -1;
}
void port_kern_free(void *d)
{
struct port_dev *dev = d;
port_remove_dev(dev);
kfree(dev);
}
static void free_port(void)
{
struct list_head *ele;
struct port_list *port;
list_for_each(ele, &ports){
port = list_entry(ele, struct port_list, list);
free_irq_by_fd(port->fd);
os_close_file(port->fd);
}
}
__uml_exitcall(free_port);
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
......
......@@ -47,14 +47,28 @@ void *port_init(char *str, int device, struct chan_opts *opts)
return(NULL);
}
if((kern_data = port_data(port)) == NULL) return(NULL);
if((kern_data = port_data(port)) == NULL)
return(NULL);
if((data = um_kmalloc(sizeof(*data))) == NULL)
goto err;
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct port_chan) { raw : opts->raw,
kernel_data : kern_data });
*data = ((struct port_chan) { .raw = opts->raw,
.kernel_data = kern_data });
sprintf(data->dev, "%d", port);
return(data);
err:
port_kern_free(kern_data);
return(NULL);
}
void port_free(void *d)
{
struct port_chan *data = d;
port_kern_free(data->kernel_data);
kfree(data);
}
int port_open(int input, int output, int primary, void *d, char **dev_out)
......@@ -86,25 +100,17 @@ int port_console_write(int fd, const char *buf, int n, void *d)
return(generic_console_write(fd, buf, n, &data->tt));
}
void port_free(void *d)
{
struct port_chan *data = d;
port_kern_free(data->kernel_data);
kfree(data);
}
struct chan_ops port_ops = {
type: "port",
init: port_init,
open: port_open,
close: port_close,
read: generic_read,
write: generic_write,
console_write: port_console_write,
window_size: generic_window_size,
free: port_free,
winch: 1,
.type = "port",
.init = port_init,
.open = port_open,
.close = port_close,
.read = generic_read,
.write = generic_write,
.console_write = port_console_write,
.window_size = generic_window_size,
.free = port_free,
.winch = 1,
};
int port_listen_fd(int port)
......@@ -113,7 +119,8 @@ int port_listen_fd(int port)
int fd, err;
fd = socket(PF_INET, SOCK_STREAM, 0);
if(fd == -1) return(-errno);
if(fd == -1)
return(-errno);
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
......@@ -163,14 +170,16 @@ int port_connection(int fd, int *socket, int *pid_out)
return(-errno);
err = os_pipe(socket, 0, 0);
if(err) goto out_close;
if(err)
goto out_close;
data = ((struct port_pre_exec_data)
{ sock_fd : new,
pipe_fd : socket[1] });
{ .sock_fd = new,
.pipe_fd = socket[1] });
err = run_helper(port_pre_exec, &data, argv, NULL);
if(err < 0) goto out_shutdown;
if(err < 0)
goto out_shutdown;
*pid_out = err;
return(new);
......
/*
* Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
* Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
......@@ -27,9 +27,9 @@ void *pty_chan_init(char *str, int device, struct chan_opts *opts)
struct pty_chan *data;
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct pty_chan) { announce : opts->announce,
dev : device,
raw : opts->raw });
*data = ((struct pty_chan) { .announce = opts->announce,
.dev = device,
.raw = opts->raw });
return(data);
}
......@@ -86,34 +86,15 @@ int getmaster(char *line)
return(-1);
}
struct grantpt_info {
int fd;
int res;
int err;
};
static void grantpt_cb(void *arg)
{
struct grantpt_info *info = arg;
info->res = grantpt(info->fd);
info->err = errno;
}
int pty_open(int input, int output, int primary, void *d, char **dev_out)
{
struct pty_chan *data = d;
int fd;
char dev[sizeof("/dev/ptyxx\0")] = "/dev/ptyxx";
struct grantpt_info info;
fd = getmaster(dev);
if(fd < 0) return(-errno);
info.fd = fd;
initial_thread_cb(grantpt_cb, &info);
unlockpt(fd);
if(data->raw) raw(fd, 0);
if(data->announce) (*data->announce)(dev, data->dev);
......@@ -130,29 +111,29 @@ int pty_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops pty_ops = {
type: "pty",
init: pty_chan_init,
open: pty_open,
close: generic_close,
read: generic_read,
write: generic_write,
console_write: pty_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 0,
.type = "pty",
.init = pty_chan_init,
.open = pty_open,
.close = generic_close,
.read = generic_read,
.write = generic_write,
.console_write = pty_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
};
struct chan_ops pts_ops = {
type: "pts",
init: pty_chan_init,
open: pts_open,
close: generic_close,
read: generic_read,
write: generic_write,
console_write: pty_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 0,
.type = "pts",
.init = pty_chan_init,
.open = pts_open,
.close = generic_close,
.read = generic_read,
.write = generic_write,
.console_write = pty_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
};
/*
......
......@@ -22,15 +22,15 @@ void slip_init(struct net_device *dev, void *data)
private = dev->priv;
spri = (struct slip_data *) private->user;
*spri = ((struct slip_data)
{ name : { '\0' },
addr: NULL,
gate_addr : init->gate_addr,
slave : -1,
ibuf : { '\0' },
obuf : { '\0' },
pos : 0,
esc : 0,
dev : dev });
{ .name = { '\0' },
.addr = NULL,
.gate_addr = init->gate_addr,
.slave = -1,
.ibuf = { '\0' },
.obuf = { '\0' },
.pos = 0,
.esc = 0,
.dev = dev });
dev->init = NULL;
dev->hard_header_len = 0;
......@@ -61,10 +61,10 @@ static int slip_write(int fd, struct sk_buff **skb,
}
struct net_kern_info slip_kern_info = {
init: slip_init,
protocol: slip_protocol,
read: slip_read,
write: slip_write,
.init = slip_init,
.protocol = slip_protocol,
.read = slip_read,
.write = slip_write,
};
static int slip_setup(char *str, char **mac_out, void *data)
......@@ -72,7 +72,7 @@ static int slip_setup(char *str, char **mac_out, void *data)
struct slip_init *init = data;
*init = ((struct slip_init)
{ gate_addr : NULL });
{ .gate_addr = NULL });
if(str[0] != '\0')
init->gate_addr = str;
......@@ -80,13 +80,13 @@ static int slip_setup(char *str, char **mac_out, void *data)
}
static struct transport slip_transport = {
list : LIST_HEAD_INIT(slip_transport.list),
name : "slip",
setup : slip_setup,
user : &slip_user_info,
kern : &slip_kern_info,
private_size : sizeof(struct slip_data),
setup_size : sizeof(struct slip_init),
.list = LIST_HEAD_INIT(slip_transport.list),
.name = "slip",
.setup = slip_setup,
.user = &slip_user_info,
.kern = &slip_kern_info,
.private_size = sizeof(struct slip_data),
.setup_size = sizeof(struct slip_init),
};
static int register_slip(void)
......
......@@ -257,14 +257,14 @@ static void slip_del_addr(unsigned char *addr, unsigned char *netmask,
}
struct net_user_info slip_user_info = {
init: slip_user_init,
open: slip_open,
close: slip_close,
remove: NULL,
set_mtu: slip_set_mtu,
add_address: slip_add_addr,
delete_address: slip_del_addr,
max_packet: BUF_SIZE
.init = slip_user_init,
.open = slip_open,
.close = slip_close,
.remove = NULL,
.set_mtu = slip_set_mtu,
.add_address = slip_add_addr,
.delete_address = slip_del_addr,
.max_packet = BUF_SIZE
};
/*
......
......@@ -22,14 +22,14 @@ void slirp_init(struct net_device *dev, void *data)
private = dev->priv;
spri = (struct slirp_data *) private->user;
*spri = ((struct slirp_data)
{ argw : init->argw,
pid : -1,
slave : -1,
ibuf : { '\0' },
obuf : { '\0' },
pos : 0,
esc : 0,
dev : dev });
{ .argw = init->argw,
.pid = -1,
.slave = -1,
.ibuf = { '\0' },
.obuf = { '\0' },
.pos = 0,
.esc = 0,
.dev = dev });
dev->init = NULL;
dev->hard_header_len = 0;
......@@ -64,10 +64,10 @@ static int slirp_write(int fd, struct sk_buff **skb,
}
struct net_kern_info slirp_kern_info = {
init: slirp_init,
protocol: slirp_protocol,
read: slirp_read,
write: slirp_write,
.init = slirp_init,
.protocol = slirp_protocol,
.read = slirp_read,
.write = slirp_write,
};
static int slirp_setup(char *str, char **mac_out, void *data)
......@@ -103,13 +103,13 @@ static int slirp_setup(char *str, char **mac_out, void *data)
}
static struct transport slirp_transport = {
list : LIST_HEAD_INIT(slirp_transport.list),
name : "slirp",
setup : slirp_setup,
user : &slirp_user_info,
kern : &slirp_kern_info,
private_size : sizeof(struct slirp_data),
setup_size : sizeof(struct slirp_init),
.list = LIST_HEAD_INIT(slirp_transport.list),
.name = "slirp",
.setup = slirp_setup,
.user = &slirp_user_info,
.kern = &slirp_kern_info,
.private_size = sizeof(struct slirp_data),
.setup_size = sizeof(struct slirp_init),
};
static int register_slirp(void)
......
......@@ -180,14 +180,14 @@ static int slirp_set_mtu(int mtu, void *data)
}
struct net_user_info slirp_user_info = {
init: slirp_user_init,
open: slirp_open,
close: slirp_close,
remove: NULL,
set_mtu: slirp_set_mtu,
add_address: NULL,
delete_address: NULL,
max_packet: BUF_SIZE
.init = slirp_user_init,
.open = slirp_open,
.close = slirp_close,
.remove = NULL,
.set_mtu = slirp_set_mtu,
.add_address = NULL,
.delete_address = NULL,
.max_packet = BUF_SIZE
};
/*
......
......@@ -41,11 +41,11 @@ void ssl_announce(char *dev_name, int dev)
}
static struct chan_opts opts = {
announce: ssl_announce,
xterm_title: "Serial Line #%d",
raw: 1,
tramp_stack : 0,
in_kernel : 1,
.announce = ssl_announce,
.xterm_title = "Serial Line #%d",
.raw = 1,
.tramp_stack = 0,
.in_kernel = 1,
};
static int ssl_config(char *str);
......@@ -53,23 +53,23 @@ static int ssl_get_config(char *dev, char *str, int size, char **error_out);
static int ssl_remove(char *str);
static struct line_driver driver = {
name : "UML serial line",
devfs_name : "tts/%d",
major : TTYAUX_MAJOR,
minor_start : 64,
type : TTY_DRIVER_TYPE_SERIAL,
subtype : 0,
read_irq : SSL_IRQ,
read_irq_name : "ssl",
write_irq : SSL_WRITE_IRQ,
write_irq_name : "ssl-write",
symlink_from : "serial",
symlink_to : "tts",
mc : {
name : "ssl",
config : ssl_config,
get_config : ssl_get_config,
remove : ssl_remove,
.name = "UML serial line",
.devfs_name = "tts/%d",
.major = TTYAUX_MAJOR,
.minor_start = 64,
.type = TTY_DRIVER_TYPE_SERIAL,
.subtype = 0,
.read_irq = SSL_IRQ,
.read_irq_name = "ssl",
.write_irq = SSL_WRITE_IRQ,
.write_irq_name = "ssl-write",
.symlink_from = "serial",
.symlink_to = "tts",
.mc = {
.name = "ssl",
.config = ssl_config,
.get_config = ssl_get_config,
.remove = ssl_remove,
},
};
......@@ -191,21 +191,21 @@ void ssl_hangup(struct tty_struct *tty)
}
static struct tty_driver ssl_driver = {
refcount : &ssl_refcount,
open : ssl_open,
close : ssl_close,
write : ssl_write,
put_char : ssl_put_char,
flush_chars : ssl_flush_chars,
chars_in_buffer : ssl_chars_in_buffer,
flush_buffer : ssl_flush_buffer,
ioctl : ssl_ioctl,
throttle : ssl_throttle,
unthrottle : ssl_unthrottle,
set_termios : ssl_set_termios,
stop : ssl_stop,
start : ssl_start,
hangup : ssl_hangup
.refcount = &ssl_refcount,
.open = ssl_open,
.close = ssl_close,
.write = ssl_write,
.put_char = ssl_put_char,
.flush_chars = ssl_flush_chars,
.chars_in_buffer = ssl_chars_in_buffer,
.flush_buffer = ssl_flush_buffer,
.ioctl = ssl_ioctl,
.throttle = ssl_throttle,
.unthrottle = ssl_unthrottle,
.set_termios = ssl_set_termios,
.stop = ssl_stop,
.start = ssl_start,
.hangup = ssl_hangup
};
/* Changed by ssl_init and referenced by ssl_exit, which are both serialized
......
......@@ -42,28 +42,28 @@ static struct tty_driver console_driver;
static int console_refcount = 0;
static struct chan_ops init_console_ops = {
type: "you shouldn't see this",
init : NULL,
open : NULL,
close : NULL,
read : NULL,
write : NULL,
console_write : generic_write,
window_size : NULL,
free : NULL,
winch: 0,
.type = "you shouldn't see this",
.init = NULL,
.open = NULL,
.close = NULL,
.read = NULL,
.write = NULL,
.console_write = generic_write,
.window_size = NULL,
.free = NULL,
.winch = 0,
};
static struct chan init_console_chan = {
list : { },
primary : 1,
input : 0,
output : 1,
opened : 1,
fd : 1,
pri : INIT_STATIC,
ops : &init_console_ops,
data : NULL
.list = { },
.primary = 1,
.input = 0,
.output = 1,
.opened = 1,
.fd = 1,
.pri = INIT_STATIC,
.ops = &init_console_ops,
.data = NULL
};
void stdio_announce(char *dev_name, int dev)
......@@ -73,11 +73,11 @@ void stdio_announce(char *dev_name, int dev)
}
static struct chan_opts opts = {
announce: stdio_announce,
xterm_title: "Virtual Console #%d",
raw: 1,
tramp_stack : 0,
in_kernel : 1,
.announce = stdio_announce,
.xterm_title = "Virtual Console #%d",
.raw = 1,
.tramp_stack = 0,
.in_kernel = 1,
};
static int con_config(char *str);
......@@ -85,23 +85,23 @@ static int con_get_config(char *dev, char *str, int size, char **error_out);
static int con_remove(char *str);
static struct line_driver driver = {
name : "UML console",
devfs_name : "vc/%d",
major : TTY_MAJOR,
minor_start : 0,
type : TTY_DRIVER_TYPE_CONSOLE,
subtype : SYSTEM_TYPE_CONSOLE,
read_irq : CONSOLE_IRQ,
read_irq_name : "console",
write_irq : CONSOLE_WRITE_IRQ,
write_irq_name : "console-write",
symlink_from : "ttys",
symlink_to : "vc",
mc : {
name : "con",
config : con_config,
get_config : con_get_config,
remove : con_remove,
.name = "UML console",
.devfs_name = "vc/%d",
.major = TTY_MAJOR,
.minor_start = 0,
.type = TTY_DRIVER_TYPE_CONSOLE,
.subtype = SYSTEM_TYPE_CONSOLE,
.read_irq = CONSOLE_IRQ,
.read_irq_name = "console",
.write_irq = CONSOLE_WRITE_IRQ,
.write_irq_name = "console-write",
.symlink_from = "ttys",
.symlink_to = "vc",
.mc = {
.name = "con",
.config = con_config,
.get_config = con_get_config,
.remove = con_remove,
},
};
......@@ -192,12 +192,12 @@ static void console_write(struct console *console, const char *string,
}
static struct tty_driver console_driver = {
refcount : &console_refcount,
open : con_open,
close : con_close,
write : con_write,
chars_in_buffer : chars_in_buffer,
set_termios : set_termios
.refcount = &console_refcount,
.open = con_open,
.close = con_close,
.write = con_write,
.chars_in_buffer = chars_in_buffer,
.set_termios = set_termios
};
static kdev_t console_device(struct console *c)
......
......@@ -32,8 +32,8 @@ void *tty_chan_init(char *str, int device, struct chan_opts *opts)
if((data = um_kmalloc(sizeof(*data))) == NULL)
return(NULL);
*data = ((struct tty_chan) { dev : str,
raw : opts->raw });
*data = ((struct tty_chan) { .dev = str,
.raw = opts->raw });
return(data);
}
......@@ -62,16 +62,16 @@ int tty_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops tty_ops = {
type: "tty",
init: tty_chan_init,
open: tty_open,
close: generic_close,
read: generic_read,
write: generic_write,
console_write: tty_console_write,
window_size: generic_window_size,
free: generic_free,
winch: 0,
.type = "tty",
.init = tty_chan_init,
.open = tty_open,
.close = generic_close,
.read = generic_read,
.write = generic_write,
.console_write = tty_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
};
/*
......
......@@ -77,9 +77,11 @@ static struct gendisk *ubd_gendisk[MAX_DEV];
static struct gendisk *fake_gendisk[MAX_DEV];
#ifdef CONFIG_BLK_DEV_UBD_SYNC
#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0 })
#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \
.cl = 1 })
#else
#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0 })
#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0, \
.cl = 1 })
#endif
/* Not protected - changed only in ubd_setup_common and then only to
......@@ -177,6 +179,8 @@ static void make_ide_entries(char *dev_name)
if(proc_ide_root == NULL) make_proc_ide();
dir = proc_mkdir(dev_name, proc_ide);
if(!dir) return;
ent = create_proc_entry("media", S_IFREG|S_IRUGO, dir);
if(!ent) return;
ent->nlink = 1;
......@@ -405,7 +409,8 @@ static int io_pid = -1;
void kill_io_thread(void)
{
if(io_pid != -1) kill(io_pid, SIGKILL);
if(io_pid != -1)
os_kill_process(io_pid, 1);
}
__uml_exitcall(kill_io_thread);
......
......@@ -37,13 +37,13 @@ void *xterm_init(char *str, int device, struct chan_opts *opts)
struct xterm_chan *data;
if((data = malloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct xterm_chan) { pid : -1,
helper_pid : -1,
device : device,
title : opts->xterm_title,
raw : opts->raw,
stack : opts->tramp_stack,
direct_rcv : !opts->in_kernel } );
*data = ((struct xterm_chan) { .pid = -1,
.helper_pid = -1,
.device = device,
.title = opts->xterm_title,
.raw = opts->raw,
.stack = opts->tramp_stack,
.direct_rcv = !opts->in_kernel } );
return(data);
}
......@@ -137,7 +137,7 @@ int xterm_open(int input, int output, int primary, void *d, char **dev_out)
}
if(new < 0){
printk("xterm_open : os_rcv_fd failed, errno = %d\n", -new);
return(new);
goto out;
}
tcgetattr(new, &data->tt);
......@@ -145,6 +145,8 @@ int xterm_open(int input, int output, int primary, void *d, char **dev_out)
data->pid = pid;
*dev_out = NULL;
out:
unlink(file);
return(new);
}
......@@ -152,9 +154,11 @@ void xterm_close(int fd, void *d)
{
struct xterm_chan *data = d;
if(data->pid != -1) kill(data->pid, SIGKILL);
if(data->pid != -1)
os_kill_process(data->pid, 1);
data->pid = -1;
if(data->helper_pid != -1) kill(data->helper_pid, SIGKILL);
if(data->helper_pid != -1)
os_kill_process(data->helper_pid, 0);
data->helper_pid = -1;
close(fd);
}
......@@ -172,16 +176,16 @@ int xterm_console_write(int fd, const char *buf, int n, void *d)
}
struct chan_ops xterm_ops = {
type: "xterm",
init: xterm_init,
open: xterm_open,
close: xterm_close,
read: generic_read,
write: generic_write,
console_write: xterm_console_write,
window_size: generic_window_size,
free: xterm_free,
winch: 1,
.type = "xterm",
.init = xterm_init,
.open = xterm_open,
.close = xterm_close,
.read = generic_read,
.write = generic_write,
.console_write = xterm_console_write,
.window_size = generic_window_size,
.free = xterm_free,
.winch = 1,
};
/*
......
......@@ -39,21 +39,21 @@ int xterm_fd(int socket, int *pid_out)
data = kmalloc(sizeof(*data), GFP_KERNEL);
if(data == NULL){
printk(KERN_ERR "xterm_fd - failed to allocate semaphore\n");
printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n");
return(-ENOMEM);
}
*data = ((struct xterm_wait)
{ sem : __SEMAPHORE_INITIALIZER(data->sem, 0),
fd : socket,
pid : -1,
new_fd : -1 });
{ .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);
printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
"err = %d\n", err);
return(err);
}
down(&data->sem);
......
OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
jiffies = jiffies_64;
SEARCH_DIR("/usr/local/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
{
. = START + SIZEOF_HEADERS;
.interp : { *(.interp) }
. = ALIGN(4096);
__binary_start = .;
. = ALIGN(4096); /* Init code and data */
_stext = .;
__init_begin = .;
.text.init : { *(.text.init) }
. = ALIGN(4096);
/* Read-only sections, merged into text segment: */
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : {
KEEP (*(.init))
} =0x90909090
.plt : { *(.plt) }
.text : {
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} =0x90909090
.fini : {
KEEP (*(.fini))
} =0x90909090
.kstrtab : { *(.kstrtab) }
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.rodata1 : { *(.rodata1) }
.eh_frame_hdr : { *(.eh_frame_hdr) }
. = ALIGN(4096);
PROVIDE (_sdata = .);
.unprotected : { *(.unprotected) }
. = ALIGN(4096);
PROVIDE (_unprotected_end = .);
. = ALIGN(4096);
__uml_setup_start = .;
.uml.setup.init : { *(.uml.setup.init) }
__uml_setup_end = .;
__uml_help_start = .;
.uml.help.init : { *(.uml.help.init) }
__uml_help_end = .;
__uml_postsetup_start = .;
.uml.postsetup.init : { *(.uml.postsetup.init) }
__uml_postsetup_end = .;
__setup_start = .;
.setup.init : { *(.init.setup) }
__setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__per_cpu_start = . ;
.data.percpu : { *(.data.percpu) }
__per_cpu_end = . ;
__initcall_start = .;
.initcall.init : {
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
*(.initcall4.init)
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
}
__initcall_end = .;
__uml_initcall_start = .;
.uml.initcall.init : { *(.uml.initcall.init) }
__uml_initcall_end = .;
__init_end = .;
__exitcall_begin = .;
.exitcall : { *(.exitcall.exit) }
__exitcall_end = .;
__uml_exitcall_begin = .;
.uml.exitcall : { *(.uml.exitcall.exit) }
__uml_exitcall_end = .;
. = ALIGN(4096);
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
__initramfs_end = .;
.data.init : { *(.data.init) }
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
.preinit_array : { *(.preinit_array) }
.init_array : { *(.init_array) }
.fini_array : { *(.fini_array) }
.data : {
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
*(.data.init_task)
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
.eh_frame : { KEEP (*(.eh_frame)) }
.gcc_except_table : { *(.gcc_except_table) }
.dynamic : { *(.dynamic) }
.ctors : {
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
.dtors : {
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
}
.jcr : { KEEP (*(.jcr)) }
.got : { *(.got.plt) *(.got) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss : {
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
}
_end = .;
PROVIDE (end = .);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}
OUTPUT_FORMAT("ELF_FORMAT")
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
SEARCH_DIR("/usr/local/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
{
. = START() + SIZEOF_HEADERS;
.interp : { *(.interp) }
. = ALIGN(4096);
__binary_start = .;
. = ALIGN(4096); /* Init code and data */
_stext = .;
__init_begin = .;
.text.init : { *(.text.init) }
. = ALIGN(4096);
/* Read-only sections, merged into text segment: */
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : {
KEEP (*(.init))
} =0x90909090
.plt : { *(.plt) }
.text : {
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} =0x90909090
.fini : {
KEEP (*(.fini))
} =0x90909090
.kstrtab : { *(.kstrtab) }
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.rodata1 : { *(.rodata1) }
.eh_frame_hdr : { *(.eh_frame_hdr) }
. = ALIGN(4096);
PROVIDE (_sdata = .);
.unprotected : { *(.unprotected) }
. = ALIGN(4096);
PROVIDE (_unprotected_end = .);
. = ALIGN(4096);
__uml_setup_start = .;
.uml.setup.init : { *(.uml.setup.init) }
__uml_setup_end = .;
__uml_help_start = .;
.uml.help.init : { *(.uml.help.init) }
__uml_help_end = .;
__uml_postsetup_start = .;
.uml.postsetup.init : { *(.uml.postsetup.init) }
__uml_postsetup_end = .;
__setup_start = .;
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
.initcall.init : { *(.initcall.init) }
__initcall_end = .;
__uml_initcall_start = .;
.uml.initcall.init : { *(.uml.initcall.init) }
__uml_initcall_end = .;
__init_end = .;
__exitcall_begin = .;
.exitcall : { *(.exitcall.exit) }
__exitcall_end = .;
__uml_exitcall_begin = .;
.uml.exitcall : { *(.uml.exitcall.exit) }
__uml_exitcall_end = .;
.data.init : { *(.data.init) }
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
.preinit_array : { *(.preinit_array) }
.init_array : { *(.init_array) }
.fini_array : { *(.fini_array) }
.data : {
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
*(.data.init_task)
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
.eh_frame : { KEEP (*(.eh_frame)) }
.gcc_except_table : { *(.gcc_except_table) }
.dynamic : { *(.dynamic) }
.ctors : {
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
.dtors : {
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
}
.jcr : { KEEP (*(.jcr)) }
.got : { *(.got.plt) *(.got) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss : {
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
}
_end = .;
PROVIDE (end = .);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}
......@@ -8,13 +8,13 @@
#include "uml-config.h"
#if defined(CONFIG_MODE_TT) && defined(CONFIG_MODE_SKAS)
#if defined(UML_CONFIG_MODE_TT) && defined(UML_CONFIG_MODE_SKAS)
#define CHOOSE_MODE(tt, skas) (mode_tt ? (tt) : (skas))
#elif defined(CONFIG_MODE_SKAS)
#elif defined(UML_CONFIG_MODE_SKAS)
#define CHOOSE_MODE(tt, skas) (skas)
#elif defined(CONFIG_MODE_TT)
#elif defined(UML_CONFIG_MODE_TT)
#define CHOOSE_MODE(tt, skas) (tt)
#endif
......
......@@ -8,11 +8,11 @@
#include "uml-config.h"
#ifdef CONFIG_MODE_TT
#ifdef UML_CONFIG_MODE_TT
#include "../kernel/tt/include/mode.h"
#endif
#ifdef CONFIG_MODE_SKAS
#ifdef UML_CONFIG_MODE_SKAS
#include "../kernel/skas/include/mode.h"
#endif
......
......@@ -25,9 +25,11 @@ struct openflags {
unsigned int t : 1; /* O_TRUNC */
unsigned int a : 1; /* O_APPEND */
unsigned int e : 1; /* O_EXCL */
unsigned int cl : 1; /* FD_CLOEXEC */
};
#define OPENFLAGS() ((struct openflags) { r : 0, w : 0, c : 0, s : 0 })
#define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \
.t = 0, .a = 0, .e = 0, .cl = 0 })
static inline struct openflags of_read(struct openflags flags)
{
......@@ -83,9 +85,16 @@ static inline struct openflags of_excl(struct openflags flags)
return(flags);
}
static inline struct openflags of_cloexec(struct openflags flags)
{
flags.cl = 1;
return(flags);
}
extern int os_seek_file(int fd, __u64 offset);
extern int os_open_file(char *file, struct openflags flags, int mode);
extern int os_read_file(int fd, char *buf, int len);
extern int os_read_file(int fd, void *buf, int len);
extern int os_write_file(int fd, void *buf, int count);
extern int os_file_size(char *file, long long *size_out);
extern int os_pipe(int *fd, int stream, int close_on_exec);
extern int os_set_fd_async(int fd, int owner);
......@@ -98,7 +107,6 @@ extern int create_unix_socket(char *file, int len);
extern int os_connect_socket(char *name);
extern int os_file_type(char *file);
extern int os_file_mode(char *file, struct openflags *mode_out);
extern int os_write_file(int fd, char *buf, int count);
extern unsigned long os_process_pc(int pid);
extern int os_process_parent(int pid);
......
/*
* Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
* Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#ifndef __SIGNAL_KERN_H__
#define __SIGNAL_KERN_H__
#include "sysdep/ptrace.h"
extern void signal_deliverer(int sig);
extern int probe_stack(unsigned long sp, int delta);
extern int have_signals(void *t);
#endif
......
......@@ -8,24 +8,24 @@
#include "uml-config.h"
#ifdef CONFIG_MODE_TT
#ifdef UML_CONFIG_MODE_TT
#include "ptrace-tt.h"
#endif
#ifdef CONFIG_MODE_SKAS
#ifdef UML_CONFIG_MODE_SKAS
#include "ptrace-skas.h"
#endif
#include "choose-mode.h"
union uml_pt_regs {
#ifdef CONFIG_MODE_TT
#ifdef UML_CONFIG_MODE_TT
struct tt_regs {
long syscall;
void *sc;
} tt;
#endif
#ifdef CONFIG_MODE_SKAS
#ifdef UML_CONFIG_MODE_SKAS
struct skas_regs {
unsigned long regs[HOST_FRAME_SIZE];
unsigned long fp[HOST_FP_SIZE];
......
......@@ -3,8 +3,13 @@
* Licensed under the GPL
*/
#ifndef __UMID_H__
#define __UMID_H__
extern int umid_file_name(char *name, char *buf, int len);
#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
......
......@@ -61,7 +61,6 @@ extern int start_fork_tramp(void *arg, unsigned long temp_stack,
int clone_flags, int (*tramp)(void *));
extern int clone_and_wait(int (*fn)(void *), void *arg, void *sp, int flags);
extern int linux_main(int argc, char **argv);
extern void remap_data(void *segment_start, void *segment_end, int w);
extern void set_cmdline(char *cmd);
extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
extern int get_pty(void);
......
......@@ -3,8 +3,6 @@
# Licensed under the GPL
#
EXTRA_TARGETS := unmap_fin.o
obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \
helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
process.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \
......@@ -27,9 +25,6 @@ USER_OBJS := $(filter %_user.o,$(obj-y)) $(user-objs-y) config.o helper.o \
process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
DMODULES-$(CONFIG_MODULES) = -D__CONFIG_MODULES__
DMODVERSIONS-$(CONFIG_MODVERSIONS) = -D__CONFIG_MODVERSIONS__
......@@ -46,12 +41,6 @@ CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS))
$(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
$(obj)/unmap.o: $(src)/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $<
$(obj)/unmap_fin.o : $(src)/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.
......
......@@ -78,7 +78,8 @@ static int capture_stack(int (*child)(void *arg), void *arg, void *sp,
/* It has outlived its usefulness, so continue it so it can exit */
if(ptrace(PTRACE_CONT, pid, 0, 0) < 0){
printf("capture_stack : mmap failed - errno = %d\n", errno);
printf("capture_stack : PTRACE_CONT failed - errno = %d\n",
errno);
exit(1);
}
if(waitpid(pid, &status, 0) < 0){
......
......@@ -128,15 +128,15 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
if(type == IRQ_READ) events = POLLIN | POLLPRI;
else events = POLLOUT;
*new_fd = ((struct irq_fd) { next : NULL,
id : dev_id,
fd : fd,
type : type,
irq : irq,
pid : pid,
events : events,
current_events: 0,
freed : 0 } );
*new_fd = ((struct irq_fd) { .next = NULL,
.id = dev_id,
.fd = fd,
.type = type,
.irq = irq,
.pid = pid,
.events = events,
.current_events = 0,
.freed = 0 } );
/* Critical section - locked by a spinlock because this stuff can
* be changed from interrupt handlers. The stuff above is done
......@@ -191,9 +191,9 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
if(type == IRQ_WRITE)
fd = -1;
pollfds[pollfds_num] = ((struct pollfd) { fd : fd,
events : events,
revents : 0 });
pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
.events = events,
.revents = 0 });
pollfds_num++;
*last_irq_ptr = new_fd;
......@@ -265,8 +265,8 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d)
void free_irq_by_irq_and_dev(int irq, void *dev)
{
struct irq_and_dev data = ((struct irq_and_dev) { irq : irq,
dev : dev });
struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq,
.dev = dev });
free_irq_by_cb(same_irq_and_dev, &data);
}
......
......@@ -14,6 +14,7 @@
#include "asm/processor.h"
#include "asm/unistd.h"
#include "asm/pgalloc.h"
#include "asm/pgtable.h"
#include "asm/page.h"
#include "asm/tlbflush.h"
#include "kern_util.h"
......@@ -42,7 +43,11 @@ EXPORT_SYMBOL(page_to_phys);
EXPORT_SYMBOL(phys_to_page);
EXPORT_SYMBOL(high_physmem);
EXPORT_SYMBOL(empty_zero_page);
EXPORT_SYMBOL(um_virt_to_phys);
EXPORT_SYMBOL(mode_tt);
EXPORT_SYMBOL(handle_page_fault);
EXPORT_SYMBOL(os_getpid);
EXPORT_SYMBOL(os_open_file);
EXPORT_SYMBOL(os_read_file);
EXPORT_SYMBOL(os_write_file);
......
......@@ -232,11 +232,11 @@ static int setup_one_range(int fd, char *driver, unsigned long start,
panic("Failed to allocating mem_region");
}
*region = ((struct mem_region) { driver : driver,
start_pfn : pfn,
start : start,
len : len,
fd : fd } );
*region = ((struct mem_region) { .driver = driver,
.start_pfn = pfn,
.start = start,
.len = len,
.fd = fd } );
regions[i] = region;
out:
up(&regions_sem);
......@@ -444,15 +444,15 @@ static struct list_head vm_reserved = LIST_HEAD_INIT(vm_reserved);
/* Static structures, linked in to the list in early boot */
static struct vm_reserved head = {
list : LIST_HEAD_INIT(head.list),
start : 0,
end : 0xffffffff
.list = LIST_HEAD_INIT(head.list),
.start = 0,
.end = 0xffffffff
};
static struct vm_reserved tail = {
list : LIST_HEAD_INIT(tail.list),
start : 0,
end : 0xffffffff
.list = LIST_HEAD_INIT(tail.list),
.start = 0,
.end = 0xffffffff
};
void set_usable_vm(unsigned long start, unsigned long end)
......@@ -488,9 +488,9 @@ int reserve_vm(unsigned long start, unsigned long end, void *e)
goto out;
}
*entry = ((struct vm_reserved)
{ list : LIST_HEAD_INIT(entry->list),
start : start,
end : end });
{ .list = LIST_HEAD_INIT(entry->list),
.start = start,
.end = end });
list_add(&entry->list, &prev->list);
err = 0;
out:
......@@ -560,9 +560,9 @@ struct iomem {
*/
struct iomem iomem_regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] =
{ name : NULL,
fd : -1,
size : 0 } };
{ .name = NULL,
.fd = -1,
.size = 0 } };
int num_iomem_regions = 0;
......@@ -572,9 +572,9 @@ void add_iomem(char *name, int fd, unsigned long size)
return;
size = (size + PAGE_SIZE - 1) & PAGE_MASK;
iomem_regions[num_iomem_regions++] =
((struct iomem) { name : name,
fd : fd,
size : size } );
((struct iomem) { .name = name,
.fd = fd,
.size = size } );
}
int setup_iomem(void)
......
......@@ -9,7 +9,9 @@
#include "linux/smp_lock.h"
#include "linux/security.h"
#include "linux/ptrace.h"
#ifdef CONFIG_PROC_MM
#include "linux/proc_mm.h"
#endif
#include "asm/ptrace.h"
#include "asm/uaccess.h"
#include "kern_util.h"
......
......@@ -52,7 +52,7 @@ void __init check_one_sigio(void (*proc)(int, int))
{
struct sigaction old, new;
struct termios tt;
struct openpty_arg pty = { master : -1, slave : -1 };
struct openpty_arg pty = { .master = -1, .slave = -1 };
int master, slave, flags;
initial_thread_cb(openpty_cb, &pty);
......@@ -111,6 +111,7 @@ static void tty_output(int master, int slave)
printk("Checking that host ptys support output SIGIO...");
memset(buf, 0, sizeof(buf));
while(write(master, buf, sizeof(buf)) > 0) ;
if(errno != EAGAIN)
panic("check_sigio : write failed, errno = %d\n", errno);
......@@ -170,15 +171,15 @@ struct pollfds {
* synchronizes with it.
*/
struct pollfds current_poll = {
poll : NULL,
size : 0,
used : 0
.poll = NULL,
.size = 0,
.used = 0
};
struct pollfds next_poll = {
poll : NULL,
size : 0,
used : 0
.poll = NULL,
.size = 0,
.used = 0
};
static int write_sigio_thread(void *unused)
......@@ -267,7 +268,8 @@ static void update_thread(void)
return;
fail:
sigio_lock();
if(write_sigio_pid != -1) kill(write_sigio_pid, SIGKILL);
if(write_sigio_pid != -1)
os_kill_process(write_sigio_pid, 1);
write_sigio_pid = -1;
close(sigio_private[0]);
close(sigio_private[1]);
......@@ -298,9 +300,9 @@ int add_sigio_fd(int fd, int read)
if(read) events = POLLIN;
else events = POLLOUT;
next_poll.poll[n - 1] = ((struct pollfd) { fd : fd,
events : events,
revents : 0 });
next_poll.poll[n - 1] = ((struct pollfd) { .fd = fd,
.events = events,
.revents = 0 });
update_thread();
out:
sigio_unlock();
......@@ -348,12 +350,12 @@ static int setup_initial_poll(int fd)
printk("setup_initial_poll : failed to allocate poll\n");
return(-1);
}
*p = ((struct pollfd) { fd : fd,
events : POLLIN,
revents : 0 });
current_poll = ((struct pollfds) { poll : p,
used : 1,
size : 1 });
*p = ((struct pollfd) { .fd = fd,
.events = POLLIN,
.revents = 0 });
current_poll = ((struct pollfds) { .poll = p,
.used = 1,
.size = 1 });
return(0);
}
......@@ -394,7 +396,7 @@ void write_sigio_workaround(void)
return;
out_kill:
kill(write_sigio_pid, SIGKILL);
os_kill_process(write_sigio_pid, 1);
write_sigio_pid = -1;
out_close2:
close(sigio_private[0]);
......@@ -420,7 +422,8 @@ int read_sigio_fd(int fd)
static void sigio_cleanup(void)
{
if(write_sigio_pid != -1) kill(write_sigio_pid, SIGKILL);
if(write_sigio_pid != -1)
os_kill_process(write_sigio_pid, 1);
}
__uml_exitcall(sigio_cleanup);
......
......@@ -30,18 +30,6 @@
EXPORT_SYMBOL(block_signals);
EXPORT_SYMBOL(unblock_signals);
int probe_stack(unsigned long sp, int delta)
{
int n;
if((get_user(n, (int *) sp) != 0) ||
(put_user(n, (int *) sp) != 0) ||
(get_user(n, (int *) (sp - delta)) != 0) ||
(put_user(n, (int *) (sp - delta)) != 0))
return(-EFAULT);
return(0);
}
static void force_segv(int sig)
{
if(sig == SIGSEGV){
......
......@@ -21,6 +21,8 @@ extern void release_thread_skas(struct task_struct *task);
extern void exit_thread_skas(void);
extern void initial_thread_cb_skas(void (*proc)(void *), void *arg);
extern void init_idle_skas(void);
extern void flush_tlb_kernel_range_skas(unsigned long start,
unsigned long end);
extern void flush_tlb_kernel_vm_skas(void);
extern void __flush_tlb_one_skas(unsigned long addr);
extern void flush_tlb_range_skas(struct vm_area_struct *vma,
......
......@@ -8,7 +8,7 @@
#include "uml-config.h"
#ifdef CONFIG_MODE_SKAS
#ifdef UML_CONFIG_MODE_SKAS
#include "skas_ptregs.h"
......
......@@ -27,9 +27,6 @@ static inline int verify_area_skas(int type, const void * addr,
return(access_ok_skas(type, addr, size) ? 0 : -EFAULT);
}
extern void *um_virt_to_phys(struct task_struct *task, unsigned long virt,
pte_t *pte_out);
static inline unsigned long maybe_map(unsigned long virt, int is_write)
{
pte_t pte;
......
......@@ -33,7 +33,7 @@ void map(int fd, unsigned long virt, unsigned long phys, unsigned long len,
.fd = region->fd,
.offset = phys_offset(phys)
} } } );
n = os_write_file(fd, (char *) &map, sizeof(map));
n = os_write_file(fd, &map, sizeof(map));
if(n != sizeof(map))
printk("map : /proc/mm map failed, errno = %d\n", errno);
}
......@@ -48,7 +48,7 @@ int unmap(int fd, void *addr, int len)
{ .munmap =
{ .addr = (unsigned long) addr,
.len = len } } } );
n = os_write_file(fd, (char *) &unmap, sizeof(unmap));
n = os_write_file(fd, &unmap, sizeof(unmap));
if((n != 0) && (n != sizeof(unmap)))
return(-errno);
return(0);
......@@ -70,7 +70,7 @@ int protect(int fd, unsigned long addr, unsigned long len, int r, int w,
.len = len,
.prot = prot } } } );
n = os_write_file(fd, (char *) &protect, sizeof(protect));
n = os_write_file(fd, &protect, sizeof(protect));
if((n != 0) && (n != sizeof(protect))){
if(must_succeed)
panic("protect failed, errno = %d", errno);
......
......@@ -39,6 +39,7 @@ static void handle_segv(int pid)
if(err)
panic("handle_segv - PTRACE_FAULTINFO failed, errno = %d\n",
errno);
segv(fault.addr, 0, FAULT_WRITE(fault.is_write), 1, NULL);
}
......@@ -79,6 +80,7 @@ static int userspace_tramp(void *arg)
enable_timer();
ptrace(PTRACE_TRACEME, 0, 0, 0);
os_stop_process(os_getpid());
return(0);
}
void start_userspace(void)
......@@ -335,7 +337,7 @@ int new_mm(int from)
copy = ((struct proc_mm_op) { .op = MM_COPY_SEGMENTS,
.u =
{ .copy_segments = from } } );
n = os_write_file(fd, (char *) &copy, sizeof(copy));
n = os_write_file(fd, &copy, sizeof(copy));
if(n != sizeof(copy))
printk("new_mm : /proc/mm copy_segments failed, "
"errno = %d\n", errno);
......
......@@ -67,7 +67,7 @@ static void fix_range(struct mm_struct *mm, unsigned long start_addr,
}
}
static void flush_kernel_vm_range(unsigned long start, unsigned long end)
void flush_tlb_kernel_range_skas(unsigned long start, unsigned long end)
{
struct mm_struct *mm;
pgd_t *pgd;
......@@ -99,7 +99,6 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end)
protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1);
}
addr += PAGE_SIZE;
}
else {
if(pmd_newpage(*pmd)){
......@@ -116,19 +115,19 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end)
void flush_tlb_kernel_vm_skas(void)
{
flush_kernel_vm_range(start_vm, end_vm);
flush_tlb_kernel_range_skas(start_vm, end_vm);
}
void __flush_tlb_one_skas(unsigned long addr)
{
flush_kernel_vm_range(addr, addr + PAGE_SIZE);
flush_tlb_kernel_range_skas(addr, addr + PAGE_SIZE);
}
void flush_tlb_range_skas(struct vm_area_struct *vma, unsigned long start,
unsigned long end)
{
if(vma->vm_mm == NULL)
flush_kernel_vm_range(start, end);
flush_tlb_kernel_range_skas(start, end);
else fix_range(vma->vm_mm, start, end, 0);
}
......
......@@ -481,8 +481,6 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_io_getevents ] = sys_io_getevents,
[ __NR_io_submit ] = sys_io_submit,
[ __NR_io_cancel ] = sys_io_cancel,
[ __NR_alloc_hugepages ] = sys_ni_syscall,
[ __NR_free_hugepages ] = sys_ni_syscall,
[ __NR_exit_group ] = sys_exit_group,
[ __NR_lookup_dcookie ] = sys_lookup_dcookie,
[ __NR_epoll_create ] = sys_epoll_create,
......
......@@ -111,7 +111,7 @@ void idle_sleep(int secs)
ts.tv_sec = secs;
ts.tv_nsec = 0;
nanosleep(&ts, &ts);
nanosleep(&ts, NULL);
}
/*
......
......@@ -21,6 +21,12 @@ void flush_tlb_all(void)
flush_tlb_mm(current->mm);
}
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt,
flush_tlb_kernel_range_skas, start, end);
}
void flush_tlb_kernel_vm(void)
{
CHOOSE_MODE(flush_tlb_kernel_vm_tt(), flush_tlb_kernel_vm_skas());
......
......@@ -109,7 +109,8 @@ unsigned long segv(unsigned long address, unsigned long ip, int is_write,
flush_tlb_kernel_vm();
return(0);
}
if(current->mm == NULL) panic("Segfault with no mm");
if(current->mm == NULL)
panic("Segfault with no mm");
err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
catcher = current->thread.fault_catcher;
......
......@@ -3,18 +3,31 @@
# Licensed under the GPL
#
obj-y = exec_kern.o exec_user.o gdb.o gdb_kern.o ksyms.o mem.o process_kern.o \
EXTRA_TARGETS := unmap_fin.o
obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
uaccess_user.o sys-$(SUBARCH)/
obj-$(CONFIG_PT_PROXY) += ptproxy/
obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/
export-objs = ksyms.o
USER_OBJS := $(filter %_user.o,$(obj-y)) gdb.o time.o tracer.o
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
$(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
$(O_TARGET) : $(obj)/unmap_fin.o
$(obj)/unmap.o: $(src)/unmap.c
$(CC) $(UNMAP_CFLAGS) -c -o $@ $<
$(obj)/unmap_fin.o : $(src)/unmap.o
ld -r -o $@ $< -lc -L/usr/lib
clean :
......@@ -44,7 +44,7 @@ int cont(int pid)
return(ptrace(PTRACE_CONT, pid, 0, 0));
}
#ifdef CONFIG_PT_PROXY
#ifdef UML_CONFIG_PT_PROXY
int debugger_signal(int status, pid_t pid)
{
......@@ -62,11 +62,11 @@ static void gdb_announce(char *dev_name, int dev)
}
static struct chan_opts opts = {
announce : gdb_announce,
xterm_title : "UML kernel debugger",
raw : 0,
tramp_stack : 0,
in_kernel : 0,
.announce = gdb_announce,
.xterm_title = "UML kernel debugger",
.raw = 0,
.tramp_stack = 0,
.in_kernel = 0,
};
/* Accessed by the tracing thread, which automatically serializes access */
......
......@@ -13,9 +13,9 @@ extern int gdb_config(char *str);
extern int gdb_remove(char *unused);
static struct mc_device gdb_mc = {
name: "gdb",
config: gdb_config,
remove: gdb_remove,
.name = "gdb",
.config = gdb_config,
.remove = gdb_remove,
};
int gdb_mc_init(void)
......
......@@ -22,6 +22,7 @@ extern void release_thread_tt(struct task_struct *task);
extern void exit_thread_tt(void);
extern void initial_thread_cb_tt(void (*proc)(void *), void *arg);
extern void init_idle_tt(void);
extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end);
extern void flush_tlb_kernel_vm_tt(void);
extern void __flush_tlb_one_tt(unsigned long addr);
extern void flush_tlb_range_tt(struct vm_area_struct *vma,
......
......@@ -8,7 +8,7 @@
#include "uml-config.h"
#ifdef CONFIG_MODE_TT
#ifdef UML_CONFIG_MODE_TT
#include "sysdep/sc.h"
#endif
......
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/mman.h>
#include "tt.h"
#include "mem_user.h"
#include "user_util.h"
void remap_data(void *segment_start, void *segment_end, int w)
{
void *addr;
unsigned long size;
int data, prot;
if(w) prot = PROT_WRITE;
else prot = 0;
prot |= PROT_READ | PROT_EXEC;
size = (unsigned long) segment_end -
(unsigned long) segment_start;
data = create_mem_file(size);
if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ,
MAP_SHARED, data, 0)) == MAP_FAILED){
perror("mapping new data segment");
exit(1);
}
memcpy(addr, segment_start, size);
if(switcheroo(data, prot, addr, segment_start,
size) < 0){
printf("switcheroo failed\n");
exit(1);
}
}
/*
* 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:
*/
......@@ -129,14 +129,14 @@ static int parent_syscall(debugger_state *debugger, int pid);
int init_parent_proxy(int pid)
{
parent = ((debugger_state) { pid : pid,
wait_options : 0,
wait_status_ptr : NULL,
waiting : 0,
real_wait : 0,
expecting_child : 0,
handle_trace : parent_syscall,
debugee : NULL } );
parent = ((debugger_state) { .pid = pid,
.wait_options = 0,
.wait_status_ptr = NULL,
.waiting = 0,
.real_wait = 0,
.expecting_child = 0,
.handle_trace = parent_syscall,
.debugee = NULL } );
return(0);
}
......
......@@ -132,7 +132,7 @@ static void flush_kernel_vm_range(unsigned long start, unsigned long end,
if(updated && update_seq) atomic_inc(&vmchange_seq);
}
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end)
{
flush_kernel_vm_range(start, end, 1);
}
......
......@@ -85,10 +85,10 @@ static void c_stop(struct seq_file *m, void *v)
}
struct seq_operations cpuinfo_op = {
start: c_start,
next: c_next,
stop: c_stop,
show: show_cpuinfo,
.start = c_start,
.next = c_next,
.stop = c_stop,
.show = show_cpuinfo,
};
pte_t * __bad_pagetable(void)
......@@ -317,6 +317,11 @@ int linux_main(int argc, char **argv)
if(physmem_size > max_physmem){
highmem = physmem_size - max_physmem;
physmem_size -= highmem;
#ifndef CONFIG_HIGHMEM
highmem = 0;
printf("CONFIG_HIGHMEM not enabled - physical memory shrunk "
"to %ld bytes\n", physmem_size);
#endif
}
high_physmem = uml_physmem + physmem_size;
......@@ -361,9 +366,9 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,
}
static struct notifier_block panic_exit_notifier = {
notifier_call : panic_exit,
next : NULL,
priority : 0
.notifier_call = panic_exit,
.next = NULL,
.priority = 0
};
void __init setup_arch(char **cmdline_p)
......
......@@ -35,7 +35,7 @@ static int umid_inited = 0;
static int make_umid(void);
static int __init set_umid(char *name, int *add)
static int __init set_umid(char *name, int is_random)
{
if(umid_inited){
printk("Unique machine name can't be set twice\n");
......@@ -48,12 +48,17 @@ static int __init set_umid(char *name, int *add)
strncpy(umid, name, UMID_LEN - 1);
umid[UMID_LEN - 1] = '\0';
umid_is_random = 0;
umid_is_random = is_random;
umid_inited = 1;
return 0;
}
__uml_setup("umid=", set_umid,
static int __init set_umid_arg(char *name, int *add)
{
return(set_umid(name, 0));
}
__uml_setup("umid=", set_umid_arg,
"umid=<name>\n"
" This is used to assign a unique identity to this UML machine and\n"
" is used for naming the pid file and management console socket.\n\n"
......@@ -186,7 +191,6 @@ int not_dead_yet(char *dir)
}
if(!dead) return(1);
return(actually_do_remove(dir));
return(0);
}
static int __init set_uml_dir(char *name, int *add)
......@@ -254,7 +258,7 @@ static int __init make_umid(void)
strcat(tmp, "XXXXXX");
fd = mkstemp(tmp);
if(fd < 0){
printk("set_umid - mkstemp failed, errno = %d\n",
printk("make_umid - mkstemp failed, errno = %d\n",
errno);
return(1);
}
......@@ -265,7 +269,7 @@ static int __init make_umid(void)
* for directories.
*/
unlink(tmp);
strcpy(umid, &tmp[strlen(uml_dir)]);
set_umid(&tmp[strlen(uml_dir)], 1);
}
sprintf(tmp, "%s%s", uml_dir, umid);
......
......@@ -46,31 +46,6 @@ void add_arg(char *cmd_line, char *arg)
strcat(cmd_line, arg);
}
void remap_data(void *segment_start, void *segment_end, int w)
{
void *addr;
unsigned long size;
int data, prot;
if(w) prot = PROT_WRITE;
else prot = 0;
prot |= PROT_READ | PROT_EXEC;
size = (unsigned long) segment_end -
(unsigned long) segment_start;
data = create_mem_file(size);
if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ,
MAP_SHARED, data, 0)) < 0){
perror("mapping new data segment");
exit(1);
}
memcpy(addr, segment_start, size);
if(switcheroo(data, prot, addr, segment_start,
size) < 0){
printf("switcheroo failed\n");
exit(1);
}
}
void stop(void)
{
while(1) sleep(1000000);
......
......@@ -28,11 +28,11 @@ static void etap_init(struct net_device *dev, void *data)
pri = dev->priv;
epri = (struct ethertap_data *) pri->user;
*epri = ((struct ethertap_data)
{ dev_name : init->dev_name,
gate_addr : init->gate_addr,
data_fd : -1,
control_fd : -1,
dev : dev });
{ .dev_name = init->dev_name,
.gate_addr = init->gate_addr,
.data_fd = -1,
.control_fd = -1,
.dev = dev });
printk("ethertap backend - %s", epri->dev_name);
if(epri->gate_addr != NULL)
......@@ -69,10 +69,10 @@ static int etap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
}
struct net_kern_info ethertap_kern_info = {
init: etap_init,
protocol: eth_protocol,
read: etap_read,
write: etap_write,
.init = etap_init,
.protocol = eth_protocol,
.read = etap_read,
.write = etap_write,
};
int ethertap_setup(char *str, char **mac_out, void *data)
......@@ -80,8 +80,8 @@ int ethertap_setup(char *str, char **mac_out, void *data)
struct ethertap_init *init = data;
*init = ((struct ethertap_init)
{ dev_name : NULL,
gate_addr : NULL });
{ .dev_name = NULL,
.gate_addr = NULL });
if(tap_setup_common(str, "ethertap", &init->dev_name, mac_out,
&init->gate_addr))
return(0);
......@@ -94,12 +94,12 @@ int ethertap_setup(char *str, char **mac_out, void *data)
}
static struct transport ethertap_transport = {
list : LIST_HEAD_INIT(ethertap_transport.list),
name : "ethertap",
setup : ethertap_setup,
user : &ethertap_user_info,
kern : &ethertap_kern_info,
private_size : sizeof(struct ethertap_data),
.list = LIST_HEAD_INIT(ethertap_transport.list),
.name = "ethertap",
.setup = ethertap_setup,
.user = &ethertap_user_info,
.kern = &ethertap_kern_info,
.private_size = sizeof(struct ethertap_data),
};
static int register_ethertap(void)
......
......@@ -216,14 +216,14 @@ static void etap_del_addr(unsigned char *addr, unsigned char *netmask,
}
struct net_user_info ethertap_user_info = {
init: etap_user_init,
open: etap_open,
close: etap_close,
remove: NULL,
set_mtu: etap_set_mtu,
add_address: etap_add_addr,
delete_address: etap_del_addr,
max_packet: MAX_PACKET - ETH_HEADER_ETHERTAP
.init = etap_user_init,
.open = etap_open,
.close = etap_close,
.remove = NULL,
.set_mtu = etap_set_mtu,
.add_address = etap_add_addr,
.delete_address = etap_del_addr,
.max_packet = MAX_PACKET - ETH_HEADER_ETHERTAP
};
/*
......
......@@ -28,11 +28,11 @@ static void tuntap_init(struct net_device *dev, void *data)
pri = dev->priv;
tpri = (struct tuntap_data *) pri->user;
*tpri = ((struct tuntap_data)
{ dev_name : init->dev_name,
fixed_config : (init->dev_name != NULL),
gate_addr : init->gate_addr,
fd : -1,
dev : dev });
{ .dev_name = init->dev_name,
.fixed_config = (init->dev_name != NULL),
.gate_addr = init->gate_addr,
.fd = -1,
.dev = dev });
printk("TUN/TAP backend - ");
if(tpri->gate_addr != NULL)
printk("IP = %s", tpri->gate_addr);
......@@ -55,10 +55,10 @@ static int tuntap_write(int fd, struct sk_buff **skb,
}
struct net_kern_info tuntap_kern_info = {
init: tuntap_init,
protocol: eth_protocol,
read: tuntap_read,
write: tuntap_write,
.init = tuntap_init,
.protocol = eth_protocol,
.read = tuntap_read,
.write = tuntap_write,
};
int tuntap_setup(char *str, char **mac_out, void *data)
......@@ -66,8 +66,8 @@ int tuntap_setup(char *str, char **mac_out, void *data)
struct tuntap_init *init = data;
*init = ((struct tuntap_init)
{ dev_name : NULL,
gate_addr : NULL });
{ .dev_name = NULL,
.gate_addr = NULL });
if(tap_setup_common(str, "tuntap", &init->dev_name, mac_out,
&init->gate_addr))
return(0);
......@@ -76,13 +76,13 @@ int tuntap_setup(char *str, char **mac_out, void *data)
}
static struct transport tuntap_transport = {
list : LIST_HEAD_INIT(tuntap_transport.list),
name : "tuntap",
setup : tuntap_setup,
user : &tuntap_user_info,
kern : &tuntap_kern_info,
private_size : sizeof(struct tuntap_data),
setup_size : sizeof(struct tuntap_init),
.list = LIST_HEAD_INIT(tuntap_transport.list),
.name = "tuntap",
.setup = tuntap_setup,
.user = &tuntap_user_info,
.kern = &tuntap_kern_info,
.private_size = sizeof(struct tuntap_data),
.setup_size = sizeof(struct tuntap_init),
};
static int register_tuntap(void)
......
......@@ -201,14 +201,14 @@ static int tuntap_set_mtu(int mtu, void *data)
}
struct net_user_info tuntap_user_info = {
init: tuntap_user_init,
open: tuntap_open,
close: tuntap_close,
remove: NULL,
set_mtu: tuntap_set_mtu,
add_address: tuntap_add_addr,
delete_address: tuntap_del_addr,
max_packet: MAX_PACKET
.init = tuntap_user_init,
.open = tuntap_open,
.close = tuntap_close,
.remove = NULL,
.set_mtu = tuntap_set_mtu,
.add_address = tuntap_add_addr,
.delete_address = tuntap_del_addr,
.max_packet = MAX_PACKET
};
/*
......
......@@ -28,8 +28,8 @@ int os_file_type(char *file)
else if(S_ISLNK(buf.st_mode)) return(OS_TYPE_SYMLINK);
else if(S_ISCHR(buf.st_mode)) return(OS_TYPE_CHARDEV);
else if(S_ISBLK(buf.st_mode)) return(OS_TYPE_BLOCKDEV);
else if(S_ISFIFO(buf.st_mode))return(OS_TYPE_FIFO);
else if(S_ISSOCK(buf.st_mode))return(OS_TYPE_SOCK);
else if(S_ISFIFO(buf.st_mode)) return(OS_TYPE_FIFO);
else if(S_ISSOCK(buf.st_mode)) return(OS_TYPE_SOCK);
else return(OS_TYPE_FILE);
}
......@@ -64,6 +64,15 @@ int os_open_file(char *file, struct openflags flags, int mode)
fd = open64(file, f, mode);
if(fd < 0) return(-errno);
if(flags.cl){
if(fcntl(fd, F_SETFD, 1)){
close(fd);
return(-errno);
}
}
return(fd);
return(fd);
}
......@@ -100,7 +109,7 @@ int os_seek_file(int fd, __u64 offset)
return(0);
}
int os_read_file(int fd, char *buf, int len)
int os_read_file(int fd, void *buf, int len)
{
int n;
......@@ -118,7 +127,7 @@ int os_read_file(int fd, char *buf, int len)
return(n);
}
int os_write_file(int fd, char *buf, int count)
int os_write_file(int fd, void *buf, int count)
{
int n;
......@@ -276,8 +285,8 @@ int os_rcv_fd(int fd, int *helper_pid_out)
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov = ((struct iovec) { iov_base : helper_pid_out,
iov_len : sizeof(*helper_pid_out) });
iov = ((struct iovec) { .iov_base = helper_pid_out,
.iov_len = sizeof(*helper_pid_out) });
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = buf;
......
......@@ -8,10 +8,10 @@ export-objs = ksyms.o
USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
SYMLINKS = semaphore.c extable.c highmem.c module.c
SYMLINKS = semaphore.c highmem.c module.c
SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
semaphore.c-dir = kernel
extable.c-dir = mm
highmem.c-dir = mm
module.c-dir = kernel
......@@ -23,7 +23,7 @@ endef
$(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
$(foreach f,$(SYMLINKS),$(src)/$f):
$(SYMLINKS):
$(call make_link,$@)
clean:
......
/*
* linux/arch/i386/mm/extable.c
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
/* Simple binary search */
const struct exception_table_entry *
search_extable(const struct exception_table_entry *first,
const struct exception_table_entry *last,
unsigned long value)
{
while (first <= last) {
const struct exception_table_entry *mid;
long diff;
mid = (last - first) / 2 + first;
diff = mid->insn - value;
if (diff == 0)
return mid;
else if (diff < 0)
first = mid+1;
else
last = mid-1;
}
return NULL;
}
......@@ -14,7 +14,7 @@ int arch_fixup(unsigned long address, void *sc_ptr)
struct sigcontext *sc = sc_ptr;
unsigned long fixup;
fixup = search_exception_table(address);
fixup = search_exception_tables(address);
if(fixup != 0){
sc->eip = fixup;
return(1);
......
#include "linux/config.h"
#include "linux/stddef.h"
#include "linux/sched.h"
......@@ -12,7 +13,9 @@ int main(int argc, char **argv)
{
print_head();
print_constant_ptr("TASK_DEBUGREGS", THREAD_OFFSET(arch.debugregs));
#ifdef CONFIG_MODE_TT
print_constant("TASK_EXTERN_PID", "int", THREAD_OFFSET(mode.tt.extern_pid));
#endif
print_tail();
return(0);
}
......
......@@ -11,15 +11,17 @@ SECTIONS
. = ALIGN(4096);
__binary_start = .;
#ifdef MODE_TT
.thread_private : {
__start_thread_private = .;
errno = .;
. += 4;
arch/um/kernel/unmap_fin.o (.data)
arch/um/kernel/tt/unmap_fin.o (.data)
__end_thread_private = .;
}
. = ALIGN(4096);
.remap : { arch/um/kernel/unmap_fin.o (.text) }
.remap : { arch/um/kernel/tt/unmap_fin.o (.text) }
#endif
. = ALIGN(4096); /* Init code and data */
_stext = .;
......@@ -107,7 +109,7 @@ SECTIONS
.data.init : { *(.data.init) }
.data :
{
. = ALIGN(16384); /* init_task */
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
*(.data.init_task)
*(.data)
*(.gnu.linkonce.d*)
......
#ifndef __UM_BUG_H
#define __UM_BUG_H
#ifndef __ASSEMBLY__
#define BUG() do { \
panic("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
} while (0)
#define PAGE_BUG(page) do { \
BUG(); \
} while (0)
extern int foo;
#endif
#endif
......@@ -4,9 +4,8 @@
struct page;
#include "asm/arch/page.h"
#include "asm/bug.h"
#undef BUG
#undef PAGE_BUG
#undef __pa
#undef __va
#undef pfn_to_page
......@@ -23,20 +22,6 @@ extern unsigned long uml_physmem;
#define PAGE_OFFSET (uml_physmem)
#define KERNELBASE PAGE_OFFSET
#ifndef __ASSEMBLY__
extern void stop(void);
#define BUG() do { \
panic("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
} while (0)
#define PAGE_BUG(page) do { \
BUG(); \
} while (0)
#endif /* __ASSEMBLY__ */
#define __va_space (8*1024*1024)
extern unsigned long region_pa(void *virt);
......
......@@ -14,6 +14,9 @@
extern pgd_t swapper_pg_dir[1024];
extern void *um_virt_to_phys(struct task_struct *task, unsigned long virt,
pte_t *pte_out);
/* zero page used for uninitialized stuff */
extern unsigned long *empty_zero_page;
......
......@@ -14,8 +14,8 @@ struct arch_thread {
int debugregs_seq;
};
#define INIT_ARCH_THREAD { debugregs : { [ 0 ... 7 ] = 0 }, \
debugregs_seq : 0 }
#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
.debugregs_seq = 0 }
#include "asm/arch/user.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment