diff options
author | jdike <jdike> | 2004-01-19 21:02:21 +0000 |
---|---|---|
committer | jdike <jdike> | 2004-01-19 21:02:21 +0000 |
commit | a70c9e4349f37ee495ef09eaf257549901b4cfd4 (patch) | |
tree | 9026c43660fe3033474c18256049fee0690268be | |
parent | 3fa26b6f9eb012c54b661351865a329819259d89 (diff) | |
download | uml-history-a70c9e4349f37ee495ef09eaf257549901b4cfd4.tar.gz |
Lots of small changes to reduce the diffs between the 2.4 and 2.6 pools.
-rw-r--r-- | arch/um/drivers/cow_kern.c | 10 | ||||
-rw-r--r-- | arch/um/drivers/cow_user.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/hostaudio_kern.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/hostaudio_user.c | 24 | ||||
-rw-r--r-- | arch/um/drivers/port_kern.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/ssl.c | 6 | ||||
-rw-r--r-- | arch/um/drivers/ubd_user.c | 13 | ||||
-rw-r--r-- | arch/um/fs/hppfs/hppfs_kern.c | 10 | ||||
-rw-r--r-- | arch/um/include/sysdep-i386/checksum.h | 3 | ||||
-rw-r--r-- | arch/um/include/sysdep-i386/frame_user.h | 28 | ||||
-rw-r--r-- | arch/um/kernel/mem.c | 4 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/um/kernel/skas/uaccess.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/skas/util/mk_ptregs.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/syscall_kern.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/syscall_user.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/tempfile.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/time_kern.c | 6 | ||||
-rw-r--r-- | arch/um/kernel/trap_kern.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/tt/process_kern.c | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/file.c | 21 | ||||
-rw-r--r-- | arch/um/os-Linux/process.c | 2 | ||||
-rw-r--r-- | arch/um/sys-i386/bugs.c | 16 | ||||
-rw-r--r-- | arch/um/util/mk_constants_kern.c | 1 |
24 files changed, 82 insertions, 83 deletions
diff --git a/arch/um/drivers/cow_kern.c b/arch/um/drivers/cow_kern.c index 413fdaf..28a30b3 100644 --- a/arch/um/drivers/cow_kern.c +++ b/arch/um/drivers/cow_kern.c @@ -30,7 +30,7 @@ struct cow { unsigned long *bitmap; unsigned long bitmap_len; int bitmap_offset; - int data_offset; + int data_offset; devfs_handle_t devfs; struct semaphore sem; struct semaphore io_sem; @@ -81,10 +81,10 @@ static int cow_ioctl(struct inode * inode, struct file * file, static int cow_revalidate(kdev_t rdev); static struct block_device_operations cow_blops = { - .open = cow_open, - .release = cow_release, - .ioctl = cow_ioctl, - .revalidate = cow_revalidate, + .open = cow_open, + .release = cow_release, + .ioctl = cow_ioctl, + .revalidate = cow_revalidate, }; /* Initialized in an initcall, and unchanged thereafter */ diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index fa36c6e..014c2c8 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c @@ -161,7 +161,7 @@ static int absolutize(char *to, int size, char *from) int write_cow_header(char *cow_file, int fd, char *backing_file, int sectorsize, int alignment, long long *size) { - struct cow_header_v3 *header; + struct cow_header_v3 *header; unsigned long modtime; int err; diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 6595eac..9f9ae27 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c @@ -5,7 +5,6 @@ #include "linux/config.h" #include "linux/module.h" -#include "linux/version.h" #include "linux/init.h" #include "linux/slab.h" #include "linux/fs.h" diff --git a/arch/um/drivers/hostaudio_user.c b/arch/um/drivers/hostaudio_user.c index f4bc8f1..4cf1f15 100644 --- a/arch/um/drivers/hostaudio_user.c +++ b/arch/um/drivers/hostaudio_user.c @@ -21,21 +21,17 @@ ssize_t hostaudio_read_user(struct hostaudio_state *state, char *buffer, printk("hostaudio: read_user called, count = %d\n", count); #endif - return(os_read_file(state->fd, buffer, count)); + return(os_read_file(state->fd, buffer, count)); } ssize_t hostaudio_write_user(struct hostaudio_state *state, const char *buffer, size_t count, loff_t *ppos) { - ssize_t ret; - #ifdef DEBUG printk("hostaudio: write_user called, count = %d\n", count); #endif - return(os_write_file(state->fd, buffer, count)); - - return(ret); + return(os_write_file(state->fd, buffer, count)); } int hostaudio_ioctl_user(struct hostaudio_state *state, unsigned int cmd, @@ -45,7 +41,7 @@ int hostaudio_ioctl_user(struct hostaudio_state *state, unsigned int cmd, printk("hostaudio: ioctl_user called, cmd = %u\n", cmd); #endif - return(os_ioctl_generic(state->fd, cmd, arg)); + return(os_ioctl_generic(state->fd, cmd, arg)); } int hostaudio_open_user(struct hostaudio_state *state, int r, int w, char *dsp) @@ -56,10 +52,10 @@ int hostaudio_open_user(struct hostaudio_state *state, int r, int w, char *dsp) state->fd = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); - if(state->fd < 0) { - printk("hostaudio_open_user failed to open '%s', err = %d\n", + if(state->fd < 0) { + printk("hostaudio_open_user failed to open '%s', err = %d\n", dsp, -state->fd); - return(state->fd); + return(state->fd); } return(0); @@ -70,10 +66,10 @@ int hostaudio_release_user(struct hostaudio_state *state) #ifdef DEBUG printk("hostaudio: release called\n"); #endif - if(state->fd >= 0){ + if(state->fd >= 0){ os_close_file(state->fd); state->fd = -1; - } + } return(0); } @@ -99,10 +95,10 @@ int hostmixer_open_mixdev_user(struct hostmixer_state *state, int r, int w, state->fd = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); - if(state->fd < 0) { + if(state->fd < 0) { printk("hostaudio_open_mixdev_user failed to open '%s', " "err = %d\n", mixer, state->fd); - return(state->fd); + return(state->fd); } return(0); diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 3940899..7161584 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -221,7 +221,7 @@ int port_wait(void *data) int fd; while(1){ - if(down_interruptible(&port->sem)) + if(down_interruptible(&port->sem)) return(-ERESTARTSYS); spin_lock(&port->lock); diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 6270713..3f02772 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c @@ -230,12 +230,6 @@ static void ssl_console_write(struct console *c, const char *string, static kdev_t ssl_console_device(struct console *c) { -#if 0 /* This is the 2.5 implementation */ -static struct tty_driver *ssl_console_device(struct console *c, int *index) - *index = c->index; - return ssl_driver; -#endif - return mk_kdev(TTY_MAJOR, c->index); } diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c index 2c549e7..8f3516b 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c @@ -13,7 +13,6 @@ #include <netinet/in.h> #include <sys/time.h> #include <sys/socket.h> -#include <string.h> #include <sys/mman.h> #include <sys/param.h> #include "asm/types.h" @@ -61,7 +60,7 @@ static int backing_file_mismatch(char *file, __u64 size, time_t mtime) int err; err = os_file_modtime(file, &modtime); - if(err < 0){ + if(err < 0){ printk("Failed to get modification time of backing file " "\"%s\", err = %d\n", file, -err); return(err); @@ -111,17 +110,17 @@ int open_ubd_file(char *file, struct openflags *openflags, __u64 size; __u32 version, align; char *backing_file; - int fd, err, sectorsize, same, mode = 0644; + int fd, err, sectorsize, same, mode = 0644; - fd = os_open_file(file, *openflags, mode); - if(fd < 0){ + fd = os_open_file(file, *openflags, mode); + if(fd < 0){ if((fd == -ENOENT) && (create_cow_out != NULL)) *create_cow_out = 1; if(!openflags->w || ((errno != EROFS) && (errno != EACCES))) return(-errno); openflags->w = 0; - fd = os_open_file(file, *openflags, mode); - if(fd < 0) + fd = os_open_file(file, *openflags, mode); + if(fd < 0) return(fd); } diff --git a/arch/um/fs/hppfs/hppfs_kern.c b/arch/um/fs/hppfs/hppfs_kern.c index 0b01612..ed093cd 100644 --- a/arch/um/fs/hppfs/hppfs_kern.c +++ b/arch/um/fs/hppfs/hppfs_kern.c @@ -160,6 +160,8 @@ static ssize_t read_proc(struct file *file, char *buf, ssize_t count, ssize_t n; read = file->f_dentry->d_inode->i_fop->read; + if(read == NULL) + return(-EOPNOTSUPP); if(!is_user) set_fs(KERNEL_DS); @@ -258,6 +260,8 @@ static ssize_t hppfs_write(struct file *file, const char *buf, size_t len, int err; write = proc_file->f_dentry->d_inode->i_fop->write; + if(write == NULL) + return(-EOPNOTSUPP); proc_file->f_pos = file->f_pos; err = (*write)(proc_file, buf, len, &proc_file->f_pos); @@ -510,6 +514,8 @@ static int hppfs_readdir(struct file *file, void *ent, filldir_t filldir) int err; readdir = proc_file->f_dentry->d_inode->i_fop->readdir; + if(readdir == NULL) + return(-EOPNOTSUPP); proc_file->f_pos = file->f_pos; err = (*readdir)(proc_file, &dirent, hppfs_filldir); @@ -568,6 +574,8 @@ static int hppfs_readlink(struct dentry *dentry, char *buffer, int buflen) return(err); readlink = proc_dentry->d_inode->i_op->readlink; + if(readlink == NULL) + return(-EOPNOTSUPP); n = (*readlink)(proc_dentry, buffer, buflen); if(proc_file.f_op->release) @@ -589,6 +597,8 @@ static int hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) return(err); follow_link = proc_dentry->d_inode->i_op->follow_link; + if(follow_link == NULL) + return(-EOPNOTSUPP); n = (*follow_link)(proc_dentry, nd); if(proc_file.f_op->release) diff --git a/arch/um/include/sysdep-i386/checksum.h b/arch/um/include/sysdep-i386/checksum.h index c77e434..545db8d 100644 --- a/arch/um/include/sysdep-i386/checksum.h +++ b/arch/um/include/sysdep-i386/checksum.h @@ -6,6 +6,7 @@ #define __UM_SYSDEP_CHECKSUM_H #include "linux/string.h" +#include "asm/uaccess.h" /* * computes the checksum of a memory block at buff, length len, @@ -60,7 +61,7 @@ unsigned int csum_partial_copy_from_user(const char *src, char *dst, /* * These are the old (and unsafe) way of doing checksums, a warning message - * will be printed if they are used and an exeption occurs. + * will be printed if they are used and an exception occurs. * * these functions should go away after some time. */ diff --git a/arch/um/include/sysdep-i386/frame_user.h b/arch/um/include/sysdep-i386/frame_user.h index b4065b2..13faf07 100644 --- a/arch/um/include/sysdep-i386/frame_user.h +++ b/arch/um/include/sysdep-i386/frame_user.h @@ -56,26 +56,26 @@ static inline void setup_arch_frame(struct arch_frame_data_raw *in, * it would have to be __builtin_frame_address(1). */ -static inline unsigned long frame_restorer(void) -{ - unsigned long *fp; - - fp = __builtin_frame_address(0); - return((unsigned long) (fp + 1)); -} +#define frame_restorer() \ +({ \ + unsigned long *fp; \ +\ + fp = __builtin_frame_address(0); \ + ((unsigned long) (fp + 1)); \ +}) /* Similarly, this returns the value of sp when the handler was first * entered. This is used to calculate the proper sp when delivering * signals. */ -static inline unsigned long frame_sp(void) -{ - unsigned long *fp; - - fp = __builtin_frame_address(0); - return((unsigned long) (fp + 1)); -} +#define frame_sp() \ +({ \ + unsigned long *fp; \ +\ + fp = __builtin_frame_address(0); \ + ((unsigned long) (fp + 1)); \ +}) #endif diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 8dd6327..c8b3851 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -81,7 +81,7 @@ void mem_init(void) start = (unsigned long) &__binary_start; if(uml_physmem != start){ map_memory(uml_physmem, __pa(uml_physmem), start - uml_physmem, - 1, 1, 0); + 1, 1, 0); } /* this will put all low memory onto the freelists */ @@ -127,7 +127,7 @@ static void __init fixrange_init(unsigned long start, unsigned long end, } } -#if CONFIG_HIGHMEM +#ifdef CONFIG_HIGHMEM pte_t *kmap_pte; pgprot_t kmap_prot; diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index de00959..97a714a 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -128,7 +128,8 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack, if(err < 0) panic("Waiting for outer trampoline failed - errno = %d", errno); if(!WIFSIGNALED(status) || (WTERMSIG(status) != SIGKILL)) - panic("outer trampoline didn't exit with SIGKILL"); + panic("outer trampoline didn't exit with SIGKILL, " + "status = %d", status); return(arg.pid); } diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c index ba1d853..0720ed5 100644 --- a/arch/um/kernel/skas/uaccess.c +++ b/arch/um/kernel/skas/uaccess.c @@ -126,7 +126,7 @@ int copy_to_user_skas(void *to, const void *from, int n) static int strncpy_chunk_from_user(unsigned long from, int len, void *arg) { - char **to_ptr = arg, *to = *to_ptr; + char **to_ptr = arg, *to = *to_ptr; int n; strncpy(to, (void *) from, len); diff --git a/arch/um/kernel/skas/util/mk_ptregs.c b/arch/um/kernel/skas/util/mk_ptregs.c index 6587910..116f74d 100644 --- a/arch/um/kernel/skas/util/mk_ptregs.c +++ b/arch/um/kernel/skas/util/mk_ptregs.c @@ -1,3 +1,4 @@ +#include <stdio.h> #include <asm/ptrace.h> #include <asm/user.h> diff --git a/arch/um/kernel/syscall_kern.c b/arch/um/kernel/syscall_kern.c index 3ba911d..cbe93cc 100644 --- a/arch/um/kernel/syscall_kern.c +++ b/arch/um/kernel/syscall_kern.c @@ -135,7 +135,7 @@ int sys_pipe(unsigned long * fildes) error = do_pipe(fd); if (!error) { - if (copy_to_user(fildes, fd, sizeof(fd))) + if (copy_to_user(fildes, fd, sizeof(fd))) error = -EFAULT; } return error; diff --git a/arch/um/kernel/syscall_user.c b/arch/um/kernel/syscall_user.c index bd5f924..3712286 100644 --- a/arch/um/kernel/syscall_user.c +++ b/arch/um/kernel/syscall_user.c @@ -19,7 +19,7 @@ struct { int record_syscall_start(int syscall) { int max, index; - + max = sizeof(syscall_record)/sizeof(syscall_record[0]); index = next_syscall_index(max); diff --git a/arch/um/kernel/tempfile.c b/arch/um/kernel/tempfile.c index 2302427..b1674bc 100644 --- a/arch/um/kernel/tempfile.c +++ b/arch/um/kernel/tempfile.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index bfc7a36..3df7611 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c @@ -45,17 +45,17 @@ void timer_irq(union uml_pt_regs *regs) { unsigned long long ticks = 0; - if(!timer_irq_inited){ + if(!timer_irq_inited){ /* This is to ensure that ticks don't pile up when * the timer handler is suspended */ first_tick = 0; return; } - + if(first_tick){ #if defined(CONFIG_UML_REAL_TIME_CLOCK) unsigned long long tsc; - /* We've had 1 tick */ + /* We've had 1 tick */ tsc = time_stamp(); delta += tsc - prev_tsc; diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index f861c53..2a45005 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c @@ -57,7 +57,7 @@ unsigned long handle_page_fault(unsigned long address, unsigned long ip, pgd = pgd_offset(mm, page); pmd = pmd_offset(pgd, page); do { - survive: + survive: switch (handle_mm_fault(mm, vma, address, is_write)) { case 1: current->min_flt++; diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c index 07b0d15..cc0ee0c 100644 --- a/arch/um/kernel/tt/process_kern.c +++ b/arch/um/kernel/tt/process_kern.c @@ -263,14 +263,12 @@ void reboot_tt(void) { current->thread.request.op = OP_REBOOT; os_usr1_process(os_getpid()); - os_kill_process(os_getpid(), 0); } void halt_tt(void) { current->thread.request.op = OP_HALT; os_usr1_process(os_getpid()); - os_kill_process(os_getpid(), 0); } void kill_off_processes_tt(void) diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 1b9924e..4083bf9 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -155,7 +155,7 @@ int os_set_slip(int fd) sencap = 0; if(ioctl(fd, SIOCSIFENCAP, &sencap) < 0){ printk("Failed to set slip encapsulation - " - "errno = %d\n", errno); + "errno = %d\n", errno); return(-errno); } @@ -167,10 +167,9 @@ int os_set_owner(int fd, int pid) if(fcntl(fd, F_SETOWN, pid) < 0){ int save_errno = errno; - if(fcntl(fd, F_GETOWN, 0) != pid){ + if(fcntl(fd, F_GETOWN, 0) != pid) return(-save_errno); - } - } + } return(0); } @@ -186,14 +185,14 @@ int os_sigio_async(int master, int slave) return(-errno); } - if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || - (fcntl(master, F_SETOWN, os_getpid()) < 0)){ - printk("fcntl F_SETFL or F_SETOWN failed, errno = %d\n", errno); + if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || + (fcntl(master, F_SETOWN, os_getpid()) < 0)){ + printk("fcntl F_SETFL or F_SETOWN failed, errno = %d\n", errno); return(-errno); } - if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0)){ - printk("fcntl F_SETFL failed, errno = %d\n", errno); + if((fcntl(slave, F_SETFL, flags | O_NONBLOCK) < 0)){ + printk("fcntl F_SETFL failed, errno = %d\n", errno); return(-errno); } @@ -410,7 +409,7 @@ int os_file_modtime(char *file, unsigned long *modtime) *modtime = buf.ust_mtime; return(0); } - + int os_get_exec_close(int fd, int* close_on_exec) { int ret; @@ -650,7 +649,7 @@ int os_lock_file(int fd, int excl) err = -errno; goto out; } - + printk("F_SETLK failed, file already locked by pid %d\n", lock.l_pid); err = save; out: diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index a4e0071..1c66ae5 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -131,7 +131,7 @@ int os_unmap_memory(void *addr, int len) int err; err = munmap(addr, len); - if(err < 0) + if(err < 0) return(-errno); return(0); } diff --git a/arch/um/sys-i386/bugs.c b/arch/um/sys-i386/bugs.c index d39750a..b453e2f 100644 --- a/arch/um/sys-i386/bugs.c +++ b/arch/um/sys-i386/bugs.c @@ -17,8 +17,8 @@ #define MAXTOKEN 64 /* Set during early boot */ -int cpu_has_cmov = 1; -int cpu_has_xmm = 0; +int host_has_cmov = 1; +int host_has_xmm = 0; static char token(int fd, char *buf, int len, char stop) { @@ -176,9 +176,9 @@ void arch_check_bugs(void) return; } if(check_cpu_flag("cmov", &have_it)) - cpu_has_cmov = have_it; + host_has_cmov = have_it; if(check_cpu_flag("xmm", &have_it)) - cpu_has_xmm = have_it; + host_has_xmm = have_it; } int arch_handle_signal(int sig, union uml_pt_regs *regs) @@ -194,18 +194,18 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs) if((*((char *) ip) != 0x0f) || ((*((char *) (ip + 1)) & 0xf0) != 0x40)) return(0); - if(cpu_has_cmov == 0) + if(host_has_cmov == 0) panic("SIGILL caused by cmov, which this processor doesn't " "implement, boot a filesystem compiled for older " "processors"); - else if(cpu_has_cmov == 1) + else if(host_has_cmov == 1) panic("SIGILL caused by cmov, which this processor claims to " "implement"); - else if(cpu_has_cmov == -1) + else if(host_has_cmov == -1) panic("SIGILL caused by cmov, couldn't tell if this processor " "implements it, boot a filesystem compiled for older " "processors"); - else panic("Bad value for cpu_has_cmov (%d)", cpu_has_cmov); + else panic("Bad value for host_has_cmov (%d)", host_has_cmov); return(0); } diff --git a/arch/um/util/mk_constants_kern.c b/arch/um/util/mk_constants_kern.c index 7e74934..bd19934 100644 --- a/arch/um/util/mk_constants_kern.c +++ b/arch/um/util/mk_constants_kern.c @@ -11,6 +11,7 @@ int main(int argc, char **argv) { print_head(); print_constant_int("UM_KERN_PAGE_SIZE", PAGE_SIZE); + print_constant_str("UM_KERN_EMERG", KERN_EMERG); print_constant_str("UM_KERN_ALERT", KERN_ALERT); print_constant_str("UM_KERN_CRIT", KERN_CRIT); |