diff -Naur -X exclude-files ac_cur/arch/um/config.in ac/arch/um/config.in --- ac_cur/arch/um/config.in Sat Nov 3 16:13:22 2001 +++ ac/arch/um/config.in Sat Nov 3 18:57:36 2001 @@ -2,13 +2,13 @@ mainmenu_name "Linux/Usermode Kernel Configuration" -define_bool CONFIG_ISA y +define_bool CONFIG_ISA n define_bool CONFIG_SBUS n +define_bool CONFIG_PCI n define_bool CONFIG_UID16 y define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y -define_bool CONFIG_GENERIC_BUST_SPINLOCK n define_bool CONFIG_GENERIC_ISA_DMA y mainmenu_option next_comment @@ -17,7 +17,6 @@ endmenu mainmenu_option next_comment -comment 'Processor features' comment 'General Setup' define_bool CONFIG_STDIO_CONSOLE y bool 'Networking support' CONFIG_NET diff -Naur -X exclude-files ac_cur/arch/um/drivers/chan_kern.c ac/arch/um/drivers/chan_kern.c --- ac_cur/arch/um/drivers/chan_kern.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/drivers/chan_kern.c Sat Nov 3 18:41:39 2001 @@ -3,6 +3,7 @@ * Licensed under the GPL */ +#include #include #include #include @@ -98,7 +99,7 @@ data = chan; break; default: - printk("open_chan : Unknown channel type - %d\n", chan->type); + printk(KERN_ERR "open_chan : Unknown channel type - %d\n", chan->type); err = -ENODEV; break; } @@ -168,7 +169,7 @@ tty_name = &str[strlen("tty")]; if(*tty_name != ':'){ - printk("parse_chan : channel type 'tty' must " + printk(KERN_ERR "parse_chan : channel type 'tty' must " "specify a device\n"); return(-1); } @@ -192,14 +193,14 @@ sock = &str[strlen("socket")]; if(*sock != ':'){ - printk("parse_chan : channel type 'socket' must " + printk(KERN_ERR "parse_chan : channel type 'socket' must " "specify a socket\n"); return(-1); } sock++; n = simple_strtoul(sock, NULL, 0); if(n == 0){ - printk("parse_chan : invalid socket number - '%s'\n", + printk(KERN_ERR "parse_chan : invalid socket number - '%s'\n", sock); return(-1); } @@ -211,14 +212,14 @@ fd = &str[strlen("fd")]; if(*fd != ':'){ - printk("parse_chan : channel type 'fd' must " + printk(KERN_ERR "parse_chan : channel type 'fd' must " "specify a file descriptor\n"); return(-1); } fd++; n = simple_strtoul(fd, &end, 0); if(*end != '\0'){ - printk("parse_chan : couldn't parse file descriptor " + printk(KERN_ERR "parse_chan : couldn't parse file descriptor " "'%s'", fd); return(-1); } @@ -226,7 +227,7 @@ return(0); } else { - printk("parse_chan couldn't parse \"%s\"\n", str); + printk(KERN_ERR "parse_chan couldn't parse \"%s\"\n", str); return(-1); } chan->init_pri = pri; diff -Naur -X exclude-files ac_cur/arch/um/drivers/chan_user.c ac/arch/um/drivers/chan_user.c --- ac_cur/arch/um/drivers/chan_user.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/drivers/chan_user.c Sat Nov 3 18:41:39 2001 @@ -222,8 +222,7 @@ char *name; if((info.fd = accept(chan->fd, NULL, 0)) < 0){ - printk("tty_read: accept failed - errno = %d\n", - errno); + printk("tty_read: accept failed - errno = %d\n", errno); return; } mkdir("/tmp/uml_dev", 0777); diff -Naur -X exclude-files ac_cur/arch/um/drivers/daemon_user.c ac/arch/um/drivers/daemon_user.c --- ac_cur/arch/um/drivers/daemon_user.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/drivers/daemon_user.c Sat Nov 3 18:41:39 2001 @@ -102,7 +102,7 @@ if(connect(pri->control, (struct sockaddr *) ctl_addr, sizeof(*ctl_addr)) < 0){ - printk("daemon_open : control connect failed, errno = %d\n", + printk("daemon_open : control connect failed, errno = %d\n", errno); err = -ENOTCONN; goto out; diff -Naur -X exclude-files ac_cur/arch/um/drivers/etap.h ac/arch/um/drivers/etap.h --- ac_cur/arch/um/drivers/etap.h Sat Nov 3 16:13:22 2001 +++ ac/arch/um/drivers/etap.h Sat Nov 3 18:41:39 2001 @@ -11,7 +11,7 @@ int data_fd; int control_fd; void *dev; - unsigned char hw_addr[ETH_ADDR_LEN]; + unsigned char hw_addr[ETH_ADDR_LEN]; int hw_setup; }; diff -Naur -X exclude-files ac_cur/arch/um/drivers/ethertap_kern.c ac/arch/um/drivers/ethertap_kern.c --- ac_cur/arch/um/drivers/ethertap_kern.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/drivers/ethertap_kern.c Sat Nov 3 18:41:39 2001 @@ -46,7 +46,8 @@ memcpy(epri->hw_addr, ethertap_priv[index].hw_addr, sizeof(epri->hw_addr)); printk("ethertap backend - %s", epri->dev_name); - if(epri->gate_addr != NULL) printk(", IP = %s", epri->gate_addr); + if(epri->gate_addr != NULL) + printk(", IP = %s", epri->gate_addr); epri->hw_setup = ethertap_priv[index].hw_setup; if(epri->hw_setup) printk(", ether = %x:%x:%x:%x:%x:%x", @@ -115,15 +116,15 @@ void ethertap_setup(char *str, struct uml_net *dev) { - struct ethertap_setup *pri; + struct ethertap_setup *pri; dev->user = ðertap_user_info; dev->kern = ðertap_kern_info; dev->private_size = sizeof(struct ethertap_data); - pri = ðertap_priv[ethertap_count]; + pri = ðertap_priv[ethertap_count]; dev->transport_index = ethertap_count++; - tap_setup_common(str, "ethertap", &pri->dev_name, pri->hw_addr, - &pri->hw_setup, &pri->gate_addr); + tap_setup_common(str, "ethertap", &pri->dev_name, pri->hw_addr, + &pri->hw_setup, &pri->gate_addr); } /* diff -Naur -X exclude-files ac_cur/arch/um/drivers/ethertap_user.c ac/arch/um/drivers/ethertap_user.c --- ac_cur/arch/um/drivers/ethertap_user.c Sat Nov 3 16:17:14 2001 +++ ac/arch/um/drivers/ethertap_user.c Sat Nov 3 18:41:39 2001 @@ -223,7 +223,7 @@ set_mtu: etap_set_mtu, add_address: etap_add_addr, delete_address: etap_del_addr, - max_packet: MAX_PACKET - ETH_HEADER_ETHERTAP + max_packet: MAX_PACKET - ETH_HEADER_ETHERTAP }; /* diff -Naur -X exclude-files ac_cur/arch/um/drivers/mmapper_kern.c ac/arch/um/drivers/mmapper_kern.c --- ac_cur/arch/um/drivers/mmapper_kern.c Sat Nov 3 16:13:22 2001 +++ ac/arch/um/drivers/mmapper_kern.c Sat Nov 3 18:41:39 2001 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff -Naur -X exclude-files ac_cur/arch/um/drivers/net_kern.c ac/arch/um/drivers/net_kern.c --- ac_cur/arch/um/drivers/net_kern.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/drivers/net_kern.c Sat Nov 3 18:41:39 2001 @@ -6,6 +6,7 @@ */ #include "linux/config.h" +#include "linux/kernel.h" #include "linux/netdevice.h" #include "linux/skbuff.h" #include "linux/socket.h" @@ -52,16 +53,17 @@ n = simple_strtoul(str, &end, 0); if(end == str){ - printk("eth_setup: Failed to parse '%s'\n", str); + printk(KERN_ERR "eth_setup: Failed to parse '%s'\n", str); return(1); } if((n < 0) || (n > sizeof(devices)/sizeof(devices[0]))){ - printk("eth_setup: device %d out of range\n", n); + printk(KERN_ERR "eth_setup: device %d out of range\n", n); return(1); } str = end; if(*str != '='){ - printk("eth_setup: expected '=' after device number\n"); + printk(KERN_ERR + "eth_setup: expected '=' after device number\n"); return(1); } str++; @@ -202,7 +204,8 @@ spin_lock(&lp->lock); while((err = uml_net_rx(dev)) > 0) ; if(err < 0) { - printk("Device '%s' read returned %d, shutting it " + printk(KERN_ERR + "Device '%s' read returned %d, shutting it " "down\n", dev->name, err); dev->flags &= ~IFF_UP; dev_close(dev); @@ -232,7 +235,7 @@ err = um_request_irq(dev->irq, lp->fd, uml_net_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, dev); if(err != 0){ - printk("uml_net_open: failed to get irq(%d)\n", err); + printk(KERN_ERR "uml_net_open: failed to get irq(%d)\n", err); (*lp->close)(lp->fd, &lp->user); lp->fd = -1; err = -ENETUNREACH; @@ -292,7 +295,7 @@ } else { netif_start_queue(dev); - printk("uml_net_start_xmit: failed(%d)\n", len); + printk(KERN_ERR "uml_net_start_xmit: failed(%d)\n", len); } spin_unlock_irqrestore(&lp->lock, flags); @@ -366,7 +369,7 @@ #ifdef undef struct connection *conn = (struct connection *)_conn; - dprintk("uml_net_user_timer_expire [%p]\n", conn); + dprintk(KERN_INFO "uml_net_user_timer_expire [%p]\n", conn); do_connect(conn); #endif } @@ -426,15 +429,15 @@ int __init uml_net_probe(void) { - int i; - - for(i = 0; i < sizeof(devices)/sizeof(devices[0]); i++){ - if(devices[i].user == NULL) continue; + int i; + + for(i = 0; i < sizeof(devices)/sizeof(devices[0]); i++){ + if(devices[i].user == NULL) continue; eth_configure(&devices[i], i); - } - return(0); + } + return(0); } - + static int net_config(char *str) { int err, n; @@ -543,7 +546,8 @@ addr[i] = simple_strtoul(str, &end, 16); if((end == str) || ((*end != ':') && (*end != ',') && (*end != '\0'))){ - printk("setup_etheraddr: failed to parse '%s' " + printk(KERN_ERR + "setup_etheraddr: failed to parse '%s' " "as an ethernet address\n", str); return(-1); } diff -Naur -X exclude-files ac_cur/arch/um/drivers/radix.h ac/arch/um/drivers/radix.h --- ac_cur/arch/um/drivers/radix.h Sat Nov 3 16:12:55 2001 +++ ac/arch/um/drivers/radix.h Wed Dec 31 19:00:00 1969 @@ -1,143 +0,0 @@ -#ifndef _RADIX_H_ -#define _RADIX_H_ - -#include - -#define RADIX_INIT(head) \ -{ \ - (head)->RdX_root = NULL; \ -} - -#define RADIX_ENTRY(type,bits) \ -struct { \ - struct type *RdX_next[(0x01 << bits)]; \ -} - -#define RADIX_HEAD(name,type) \ -struct name { \ - struct type *RdX_root; \ -}; - -#define RADIX_INSERT(head,type,field,bits,tdef,key,klen,result) \ -{ \ - struct type **RdX_node = &((head)->RdX_root); \ - tdef RdX_mask; \ - int RdX_index; \ - int RdX_size = sizeof(tdef)*8; \ - char RdX_status = 0; \ - int RdX_count = 0; \ - \ - if(klen % bits) result = -1; \ - else { \ - RdX_mask = (0x01 << bits)-1; \ - while((RdX_count*bits) < klen) { \ - RdX_status = 1; \ - if(!(*RdX_node)) { \ - RdX_status = 2; \ - (*RdX_node) = (struct type *)kmalloc(sizeof(struct type), \ - GFP_KERNEL); \ - if(!(*RdX_node)) { \ - result = -2; \ - break; \ - } \ - RdX_status = 3; \ - memset((*RdX_node),0,sizeof(struct type)); \ - RdX_status = 4; \ - } \ - RdX_index = (key >> (RdX_size - bits - (RdX_count * bits))) & RdX_mask; \ - RdX_status = 5; \ - RdX_node = &((*RdX_node)->field.RdX_next[RdX_index]); \ - RdX_status = 6; \ - RdX_count++; \ - result = 0; \ - } \ - if(result != -2 && (!(*RdX_node))) { \ - (*RdX_node) = (struct type *)kmalloc(sizeof(struct type), \ - GFP_KERNEL); \ - if(!(*RdX_node)) { \ - result = -2; \ - } else { \ - memset((*RdX_node),0,sizeof(struct type)); \ - } \ - } \ - } \ -} - -#define RADIX_DO(head,type,field,bits,tdef,key,klen,flm,elem,result,RxD_set) \ -{ \ - struct type *RdX_node = (head)->RdX_root; \ - tdef RdX_mask; \ - int RdX_index; \ - int RdX_size = sizeof(tdef)*8; \ - int RdX_count = 0; \ - \ - if(klen % bits) result = -1; \ - else { \ - RdX_mask = (0x01 << bits)-1; \ - while((RdX_count*bits) < klen) { \ - if(!RdX_node) { \ - result = -2; \ - break; \ - } else { \ - RdX_index = (key >> (RdX_size - bits - (RdX_count * bits))) & RdX_mask;\ - RdX_node = RdX_node->field.RdX_next[RdX_index]; \ - } \ - RdX_count++; \ - } \ - if(!RdX_node) { \ - result = -3; \ - } else { \ - if(RxD_set) { \ - RdX_node->flm = elem; \ - } else { \ - elem = RdX_node->flm; \ - } \ - result = 0; \ - } \ - } \ -} - -#define RADIX_SET(head,type,field,bits,tdef,key,klen,flm,elem,result) \ - RADIX_DO(head,type,field,bits,tdef,key,klen,flm,elem,result,1) -#define RADIX_GET(head,type,field,bits,tdef,key,klen,flm,elem,result) \ - RADIX_DO(head,type,field,bits,tdef,key,klen,flm,elem,result,0) - -#define RADIX_VISIT_ALL(head,type,field,bits,visit,extra) \ -{ \ - int RdX_node_count = (0x1 << bits); \ - struct type *RdX_stack[RdX_node_count]; \ - int RdX_stack_count[RdX_node_count]; \ - int RdX_stack_depth = 0; \ - struct type *RdX_node; \ - int RdX_done = 0; \ - int R = 0; \ - \ - if((RdX_node = (head)->RdX_root)) { \ - while(!RdX_done) { \ - if(RdX_node->field.RdX_next[R]) { \ - RdX_stack[RdX_stack_depth] = RdX_node; \ - RdX_stack_count[RdX_stack_depth] = R + 1; \ - RdX_stack_depth++; \ - RdX_node = RdX_node->field.RdX_next[R]; \ - R = 0; \ - } else { \ - R++; \ - if(R >= RdX_node_count) { \ - if(visit(RdX_node,extra)) { \ - RdX_done = 1; \ - break; \ - } \ - RdX_stack_depth--; \ - if(RdX_stack_depth >= 0) { \ - RdX_node = RdX_stack[RdX_stack_depth]; \ - R = RdX_stack_count[RdX_stack_depth]; \ - } else { \ - RdX_done = 1; \ - } \ - } \ - } \ - } \ - } \ -} - -#endif diff -Naur -X exclude-files ac_cur/arch/um/drivers/slip_kern.c ac/arch/um/drivers/slip_kern.c --- ac_cur/arch/um/drivers/slip_kern.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/drivers/slip_kern.c Sat Nov 3 18:41:39 2001 @@ -1,3 +1,4 @@ +#include "linux/kernel.h" #include "linux/stddef.h" #include "linux/init.h" #include "linux/netdevice.h" @@ -40,7 +41,7 @@ umn_dev.tx_queue_len = 256; umn_dev.flags = IFF_NOARP; if(register_netdev(&umn_dev)) - printk("Couldn't initialize umn\n"); + printk(KERN_ERR "Couldn't initialize umn\n"); printk("SLIP backend - SLIP IP = %s\n", spri->gate_addr); return(&umn_dev); diff -Naur -X exclude-files ac_cur/arch/um/drivers/ssl.c ac/arch/um/drivers/ssl.c --- ac_cur/arch/um/drivers/ssl.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/drivers/ssl.c Sat Nov 3 18:41:39 2001 @@ -53,7 +53,8 @@ void ssl_announce(char *dev_name, int dev) { - printk("Serial line %d assigned device '%s'\n", dev, dev_name); + printk(KERN_INFO "Serial line %d assigned device '%s'\n", dev, + dev_name); } DECLARE_MUTEX(ssl_sem); @@ -73,8 +74,8 @@ &private[line]); up(&ssl_sem); if(err){ - printk("Couldn't open serial line %d - errno = %d\n", line, - -err); + printk(KERN_ERR "Couldn't open serial line %d - errno = %d\n", + line, -err); up(&ssl_sem); return(err); } @@ -149,7 +150,8 @@ ret = -ENOIOCTLCMD; break; default: - printk("Unimplemented ioctl in ssl_ioctl : 0x%x\n", cmd); + printk(KERN_ERR + "Unimplemented ioctl in ssl_ioctl : 0x%x\n", cmd); ret = -ENOIOCTLCMD; break; } @@ -158,12 +160,12 @@ static void ssl_throttle(struct tty_struct * tty) { - printk("Someone should implement ssl_throttle\n"); + printk(KERN_ERR "Someone should implement ssl_throttle\n"); } static void ssl_unthrottle(struct tty_struct * tty) { - printk("Someone should implement ssl_unthrottle\n"); + printk(KERN_ERR "Someone should implement ssl_unthrottle\n"); } static void ssl_set_termios(struct tty_struct *tty, @@ -173,12 +175,12 @@ static void ssl_stop(struct tty_struct *tty) { - printk("Someone should implement ssl_stop\n"); + printk(KERN_ERR "Someone should implement ssl_stop\n"); } static void ssl_start(struct tty_struct *tty) { - printk("Someone should implement ssl_start\n"); + printk(KERN_ERR "Someone should implement ssl_start\n"); } void ssl_hangup(struct tty_struct *tty) @@ -261,7 +263,8 @@ else { n = simple_strtoul(str, &end, 0); if(*end != '='){ - printk("ssl_chan_setup failed to parse \"%s\"\n", + printk(KERN_ERR + "ssl_chan_setup failed to parse \"%s\"\n", str); return(1); } diff -Naur -X exclude-files ac_cur/arch/um/drivers/stdio_console.c ac/arch/um/drivers/stdio_console.c --- ac_cur/arch/um/drivers/stdio_console.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/drivers/stdio_console.c Sat Nov 3 18:41:39 2001 @@ -63,7 +63,8 @@ err = open_chan_pair(&vts[line].chan, setup_console_irq, &vts[line]); if(err < 0){ - printk("Failed to open virtual console %d, errno = %d\n", + printk(KERN_ERR + "Failed to open virtual console %d, errno = %d\n", line, err); } return(err); @@ -238,7 +239,8 @@ void stdio_announce(char *dev_name, int dev) { - printk("Virtual console %d assigned device '%s'\n", dev, dev_name); + printk(KERN_INFO "Virtual console %d assigned device '%s'\n", dev, + dev_name); } static struct chan_opts opts = { @@ -257,7 +259,8 @@ else { n = simple_strtoul(str, &end, 0); if(*end != '='){ - printk("console_chan_setup failed to parse \"%s\"\n", + printk(KERN_ERR + "console_chan_setup failed to parse \"%s\"\n", str); return(1); } diff -Naur -X exclude-files ac_cur/arch/um/drivers/ubd.c ac/arch/um/drivers/ubd.c --- ac_cur/arch/um/drivers/ubd.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/drivers/ubd.c Sat Nov 3 18:53:37 2001 @@ -224,21 +224,23 @@ } major = simple_strtoul(str, &end, 0); if(*end != '\0'){ - printk("ubd_setup : didn't parse major number\n"); + printk(KERN_ERR + "ubd_setup : didn't parse major number\n"); return(1); } fake_gendisk.major = major; fake_major = major; - printk("Setting extra ubd major number to %d\n", major); - return(0); + printk(KERN_INFO "Setting extra ubd major number to %d\n", + major); + return(0); } if(n < '0'){ - printk("ubd_setup : index out of range\n"); + printk(KERN_ERR "ubd_setup : index out of range\n"); return(1); } n -= '0'; if(n >= MAX_DEV){ - printk("ubd_setup : index out of range\n"); + printk(KERN_ERR "ubd_setup : index out of range\n"); return(1); } if(index_out) *index_out = n; @@ -252,7 +254,7 @@ str++; } if(*str++ != '='){ - printk("ubd_setup : Expected '='\n"); + printk(KERN_ERR "ubd_setup : Expected '='\n"); return(1); } backing_file = strchr(str, ','); @@ -287,7 +289,8 @@ static int fakehd(char *str) { - printk("fakehd : Changing ubd_gendisk.major_name to \"hd\".\n"); + printk(KERN_INFO + "fakehd : Changing ubd_gendisk.major_name to \"hd\".\n"); ubd_gendisk.major_name = "hd"; return(1); } @@ -334,7 +337,7 @@ DEVICE_INTR = NULL; intr_count++; if(read_ubd_fs(thread_fds[0], &req, sizeof(req)) != sizeof(req)){ - printk("Pid %d - spurious interrupt in ubd_handler, " + printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, " "errno = %d\n", getpid(), errno); end_request(0); return; @@ -448,7 +451,7 @@ ubd_dir_handle = devfs_mk_dir (NULL, "ubd", NULL); if (devfs_register_blkdev(MAJOR_NR, "ubd", &ubd_blops)) { - printk("ubd: unable to get major %d\n", MAJOR_NR); + printk(KERN_ERR "ubd: unable to get major %d\n", MAJOR_NR); return -1; } q = BLK_DEFAULT_QUEUE(MAJOR_NR); @@ -458,37 +461,37 @@ blksize_size[MAJOR_NR] = blk_sizes; blk_size[MAJOR_NR] = sizes; hardsect_size[MAJOR_NR] = hardsect_sizes; - add_gendisk(&ubd_gendisk); - if (fake_major != 0){ if(devfs_register_blkdev(fake_major, "ubd", &ubd_blops)) { - printk("ubd: unable to get major %d\n", fake_major); + printk(KERN_ERR "ubd: unable to get major %d\n", + fake_major); return -1; } blk_init_queue(BLK_DEFAULT_QUEUE(fake_major), DEVICE_REQUEST); read_ahead[fake_major] = 8; /* 8 sector (4kB) read-ahead */ blksize_size[fake_major] = blk_sizes; hardsect_size[fake_major] = hardsect_sizes; - add_gendisk(&fake_gendisk); } for(i=0;i #include #include -#include +#include "asm/types.h" #include "user_util.h" #include "kern_util.h" #include "user.h" @@ -352,8 +352,7 @@ char *buf; unsigned long len; int n, nsectors, start, end, bit; - __u64 off; - + __u64 off; nsectors = req->length / req->sectorsize; start = 0; do { diff -Naur -X exclude-files ac_cur/arch/um/include/sysdep-i386/sigcontext.h ac/arch/um/include/sysdep-i386/sigcontext.h --- ac_cur/arch/um/include/sysdep-i386/sigcontext.h Sat Nov 3 16:12:55 2001 +++ ac/arch/um/include/sysdep-i386/sigcontext.h Sat Nov 3 18:41:39 2001 @@ -12,7 +12,6 @@ #define SC_IP(sc) ((sc)->eip) #define SC_SP(sc) ((sc)->esp_at_signal) #define SEGV_IS_FIXABLE(sc) (((sc)->trapno == 14) || ((sc)->trapno == 13)) - #endif /* diff -Naur -X exclude-files ac_cur/arch/um/include/user_util.h ac/arch/um/include/user_util.h --- ac_cur/arch/um/include/user_util.h Sat Nov 3 16:14:26 2001 +++ ac/arch/um/include/user_util.h Sat Nov 3 18:41:39 2001 @@ -91,8 +91,6 @@ extern int exit_kernel(int pid, void *task); extern int get_pty(void); extern void save_signal_state(int *sig_ptr); -extern void fill_in_sigcontext(void *sc, struct sys_pt_regs *regs, - unsigned long cr2, int err); extern int activate_fd(int irq, int fd, void *dev_id); extern void reactivate_fd(int fd); extern void free_irq_fd(void *dev_id); diff -Naur -X exclude-files ac_cur/arch/um/kernel/Makefile ac/arch/um/kernel/Makefile --- ac_cur/arch/um/kernel/Makefile Sat Nov 3 16:15:32 2001 +++ ac/arch/um/kernel/Makefile Sat Nov 3 18:41:39 2001 @@ -10,6 +10,11 @@ OBJS += initrd_kern.o initrd_user.o endif +# user_syms.o not included here because Rules.make has its own ideas about +# building anything in export-objs + +USER_OBJS = $(filter %_user.o,$(OBJS)) process.o time.o umid.o user_util.o + export-objs = ksyms.o process_kern.o signal_kern.o user_syms.o UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS)) @@ -33,39 +38,9 @@ all: $(OBJ) unmap_fin.o -exec_user.o: exec_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -irq_user.o: irq_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -mem_user.o: mem_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -process.o: process.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -signal_user.o: signal_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -syscall_user.o: syscall_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -time.o: time.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -trap_user.o: trap_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -uaccess_user.o: uaccess_user.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - -umid.o: umid.c - $(CC) $(USER_CFLAGS) -c -o $@ $< +$(USER_OBJS) : %.o: %.c + $(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $< -user_util.o: user_util.c - $(CC) $(USER_CFLAGS) -c -o $@ $< - unmap.o: unmap.c echo $(UNMAP_CFLAGS) $(CC) $(UNMAP_CFLAGS) -c -o $@ $< diff -Naur -X exclude-files ac_cur/arch/um/kernel/irq.c ac/arch/um/kernel/irq.c --- ac_cur/arch/um/kernel/irq.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/kernel/irq.c Sat Nov 3 18:41:39 2001 @@ -46,7 +46,7 @@ * a generic callback i think. */ #if CONFIG_X86 - printk("unexpected IRQ trap at vector %02x\n", irq); + printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq); #ifdef CONFIG_X86_LOCAL_APIC /* * Currently unexpected vectors happen only on SMP and APIC. @@ -244,7 +244,7 @@ desc->depth--; break; case 0: - printk("enable_irq() unbalanced from %p\n", + printk(KERN_ERR "enable_irq() unbalanced from %p\n", __builtin_return_address(0)); } spin_unlock_irqrestore(&desc->lock, flags); @@ -382,7 +382,8 @@ */ if (irqflags & SA_SHIRQ) { if (!dev_id) - printk("Bad boy: %s (at 0x%x) called us without a dev_id!\n", devname, (&irq)[-1]); + printk(KERN_ERR "Bad boy: %s (at 0x%x) called us " + "without a dev_id!\n", devname, (&irq)[-1]); } #endif @@ -534,7 +535,7 @@ kfree(action); return; } - printk("Trying to free free IRQ%d\n",irq); + printk(KERN_ERR "Trying to free free IRQ%d\n",irq); spin_unlock_irqrestore(&desc->lock,flags); return; } diff -Naur -X exclude-files ac_cur/arch/um/kernel/mem.c ac/arch/um/kernel/mem.c --- ac_cur/arch/um/kernel/mem.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/kernel/mem.c Sat Nov 3 18:41:39 2001 @@ -53,7 +53,7 @@ /* this will put all low memory onto the freelists */ totalram_pages += free_all_bootmem(); - printk("Memory: %luk available\n", + printk(KERN_INFO "Memory: %luk available\n", (unsigned long) nr_free_pages() << (PAGE_SHIFT-10)); kmalloc_ok = 1; } @@ -85,7 +85,7 @@ void si_meminfo(struct sysinfo *val) { val->totalram = totalram_pages; - val->sharedram = atomic_read(&shmem_nrpages); + val->sharedram = 0; val->freeram = nr_free_pages(); val->bufferram = atomic_read(&buffermem_pages); val->totalhigh = 0; @@ -128,7 +128,7 @@ totalram_pages++; } } - + #endif int do_check_pgt_cache(int low, int high) diff -Naur -X exclude-files ac_cur/arch/um/kernel/process.c ac/arch/um/kernel/process.c --- ac_cur/arch/um/kernel/process.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/kernel/process.c Sat Nov 3 18:41:39 2001 @@ -69,7 +69,7 @@ SIGUSR1, SIGIO, -1); if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1); signal(SIGCHLD, SIG_IGN); - signal(SIGHUP, SIG_IGN); + signal(SIGHUP, SIG_IGN); set_timers(1); /* XXX A bit of a race here */ init_irq_signals(sig_stack != NULL); } diff -Naur -X exclude-files ac_cur/arch/um/kernel/process_kern.c ac/arch/um/kernel/process_kern.c --- ac_cur/arch/um/kernel/process_kern.c Sat Nov 3 16:18:22 2001 +++ ac/arch/um/kernel/process_kern.c Sat Nov 3 18:41:39 2001 @@ -4,6 +4,7 @@ */ #include "linux/config.h" +#include "linux/kernel.h" #include "linux/sched.h" #include "linux/interrupt.h" #include "linux/mm.h" @@ -175,7 +176,8 @@ usr1_pid(getpid()); extern_pid = current->thread.request.u.thread.new_pid; if(extern_pid < 0){ - printk("Kernel thread failed : errno = %d", -extern_pid); + printk(KERN_ERR "Kernel thread failed : errno = %d", + -extern_pid); return(extern_pid); } if(extern_pid_out != NULL) *extern_pid_out = extern_pid; @@ -268,8 +270,8 @@ new_pid = start_fork_tramp(p->thread.kernel_stack, stack, clone_vm, fork_tramp); if(new_pid < 0){ - printk("copy_thread : clone failed with errno = %d", - -new_pid); + printk(KERN_ERR "copy_thread : clone failed - " + "errno = %d", -new_pid); return(new_pid); } current->thread.request.op = OP_FORK; @@ -400,7 +402,7 @@ static void do_idle(void) { idle_timer(); - + while(1){ /* endless idle loop with no priority at all */ current->nice = 20; @@ -434,10 +436,11 @@ int i, pid; if(ncpus > 1){ - printk("Starting up other processors:\n"); + printk(KERN_INFO "Starting up other processors:\n"); for(i=1;ipid); + printk(KERN_ERR "Killing pid %d because of a lack of memory\n", + current->pid); lock_kernel(); sigaddset(¤t->pending.signal, SIGBUS); recalc_sigpending(current); @@ -598,7 +602,7 @@ void not_implemented(void) { - printk("Something isn't implemented in here\n"); + printk(KERN_DEBUG "Something isn't implemented in here\n"); } EXPORT_SYMBOL(not_implemented); diff -Naur -X exclude-files ac_cur/arch/um/kernel/signal_kern.c ac/arch/um/kernel/signal_kern.c --- ac_cur/arch/um/kernel/signal_kern.c Sat Nov 3 16:18:22 2001 +++ ac/arch/um/kernel/signal_kern.c Sat Nov 3 18:41:39 2001 @@ -275,7 +275,7 @@ case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: - if(do_coredump(signr, NULL)) + if (do_coredump(signr, NULL)) exit_code |= 0x80; /* FALLTHRU */ diff -Naur -X exclude-files ac_cur/arch/um/kernel/signal_user.c ac/arch/um/kernel/signal_user.c --- ac_cur/arch/um/kernel/signal_user.c Sat Nov 3 16:18:22 2001 +++ ac/arch/um/kernel/signal_user.c Sat Nov 3 18:41:39 2001 @@ -17,6 +17,7 @@ #include "signal_user.h" #include "signal_kern.h" #include "sysdep/sigcontext.h" +#include "sigcontext.h" extern int timer_on; diff -Naur -X exclude-files ac_cur/arch/um/kernel/smp.c ac/arch/um/kernel/smp.c --- ac_cur/arch/um/kernel/smp.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/kernel/smp.c Sat Nov 3 18:41:39 2001 @@ -8,7 +8,7 @@ #include "linux/config.h" #include "linux/sched.h" #include "linux/threads.h" -#include "linux/smp.h" +#include "asm/smp.h" #include "asm/processor.h" #include "asm/spinlock.h" #include "asm/softirq.h" @@ -50,7 +50,7 @@ { int cpu = smp_processor_id(); - printk("\n%s, CPU %d:\n", str, cpu); + printk(KERN_INFO "\n%s, CPU %d:\n", str, cpu); } #define MAXCOUNT 100000000 @@ -83,7 +83,7 @@ void smp_send_stop(void) { - printk("Stopping all CPUs\n"); + printk(KERN_INFO "Stopping all CPUs\n"); } void smp_commence(void) @@ -93,18 +93,20 @@ void smp_boot_cpus(void) { if(ncpus < 1){ - printk("ncpus set to 1\n"); + printk(KERN_INFO "ncpus set to 1\n"); ncpus = 1; } else if(ncpus > NR_CPUS){ - printk("ncpus can't be greater than NR_CPUS, set to %d\n", NR_CPUS); + printk(KERN_INFO + "ncpus can't be greater than NR_CPUS, set to %d\n", + NR_CPUS); ncpus = NR_CPUS; } } int setup_profiling_timer(unsigned int multiplier) { - printk("setup_profiling_timer\n"); + printk(KERN_INFO "setup_profiling_timer\n"); return(0); } diff -Naur -X exclude-files ac_cur/arch/um/kernel/syscall_user.c ac/arch/um/kernel/syscall_user.c --- ac_cur/arch/um/kernel/syscall_user.c Sat Nov 3 16:18:22 2001 +++ ac/arch/um/kernel/syscall_user.c Sat Nov 3 18:41:39 2001 @@ -136,6 +136,7 @@ ((unsigned long *) UM_IP(&proc_regs) >= &_stext) && ((unsigned long *) UM_IP(&proc_regs) <= &_etext)) tracer_panic("I'm tracing myself and I can't get out"); + regs = process_state(task); *regs = proc_regs; set_tracing(task, 0); diff -Naur -X exclude-files ac_cur/arch/um/kernel/time.c ac/arch/um/kernel/time.c --- ac_cur/arch/um/kernel/time.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/kernel/time.c Sat Nov 3 18:41:39 2001 @@ -7,7 +7,6 @@ #include #include - #include #include #include @@ -75,8 +74,8 @@ void set_timers(int set_signal) { if(set_signal){ - if(signal(SIGVTALRM, (__sighandler_t) alarm_handler) == - SIG_ERR) + if(signal(SIGVTALRM, + (__sighandler_t) alarm_handler) == SIG_ERR) panic("Couldn't set SIGVTALRM handler"); set_interval(ITIMER_VIRTUAL); } diff -Naur -X exclude-files ac_cur/arch/um/kernel/time_kern.c ac/arch/um/kernel/time_kern.c --- ac_cur/arch/um/kernel/time_kern.c Sat Nov 3 16:12:55 2001 +++ ac/arch/um/kernel/time_kern.c Sat Nov 3 18:41:39 2001 @@ -46,6 +46,8 @@ do_timer(®s); } + + void um_timer(int irq, void *dev, struct pt_regs *regs) { do_timer(regs); @@ -86,7 +88,7 @@ for(i=0;ithread.fault_addr = (void *) address; up_read(&mm->mmap_sem); do_longjmp(current->thread.fault_catcher); - } + } else if(current->thread.fault_addr != NULL){ panic("fault_addr set but no fault catcher"); } @@ -101,6 +101,7 @@ if(is_write) pte_mkdirty(*pte); } while(is_write && !pte_write(*pte)); if(is_write && !pte_write(*pte)) panic("page not writeable"); + flush_tlb_page(vma, page); up_read(&mm->mmap_sem); return(0); } @@ -266,7 +267,7 @@ void signal_usr1(int sig) { if(debugger_pid != -1){ - printk("The debugger is already running\n"); + printk(KERN_ERR "The debugger is already running\n"); return; } if(parse_chan_pair(gdb_init, 0, &gdb_chan, INIT_ONE, &opts)) return; @@ -335,7 +336,7 @@ void child_signal(pid_t pid, int status){ } int init_ptrace_proxy(int idle_pid, int startup, int stop) { - printk("debug requested when CONFIG_PT_PROXY is off\n"); + printk(KERN_ERR "debug requested when CONFIG_PT_PROXY is off\n"); wait_for_stop(idle_pid, SIGSTOP, PTRACE_CONT); ptrace(PTRACE_CONT, idle_pid, 0, 0); return(-1); @@ -343,7 +344,7 @@ void signal_usr1(int sig) { - printk("debug requested when CONFIG_PT_PROXY is off\n"); + printk(KERN_ERR "debug requested when CONFIG_PT_PROXY is off\n"); } int attach_debugger(int idle_pid, int pid, int stop) @@ -357,7 +358,7 @@ { return(-1); } - + int remove_gdb(void) { return(-1); diff -Naur -X exclude-files ac_cur/arch/um/kernel/trap_user.c ac/arch/um/kernel/trap_user.c --- ac_cur/arch/um/kernel/trap_user.c Sat Nov 3 16:18:22 2001 +++ ac/arch/um/kernel/trap_user.c Sat Nov 3 18:41:39 2001 @@ -170,7 +170,7 @@ eip = ptrace(PTRACE_PEEKUSER, pid, UM_IP_OFFSET, 0); signal_record[signal_index].addr = eip; signal_record[signal_index++].signal = sig; -#ifdef CONFIG_SMP +#ifdef CONFIG_SMP /* XXX user code can't refer to CONFIG_* */ proc_id = pid_to_processor_id(pid); task = cpu_tasks[proc_id].task; #else @@ -194,7 +194,7 @@ break; case OP_REBOOT: case OP_HALT: - kmalloc_ok = 0; + kmalloc_ok = 0; ptrace(PTRACE_KILL, pid, 0, 0); return(op == OP_REBOOT); case OP_NONE: @@ -255,7 +255,7 @@ child_signal(pid, status); continue; } - tracing = 0; + tracing = 0; break; } set_tracing(task, tracing); @@ -412,6 +412,13 @@ timer_ready = 1; } +void do_longjmp(void *p) +{ + jmp_buf *jbuf = (jmp_buf *) p; + + longjmp(*jbuf, 1); +} + static int __init uml_debug_setup(char *line, int *add) { debug = 1; @@ -429,13 +436,6 @@ " at http://user-mode-linux.sourceforge.net/ for more information.\n\n" ); -void do_longjmp(void *p) -{ - jmp_buf *jbuf = (jmp_buf *) p; - - longjmp(*jbuf, 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 diff -Naur -X exclude-files ac_cur/arch/um/kernel/um_arch.c ac/arch/um/kernel/um_arch.c --- ac_cur/arch/um/kernel/um_arch.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/kernel/um_arch.c Sat Nov 3 19:32:24 2001 @@ -18,7 +18,6 @@ #include "asm/elf.h" #include "asm/user.h" #include "asm/delay.h" -#include "asm/types.h" #include "ubd_user.h" #include "asm/current.h" #include "user_util.h" @@ -30,8 +29,6 @@ #include "initrd.h" #include "init.h" -extern __u64 file_size(char *file); - unsigned long _stext; #define DEFAULT_COMMAND_LINE "root=/dev/ubd0" @@ -241,9 +238,9 @@ brk_start = sbrk(0); remap_data(ROUND_DOWN(&__bss_start), ROUND_UP(brk_start)); - /* Start physical memory at least 4M after the current brk */ - uml_physmem = ROUND_4M(brk_start) + (1 << 22); - + /* Start physical memory at least 4M after the current brk */ + uml_physmem = ROUND_4M(brk_start) + (1 << 22); + for (i = 1; i < argc; i++){ if((i == 1) && (argv[i][0] == ' ')) continue; add = 1; @@ -285,14 +282,14 @@ bootmap_size = init_bootmem(start_pfn, end_pfn - start_pfn); free_bootmem(__pa(uml_physmem) + bootmap_size, high_physmem - uml_physmem - bootmap_size); - uml_postsetup(); + init_task.thread.kernel_stack = (unsigned long) &init_task + 2 * PAGE_SIZE; #ifndef CONFIG_SMP current = &init_task; -#endif - task_protections((unsigned long) &init_task); +#endif + task_protections((unsigned long) &init_task); sp = (void *) init_task.thread.kernel_stack + 2 * PAGE_SIZE - sizeof(unsigned long); return(signals(start_kernel_proc, sp)); diff -Naur -X exclude-files ac_cur/arch/um/kernel/user_util.c ac/arch/um/kernel/user_util.c --- ac_cur/arch/um/kernel/user_util.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/kernel/user_util.c Sat Nov 3 18:41:39 2001 @@ -14,7 +14,7 @@ #include #include #include -#include +#include "asm/types.h" #include #include #include @@ -199,7 +199,8 @@ !WIFSTOPPED(status) || (WSTOPSIG(status) != sig)){ if(ret < 0){ if(errno == EINTR) continue; - printk("wait failed, errno = %d\n", errno); + printk("wait failed, errno = %d\n", + errno); } else if(WIFEXITED(status)) printk("process exited with status %d\n", diff -Naur -X exclude-files ac_cur/arch/um/ptproxy/proxy.c ac/arch/um/ptproxy/proxy.c --- ac_cur/arch/um/ptproxy/proxy.c Sat Nov 3 16:15:32 2001 +++ ac/arch/um/ptproxy/proxy.c Sat Nov 3 18:41:39 2001 @@ -258,11 +258,11 @@ exit(1); } execlp("gdb", "gdb", "--command", tempname, prog, NULL); - printk("start_debugger : exec of gdb failed, errno = %d\n", + printk("start_debugger : exec of gdb failed, errno = %d\n", errno); } if(child < 0){ - printk("start_debugger : fork for gdb failed, errno = %d\n", + printk("start_debugger : fork for gdb failed, errno = %d\n", errno); return(-1); } diff -Naur -X exclude-files ac_cur/arch/um/ptproxy/ptrace.c ac/arch/um/ptproxy/ptrace.c --- ac_cur/arch/um/ptproxy/ptrace.c Sat Nov 3 16:17:35 2001 +++ ac/arch/um/ptproxy/ptrace.c Sat Nov 3 18:41:39 2001 @@ -195,6 +195,7 @@ debugger->result = ptrace (PTRACE_SYSCALL, child, arg3, arg4); if (debugger->result == -1) debugger->result = -errno; + break; case PTRACE_TRACEME: diff -Naur -X exclude-files ac_cur/arch/um/sys-i386/Makefile ac/arch/um/sys-i386/Makefile --- ac_cur/arch/um/sys-i386/Makefile Sat Nov 3 16:13:06 2001 +++ ac/arch/um/sys-i386/Makefile Sat Nov 3 18:41:39 2001 @@ -1,7 +1,7 @@ OBJ = sys.o OBJS = checksum.o ldt.o old-checksum.o ptrace.o ptrace_user.o semaphore.o \ - sigcontext.o syscalls.o sysrq.o + sigcontext.o syscalls.o sysrq.o export-objs = ksyms.o SYMLINKS = semaphore.c old-checksum.c checksum.S @@ -19,7 +19,7 @@ $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< ptrace_user.o: ptrace_user.c - $(CC) -D__KERNEL__ $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< + $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< checksum.S old-checksum.c: -rm -f $@