diff -u --recursive --new-file v2.1.114/linux/Documentation/VGA-softcursor.txt linux/Documentation/VGA-softcursor.txt --- v2.1.114/linux/Documentation/VGA-softcursor.txt Sun Jul 26 11:57:14 1998 +++ linux/Documentation/VGA-softcursor.txt Tue Aug 4 10:52:56 1998 @@ -3,13 +3,12 @@ Linux now has some ability to manipulate cursor appearance. Normally, you can set the size of hardware cursor (and also work around some ugly bugs in -those miserable Trident cards--see #define TRIDENT_GLITCH in drivers/char/ -vga.c). In case you enable "Software generated cursor" in the system -configuration, you can play a few new tricks: you can make your cursor look -like a non-blinking red block, make it inverse background of the character -it's over or to highlight that character and still choose whether the -original hardware cursor should remain visible or not. There may be other -things I have never thought of. +those miserable Trident cards--see #define TRIDENT_GLITCH in drivers/video/ +vgacon.c). You can now play a few new tricks: you can make your cursor look +like a non-blinking red block, make it inverse background of the character it's +over or to highlight that character and still choose whether the original +hardware cursor should remain visible or not. There may be other things I have +never thought of. The cursor appearance is controlled by a "[?1;2;3c" escape sequence where 1, 2 and 3 are parameters described below. If you omit any of them, diff -u --recursive --new-file v2.1.114/linux/Makefile linux/Makefile --- v2.1.114/linux/Makefile Mon Aug 3 17:48:26 1998 +++ linux/Makefile Tue Aug 4 00:22:45 1998 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 114 +SUBLEVEL = 115 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff -u --recursive --new-file v2.1.114/linux/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c --- v2.1.114/linux/arch/alpha/kernel/setup.c Thu Jul 16 18:09:23 1998 +++ linux/arch/alpha/kernel/setup.c Tue Aug 4 10:35:21 1998 @@ -296,7 +296,7 @@ static int alcor_indices[] = {0,0,0,1,1,1,0,0,0,0,0,0,2,2,2,2,2,2}; static char * eb64p_names[] = {"EB64+", "Cabriolet", "AlphaPCI64"}; - static int eb64p_indices[] = {0,0,1.2}; + static int eb64p_indices[] = {0,0,1,2}; static char * eb66_names[] = {"EB66", "EB66+"}; static int eb66_indices[] = {0,0,1}; diff -u --recursive --new-file v2.1.114/linux/arch/alpha/mm/init.c linux/arch/alpha/mm/init.c --- v2.1.114/linux/arch/alpha/mm/init.c Tue Jun 23 10:01:19 1998 +++ linux/arch/alpha/mm/init.c Tue Aug 4 12:58:48 1998 @@ -88,6 +88,21 @@ return (pte_t *) pmd_page(*pmd) + offset; } +int do_check_pgt_cache(int low, int high) +{ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} /* * BAD_PAGE is the page that is used for page faults when linux diff -u --recursive --new-file v2.1.114/linux/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c --- v2.1.114/linux/arch/arm/kernel/process.c Tue Jul 21 00:15:30 1998 +++ linux/arch/arm/kernel/process.c Tue Aug 4 12:58:48 1998 @@ -71,6 +71,7 @@ current->priority = -100; for (;;) { + check_pgt_cache(); #if 0 //def ARCH_IDLE_OK if (!hlt_counter && !need_resched) proc_idle (); diff -u --recursive --new-file v2.1.114/linux/arch/arm/mm/init.c linux/arch/arm/mm/init.c --- v2.1.114/linux/arch/arm/mm/init.c Fri May 8 23:14:42 1998 +++ linux/arch/arm/mm/init.c Tue Aug 4 12:58:48 1998 @@ -34,6 +34,22 @@ extern char _etext, _stext, _edata, __bss_start, _end; extern char __init_begin, __init_end; +int do_check_pgt_cache(int low, int high) +{ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} + /* * BAD_PAGE is the page that is used for page faults when linux * is out-of-memory. Older versions of linux just did a diff -u --recursive --new-file v2.1.114/linux/arch/i386/config.in linux/arch/i386/config.in --- v2.1.114/linux/arch/i386/config.in Thu Jul 16 18:09:23 1998 +++ linux/arch/i386/config.in Tue Aug 4 13:16:21 1998 @@ -146,10 +146,6 @@ comment 'Kernel hacking' #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC -bool 'Kernel profiling support' CONFIG_PROFILE -if [ "$CONFIG_PROFILE" = "y" ]; then - int ' Profile shift count' CONFIG_PROFILE_SHIFT 2 -fi bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ endmenu diff -u --recursive --new-file v2.1.114/linux/arch/i386/kernel/bios32.c linux/arch/i386/kernel/bios32.c --- v2.1.114/linux/arch/i386/kernel/bios32.c Mon Aug 3 17:48:26 1998 +++ linux/arch/i386/kernel/bios32.c Tue Aug 4 10:54:37 1998 @@ -1,7 +1,7 @@ /* * bios32.c - Low-Level PCI Access * - * $Id: bios32.c,v 1.43 1998/08/03 15:59:20 mj Exp $ + * $Id: bios32.c,v 1.44 1998/08/04 14:54:56 mj Exp $ * * Copyright 1993, 1994 Drew Eckhardt * Visionary Computing @@ -65,6 +65,12 @@ * * Jun 19, 1998 : Changed to use spinlocks, so that PCI configuration space * can be accessed from interrupts even on SMP systems. [mj] + * + * August 1998 : Better support for peer host bridges and more paranoid + * checks for direct hardware access. Ugh, this file starts to look as + * a large gallery of common hardware bug workarounds (watch the comments) + * -- the PCI specs themselves are sane, but most implementors should be + * hit hard with \hammer scaled \magstep5. [mj] */ #include @@ -331,6 +337,25 @@ pci_conf2_write_config_dword }; +/* + * Before we decide to use direct hardware access mechanisms, we try to do some + * trivial checks to ensure it at least _seems_ to be working -- we just test + * whether bus 00 contains a host bridge (this is similar to checking + * techniques used in XFree86, but ours should be more reliable since we + * attempt to make use of direct access hints provided by the PCI BIOS). + */ +__initfunc(int pci_sanity_check(struct pci_access *a)) +{ + u16 dfn, class; + + for(dfn=0; dfn < 0x100; dfn++) + if (!a->read_config_word(0, dfn, PCI_CLASS_DEVICE, &class) && + class == PCI_CLASS_BRIDGE_HOST) + return 1; + DBG("PCI: Sanity check failed\n"); + return 0; +} + __initfunc(static struct pci_access *pci_check_direct(void)) { unsigned int tmp; @@ -345,7 +370,8 @@ outb (0x01, 0xCFB); tmp = inl (0xCF8); outl (0x80000000, 0xCF8); - if (inl (0xCF8) == 0x80000000) { + if (inl (0xCF8) == 0x80000000 && + pci_sanity_check(&pci_direct_conf1)) { outl (tmp, 0xCF8); __restore_flags(flags); printk("PCI: Using configuration type 1\n"); @@ -361,7 +387,8 @@ outb (0x00, 0xCFB); outb (0x00, 0xCF8); outb (0x00, 0xCFA); - if (inb (0xCF8) == 0x00 && inb (0xCFA) == 0x00) { + if (inb (0xCF8) == 0x00 && inb (0xCFA) == 0x00 && + pci_sanity_check(&pci_direct_conf2)) { __restore_flags(flags); printk("PCI: Using configuration type 2\n"); return &pci_direct_conf2; @@ -920,6 +947,7 @@ struct pci_bus *b = &pci_root; int i; +#ifdef CONFIG_PCI_DIRECT /* * Don't search for peer host bridges if we use config type 2 * since it reads bogus values for non-existent busses and @@ -927,6 +955,7 @@ */ if (access_pci == &pci_direct_conf2) return; +#endif do { int n = b->subordinate+1; u16 l; diff -u --recursive --new-file v2.1.114/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S --- v2.1.114/linux/arch/i386/kernel/entry.S Tue Jul 21 00:15:30 1998 +++ linux/arch/i386/kernel/entry.S Mon Aug 3 23:11:17 1998 @@ -562,6 +562,8 @@ .long SYMBOL_NAME(sys_capset) /* 185 */ .long SYMBOL_NAME(sys_sigaltstack) .long SYMBOL_NAME(sys_sendfile) + .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */ + .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ .rept NR_syscalls-187 .long SYMBOL_NAME(sys_ni_syscall) diff -u --recursive --new-file v2.1.114/linux/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c --- v2.1.114/linux/arch/i386/kernel/io_apic.c Mon Aug 3 17:48:26 1998 +++ linux/arch/i386/kernel/io_apic.c Mon Aug 3 23:57:29 1998 @@ -1108,9 +1108,8 @@ /* * disable it in the 8259A: */ - cached_irq_mask |= 1 << i; if (i < 16) - set_8259A_irq_mask(i); + disable_8259A_irq(i); } } } diff -u --recursive --new-file v2.1.114/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c --- v2.1.114/linux/arch/i386/kernel/irq.c Tue Jul 21 00:15:30 1998 +++ linux/arch/i386/kernel/irq.c Tue Aug 4 10:52:50 1998 @@ -48,27 +48,23 @@ /* * About the IO-APIC, the architecture is 'merged' into our * current irq architecture, seemlessly. (i hope). It is only - * visible through 8 more hardware interrupt lines, but otherwise - * drivers are unaffected. The main code is believed to be - * NR_IRQS-safe (nothing anymore thinks we have 16 + * visible through a few more more hardware interrupt lines, but + * otherwise drivers are unaffected. The main code is believed + * to be NR_IRQS-safe (nothing anymore thinks we have 16 * irq lines only), but there might be some places left ... */ /* * This contains the irq mask for both 8259A irq controllers, - * and on SMP the extended IO-APIC IRQs 16-23. The IO-APIC - * uses this mask too, in probe_irq*(). - * - * (0x0000ffff for NR_IRQS==16, 0x00ffffff for NR_IRQS=24) */ -#if NR_IRQS == 64 -unsigned long long cached_irq_mask = -1; -#else -unsigned long long cached_irq_mask = (((unsigned long long) 1)<> 8) & 0xff) +#define cached_21 (__byte(0,cached_irq_mask)) +#define cached_A1 (__byte(1,cached_irq_mask)) spinlock_t irq_controller_lock; @@ -81,18 +77,11 @@ * this 'mixed mode' IRQ handling costs us one more branch in do_IRQ, * but we have _much_ higher compatibility and robustness this way. */ - -/* - * Default to all normal IRQ's _not_ using the IO APIC. - * - * To get IO-APIC interrupts we turn some of them into IO-APIC - * interrupts during boot. - */ unsigned long long io_apic_irqs = 0; static void do_8259A_IRQ (unsigned int irq, int cpu, struct pt_regs * regs); -static void enable_8259A_irq (unsigned int irq); -static void disable_8259A_irq (unsigned int irq); +static void enable_8259A_irq(unsigned int irq); +void disable_8259A_irq(unsigned int irq); /* * Dummy controller type for unused interrupts @@ -127,10 +116,10 @@ * These have to be protected by the irq controller spinlock * before being called. */ - -static inline void mask_8259A(unsigned int irq) +void disable_8259A_irq(unsigned int irq) { - cached_irq_mask |= 1 << irq; + unsigned int mask = 1 << irq; + cached_irq_mask |= mask; if (irq & 8) { outb(cached_A1,0xA1); } else { @@ -138,9 +127,10 @@ } } -static inline void unmask_8259A(unsigned int irq) +static void enable_8259A_irq(unsigned int irq) { - cached_irq_mask &= ~(1 << irq); + unsigned int mask = ~(1 << irq); + cached_irq_mask &= mask; if (irq & 8) { outb(cached_A1,0xA1); } else { @@ -148,21 +138,6 @@ } } -void set_8259A_irq_mask(unsigned int irq) -{ - /* - * (it might happen that we see IRQ>15 on a UP box, with SMP - * emulation) - */ - if (irq < 16) { - if (irq & 8) { - outb(cached_A1,0xA1); - } else { - outb(cached_21,0x21); - } - } -} - /* * This builds up the IRQ handler stubs using some ugly macros in irq.h * @@ -638,23 +613,7 @@ return status; } -/* - * disable/enable_irq() wait for all irq contexts to finish - * executing. Also it's recursive. - */ -static void disable_8259A_irq(unsigned int irq) -{ - cached_irq_mask |= 1 << irq; - set_8259A_irq_mask(irq); -} - -void enable_8259A_irq (unsigned int irq) -{ - cached_irq_mask &= ~(1 << irq); - set_8259A_irq_mask(irq); -} - -int i8259A_irq_pending (unsigned int irq) +int i8259A_irq_pending(unsigned int irq) { unsigned int mask = 1< high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} /* * BAD_PAGE is the page that is used for page faults when linux diff -u --recursive --new-file v2.1.114/linux/arch/m68k/mm/init.c linux/arch/m68k/mm/init.c --- v2.1.114/linux/arch/m68k/mm/init.c Mon Aug 3 12:45:44 1998 +++ linux/arch/m68k/mm/init.c Tue Aug 4 12:58:48 1998 @@ -31,6 +31,20 @@ extern void init_kpointer_table(void); extern void show_net_buffers(void); +int do_check_pgt_cache(int low, int high) +{ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pmd_quicklist) + freed += free_pmd_slow(get_pmd_fast()); + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} + /* * BAD_PAGE is the page that is used for page faults when linux * is out-of-memory. Older versions of linux just did a diff -u --recursive --new-file v2.1.114/linux/arch/m68k/mm/memory.c linux/arch/m68k/mm/memory.c --- v2.1.114/linux/arch/m68k/mm/memory.c Mon Aug 3 12:45:44 1998 +++ linux/arch/m68k/mm/memory.c Tue Aug 4 12:58:48 1998 @@ -161,7 +161,7 @@ return pmdp; } -void free_pointer_table (pmd_t *ptable) +int free_pointer_table (pmd_t *ptable) { struct ptable_desc *dp; unsigned long page = (unsigned long)ptable & PAGE_MASK; @@ -189,7 +189,7 @@ cache_page (dp->page); free_page (dp->page); kfree (dp); - return; + return 1; } else { /* * move this descriptor to the front of the list, since @@ -205,6 +205,7 @@ ptable_list.next->prev = dp; ptable_list.next = dp; restore_flags(flags); + return 0; } } diff -u --recursive --new-file v2.1.114/linux/arch/mips/mm/init.c linux/arch/mips/mm/init.c --- v2.1.114/linux/arch/mips/mm/init.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/mm/init.c Tue Aug 4 12:58:48 1998 @@ -47,6 +47,22 @@ return 0; } +int do_check_pgt_cache(int low, int high) +{ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} + /* * BAD_PAGE is the page that is used for page faults when linux * is out-of-memory. Older versions of linux just did a diff -u --recursive --new-file v2.1.114/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c --- v2.1.114/linux/arch/ppc/mm/init.c Sun Jun 7 11:16:28 1998 +++ linux/arch/ppc/mm/init.c Tue Aug 4 12:58:48 1998 @@ -148,6 +148,22 @@ return (pte_t *) pmd_page(*pmd) + offset; } +int do_check_pgt_cache(int low, int high) +{ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} + /* * BAD_PAGE is the page that is used for page faults when linux * is out-of-memory. Older versions of linux just did a diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c --- v2.1.114/linux/arch/sparc/kernel/process.c Sun Jun 7 11:16:28 1998 +++ linux/arch/sparc/kernel/process.c Tue Aug 4 12:58:48 1998 @@ -40,7 +40,6 @@ #include extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *); -extern void srmmu_check_pgt_cache(void); struct task_struct *current_set[NR_CPUS] = {&init_task, }; @@ -92,9 +91,8 @@ } } restore_flags(flags); - check_pgt_cache(); - } else - srmmu_check_pgt_cache(); + } + check_pgt_cache(); schedule(); } ret = 0; diff -u --recursive --new-file v2.1.114/linux/arch/sparc/mm/srmmu.c linux/arch/sparc/mm/srmmu.c --- v2.1.114/linux/arch/sparc/mm/srmmu.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc/mm/srmmu.c Tue Aug 4 12:58:48 1998 @@ -2722,16 +2722,12 @@ srmmu_is_bad(); } -/* Low and high watermarks for page table cache. - The system should try to have pgt_water[0] <= cache elements <= pgt_water[1] - */ -extern int pgt_cache_water[2]; - -void srmmu_check_pgt_cache(void) +static int srmmu_check_pgt_cache(int low, int high) { struct page *page, *page2; + int freed = 0; - if (pgtable_cache_size > pgt_cache_water[0]) { + if (pgtable_cache_size > high) { spin_lock(&pte_spinlock); for (page2 = NULL, page = (struct page *)pte_quicklist; page;) { if ((unsigned int)page->pprev_hash == 0xffff) { @@ -2743,11 +2739,12 @@ page->pprev_hash = NULL; pgtable_cache_size -= 16; free_page(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); + freed++; if (page2) page = page2->next_hash; else page = (struct page *)pte_quicklist; - if (pgtable_cache_size <= pgt_cache_water[1]) + if (pgtable_cache_size <= low) break; continue; } @@ -2756,7 +2753,7 @@ } spin_unlock(&pte_spinlock); } - if (pgd_cache_size > pgt_cache_water[0] / 4) { + if (pgd_cache_size > high / 4) { spin_lock(&pgd_spinlock); for (page2 = NULL, page = (struct page *)pgd_quicklist; page;) { if ((unsigned int)page->pprev_hash == 0xf) { @@ -2768,11 +2765,12 @@ page->pprev_hash = NULL; pgd_cache_size -= 4; free_page(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); + freed++; if (page2) page = page2->next_hash; else page = (struct page *)pgd_quicklist; - if (pgd_cache_size <= pgt_cache_water[1] / 4) + if (pgd_cache_size <= low / 4) break; continue; } @@ -2781,6 +2779,7 @@ } spin_unlock(&pgd_spinlock); } + return freed; } extern unsigned long spwin_mmu_patchme, fwin_mmu_patchme, @@ -2853,6 +2852,7 @@ BTFIXUPSET_CALL(get_pgd_fast, srmmu_get_pgd_fast, BTFIXUPCALL_RETINT(0)); BTFIXUPSET_CALL(free_pte_slow, srmmu_free_pte_slow, BTFIXUPCALL_NOP); BTFIXUPSET_CALL(free_pgd_slow, srmmu_free_pgd_slow, BTFIXUPCALL_NOP); + BTFIXUPSET_CALL(do_check_pgt_cache, srmmu_check_pgt_cache, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(set_pgdir, srmmu_set_pgdir, BTFIXUPCALL_NORM); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/mm/sun4c.c linux/arch/sparc/mm/sun4c.c --- v2.1.114/linux/arch/sparc/mm/sun4c.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc/mm/sun4c.c Tue Aug 4 12:58:48 1998 @@ -2536,6 +2536,22 @@ return (pgd_t *)ret; } +static int sun4c_check_pgt_cache(int low, int high) +{ + int freed = 0; + if(pgtable_cache_size > high) { + do { + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; + if(pmd_quicklist) + free_pmd_slow(get_pmd_fast()), freed++; + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } + return freed; +} + static void sun4c_set_pgdir(unsigned long address, pgd_t entry) { /* Nothing to do */ @@ -2803,6 +2819,7 @@ BTFIXUPSET_CALL(get_pgd_fast, sun4c_pgd_alloc, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(free_pte_slow, sun4c_free_pte_slow, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(free_pgd_slow, sun4c_free_pgd_slow, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(do_check_pgt_cache, sun4c_check_pgt_cache, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(set_pgdir, sun4c_set_pgdir, BTFIXUPCALL_NOP); diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/process.c linux/arch/sparc64/kernel/process.c --- v2.1.114/linux/arch/sparc64/kernel/process.c Sun Jun 7 11:16:28 1998 +++ linux/arch/sparc64/kernel/process.c Tue Aug 4 12:58:48 1998 @@ -43,45 +43,6 @@ #ifndef __SMP__ -extern int pgt_cache_water[2]; - -static inline void ultra_check_pgt_cache(void) -{ - struct page *page, *page2; - - if(pgtable_cache_size > pgt_cache_water[0]) { - do { - if(pmd_quicklist) - free_pmd_slow(get_pmd_fast()); - if(pte_quicklist) - free_pte_slow(get_pte_fast()); - } while(pgtable_cache_size > pgt_cache_water[1]); - } - if (pgd_cache_size > pgt_cache_water[0] / 4) { - for (page2 = NULL, page = (struct page *)pgd_quicklist; page;) { - if ((unsigned long)page->pprev_hash == 3) { - if (page2) - page2->next_hash = page->next_hash; - else - (struct page *)pgd_quicklist = page->next_hash; - page->next_hash = NULL; - page->pprev_hash = NULL; - pgd_cache_size -= 2; - free_page(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); - if (page2) - page = page2->next_hash; - else - page = (struct page *)pgd_quicklist; - if (pgd_cache_size <= pgt_cache_water[1] / 4) - break; - continue; - } - page2 = page; - page = page->next_hash; - } - } -} - /* * the idle loop on a Sparc... ;) */ @@ -94,7 +55,7 @@ current->priority = -100; current->counter = -100; for (;;) { - ultra_check_pgt_cache(); + check_pgt_cache(); run_task_queue(&tq_scheduler); schedule(); } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/mm/init.c linux/arch/sparc64/mm/init.c --- v2.1.114/linux/arch/sparc64/mm/init.c Sun Jun 7 11:16:28 1998 +++ linux/arch/sparc64/mm/init.c Tue Aug 4 12:58:48 1998 @@ -54,6 +54,50 @@ __bfill64((void *)pmdp, &two_null_pte_table); } +int do_check_pgt_cache(int low, int high) +{ + struct page *page, *page2; + int freed = 0; + + if(pgtable_cache_size > high) { + do { +#ifdef __SMP__ + if(pgd_quicklist) + free_pgd_slow(get_pgd_fast()), freed++; +#endif + if(pte_quicklist) + free_pte_slow(get_pte_fast()), freed++; + } while(pgtable_cache_size > low); + } +#ifndef __SMP__ + if (pgd_cache_size > high / 4) { + for (page2 = NULL, page = (struct page *)pgd_quicklist; page;) { + if ((unsigned long)page->pprev_hash == 3) { + if (page2) + page2->next_hash = page->next_hash; + else + (struct page *)pgd_quicklist = page->next_hash; + page->next_hash = NULL; + page->pprev_hash = NULL; + pgd_cache_size -= 2; + free_page(PAGE_OFFSET + (page->map_nr << PAGE_SHIFT)); + freed++; + if (page2) + page = page2->next_hash; + else + page = (struct page *)pgd_quicklist; + if (pgd_cache_size <= low / 4) + break; + continue; + } + page2 = page; + page = page->next_hash; + } + } +#endif + return freed; +} + /* * BAD_PAGE is the page that is used for page faults when linux * is out-of-memory. Older versions of linux just did a diff -u --recursive --new-file v2.1.114/linux/drivers/char/console.c linux/drivers/char/console.c --- v2.1.114/linux/drivers/char/console.c Tue Jul 28 14:21:08 1998 +++ linux/drivers/char/console.c Tue Aug 4 10:52:56 1998 @@ -92,6 +92,7 @@ #include #include #include +#include #ifdef CONFIG_APM #include #endif @@ -170,6 +171,14 @@ static struct vc_data *master_display_fg = NULL; /* + * Unfortunately, we need to delay tty echo when we're currently writing to the + * console since the code is (and always was) not re-entrant, so we insert + * all filp requests to con_task_queue instead of tq_timer and run it from + * the console_bh. + */ +DECLARE_TASK_QUEUE(con_task_queue); + +/* * Low-Level Functions */ @@ -1068,7 +1077,7 @@ tty_insert_flip_char(tty, *p, 0); p++; } - tty_schedule_flip(tty); + con_schedule_flip(tty); } static void cursor_report(int currcons, struct tty_struct * tty) @@ -1735,11 +1744,6 @@ struct vt_struct *vt = (struct vt_struct *)tty->driver_data; u16 himask, charmask; -#if CONFIG_AP1000 - ap_write(1,buf,count); - return(count); -#endif - currcons = vt->vc_num; if (!vc_cons_allocated(currcons)) { /* could this happen? */ @@ -1893,6 +1897,7 @@ */ static void console_bh(void) { + run_task_queue(&con_task_queue); if (want_console >= 0) { if (want_console != fg_console && vc_cons_allocated(want_console)) { hide_cursor(fg_console); @@ -1924,10 +1929,6 @@ ushort cnt = 0; ushort myx = x; -#if CONFIG_AP1000 - prom_printf(b); - return; -#endif if (!printable || printing) return; /* console not yet initialized */ printing = 1; @@ -1938,21 +1939,26 @@ if (!vc_cons_allocated(currcons)) { /* impossible */ printk("vt_console_print: tty %d not allocated ??\n", currcons+1); - return; + goto quit; } /* undraw cursor first */ - hide_cursor(currcons); - + if (IS_FG) + hide_cursor(currcons); + start = (ushort *)pos; /* Contrived structure to try to emulate original need_wrap behaviour * Problems caused when we have need_wrap set on '\n' character */ + disable_bh(CONSOLE_BH); while (count--) { + enable_bh(CONSOLE_BH); c = *b++; + disable_bh(CONSOLE_BH); if (c == 10 || c == 13 || c == 8 || need_wrap) { if (cnt > 0) { - sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); + if (IS_VISIBLE) + sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); x += cnt; if (need_wrap) x--; @@ -1982,15 +1988,19 @@ myx++; } if (cnt > 0) { - sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); + if (IS_VISIBLE) + sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); x += cnt; if (x == video_num_columns) { x--; need_wrap = 1; } } + enable_bh(CONSOLE_BH); set_cursor(currcons); poke_blanked_console(); + +quit: printing = 0; } @@ -2127,10 +2137,8 @@ console_num = MINOR(tty->device) - (tty->driver.minor_start); if (!vc_cons_allocated(console_num)) return; -#if !CONFIG_AP1000 set_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); -#endif } /* @@ -2144,10 +2152,8 @@ console_num = MINOR(tty->device) - (tty->driver.minor_start); if (!vc_cons_allocated(console_num)) return; -#if !CONFIG_AP1000 clr_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); -#endif } static void con_flush_chars(struct tty_struct *tty) @@ -2256,10 +2262,6 @@ if (tty_register_driver(&console_driver)) panic("Couldn't register console driver\n"); -#if CONFIG_AP1000 - return kmem_start; -#endif - timer_table[BLANK_TIMER].fn = blank_screen; timer_table[BLANK_TIMER].expires = 0; if (blankinterval) { @@ -2597,7 +2599,7 @@ /* If from KDFONTOP ioctl, don't allow things which can be done in userland, so that we can get rid of this soon */ - if (op->flags & KD_FONT_FLAG_NEW) + if (!(op->flags & KD_FONT_FLAG_OLD)) goto quit; rc = -EFAULT; for (h = 32; h > 0; h--) @@ -2640,7 +2642,7 @@ if (op->data && op->charcount > old_op.charcount) rc = -ENOSPC; - if (op->flags & KD_FONT_FLAG_NEW) { + if (!(op->flags & KD_FONT_FLAG_OLD)) { if (op->width > old_op.width || op->height > old_op.height) rc = -ENOSPC; @@ -2694,7 +2696,7 @@ u16 vcs_scr_readw(int currcons, u16 *org) { - if (org == (u16 *)pos && softcursor_original != -1) + if ((unsigned long)org == pos && softcursor_original != -1) return softcursor_original; return scr_readw(org); } @@ -2702,7 +2704,7 @@ void vcs_scr_writew(int currcons, u16 val, u16 *org) { scr_writew(val, org); - if (org == (u16 *)pos) { + if ((unsigned long)org == pos) { softcursor_original = -1; add_softcursor(currcons); } diff -u --recursive --new-file v2.1.114/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c --- v2.1.114/linux/drivers/char/keyboard.c Thu Jul 16 18:09:24 1998 +++ linux/drivers/char/keyboard.c Tue Aug 4 10:52:57 1998 @@ -19,6 +19,7 @@ * parts by Geert Uytterhoeven, May 1997 * * 27-05-97: Added support for the Magic SysRq Key (Martin Mares) + * 16-01-97: Dead-key-twice behavior now configurable (Jiri Hanika) */ #include @@ -140,7 +141,8 @@ const int NR_TYPES = SIZE(max_vals); -static void put_queue(int); +/* N.B. drivers/macintosh/mac_keyb.c needs to call put_queue */ +void put_queue(int); static unsigned char handle_diacr(unsigned char); /* kbd_pt_regs - set by keyboard_interrupt(), used by show_ptregs() */ @@ -310,12 +312,12 @@ } -static void put_queue(int ch) +void put_queue(int ch) { wake_up(&keypress_wait); if (tty) { tty_insert_flip_char(tty, ch, 0); - tty_schedule_flip(tty); + con_schedule_flip(tty); } } @@ -329,7 +331,7 @@ tty_insert_flip_char(tty, *cp, 0); cp++; } - tty_schedule_flip(tty); + con_schedule_flip(tty); } static void applkey(int key, char mode) @@ -441,7 +443,7 @@ if (!tty) return; tty_insert_flip_char(tty, 0, TTY_BREAK); - tty_schedule_flip(tty); + con_schedule_flip(tty); } static void scroll_forw(void) @@ -539,8 +541,8 @@ static unsigned char ret_diacr[NR_DEAD] = {A_GRAVE, A_ACUTE, A_CFLEX, A_TILDE, A_DIAER, A_CEDIL }; -/* If a dead key pressed twice, output a character corresponding to it, */ -/* otherwise just remember the dead key. */ +/* If a dead key pressed twice, output a character corresponding to it, */ +/* unless overriden in accent_table; otherwise just remember the dead key. */ static void do_dead(unsigned char value, char up_flag) { @@ -549,8 +551,7 @@ value = ret_diacr[value]; if (diacr == value) { /* pressed twice */ - diacr = 0; - put_queue(value); + put_queue(handle_diacr(value)); return; } diacr = value; @@ -574,7 +575,8 @@ return accent_table[i].result; } - put_queue(d); + if (ch != d) /* dead key pressed twice, put once */ + put_queue(d); return ch; } diff -u --recursive --new-file v2.1.114/linux/drivers/char/radio-aimslab.c linux/drivers/char/radio-aimslab.c --- v2.1.114/linux/drivers/char/radio-aimslab.c Tue Jul 21 00:15:31 1998 +++ linux/drivers/char/radio-aimslab.c Tue Aug 4 10:31:58 1998 @@ -155,7 +155,7 @@ /* adapted from radio-aztech.c */ - freq = (freq / 16.0) * 100; /* massage the data a little */ + freq = (freq * 100) / 16; /* massage the data a little */ freq += 1070; /* IF = 10.7 MHz */ freq /= 5; /* ref = 25 kHz */ @@ -223,8 +223,8 @@ return -EFAULT; if(v.tuner) /* Only 1 tuner */ return -EINVAL; - v.rangelow=(int)(88.0*16); - v.rangehigh=(int)(108.0*16); + v.rangelow=(88*16); + v.rangehigh=(108*16); v.flags=0; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*rt_getsigstr(rt); diff -u --recursive --new-file v2.1.114/linux/drivers/char/radio-aztech.c linux/drivers/char/radio-aztech.c --- v2.1.114/linux/drivers/char/radio-aztech.c Tue Jun 9 11:57:29 1998 +++ linux/drivers/char/radio-aztech.c Tue Aug 4 10:31:58 1998 @@ -113,7 +113,7 @@ { int i; - frequency = (frequency / 16.0) * 100; /* massage data a bit */ + frequency = (frequency * 100) / 16; /* massage data a bit */ frequency += 1070; /* tuning needs 24 data bits */ frequency /= 5; @@ -177,8 +177,8 @@ return -EFAULT; if(v.tuner) /* Only 1 tuner */ return -EINVAL; - v.rangelow=(int)(87.9*16); - v.rangehigh=(int)(107.8*16); + v.rangelow=(879*16)/10; + v.rangehigh=(1078*16)/10; v.flags=0; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*az_getsigstr(az); diff -u --recursive --new-file v2.1.114/linux/drivers/char/vt.c linux/drivers/char/vt.c --- v2.1.114/linux/drivers/char/vt.c Tue Jul 28 14:21:08 1998 +++ linux/drivers/char/vt.c Tue Aug 4 10:52:57 1998 @@ -393,7 +393,7 @@ if (!perm) return -EPERM; op.op = KD_FONT_OP_SET; - op.flags = 0; + op.flags = KD_FONT_FLAG_OLD; op.width = 8; op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; @@ -401,7 +401,7 @@ return con_font_op(fg_console, &op); case GIO_FONTX: { op.op = KD_FONT_OP_GET; - op.flags = 0; + op.flags = KD_FONT_FLAG_OLD; op.width = 8; op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; @@ -955,7 +955,7 @@ if (!perm) return -EPERM; op.op = KD_FONT_OP_SET; - op.flags = KD_FONT_FLAG_DONT_RECALC; /* Compatibility */ + op.flags = KD_FONT_FLAG_OLD | KD_FONT_FLAG_DONT_RECALC; /* Compatibility */ op.width = 8; op.height = 0; op.charcount = 256; @@ -966,7 +966,7 @@ case GIO_FONT: { struct console_font_op op; op.op = KD_FONT_OP_GET; - op.flags = 0; + op.flags = KD_FONT_FLAG_OLD; op.width = 8; op.height = 32; op.charcount = 256; @@ -1014,7 +1014,6 @@ return -EFAULT; if (!perm && op.op != KD_FONT_OP_GET) return -EPERM; - op.flags |= KD_FONT_FLAG_NEW; i = con_font_op(console, &op); if (i) return i; if (copy_to_user((void *) arg, &op, sizeof(op))) @@ -1249,14 +1248,6 @@ if (vt_cons[new_console]->vc_mode == KD_TEXT) set_palette() ; - /* FIXME: Do we still need this? */ -#ifdef CONFIG_SUN_CONSOLE - if (old_vc_mode != vt_cons[new_console]->vc_mode) - { - if (old_vc_mode == KD_GRAPHICS) - update_screen(new_console); - } -#endif /* * Wake anyone waiting for their VT to activate */ diff -u --recursive --new-file v2.1.114/linux/drivers/isdn/pcbit/pcbit.h linux/drivers/isdn/pcbit/pcbit.h --- v2.1.114/linux/drivers/isdn/pcbit/pcbit.h Tue Apr 23 02:31:35 1996 +++ linux/drivers/isdn/pcbit/pcbit.h Tue Aug 4 10:31:59 1998 @@ -98,7 +98,7 @@ }; #define STATS_TIMER (10*HZ) -#define ERRTIME (0.1*HZ) +#define ERRTIME (HZ/10) /* MRU */ #define MAXBUFSIZE 1534 diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/ibmmca.c linux/drivers/scsi/ibmmca.c --- v2.1.114/linux/drivers/scsi/ibmmca.c Sun Jul 26 11:57:16 1998 +++ linux/drivers/scsi/ibmmca.c Tue Aug 4 10:31:58 1998 @@ -2137,8 +2137,7 @@ { if (IBM_DS.total_accesses == 0) return (0); if (IBM_DS.ldn_access[ldn] == 0) return (0); -#error Floating point in kernel - shoot programmer - return((int)(((float)IBM_DS.ldn_access[ldn]/(float)IBM_DS.total_accesses)*(float)100.000)); + return (IBM_DS.ldn_access[ldn] * 100) / IBM_DS.total_accesses; } /* calculate total amount of r/w-accesses */ diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/wd7000.c linux/drivers/scsi/wd7000.c --- v2.1.114/linux/drivers/scsi/wd7000.c Wed May 20 19:10:40 1998 +++ linux/drivers/scsi/wd7000.c Tue Aug 4 10:31:58 1998 @@ -666,7 +666,7 @@ configs[wd7000_card_num].bus_on = BUS_ON; } else - configs[wd7000_card_num].bus_on = ints[4] / 125.0; + configs[wd7000_card_num].bus_on = ints[4] / 125; } else configs[wd7000_card_num].bus_on = BUS_ON; @@ -678,7 +678,7 @@ configs[wd7000_card_num].bus_off = BUS_OFF; } else - configs[wd7000_card_num].bus_off = ints[5] / 125.0; + configs[wd7000_card_num].bus_off = ints[5] / 125; } else configs[wd7000_card_num].bus_off = BUS_OFF; diff -u --recursive --new-file v2.1.114/linux/drivers/video/vgacon.c linux/drivers/video/vgacon.c --- v2.1.114/linux/drivers/video/vgacon.c Mon Aug 3 12:45:47 1998 +++ linux/drivers/video/vgacon.c Tue Aug 4 10:52:57 1998 @@ -190,6 +190,7 @@ display_desc = "*MDA"; request_region(0x3b0,12,"mda"); request_region(0x3bf, 1,"mda"); + vga_video_font_height = 16; } } else /* If not, it is color. */ @@ -256,6 +257,7 @@ vga_vram_end = 0xba000; display_desc = "*CGA"; request_region(0x3d4,2,"cga"); + vga_video_font_height = 8; } } vga_vram_base = VGA_MAP_MEM(vga_vram_base); @@ -284,11 +286,12 @@ || vga_video_type == VIDEO_TYPE_EGAM) { vga_hardscroll_enabled = vga_hardscroll_user_enable; vga_default_font_height = ORIG_VIDEO_POINTS; - vga_video_font_height = video_font_height = ORIG_VIDEO_POINTS; + vga_video_font_height = ORIG_VIDEO_POINTS; /* This may be suboptimal but is a safe bet - go with it */ video_scan_lines = - video_font_height * vga_video_num_lines; + vga_video_font_height * vga_video_num_lines; } + video_font_height = vga_video_font_height; return display_desc; } @@ -356,19 +359,15 @@ static void vgacon_invert_region(struct vc_data *c, u16 *p, int count) { - if (vga_can_do_color) { - while (count--) { - u16 a = scr_readw(p); - a = (((a) & 0x88ff) | (((a) & 0x7000) >> 4) - | (((a) & 0x0700) << 4)); - scr_writew(a, p++); - } - } else { - while (count--) { - u16 a = scr_readw(p); + int col = vga_can_do_color; + + while (count--) { + u16 a = scr_readw(p); + if (col) + a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4); + else a ^= ((a & 0x0700) == 0x0100) ? 0x7000 : 0x7700; - scr_writew(a, p++); - } + scr_writew(a, p++); } } @@ -684,7 +683,7 @@ charmap = (char *)VGA_MAP_MEM(colourmap); beg = 0x0e; #ifdef VGA_CAN_DO_64KB - if (video_type == VIDEO_TYPE_VGAC) + if (vga_video_type == VIDEO_TYPE_VGAC) beg = 0x06; #endif } else { diff -u --recursive --new-file v2.1.114/linux/fs/namei.c linux/fs/namei.c --- v2.1.114/linux/fs/namei.c Thu Jul 16 18:09:28 1998 +++ linux/fs/namei.c Mon Aug 3 14:20:09 1998 @@ -524,13 +524,19 @@ if (flag & O_CREAT) { struct dentry *dir; + error = -EEXIST; + if (dentry->d_inode && (flag & O_EXCL)) + goto exit; + dir = lock_parent(dentry); error = PTR_ERR(dir); if (IS_ERR(dir)) goto exit; + /* - * The existence test must be done _after_ getting the directory - * semaphore - the dentry might otherwise change. + * Somebody might have created the file while we + * waited for the directory lock.. So we have to + * re-do the existence test. */ if (dentry->d_inode) { error = 0; diff -u --recursive --new-file v2.1.114/linux/fs/proc/proc_tty.c linux/fs/proc/proc_tty.c --- v2.1.114/linux/fs/proc/proc_tty.c Sun Jul 26 11:57:18 1998 +++ linux/fs/proc/proc_tty.c Tue Aug 4 10:57:13 1998 @@ -80,7 +80,7 @@ break; } len += sprintf(page+len, "%-20s /dev/%-8s %3d %7s %s\n", - p->driver_name ? p->driver_name : "", + p->driver_name ? p->driver_name : "unknown", p->name, p->major, range, type); if (len+begin > off+count) break; diff -u --recursive --new-file v2.1.114/linux/include/asm-alpha/pgtable.h linux/include/asm-alpha/pgtable.h --- v2.1.114/linux/include/asm-alpha/pgtable.h Sun Jul 26 11:57:19 1998 +++ linux/include/asm-alpha/pgtable.h Tue Aug 4 12:58:47 1998 @@ -559,6 +559,8 @@ #define pte_alloc_kernel pte_alloc #define pmd_alloc_kernel pmd_alloc +extern int do_check_pgt_cache(int, int); + extern inline void set_pgdir(unsigned long address, pgd_t entry) { struct task_struct * p; diff -u --recursive --new-file v2.1.114/linux/include/asm-arm/pgtable.h linux/include/asm-arm/pgtable.h --- v2.1.114/linux/include/asm-arm/pgtable.h Tue Jan 20 16:39:42 1998 +++ linux/include/asm-arm/pgtable.h Tue Aug 4 12:58:48 1998 @@ -7,4 +7,6 @@ #define module_map vmalloc #define module_unmap vfree +extern int do_check_pgt_cache(int, int); + #endif /* _ASMARM_PGTABLE_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h --- v2.1.114/linux/include/asm-i386/pgtable.h Fri Jul 31 17:05:52 1998 +++ linux/include/asm-i386/pgtable.h Tue Aug 4 12:58:47 1998 @@ -547,6 +547,8 @@ #define pmd_free_kernel pmd_free #define pmd_alloc_kernel pmd_alloc +extern int do_check_pgt_cache(int, int); + extern inline void set_pgdir(unsigned long address, pgd_t entry) { struct task_struct * p; diff -u --recursive --new-file v2.1.114/linux/include/asm-i386/spinlock.h linux/include/asm-i386/spinlock.h --- v2.1.114/linux/include/asm-i386/spinlock.h Mon Aug 3 17:48:28 1998 +++ linux/include/asm-i386/spinlock.h Tue Aug 4 13:15:49 1998 @@ -9,9 +9,16 @@ /* * Your basic spinlocks, allowing only a single CPU anywhere + * + * Gcc-2.7.x has a nasty bug with empty initializers. */ -typedef struct { } spinlock_t; -#define SPIN_LOCK_UNLOCKED { } +#if (__GNUC__ > 2) || (__GNUC_MINOR__ >= 8) + typedef struct { } spinlock_t; + #define SPIN_LOCK_UNLOCKED { 0 } +#else + typedef struct { int gcc_is_buggy; } spinlock_t; + #define SPIN_LOCK_UNLOCKED { 0 } +#endif #define spin_lock_init(lock) do { } while(0) #define spin_lock(lock) do { } while(0) diff -u --recursive --new-file v2.1.114/linux/include/asm-i386/unistd.h linux/include/asm-i386/unistd.h --- v2.1.114/linux/include/asm-i386/unistd.h Wed Jul 1 19:38:56 1998 +++ linux/include/asm-i386/unistd.h Mon Aug 3 23:10:25 1998 @@ -193,6 +193,8 @@ #define __NR_capset 185 #define __NR_sigaltstack 186 #define __NR_sendfile 187 +#define __NR_streams1 188 /* some people actually want it */ +#define __NR_streams2 189 /* some people actually want it */ /* user-visible error numbers are in the range -1 - -122: see */ diff -u --recursive --new-file v2.1.114/linux/include/asm-m68k/pgtable.h linux/include/asm-m68k/pgtable.h --- v2.1.114/linux/include/asm-m68k/pgtable.h Mon Aug 3 12:45:47 1998 +++ linux/include/asm-m68k/pgtable.h Tue Aug 4 12:58:47 1998 @@ -621,7 +621,7 @@ extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long offset); extern pmd_t *get_pointer_table(void); -extern void free_pointer_table(pmd_t *); +extern int free_pointer_table(pmd_t *); extern pmd_t *get_kpointer_table(void); extern void free_kpointer_table(pmd_t *); @@ -671,9 +671,9 @@ quicklists.pgtable_cache_sz++; } -extern __inline__ void free_pmd_slow(pmd_t *pmd) +extern __inline__ int free_pmd_slow(pmd_t *pmd) { - free_pointer_table(pmd); + return free_pointer_table(pmd); } /* The pgd cache is folded into the pmd cache, so these are dummy routines. */ @@ -788,6 +788,8 @@ pgd = (pgd_t *)get_pointer_table(); return pgd; } + +extern int do_check_pgt_cache(int, int); extern inline void set_pgdir(unsigned long address, pgd_t entry) { diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/pgtable.h linux/include/asm-mips/pgtable.h --- v2.1.114/linux/include/asm-mips/pgtable.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/pgtable.h Tue Aug 4 12:58:47 1998 @@ -489,6 +489,8 @@ return (pgd_t *) page; } +extern int do_check_pgt_cache(int, int); + extern pgd_t swapper_pg_dir[1024]; extern void (*update_mmu_cache)(struct vm_area_struct *vma, diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/pgtable.h linux/include/asm-ppc/pgtable.h --- v2.1.114/linux/include/asm-ppc/pgtable.h Sun Jun 7 11:16:39 1998 +++ linux/include/asm-ppc/pgtable.h Tue Aug 4 12:58:48 1998 @@ -513,6 +513,8 @@ #define pmd_alloc_kernel pmd_alloc #define pte_alloc_kernel pte_alloc +extern int do_check_pgt_cache(int, int); + extern inline void set_pgdir(unsigned long address, pgd_t entry) { struct task_struct * p; diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/pgtable.h linux/include/asm-sparc/pgtable.h --- v2.1.114/linux/include/asm-sparc/pgtable.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/pgtable.h Tue Aug 4 12:58:48 1998 @@ -354,6 +354,7 @@ BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void) BTFIXUPDEF_CALL(void, free_pte_slow, pte_t *) BTFIXUPDEF_CALL(void, free_pgd_slow, pgd_t *) +BTFIXUPDEF_CALL(int, do_check_pgt_cache, int, int) #define get_pte_fast() BTFIXUP_CALL(get_pte_fast)() extern __inline__ pmd_t *get_pmd_fast(void) @@ -366,6 +367,7 @@ { } #define free_pgd_slow(pgd) BTFIXUP_CALL(free_pgd_slow)(pgd) +#define do_check_pgt_cache(low,high) BTFIXUP_CALL(do_check_pgt_cache)(low,high) /* * Allocate and free page tables. The xxx_kernel() versions are diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/pgtable.h linux/include/asm-sparc64/pgtable.h --- v2.1.114/linux/include/asm-sparc64/pgtable.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/pgtable.h Tue Aug 4 12:58:48 1998 @@ -541,6 +541,8 @@ #define pte_alloc_kernel(pmd, addr) pte_alloc(pmd, addr) #define pmd_alloc_kernel(pgd, addr) pmd_alloc(pgd, addr) +extern int do_check_pgt_cache(int, int); + extern inline void set_pgdir(unsigned long address, pgd_t entry) { /* Nothing to do on sparc64 :) */ diff -u --recursive --new-file v2.1.114/linux/include/linux/console_struct.h linux/include/linux/console_struct.h --- v2.1.114/linux/include/linux/console_struct.h Mon Aug 3 12:45:47 1998 +++ linux/include/linux/console_struct.h Tue Aug 4 10:52:56 1998 @@ -9,12 +9,6 @@ * to achieve effects such as fast scrolling by changing the origin. */ -/* - * You can set here how should the cursor look by default. - * In case you set CONFIG_SOFTCURSOR, this might be really interesting. - */ -#define CUR_DEFAULT CUR_UNDERLINE - #define NPAR 16 struct vc_data { @@ -108,3 +102,5 @@ #define CUR_BLOCK 6 #define CUR_HWMASK 0x0f #define CUR_SWMASK 0xfff0 + +#define CUR_DEFAULT CUR_UNDERLINE diff -u --recursive --new-file v2.1.114/linux/include/linux/kbd_kern.h linux/include/linux/kbd_kern.h --- v2.1.114/linux/include/linux/kbd_kern.h Fri Jul 31 17:07:03 1998 +++ linux/include/linux/kbd_kern.h Tue Aug 4 10:52:57 1998 @@ -151,4 +151,14 @@ extern unsigned int keymap_count; +/* console.c */ + +extern task_queue con_task_queue; + +extern inline void con_schedule_flip(struct tty_struct *t) +{ + queue_task(&t->flip.tqueue, &con_task_queue); + mark_bh(CONSOLE_BH); +} + #endif diff -u --recursive --new-file v2.1.114/linux/include/linux/kd.h linux/include/linux/kd.h --- v2.1.114/linux/include/linux/kd.h Mon Aug 3 12:45:47 1998 +++ linux/include/linux/kd.h Tue Aug 4 10:52:57 1998 @@ -168,10 +168,9 @@ #define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */ #define KD_FONT_OP_COPY 3 /* Copy from another console */ -#define KD_FONT_FLAG_GLOBAL 1 /* Change on _all_ consoles */ -#define KD_FONT_FLAG_DONT_RECALC 2 /* Don't recalculate hw charcell size [compat] */ +#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */ #ifdef __KERNEL__ -#define KD_FONT_FLAG_NEW 0x80000000 /* Indicate new KDFONTOP interface, which should be more strict */ +#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */ #endif /* note: 0x4B00-0x4B4E all have had a value at some time; diff -u --recursive --new-file v2.1.114/linux/include/linux/mm.h linux/include/linux/mm.h --- v2.1.114/linux/include/linux/mm.h Fri Jul 31 17:05:53 1998 +++ linux/include/linux/mm.h Tue Aug 4 12:58:47 1998 @@ -277,8 +277,10 @@ extern void vmtruncate(struct inode * inode, unsigned long offset); extern void handle_mm_fault(struct task_struct *tsk,struct vm_area_struct *vma, unsigned long address, int write_access); -extern void check_pgt_cache(void); extern void make_pages_present(unsigned long addr, unsigned long end); + +extern int pgt_cache_water[2]; +extern int check_pgt_cache(void); extern unsigned long paging_init(unsigned long start_mem, unsigned long end_mem); extern void mem_init(unsigned long start_mem, unsigned long end_mem); diff -u --recursive --new-file v2.1.114/linux/include/linux/sched.h linux/include/linux/sched.h --- v2.1.114/linux/include/linux/sched.h Mon Aug 3 17:48:28 1998 +++ linux/include/linux/sched.h Tue Aug 4 00:24:05 1998 @@ -322,16 +322,6 @@ #define DEF_PRIORITY (20*HZ/100) /* 200 ms time slices */ -/* Note: This is very ugly I admit. But some versions of gcc will - * dump core when an empty structure constant is parsed at - * the end of a large top level structure initialization. -DaveM - */ -#ifdef __SMP__ -#define INIT_LOCKS SPIN_LOCK_UNLOCKED -#else -#define INIT_LOCKS -#endif - /* * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) @@ -367,7 +357,7 @@ /* fs */ &init_fs, \ /* files */ &init_files, \ /* mm */ &init_mm, \ -/* signals */ INIT_LOCKS, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ +/* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ } union task_union { diff -u --recursive --new-file v2.1.114/linux/init/main.c linux/init/main.c --- v2.1.114/linux/init/main.c Mon Aug 3 12:45:48 1998 +++ linux/init/main.c Mon Aug 3 13:54:07 1998 @@ -1123,11 +1123,12 @@ dquot_init_hash(); #endif printk("POSIX conformance testing by UNIFIX\n"); - check_bugs(); #ifdef __SMP__ smp_init(); #endif + + check_bugs(); #if defined(CONFIG_MTRR) /* Do this after SMP initialization */ /* diff -u --recursive --new-file v2.1.114/linux/mm/memory.c linux/mm/memory.c --- v2.1.114/linux/mm/memory.c Mon Aug 3 12:45:48 1998 +++ linux/mm/memory.c Tue Aug 4 12:58:47 1998 @@ -56,6 +56,11 @@ unsigned long num_physpages = 0; void * high_memory = NULL; +/* Low and high watermarks for page table cache. + The system should try to have pgt_water[0] <= cache elements <= pgt_water[1] + */ +int pgt_cache_water[2] = { 25, 50 }; + /* * We special-case the C-O-W ZERO_PAGE, because it's such * a common occurrence (no need to read the page to know @@ -136,7 +141,8 @@ free_one_pgd(page_dir + i); /* keep the page table cache within bounds */ - check_pgt_cache(); + do_check_pgt_cache(pgtable_cache_water[0], + pgtable_cache_water[1]); return; out_bad: @@ -165,7 +171,8 @@ pgd_free(page_dir); /* keep the page table cache within bounds */ - check_pgt_cache(); + do_check_pgt_cache(pgtable_cache_water[0], + pgtable_cache_water[1]); out: return; @@ -948,21 +955,9 @@ } } -/* Low and high watermarks for page table cache. - The system should try to have pgt_water[0] <= cache elements <= pgt_water[1] - */ -int pgt_cache_water[2] = { 25, 50 }; - -void check_pgt_cache(void) +/* Returns the number of pages freed */ +int check_pgt_cache(void) { - if (pgtable_cache_size > pgt_cache_water[1]) { - do { - if (pgd_quicklist) - free_pgd_slow(get_pgd_fast()); - if (pmd_quicklist) - free_pmd_slow(get_pmd_fast()); - if (pte_quicklist) - free_pte_slow(get_pte_fast()); - } while (pgtable_cache_size > pgt_cache_water[0]); - } + return do_check_pgt_cache(pgtable_cache_water[0], + pgtable_cache_water[1]); }