diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mm/mm-armv.c | 2 | ||||
-rw-r--r-- | arch/i386/Kconfig | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c | 8 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | 8 | ||||
-rw-r--r-- | arch/i386/kernel/msr.c | 9 | ||||
-rw-r--r-- | arch/i386/mach-voyager/voyager_smp.c | 6 | ||||
-rw-r--r-- | arch/i386/mm/pgtable.c | 14 | ||||
-rw-r--r-- | arch/ia64/Kconfig | 5 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 1 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_mem.c | 23 | ||||
-rw-r--r-- | arch/sparc/kernel/sys_sunos.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sunos32.c | 2 | ||||
-rw-r--r-- | arch/um/Makefile-x86_64 | 7 | ||||
-rw-r--r-- | arch/um/drivers/stderr_console.c | 22 | ||||
-rw-r--r-- | arch/um/kernel/skas/mmu.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/time.c | 172 | ||||
-rw-r--r-- | arch/um/kernel/time_kern.c | 32 | ||||
-rw-r--r-- | arch/um/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/mem.c | 21 | ||||
-rw-r--r-- | arch/um/sys-i386/sys_call_table.S | 2 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscall_table.c | 6 |
21 files changed, 105 insertions, 243 deletions
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index 487d7ad..b0242c6 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -226,7 +226,7 @@ void free_pgd_slow(pgd_t *pgd) pte = pmd_page(*pmd); pmd_clear(pmd); - dec_page_state(nr_page_table_pages); + dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE); pte_lock_deinit(pte); pte_free(pte); pmd_free(pmd); diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 17184292..27d8ddd 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -176,7 +176,7 @@ endchoice config ACPI_SRAT bool default y - depends on NUMA && (X86_SUMMIT || X86_GENERICARCH) + depends on ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH) select ACPI_NUMA config HAVE_ARCH_PARSE_SRAT diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index b9358e5..567b39b 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -417,8 +417,14 @@ acpi_cpufreq_cpu_init ( goto err_free; perf = data->acpi_data; - policy->cpus = perf->shared_cpu_map; policy->shared_type = perf->shared_type; + /* + * Will let policy->cpus know about dependency only when software + * coordination is required. + */ + if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || + policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) + policy->cpus = perf->shared_cpu_map; if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) { acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS; diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index d91815e..b77f135 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c @@ -398,8 +398,14 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy) dprintk(PFX "obtaining ACPI data failed\n"); return -EIO; } - policy->cpus = p->shared_cpu_map; policy->shared_type = p->shared_type; + /* + * Will let policy->cpus know about dependency only when software + * coordination is required. + */ + if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || + policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) + policy->cpus = p->shared_cpu_map; /* verify the acpi_data */ if (p->state_count <= 1) { diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index 4eae03d..d535cdb 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c @@ -250,7 +250,9 @@ static int msr_class_device_create(int i) return err; } -static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) +#ifdef CONFIG_HOTPLUG_CPU +static int msr_class_cpu_callback(struct notifier_block *nfb, + unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -269,6 +271,7 @@ static struct notifier_block __cpuinitdata msr_class_cpu_notifier = { .notifier_call = msr_class_cpu_callback, }; +#endif static int __init msr_init(void) { @@ -291,7 +294,7 @@ static int __init msr_init(void) if (err != 0) goto out_class; } - register_cpu_notifier(&msr_class_cpu_notifier); + register_hotcpu_notifier(&msr_class_cpu_notifier); err = 0; goto out; @@ -314,7 +317,7 @@ static void __exit msr_exit(void) class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); class_destroy(msr_class); unregister_chrdev(MSR_MAJOR, "cpu/msr"); - unregister_cpu_notifier(&msr_class_cpu_notifier); + unregister_hotcpu_notifier(&msr_class_cpu_notifier); } module_init(msr_init); diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index 8a1b882..6c86575 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c @@ -1937,3 +1937,9 @@ smp_cpus_done(unsigned int max_cpus) { zap_low_mappings(); } + +void __init +smp_setup_processor_id(void) +{ + current_thread_info()->cpu = hard_smp_processor_id(); +} diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c index a5152f1..bd98768 100644 --- a/arch/i386/mm/pgtable.c +++ b/arch/i386/mm/pgtable.c @@ -29,7 +29,6 @@ void show_mem(void) struct page *page; pg_data_t *pgdat; unsigned long i; - struct page_state ps; unsigned long flags; printk(KERN_INFO "Mem-info:\n"); @@ -57,12 +56,13 @@ void show_mem(void) printk(KERN_INFO "%d pages shared\n", shared); printk(KERN_INFO "%d pages swap cached\n", cached); - get_page_state(&ps); - printk(KERN_INFO "%lu pages dirty\n", ps.nr_dirty); - printk(KERN_INFO "%lu pages writeback\n", ps.nr_writeback); - printk(KERN_INFO "%lu pages mapped\n", ps.nr_mapped); - printk(KERN_INFO "%lu pages slab\n", ps.nr_slab); - printk(KERN_INFO "%lu pages pagetables\n", ps.nr_page_table_pages); + printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY)); + printk(KERN_INFO "%lu pages writeback\n", + global_page_state(NR_WRITEBACK)); + printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED)); + printk(KERN_INFO "%lu pages slab\n", global_page_state(NR_SLAB)); + printk(KERN_INFO "%lu pages pagetables\n", + global_page_state(NR_PAGETABLE)); } /* diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index b487e22..47de9ee 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -70,6 +70,11 @@ config DMA_IS_DMA32 bool default y +config DMA_IS_NORMAL + bool + depends on IA64_SGI_SN2 + default y + choice prompt "System type" default IA64_GENERIC diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 8937318..d0f82c9 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -765,7 +765,6 @@ unsigned long nr_iowait(void) #endif /* MODULE */ EXPORT_SYMBOL_GPL(si_swapinfo); EXPORT_SYMBOL_GPL(nr_threads); -EXPORT_SYMBOL_GPL(get_full_page_state); EXPORT_SYMBOL_GPL(nr_running); EXPORT_SYMBOL_GPL(nr_iowait); //EXPORT_SYMBOL_GPL(nr_context_switches); diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c index 7165c8f..ab3b076 100644 --- a/arch/s390/appldata/appldata_mem.c +++ b/arch/s390/appldata/appldata_mem.c @@ -106,21 +106,21 @@ static void appldata_get_mem_data(void *data) * serialized through the appldata_ops_lock and can use static */ static struct sysinfo val; - static struct page_state ps; + unsigned long ev[NR_VM_EVENT_ITEMS]; struct appldata_mem_data *mem_data; mem_data = data; mem_data->sync_count_1++; - get_full_page_state(&ps); - mem_data->pgpgin = ps.pgpgin >> 1; - mem_data->pgpgout = ps.pgpgout >> 1; - mem_data->pswpin = ps.pswpin; - mem_data->pswpout = ps.pswpout; - mem_data->pgalloc = ps.pgalloc_high + ps.pgalloc_normal + - ps.pgalloc_dma; - mem_data->pgfault = ps.pgfault; - mem_data->pgmajfault = ps.pgmajfault; + all_vm_events(ev); + mem_data->pgpgin = ev[PGPGIN] >> 1; + mem_data->pgpgout = ev[PGPGOUT] >> 1; + mem_data->pswpin = ev[PSWPIN]; + mem_data->pswpout = ev[PSWPOUT]; + mem_data->pgalloc = ev[PGALLOC_HIGH] + ev[PGALLOC_NORMAL] + + ev[PGALLOC_DMA]; + mem_data->pgfault = ev[PGFAULT]; + mem_data->pgmajfault = ev[PGMAJFAULT]; si_meminfo(&val); mem_data->sharedram = val.sharedram; @@ -129,7 +129,8 @@ static void appldata_get_mem_data(void *data) mem_data->totalhigh = P2K(val.totalhigh); mem_data->freehigh = P2K(val.freehigh); mem_data->bufferram = P2K(val.bufferram); - mem_data->cached = P2K(atomic_read(&nr_pagecache) - val.bufferram); + mem_data->cached = P2K(global_page_state(NR_FILE_PAGES) + - val.bufferram); si_swapinfo(&val); mem_data->totalswap = P2K(val.totalswap); diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 288de27..aa0fb2e 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -196,7 +196,7 @@ asmlinkage int sunos_brk(unsigned long brk) * simple, it hopefully works in most obvious cases.. Easy to * fool it, but this should catch most mistakes. */ - freepages = get_page_cache_size(); + freepages = global_page_state(NR_FILE_PAGES); freepages >>= 1; freepages += nr_free_pages(); freepages += nr_swap_pages; diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index ae5b32f..87ebdf8 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -155,7 +155,7 @@ asmlinkage int sunos_brk(u32 baddr) * simple, it hopefully works in most obvious cases.. Easy to * fool it, but this should catch most mistakes. */ - freepages = get_page_cache_size(); + freepages = global_page_state(NR_FILE_PAGES); freepages >>= 1; freepages += nr_free_pages(); freepages += nr_swap_pages; diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index dfd88b6..dffd118 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 @@ -6,9 +6,11 @@ START := 0x60000000 #We #undef __x86_64__ for kernelspace, not for userspace where #it's needed for headers to work! -CFLAGS += -U__$(SUBARCH)__ -fno-builtin -USER_CFLAGS += -fno-builtin +CFLAGS += -U__$(SUBARCH)__ -fno-builtin -m64 +USER_CFLAGS += -fno-builtin -m64 CHECKFLAGS += -m64 +AFLAGS += -m64 +LDFLAGS += -m elf_x86_64 ELF_ARCH := i386:x86-64 ELF_FORMAT := elf64-x86-64 @@ -16,3 +18,4 @@ ELF_FORMAT := elf64-x86-64 # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example. LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 +LINK-y += -m64 diff --git a/arch/um/drivers/stderr_console.c b/arch/um/drivers/stderr_console.c index 429ae8e..6d2cf32 100644 --- a/arch/um/drivers/stderr_console.c +++ b/arch/um/drivers/stderr_console.c @@ -8,10 +8,7 @@ /* * Don't register by default -- as this registeres very early in the - * boot process it becomes the default console. And as this isn't a - * real tty driver init isn't able to open /dev/console then. - * - * In most cases this isn't what you want ... + * boot process it becomes the default console. */ static int use_stderr_console = 0; @@ -43,3 +40,20 @@ static int stderr_setup(char *str) return 1; } __setup("stderr=", stderr_setup); + +/* The previous behavior of not unregistering led to /dev/console being + * impossible to open. My FC5 filesystem started having init die, and the + * system panicing because of this. Unregistering causes the real + * console to become the default console, and /dev/console can then be + * opened. Making this an initcall makes this happen late enough that + * there is no added value in dumping everything to stderr, and the + * normal console is good enough to show you all available output. + */ +static int __init unregister_stderr(void) +{ + unregister_console(&stderr_console); + + return 0; +} + +__initcall(unregister_stderr); diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c index c5c9885..624ca23 100644 --- a/arch/um/kernel/skas/mmu.c +++ b/arch/um/kernel/skas/mmu.c @@ -152,7 +152,7 @@ void destroy_context_skas(struct mm_struct *mm) free_page(mmu->id.stack); pte_lock_deinit(virt_to_page(mmu->last_page_table)); pte_free_kernel((pte_t *) mmu->last_page_table); - dec_page_state(nr_page_table_pages); + dec_zone_page_state(virt_to_page(mmu->last_page_table), NR_PAGETABLE); #ifdef CONFIG_3_LEVEL_PGTABLES pmd_free((pmd_t *) mmu->last_pmd); #endif diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c deleted file mode 100644 index 8fa2ae7..0000000 --- a/arch/um/kernel/time.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <time.h> -#include <sys/time.h> -#include <signal.h> -#include <errno.h> -#include "user_util.h" -#include "kern_util.h" -#include "user.h" -#include "process.h" -#include "time_user.h" -#include "kern_constants.h" -#include "os.h" - -/* XXX This really needs to be declared and initialized in a kernel file since - * it's in <linux/time.h> - */ -extern struct timespec wall_to_monotonic; - -extern struct timeval xtime; - -struct timeval local_offset = { 0, 0 }; - -void timer(void) -{ - gettimeofday(&xtime, NULL); - timeradd(&xtime, &local_offset, &xtime); -} - -static void set_interval(int timer_type) -{ - int usec = 1000000/hz(); - struct itimerval interval = ((struct itimerval) { { 0, usec }, - { 0, usec } }); - - if(setitimer(timer_type, &interval, NULL) == -1) - panic("setitimer failed - errno = %d\n", errno); -} - -void enable_timer(void) -{ - set_interval(ITIMER_VIRTUAL); -} - -void prepare_timer(void * ptr) -{ - int usec = 1000000/hz(); - *(struct itimerval *)ptr = ((struct itimerval) { { 0, usec }, - { 0, usec }}); -} - -void disable_timer(void) -{ - struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }}); - if((setitimer(ITIMER_VIRTUAL, &disable, NULL) < 0) || - (setitimer(ITIMER_REAL, &disable, NULL) < 0)) - printk("disnable_timer - setitimer failed, errno = %d\n", - errno); - /* If there are signals already queued, after unblocking ignore them */ - set_handler(SIGALRM, SIG_IGN, 0, -1); - set_handler(SIGVTALRM, SIG_IGN, 0, -1); -} - -void switch_timers(int to_real) -{ - struct itimerval disable = ((struct itimerval) { { 0, 0 }, { 0, 0 }}); - struct itimerval enable = ((struct itimerval) { { 0, 1000000/hz() }, - { 0, 1000000/hz() }}); - int old, new; - - if(to_real){ - old = ITIMER_VIRTUAL; - new = ITIMER_REAL; - } - else { - old = ITIMER_REAL; - new = ITIMER_VIRTUAL; - } - - if((setitimer(old, &disable, NULL) < 0) || - (setitimer(new, &enable, NULL))) - printk("switch_timers - setitimer failed, errno = %d\n", - errno); -} - -void uml_idle_timer(void) -{ - if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR) - panic("Couldn't unset SIGVTALRM handler"); - - set_handler(SIGALRM, (__sighandler_t) alarm_handler, - SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1); - set_interval(ITIMER_REAL); -} - -extern void ktime_get_ts(struct timespec *ts); -#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) - -void time_init(void) -{ - struct timespec now; - - if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR) - panic("Couldn't set SIGVTALRM handler"); - set_interval(ITIMER_VIRTUAL); - - do_posix_clock_monotonic_gettime(&now); - wall_to_monotonic.tv_sec = -now.tv_sec; - wall_to_monotonic.tv_nsec = -now.tv_nsec; -} - -/* Defined in linux/ktimer.h, which can't be included here */ -#define clock_was_set() do { } while (0) - -void do_gettimeofday(struct timeval *tv) -{ - unsigned long flags; - - flags = time_lock(); - gettimeofday(tv, NULL); - timeradd(tv, &local_offset, tv); - time_unlock(flags); - clock_was_set(); -} - -int do_settimeofday(struct timespec *tv) -{ - struct timeval now; - unsigned long flags; - struct timeval tv_in; - - if ((unsigned long) tv->tv_nsec >= UM_NSEC_PER_SEC) - return -EINVAL; - - tv_in.tv_sec = tv->tv_sec; - tv_in.tv_usec = tv->tv_nsec / 1000; - - flags = time_lock(); - gettimeofday(&now, NULL); - timersub(&tv_in, &now, &local_offset); - time_unlock(flags); - - return(0); -} - -void idle_sleep(int secs) -{ - struct timespec ts; - - ts.tv_sec = secs; - ts.tv_nsec = 0; - nanosleep(&ts, NULL); -} - -/* XXX This partly duplicates init_irq_signals */ - -void user_time_init(void) -{ - set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, - SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, - SIGALRM, SIGUSR2, -1); - set_handler(SIGALRM, (__sighandler_t) alarm_handler, - SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, - SIGVTALRM, SIGUSR2, -1); - set_interval(ITIMER_VIRTUAL); -} diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 87cdbc5..820fa36 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c @@ -96,11 +96,15 @@ void time_init_kern(void) void do_boot_timer_handler(struct sigcontext * sc) { + unsigned long flags; struct pt_regs regs; CHOOSE_MODE((void) (UPT_SC(®s.regs) = sc), (void) (regs.regs.skas.is_user = 0)); + + write_seqlock_irqsave(&xtime_lock, flags); do_timer(®s); + write_sequnlock_irqrestore(&xtime_lock, flags); } static DEFINE_SPINLOCK(timer_spinlock); @@ -125,25 +129,17 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs) unsigned long long nsecs; unsigned long flags; + write_seqlock_irqsave(&xtime_lock, flags); + do_timer(regs); - write_seqlock_irqsave(&xtime_lock, flags); nsecs = get_time() + local_offset; xtime.tv_sec = nsecs / NSEC_PER_SEC; xtime.tv_nsec = nsecs - xtime.tv_sec * NSEC_PER_SEC; - write_sequnlock_irqrestore(&xtime_lock, flags); - - return(IRQ_HANDLED); -} -long um_time(int __user *tloc) -{ - long ret = get_time() / NSEC_PER_SEC; - - if((tloc != NULL) && put_user(ret, tloc)) - return -EFAULT; + write_sequnlock_irqrestore(&xtime_lock, flags); - return ret; + return IRQ_HANDLED; } void do_gettimeofday(struct timeval *tv) @@ -174,18 +170,6 @@ static inline void set_time(unsigned long long nsecs) clock_was_set(); } -long um_stime(int __user *tptr) -{ - int value; - - if (get_user(value, tptr)) - return -EFAULT; - - set_time((unsigned long long) value * NSEC_PER_SEC); - - return 0; -} - int do_settimeofday(struct timespec *tv) { set_time((unsigned long long) tv->tv_sec * NSEC_PER_SEC + tv->tv_nsec); diff --git a/arch/um/kernel/vmlinux.lds.S b/arch/um/kernel/vmlinux.lds.S index f8aeb44..72acdce 100644 --- a/arch/um/kernel/vmlinux.lds.S +++ b/arch/um/kernel/vmlinux.lds.S @@ -1,3 +1,5 @@ +/* in case the preprocessor is a 32bit one */ +#undef i386 #ifdef CONFIG_LD_SCRIPT_STATIC #include "uml.lds.S" #else diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index c6432e7..560c806 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c @@ -55,7 +55,7 @@ static void __init find_tempdir(void) */ static int next(int fd, char *buf, int size, char c) { - int n; + int n, len; char *ptr; while((ptr = strchr(buf, c)) == NULL){ @@ -69,7 +69,17 @@ static int next(int fd, char *buf, int size, char c) } ptr++; - memmove(buf, ptr, strlen(ptr) + 1); + len = strlen(ptr); + memmove(buf, ptr, len + 1); + + /* Refill the buffer so that if there's a partial string that we care + * about, it will be completed, and we can recognize it. + */ + n = read(fd, &buf[len], size - len - 1); + if(n < 0) + return -errno; + + buf[len + n] = '\0'; return 1; } @@ -200,8 +210,11 @@ int create_tmp_file(unsigned long long len) exit(1); } - if (lseek64(fd, len, SEEK_SET) < 0) { - perror("os_seek_file"); + /* Seek to len - 1 because writing a character there will + * increase the file size by one byte, to the desired length. + */ + if (lseek64(fd, len - 1, SEEK_SET) < 0) { + perror("os_seek_file"); exit(1); } diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S index 1ff6147..2497554 100644 --- a/arch/um/sys-i386/sys_call_table.S +++ b/arch/um/sys-i386/sys_call_table.S @@ -7,8 +7,6 @@ #define sys_vm86old sys_ni_syscall #define sys_vm86 sys_ni_syscall -#define sys_stime um_stime -#define sys_time um_time #define old_mmap old_mmap_i386 #include "../../i386/kernel/syscall_table.S" diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c index 67ba024..9e9ad72 100644 --- a/arch/um/sys-x86_64/syscall_table.c +++ b/arch/um/sys-x86_64/syscall_table.c @@ -19,12 +19,6 @@ /*#define sys_set_thread_area sys_ni_syscall #define sys_get_thread_area sys_ni_syscall*/ -/* For __NR_time. The x86-64 name hopefully will change from sys_time64 to - * sys_time (since the current situation is bogus). I've sent a patch to cleanup - * this. Remove below the obsoleted line. */ -#define sys_time64 um_time -#define sys_time um_time - /* On UML we call it this way ("old" means it's not mmap2) */ #define sys_mmap old_mmap /* On x86-64 sys_uname is actually sys_newuname plus a compatibility trick. |