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 Jun 30 11:53:23 2001 +++ ac/arch/um/drivers/chan_kern.c Sat Jun 30 12:02:12 2001 @@ -5,6 +5,7 @@ #include #include +#include #include #include "chan.h" #include "user_util.h" @@ -18,8 +19,10 @@ if(count == 0) return; n = tty_read(&chan->in, tty); if(tty) tty_flip_buffer_push(tty); - if(n > 0) chan->in.hung_up = 0; - if(n >= 0) reactivate_fd(chan->in.fd); + if(n > 0){ + chan->in.hung_up = 0; + reactivate_fd(chan->in.fd); + } } void tty_eof(void *tty_ptr, int *hung_up) @@ -36,14 +39,18 @@ struct tty_struct *tty = tty_ptr; if(tty == NULL) return; - if (tty->flip.count >= TTY_FLIPBUF_SIZE) - return; + + if (I_IXON(tty) && !I_IXOFF(tty) && !tty->raw) { + if (ch == STOP_CHAR(tty)) + stop_tty(tty); + else if (ch == START_CHAR(tty)) + start_tty(tty); + } + if((tty->flip.flag_buf_ptr == NULL) || (tty->flip.char_buf_ptr == NULL)) return; - tty->flip.count++; - *tty->flip.flag_buf_ptr++ = TTY_NORMAL; - *tty->flip.char_buf_ptr++ = ch; + tty_insert_flip_char(tty, ch, TTY_NORMAL); } static void accept_interrupt(int irq, void *dev, struct pt_regs *unused) 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 Jun 30 11:53:23 2001 +++ ac/arch/um/drivers/chan_user.c Sat Jun 30 12:02:24 2001 @@ -22,13 +22,11 @@ int tty_read(struct chan *chan, void *tty) { - int n, count = 0; + int n; char ch; - while((n = read(chan->fd, &ch, sizeof(ch))) == sizeof(ch)){ + while((n = read(chan->fd, &ch, sizeof(ch))) == sizeof(ch)) tty_receive_char(tty, ch); - count++; - } if(n < 0){ if(errno == EIO){ tty_eof(tty, &chan->hung_up); @@ -39,6 +37,7 @@ return(-1); } } + else if(n == 0) return(0); return(1); } 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 Jun 30 11:53:23 2001 +++ ac/arch/um/drivers/daemon_user.c Sat Jun 30 12:03:45 2001 @@ -96,7 +96,8 @@ return(-ENOMEM); } - if(connect(pri->control, ctl_addr, sizeof(*ctl_addr)) < 0){ + if(connect(pri->control, (struct sockaddr *) ctl_addr, + sizeof(*ctl_addr)) < 0){ printk("daemon_open : control connect failed, errno = %d\n", errno); err = -ENOTCONN; @@ -121,7 +122,7 @@ err = -ENOMEM; goto out; } - if(bind(fd, local_addr, sizeof(*local_addr)) < 0){ + if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){ printk("daemon_open : data bind failed, errno = %d\n", errno); close(fd); @@ -162,7 +163,8 @@ int n; struct sockaddr_un *data_addr = pri->data_addr; - n = sendto(fd, buf, len, 0, data_addr, sizeof(*data_addr)); + n = sendto(fd, buf, len, 0, (struct sockaddr *) data_addr, + sizeof(*data_addr)); if(n < 0){ if(errno == EAGAIN) return(0); return(-errno); 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 Jun 30 11:54:29 2001 +++ ac/arch/um/drivers/ethertap_user.c Sat Jun 30 12:03:54 2001 @@ -89,7 +89,8 @@ int fds[2]; char addr[sizeof("255.255.255.255\0")], ether[6]; - dev_ip_addr(pri->dev, addr, ðer[2]); + if((pri->gate_addr != NULL) || !pri->hw_setup) + dev_ip_addr(pri->dev, addr, ðer[2]); if(pri->gate_addr != NULL){ int uml_addr[4], tap_addr[4]; if(sscanf(addr, "%d.%d.%d.%d", ¨_addr[0], ¨_addr[1], 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 Jun 30 11:53:23 2001 +++ ac/arch/um/drivers/net_kern.c Sat Jun 30 12:04:04 2001 @@ -12,7 +12,6 @@ #include "linux/spinlock.h" #include "linux/module.h" #include "linux/init.h" -#include "linux/autoconf.h" #include "linux/etherdevice.h" #include "linux/list.h" #include "linux/inetdevice.h" 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 Jun 30 11:53:23 2001 +++ ac/arch/um/drivers/stdio_console.c Sat Jun 30 12:04:44 2001 @@ -5,6 +5,7 @@ #include "linux/posix_types.h" #include "linux/tty.h" +#include "linux/tty_flip.h" #include "linux/types.h" #include "linux/major.h" #include "linux/kdev_t.h" @@ -15,6 +16,7 @@ #include "linux/interrupt.h" #include "asm/current.h" #include "asm/softirq.h" +#include "asm/hardirq.h" #include "stdio_console.h" #include "chan.h" #include "user_util.h" @@ -96,6 +98,11 @@ { int line; + if (in_interrupt() && tty->stopped) + return 0; + while (tty->stopped) { + schedule(); + } line = MINOR(tty->device) - tty->driver.minor_start; return(write_chan(&vts[line].chan, buf, count)); } 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 Jun 30 11:53:23 2001 +++ ac/arch/um/drivers/ubd.c Sat Jun 30 12:04:59 2001 @@ -288,6 +288,7 @@ elevator_init(&q->elevator, ELEVATOR_NOOP); read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */ blksize_size[MAJOR_NR] = blk_sizes; + blk_size[MAJOR_NR] = sizes; hardsect_size[MAJOR_NR] = hardsect_sizes; ubd_gendisk.next = gendisk_head; gendisk_head = &ubd_gendisk; @@ -299,17 +300,12 @@ 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; fake_gendisk.next = gendisk_head; gendisk_head = &fake_gendisk; } for(i=0;irq_status == RQ_INACTIVE) return; if (DEVICE_INTR) return; - do { - again = 0; - INIT_REQUEST; - block = CURRENT->sector; - nsect = CURRENT->current_nr_sectors; - dev = MINOR(CURRENT->rq_dev); - if(ubd_dev[dev].is_dir){ - strcpy(CURRENT->buffer, "HOSTFS:"); - strcat(CURRENT->buffer, ubd_dev[dev].file); - end_request(1); - return; - } - req.read = (CURRENT->cmd == READ); - req.fd = ubd_dev[dev].fd; - req.offset = ((__u64) block) << 9; - req.length = nsect << 9; - req.buffer = CURRENT->buffer; - req.req = CURRENT; - if((req.offset >= ubd_dev[dev].size) && - (ubd_dev[dev].size != -1)){ - end_request(0); - again = 1; - } - } while(again); + INIT_REQUEST; + block = CURRENT->sector; + nsect = CURRENT->current_nr_sectors; + dev = MINOR(CURRENT->rq_dev); + if(ubd_dev[dev].is_dir){ + strcpy(CURRENT->buffer, "HOSTFS:"); + strcat(CURRENT->buffer, ubd_dev[dev].file); + end_request(1); + return; + } + req.read = (CURRENT->cmd == READ); + req.fd = ubd_dev[dev].fd; + req.offset = ((__u64) block) << 9; + req.length = nsect << 9; + req.buffer = CURRENT->buffer; + req.req = CURRENT; if(thread_fds[0] == -1){ do_io(&req); ubd_finish(); diff -Naur -X exclude-files ac_cur/arch/um/include/kern.h ac/arch/um/include/kern.h --- ac_cur/arch/um/include/kern.h Sat Jun 30 11:53:23 2001 +++ ac/arch/um/include/kern.h Sat Jun 30 12:05:10 2001 @@ -28,7 +28,7 @@ extern int kill(int pid, int sig); extern int getuid(void); -#endif __KERN_H__ +#endif /* * Overrides for Emacs so that we follow Linus's tabbing style. 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 Jun 30 11:53:23 2001 +++ ac/arch/um/include/sysdep-i386/sigcontext.h Sat Jun 30 12:05:52 2001 @@ -11,7 +11,7 @@ #define SC_FAULT_WRITE(sc) (((sc)->err) & 2) #define SC_IP(sc) ((sc)->eip) #define SC_SP(sc) ((sc)->esp_at_signal) -#define SEGV_IS_FIXABLE(sc) ((sc)->trapno == 14) +#define SEGV_IS_FIXABLE(sc) (((sc)->trapno == 14) || ((sc)->trapno == 13)) #endif diff -Naur -X exclude-files ac_cur/arch/um/kernel/Makefile ac/arch/um/kernel/Makefile --- ac_cur/arch/um/kernel/Makefile Sat Jun 30 11:53:23 2001 +++ ac/arch/um/kernel/Makefile Sat Jun 30 12:06:05 2001 @@ -17,14 +17,14 @@ UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS)) ifeq ($(CONFIG_MODULES), y) - DMODULES = -DCONFIG_MODULES + DMODULES = -D__CONFIG_MODULES__ endif ifeq ($(CONFIG_MODVERSIONS), y) - DMODVERSIONS = -DCONFIG_MODVERSIONS + DMODVERSIONS = -D__CONFIG_MODVERSIONS__ endif -CFLAGS_user_syms.o = -DAUTOCONF_INCLUDED $(DMODULES) $(DMODVERSIONS) -I- \ +CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES) $(DMODVERSIONS) -I- \ -I../include all: $(OBJ) unmap_fin.o diff -Naur -X exclude-files ac_cur/arch/um/kernel/irq_user.c ac/arch/um/kernel/irq_user.c --- ac_cur/arch/um/kernel/irq_user.c Sat Jun 30 11:54:55 2001 +++ ac/arch/um/kernel/irq_user.c Sat Jun 30 12:18:08 2001 @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include "user_util.h" @@ -148,7 +147,8 @@ flags = on_sigstack ? SA_ONSTACK : 0; set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, - flags | SA_NODEFER, SIGUSR1, SIGIO, SIGUSR2, -1); + flags | SA_NODEFER | SA_RESTART, SIGUSR1, SIGIO, + SIGUSR2, -1); set_handler(SIGIO, (__sighandler_t) irq_handler, flags, SIGUSR1, SIGIO, SIGUSR2, -1); } 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 Jun 30 11:54:55 2001 +++ ac/arch/um/kernel/syscall_user.c Sat Jun 30 12:06:23 2001 @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include 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 Jun 30 11:54:55 2001 +++ ac/arch/um/kernel/time.c Sat Jun 30 12:18:02 2001 @@ -52,7 +52,8 @@ { if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) panic("Couldn't unset SIGVTALRM handler"); - set_handler(SIGALRM, (__sighandler_t) alarm_handler, SA_NODEFER, + set_handler(SIGALRM, (__sighandler_t) alarm_handler, + SA_NODEFER | SA_RESTART, SIGUSR1, SIGIO, SIGUSR2, -1); set_interval(ITIMER_REAL); } 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 Jun 30 11:54:55 2001 +++ ac/arch/um/kernel/trap_user.c Sat Jun 30 12:06:32 2001 @@ -280,7 +280,7 @@ struct sigcontext_struct *context = sc; int index; - if(!SEGV_IS_FIXABLE(context)){ + if(usermode && !SEGV_IS_FIXABLE(context)){ bad_segv(SC_FAULT_ADDR(context), SC_IP(context), SC_FAULT_WRITE(context)); return; diff -Naur -X exclude-files ac_cur/arch/um/kernel/user_syms.c ac/arch/um/kernel/user_syms.c --- ac_cur/arch/um/kernel/user_syms.c Sat Jun 30 11:53:23 2001 +++ ac/arch/um/kernel/user_syms.c Sat Jun 30 12:06:47 2001 @@ -9,7 +9,7 @@ #include #include "user_util.h" -/* XXX All the CONFIG_* stuff is broken because this file can't include +/* XXX All the __CONFIG_* stuff is broken because this file can't include * config.h */ @@ -28,13 +28,13 @@ #define __MODULE_STRING_1(x) #x #define __MODULE_STRING(x) __MODULE_STRING_1(x) -#if !defined(AUTOCONF_INCLUDED) +#if !defined(__AUTOCONF_INCLUDED__) #define __EXPORT_SYMBOL(sym,str) error config_must_be_included_before_module #define EXPORT_SYMBOL(var) error config_must_be_included_before_module #define EXPORT_SYMBOL_NOVERS(var) error config_must_be_included_before_module -#elif !defined(CONFIG_MODULES) +#elif !defined(__CONFIG_MODULES__) #define __EXPORT_SYMBOL(sym,str) #define EXPORT_SYMBOL(var) @@ -49,7 +49,7 @@ __attribute__((section("__ksymtab"))) = \ { (unsigned long)&sym, __kstrtab_##sym } -#if defined(MODVERSIONS) || !defined(CONFIG_MODVERSIONS) +#if defined(__MODVERSIONS__) || !defined(__CONFIG_MODVERSIONS__) #define EXPORT_SYMBOL(var) __EXPORT_SYMBOL(var, __MODULE_STRING(var)) #else #define EXPORT_SYMBOL(var) __EXPORT_SYMBOL(var, __MODULE_STRING(__VERSIONED_SYMBOL(var))) diff -Naur -X exclude-files ac_cur/arch/um/sys-ppc/miscthings.c ac/arch/um/sys-ppc/miscthings.c --- ac_cur/arch/um/sys-ppc/miscthings.c Sat Jun 30 11:53:23 2001 +++ ac/arch/um/sys-ppc/miscthings.c Sat Jun 30 12:06:55 2001 @@ -1,5 +1,4 @@ #include "asm/uaccess.h" -#include "linux/config.h" #include "linux/threads.h" #include "linux/stddef.h" // for NULL #include "linux/elf.h" // for AT_NULL