Commit 9fbf0a8b authored by Jeff Dike's avatar Jeff Dike

Merge uml.karaya.com:/home/jdike/linux/2.5/build-2.5

into uml.karaya.com:/home/jdike/linux/2.5/cleanup-2.5
parents cff547d2 7f836ff7
...@@ -75,15 +75,15 @@ static void not_configged_free(void *data) ...@@ -75,15 +75,15 @@ static void not_configged_free(void *data)
} }
static struct chan_ops not_configged_ops = { static struct chan_ops not_configged_ops = {
init: not_configged_init, .init = not_configged_init,
open: not_configged_open, .open = not_configged_open,
close: not_configged_close, .close = not_configged_close,
read: not_configged_read, .read = not_configged_read,
write: not_configged_write, .write = not_configged_write,
console_write: not_configged_console_write, .console_write = not_configged_console_write,
window_size: not_configged_window_size, .window_size = not_configged_window_size,
free: not_configged_free, .free = not_configged_free,
winch: 0, .winch = 0,
}; };
static void tty_receive_char(struct tty_struct *tty, char ch) 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, ...@@ -395,15 +395,15 @@ static struct chan *parse_chan(char *str, int pri, int device,
chan = kmalloc(sizeof(*chan), GFP_KERNEL); chan = kmalloc(sizeof(*chan), GFP_KERNEL);
if(chan == NULL) return(NULL); if(chan == NULL) return(NULL);
*chan = ((struct chan) { list : LIST_HEAD_INIT(chan->list), *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list),
primary : 1, .primary = 1,
input : 0, .input = 0,
output : 0, .output = 0,
opened : 0, .opened = 0,
fd : -1, .fd = -1,
pri : pri, .pri = pri,
ops : ops, .ops = ops,
data : data }); .data = data });
return(chan); return(chan);
} }
......
...@@ -159,9 +159,9 @@ static int winch_tramp(int fd, void *device_data, int *fd_out) ...@@ -159,9 +159,9 @@ static int winch_tramp(int fd, void *device_data, int *fd_out)
return(err); return(err);
} }
data = ((struct winch_data) { pty_fd : fd, data = ((struct winch_data) { .pty_fd = fd,
pipe_fd : fds[1], .pipe_fd = fds[1],
close_me : fds[0] } ); .close_me = fds[0] } );
pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); pid = run_helper_thread(winch_thread, &data, 0, &stack, 0);
if(pid < 0){ if(pid < 0){
printk("fork of winch_thread failed - errno = %d\n", errno); printk("fork of winch_thread failed - errno = %d\n", errno);
......
...@@ -28,14 +28,14 @@ void daemon_init(struct net_device *dev, void *data) ...@@ -28,14 +28,14 @@ void daemon_init(struct net_device *dev, void *data)
pri = dev->priv; pri = dev->priv;
dpri = (struct daemon_data *) pri->user; dpri = (struct daemon_data *) pri->user;
*dpri = ((struct daemon_data) *dpri = ((struct daemon_data)
{ sock_type : init->sock_type, { .sock_type = init->sock_type,
ctl_sock : init->ctl_sock, .ctl_sock = init->ctl_sock,
ctl_addr : NULL, .ctl_addr = NULL,
data_addr : NULL, .data_addr = NULL,
local_addr : NULL, .local_addr = NULL,
fd : -1, .fd = -1,
control : -1, .control = -1,
dev : dev }); .dev = dev });
printk("daemon backend (uml_switch version %d) - %s:%s", printk("daemon backend (uml_switch version %d) - %s:%s",
SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock); SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock);
...@@ -59,10 +59,10 @@ static int daemon_write(int fd, struct sk_buff **skb, ...@@ -59,10 +59,10 @@ static int daemon_write(int fd, struct sk_buff **skb,
} }
static struct net_kern_info daemon_kern_info = { static struct net_kern_info daemon_kern_info = {
init: daemon_init, .init = daemon_init,
protocol: eth_protocol, .protocol = eth_protocol,
read: daemon_read, .read = daemon_read,
write: daemon_write, .write = daemon_write,
}; };
int daemon_setup(char *str, char **mac_out, void *data) int daemon_setup(char *str, char **mac_out, void *data)
...@@ -71,8 +71,8 @@ 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; char *remain;
*init = ((struct daemon_init) *init = ((struct daemon_init)
{ sock_type : "unix", { .sock_type = "unix",
ctl_sock : "/tmp/uml.ctl" }); .ctl_sock = "/tmp/uml.ctl" });
remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock, remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock,
NULL); NULL);
...@@ -84,13 +84,13 @@ int daemon_setup(char *str, char **mac_out, void *data) ...@@ -84,13 +84,13 @@ int daemon_setup(char *str, char **mac_out, void *data)
} }
static struct transport daemon_transport = { static struct transport daemon_transport = {
list : LIST_HEAD_INIT(daemon_transport.list), .list = LIST_HEAD_INIT(daemon_transport.list),
name : "daemon", .name = "daemon",
setup : daemon_setup, .setup = daemon_setup,
user : &daemon_user_info, .user = &daemon_user_info,
kern : &daemon_kern_info, .kern = &daemon_kern_info,
private_size : sizeof(struct daemon_data), .private_size = sizeof(struct daemon_data),
setup_size : sizeof(struct daemon_init), .setup_size = sizeof(struct daemon_init),
}; };
static int register_daemon(void) static int register_daemon(void)
......
...@@ -172,14 +172,14 @@ static int daemon_set_mtu(int mtu, void *data) ...@@ -172,14 +172,14 @@ static int daemon_set_mtu(int mtu, void *data)
} }
struct net_user_info daemon_user_info = { struct net_user_info daemon_user_info = {
init: daemon_user_init, .init = daemon_user_init,
open: daemon_open, .open = daemon_open,
close: NULL, .close = NULL,
remove: daemon_remove, .remove = daemon_remove,
set_mtu: daemon_set_mtu, .set_mtu = daemon_set_mtu,
add_address: NULL, .add_address = NULL,
delete_address: NULL, .delete_address = NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER .max_packet = MAX_PACKET - ETH_HEADER_OTHER
}; };
/* /*
......
...@@ -36,8 +36,8 @@ void *fd_init(char *str, int device, struct chan_opts *opts) ...@@ -36,8 +36,8 @@ void *fd_init(char *str, int device, struct chan_opts *opts)
return(NULL); return(NULL);
} }
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL); if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct fd_chan) { fd : n, *data = ((struct fd_chan) { .fd = n,
raw : opts->raw }); .raw = opts->raw });
return(data); return(data);
} }
...@@ -72,16 +72,16 @@ int fd_console_write(int fd, const char *buf, int n, void *d) ...@@ -72,16 +72,16 @@ int fd_console_write(int fd, const char *buf, int n, void *d)
} }
struct chan_ops fd_ops = { struct chan_ops fd_ops = {
type: "fd", .type = "fd",
init: fd_init, .init = fd_init,
open: fd_open, .open = fd_open,
close: fd_close, .close = fd_close,
read: generic_read, .read = generic_read,
write: generic_write, .write = generic_write,
console_write: fd_console_write, .console_write = fd_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: generic_free, .free = generic_free,
winch: 1, .winch = 1,
}; };
/* /*
......
...@@ -145,17 +145,17 @@ static int harddog_ioctl(struct inode *inode, struct file *file, ...@@ -145,17 +145,17 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
} }
static struct file_operations harddog_fops = { static struct file_operations harddog_fops = {
owner: THIS_MODULE, .owner = THIS_MODULE,
write: harddog_write, .write = harddog_write,
ioctl: harddog_ioctl, .ioctl = harddog_ioctl,
open: harddog_open, .open = harddog_open,
release: harddog_release, .release = harddog_release,
}; };
static struct miscdevice harddog_miscdev = { static struct miscdevice harddog_miscdev = {
minor: WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
name: "watchdog", .name = "watchdog",
fops: &harddog_fops, .fops = &harddog_fops,
}; };
static char banner[] __initdata = KERN_INFO "UML Watchdog Timer\n"; static char banner[] __initdata = KERN_INFO "UML Watchdog Timer\n";
......
...@@ -195,23 +195,23 @@ static int hostmixer_release(struct inode *inode, struct file *file) ...@@ -195,23 +195,23 @@ static int hostmixer_release(struct inode *inode, struct file *file)
/* kernel module operations */ /* kernel module operations */
static struct file_operations hostaudio_fops = { static struct file_operations hostaudio_fops = {
owner: THIS_MODULE, .owner = THIS_MODULE,
llseek: no_llseek, .llseek = no_llseek,
read: hostaudio_read, .read = hostaudio_read,
write: hostaudio_write, .write = hostaudio_write,
poll: hostaudio_poll, .poll = hostaudio_poll,
ioctl: hostaudio_ioctl, .ioctl = hostaudio_ioctl,
mmap: NULL, .mmap = NULL,
open: hostaudio_open, .open = hostaudio_open,
release: hostaudio_release, .release = hostaudio_release,
}; };
static struct file_operations hostmixer_fops = { static struct file_operations hostmixer_fops = {
owner: THIS_MODULE, .owner = THIS_MODULE,
llseek: no_llseek, .llseek = no_llseek,
ioctl: hostmixer_ioctl_mixdev, .ioctl = hostmixer_ioctl_mixdev,
open: hostmixer_open_mixdev, .open = hostmixer_open_mixdev,
release: hostmixer_release, .release = hostmixer_release,
}; };
struct { struct {
......
...@@ -35,7 +35,7 @@ void line_timer_cb(void *arg) ...@@ -35,7 +35,7 @@ void line_timer_cb(void *arg)
line_interrupt(dev->driver->read_irq, dev, NULL); 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; int end;
...@@ -519,11 +519,11 @@ void register_winch_irq(int fd, int tty_fd, int pid, void *line) ...@@ -519,11 +519,11 @@ void register_winch_irq(int fd, int tty_fd, int pid, void *line)
printk("register_winch_irq - kmalloc failed\n"); printk("register_winch_irq - kmalloc failed\n");
goto out; goto out;
} }
*winch = ((struct winch) { list : LIST_HEAD_INIT(winch->list), *winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list),
fd : fd, .fd = fd,
tty_fd : tty_fd, .tty_fd = tty_fd,
pid : pid, .pid = pid,
line : line }); .line = line });
list_add(&winch->list, &winch_handlers); list_add(&winch->list, &winch_handlers);
if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
......
...@@ -36,11 +36,11 @@ void mcast_init(struct net_device *dev, void *data) ...@@ -36,11 +36,11 @@ void mcast_init(struct net_device *dev, void *data)
pri = dev->priv; pri = dev->priv;
dpri = (struct mcast_data *) pri->user; dpri = (struct mcast_data *) pri->user;
*dpri = ((struct mcast_data) *dpri = ((struct mcast_data)
{ addr : init->addr, { .addr = init->addr,
port : init->port, .port = init->port,
ttl : init->ttl, .ttl = init->ttl,
mcast_addr : NULL, .mcast_addr = NULL,
dev : dev }); .dev = dev });
printk("mcast backend "); printk("mcast backend ");
printk("multicast adddress: %s:%u, TTL:%u ", printk("multicast adddress: %s:%u, TTL:%u ",
dpri->addr, dpri->port, dpri->ttl); dpri->addr, dpri->port, dpri->ttl);
...@@ -64,10 +64,10 @@ static int mcast_write(int fd, struct sk_buff **skb, ...@@ -64,10 +64,10 @@ static int mcast_write(int fd, struct sk_buff **skb,
} }
static struct net_kern_info mcast_kern_info = { static struct net_kern_info mcast_kern_info = {
init: mcast_init, .init = mcast_init,
protocol: eth_protocol, .protocol = eth_protocol,
read: mcast_read, .read = mcast_read,
write: mcast_write, .write = mcast_write,
}; };
int mcast_setup(char *str, char **mac_out, void *data) int mcast_setup(char *str, char **mac_out, void *data)
...@@ -78,9 +78,9 @@ 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; int n;
*init = ((struct mcast_init) *init = ((struct mcast_init)
{ addr : "239.192.168.1", { .addr = "239.192.168.1",
port : 1102, .port = 1102,
ttl : 1 }); .ttl = 1 });
remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str, remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str,
NULL); NULL);
...@@ -116,13 +116,13 @@ int mcast_setup(char *str, char **mac_out, void *data) ...@@ -116,13 +116,13 @@ int mcast_setup(char *str, char **mac_out, void *data)
} }
static struct transport mcast_transport = { static struct transport mcast_transport = {
list : LIST_HEAD_INIT(mcast_transport.list), .list = LIST_HEAD_INIT(mcast_transport.list),
name : "mcast", .name = "mcast",
setup : mcast_setup, .setup = mcast_setup,
user : &mcast_user_info, .user = &mcast_user_info,
kern : &mcast_kern_info, .kern = &mcast_kern_info,
private_size : sizeof(struct mcast_data), .private_size = sizeof(struct mcast_data),
setup_size : sizeof(struct mcast_init), .setup_size = sizeof(struct mcast_init),
}; };
static int register_mcast(void) static int register_mcast(void)
......
...@@ -153,14 +153,14 @@ static int mcast_set_mtu(int mtu, void *data) ...@@ -153,14 +153,14 @@ static int mcast_set_mtu(int mtu, void *data)
} }
struct net_user_info mcast_user_info = { struct net_user_info mcast_user_info = {
init: mcast_user_init, .init = mcast_user_init,
open: mcast_open, .open = mcast_open,
close: mcast_close, .close = mcast_close,
remove: NULL, .remove = NULL,
set_mtu: mcast_set_mtu, .set_mtu = mcast_set_mtu,
add_address: NULL, .add_address = NULL,
delete_address: NULL, .delete_address = NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER .max_packet = MAX_PACKET - ETH_HEADER_OTHER
}; };
/* /*
......
...@@ -36,8 +36,8 @@ static int do_unlink_socket(struct notifier_block *notifier, ...@@ -36,8 +36,8 @@ static int do_unlink_socket(struct notifier_block *notifier,
static struct notifier_block reboot_notifier = { static struct notifier_block reboot_notifier = {
notifier_call: do_unlink_socket, .notifier_call = do_unlink_socket,
priority: 0, .priority = 0,
}; };
/* Safe without explicit locking for now. Tasklets provide their own /* 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, ...@@ -418,9 +418,9 @@ static int notify_panic(struct notifier_block *self, unsigned long unused1,
} }
static struct notifier_block panic_exit_notifier = { static struct notifier_block panic_exit_notifier = {
notifier_call : notify_panic, .notifier_call = notify_panic,
next : NULL, .next = NULL,
priority : 1 .priority = 1
}; };
static int add_notifier(void) static int add_notifier(void)
......
...@@ -106,13 +106,13 @@ mmapper_release(struct inode *inode, struct file *file) ...@@ -106,13 +106,13 @@ mmapper_release(struct inode *inode, struct file *file)
} }
static struct file_operations mmapper_fops = { static struct file_operations mmapper_fops = {
owner: THIS_MODULE, .owner = THIS_MODULE,
read: mmapper_read, .read = mmapper_read,
write: mmapper_write, .write = mmapper_write,
ioctl: mmapper_ioctl, .ioctl = mmapper_ioctl,
mmap: mmapper_mmap, .mmap = mmapper_mmap,
open: mmapper_open, .open = mmapper_open,
release: mmapper_release, .release = mmapper_release,
}; };
static int __init mmapper_init(void) static int __init mmapper_init(void)
......
...@@ -368,22 +368,22 @@ static int eth_configure(int n, void *init, char *mac, ...@@ -368,22 +368,22 @@ static int eth_configure(int n, void *init, char *mac,
*/ */
save = lp->user[0]; save = lp->user[0];
*lp = ((struct uml_net_private) *lp = ((struct uml_net_private)
{ list : LIST_HEAD_INIT(lp->list), { .list = LIST_HEAD_INIT(lp->list),
lock : SPIN_LOCK_UNLOCKED, .lock = SPIN_LOCK_UNLOCKED,
dev : dev, .dev = dev,
fd : -1, .fd = -1,
mac : { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0}, .mac = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
have_mac : device->have_mac, .have_mac = device->have_mac,
protocol : transport->kern->protocol, .protocol = transport->kern->protocol,
open : transport->user->open, .open = transport->user->open,
close : transport->user->close, .close = transport->user->close,
remove : transport->user->remove, .remove = transport->user->remove,
read : transport->kern->read, .read = transport->kern->read,
write : transport->kern->write, .write = transport->kern->write,
add_address : transport->user->add_address, .add_address = transport->user->add_address,
delete_address : transport->user->delete_address, .delete_address = transport->user->delete_address,
set_mtu : transport->user->set_mtu, .set_mtu = transport->user->set_mtu,
user : { save } }); .user = { save } });
init_timer(&lp->tl); init_timer(&lp->tl);
lp->tl.function = uml_net_user_timer_expire; lp->tl.function = uml_net_user_timer_expire;
memset(&lp->stats, 0, sizeof(lp->stats)); memset(&lp->stats, 0, sizeof(lp->stats));
...@@ -542,9 +542,9 @@ static int eth_setup(char *str) ...@@ -542,9 +542,9 @@ static int eth_setup(char *str)
printk("eth_init : alloc_bootmem failed\n"); printk("eth_init : alloc_bootmem failed\n");
return(1); return(1);
} }
*new = ((struct eth_init) { list : LIST_HEAD_INIT(new->list), *new = ((struct eth_init) { .list = LIST_HEAD_INIT(new->list),
index : n, .index = n,
init : str }); .init = str });
list_add_tail(&new->list, &eth_cmd_line); list_add_tail(&new->list, &eth_cmd_line);
return(1); return(1);
} }
...@@ -618,9 +618,10 @@ static int net_remove(char *str) ...@@ -618,9 +618,10 @@ static int net_remove(char *str)
} }
static struct mc_device net_mc = { static struct mc_device net_mc = {
name: "eth", .name = "eth",
config: net_config, .config = net_config,
remove: net_remove, .get_config = NULL,
.remove = net_remove,
}; };
static int uml_inetaddr_event(struct notifier_block *this, unsigned long event, 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, ...@@ -662,7 +663,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
} }
struct notifier_block uml_inetaddr_notifier = { struct notifier_block uml_inetaddr_notifier = {
notifier_call: uml_inetaddr_event, .notifier_call = uml_inetaddr_event,
}; };
static int uml_net_init(void) static int uml_net_init(void)
......
...@@ -32,16 +32,16 @@ void null_free(void *data) ...@@ -32,16 +32,16 @@ void null_free(void *data)
} }
struct chan_ops null_ops = { struct chan_ops null_ops = {
type: "null", .type = "null",
init: null_init, .init = null_init,
open: null_open, .open = null_open,
close: generic_close, .close = generic_close,
read: null_read, .read = null_read,
write: generic_write, .write = generic_write,
console_write: generic_console_write, .console_write = generic_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: null_free, .free = null_free,
winch: 0, .winch = 0,
}; };
/* /*
......
...@@ -27,12 +27,12 @@ void pcap_init(struct net_device *dev, void *data) ...@@ -27,12 +27,12 @@ void pcap_init(struct net_device *dev, void *data)
pri = dev->priv; pri = dev->priv;
ppri = (struct pcap_data *) pri->user; ppri = (struct pcap_data *) pri->user;
*ppri = ((struct pcap_data) *ppri = ((struct pcap_data)
{ host_if : init->host_if, { .host_if = init->host_if,
promisc : init->promisc, .promisc = init->promisc,
optimize : init->optimize, .optimize = init->optimize,
filter : init->filter, .filter = init->filter,
compiled : NULL, .compiled = NULL,
pcap : NULL }); .pcap = NULL });
} }
static int pcap_read(int fd, struct sk_buff **skb, 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) ...@@ -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 = { static struct net_kern_info pcap_kern_info = {
init: pcap_init, .init = pcap_init,
protocol: eth_protocol, .protocol = eth_protocol,
read: pcap_read, .read = pcap_read,
write: pcap_write, .write = pcap_write,
}; };
int pcap_setup(char *str, char **mac_out, void *data) int pcap_setup(char *str, char **mac_out, void *data)
...@@ -64,10 +64,10 @@ 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; int i;
*init = ((struct pcap_init) *init = ((struct pcap_init)
{ host_if : "eth0", { .host_if = "eth0",
promisc : 1, .promisc = 1,
optimize : 0, .optimize = 0,
filter : NULL }); .filter = NULL });
remain = split_if_spec(str, &host_if, &init->filter, remain = split_if_spec(str, &host_if, &init->filter,
&options[0], &options[1], NULL); &options[0], &options[1], NULL);
...@@ -98,13 +98,13 @@ int pcap_setup(char *str, char **mac_out, void *data) ...@@ -98,13 +98,13 @@ int pcap_setup(char *str, char **mac_out, void *data)
} }
static struct transport pcap_transport = { static struct transport pcap_transport = {
list : LIST_HEAD_INIT(pcap_transport.list), .list = LIST_HEAD_INIT(pcap_transport.list),
name : "pcap", .name = "pcap",
setup : pcap_setup, .setup = pcap_setup,
user : &pcap_user_info, .user = &pcap_user_info,
kern : &pcap_kern_info, .kern = &pcap_kern_info,
private_size : sizeof(struct pcap_data), .private_size = sizeof(struct pcap_data),
setup_size : sizeof(struct pcap_init), .setup_size = sizeof(struct pcap_init),
}; };
static int register_pcap(void) static int register_pcap(void)
......
...@@ -106,8 +106,8 @@ static void handler(u_char *data, const struct pcap_pkthdr *header, ...@@ -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) int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri)
{ {
struct pcap_handler_data hdata = ((struct pcap_handler_data) struct pcap_handler_data hdata = ((struct pcap_handler_data)
{ buffer : buffer, { .buffer = buffer,
len : len }); .len = len });
int n; int n;
n = pcap_dispatch(pri->pcap, 1, handler, (u_char *) &hdata); 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) ...@@ -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 = { struct net_user_info pcap_user_info = {
init: pcap_user_init, .init = pcap_user_init,
open: pcap_open, .open = pcap_open,
close: NULL, .close = NULL,
remove: pcap_remove, .remove = pcap_remove,
set_mtu: NULL, .set_mtu = NULL,
add_address: NULL, .add_address = NULL,
delete_address: NULL, .delete_address = NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER .max_packet = MAX_PACKET - ETH_HEADER_OTHER
}; };
/* /*
......
...@@ -31,7 +31,6 @@ struct port_list { ...@@ -31,7 +31,6 @@ struct port_list {
struct port_dev { struct port_dev {
struct port_list *port; struct port_list *port;
int fd;
int helper_pid; int helper_pid;
int telnetd_pid; int telnetd_pid;
}; };
...@@ -55,7 +54,8 @@ static void pipe_interrupt(int irq, void *data, struct pt_regs *regs) ...@@ -55,7 +54,8 @@ static void pipe_interrupt(int irq, void *data, struct pt_regs *regs)
if(fd == -EAGAIN) if(fd == -EAGAIN)
return; 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); os_close_file(conn->fd);
} }
...@@ -75,26 +75,29 @@ static int port_accept(struct port_list *port) ...@@ -75,26 +75,29 @@ static int port_accept(struct port_list *port)
fd = port_connection(port->fd, socket, &pid); fd = port_connection(port->fd, socket, &pid);
if(fd < 0){ if(fd < 0){
if(fd != -EAGAIN) if(fd != -EAGAIN)
printk("port_connection returned %d\n", -fd); printk(KERN_ERR "port_accept : port_connection "
"returned %d\n", -fd);
goto out; goto out;
} }
conn = kmalloc(sizeof(*conn), GFP_ATOMIC); conn = kmalloc(sizeof(*conn), GFP_ATOMIC);
if(conn == NULL){ if(conn == NULL){
printk("port_interrupt : failed to allocate connection\n"); printk(KERN_ERR "port_accept : failed to allocate "
"connection\n");
goto out_close; goto out_close;
} }
*conn = ((struct connection) *conn = ((struct connection)
{ list : LIST_HEAD_INIT(conn->list), { .list = LIST_HEAD_INIT(conn->list),
fd : fd, .fd = fd,
socket : { socket[0], socket[1] }, .socket = { socket[0], socket[1] },
telnetd_pid : pid, .telnetd_pid = pid,
port : port }); .port = port });
if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt, if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
"telnetd", conn)){ "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; goto out_free;
} }
...@@ -106,7 +109,8 @@ static int port_accept(struct port_list *port) ...@@ -106,7 +109,8 @@ static int port_accept(struct port_list *port)
kfree(conn); kfree(conn);
out_close: out_close:
os_close_file(fd); os_close_file(fd);
if(pid != -1) os_kill_process(pid, 0); if(pid != -1)
os_kill_process(pid, 0);
out: out:
return(ret); return(ret);
} }
...@@ -174,14 +178,15 @@ void *port_data(int port_num) ...@@ -174,14 +178,15 @@ void *port_data(int port_num)
} }
*port = ((struct port_list) *port = ((struct port_list)
{ list : LIST_HEAD_INIT(port->list), { .list = LIST_HEAD_INIT(port->list),
has_connection : 0, .has_connection = 0,
sem : __SEMAPHORE_INITIALIZER(port->sem, 0), .sem = __SEMAPHORE_INITIALIZER(port->sem,
lock : SPIN_LOCK_UNLOCKED, 0),
port : port_num, .lock = SPIN_LOCK_UNLOCKED,
fd : fd, .port = port_num,
pending : LIST_HEAD_INIT(port->pending), .fd = fd,
connections : LIST_HEAD_INIT(port->connections) }); .pending = LIST_HEAD_INIT(port->pending),
.connections = LIST_HEAD_INIT(port->connections) });
list_add(&port->list, &ports); list_add(&port->list, &ports);
found: found:
...@@ -191,9 +196,9 @@ void *port_data(int port_num) ...@@ -191,9 +196,9 @@ void *port_data(int port_num)
goto out; goto out;
} }
*dev = ((struct port_dev) { port : port, *dev = ((struct port_dev) { .port = port,
fd : -1, .helper_pid = -1,
helper_pid : -1 }); .telnetd_pid = -1 });
goto out; goto out;
out_free: out_free:
...@@ -205,38 +210,16 @@ void *port_data(int port_num) ...@@ -205,38 +210,16 @@ void *port_data(int port_num)
return(dev); 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) int port_wait(void *data)
{ {
struct port_dev *dev = data; struct port_dev *dev = data;
struct connection *conn; struct connection *conn;
struct port_list *port = dev->port; struct port_list *port = dev->port;
int fd;
while(1){ while(1){
if(down_interruptible(&port->sem)) return(-ERESTARTSYS); if(down_interruptible(&port->sem))
return(-ERESTARTSYS);
spin_lock(&port->lock); spin_lock(&port->lock);
...@@ -263,21 +246,48 @@ int port_wait(void *data) ...@@ -263,21 +246,48 @@ int port_wait(void *data)
kfree(conn); kfree(conn);
} }
dev->fd = conn->fd; fd = conn->fd;
dev->helper_pid = conn->helper_pid; dev->helper_pid = conn->helper_pid;
dev->telnetd_pid = conn->telnetd_pid; dev->telnetd_pid = conn->telnetd_pid;
kfree(conn); 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, 0);
dev->helper_pid = -1;
dev->telnetd_pid = -1;
} }
void port_kern_free(void *d) void port_kern_free(void *d)
{ {
struct port_dev *dev = d; struct port_dev *dev = d;
port_remove_dev(dev);
kfree(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. * Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically * 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) ...@@ -47,14 +47,28 @@ void *port_init(char *str, int device, struct chan_opts *opts)
return(NULL); 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,
*data = ((struct port_chan) { raw : opts->raw, .kernel_data = kern_data });
kernel_data : kern_data });
sprintf(data->dev, "%d", port); sprintf(data->dev, "%d", port);
return(data); 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) 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) ...@@ -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)); 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 = { struct chan_ops port_ops = {
type: "port", .type = "port",
init: port_init, .init = port_init,
open: port_open, .open = port_open,
close: port_close, .close = port_close,
read: generic_read, .read = generic_read,
write: generic_write, .write = generic_write,
console_write: port_console_write, .console_write = port_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: port_free, .free = port_free,
winch: 1, .winch = 1,
}; };
int port_listen_fd(int port) int port_listen_fd(int port)
...@@ -113,7 +119,8 @@ int port_listen_fd(int port) ...@@ -113,7 +119,8 @@ int port_listen_fd(int port)
int fd, err; int fd, err;
fd = socket(PF_INET, SOCK_STREAM, 0); fd = socket(PF_INET, SOCK_STREAM, 0);
if(fd == -1) return(-errno); if(fd == -1)
return(-errno);
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons(port); addr.sin_port = htons(port);
...@@ -163,14 +170,16 @@ int port_connection(int fd, int *socket, int *pid_out) ...@@ -163,14 +170,16 @@ int port_connection(int fd, int *socket, int *pid_out)
return(-errno); return(-errno);
err = os_pipe(socket, 0, 0); err = os_pipe(socket, 0, 0);
if(err) goto out_close; if(err)
goto out_close;
data = ((struct port_pre_exec_data) data = ((struct port_pre_exec_data)
{ sock_fd : new, { .sock_fd = new,
pipe_fd : socket[1] }); .pipe_fd = socket[1] });
err = run_helper(port_pre_exec, &data, argv, NULL); err = run_helper(port_pre_exec, &data, argv, NULL);
if(err < 0) goto out_shutdown; if(err < 0)
goto out_shutdown;
*pid_out = err; *pid_out = err;
return(new); return(new);
......
/* /*
* Copyright (C) 2001 Jeff Dike (jdike@karaya.com) * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL * Licensed under the GPL
*/ */
...@@ -27,9 +27,9 @@ void *pty_chan_init(char *str, int device, struct chan_opts *opts) ...@@ -27,9 +27,9 @@ void *pty_chan_init(char *str, int device, struct chan_opts *opts)
struct pty_chan *data; struct pty_chan *data;
if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL); if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct pty_chan) { announce : opts->announce, *data = ((struct pty_chan) { .announce = opts->announce,
dev : device, .dev = device,
raw : opts->raw }); .raw = opts->raw });
return(data); return(data);
} }
...@@ -86,34 +86,15 @@ int getmaster(char *line) ...@@ -86,34 +86,15 @@ int getmaster(char *line)
return(-1); 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) int pty_open(int input, int output, int primary, void *d, char **dev_out)
{ {
struct pty_chan *data = d; struct pty_chan *data = d;
int fd; int fd;
char dev[sizeof("/dev/ptyxx\0")] = "/dev/ptyxx"; char dev[sizeof("/dev/ptyxx\0")] = "/dev/ptyxx";
struct grantpt_info info;
fd = getmaster(dev); fd = getmaster(dev);
if(fd < 0) return(-errno); if(fd < 0) return(-errno);
info.fd = fd;
initial_thread_cb(grantpt_cb, &info);
unlockpt(fd);
if(data->raw) raw(fd, 0); if(data->raw) raw(fd, 0);
if(data->announce) (*data->announce)(dev, data->dev); 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) ...@@ -130,29 +111,29 @@ int pty_console_write(int fd, const char *buf, int n, void *d)
} }
struct chan_ops pty_ops = { struct chan_ops pty_ops = {
type: "pty", .type = "pty",
init: pty_chan_init, .init = pty_chan_init,
open: pty_open, .open = pty_open,
close: generic_close, .close = generic_close,
read: generic_read, .read = generic_read,
write: generic_write, .write = generic_write,
console_write: pty_console_write, .console_write = pty_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: generic_free, .free = generic_free,
winch: 0, .winch = 0,
}; };
struct chan_ops pts_ops = { struct chan_ops pts_ops = {
type: "pts", .type = "pts",
init: pty_chan_init, .init = pty_chan_init,
open: pts_open, .open = pts_open,
close: generic_close, .close = generic_close,
read: generic_read, .read = generic_read,
write: generic_write, .write = generic_write,
console_write: pty_console_write, .console_write = pty_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: generic_free, .free = generic_free,
winch: 0, .winch = 0,
}; };
/* /*
......
...@@ -22,15 +22,15 @@ void slip_init(struct net_device *dev, void *data) ...@@ -22,15 +22,15 @@ void slip_init(struct net_device *dev, void *data)
private = dev->priv; private = dev->priv;
spri = (struct slip_data *) private->user; spri = (struct slip_data *) private->user;
*spri = ((struct slip_data) *spri = ((struct slip_data)
{ name : { '\0' }, { .name = { '\0' },
addr: NULL, .addr = NULL,
gate_addr : init->gate_addr, .gate_addr = init->gate_addr,
slave : -1, .slave = -1,
ibuf : { '\0' }, .ibuf = { '\0' },
obuf : { '\0' }, .obuf = { '\0' },
pos : 0, .pos = 0,
esc : 0, .esc = 0,
dev : dev }); .dev = dev });
dev->init = NULL; dev->init = NULL;
dev->hard_header_len = 0; dev->hard_header_len = 0;
...@@ -61,10 +61,10 @@ static int slip_write(int fd, struct sk_buff **skb, ...@@ -61,10 +61,10 @@ static int slip_write(int fd, struct sk_buff **skb,
} }
struct net_kern_info slip_kern_info = { struct net_kern_info slip_kern_info = {
init: slip_init, .init = slip_init,
protocol: slip_protocol, .protocol = slip_protocol,
read: slip_read, .read = slip_read,
write: slip_write, .write = slip_write,
}; };
static int slip_setup(char *str, char **mac_out, void *data) 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) ...@@ -72,7 +72,7 @@ static int slip_setup(char *str, char **mac_out, void *data)
struct slip_init *init = data; struct slip_init *init = data;
*init = ((struct slip_init) *init = ((struct slip_init)
{ gate_addr : NULL }); { .gate_addr = NULL });
if(str[0] != '\0') if(str[0] != '\0')
init->gate_addr = str; init->gate_addr = str;
...@@ -80,13 +80,13 @@ static int slip_setup(char *str, char **mac_out, void *data) ...@@ -80,13 +80,13 @@ static int slip_setup(char *str, char **mac_out, void *data)
} }
static struct transport slip_transport = { static struct transport slip_transport = {
list : LIST_HEAD_INIT(slip_transport.list), .list = LIST_HEAD_INIT(slip_transport.list),
name : "slip", .name = "slip",
setup : slip_setup, .setup = slip_setup,
user : &slip_user_info, .user = &slip_user_info,
kern : &slip_kern_info, .kern = &slip_kern_info,
private_size : sizeof(struct slip_data), .private_size = sizeof(struct slip_data),
setup_size : sizeof(struct slip_init), .setup_size = sizeof(struct slip_init),
}; };
static int register_slip(void) static int register_slip(void)
......
...@@ -257,14 +257,14 @@ static void slip_del_addr(unsigned char *addr, unsigned char *netmask, ...@@ -257,14 +257,14 @@ static void slip_del_addr(unsigned char *addr, unsigned char *netmask,
} }
struct net_user_info slip_user_info = { struct net_user_info slip_user_info = {
init: slip_user_init, .init = slip_user_init,
open: slip_open, .open = slip_open,
close: slip_close, .close = slip_close,
remove: NULL, .remove = NULL,
set_mtu: slip_set_mtu, .set_mtu = slip_set_mtu,
add_address: slip_add_addr, .add_address = slip_add_addr,
delete_address: slip_del_addr, .delete_address = slip_del_addr,
max_packet: BUF_SIZE .max_packet = BUF_SIZE
}; };
/* /*
......
...@@ -22,14 +22,14 @@ void slirp_init(struct net_device *dev, void *data) ...@@ -22,14 +22,14 @@ void slirp_init(struct net_device *dev, void *data)
private = dev->priv; private = dev->priv;
spri = (struct slirp_data *) private->user; spri = (struct slirp_data *) private->user;
*spri = ((struct slirp_data) *spri = ((struct slirp_data)
{ argw : init->argw, { .argw = init->argw,
pid : -1, .pid = -1,
slave : -1, .slave = -1,
ibuf : { '\0' }, .ibuf = { '\0' },
obuf : { '\0' }, .obuf = { '\0' },
pos : 0, .pos = 0,
esc : 0, .esc = 0,
dev : dev }); .dev = dev });
dev->init = NULL; dev->init = NULL;
dev->hard_header_len = 0; dev->hard_header_len = 0;
...@@ -64,10 +64,10 @@ static int slirp_write(int fd, struct sk_buff **skb, ...@@ -64,10 +64,10 @@ static int slirp_write(int fd, struct sk_buff **skb,
} }
struct net_kern_info slirp_kern_info = { struct net_kern_info slirp_kern_info = {
init: slirp_init, .init = slirp_init,
protocol: slirp_protocol, .protocol = slirp_protocol,
read: slirp_read, .read = slirp_read,
write: slirp_write, .write = slirp_write,
}; };
static int slirp_setup(char *str, char **mac_out, void *data) 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) ...@@ -103,13 +103,13 @@ static int slirp_setup(char *str, char **mac_out, void *data)
} }
static struct transport slirp_transport = { static struct transport slirp_transport = {
list : LIST_HEAD_INIT(slirp_transport.list), .list = LIST_HEAD_INIT(slirp_transport.list),
name : "slirp", .name = "slirp",
setup : slirp_setup, .setup = slirp_setup,
user : &slirp_user_info, .user = &slirp_user_info,
kern : &slirp_kern_info, .kern = &slirp_kern_info,
private_size : sizeof(struct slirp_data), .private_size = sizeof(struct slirp_data),
setup_size : sizeof(struct slirp_init), .setup_size = sizeof(struct slirp_init),
}; };
static int register_slirp(void) static int register_slirp(void)
......
...@@ -180,14 +180,14 @@ static int slirp_set_mtu(int mtu, void *data) ...@@ -180,14 +180,14 @@ static int slirp_set_mtu(int mtu, void *data)
} }
struct net_user_info slirp_user_info = { struct net_user_info slirp_user_info = {
init: slirp_user_init, .init = slirp_user_init,
open: slirp_open, .open = slirp_open,
close: slirp_close, .close = slirp_close,
remove: NULL, .remove = NULL,
set_mtu: slirp_set_mtu, .set_mtu = slirp_set_mtu,
add_address: NULL, .add_address = NULL,
delete_address: NULL, .delete_address = NULL,
max_packet: BUF_SIZE .max_packet = BUF_SIZE
}; };
/* /*
......
...@@ -41,11 +41,11 @@ void ssl_announce(char *dev_name, int dev) ...@@ -41,11 +41,11 @@ void ssl_announce(char *dev_name, int dev)
} }
static struct chan_opts opts = { static struct chan_opts opts = {
announce: ssl_announce, .announce = ssl_announce,
xterm_title: "Serial Line #%d", .xterm_title = "Serial Line #%d",
raw: 1, .raw = 1,
tramp_stack : 0, .tramp_stack = 0,
in_kernel : 1, .in_kernel = 1,
}; };
static int ssl_config(char *str); static int ssl_config(char *str);
...@@ -53,23 +53,23 @@ static int ssl_get_config(char *dev, char *str, int size, char **error_out); ...@@ -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 int ssl_remove(char *str);
static struct line_driver driver = { static struct line_driver driver = {
name : "UML serial line", .name = "UML serial line",
devfs_name : "tts/%d", .devfs_name = "tts/%d",
major : TTYAUX_MAJOR, .major = TTYAUX_MAJOR,
minor_start : 64, .minor_start = 64,
type : TTY_DRIVER_TYPE_SERIAL, .type = TTY_DRIVER_TYPE_SERIAL,
subtype : 0, .subtype = 0,
read_irq : SSL_IRQ, .read_irq = SSL_IRQ,
read_irq_name : "ssl", .read_irq_name = "ssl",
write_irq : SSL_WRITE_IRQ, .write_irq = SSL_WRITE_IRQ,
write_irq_name : "ssl-write", .write_irq_name = "ssl-write",
symlink_from : "serial", .symlink_from = "serial",
symlink_to : "tts", .symlink_to = "tts",
mc : { .mc = {
name : "ssl", .name = "ssl",
config : ssl_config, .config = ssl_config,
get_config : ssl_get_config, .get_config = ssl_get_config,
remove : ssl_remove, .remove = ssl_remove,
}, },
}; };
...@@ -191,21 +191,21 @@ void ssl_hangup(struct tty_struct *tty) ...@@ -191,21 +191,21 @@ void ssl_hangup(struct tty_struct *tty)
} }
static struct tty_driver ssl_driver = { static struct tty_driver ssl_driver = {
refcount : &ssl_refcount, .refcount = &ssl_refcount,
open : ssl_open, .open = ssl_open,
close : ssl_close, .close = ssl_close,
write : ssl_write, .write = ssl_write,
put_char : ssl_put_char, .put_char = ssl_put_char,
flush_chars : ssl_flush_chars, .flush_chars = ssl_flush_chars,
chars_in_buffer : ssl_chars_in_buffer, .chars_in_buffer = ssl_chars_in_buffer,
flush_buffer : ssl_flush_buffer, .flush_buffer = ssl_flush_buffer,
ioctl : ssl_ioctl, .ioctl = ssl_ioctl,
throttle : ssl_throttle, .throttle = ssl_throttle,
unthrottle : ssl_unthrottle, .unthrottle = ssl_unthrottle,
set_termios : ssl_set_termios, .set_termios = ssl_set_termios,
stop : ssl_stop, .stop = ssl_stop,
start : ssl_start, .start = ssl_start,
hangup : ssl_hangup .hangup = ssl_hangup
}; };
/* Changed by ssl_init and referenced by ssl_exit, which are both serialized /* Changed by ssl_init and referenced by ssl_exit, which are both serialized
......
...@@ -42,28 +42,28 @@ static struct tty_driver console_driver; ...@@ -42,28 +42,28 @@ static struct tty_driver console_driver;
static int console_refcount = 0; static int console_refcount = 0;
static struct chan_ops init_console_ops = { static struct chan_ops init_console_ops = {
type: "you shouldn't see this", .type = "you shouldn't see this",
init : NULL, .init = NULL,
open : NULL, .open = NULL,
close : NULL, .close = NULL,
read : NULL, .read = NULL,
write : NULL, .write = NULL,
console_write : generic_write, .console_write = generic_write,
window_size : NULL, .window_size = NULL,
free : NULL, .free = NULL,
winch: 0, .winch = 0,
}; };
static struct chan init_console_chan = { static struct chan init_console_chan = {
list : { }, .list = { },
primary : 1, .primary = 1,
input : 0, .input = 0,
output : 1, .output = 1,
opened : 1, .opened = 1,
fd : 1, .fd = 1,
pri : INIT_STATIC, .pri = INIT_STATIC,
ops : &init_console_ops, .ops = &init_console_ops,
data : NULL .data = NULL
}; };
void stdio_announce(char *dev_name, int dev) void stdio_announce(char *dev_name, int dev)
...@@ -73,11 +73,11 @@ 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 = { static struct chan_opts opts = {
announce: stdio_announce, .announce = stdio_announce,
xterm_title: "Virtual Console #%d", .xterm_title = "Virtual Console #%d",
raw: 1, .raw = 1,
tramp_stack : 0, .tramp_stack = 0,
in_kernel : 1, .in_kernel = 1,
}; };
static int con_config(char *str); static int con_config(char *str);
...@@ -85,23 +85,23 @@ static int con_get_config(char *dev, char *str, int size, char **error_out); ...@@ -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 int con_remove(char *str);
static struct line_driver driver = { static struct line_driver driver = {
name : "UML console", .name = "UML console",
devfs_name : "vc/%d", .devfs_name = "vc/%d",
major : TTY_MAJOR, .major = TTY_MAJOR,
minor_start : 0, .minor_start = 0,
type : TTY_DRIVER_TYPE_CONSOLE, .type = TTY_DRIVER_TYPE_CONSOLE,
subtype : SYSTEM_TYPE_CONSOLE, .subtype = SYSTEM_TYPE_CONSOLE,
read_irq : CONSOLE_IRQ, .read_irq = CONSOLE_IRQ,
read_irq_name : "console", .read_irq_name = "console",
write_irq : CONSOLE_WRITE_IRQ, .write_irq = CONSOLE_WRITE_IRQ,
write_irq_name : "console-write", .write_irq_name = "console-write",
symlink_from : "ttys", .symlink_from = "ttys",
symlink_to : "vc", .symlink_to = "vc",
mc : { .mc = {
name : "con", .name = "con",
config : con_config, .config = con_config,
get_config : con_get_config, .get_config = con_get_config,
remove : con_remove, .remove = con_remove,
}, },
}; };
...@@ -192,12 +192,12 @@ static void console_write(struct console *console, const char *string, ...@@ -192,12 +192,12 @@ static void console_write(struct console *console, const char *string,
} }
static struct tty_driver console_driver = { static struct tty_driver console_driver = {
refcount : &console_refcount, .refcount = &console_refcount,
open : con_open, .open = con_open,
close : con_close, .close = con_close,
write : con_write, .write = con_write,
chars_in_buffer : chars_in_buffer, .chars_in_buffer = chars_in_buffer,
set_termios : set_termios .set_termios = set_termios
}; };
static kdev_t console_device(struct console *c) static kdev_t console_device(struct console *c)
......
...@@ -32,8 +32,8 @@ void *tty_chan_init(char *str, int device, struct chan_opts *opts) ...@@ -32,8 +32,8 @@ void *tty_chan_init(char *str, int device, struct chan_opts *opts)
if((data = um_kmalloc(sizeof(*data))) == NULL) if((data = um_kmalloc(sizeof(*data))) == NULL)
return(NULL); return(NULL);
*data = ((struct tty_chan) { dev : str, *data = ((struct tty_chan) { .dev = str,
raw : opts->raw }); .raw = opts->raw });
return(data); return(data);
} }
...@@ -62,16 +62,16 @@ int tty_console_write(int fd, const char *buf, int n, void *d) ...@@ -62,16 +62,16 @@ int tty_console_write(int fd, const char *buf, int n, void *d)
} }
struct chan_ops tty_ops = { struct chan_ops tty_ops = {
type: "tty", .type = "tty",
init: tty_chan_init, .init = tty_chan_init,
open: tty_open, .open = tty_open,
close: generic_close, .close = generic_close,
read: generic_read, .read = generic_read,
write: generic_write, .write = generic_write,
console_write: tty_console_write, .console_write = tty_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: generic_free, .free = generic_free,
winch: 0, .winch = 0,
}; };
/* /*
......
...@@ -37,13 +37,13 @@ void *xterm_init(char *str, int device, struct chan_opts *opts) ...@@ -37,13 +37,13 @@ void *xterm_init(char *str, int device, struct chan_opts *opts)
struct xterm_chan *data; struct xterm_chan *data;
if((data = malloc(sizeof(*data))) == NULL) return(NULL); if((data = malloc(sizeof(*data))) == NULL) return(NULL);
*data = ((struct xterm_chan) { pid : -1, *data = ((struct xterm_chan) { .pid = -1,
helper_pid : -1, .helper_pid = -1,
device : device, .device = device,
title : opts->xterm_title, .title = opts->xterm_title,
raw : opts->raw, .raw = opts->raw,
stack : opts->tramp_stack, .stack = opts->tramp_stack,
direct_rcv : !opts->in_kernel } ); .direct_rcv = !opts->in_kernel } );
return(data); return(data);
} }
...@@ -172,16 +172,16 @@ int xterm_console_write(int fd, const char *buf, int n, void *d) ...@@ -172,16 +172,16 @@ int xterm_console_write(int fd, const char *buf, int n, void *d)
} }
struct chan_ops xterm_ops = { struct chan_ops xterm_ops = {
type: "xterm", .type = "xterm",
init: xterm_init, .init = xterm_init,
open: xterm_open, .open = xterm_open,
close: xterm_close, .close = xterm_close,
read: generic_read, .read = generic_read,
write: generic_write, .write = generic_write,
console_write: xterm_console_write, .console_write = xterm_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: xterm_free, .free = xterm_free,
winch: 1, .winch = 1,
}; };
/* /*
......
...@@ -39,21 +39,21 @@ int xterm_fd(int socket, int *pid_out) ...@@ -39,21 +39,21 @@ int xterm_fd(int socket, int *pid_out)
data = kmalloc(sizeof(*data), GFP_KERNEL); data = kmalloc(sizeof(*data), GFP_KERNEL);
if(data == NULL){ 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); return(-ENOMEM);
} }
*data = ((struct xterm_wait) *data = ((struct xterm_wait)
{ sem : __SEMAPHORE_INITIALIZER(data->sem, 0), { .sem = __SEMAPHORE_INITIALIZER(data->sem, 0),
fd : socket, .fd = socket,
pid : -1, .pid = -1,
new_fd : -1 }); .new_fd = -1 });
err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt, err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
"xterm", data); "xterm", data);
if(err){ if(err){
printk(KERN_ERR "Failed to get IRQ for xterm, err = %d\n", printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
err); "err = %d\n", err);
return(err); return(err);
} }
down(&data->sem); down(&data->sem);
......
/* /*
* Copyright (C) 2001 Jeff Dike (jdike@karaya.com) * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL * Licensed under the GPL
*/ */
#ifndef __SIGNAL_KERN_H__ #ifndef __SIGNAL_KERN_H__
#define __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); extern int have_signals(void *t);
#endif #endif
......
...@@ -3,8 +3,13 @@ ...@@ -3,8 +3,13 @@
* Licensed under the GPL * Licensed under the GPL
*/ */
#ifndef __UMID_H__
#define __UMID_H__
extern int umid_file_name(char *name, char *buf, int len); extern int umid_file_name(char *name, char *buf, int len);
#endif
/* /*
* Overrides for Emacs so that we follow Linus's tabbing style. * Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically * Emacs will notice this stuff at the end of the file and automatically
......
...@@ -78,7 +78,8 @@ static int capture_stack(int (*child)(void *arg), void *arg, void *sp, ...@@ -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 */ /* It has outlived its usefulness, so continue it so it can exit */
if(ptrace(PTRACE_CONT, pid, 0, 0) < 0){ 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); exit(1);
} }
if(waitpid(pid, &status, 0) < 0){ if(waitpid(pid, &status, 0) < 0){
......
...@@ -128,15 +128,15 @@ int activate_fd(int irq, int fd, int type, void *dev_id) ...@@ -128,15 +128,15 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
if(type == IRQ_READ) events = POLLIN | POLLPRI; if(type == IRQ_READ) events = POLLIN | POLLPRI;
else events = POLLOUT; else events = POLLOUT;
*new_fd = ((struct irq_fd) { next : NULL, *new_fd = ((struct irq_fd) { .next = NULL,
id : dev_id, .id = dev_id,
fd : fd, .fd = fd,
type : type, .type = type,
irq : irq, .irq = irq,
pid : pid, .pid = pid,
events : events, .events = events,
current_events: 0, .current_events = 0,
freed : 0 } ); .freed = 0 } );
/* Critical section - locked by a spinlock because this stuff can /* Critical section - locked by a spinlock because this stuff can
* be changed from interrupt handlers. The stuff above is done * 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) ...@@ -191,9 +191,9 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
if(type == IRQ_WRITE) if(type == IRQ_WRITE)
fd = -1; fd = -1;
pollfds[pollfds_num] = ((struct pollfd) { fd : fd, pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
events : events, .events = events,
revents : 0 }); .revents = 0 });
pollfds_num++; pollfds_num++;
*last_irq_ptr = new_fd; *last_irq_ptr = new_fd;
...@@ -265,8 +265,8 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d) ...@@ -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) void free_irq_by_irq_and_dev(int irq, void *dev)
{ {
struct irq_and_dev data = ((struct irq_and_dev) { irq : irq, struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq,
dev : dev }); .dev = dev });
free_irq_by_cb(same_irq_and_dev, &data); free_irq_by_cb(same_irq_and_dev, &data);
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "asm/processor.h" #include "asm/processor.h"
#include "asm/unistd.h" #include "asm/unistd.h"
#include "asm/pgalloc.h" #include "asm/pgalloc.h"
#include "asm/pgtable.h"
#include "asm/page.h" #include "asm/page.h"
#include "asm/tlbflush.h" #include "asm/tlbflush.h"
#include "kern_util.h" #include "kern_util.h"
...@@ -42,7 +43,11 @@ EXPORT_SYMBOL(page_to_phys); ...@@ -42,7 +43,11 @@ EXPORT_SYMBOL(page_to_phys);
EXPORT_SYMBOL(phys_to_page); EXPORT_SYMBOL(phys_to_page);
EXPORT_SYMBOL(high_physmem); EXPORT_SYMBOL(high_physmem);
EXPORT_SYMBOL(empty_zero_page); 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_open_file);
EXPORT_SYMBOL(os_read_file); EXPORT_SYMBOL(os_read_file);
EXPORT_SYMBOL(os_write_file); EXPORT_SYMBOL(os_write_file);
......
...@@ -231,11 +231,11 @@ static int setup_one_range(int fd, char *driver, unsigned long start, ...@@ -231,11 +231,11 @@ static int setup_one_range(int fd, char *driver, unsigned long start,
panic("Failed to allocating mem_region"); panic("Failed to allocating mem_region");
} }
*region = ((struct mem_region) { driver : driver, *region = ((struct mem_region) { .driver = driver,
start_pfn : pfn, .start_pfn = pfn,
start : start, .start = start,
len : len, .len = len,
fd : fd } ); .fd = fd } );
regions[i] = region; regions[i] = region;
out: out:
up(&regions_sem); up(&regions_sem);
...@@ -423,15 +423,15 @@ static struct list_head vm_reserved = LIST_HEAD_INIT(vm_reserved); ...@@ -423,15 +423,15 @@ static struct list_head vm_reserved = LIST_HEAD_INIT(vm_reserved);
/* Static structures, linked in to the list in early boot */ /* Static structures, linked in to the list in early boot */
static struct vm_reserved head = { static struct vm_reserved head = {
list : LIST_HEAD_INIT(head.list), .list = LIST_HEAD_INIT(head.list),
start : 0, .start = 0,
end : 0xffffffff .end = 0xffffffff
}; };
static struct vm_reserved tail = { static struct vm_reserved tail = {
list : LIST_HEAD_INIT(tail.list), .list = LIST_HEAD_INIT(tail.list),
start : 0, .start = 0,
end : 0xffffffff .end = 0xffffffff
}; };
void set_usable_vm(unsigned long start, unsigned long end) void set_usable_vm(unsigned long start, unsigned long end)
...@@ -467,9 +467,9 @@ int reserve_vm(unsigned long start, unsigned long end, void *e) ...@@ -467,9 +467,9 @@ int reserve_vm(unsigned long start, unsigned long end, void *e)
goto out; goto out;
} }
*entry = ((struct vm_reserved) *entry = ((struct vm_reserved)
{ list : LIST_HEAD_INIT(entry->list), { .list = LIST_HEAD_INIT(entry->list),
start : start, .start = start,
end : end }); .end = end });
list_add(&entry->list, &prev->list); list_add(&entry->list, &prev->list);
err = 0; err = 0;
out: out:
...@@ -539,9 +539,9 @@ struct iomem { ...@@ -539,9 +539,9 @@ struct iomem {
*/ */
struct iomem iomem_regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] = struct iomem iomem_regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] =
{ name : NULL, { .name = NULL,
fd : -1, .fd = -1,
size : 0 } }; .size = 0 } };
int num_iomem_regions = 0; int num_iomem_regions = 0;
...@@ -551,9 +551,9 @@ void add_iomem(char *name, int fd, unsigned long size) ...@@ -551,9 +551,9 @@ void add_iomem(char *name, int fd, unsigned long size)
return; return;
size = (size + PAGE_SIZE - 1) & PAGE_MASK; size = (size + PAGE_SIZE - 1) & PAGE_MASK;
iomem_regions[num_iomem_regions++] = iomem_regions[num_iomem_regions++] =
((struct iomem) { name : name, ((struct iomem) { .name = name,
fd : fd, .fd = fd,
size : size } ); .size = size } );
} }
int setup_iomem(void) int setup_iomem(void)
......
...@@ -52,7 +52,7 @@ void __init check_one_sigio(void (*proc)(int, int)) ...@@ -52,7 +52,7 @@ void __init check_one_sigio(void (*proc)(int, int))
{ {
struct sigaction old, new; struct sigaction old, new;
struct termios tt; struct termios tt;
struct openpty_arg pty = { master : -1, slave : -1 }; struct openpty_arg pty = { .master = -1, .slave = -1 };
int master, slave, flags; int master, slave, flags;
initial_thread_cb(openpty_cb, &pty); initial_thread_cb(openpty_cb, &pty);
...@@ -170,15 +170,15 @@ struct pollfds { ...@@ -170,15 +170,15 @@ struct pollfds {
* synchronizes with it. * synchronizes with it.
*/ */
struct pollfds current_poll = { struct pollfds current_poll = {
poll : NULL, .poll = NULL,
size : 0, .size = 0,
used : 0 .used = 0
}; };
struct pollfds next_poll = { struct pollfds next_poll = {
poll : NULL, .poll = NULL,
size : 0, .size = 0,
used : 0 .used = 0
}; };
static int write_sigio_thread(void *unused) static int write_sigio_thread(void *unused)
...@@ -298,9 +298,9 @@ int add_sigio_fd(int fd, int read) ...@@ -298,9 +298,9 @@ int add_sigio_fd(int fd, int read)
if(read) events = POLLIN; if(read) events = POLLIN;
else events = POLLOUT; else events = POLLOUT;
next_poll.poll[n - 1] = ((struct pollfd) { fd : fd, next_poll.poll[n - 1] = ((struct pollfd) { .fd = fd,
events : events, .events = events,
revents : 0 }); .revents = 0 });
update_thread(); update_thread();
out: out:
sigio_unlock(); sigio_unlock();
...@@ -348,12 +348,12 @@ static int setup_initial_poll(int fd) ...@@ -348,12 +348,12 @@ static int setup_initial_poll(int fd)
printk("setup_initial_poll : failed to allocate poll\n"); printk("setup_initial_poll : failed to allocate poll\n");
return(-1); return(-1);
} }
*p = ((struct pollfd) { fd : fd, *p = ((struct pollfd) { .fd = fd,
events : POLLIN, .events = POLLIN,
revents : 0 }); .revents = 0 });
current_poll = ((struct pollfds) { poll : p, current_poll = ((struct pollfds) { .poll = p,
used : 1, .used = 1,
size : 1 }); .size = 1 });
return(0); return(0);
} }
...@@ -420,7 +420,8 @@ int read_sigio_fd(int fd) ...@@ -420,7 +420,8 @@ int read_sigio_fd(int fd)
static void sigio_cleanup(void) static void sigio_cleanup(void)
{ {
if(write_sigio_pid != -1) kill(write_sigio_pid, SIGKILL); if(write_sigio_pid != -1)
kill(write_sigio_pid, SIGKILL);
} }
__uml_exitcall(sigio_cleanup); __uml_exitcall(sigio_cleanup);
......
...@@ -29,18 +29,6 @@ ...@@ -29,18 +29,6 @@
EXPORT_SYMBOL(block_signals); EXPORT_SYMBOL(block_signals);
EXPORT_SYMBOL(unblock_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) static void force_segv(int sig)
{ {
if(sig == SIGSEGV){ if(sig == SIGSEGV){
......
...@@ -27,9 +27,6 @@ static inline int verify_area_skas(int type, const void * addr, ...@@ -27,9 +27,6 @@ static inline int verify_area_skas(int type, const void * addr,
return(access_ok_skas(type, addr, size) ? 0 : -EFAULT); 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) static inline unsigned long maybe_map(unsigned long virt, int is_write)
{ {
pte_t pte; pte_t pte;
......
...@@ -99,7 +99,6 @@ void flush_tlb_kernel_range_skas(unsigned long start, unsigned long end) ...@@ -99,7 +99,6 @@ void flush_tlb_kernel_range_skas(unsigned long start, unsigned long end)
protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1);
} }
addr += PAGE_SIZE; addr += PAGE_SIZE;
} }
else { else {
if(pmd_newpage(*pmd)){ if(pmd_newpage(*pmd)){
......
...@@ -108,7 +108,7 @@ void idle_sleep(int secs) ...@@ -108,7 +108,7 @@ void idle_sleep(int secs)
ts.tv_sec = secs; ts.tv_sec = secs;
ts.tv_nsec = 0; ts.tv_nsec = 0;
nanosleep(&ts, &ts); nanosleep(&ts, NULL);
} }
/* /*
......
...@@ -109,7 +109,8 @@ unsigned long segv(unsigned long address, unsigned long ip, int is_write, ...@@ -109,7 +109,8 @@ unsigned long segv(unsigned long address, unsigned long ip, int is_write,
flush_tlb_kernel_vm(); flush_tlb_kernel_vm();
return(0); 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); err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
catcher = current->thread.fault_catcher; catcher = current->thread.fault_catcher;
......
...@@ -62,11 +62,11 @@ static void gdb_announce(char *dev_name, int dev) ...@@ -62,11 +62,11 @@ static void gdb_announce(char *dev_name, int dev)
} }
static struct chan_opts opts = { static struct chan_opts opts = {
announce : gdb_announce, .announce = gdb_announce,
xterm_title : "UML kernel debugger", .xterm_title = "UML kernel debugger",
raw : 0, .raw = 0,
tramp_stack : 0, .tramp_stack = 0,
in_kernel : 0, .in_kernel = 0,
}; };
/* Accessed by the tracing thread, which automatically serializes access */ /* Accessed by the tracing thread, which automatically serializes access */
......
...@@ -13,9 +13,9 @@ extern int gdb_config(char *str); ...@@ -13,9 +13,9 @@ extern int gdb_config(char *str);
extern int gdb_remove(char *unused); extern int gdb_remove(char *unused);
static struct mc_device gdb_mc = { static struct mc_device gdb_mc = {
name: "gdb", .name = "gdb",
config: gdb_config, .config = gdb_config,
remove: gdb_remove, .remove = gdb_remove,
}; };
int gdb_mc_init(void) int gdb_mc_init(void)
......
...@@ -129,14 +129,14 @@ static int parent_syscall(debugger_state *debugger, int pid); ...@@ -129,14 +129,14 @@ static int parent_syscall(debugger_state *debugger, int pid);
int init_parent_proxy(int pid) int init_parent_proxy(int pid)
{ {
parent = ((debugger_state) { pid : pid, parent = ((debugger_state) { .pid = pid,
wait_options : 0, .wait_options = 0,
wait_status_ptr : NULL, .wait_status_ptr = NULL,
waiting : 0, .waiting = 0,
real_wait : 0, .real_wait = 0,
expecting_child : 0, .expecting_child = 0,
handle_trace : parent_syscall, .handle_trace = parent_syscall,
debugee : NULL } ); .debugee = NULL } );
return(0); return(0);
} }
......
...@@ -85,10 +85,10 @@ static void c_stop(struct seq_file *m, void *v) ...@@ -85,10 +85,10 @@ static void c_stop(struct seq_file *m, void *v)
} }
struct seq_operations cpuinfo_op = { struct seq_operations cpuinfo_op = {
start: c_start, .start = c_start,
next: c_next, .next = c_next,
stop: c_stop, .stop = c_stop,
show: show_cpuinfo, .show = show_cpuinfo,
}; };
pte_t * __bad_pagetable(void) pte_t * __bad_pagetable(void)
...@@ -317,6 +317,11 @@ int linux_main(int argc, char **argv) ...@@ -317,6 +317,11 @@ int linux_main(int argc, char **argv)
if(physmem_size > max_physmem){ if(physmem_size > max_physmem){
highmem = physmem_size - max_physmem; highmem = physmem_size - max_physmem;
physmem_size -= highmem; 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; high_physmem = uml_physmem + physmem_size;
...@@ -361,9 +366,9 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1, ...@@ -361,9 +366,9 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,
} }
static struct notifier_block panic_exit_notifier = { static struct notifier_block panic_exit_notifier = {
notifier_call : panic_exit, .notifier_call = panic_exit,
next : NULL, .next = NULL,
priority : 0 .priority = 0
}; };
void __init setup_arch(char **cmdline_p) void __init setup_arch(char **cmdline_p)
......
...@@ -186,7 +186,6 @@ int not_dead_yet(char *dir) ...@@ -186,7 +186,6 @@ int not_dead_yet(char *dir)
} }
if(!dead) return(1); if(!dead) return(1);
return(actually_do_remove(dir)); return(actually_do_remove(dir));
return(0);
} }
static int __init set_uml_dir(char *name, int *add) static int __init set_uml_dir(char *name, int *add)
......
...@@ -28,11 +28,11 @@ static void etap_init(struct net_device *dev, void *data) ...@@ -28,11 +28,11 @@ static void etap_init(struct net_device *dev, void *data)
pri = dev->priv; pri = dev->priv;
epri = (struct ethertap_data *) pri->user; epri = (struct ethertap_data *) pri->user;
*epri = ((struct ethertap_data) *epri = ((struct ethertap_data)
{ dev_name : init->dev_name, { .dev_name = init->dev_name,
gate_addr : init->gate_addr, .gate_addr = init->gate_addr,
data_fd : -1, .data_fd = -1,
control_fd : -1, .control_fd = -1,
dev : dev }); .dev = dev });
printk("ethertap backend - %s", epri->dev_name); printk("ethertap backend - %s", epri->dev_name);
if(epri->gate_addr != NULL) if(epri->gate_addr != NULL)
...@@ -69,10 +69,10 @@ static int etap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp) ...@@ -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 = { struct net_kern_info ethertap_kern_info = {
init: etap_init, .init = etap_init,
protocol: eth_protocol, .protocol = eth_protocol,
read: etap_read, .read = etap_read,
write: etap_write, .write = etap_write,
}; };
int ethertap_setup(char *str, char **mac_out, void *data) int ethertap_setup(char *str, char **mac_out, void *data)
...@@ -80,8 +80,8 @@ 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; struct ethertap_init *init = data;
*init = ((struct ethertap_init) *init = ((struct ethertap_init)
{ dev_name : NULL, { .dev_name = NULL,
gate_addr : NULL }); .gate_addr = NULL });
if(tap_setup_common(str, "ethertap", &init->dev_name, mac_out, if(tap_setup_common(str, "ethertap", &init->dev_name, mac_out,
&init->gate_addr)) &init->gate_addr))
return(0); return(0);
...@@ -94,12 +94,12 @@ int ethertap_setup(char *str, char **mac_out, void *data) ...@@ -94,12 +94,12 @@ int ethertap_setup(char *str, char **mac_out, void *data)
} }
static struct transport ethertap_transport = { static struct transport ethertap_transport = {
list : LIST_HEAD_INIT(ethertap_transport.list), .list = LIST_HEAD_INIT(ethertap_transport.list),
name : "ethertap", .name = "ethertap",
setup : ethertap_setup, .setup = ethertap_setup,
user : &ethertap_user_info, .user = &ethertap_user_info,
kern : &ethertap_kern_info, .kern = &ethertap_kern_info,
private_size : sizeof(struct ethertap_data), .private_size = sizeof(struct ethertap_data),
}; };
static int register_ethertap(void) static int register_ethertap(void)
......
...@@ -216,14 +216,14 @@ static void etap_del_addr(unsigned char *addr, unsigned char *netmask, ...@@ -216,14 +216,14 @@ static void etap_del_addr(unsigned char *addr, unsigned char *netmask,
} }
struct net_user_info ethertap_user_info = { struct net_user_info ethertap_user_info = {
init: etap_user_init, .init = etap_user_init,
open: etap_open, .open = etap_open,
close: etap_close, .close = etap_close,
remove: NULL, .remove = NULL,
set_mtu: etap_set_mtu, .set_mtu = etap_set_mtu,
add_address: etap_add_addr, .add_address = etap_add_addr,
delete_address: etap_del_addr, .delete_address = etap_del_addr,
max_packet: MAX_PACKET - ETH_HEADER_ETHERTAP .max_packet = MAX_PACKET - ETH_HEADER_ETHERTAP
}; };
/* /*
......
...@@ -28,11 +28,11 @@ static void tuntap_init(struct net_device *dev, void *data) ...@@ -28,11 +28,11 @@ static void tuntap_init(struct net_device *dev, void *data)
pri = dev->priv; pri = dev->priv;
tpri = (struct tuntap_data *) pri->user; tpri = (struct tuntap_data *) pri->user;
*tpri = ((struct tuntap_data) *tpri = ((struct tuntap_data)
{ dev_name : init->dev_name, { .dev_name = init->dev_name,
fixed_config : (init->dev_name != NULL), .fixed_config = (init->dev_name != NULL),
gate_addr : init->gate_addr, .gate_addr = init->gate_addr,
fd : -1, .fd = -1,
dev : dev }); .dev = dev });
printk("TUN/TAP backend - "); printk("TUN/TAP backend - ");
if(tpri->gate_addr != NULL) if(tpri->gate_addr != NULL)
printk("IP = %s", tpri->gate_addr); printk("IP = %s", tpri->gate_addr);
...@@ -55,10 +55,10 @@ static int tuntap_write(int fd, struct sk_buff **skb, ...@@ -55,10 +55,10 @@ static int tuntap_write(int fd, struct sk_buff **skb,
} }
struct net_kern_info tuntap_kern_info = { struct net_kern_info tuntap_kern_info = {
init: tuntap_init, .init = tuntap_init,
protocol: eth_protocol, .protocol = eth_protocol,
read: tuntap_read, .read = tuntap_read,
write: tuntap_write, .write = tuntap_write,
}; };
int tuntap_setup(char *str, char **mac_out, void *data) int tuntap_setup(char *str, char **mac_out, void *data)
...@@ -66,8 +66,8 @@ 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; struct tuntap_init *init = data;
*init = ((struct tuntap_init) *init = ((struct tuntap_init)
{ dev_name : NULL, { .dev_name = NULL,
gate_addr : NULL }); .gate_addr = NULL });
if(tap_setup_common(str, "tuntap", &init->dev_name, mac_out, if(tap_setup_common(str, "tuntap", &init->dev_name, mac_out,
&init->gate_addr)) &init->gate_addr))
return(0); return(0);
...@@ -76,13 +76,13 @@ int tuntap_setup(char *str, char **mac_out, void *data) ...@@ -76,13 +76,13 @@ int tuntap_setup(char *str, char **mac_out, void *data)
} }
static struct transport tuntap_transport = { static struct transport tuntap_transport = {
list : LIST_HEAD_INIT(tuntap_transport.list), .list = LIST_HEAD_INIT(tuntap_transport.list),
name : "tuntap", .name = "tuntap",
setup : tuntap_setup, .setup = tuntap_setup,
user : &tuntap_user_info, .user = &tuntap_user_info,
kern : &tuntap_kern_info, .kern = &tuntap_kern_info,
private_size : sizeof(struct tuntap_data), .private_size = sizeof(struct tuntap_data),
setup_size : sizeof(struct tuntap_init), .setup_size = sizeof(struct tuntap_init),
}; };
static int register_tuntap(void) static int register_tuntap(void)
......
...@@ -201,14 +201,14 @@ static int tuntap_set_mtu(int mtu, void *data) ...@@ -201,14 +201,14 @@ static int tuntap_set_mtu(int mtu, void *data)
} }
struct net_user_info tuntap_user_info = { struct net_user_info tuntap_user_info = {
init: tuntap_user_init, .init = tuntap_user_init,
open: tuntap_open, .open = tuntap_open,
close: tuntap_close, .close = tuntap_close,
remove: NULL, .remove = NULL,
set_mtu: tuntap_set_mtu, .set_mtu = tuntap_set_mtu,
add_address: tuntap_add_addr, .add_address = tuntap_add_addr,
delete_address: tuntap_del_addr, .delete_address = tuntap_del_addr,
max_packet: MAX_PACKET .max_packet = MAX_PACKET
}; };
/* /*
......
...@@ -276,8 +276,8 @@ int os_rcv_fd(int fd, int *helper_pid_out) ...@@ -276,8 +276,8 @@ int os_rcv_fd(int fd, int *helper_pid_out)
msg.msg_name = NULL; msg.msg_name = NULL;
msg.msg_namelen = 0; msg.msg_namelen = 0;
iov = ((struct iovec) { iov_base : helper_pid_out, iov = ((struct iovec) { .iov_base = helper_pid_out,
iov_len : sizeof(*helper_pid_out) }); .iov_len = sizeof(*helper_pid_out) });
msg.msg_iov = &iov; msg.msg_iov = &iov;
msg.msg_iovlen = 1; msg.msg_iovlen = 1;
msg.msg_control = buf; msg.msg_control = buf;
......
...@@ -9,6 +9,7 @@ USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o ...@@ -9,6 +9,7 @@ USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
SYMLINKS = semaphore.c highmem.c module.c SYMLINKS = semaphore.c highmem.c module.c
SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
semaphore.c-dir = kernel semaphore.c-dir = kernel
highmem.c-dir = mm highmem.c-dir = mm
...@@ -22,7 +23,7 @@ endef ...@@ -22,7 +23,7 @@ endef
$(USER_OBJS) : %.o: %.c $(USER_OBJS) : %.o: %.c
$(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
$(foreach f,$(SYMLINKS),$(src)/$f): $(SYMLINKS):
$(call make_link,$@) $(call make_link,$@)
clean: clean:
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
extern pgd_t swapper_pg_dir[1024]; 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 */ /* zero page used for uninitialized stuff */
extern unsigned long *empty_zero_page; extern unsigned long *empty_zero_page;
......
...@@ -14,8 +14,8 @@ struct arch_thread { ...@@ -14,8 +14,8 @@ struct arch_thread {
int debugregs_seq; int debugregs_seq;
}; };
#define INIT_ARCH_THREAD { debugregs : { [ 0 ... 7 ] = 0 }, \ #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
debugregs_seq : 0 } .debugregs_seq = 0 }
#include "asm/arch/user.h" #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